From portal-commits at lists.jboss.org Thu Jan 31 19:02:30 2008 Content-Type: multipart/mixed; boundary="===============7090991182245010892==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9691 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Thu, 31 Jan 2008 19:02:29 -0500 Message-ID: --===============7090991182245010892== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-01-31 19:02:29 -0500 (Thu, 31 Jan 2008) New Revision: 9691 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installa= tion.xml Log: adding more content to 2.2.1.4. Datasource Configuration Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/i= nstallation.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-01-31 23:58:12 UTC (rev 9690) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-01 00:02:29 UTC (rev 9691) @@ -57,7 +57,7 @@ Getting the Binary - The binary download is available from the JBoss Portal Downloads page. Look for the JBoss Portal Binary package. Once the binary zip file is downloaded and extracted, the folde= r hierarchy will look like the following: + The binary download is available from the JBoss Portal Downloads page. Look for the JBoss Portal Binary package. Once the binary zip file has been downloaded and extracted, the= folder hierarchy will look similar to the following: @@ -92,7 +92,7 @@ - Create a new Database: this gui= de assumes that the new database will be called jbossportal. + Create a new database: this gui= de assumes that the new database will be called jbossportal. @@ -108,24 +108,22 @@ - DataSource Configuration - - The JBoss Portal download you extracted in - - contains pre-configured datasource descriptors, you can use= for most popular RDBMS under the - setup - directory. For more details about the datasource descriptor= or if your database server is not part - of the pre-built descriptors, please refer to - the dedicated wiki page. - - - - + Datasource Configuration + + The JBoss Portal binary download that was extracted in , contains pre-configured Datasource d= escriptors for the more popular databases. Datasource descriptors are provi= ded for the MySQL 4, MySQL 5, PostgreSQL, Microsoft SQL Server, and Oracle = databases, and can be found in the setup subdirectory = where the JBoss Portal binary was extracted to: + + + + + - - At this point, you should configure the one that suits y= ou best with your Database and JDBC - driver. - + Copy the Datasource descriptor that matches your database into th= e JBOSS_INSTALLATION_DIRECTORY/server/configuration<= /replaceable>/deploy/ directory, where configuratio= n is either all, default, minimal, or production. For example= , if you are using the production configuration, copy the Datasource descri= ptor into the JBOSS_INSTALLATION_DIRECTORY/server/production/depl= oy/ directory. + + + After the Datasource descriptor has been copied into the deploy directory, make sure the username, password, connection= -url, and driver-class are correct for your chosen database. Datasource des= criptor files can be deployed to test before being used in production. The = following is an example Datasource descriptor for the PostgreSQL database: + + @@ -136,11 +134,10 @@ portalpassword - ]]> - Please verify that the username, password, url, and driver-= class are correct for - your flavor of DB. You can deploy the datasource file by it= self to test, in - advance. - +]]> + + For further details about Datasource descriptors, please refer to= the JBoss JDBC Datasource wiki page. + --===============7090991182245010892==-- From portal-commits at lists.jboss.org Thu Jan 31 19:44:40 2008 Content-Type: multipart/mixed; boundary="===============1893888635868377038==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9692 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Thu, 31 Jan 2008 19:44:40 -0500 Message-ID: --===============1893888635868377038== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-01-31 19:44:39 -0500 (Thu, 31 Jan 2008) New Revision: 9692 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installa= tion.xml Log: rephrasing and adding a bit more content to 2.2.2. Deploying JBoss Portal Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/i= nstallation.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-01 00:02:29 UTC (rev 9691) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-01 00:44:39 UTC (rev 9692) @@ -2,12 +2,13 @@ Installation Depending on your needs, there are several different methods to i= nstall JBoss Portal. Pre-configured clustered versions (JBo= ss Portal Binary (Clustered)) are available from the - JBoss Portal Downloads page. Clustered versions of JBoss Port= al must be deployed in the JBOSS_INSTALLATION_DIRECT= ORY/server/all/deploy/ directory. All JBoss AS ins= tances must reference the same datasource. See for details on how to configure JBoss Portal for clustering. + JBoss Portal Downloads page. Clustered versions of JBoss Port= al must be deployed in the JBOSS_INSTALLATION_DIRECTORY/server/al= l/deploy/ directory. All JBoss AS instances must reference the s= ame datasource. See for details on how to co= nfigure JBoss Portal for clustering. JBoss Portal and JBoss AS Bundle This is the easiest and fastest way to get JBoss Portal instal= led and running. The JBoss Portal and JBoss AS bundle contains JBoss AS, JB= oss Portal, and the embedded Hypersonic SQL database. To install the JBoss = Portal and JBoss AS bundle: + @@ -21,7 +22,7 @@ - Start the server: change into = the JBOSS_INSTALLATION_DIRECTORY/bin directory. On Microsoft Windows, execute run.bat. On Linux, run the ./run.sh command. + Start the server: change into = the JBOSS_INSTALLATION_DIRECTORY/bin/ directory. On Mi= crosoft Windows, execute run.bat. On Linux, run the ./run.sh command. @@ -30,27 +31,28 @@ + SQL Errors Tables are automatically created the first time JBoss Portal starts= . When deployed for the first time, JBoss Portal checks for the existence o= f the initial tables, which have not been created yet. This causes errors s= uch as the following, which can safely be ignored: - + + ]]> Installing the Binary Download The binary package typically consists of the - jboss-portal.sar directory, documentation su= ch as the JBoss Portal User Guide and the JBoss Portal Reference Guide, and= a set of pre-configured Datasource descriptors that allow + jboss-portal.sar/ directory, documentation s= uch as the JBoss Portal User Guide and the JBoss Portal Reference Guide, an= d a set of pre-configured Datasource descriptors that allow JBoss Portal to communicate with an external database. This insta= llation method is recommended for users who already have JBoss EAP or JBoss= AS installed, or those who need to install JBoss Portal in a clustered env= ironment. Setting up your Environment @@ -89,6 +91,7 @@ To configure a database to use with JBoss Portal: + @@ -106,6 +109,7 @@ + Datasource Configuration @@ -142,39 +146,44 @@ Deploying JBoss Portal + + To start JBoss EAP or JBoss AS and deploy JBoss Portal: + - Deploy: - Copy the datasource descriptor file (*-ds.xml) you mo= dified above AND the - jboss-portal.sar - from the download folder to - JBOSS_INSTALL_DIRECTORY/server/default/depl= oy/. - - - - - Start the Server: - Go to JBOSS_INSTALL_DIRECTORY/bin and execute run.bat (run.sh, if - Linux) - - - - During the first boot (ever), SQL errors in the log, lik= e the one below, can be safely ignored. They - are thrown when the portal checks for the existence of the = initial tables, before it creates them for - you. - - - Point your browser to - http://localhost:8080/portal - , and you should see the Portal HomePage. You can now login us= ing one of the two default accounts: - user/user - or - admin/admin - . - + Datasource descriptor: if you have= not done so already, change into the setup subdirecto= ry where the JBoss Portal binary was extracted to. Copy the correct Datasou= rce descriptor file (*-ds.xml) you modified in the pre= vious steps into the JBOSS_INSTALLATION_DIRECTORY/server/configuration/deploy/ directory. + + + + + Start the server: change into the <= filename>JBOSS_INSTALLATION_DIRECTORY/bin/ directory. On Microso= ft Windows, execute run.bat. On Linux, run the = ./run.sh command. + + + + + Log in to JBoss Portal: using a Web= browser, navigate to http://localhost:8080/portal to open the JBoss Portal homepage. Log in using one of the two def= ault accounts: username user, password user<= /emphasis>, or username admin, password admi= n. + + + + + + SQL Errors + + Tables are automatically created the first time JBoss Portal starts. Wh= en deployed for the first time, JBoss Portal checks for the existence of th= e initial tables, which have not been created yet. This causes errors such = as the following, which can safely be ignored: + + + + + --===============1893888635868377038==-- From portal-commits at lists.jboss.org Thu Jan 31 19:46:10 2008 Content-Type: multipart/mixed; boundary="===============1921245270986635639==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9693 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168 and 9 other directories. Date: Thu, 31 Jan 2008 19:46:10 -0500 Message-ID: --===============1921245270986635639== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-01-31 19:46:09 -0500 (Thu, 31 Jan 2008) New Revision: 9693 Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerListenerInfo.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletURLGenerationListenerChain.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portleturl/ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portleturl/PortletURLSnapshot.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portleturl/URLGenerationListener.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portleturl/URLGenerationListener1.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portleturl/URLGenerationListener2.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portleturl/URLGenerationListenerTestCase.java modules/portlet/trunk/test/src/test/resources/jsr286/tck/portleturl-war/ modules/portlet/trunk/test/src/test/resources/jsr286/tck/portleturl-war/= WEB-INF/ modules/portlet/trunk/test/src/test/resources/jsr286/tck/portleturl-war/= WEB-INF/portlet.xml modules/portlet/trunk/test/src/test/resources/jsr286/tck/portleturl-war/= WEB-INF/web.xml Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerInfoBuilder.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerPortletApplicationInfo.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletApplicationImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletParameter.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletParameterMap.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/BaseURLImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletURLImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/ResourceURLImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletApplicationDeployment.java modules/portlet/trunk/test/src/test/build.xml modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml Log: - implemented PortletURLGenerationListener - started to write test cases for PortletURLGenerationListener Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/info/ContainerInfoBuilder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerInfoBuilder.java 2008-02-01 00:44:39 UTC (rev 9692) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerInfoBuilder.java 2008-02-01 00:46:09 UTC (rev 9693) @@ -38,6 +38,7 @@ import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData; import org.jboss.portal.portlet.impl.metadata.PublicRenderParameterMetaDat= a; +import org.jboss.portal.portlet.impl.metadata.ListenerMetaData; import org.jboss.portal.portlet.impl.metadata.filter.FilterMetaData; import org.jboss.portal.portlet.info.MetaInfo; import org.jboss.portal.portlet.LifeCyclePhase; @@ -148,6 +149,10 @@ throw new Error(e); } } + if (tmp.getListeners() =3D=3D null) + { + tmp.setListeners(new ArrayList()); + } } } = @@ -266,6 +271,7 @@ = // String defaultNamespace =3D XMLConstants.NULL_NS_URI; + List listeners =3D Collections.emptyList(); if (this.portletApplicationMD instanceof PortletApplication20MetaDat= a) { PortletApplication20MetaData tmp =3D (PortletApplication20MetaDat= a)this.portletApplicationMD; @@ -297,6 +303,16 @@ } = // + listeners =3D new ArrayList(tmp.getListene= rs().size()); + for (ListenerMetaData listenerMD : tmp.getListeners()) + { + ContainerListenerInfo listener =3D build(listenerMD); + listeners.add(listener); + } + listeners =3D Collections.unmodifiableList(listeners); + + + // // for (FilterMetaData filterMD : tmp.getFilterCollection()) // { // ContainerFilterInfo filter =3D build(filterMD); @@ -304,9 +320,17 @@ } = // - return new ContainerPortletApplicationInfo(defaultNamespace); + return new ContainerPortletApplicationInfo(defaultNamespace, listene= rs); } = + private ContainerListenerInfo build(ListenerMetaData listenerMD) + { + return new ContainerListenerInfo( + listenerMD.getListenerClass(), + listenerMD.getDisplayName(), + listenerMD.getDescription()); + } + private ContainerFilterInfo build(FilterMetaData filterMD) { Map initParameters =3D new HashMap(); Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/info/ContainerListenerInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerListenerInfo.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerListenerInfo.java 2008-02-01 00:46:09 UTC (rev 9693) @@ -0,0 +1,64 @@ +/*************************************************************************= ***** + * 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.portlet.impl.info; + +import org.jboss.portal.common.i18n.LocalizedString; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ContainerListenerInfo +{ + + /** . */ + private final String className; + + /** . */ + private final LocalizedString displayName; + + /** . */ + private final LocalizedString description; + + public ContainerListenerInfo(String className, LocalizedString displayN= ame, LocalizedString description) + { + this.className =3D className; + this.displayName =3D displayName; + this.description =3D description; + } + + public String getClassName() + { + return className; + } + + public LocalizedString getDisplayName() + { + return displayName; + } + + public LocalizedString getDescription() + { + return description; + } +} Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/info/ContainerPortletApplicationInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerPortletApplicationInfo.java 2008-02-01 00:44:39 UTC (rev 9= 692) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerPortletApplicationInfo.java 2008-02-01 00:46:09 UTC (rev 9= 693) @@ -22,6 +22,8 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.impl.info; = +import java.util.List; + /** * @author Julien Viet * @version $Revision: 630 $ @@ -32,13 +34,24 @@ /** . */ private final String defaultNamespace; = - public ContainerPortletApplicationInfo(String defaultNamespace) + /** . */ + private final List listeners; + + public ContainerPortletApplicationInfo( + String defaultNamespace, + List listeners) { this.defaultNamespace =3D defaultNamespace; + this.listeners =3D listeners; } = public String getDefaultNamespace() { return defaultNamespace; } + + public List getListeners() + { + return listeners; + } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletApplicationImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletApplicationImpl.java 2008-02-01 00:44:39 UTC (rev 9692) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletApplicationImpl.java 2008-02-01 00:46:09 UTC (rev 9693) @@ -23,18 +23,26 @@ package org.jboss.portal.portlet.impl.jsr168; = import org.jboss.portal.portlet.impl.jsr168.api.PortletContextImpl; +import org.jboss.portal.portlet.impl.jsr168.api.PortletURLGenerationListen= erChain; import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory; import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo; +import org.jboss.portal.portlet.impl.info.ContainerListenerInfo; import org.jboss.portal.portlet.metadata.JBossApplicationMetaData; import org.jboss.portal.portlet.container.PortletApplication; import org.jboss.portal.portlet.container.PortletApplicationContext; import org.jboss.portal.portlet.container.PortletContainer; +import org.apache.log4j.Logger; = import javax.portlet.PortletContext; +import javax.portlet.PortletURLGenerationListener; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.Set; +import java.util.List; +import java.util.LinkedList; +import java.util.Collections; +import java.lang.reflect.Constructor; = /** * @author Julien Viet @@ -43,6 +51,9 @@ public class PortletApplicationImpl implements PortletApplication { = + /** Logger. */ + protected final Logger log; + /** . */ protected final ContainerPortletApplicationInfo info; = @@ -67,6 +78,9 @@ /** . */ protected String version; = + /** . */ + protected PortletURLGenerationListener urlListener; + /** * Todo remove meta data reference and use info instead. * = @@ -89,6 +103,7 @@ this.portletAPIFactory =3D portletAPIFactory; this.portlets =3D new LinkedHashMap(); this.context =3D context; + this.log =3D Logger.getLogger("org.jboss.portal.portlet.application.= " + context.getContextPath().replace('.', '_')); } = public String getId() @@ -130,14 +145,63 @@ = public void start() throws Exception { - version =3D metaData.getVersion(); - portletContext =3D new PortletContextImpl(context.getServletContext(= )); + List listeners =3D Collections.emptyLi= st(); + for (ContainerListenerInfo listenerInfo : info.getListeners()) + { + String className =3D listenerInfo.getClassName(); + ClassLoader classLoader =3D context.getClassLoader(); + try + { + Class clazz =3D classLoader.loadClass(className); + if (PortletURLGenerationListener.class.isAssignableFrom(clazz)) + { + Constructor ctor =3D clazz.getConstructor(); + PortletURLGenerationListener listener =3D (PortletURLGenera= tionListener)ctor.newInstance(); + if (listeners.size() =3D=3D 0) + { + listeners =3D new LinkedList(); + } + listeners.add(listener); + } + else + { + log.info("Cannot create filter with class " + className + "= because it does not implement the PortletURLGenerationListener interface"); + } + } + catch (IllegalAccessException e) + { + log.error("Cannot create filter with class " + className + " b= ecause the class is not accessible", e); + } + catch (NoSuchMethodException e) + { + log.error("Cannot create filter with class " + className + " b= ecause it does not have an no argument constructor", e); + } + catch (ClassNotFoundException e) + { + log.error("Cannot create filter with class " + className + " b= ecause the class cannot be loaded", e); + } + catch (InstantiationException e) + { + log.error("Cannot create filter with class " + className + " b= ecause it cannot be instantiated", e); + } + catch (Error e) + { + log.error("Cannot create filter with class " + className + " b= ecause of an error", e); + } + } + + // + this.version =3D metaData.getVersion(); + this.portletContext =3D new PortletContextImpl(context.getServletCon= text()); + this.urlListener =3D listeners.size() =3D=3D 0 ? null : new PortletU= RLGenerationListenerChain(Collections.unmodifiableList(listeners)); + } = public void stop() { - version =3D null; - portletContext =3D null; + this.version =3D null; + this.portletContext =3D null; + this.urlListener =3D null; } = public String getVersion() @@ -150,6 +214,17 @@ return portletContext; } = + public T getListener(Class type) + { + if (type =3D=3D PortletURLGenerationListener.class) + { + return type.cast(urlListener); + } + + // + return null; + } + // WebApp implementation **********************************************= ********************************************** = public Set getPortletContainers() Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletParameter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletParameter.java 2008-02-01 00:44:39 UTC (rev 9692) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletParameter.java 2008-02-01 00:46:09 UTC (rev 9693) @@ -31,16 +31,14 @@ = enum Scope { - PUBLIC, PRIVATE - } = /** The entry scope. */ private final Scope scope; = /** The entry value. */ - private String[] values; + private final String[] values; = PortletParameter(Scope scope, String[] values) { @@ -57,9 +55,4 @@ { return values; } - - void setValues(String[] values) - { - this.values =3D values; - } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletParameterMap.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletParameterMap.java 2008-02-01 00:44:39 UTC (rev 9692) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletParameterMap.java 2008-02-01 00:46:09 UTC (rev 9693) @@ -58,6 +58,13 @@ this.navigationInfo =3D navigationInfo; } = + public PortletParameterMap(PortletParameterMap original) + { + this.navigationInfo =3D original.navigationInfo; + this.entries =3D new HashMap(original.entr= ies); + this.publicEntryRemovals =3D new HashSet(publicEntryRemovals= ); + } + public String getParameterValue(String name) { String[] values =3D getParameterValues(name); @@ -122,36 +129,34 @@ = private void internalPut(String name, String[] value, boolean cloneValu= e) { + if (cloneValue) + { + value =3D value.clone(); + } + // Look if we have an entry already PortletParameter entry =3D entries.get(name); = // - PortletParameter.Scope scope; if (entry =3D=3D null) { ParameterInfo parameterInfo =3D navigationInfo.getPublicParameter= (name); - scope =3D parameterInfo =3D=3D null ? PortletParameter.Scope.PRIV= ATE : PortletParameter.Scope.PUBLIC; - } - else - { - scope =3D entry.getScope(); - } = - // - if (cloneValue) - { - value =3D value.clone(); - } + // + PortletParameter.Scope scope =3D parameterInfo =3D=3D null ? Port= letParameter.Scope.PRIVATE : PortletParameter.Scope.PUBLIC; = - // - if (entry =3D=3D null) - { - publicEntryRemovals.remove(name); + // + if (scope =3D=3D PortletParameter.Scope.PUBLIC) + { + publicEntryRemovals.remove(name); + } + + // entries.put(name, new PortletParameter(scope, value)); } else { - entry.setValues(value); + entries.put(name, new PortletParameter(entry.getScope(), value)); } } = Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/BaseURLImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/BaseURLImpl.java 2008-02-01 00:44:39 UTC (rev 9692) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/BaseURLImpl.java 2008-02-01 00:46:09 UTC (rev 9693) @@ -24,11 +24,12 @@ = import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.spi.PortletInvocationContext; -import org.jboss.portal.portlet.impl.jsr168.PortletParameterMap; +import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl; import org.jboss.portal.common.NotYetImplemented; = import javax.portlet.BaseURL; import javax.portlet.PortletSecurityException; +import javax.portlet.PortletURLGenerationListener; import java.util.Map; import java.io.Writer; import java.io.IOException; @@ -47,31 +48,44 @@ protected final PortletRequestImpl preq; = /** . */ - protected final InternalContainerURL url; + protected Boolean secure; = /** . */ - protected Boolean secure; + protected final boolean filterable; = - protected BaseURLImpl(PortletInvocation invocation, PortletRequestImpl = preq, InternalContainerURL url) + protected BaseURLImpl( + PortletInvocation invocation, + PortletRequestImpl preq, + boolean filterable) { this.inv =3D invocation; this.preq =3D preq; - this.url =3D url; + this.filterable =3D filterable; } = + protected BaseURLImpl(BaseURLImpl original) + { + this.inv =3D original.inv; + this.preq =3D original.preq; + this.filterable =3D false; + } + /** @throws IllegalArgumentException if the name is null */ public void setParameter(String name, String value) { + InternalContainerURL url =3D getContainerURL(); url.setParameter(name, value); } = public void setParameter(String name, String[] values) { + InternalContainerURL url =3D getContainerURL(); url.setParameter(name, values); } = public void setParameters(Map parameters) { + InternalContainerURL url =3D getContainerURL(); url.setParameters(parameters); } = @@ -82,7 +96,8 @@ = public Map getParameterMap() { - throw new NotYetImplemented(); + InternalContainerURL url =3D getContainerURL(); + return url.getParameters(); } = public void write(Writer writer) throws IOException @@ -107,10 +122,33 @@ = public String toString() { + PortletURLGenerationListener listener =3D ((PortletApplicationImpl)p= req.container.getApplication()).getListener(PortletURLGenerationListener.cl= ass); + + // + InternalContainerURL url; + if (listener !=3D null) + { + // Create a safe clone + BaseURLImpl clone =3D createClone(); + clone.filter(listener); + url =3D clone.getContainerURL(); + } + else + { + url =3D getContainerURL(); + } + + // PortletInvocationContext responseContext =3D inv.getContext(); return responseContext.renderURL(url, secure, null, true); } = + protected abstract void filter(PortletURLGenerationListener listener); + + protected abstract BaseURLImpl createClone(); + + protected abstract InternalContainerURL getContainerURL(); + protected static abstract class InternalContainerURL implements org.jbo= ss.portal.portlet.ContainerURL { = @@ -120,5 +158,8 @@ = protected abstract void setParameters(Map paramete= rs); = + protected abstract Map getParameters(); + } + } Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/jsr168/api/PortletURLGenerationListenerChain.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletURLGenerationListenerChain.java = (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletURLGenerationListenerChain.java 2008-02-01 00:46:09 UT= C (rev 9693) @@ -0,0 +1,91 @@ +/*************************************************************************= ***** + * 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.portlet.impl.jsr168.api; + +import javax.portlet.PortletURLGenerationListener; +import javax.portlet.PortletURL; +import javax.portlet.ResourceURL; +import java.util.List; + +/** + * An implementation of the API that chains. + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletURLGenerationListenerChain implements PortletURLGenera= tionListener +{ + + /** . */ + private PortletURLGenerationListener[] listeners; + + public PortletURLGenerationListenerChain(List listeners) + { + this.listeners =3D listeners.toArray(new PortletURLGenerationListene= r[listeners.size()]); + } + + public void filterActionURL(PortletURL portletURL) + { + for (PortletURLGenerationListener listener : listeners) + { + try + { + listener.filterActionURL(portletURL); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + + public void filterRenderURL(PortletURL portletURL) + { + for (PortletURLGenerationListener listener : listeners) + { + try + { + listener.filterRenderURL(portletURL); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + + public void filterResourceURL(ResourceURL resourceURL) + { + for (PortletURLGenerationListener listener : listeners) + { + try + { + listener.filterResourceURL(resourceURL); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } +} Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/PortletURLImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletURLImpl.java 2008-02-01 00:44:39 UTC (rev 9692) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletURLImpl.java 2008-02-01 00:46:09 UTC (rev 9693) @@ -23,6 +23,7 @@ package org.jboss.portal.portlet.impl.jsr168.api; = import org.jboss.portal.common.NotYetImplemented; +import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.impl.jsr168.PortletParameterMap; import org.jboss.portal.portlet.ActionURL; @@ -36,6 +37,7 @@ import javax.portlet.PortletURL; import javax.portlet.WindowState; import javax.portlet.WindowStateException; +import javax.portlet.PortletURLGenerationListener; import java.util.Map; = /** @@ -48,26 +50,38 @@ public static PortletURLImpl createActionURL(PortletInvocation invocati= on, PortletRequestImpl preq) { InternalActionURL url =3D new InternalActionURL(); - return new PortletURLImpl(invocation, preq, url); + return new PortletURLImpl(invocation, preq, url, true); } = public static PortletURLImpl createRenderURL(PortletInvocation invocati= on, PortletRequestImpl preq) { InternalRenderURL url =3D new InternalRenderURL(new PortletParameter= Map(preq.navigationInfo)); - return new PortletURLImpl(invocation, preq, url); + return new PortletURLImpl(invocation, preq, url, true); } = /** . */ private final InternalPortletURL url; = - private PortletURLImpl(PortletInvocation invocation, PortletRequestImpl= preq, InternalPortletURL url) + private PortletURLImpl( + PortletInvocation invocation, + PortletRequestImpl preq, + InternalPortletURL url, + boolean filterable) { - super(invocation, preq, url); + super(invocation, preq, filterable); = // this.url =3D url; } = + public PortletURLImpl(PortletURLImpl original) + { + super(original); + + // + this.url =3D original.url instanceof InternalRenderURL ? new Interna= lRenderURL((InternalRenderURL)original.url) : new InternalActionURL((Intern= alActionURL)original.url); + } + public void setWindowState(WindowState windowState) throws WindowStateE= xception { if (!preq.isWindowStateAllowed(windowState)) @@ -100,12 +114,12 @@ = public PortletMode getPortletMode() { - throw new NotYetImplemented(); + return url.portletMode; } = public WindowState getWindowState() { - throw new NotYetImplemented(); + return url.windowState; } = public void removePublicRenderParameter(String name) @@ -113,6 +127,28 @@ url.removePublicRenderParameter(name); } = + protected InternalContainerURL getContainerURL() + { + return url; + } + + protected BaseURLImpl createClone() + { + return new PortletURLImpl(this); + } + + protected void filter(PortletURLGenerationListener listener) + { + if (url instanceof InternalActionURL) + { + listener.filterActionURL(this); + } + else + { + listener.filterRenderURL(this); + } + } + private static abstract class InternalPortletURL extends InternalContai= nerURL implements org.jboss.portal.portlet.PortletURL { = @@ -122,6 +158,18 @@ /** . */ protected PortletMode portletMode; = + protected InternalPortletURL() + { + this.windowState =3D null; + this.portletMode =3D null; + } + + protected InternalPortletURL(InternalPortletURL original) + { + this.windowState =3D original.windowState; + this.portletMode =3D original.portletMode; + } + public Mode getMode() { if (portletMode !=3D null) @@ -154,6 +202,14 @@ this.interactionState =3D ParametersStateString.create(); } = + private InternalActionURL(InternalActionURL original) + { + super(original); + + // + this.interactionState =3D ParametersStateString.create(ParameterM= ap.clone(original.interactionState.getParameters())); + } + public StateString getInteractionState() { return interactionState; @@ -177,6 +233,11 @@ protected void removePublicRenderParameter(String name) { } + + protected Map getParameters() + { + return ParameterMap.clone(interactionState.getParameters()); + } } = private static class InternalRenderURL extends InternalPortletURL imple= ments RenderURL @@ -189,6 +250,14 @@ this.parameters =3D parameters; } = + private InternalRenderURL(InternalRenderURL original) + { + super(original); + + // + this.parameters =3D new PortletParameterMap(original.parameters); + } + public StateString getNavigationalState() { return ParametersStateString.create(parameters.getPrivateMapSnaps= hot()); @@ -218,5 +287,10 @@ { parameters.removePublicParameterValue(name); } + + protected Map getParameters() + { + return ParameterMap.clone(parameters.getMap()); + } } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/ResourceURLImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/ResourceURLImpl.java 2008-02-01 00:44:39 UTC (rev 9692) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/ResourceURLImpl.java 2008-02-01 00:46:09 UTC (rev 9693) @@ -27,8 +27,10 @@ import org.jboss.portal.portlet.cache.CacheLevel; import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.ParametersStateString; +import org.jboss.portal.common.util.ParameterMap; = import javax.portlet.ResourceURL; +import javax.portlet.PortletURLGenerationListener; import java.util.Map; import java.util.HashMap; = @@ -68,9 +70,10 @@ private ResourceURLImpl( PortletInvocation invocation, PortletRequestImpl preq, - InternalResourceURL url) + InternalResourceURL url, + boolean filterable) { - super(invocation, preq, url); + super(invocation, preq, filterable); = // this.url =3D url; @@ -82,6 +85,14 @@ } } = + private ResourceURLImpl(ResourceURLImpl original) + { + super(original); + + // + this.url =3D new InternalResourceURL(original.url); + } + public void setResourceID(String resourceID) { if (resourceID !=3D null) @@ -131,9 +142,24 @@ } } = + protected InternalContainerURL getContainerURL() + { + return url; + } + + protected BaseURLImpl createClone() + { + return new ResourceURLImpl(this); + } + + protected void filter(PortletURLGenerationListener listener) + { + listener.filterResourceURL(this); + } + public static ResourceURLImpl createResourceURL(PortletInvocation invoc= ation, PortletRequestImpl preq) { - return new ResourceURLImpl(invocation, preq, new InternalResourceURL= ()); + return new ResourceURLImpl(invocation, preq, new InternalResourceURL= (), true); } = private static class InternalResourceURL extends InternalContainerURL i= mplements org.jboss.portal.portlet.ResourceURL @@ -156,6 +182,14 @@ this.parameters =3D ParametersStateString.create(); } = + private InternalResourceURL(InternalResourceURL original) + { + this.id =3D original.id; + this.parentCacheLevel =3D original.parentCacheLevel; + this.cacheLevel =3D original.cacheLevel; + this.parameters =3D ParametersStateString.create(ParameterMap.clo= ne(original.parameters.getParameters())); + } + protected void setParameter(String name, String value) { parameters.setValue(name, value); @@ -171,6 +205,11 @@ parameters.replace(parameterMap); } = + protected Map getParameters() + { + return ParameterMap.clone(parameters.getParameters()); + } + public StateString getResourceState() { return parameters; Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/portleturl/PortletURLSnapshot.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/PortletURLSnapshot.java (r= ev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/PortletURLSnapshot.java 2008-02-01 00:46:09 UTC (r= ev 9693) @@ -0,0 +1,165 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.tck.portleturl; + +import org.jboss.unit.api.Assert; + +import javax.portlet.PortletMode; +import javax.portlet.WindowState; +import javax.portlet.PortletURL; +import javax.portlet.ResourceURL; +import java.util.Map; +import java.util.LinkedList; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletURLSnapshot +{ + + /** . */ + public static LinkedList queue =3D new LinkedList(); + + public static PortletURLSnapshot next() + { + Assert.assertTrue(queue.size() > 0); + return queue.removeFirst(); + } + + public static int size() + { + return queue.size(); + } + + /** . */ + private static final int ACTION =3D 0; + + /** . */ + private static final int RENDER =3D 1; + + /** . */ + private static final int RESOURCE =3D 2; + + /** . */ + final Class source; + + /** . */ + final int type; + + /** . */ + final PortletMode portletMode; + + /** . */ + final WindowState windowState; + + /** . */ + final Map parameters; + + public static PortletURLSnapshot createActionURL(Class source, PortletU= RL actionURL) + { + return new PortletURLSnapshot(source, ACTION, actionURL); + } + + public static PortletURLSnapshot createRenderURL(Class source, PortletU= RL renderURL) + { + return new PortletURLSnapshot(source, RENDER, renderURL); + } + + public static PortletURLSnapshot createResourceURL(Class source, Resour= ceURL resourceURL) + { + return new PortletURLSnapshot(source, resourceURL); + } + + public static PortletURLSnapshot createActionURL(Class source, PortletM= ode portletMode, WindowState windowState, Map parameters) + { + return new PortletURLSnapshot(source, ACTION, portletMode, windowSta= te, parameters); + } + + public static PortletURLSnapshot createRenderRL(Class source, PortletMo= de portletMode, WindowState windowState, Map parameters) + { + return new PortletURLSnapshot(source, RENDER, portletMode, windowSta= te, parameters); + } + + public static PortletURLSnapshot createResourceURL(Class source, Map parameters) + { + return new PortletURLSnapshot(source, parameters); + } + + private PortletURLSnapshot(Class source, int type, PortletURL portletUR= L) + { + this.source =3D source; + this.type =3D type; + this.portletMode =3D portletURL.getPortletMode(); + this.windowState =3D portletURL.getWindowState(); + this.parameters =3D portletURL.getParameterMap(); + } + + private PortletURLSnapshot(Class source, ResourceURL portletURL) + { + this.source =3D source; + this.type =3D RESOURCE; + this.portletMode =3D null; + this.windowState =3D null; + this.parameters =3D portletURL.getParameterMap(); + } + + private PortletURLSnapshot(Class source, int type, PortletMode portletM= ode, WindowState windowState, Map parameters) + { + this.source =3D source; + this.type =3D type; + this.portletMode =3D portletMode; + this.windowState =3D windowState; + this.parameters =3D parameters; + } + + private PortletURLSnapshot(Class source, Map paramete= rs) + { + this.source =3D source; + this.type =3D RESOURCE; + this.portletMode =3D null; + this.windowState =3D null; + this.parameters =3D parameters; + } + + public void assertEquals(PortletURLSnapshot actual) + { + Assert.assertNotNull(actual); + Assert.assertEquals(source, actual.source); + Assert.assertEquals(type, actual.type); + Assert.assertEquals(parameters.keySet(), actual.parameters.keySet()); + for (Map.Entry entry : parameters.entrySet()) + { + Assert.assertEquals(entry.getValue(), actual.parameters.get(entry= .getKey())); + } + if (type =3D=3D RESOURCE) + { + + } + else + { + Assert.assertEquals(portletMode, actual.portletMode); + Assert.assertEquals(windowState, actual.windowState); + } + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/portleturl/URLGenerationListener.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/URLGenerationListener.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/URLGenerationListener.java 2008-02-01 00:46:09 UTC= (rev 9693) @@ -0,0 +1,51 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.tck.portleturl; + +import javax.portlet.PortletURLGenerationListener; +import javax.portlet.PortletURL; +import javax.portlet.ResourceURL; +import java.util.LinkedList; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class URLGenerationListener implements PortletURLGenerationListener +{ + + public void filterActionURL(PortletURL portletURL) + { + PortletURLSnapshot.queue.addLast(PortletURLSnapshot.createActionURL(= getClass(), portletURL)); + } + + public void filterRenderURL(PortletURL portletURL) + { + PortletURLSnapshot.queue.addLast(PortletURLSnapshot.createRenderURL(= getClass(), portletURL)); + } + + public void filterResourceURL(ResourceURL resourceURL) + { + PortletURLSnapshot.queue.addLast(PortletURLSnapshot.createResourceUR= L(getClass(), resourceURL)); + } +} \ No newline at end of file Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/portleturl/URLGenerationListener1.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/URLGenerationListener1.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/URLGenerationListener1.java 2008-02-01 00:46:09 UT= C (rev 9693) @@ -0,0 +1,36 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.tck.portleturl; + +import javax.portlet.PortletURLGenerationListener; +import javax.portlet.PortletURL; +import javax.portlet.ResourceURL; +import java.util.LinkedList; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class URLGenerationListener1 extends URLGenerationListener +{ +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/portleturl/URLGenerationListener2.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/URLGenerationListener2.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/URLGenerationListener2.java 2008-02-01 00:46:09 UT= C (rev 9693) @@ -0,0 +1,36 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.tck.portleturl; + +import javax.portlet.PortletURLGenerationListener; +import javax.portlet.PortletURL; +import javax.portlet.ResourceURL; +import java.util.LinkedList; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class URLGenerationListener2 extends URLGenerationListener +{ +} \ No newline at end of file Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/portleturl/URLGenerationListenerTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/URLGenerationListenerTestCase.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/URLGenerationListenerTestCase.java 2008-02-01 00:4= 6:09 UTC (rev 9693) @@ -0,0 +1,80 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.tck.portleturl; + +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import static org.jboss.unit.api.Assert.*; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.PortletURL; +import javax.portlet.PortletMode; +import java.io.IOException; +import java.util.HashMap; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)TestCase +public class URLGenerationListenerTestCase +{ + public URLGenerationListenerTestCase(PortletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + PortletURL actionURL =3D response.createActionURL(); + + // + actionURL.toString(); + PortletURLSnapshot actionSnapshot1 =3D PortletURLSnapshot.next= (); + PortletURLSnapshot actionSnapshot2 =3D PortletURLSnapshot.next= (); + assertEquals(0, PortletURLSnapshot.size()); + actionSnapshot1.assertEquals(PortletURLSnapshot.createActionUR= L(URLGenerationListener1.class, null, null, new HashMap()= )); + actionSnapshot2.assertEquals(PortletURLSnapshot.createActionUR= L(URLGenerationListener2.class, null, null, new HashMap()= )); + + // + actionURL.setPortletMode(PortletMode.EDIT); + actionURL.toString(); + actionSnapshot1 =3D PortletURLSnapshot.next(); + actionSnapshot2 =3D PortletURLSnapshot.next(); + assertEquals(0, PortletURLSnapshot.size()); + actionSnapshot1.assertEquals(PortletURLSnapshot.createActionUR= L(URLGenerationListener1.class, PortletMode.EDIT, null, new HashMap())); + actionSnapshot2.assertEquals(PortletURLSnapshot.createActionUR= L(URLGenerationListener2.class, PortletMode.EDIT, null, new HashMap())); + + // + return new EndTestResponse(); + } + }); + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortletApplicationDeployment.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployment.java 2008-02-01 00:44:39 UTC (rev 9692) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployment.java 2008-02-01 00:46:09 UTC (rev 9693) @@ -299,6 +299,6 @@ = public String getContextPath() { - throw new NotYetImplemented(); + return webApp.getContextPath(); } } Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-01 00:44:39 UTC (= rev 9692) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-01 00:46:09 UTC (= rev 9693) @@ -350,6 +350,7 @@ + = = Added: modules/portlet/trunk/test/src/test/resources/jsr286/tck/portleturl-= war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/tck/portleturl-war= /WEB-INF/portlet.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr286/tck/portleturl-war= /WEB-INF/portlet.xml 2008-02-01 00:46:09 UTC (rev 9693) @@ -0,0 +1,47 @@ + + + + + + + UniversalTestPortletA + org.jboss.portal.test.portlet.framework.UTP1 + + text/html + EDIT + + foo + + + + org.jboss.portal.test.portlet.jsr286.tck.portleturl.= URLGenerationListener1 + + + org.jboss.portal.test.portlet.jsr286.tck.portleturl.= URLGenerationListener2 + + + Added: modules/portlet/trunk/test/src/test/resources/jsr286/tck/portleturl-= war/WEB-INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/tck/portleturl-war= /WEB-INF/web.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr286/tck/portleturl-war= /WEB-INF/web.xml 2008-02-01 00:46:09 UTC (rev 9693) @@ -0,0 +1,32 @@ + + + + + + + org.jboss.portal.unit.PortletTestSuite + + Modified: modules/portlet/trunk/test/src/test/resources/test/remote-jboss-u= nit.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xm= l 2008-02-01 00:44:39 UTC (rev 9692) +++ modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xm= l 2008-02-01 00:46:09 UTC (rev 9693) @@ -179,6 +179,10 @@ + + + + = --===============1921245270986635639==-- From portal-commits at lists.jboss.org Thu Jan 31 21:10:52 2008 Content-Type: multipart/mixed; boundary="===============4416143446257339021==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9694 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Thu, 31 Jan 2008 21:10:52 -0500 Message-ID: --===============4416143446257339021== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-01-31 21:10:51 -0500 (Thu, 31 Jan 2008) New Revision: 9694 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installa= tion.xml Log: 2.3.1. Getting the Sources updating, rephrasing, adding content Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/i= nstallation.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-01 00:46:09 UTC (rev 9693) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-01 02:10:51 UTC (rev 9694) @@ -190,53 +190,68 @@ Installing from Sources Getting the Sources - There are two ways for you to obtain the JBoss Portal sourc= e files: - - - From our - download page - - - - From SVN, using the following URL: - - http://anonsvn.jboss.org/repos/portal/branches/JBoss_Po= rtal_Branch_2_6 : For the latest sources of the 2.6 branch - http://anonsvn.jboss.org/repos/portal/trunk/ : For the = latest sources - - - For more information on Portal SVN, and accessing = different versions of the Portal codebase, - please visit - this wiki article. - - - - - Several parts have been extracted from the code ab= ove. Those modules have a different lifecycle and - a different versioning. Here is the list of modules used in JB= oss Portal 2.6.3 and the location of the source code. - - JBoss Portal Common 1.1.0: htt= p://anonsvn.jboss.org/repos/portal/modules/common/tags/JBP_COMMON_1_1_0 - JBoss Portal Web 1.1: http://anonsvn.jboss.org/re= pos/portal/modules/web/tags/JBP_WEB_1_1_0 - JBoss Portal Test 1.0.1: http://anonsvn.jboss.org= /repos/portal/modules/test/tags/JBP_TEST_1_0_1 - JBoss Portal Portlet 1.0.1: http://anonsvn.jboss.= org/repos/portal/modules/portlet/tags/JBP_PORTLET_1_0_1 - JBoss Portal Identity 1.0.1: http://anonsvn.jboss= .org/repos/portal/modules/identity/tags/JBP_IDENTITY_1_0_1 - - - = - - - After checking out of SVN or extracting the Source zip, your d= irectory structure should look like this: + + The JBoss Portal source files can be obtained from the the + JBoss Portal Downloads page. The source files downloaded use= s a JBoss Portal Source Code naming convention. As wel= l, they can be obtained from SVN: + + + + + + the latest source files of the 2.6 branch: http://anonsvn= .jboss.org/repos/portal/branches/JBoss_Portal_Branch_2_6 + + + + + the latest sources: http://anonsvn.jboss.org/repos/portal= /trunk/ + + + + + + Several parts have been extracted from the repositories above. These = modules have a different lifecycle and a different version scheme. The foll= owing is a list of modules used in JBoss Portal 2.6.3, and the locations of= their source code: + + + + + + JBoss Portal Common 1.1.0: http://anonsvn.jboss.org/repo= s/portal/modules/common/tags/JBP_COMMON_1_1_0 + + + + + JBoss Portal Web 1.1: http://anonsvn.jboss.org/repos/por= tal/modules/web/tags/JBP_WEB_1_1_0 + + + + + JBoss Portal Test 1.0.1: http://anonsvn.jboss.org/repos/= portal/modules/test/tags/JBP_TEST_1_0_1 + + + + + JBoss Portal Portlet 1.0.1: http://anonsvn.jboss.org/rep= os/portal/modules/portlet/tags/JBP_PORTLET_1_0_1 + + + + + JBoss Portal Identity 1.0.1: http://anonsvn.jboss.org/re= pos/portal/modules/identity/tags/JBP_IDENTITY_1_0_1 + + + + + + After checking out the source from SVN, or after extracting the JBoss Portal Source Code zip file, the directory structure w= ill be similar to the following: + - - The screenshot above, shows the downloaded source dir= ectory. Those of you checking out from SVN, will get - an empty thirdparty directory. This di= rectory will be filled when you first run the build - in the following steps. - - - + + If the source files were obtained from SVN, there will be an empty <= filename>thirdparty directory. This directory will contain files= after building the JBoss Portal source in . For more information about the JBoss Portal SVN, and a= ccessing different versions of the JBoss Portal codebase, please visit the = Por= tal SVN Repo page on the JBoss Wiki. + + Setting up the application server @@ -281,7 +296,7 @@ - + Building/Deploying from Sources To build and deploy the JBoss Portal service, go to JBOSS_PORTAL_HOME_DIRECTORY/build --===============4416143446257339021==-- From portal-commits at lists.jboss.org Thu Jan 31 23:12:10 2008 Content-Type: multipart/mixed; boundary="===============8091202642164186190==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9695 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Thu, 31 Jan 2008 23:12:09 -0500 Message-ID: --===============8091202642164186190== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-01-31 23:12:08 -0500 (Thu, 31 Jan 2008) New Revision: 9695 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installa= tion.xml Log: 2.3.1. Getting the Sources few sentence rewrites Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/i= nstallation.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-01 02:10:51 UTC (rev 9694) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-01 04:12:08 UTC (rev 9695) @@ -191,8 +191,8 @@ Getting the Sources - The JBoss Portal source files can be obtained from the the - JBoss Portal Downloads page. The source files downloaded use= s a JBoss Portal Source Code naming convention. As wel= l, they can be obtained from SVN: + The JBoss Portal source files can be obtained from the + JBoss Portal Downloads page. The source files download uses = a JBoss Portal Source Code naming convention. As well,= the sources can be obtained from SVN: @@ -209,7 +209,7 @@ - Several parts have been extracted from the repositories above. These = modules have a different lifecycle and a different version scheme. The foll= owing is a list of modules used in JBoss Portal 2.6.3, and the locations of= their source code: + Several modules have been extracted from the JBoss Portal SVN reposit= ory. These modules have a different lifecycle and a different version schem= e. The following is a list of modules used in JBoss Portal 2.6.3, and the l= ocations of their source code: @@ -241,7 +241,7 @@ - After checking out the source from SVN, or after extracting the JBoss Portal Source Code zip file, the directory structure w= ill be similar to the following: + After checking out the source from SVN, or after extracting the JBoss Portal Source Code zip file, a directory structure sim= ilar to the following will be created: @@ -249,7 +249,7 @@ - If the source files were obtained from SVN, there will be an empty <= filename>thirdparty directory. This directory will contain files= after building the JBoss Portal source in . For more information about the JBoss Portal SVN, and a= ccessing different versions of the JBoss Portal codebase, please visit the = Por= tal SVN Repo page on the JBoss Wiki. + If the source files were obtained from SVN, change into the trunk/src/ directory to see the directories from the above ima= ge. As well, there will be an empty thirdparty directo= ry. This directory will contain files after building the JBoss Portal sourc= e code (). For more info= rmation about the JBoss Portal SVN repository, and accessing different vers= ions of the JBoss Portal codebase, please visit the JBoss Portal SVN Repo page on the JBoss Wiki. --===============8091202642164186190==-- From portal-commits at lists.jboss.org Fri Feb 1 00:11:42 2008 Content-Type: multipart/mixed; boundary="===============5720589773167518160==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9696 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Fri, 01 Feb 2008 00:11:42 -0500 Message-ID: --===============5720589773167518160== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-01 00:11:42 -0500 (Fri, 01 Feb 2008) New Revision: 9696 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installa= tion.xml Log: revising content: 2.3.2.2. Operating System Environment Settings Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/i= nstallation.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-01 04:12:08 UTC (rev 9695) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-01 05:11:42 UTC (rev 9696) @@ -253,37 +253,22 @@ - Setting up the application server + Setting up the JBoss Application Server - Application Server Setup - Of course you will need to install JBoss Application Ser= ver prior to installing JBoss - portal, if you didn't do so yet, please install JBoss EAP 4= .2 or JBoss AS 4.2.2. If you have a - subscription contract with Red Hat, you can have access to = the EAP - version from the s= upport portal. - For the other versions you can get them - here - - . - + JBoss Application Server Setup + Before deploying JBoss Portal, make sure you have JBoss EAP or = JBoss AS installed. Customers who have access to the JBoss Customer Support Portal (CSP) should download and install JBoss EAP 4.2. Customers who do not have= access to the JBoss CSP are advised to use JBoss AS. For JBoss AS installation instru= ctions, please refer to the JBoss AS Installation Guide. + - Operating System Environment Setting - For the build targets to work, you must first set the - JBOSS_HOME - environment variable in your - operating system, to the root directory of the JBoss Applic= ation Server installation. - - In Windows, this is accomplished by going to - Start > Settings > Control Panel > System > Advan= ced > Environment Variables - . Now under the + Operating System Environment Settings + For build targets to work, you must configure a JBOSS_HOME environment variable. This environment variable mus= t point to the root directory of the JBoss EAP or JBoss AS installation dir= ectory, which is the directory where the JBoss EAP or JBoss AS files were e= xtracted to. + + When using Microsoft Windows, this is accomplished by go= ing to + Start > Settings > Control Panel > System > Advan= ced > Environment Variables. Under the System Variables section, click - New - . You will be setting the - JBOSS_HOME - environment variable to the location of your JBoss Applicat= ion Server installation: + New. Set the JBOSS_HOME + environment variable to the location of your JBoss EAP or J= Boss AS installation directory: @@ -291,13 +276,42 @@ - On a Unix-like Operating System, you would accomplish this = by typing: - export JBOSS_HOME=3D/path/to/your/jboss/directory<= /command> - - + To configure the JBOSS_HOME environment variabl= e on Linux: + + + + + + Add the following line to the ~/.bashrc file= . Note: this must be configured while logged in as the user who will run JB= oss EAP or JBoss AS: + + + +export JBOSS_HOME=3D/path/to/installation/ + + + + + + Run the following command to enable the JBOSS_HOME environment variable: + + + +source ~/.bashrc + + + + + + + JBoss EAP <filename>JBOSS_HOME</filename> Environment Variable<= /title> + <para> + If you are running JBoss EAP, configure the <filename>JBOSS_HOME</fil= ename> environment variable to point to the <filename>/path/to/jboss-eap-<r= eplaceable>version</replaceable>/jboss-as/</filename> directory. + </para> + </note> + </sect3> </sect2> <sect2 id=3D"building_deploying_from_source"> - <title>Building/Deploying from Sources + Building and Deploying from Sources To build and deploy the JBoss Portal service, go to JBOSS_PORTAL_HOME_DIRECTORY/build and type: --===============5720589773167518160==-- From portal-commits at lists.jboss.org Fri Feb 1 02:06:21 2008 Content-Type: multipart/mixed; boundary="===============0123717453582187968==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9697 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Fri, 01 Feb 2008 02:06:19 -0500 Message-ID: --===============0123717453582187968== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-01 02:06:19 -0500 (Fri, 01 Feb 2008) New Revision: 9697 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installa= tion.xml Log: 2.3.3. Building and Deploying from the Sources updating section with more verbose instructions Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/i= nstallation.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-01 05:11:42 UTC (rev 9696) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-01 07:06:19 UTC (rev 9697) @@ -311,41 +311,68 @@ - Building and Deploying from Sources - To build and deploy the JBoss Portal service, go to - JBOSS_PORTAL_HOME_DIRECTORY/build - and type: - build deploy - - - - + Building and Deploying from the Sources + To build and deploy JBoss Portal from the sources, change into the= JBOSS_PORTAL_INSTALL_DIRECTORY/build/ directory. Mic= rosoft Windows users need to run the build.bat deploy co= mmand, and Linux users need to run the ./build.sh deploy= command. + + + During the first build, third-party libraries will be obtained from an = online + repository, so you must be connected to Internet, and if you are behind= a proxy server, you also + need to define your proxy address and host. If you are runn= ing Linux, add the following line to the JBOSS_INSTALLATION_DIREC= TORY/bin/run.sh file: + + + +JAVA_OPTS=3D-Dhttp.proxyHost=3D<proxy-hostname> -Dhttp.proxyPort=3D<proxy-port> + + + + Replace proxy-hostname with the proxy server'= s hostname, and proxy-port with the correct prox= y server port number. If you are running Microsoft Windows, add the followi= ng line to the JBOSS_INSTALLATION_DIRECTORY/bin/run.bat file: + + + +set JAVA_OPTS=3D-Dhttp.proxyHost=3D<proxy-hostname> -Dhttp.proxyPort=3D<proxy-port> + + + + Replace proxy-hostname with the proxy server'= s hostname, and proxy-port with the correct prox= y server port number. + + + At the end of the build process, the jboss-portal.sar file is copied into the JBOSS_HOME/server/default/deploy/ directory: + + + + + - - During the first compilation, third-party libraries w= ill be obtained from an online - repository, you need to be connected to Internet and if you= are behind a proxy, you also - need to define your proxy address and host by adding: - JAVA_OPTS=3D-Dhttp.proxyHost=3D<Proxy Host> -= Dhttp.proxyPort=3D<Proxy Port> in your environment. - - - To build the clustered version, you will need to go to - JBOSS_PORTAL_HOME_DIRECTORY/build - and type: - build main - Then, go to - JBOSS_PORTAL_HOME_DIRECTORY/core - and type: - build deploy-ha - This will copy the - jboss-portal-ha.sar - to your - all - configuration for you. - - At the end of the build process, the - jboss-portal.sar - is copied to JBOSS_HOME/server/default/deploy. - + + To build the clustered version on Linux Operating Systems: + + + + + + Change into the JBOSS_PORTAL_HOME_DIRECTORY/build/ directory, and run the following command: + + + +./build.sh main + + + + + + Change into the JBOSS_PORTAL_HOME_DIRECTORY/core/ directory, and run the following command: + + + +./build.sh deploy-ha + = + + + After ./build.sh deploy-ha completes, the jboss-portal-ha.sar file is copied into the JBOSS_HO= ME/server/all/deploy/ directory. + + + + Setting up the database --===============0123717453582187968==-- From portal-commits at lists.jboss.org Fri Feb 1 02:49:00 2008 Content-Type: multipart/mixed; boundary="===============8965073585541566046==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9698 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Fri, 01 Feb 2008 02:49:00 -0500 Message-ID: --===============8965073585541566046== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-01 02:49:00 -0500 (Fri, 01 Feb 2008) New Revision: 9698 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installa= tion.xml Log: revising structure of 2.3.3. Building and Deploying from the Sources Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/i= nstallation.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-01 07:06:19 UTC (rev 9697) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-01 07:49:00 UTC (rev 9698) @@ -312,30 +312,30 @@ Building and Deploying from the Sources - To build and deploy JBoss Portal from the sources, change into the= JBOSS_PORTAL_INSTALL_DIRECTORY/build/ directory. Mic= rosoft Windows users need to run the build.bat deploy co= mmand, and Linux users need to run the ./build.sh deploy= command. + + During the first build, third-party libraries will be obtained from an = online + repository, so you must be connected to the Internet, and if you are be= hind a proxy server, you also + need to define your proxy server address and proxy server port number. = If you are running Linux, add the following line to the JBOSS_INS= TALLATION_DIRECTORY/bin/run.sh file: - During the first build, third-party libraries will be obtained from an = online - repository, so you must be connected to Internet, and if you are behind= a proxy server, you also - need to define your proxy address and host. If you are runn= ing Linux, add the following line to the JBOSS_INSTALLATION_DIREC= TORY/bin/run.sh file: - - JAVA_OPTS=3D-Dhttp.proxyHost=3D<proxy-hostname> -Dhttp.proxyPort=3D<proxy-port> - - - Replace proxy-hostname with the proxy server'= s hostname, and proxy-port with the correct prox= y server port number. If you are running Microsoft Windows, add the followi= ng line to the JBOSS_INSTALLATION_DIRECTORY/bin/run.bat file: - - + + + Replace proxy-hostname with the proxy server= 's hostname, and proxy-port with the correct pro= xy server port number. If you are running Microsoft Windows, add the follow= ing line to the JBOSS_INSTALLATION_DIRECTORY/bin/run.bat file: + + set JAVA_OPTS=3D-Dhttp.proxyHost=3D<proxy-hostname> -Dhttp.proxyPort=3D<proxy-port> + + + Replace proxy-hostname with the proxy server= 's hostname, and proxy-port with the correct pro= xy server port number. + To build and deploy JBoss Portal from the sources, change into the= JBOSS_PORTAL_HOME_DIRECTORY/build/ directory. Micros= oft Windows users need to run the build.bat deploy comma= nd, and Linux users need to run the ./build.sh deploy co= mmand. + - Replace proxy-hostname with the proxy server'= s hostname, and proxy-port with the correct prox= y server port number. - - At the end of the build process, the jboss-portal.sar file is copied into the JBOSS_HOME/server/default/deploy/ directory: @@ -368,11 +368,14 @@ = - After ./build.sh deploy-ha completes, the jboss-portal-ha.sar file is copied into the JBOSS_HO= ME/server/all/deploy/ directory. + After the ./build.sh deploy-ha command completes, = the jboss-portal-ha.sar file is copied into the JBOSS_HOME/server/all/deploy/ directory. + + To build the clustered version on Microsoft Windows, repeat the above s= teps, replacing ./build.sh with build.bat. + Setting up the database --===============8965073585541566046==-- From portal-commits at lists.jboss.org Fri Feb 1 03:06:33 2008 Content-Type: multipart/mixed; boundary="===============8350418590925253490==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9699 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Fri, 01 Feb 2008 03:04:52 -0500 Message-ID: --===============8350418590925253490== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-01 03:04:52 -0500 (Fri, 01 Feb 2008) New Revision: 9699 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installa= tion.xml Log: 2.3.3. Building and Deploying from the Sources small spelling corrections/wording changes Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/i= nstallation.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-01 07:49:00 UTC (rev 9698) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-01 08:04:52 UTC (rev 9699) @@ -286,7 +286,7 @@ -export JBOSS_HOME=3D/path/to/installation/ +export JBOSS_HOME=3D/path/to/jboss/installation/ @@ -314,8 +314,7 @@ Building and Deploying from the Sources During the first build, third-party libraries will be obtained from an = online - repository, so you must be connected to the Internet, and if you are be= hind a proxy server, you also - need to define your proxy server address and proxy server port number. = If you are running Linux, add the following line to the JBOSS_INS= TALLATION_DIRECTORY/bin/run.sh file: + repository, so you must be connected to the Internet, and if you are be= hind a proxy server, you need to define your proxy server address and proxy= server port number. If you are running Linux, add the following line to th= e JBOSS_INSTALLATION_DIRECTORY/bin/run.sh file: @@ -333,7 +332,7 @@ Replace proxy-hostname with the proxy server= 's hostname, and proxy-port with the correct pro= xy server port number. - To build and deploy JBoss Portal from the sources, change into the= JBOSS_PORTAL_HOME_DIRECTORY/build/ directory. Micros= oft Windows users need to run the build.bat deploy comma= nd, and Linux users need to run the ./build.sh deploy co= mmand. + To build and deploy JBoss Portal from the sources, change into the= JBOSS_PORTAL_HOME_DIRECTORY/build/ directory. Then, = Microsoft Windows users need to run the build.bat deploy= command, and Linux users need to run the ./build.sh deploy command. At the end of the build process, the jboss-portal.sar file is copied into the JBOSS_HOME/server/default/deploy/ directory: @@ -374,7 +373,7 @@ - To build the clustered version on Microsoft Windows, repeat the above s= teps, replacing ./build.sh with build.bat. + To build the clustered version on Microsoft Windows, repeat the previou= s steps, replacing ./build.sh with build.bat. --===============8350418590925253490==-- From portal-commits at lists.jboss.org Fri Feb 1 03:10:37 2008 Content-Type: multipart/mixed; boundary="===============7645033834653276234==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9700 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Fri, 01 Feb 2008 03:10:37 -0500 Message-ID: --===============7645033834653276234== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-01 03:10:37 -0500 (Fri, 01 Feb 2008) New Revision: 9700 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installa= tion.xml Log: changing heading "from sources" to "from the sources" Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/i= nstallation.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-01 08:04:52 UTC (rev 9699) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-01 08:10:37 UTC (rev 9700) @@ -187,7 +187,7 @@ - Installing from Sources + Installing from the Sources Getting the Sources --===============7645033834653276234==-- From portal-commits at lists.jboss.org Fri Feb 1 09:07:32 2008 Content-Type: multipart/mixed; boundary="===============6409805838425168100==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9701 - modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portleturl. Date: Fri, 01 Feb 2008 09:07:31 -0500 Message-ID: --===============6409805838425168100== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-01 09:07:31 -0500 (Fri, 01 Feb 2008) New Revision: 9701 Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portleturl/CallbackQueue.java Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portleturl/PortletURLSnapshot.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portleturl/URLGenerationListener.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portleturl/URLGenerationListener1.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portleturl/URLGenerationListener2.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portleturl/URLGenerationListenerTestCase.java Log: - update the url gen listener test cases to scale more in # of test cases t= o write Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/portleturl/CallbackQueue.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/CallbackQueue.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/CallbackQueue.java 2008-02-01 14:07:31 UTC (rev 97= 01) @@ -0,0 +1,73 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.tck.portleturl; + +import org.jboss.unit.api.Assert; + +import javax.portlet.PortletURLGenerationListener; +import javax.portlet.PortletURL; +import javax.portlet.ResourceURL; +import java.util.LinkedList; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class CallbackQueue +{ + + /** . */ + private static LinkedList queue =3D new LinkedList<= PortletURLSnapshot>(); + + public static PortletURLSnapshot next() + { + Assert.assertTrue(queue.size() > 0); + return queue.removeFirst(); + } + + public static int size() + { + return queue.size(); + } + + public static PortletURLGenerationListener createListener(final String = id) + { + return new PortletURLGenerationListener() + { + public void filterActionURL(PortletURL portletURL) + { + queue.addLast(PortletURLSnapshot.createActionURL(id, portletUR= L)); + } + + public void filterRenderURL(PortletURL portletURL) + { + queue.addLast(PortletURLSnapshot.createRenderURL(id, portletUR= L)); + } + + public void filterResourceURL(ResourceURL resourceURL) + { + queue.addLast(PortletURLSnapshot.createResourceURL(id, resourc= eURL)); + } + }; + } +} Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/portleturl/PortletURLSnapshot.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/PortletURLSnapshot.java 2008-02-01 08:10:37 UTC (r= ev 9700) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/PortletURLSnapshot.java 2008-02-01 14:07:31 UTC (r= ev 9701) @@ -39,20 +39,6 @@ { = /** . */ - public static LinkedList queue =3D new LinkedList(); - - public static PortletURLSnapshot next() - { - Assert.assertTrue(queue.size() > 0); - return queue.removeFirst(); - } - - public static int size() - { - return queue.size(); - } - - /** . */ private static final int ACTION =3D 0; = /** . */ @@ -62,7 +48,7 @@ private static final int RESOURCE =3D 2; = /** . */ - final Class source; + final String source; = /** . */ final int type; @@ -76,37 +62,37 @@ /** . */ final Map parameters; = - public static PortletURLSnapshot createActionURL(Class source, PortletU= RL actionURL) + public static PortletURLSnapshot createActionURL(String source, Portlet= URL actionURL) { return new PortletURLSnapshot(source, ACTION, actionURL); } = - public static PortletURLSnapshot createRenderURL(Class source, PortletU= RL renderURL) + public static PortletURLSnapshot createRenderURL(String source, Portlet= URL renderURL) { return new PortletURLSnapshot(source, RENDER, renderURL); } = - public static PortletURLSnapshot createResourceURL(Class source, Resour= ceURL resourceURL) + public static PortletURLSnapshot createResourceURL(String source, Resou= rceURL resourceURL) { return new PortletURLSnapshot(source, resourceURL); } = - public static PortletURLSnapshot createActionURL(Class source, PortletM= ode portletMode, WindowState windowState, Map parameters) + public static PortletURLSnapshot createActionURL(String source, Portlet= Mode portletMode, WindowState windowState, Map parameters) { return new PortletURLSnapshot(source, ACTION, portletMode, windowSta= te, parameters); } = - public static PortletURLSnapshot createRenderRL(Class source, PortletMo= de portletMode, WindowState windowState, Map parameters) + public static PortletURLSnapshot createRenderRL(String source, PortletM= ode portletMode, WindowState windowState, Map parameters) { return new PortletURLSnapshot(source, RENDER, portletMode, windowSta= te, parameters); } = - public static PortletURLSnapshot createResourceURL(Class source, Map parameters) + public static PortletURLSnapshot createResourceURL(String source, Map parameters) { return new PortletURLSnapshot(source, parameters); } = - private PortletURLSnapshot(Class source, int type, PortletURL portletUR= L) + private PortletURLSnapshot(String source, int type, PortletURL portletU= RL) { this.source =3D source; this.type =3D type; @@ -115,7 +101,7 @@ this.parameters =3D portletURL.getParameterMap(); } = - private PortletURLSnapshot(Class source, ResourceURL portletURL) + private PortletURLSnapshot(String source, ResourceURL portletURL) { this.source =3D source; this.type =3D RESOURCE; @@ -124,7 +110,7 @@ this.parameters =3D portletURL.getParameterMap(); } = - private PortletURLSnapshot(Class source, int type, PortletMode portletM= ode, WindowState windowState, Map parameters) + private PortletURLSnapshot(String source, int type, PortletMode portlet= Mode, WindowState windowState, Map parameters) { this.source =3D source; this.type =3D type; @@ -133,7 +119,7 @@ this.parameters =3D parameters; } = - private PortletURLSnapshot(Class source, Map paramete= rs) + private PortletURLSnapshot(String source, Map paramet= ers) { this.source =3D source; this.type =3D RESOURCE; Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/portleturl/URLGenerationListener.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/URLGenerationListener.java 2008-02-01 08:10:37 UTC= (rev 9700) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/URLGenerationListener.java 2008-02-01 14:07:31 UTC= (rev 9701) @@ -31,21 +31,36 @@ * @author Julien Viet * @version $Revision: 630 $ */ -public class URLGenerationListener implements PortletURLGenerationListener +public abstract class URLGenerationListener implements PortletURLGeneratio= nListener { = public void filterActionURL(PortletURL portletURL) { - PortletURLSnapshot.queue.addLast(PortletURLSnapshot.createActionURL(= getClass(), portletURL)); + PortletURLGenerationListener delegate =3D getListener(); + if (delegate !=3D null) + { + delegate.filterActionURL(portletURL); + } } = public void filterRenderURL(PortletURL portletURL) { - PortletURLSnapshot.queue.addLast(PortletURLSnapshot.createRenderURL(= getClass(), portletURL)); + PortletURLGenerationListener delegate =3D getListener(); + if (delegate !=3D null) + { + delegate.filterRenderURL(portletURL); + } } = public void filterResourceURL(ResourceURL resourceURL) { - PortletURLSnapshot.queue.addLast(PortletURLSnapshot.createResourceUR= L(getClass(), resourceURL)); + PortletURLGenerationListener delegate =3D getListener(); + if (delegate !=3D null) + { + delegate.filterResourceURL(resourceURL); + } } + + protected abstract PortletURLGenerationListener getListener(); + } \ No newline at end of file Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/portleturl/URLGenerationListener1.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/URLGenerationListener1.java 2008-02-01 08:10:37 UT= C (rev 9700) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/URLGenerationListener1.java 2008-02-01 14:07:31 UT= C (rev 9701) @@ -33,4 +33,12 @@ */ public class URLGenerationListener1 extends URLGenerationListener { + + /** . */ + public static PortletURLGenerationListener delegate; + + protected PortletURLGenerationListener getListener() + { + return delegate; + } } Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/portleturl/URLGenerationListener2.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/URLGenerationListener2.java 2008-02-01 08:10:37 UT= C (rev 9700) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/URLGenerationListener2.java 2008-02-01 14:07:31 UT= C (rev 9701) @@ -33,4 +33,12 @@ */ public class URLGenerationListener2 extends URLGenerationListener { + + /** . */ + public static PortletURLGenerationListener delegate; + + protected PortletURLGenerationListener getListener() + { + return delegate; + } } \ No newline at end of file Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/portleturl/URLGenerationListenerTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/URLGenerationListenerTestCase.java 2008-02-01 08:1= 0:37 UTC (rev 9700) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/URLGenerationListenerTestCase.java 2008-02-01 14:0= 7:31 UTC (rev 9701) @@ -55,22 +55,25 @@ { PortletURL actionURL =3D response.createActionURL(); = + URLGenerationListener1.delegate =3D CallbackQueue.createListen= er("l1"); + URLGenerationListener2.delegate =3D CallbackQueue.createListen= er("l2"); + // actionURL.toString(); - PortletURLSnapshot actionSnapshot1 =3D PortletURLSnapshot.next= (); - PortletURLSnapshot actionSnapshot2 =3D PortletURLSnapshot.next= (); - assertEquals(0, PortletURLSnapshot.size()); - actionSnapshot1.assertEquals(PortletURLSnapshot.createActionUR= L(URLGenerationListener1.class, null, null, new HashMap()= )); - actionSnapshot2.assertEquals(PortletURLSnapshot.createActionUR= L(URLGenerationListener2.class, null, null, new HashMap()= )); + PortletURLSnapshot actionSnapshot1 =3D CallbackQueue.next(); + PortletURLSnapshot actionSnapshot2 =3D CallbackQueue.next(); + assertEquals(0, CallbackQueue.size()); + actionSnapshot1.assertEquals(PortletURLSnapshot.createActionUR= L("l1", null, null, new HashMap())); + actionSnapshot2.assertEquals(PortletURLSnapshot.createActionUR= L("l2", null, null, new HashMap())); = // actionURL.setPortletMode(PortletMode.EDIT); actionURL.toString(); - actionSnapshot1 =3D PortletURLSnapshot.next(); - actionSnapshot2 =3D PortletURLSnapshot.next(); - assertEquals(0, PortletURLSnapshot.size()); - actionSnapshot1.assertEquals(PortletURLSnapshot.createActionUR= L(URLGenerationListener1.class, PortletMode.EDIT, null, new HashMap())); - actionSnapshot2.assertEquals(PortletURLSnapshot.createActionUR= L(URLGenerationListener2.class, PortletMode.EDIT, null, new HashMap())); + actionSnapshot1 =3D CallbackQueue.next(); + actionSnapshot2 =3D CallbackQueue.next(); + assertEquals(0, CallbackQueue.size()); + actionSnapshot1.assertEquals(PortletURLSnapshot.createActionUR= L("l1", PortletMode.EDIT, null, new HashMap())); + actionSnapshot2.assertEquals(PortletURLSnapshot.createActionUR= L("l2", PortletMode.EDIT, null, new HashMap())); = // return new EndTestResponse(); --===============6409805838425168100==-- From portal-commits at lists.jboss.org Fri Feb 1 13:10:37 2008 Content-Type: multipart/mixed; boundary="===============8074724752559375601==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9702 - in modules/common/trunk/common/src: main/java/org/jboss/portal/common/text and 1 other directories. Date: Fri, 01 Feb 2008 13:10:37 -0500 Message-ID: --===============8074724752559375601== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-01 13:10:37 -0500 (Fri, 01 Feb 2008) New Revision: 9702 Added: modules/common/trunk/common/src/main/java/org/jboss/portal/common/text/E= ntityEncoder.java modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/t= ext/EntityEncoderTestCase.java Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common/markup= /MarkupAttribute.java modules/common/trunk/common/src/main/java/org/jboss/portal/common/text/A= bstractCharEncoder.java modules/common/trunk/common/src/main/java/org/jboss/portal/common/text/C= harBuffer.java modules/common/trunk/common/src/main/java/org/jboss/portal/common/text/C= harEncoder.java Log: - adapted the existing 2.6 entity table as a common CharEncoder Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common= /markup/MarkupAttribute.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/src/main/java/org/jboss/portal/common/marku= p/MarkupAttribute.java 2008-02-01 14:07:31 UTC (rev 9701) +++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/marku= p/MarkupAttribute.java 2008-02-01 18:10:37 UTC (rev 9702) @@ -156,7 +156,7 @@ // Patches the encoder to let '/' not being encoded encoder =3D new AbstractCharEncoder() { - public void encode(char c, CharWriter writer) throws Encodi= ngException + protected void safeEncode(char c, CharWriter writer) throws= EncodingException { if (c =3D=3D '/') { Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common= /text/AbstractCharEncoder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/src/main/java/org/jboss/portal/common/text/= AbstractCharEncoder.java 2008-02-01 14:07:31 UTC (rev 9701) +++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/text/= AbstractCharEncoder.java 2008-02-01 18:10:37 UTC (rev 9702) @@ -31,22 +31,88 @@ = public void encode(char[] chars, int off, int len, CharWriter writer) t= hrows EncodingException { - for (int i =3D off;i < len;i++) + if (chars =3D=3D null) { - encode(chars[i], writer); + throw new IllegalArgumentException(); } + if (writer =3D=3D null) + { + throw new IllegalArgumentException(); + } + if (off < 0) + { + throw new IllegalArgumentException(); + } + if (off + len > chars.length) + { + throw new IllegalArgumentException(); + } + + // + safeEncode(chars, off, len, writer); } = public void encode(char[] chars, CharWriter writer) throws EncodingExce= ption { - encode(chars, 0, chars.length, writer); + if (chars =3D=3D null) + { + throw new IllegalArgumentException(); + } + if (writer =3D=3D null) + { + throw new IllegalArgumentException(); + } + + // + safeEncode(chars, writer); } = public void encode(CharSequence s, CharWriter writer) throws EncodingEx= ception { + if (s =3D=3D null) + { + throw new IllegalArgumentException(); + } + if (writer =3D=3D null) + { + throw new IllegalArgumentException(); + } + + // + safeEncode(s, writer); + } + + public void encode(char c, CharWriter writer) throws EncodingException + { + if (writer =3D=3D null) + { + throw new IllegalArgumentException(); + } + + // + safeEncode(c, writer); + } + + protected void safeEncode(char[] chars, int off, int len, CharWriter wr= iter) throws EncodingException + { + for (int i =3D off;i < len;i++) + { + safeEncode(chars[i], writer); + } + } + + protected void safeEncode(char[] chars, CharWriter writer) throws Encod= ingException + { + safeEncode(chars, 0, chars.length, writer); + } + + protected void safeEncode(CharSequence s, CharWriter writer) throws Enc= odingException + { for (int i =3D 0;i < s.length();i++) { - encode(s.charAt(i), writer); + safeEncode(s.charAt(i), writer); } } + + protected abstract void safeEncode(char c, CharWriter writer) throws En= codingException; } Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common= /text/CharBuffer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/src/main/java/org/jboss/portal/common/text/= CharBuffer.java 2008-02-01 14:07:31 UTC (rev 9701) +++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/text/= CharBuffer.java 2008-02-01 18:10:37 UTC (rev 9702) @@ -23,7 +23,7 @@ package org.jboss.portal.common.text; = /** - * A simple char buffer. + * A simple char buffer that implements the CharWriter interf= ace * * @author Julien Viet * @version $Revision: 7228 $ Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common= /text/CharEncoder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/src/main/java/org/jboss/portal/common/text/= CharEncoder.java 2008-02-01 14:07:31 UTC (rev 9701) +++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/text/= CharEncoder.java 2008-02-01 18:10:37 UTC (rev 9702) @@ -23,13 +23,48 @@ package org.jboss.portal.common.text; = /** + * Defines an interface for encoding chars. + * * @author Julien Viet * @version $Revision: 1.1 $ */ public interface CharEncoder { - void encode(char c, CharWriter writer) throws EncodingException; - void encode(char[] chars, int off, int len, CharWriter writer) throws E= ncodingException; - void encode(char[] chars, CharWriter writer) throws EncodingException; - void encode(CharSequence s, CharWriter writer) throws EncodingException; + /** + * + * @param c the char to encode + * @param writer the writer to use + * @throws IllegalArgumentException if any argument is null + * @throws EncodingException an encoding exception + */ + void encode(char c, CharWriter writer) throws IllegalArgumentException,= EncodingException; + + /** + * + * @param chars the chars to encode + * @param off the offset in the char array + * @param len the lenght of chars to encode + * @param writer the writer to use + * @throws IllegalArgumentException if any argument is null or if the b= ounds not valid in the provided array + * @throws EncodingException an encoding exception + */ + void encode(char[] chars, int off, int len, CharWriter writer) throws I= llegalArgumentException, EncodingException; + + /** + * + * @param chars the chars to encode + * @param writer the writer to use + * @throws IllegalArgumentException if any argument is null + * @throws EncodingException an encoding exception + */ + void encode(char[] chars, CharWriter writer) throws IllegalArgumentExce= ption, EncodingException; + + /** + * + * @param s the sequence to encode + * @param writer the writer to use + * @throws IllegalArgumentException if any argument is null + * @throws EncodingException an encoding exception + */ + void encode(CharSequence s, CharWriter writer) throws IllegalArgumentEx= ception, EncodingException; } Added: modules/common/trunk/common/src/main/java/org/jboss/portal/common/te= xt/EntityEncoder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/src/main/java/org/jboss/portal/common/text/= EntityEncoder.java (rev 0) +++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/text/= EntityEncoder.java 2008-02-01 18:10:37 UTC (rev 9702) @@ -0,0 +1,381 @@ +/*************************************************************************= ***** + * 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.common.text; + +/** + * This encoder performs lookup for converting a char to its HTML entity r= epresentation. + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class EntityEncoder extends AbstractCharEncoder +{ + + protected void safeEncode(char c, CharWriter writer) throws EncodingExc= eption + { + String s =3D charToEntity[c]; + + // + if (s !=3D null) + { + writer.append('&'); + writer.append(s); + writer.append(';'); + } + else + { + writer.append(c); + } + } + + public void safeEncode(char[] chars, int off, int len, CharWriter write= r) throws EncodingException + { + // The index of the last copied char + int previous =3D off; + + // + int to =3D off + len; + + // Perform lookup char by char + for (int current =3D off; current < to; current++) + { + // Lookup + String replacement =3D lookup(chars[current]); + + // Do we have a replacement + if (replacement !=3D null) + { + // We lazy create the result + + // Append the previous chars if any + writer.append(chars, previous, current - previous); + + // Append the replaced entity + writer.append('&').append(replacement).append(';'); + + // Update the previous pointer + previous =3D current + 1; + } + } + + // + writer.append(chars, previous, chars.length - previous); + } + + /** All HTML entities. */ + public static final EntityEncoder FULL =3D new EntityEncoder(); + + /** All HTML entities except the HTML chars which are used to do HTML i= tself. */ + public static final EntityEncoder BASIC =3D new BasicEntityTable(); + + private static class BasicEntityTable extends EntityEncoder + { + public BasicEntityTable() + { + remove('<'); + remove('>'); + remove('"'); + remove('&'); + } + } + + /** . */ + private String[] charToEntity =3D new String[65536]; + + protected EntityEncoder() + { + put(160, "nbsp"); + put(161, "iexcl"); + put(162, "cent"); + put(163, "pound"); + put(164, "curren"); + put(165, "yen"); + put(166, "brvbar"); + put(167, "sect"); + put(168, "uml"); + put(169, "copy"); + put(170, "ordf"); + put(171, "laquo"); + put(172, "not"); + put(173, "shy"); + put(174, "reg"); + put(175, "macr"); + put(176, "deg"); + put(177, "plusmn"); + put(178, "sup2"); + put(179, "sup3"); + put(180, "acute"); + put(181, "micro"); + put(182, "para"); + put(183, "middot"); + put(184, "cedil"); + put(185, "sup1"); + put(186, "ordm"); + put(187, "raquo"); + put(188, "frac14"); + put(189, "frac12"); + put(190, "frac34"); + put(191, "iquest"); + put(192, "Agrave"); + put(193, "Aacute"); + put(194, "Acirc"); + put(195, "Atilde"); + put(196, "Auml"); + put(197, "Aring"); + put(198, "AElig"); + put(199, "Ccedil"); + put(200, "Egrave"); + put(201, "Eacute"); + put(202, "Ecirc"); + put(203, "Euml"); + put(204, "Igrave"); + put(205, "Iacute"); + put(206, "Icirc"); + put(207, "Iuml"); + put(208, "ETH"); + put(209, "Ntilde"); + put(210, "Ograve"); + put(211, "Oacute"); + put(212, "Ocirc"); + put(213, "Otilde"); + put(214, "Ouml"); + put(215, "times"); + put(216, "Oslash"); + put(217, "Ugrave"); + put(218, "Uacute"); + put(219, "Ucirc"); + put(220, "Uuml"); + put(221, "Yacute"); + put(222, "THORN"); + put(223, "szlig"); + put(224, "agrave"); + put(225, "aacute"); + put(226, "acirc"); + put(227, "atilde"); + put(228, "auml"); + put(229, "aring"); + put(230, "aelig"); + put(231, "ccedil"); + put(232, "egrave"); + put(233, "eacute"); + put(234, "ecirc"); + put(235, "euml"); + put(236, "igrave"); + put(237, "iacute"); + put(238, "icirc"); + put(239, "iuml"); + put(240, "eth"); + put(241, "ntilde"); + put(242, "ograve"); + put(243, "oacute"); + put(244, "ocirc"); + put(245, "otilde"); + put(246, "ouml"); + put(247, "divide"); + put(248, "oslash"); + put(249, "ugrave"); + put(250, "uacute"); + put(251, "ucirc"); + put(252, "uuml"); + put(253, "yacute"); + put(254, "thorn"); + put(255, "yuml"); + put(402, "fnof"); + put(913, "Alpha"); + put(914, "Beta"); + put(915, "Gamma"); + put(916, "Delta"); + put(917, "Epsilon"); + put(918, "Zeta"); + put(919, "Eta"); + put(920, "Theta"); + put(921, "Iota"); + put(922, "Kappa"); + put(923, "Lambda"); + put(924, "Mu"); + put(925, "Nu"); + put(926, "Xi"); + put(927, "Omicron"); + put(928, "Pi"); + put(929, "Rho"); + put(931, "Sigma"); + put(932, "Tau"); + put(933, "Upsilon"); + put(934, "Phi"); + put(935, "Chi"); + put(936, "Psi"); + put(937, "Omega"); + put(945, "alpha"); + put(946, "beta"); + put(947, "gamma"); + put(948, "delta"); + put(949, "epsilon"); + put(950, "zeta"); + put(951, "eta"); + put(952, "theta"); + put(953, "iota"); + put(954, "kappa"); + put(955, "lambda"); + put(956, "mu"); + put(957, "nu"); + put(958, "xi"); + put(959, "omicron"); + put(960, "pi"); + put(961, "rho"); + put(962, "sigmaf"); + put(963, "sigma"); + put(964, "tau"); + put(965, "upsilon"); + put(966, "phi"); + put(967, "chi"); + put(968, "psi"); + put(969, "omega"); + put(977, "thetasym"); + put(978, "upsih"); + put(982, "piv"); + put(8226, "bull"); + put(8230, "hellip"); + put(8242, "prime"); + put(8243, "Prime"); + put(8254, "oline"); + put(8260, "frasl"); + put(8472, "weierp"); + put(8465, "image"); + put(8476, "real"); + put(8482, "trade"); + put(8501, "alefsym"); + put(8592, "larr"); + put(8593, "uarr"); + put(8594, "rarr"); + put(8595, "darr"); + put(8596, "harr"); + put(8629, "crarr"); + put(8656, "lArr"); + put(8657, "uArr"); + put(8658, "rArr"); + put(8659, "dArr"); + put(8660, "hArr"); + put(8704, "forall"); + put(8706, "part"); + put(8707, "exist"); + put(8709, "empty"); + put(8711, "nabla"); + put(8712, "isin"); + put(8713, "notin"); + put(8715, "ni"); + put(8719, "prod"); + put(8721, "sum"); + put(8722, "minus"); + put(8727, "lowast"); + put(8730, "radic"); + put(8733, "prop"); + put(8734, "infin"); + put(8736, "ang"); + put(8743, "and"); + put(8744, "or"); + put(8745, "cap"); + put(8746, "cup"); + put(8747, "int"); + put(8756, "there4"); + put(8764, "sim"); + put(8773, "cong"); + put(8776, "asymp"); + put(8800, "ne"); + put(8801, "equiv"); + put(8804, "le"); + put(8805, "ge"); + put(8834, "sub"); + put(8835, "sup"); + put(8836, "nsub"); + put(8838, "sube"); + put(8839, "supe"); + put(8853, "oplus"); + put(8855, "otimes"); + put(8869, "perp"); + put(8901, "sdot"); + put(8968, "lceil"); + put(8969, "rceil"); + put(8970, "lfloor"); + put(8971, "rfloor"); + put(9001, "lang"); + put(9002, "rang"); + put(9674, "loz"); + put(9824, "spades"); + put(9827, "clubs"); + put(9829, "hearts"); + put(9830, "diams"); + put(34, "quot"); + put(38, "amp"); + put(60, "lt"); + put(62, "gt"); + put(338, "OElig"); + put(339, "oelig"); + put(352, "Scaron"); + put(353, "scaron"); + put(376, "Yuml"); + put(710, "circ"); + put(732, "tilde"); + put(8194, "ensp"); + put(8195, "emsp"); + put(8201, "thinsp"); + put(8204, "zwnj"); + put(8205, "zwj"); + put(8206, "lrm"); + put(8207, "rlm"); + put(8211, "ndash"); + put(8212, "mdash"); + put(8216, "lsquo"); + put(8217, "rsquo"); + put(8218, "sbquo"); + put(8220, "ldquo"); + put(8221, "rdquo"); + put(8222, "bdquo"); + put(8224, "dagger"); + put(8225, "Dagger"); + put(8240, "permil"); + put(8249, "lsaquo"); + put(8250, "rsaquo"); + put(8364, "euro"); + } + + protected final void put(int c, String entity) + { + charToEntity[c] =3D entity; + } + + protected final void remove(int c) + { + charToEntity[c] =3D null; + } + + /** + * Returns null if no entity is found or return the converted entity. + * + * @param c the char to encode + * @return the corresponding encoded string or null + */ + public final String lookup(char c) + { + return charToEntity[c]; + } +} Added: modules/common/trunk/common/src/test/java/org/jboss/portal/test/comm= on/text/EntityEncoderTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/= text/EntityEncoderTestCase.java (rev 0) +++ modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/= text/EntityEncoderTestCase.java 2008-02-01 18:10:37 UTC (rev 9702) @@ -0,0 +1,60 @@ +/*************************************************************************= ***** + * 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.text; + +import junit.framework.TestCase; +import org.jboss.portal.common.text.EntityEncoder; +import org.jboss.portal.common.text.CharBuffer; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class EntityEncoderTestCase extends TestCase +{ + + public void testChar() + { + CharBuffer buffer =3D new CharBuffer(); + EntityEncoder.FULL.encode('&', buffer); + assertEquals("&", buffer.asString(true)); + EntityEncoder.FULL.encode('c', buffer); + assertEquals("c", buffer.asString(true)); + } + + public void testString() + { + test("&", "&"); + test("&bar", "&bar"); + test("foo&", "foo&"); + test("foo&bar", "foo&bar"); + } + + private void test(String expected, String actual) + { + CharBuffer buffer =3D new CharBuffer(); + EntityEncoder.FULL.encode(actual, buffer); + assertEquals(expected, buffer.asString()); + } + +} --===============8074724752559375601==-- From portal-commits at lists.jboss.org Fri Feb 1 15:04:10 2008 Content-Type: multipart/mixed; boundary="===============2039205678258423640==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9703 - in modules/identity/trunk/sso: src/main/java/org/jboss/portal/identity/sso/josso and 1 other directory. Date: Fri, 01 Feb 2008 15:04:09 -0500 Message-ID: --===============2039205678258423640== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sohil.shah(a)jboss.com Date: 2008-02-01 15:04:09 -0500 (Fri, 01 Feb 2008) New Revision: 9703 Modified: modules/identity/trunk/sso/build.xml modules/identity/trunk/sso/pom.xml modules/identity/trunk/sso/src/main/java/org/jboss/portal/identity/sso/j= osso/JOSSOLogoutValve.java Log: build cleanup Modified: modules/identity/trunk/sso/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/identity/trunk/sso/build.xml 2008-02-01 18:10:37 UTC (rev 9702) +++ modules/identity/trunk/sso/build.xml 2008-02-01 20:04:09 UTC (rev 9703) @@ -44,26 +44,30 @@ http://repository.jboss.com/cas/3.0.7/lib/casclient-lenient.jar --> = = + + + = + = = + = + + = + = + + = - + = = - + = = = - + = - - - - = = - - = - = + = - + = = @@ -77,63 +81,74 @@ It also deploys any custom configuration/dependencies into the JOSSO war= file which is the JOSSO Authentication Server --> - - - = + = - = - = = - = + + = + = = + = + = + = + = - - = + + = = - - = - + = + + + + + + + + = - - = + + = = - - = + + = = = - - + = = - - = = - = + + = + + + + = = + = = + + = + = = = - + @@ -148,26 +163,27 @@ = - - - - - + + + + + - + - - - - - - - - - - - + + + + + + + + + + + + --> Modified: modules/identity/trunk/sso/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/identity/trunk/sso/pom.xml 2008-02-01 18:10:37 UTC (rev 9702) +++ modules/identity/trunk/sso/pom.xml 2008-02-01 20:04:09 UTC (rev 9703) @@ -23,9 +23,17 @@ josso + josso-common + + + josso josso-tomcat55-plugin + josso + josso-jboss4-plugin + = + ja-sig-cas cas-server @@ -40,6 +48,26 @@ org.springframework spring + + + commons-configuration + commons-configuration + 1.2 + + + commons-discovery + commons-discovery + 0.4 + + + xmldb + xmldb-common + 20021220 + + + axis + axis + 1.4 = = @@ -50,11 +78,16 @@ maven-antrun-extended-plugin 1.13 = + + + + = Modified: modules/identity/trunk/sso/src/main/java/org/jboss/portal/identit= y/sso/josso/JOSSOLogoutValve.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/identity/trunk/sso/src/main/java/org/jboss/portal/identity/sso/= josso/JOSSOLogoutValve.java 2008-02-01 18:10:37 UTC (rev 9702) +++ modules/identity/trunk/sso/src/main/java/org/jboss/portal/identity/sso/= josso/JOSSOLogoutValve.java 2008-02-01 20:04:09 UTC (rev 9703) @@ -45,7 +45,8 @@ public void invoke(Request request, Response response) throws IOExcepti= on, ServletException { - HttpServletRequest httpRequest =3D (HttpServletRequest) request; = = + HttpServletRequest httpRequest =3D (HttpServletRequest) request; = + request.setAttribute("ssoEnabled", "true"); = Cookie jossoPortalCookie =3D this.findJOSSOPortalLogoutCookie(httpRe= quest); if(jossoPortalCookie !=3D null) --===============2039205678258423640==-- From portal-commits at lists.jboss.org Fri Feb 1 15:15:40 2008 Content-Type: multipart/mixed; boundary="===============3468724194984439155==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9704 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller. Date: Fri, 01 Feb 2008 15:15:40 -0500 Message-ID: --===============3468724194984439155== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-01 15:15:37 -0500 (Fri, 01 Feb 2008) New Revision: 9704 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletController.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletRequestHandler.java Log: - Moved PortletController.deliverEvent to PortletRequestHandler as it's onl= y used there. - Removed useless calls to downcastRequest in PortletRequestHandler. Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletController.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletController.java 2008-02-01 20:04:09 UTC (rev 9703) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletController.java 2008-02-01 20:15:37 UTC (rev 9704) @@ -22,7 +22,6 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.controller; = -import org.apache.log4j.Logger; import org.jboss.portal.Mode; import org.jboss.portal.WindowState; import org.jboss.portal.common.util.MarkupInfo; @@ -40,30 +39,23 @@ import org.jboss.portal.portlet.impl.spi.AbstractServerContext; import org.jboss.portal.portlet.impl.spi.AbstractUserContext; import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; -import org.jboss.portal.portlet.info.NavigationInfo; -import org.jboss.portal.portlet.info.ParameterInfo; -import org.jboss.portal.portlet.invocation.EventInvocation; import org.jboss.portal.portlet.invocation.RenderInvocation; import org.jboss.portal.portlet.invocation.response.ErrorResponse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.ResponseProperties; -import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStat= eResponse; import org.jboss.portal.portlet.spi.PortalContext; import org.jboss.portal.portlet.test.PageNavigationalState; import org.jboss.portal.portlet.test.PortletURLRenderer; -import org.jboss.portal.portlet.test.TestEventContext; import org.jboss.portal.portlet.test.TestInstanceContext; import org.jboss.portal.portlet.test.TestRenderContext; import org.jboss.portal.portlet.test.WindowNavigationalState; -import org.jboss.portal.portlet.test.event.Event; import org.jboss.portal.web.IllegalRequestException; import org.w3c.dom.Element; = import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.xml.namespace.QName; import java.io.IOException; import java.io.PrintWriter; import java.io.UnsupportedEncodingException; @@ -88,16 +80,10 @@ // private final boolean redirectAfterAction =3D true; = /** . */ - private final Logger log; - - /** . */ private final PortalContext portalContext; = public PortletController() throws IllegalRequestException, UnsupportedE= ncodingException { - // - this.log =3D Logger.getLogger(PortletController.class); - Map portalProperties =3D new HashMap= (); portalProperties.put("javax.portlet.markup.head.element.support", "t= rue"); = @@ -128,64 +114,6 @@ handler.handle(controllerRequest); } = - PortletInvocationResponse deliverEvent( - PortletControllerContext context, - Event event, - PageNavigationalState pageNS, - List requestCookies) throws PortletInvokerException - { - Portlet portlet =3D context.getPortlet(event.getPortletContext().get= Id()); - HttpServletRequest req =3D context.getClientRequest(); - HttpServletResponse resp =3D context.getClientResponse(); - WindowNavigationalState windowNS =3D pageNS.getWindowNavigationalSta= te(portlet.getContext().getId()); - PortletURLRenderer renderer =3D new PortletURLRenderer(pageNS, windo= wNS, portlet, req, resp); - - // - if (windowNS =3D=3D null) - { - windowNS =3D new WindowNavigationalState(); - } - - // - ParameterMap publicNS =3D pageNS.getPublicNavigationalState(portlet); - - // - TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), true); - TestEventContext actionContext =3D new TestEventContext( - renderer, - windowNS.getMode(), - windowNS.getWindowState(), - windowNS.getPortletNavigationalState(), - publicNS, - MARKUP_INFO, - event.getName(), - event.getPayload()); - EventInvocation eventInvocation =3D new EventInvocation(actionContex= t); - - // - eventInvocation.setClientContext(new AbstractClientContext(req, requ= estCookies)); - eventInvocation.setServerContext(new AbstractServerContext(req, resp= )); - eventInvocation.setInstanceContext(instanceContext); - eventInvocation.setUserContext(new AbstractUserContext(req)); - eventInvocation.setWindowContext(new AbstractWindowContext(portlet.g= etContext().getId())); - eventInvocation.setPortalContext(getPortalContext()); - eventInvocation.setSecurityContext(new AbstractSecurityContext(req)); - eventInvocation.setTarget(instanceContext.getTarget()); - - // - try - { - return context.invoke(eventInvocation); - } - catch (PortletInvokerException e) - { - log.error("Error during event invocation", e); - - // - return null; - } - } - /** * @param context * @param pageProperties properties that needs to be rendered on this p= age @@ -382,71 +310,6 @@ } } = - void updateNavigationalState( - PortletControllerContext context, - String portletId, - UpdateNavigationalStateResponse update, - PageNavigationalState pageState) throws PortletInvokerException - { - Portlet portlet =3D context.getPortlet(portletId); - - // - WindowNavigationalState windowNS =3D pageState.getWindowNavigational= State(portletId); - - // - if (windowNS =3D=3D null) - { - windowNS =3D new WindowNavigationalState(); - } - - // - Mode mode =3D windowNS.getMode(); - if (update.getMode() !=3D null) - { - mode =3D update.getMode(); - } - WindowState windowState =3D windowNS.getWindowState(); - if (update.getWindowState() !=3D null) - { - windowState =3D update.getWindowState(); - } - StateString portletNS =3D windowNS.getPortletNavigationalState(); - if (update.getNavigationalState() !=3D null) - { - portletNS =3D update.getNavigationalState(); - } - windowNS =3D new WindowNavigationalState(portletNS, mode, windowStat= e); - pageState.setWindowNavigationalState(portletId, windowNS); - - // Now update shared state scoped at page - Map publicNS =3D update.getPublicNavigationalState= Updates(); - if (publicNS !=3D null) - { - NavigationInfo navigationInfo =3D portlet.getInfo().getNavigation= (); - Map pageNS =3D pageState.getPageNavigationalStat= e(); - for (Map.Entry entry : publicNS.entrySet()) - { - String id =3D entry.getKey(); - ParameterInfo parameterInfo =3D navigationInfo.getPublicParame= ter(id); - - // - if (parameterInfo !=3D null) - { - QName name =3D parameterInfo.getName(); - String[] value =3D entry.getValue(); - if (value.length > 0) - { - pageNS.put(name, value); - } - else - { - pageNS.remove(name); - } - } - } - } - } - PortalContext getPortalContext() { return portalContext; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletRequestHandler.java 2008-02-01 20:04:09 UTC (rev 9703) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletRequestHandler.java 2008-02-01 20:15:37 UTC (rev 9704) @@ -10,13 +10,17 @@ import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletContext; import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.impl.spi.AbstractClientContext; import org.jboss.portal.portlet.impl.spi.AbstractRequestContext; import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; import org.jboss.portal.portlet.impl.spi.AbstractServerContext; import org.jboss.portal.portlet.impl.spi.AbstractUserContext; import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; +import org.jboss.portal.portlet.info.NavigationInfo; +import org.jboss.portal.portlet.info.ParameterInfo; import org.jboss.portal.portlet.invocation.ActionInvocation; +import org.jboss.portal.portlet.invocation.EventInvocation; import org.jboss.portal.portlet.invocation.response.ErrorResponse; import org.jboss.portal.portlet.invocation.response.HTTPRedirectionRespons= e; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; @@ -26,16 +30,21 @@ import org.jboss.portal.portlet.test.PageNavigationalState; import org.jboss.portal.portlet.test.PortletURLRenderer; import org.jboss.portal.portlet.test.TestActionContext; +import org.jboss.portal.portlet.test.TestEventContext; import org.jboss.portal.portlet.test.TestInstanceContext; +import org.jboss.portal.portlet.test.WindowNavigationalState; import static org.jboss.portal.portlet.test.controller.PortletController.*; import org.jboss.portal.portlet.test.event.Event; import org.jboss.portal.portlet.test.event.EventControllerContext; = +import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.xml.namespace.QName; import java.io.IOException; import java.util.LinkedList; import java.util.List; +import java.util.Map; = /** * @author Chris Laprun @@ -58,10 +67,8 @@ return (PortletRequest)request; } = - void processResponse(PortletRequest request, PortletInvocationResponse = response) throws IOException, PortletInvokerException + void processResponse(PortletRequest portletRequest, PortletInvocationRe= sponse response) throws IOException, PortletInvokerException { - PortletRequest portletRequest =3D downcastRequest(request); - PortletControllerContext context =3D portletRequest.controllerContex= t; = // @@ -93,7 +100,7 @@ if (response instanceof UpdateNavigationalStateResponse) { UpdateNavigationalStateResponse updateResponse =3D (UpdateNavi= gationalStateResponse)response; - controller.updateNavigationalState(context, portletRequest.por= tletId, updateResponse, portletRequest.pageState); + updateNavigationalState(context, portletRequest.portletId, upd= ateResponse, portletRequest.pageState); = // ResponseProperties update =3D updateResponse.getProperties(); @@ -122,7 +129,7 @@ Event event =3D eventQueue.removeFirst(); = // - PortletInvocationResponse eventResponse =3D controller.deliver= Event(context, event, portletRequest.pageState, requestProperties.getCookie= s()); + PortletInvocationResponse eventResponse =3D deliverEvent(conte= xt, event, portletRequest.pageState, requestProperties.getCookies()); = // if (eventResponse instanceof UpdateNavigationalStateResponse) @@ -130,7 +137,7 @@ UpdateNavigationalStateResponse update =3D (UpdateNavigatio= nalStateResponse)eventResponse; = // Update ns - controller.updateNavigationalState(context, event.getPortle= tContext().getId(), update, portletRequest.pageState); + updateNavigationalState(context, event.getPortletContext().= getId(), update, portletRequest.pageState); = // Add events if any for (StateResponse.Event portletEvent : update.getEvents()) @@ -197,10 +204,8 @@ controller.render(context, requestProperties, portletRequest.pageSta= te); } = - PortletInvocationResponse invoke(PortletRequest controllerRequest) thro= ws PortletInvokerException + PortletInvocationResponse invoke(PortletRequest portletRequest) throws = PortletInvokerException { - PortletRequest portletRequest =3D downcastRequest(controllerRequest); - PortletControllerContext context =3D portletRequest.controllerContex= t; Portlet portlet =3D context.getPortlet(portletRequest.portletId); HttpServletRequest req =3D context.getClientRequest(); @@ -284,4 +289,122 @@ } } = + private PortletInvocationResponse deliverEvent(PortletControllerContext= context, Event event, + PageNavigationalState pa= geNS, List requestCookies) + throws PortletInvokerException + { + Portlet portlet =3D context.getPortlet(event.getPortletContext().get= Id()); + HttpServletRequest req =3D context.getClientRequest(); + HttpServletResponse resp =3D context.getClientResponse(); + WindowNavigationalState windowNS =3D pageNS.getWindowNavigationalSta= te(portlet.getContext().getId()); + PortletURLRenderer renderer =3D new PortletURLRenderer(pageNS, windo= wNS, portlet, req, resp); + + // + if (windowNS =3D=3D null) + { + windowNS =3D new WindowNavigationalState(); + } + + // + ParameterMap publicNS =3D pageNS.getPublicNavigationalState(portlet); + + // + TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), true); + TestEventContext actionContext =3D new TestEventContext( + renderer, + windowNS.getMode(), + windowNS.getWindowState(), + windowNS.getPortletNavigationalState(), + publicNS, + MARKUP_INFO, + event.getName(), + event.getPayload()); + EventInvocation eventInvocation =3D new EventInvocation(actionContex= t); + + // + eventInvocation.setClientContext(new AbstractClientContext(req, requ= estCookies)); + eventInvocation.setServerContext(new AbstractServerContext(req, resp= )); + eventInvocation.setInstanceContext(instanceContext); + eventInvocation.setUserContext(new AbstractUserContext(req)); + eventInvocation.setWindowContext(new AbstractWindowContext(portlet.g= etContext().getId())); + eventInvocation.setPortalContext(controller.getPortalContext()); + eventInvocation.setSecurityContext(new AbstractSecurityContext(req)); + eventInvocation.setTarget(instanceContext.getTarget()); + + // + try + { + return context.invoke(eventInvocation); + } + catch (PortletInvokerException e) + { + log.error("Error during event invocation", e); + + // + return null; + } + } + + private void updateNavigationalState(PortletControllerContext context, = String portletId, + UpdateNavigationalStateResponse up= date, PageNavigationalState pageState) + throws PortletInvokerException + { + Portlet portlet =3D context.getPortlet(portletId); + + // + WindowNavigationalState windowNS =3D pageState.getWindowNavigational= State(portletId); + + // + if (windowNS =3D=3D null) + { + windowNS =3D new WindowNavigationalState(); + } + + // + Mode mode =3D windowNS.getMode(); + if (update.getMode() !=3D null) + { + mode =3D update.getMode(); + } + WindowState windowState =3D windowNS.getWindowState(); + if (update.getWindowState() !=3D null) + { + windowState =3D update.getWindowState(); + } + StateString portletNS =3D windowNS.getPortletNavigationalState(); + if (update.getNavigationalState() !=3D null) + { + portletNS =3D update.getNavigationalState(); + } + windowNS =3D new WindowNavigationalState(portletNS, mode, windowStat= e); + pageState.setWindowNavigationalState(portletId, windowNS); + + // Now update shared state scoped at page + Map publicNS =3D update.getPublicNavigationalState= Updates(); + if (publicNS !=3D null) + { + NavigationInfo navigationInfo =3D portlet.getInfo().getNavigation= (); + Map pageNS =3D pageState.getPageNavigationalStat= e(); + for (Map.Entry entry : publicNS.entrySet()) + { + String id =3D entry.getKey(); + ParameterInfo parameterInfo =3D navigationInfo.getPublicParame= ter(id); + + // + if (parameterInfo !=3D null) + { + QName name =3D parameterInfo.getName(); + String[] value =3D entry.getValue(); + if (value.length > 0) + { + pageNS.put(name, value); + } + else + { + pageNS.remove(name); + } + } + } + } + } } --===============3468724194984439155==-- From portal-commits at lists.jboss.org Fri Feb 1 15:46:13 2008 Content-Type: multipart/mixed; boundary="===============8833324887703128420==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9705 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api and 2 other directories. Date: Fri, 01 Feb 2008 15:46:11 -0500 Message-ID: --===============8833324887703128420== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-01 15:46:11 -0500 (Fri, 01 Feb 2008) New Revision: 9705 Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portleturl/URLRenderer.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletParameterMap.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/BaseURLImpl.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portleturl/CallbackQueue.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portleturl/PortletURLSnapshot.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portleturl/URLGenerationListenerTestCase.java modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml Log: - make current url listener tests more robust Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletParameterMap.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletParameterMap.java 2008-02-01 20:15:37 UTC (rev 9704) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletParameterMap.java 2008-02-01 20:46:11 UTC (rev 9705) @@ -45,24 +45,28 @@ private NavigationInfo navigationInfo; = /** . */ - private Map entries =3D new HashMap(); + private Map entries; = /** . */ - private Set publicEntryRemovals =3D new HashSet(); + private Set publicEntryRemovals; = /** . */ - private TypedMap combinedMa= p =3D new TypedMap(entries, key= Converter, valueConverter); + private TypedMap combinedMa= p; = public PortletParameterMap(NavigationInfo navigationInfo) { this.navigationInfo =3D navigationInfo; + this.entries =3D new HashMap(); + this.publicEntryRemovals =3D new HashSet(); + this.combinedMap =3D new TypedMap(entries, keyConverter, valueConverter); } = public PortletParameterMap(PortletParameterMap original) { this.navigationInfo =3D original.navigationInfo; this.entries =3D new HashMap(original.entr= ies); - this.publicEntryRemovals =3D new HashSet(publicEntryRemovals= ); + this.publicEntryRemovals =3D new HashSet(original.publicEntr= yRemovals); + this.combinedMap =3D new TypedMap(entries, keyConverter, valueConverter); } = public String getParameterValue(String name) Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/BaseURLImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/BaseURLImpl.java 2008-02-01 20:15:37 UTC (rev 9704) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/BaseURLImpl.java 2008-02-01 20:46:11 UTC (rev 9705) @@ -26,6 +26,8 @@ import org.jboss.portal.portlet.spi.PortletInvocationContext; import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl; import org.jboss.portal.common.NotYetImplemented; +import org.jboss.portal.common.io.WriterCharWriter; +import org.jboss.portal.common.text.EntityEncoder; = import javax.portlet.BaseURL; import javax.portlet.PortletSecurityException; @@ -102,12 +104,12 @@ = public void write(Writer writer) throws IOException { - throw new NotYetImplemented(); + writer.write(toString()); } = public void write(Writer writer, boolean b) throws IOException { - throw new NotYetImplemented(); + EntityEncoder.FULL.encode(toString(), new WriterCharWriter(writer)); } = public void addProperty(String s, String s1) Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/portleturl/CallbackQueue.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/CallbackQueue.java 2008-02-01 20:15:37 UTC (rev 97= 04) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/CallbackQueue.java 2008-02-01 20:46:11 UTC (rev 97= 05) @@ -45,6 +45,11 @@ return queue.removeFirst(); } = + public static void clear() + { + queue.clear(); + } + public static int size() { return queue.size(); Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/portleturl/PortletURLSnapshot.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/PortletURLSnapshot.java 2008-02-01 20:15:37 UTC (r= ev 9704) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/PortletURLSnapshot.java 2008-02-01 20:46:11 UTC (r= ev 9705) @@ -29,7 +29,6 @@ import javax.portlet.PortletURL; import javax.portlet.ResourceURL; import java.util.Map; -import java.util.LinkedList; = /** * @author Julien Viet @@ -62,6 +61,9 @@ /** . */ final Map parameters; = + /** . */ + final String cacheability; + public static PortletURLSnapshot createActionURL(String source, Portlet= URL actionURL) { return new PortletURLSnapshot(source, ACTION, actionURL); @@ -82,14 +84,14 @@ return new PortletURLSnapshot(source, ACTION, portletMode, windowSta= te, parameters); } = - public static PortletURLSnapshot createRenderRL(String source, PortletM= ode portletMode, WindowState windowState, Map parameters) + public static PortletURLSnapshot createRenderURL(String source, Portlet= Mode portletMode, WindowState windowState, Map parameters) { return new PortletURLSnapshot(source, RENDER, portletMode, windowSta= te, parameters); } = - public static PortletURLSnapshot createResourceURL(String source, Map parameters) + public static PortletURLSnapshot createResourceURL(String source, Map parameters, String cacheability) { - return new PortletURLSnapshot(source, parameters); + return new PortletURLSnapshot(source, parameters, cacheability); } = private PortletURLSnapshot(String source, int type, PortletURL portletU= RL) @@ -99,15 +101,17 @@ this.portletMode =3D portletURL.getPortletMode(); this.windowState =3D portletURL.getWindowState(); this.parameters =3D portletURL.getParameterMap(); + this.cacheability =3D null; } = - private PortletURLSnapshot(String source, ResourceURL portletURL) + private PortletURLSnapshot(String source, ResourceURL resourceURL) { this.source =3D source; this.type =3D RESOURCE; this.portletMode =3D null; this.windowState =3D null; - this.parameters =3D portletURL.getParameterMap(); + this.parameters =3D resourceURL.getParameterMap(); + this.cacheability =3D resourceURL.getCacheability(); } = private PortletURLSnapshot(String source, int type, PortletMode portlet= Mode, WindowState windowState, Map parameters) @@ -117,15 +121,17 @@ this.portletMode =3D portletMode; this.windowState =3D windowState; this.parameters =3D parameters; + this.cacheability =3D null; } = - private PortletURLSnapshot(String source, Map paramet= ers) + private PortletURLSnapshot(String source, Map paramet= ers, String cacheability) { this.source =3D source; this.type =3D RESOURCE; this.portletMode =3D null; this.windowState =3D null; this.parameters =3D parameters; + this.cacheability =3D cacheability; } = public void assertEquals(PortletURLSnapshot actual) @@ -140,7 +146,7 @@ } if (type =3D=3D RESOURCE) { - + Assert.assertEquals(cacheability, actual.cacheability); } else { Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/portleturl/URLGenerationListenerTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/URLGenerationListenerTestCase.java 2008-02-01 20:1= 5:37 UTC (rev 9704) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/URLGenerationListenerTestCase.java 2008-02-01 20:4= 6:11 UTC (rev 9705) @@ -25,11 +25,15 @@ import org.jboss.portal.unit.annotations.TestCase; import org.jboss.portal.unit.PortletTestCase; import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.Assertion; import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.unit.actions.PortletResourceTestAction; import org.jboss.portal.test.portlet.framework.UTP1; import org.jboss.unit.driver.DriverResponse; import org.jboss.unit.driver.response.EndTestResponse; import static org.jboss.unit.api.Assert.*; +import org.jboss.unit.api.Assert; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; = import javax.portlet.Portlet; import javax.portlet.RenderRequest; @@ -37,14 +41,22 @@ import javax.portlet.PortletException; import javax.portlet.PortletURL; import javax.portlet.PortletMode; +import javax.portlet.ResourceURL; +import javax.portlet.BaseURL; +import javax.portlet.PortletRequest; +import javax.portlet.MimeResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; import java.io.IOException; +import java.io.StringWriter; import java.util.HashMap; +import java.util.Collections; = /** * @author Julien Viet * @version $Revision: 630 $ */ -(a)TestCase +(a)TestCase({Assertion.JSR286_47,Assertion.JSR286_48,Assertion.JSR286_49,A= ssertion.JSR286_51}) public class URLGenerationListenerTestCase { public URLGenerationListenerTestCase(PortletTestCase seq) @@ -53,31 +65,125 @@ { protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException { - PortletURL actionURL =3D response.createActionURL(); + test(response, URLRenderer.ToString); + test(response, URLRenderer.Write); + test(response, URLRenderer.WriteXMLEspaced); = - URLGenerationListener1.delegate =3D CallbackQueue.createListen= er("l1"); - URLGenerationListener2.delegate =3D CallbackQueue.createListen= er("l2"); - // - actionURL.toString(); - PortletURLSnapshot actionSnapshot1 =3D CallbackQueue.next(); - PortletURLSnapshot actionSnapshot2 =3D CallbackQueue.next(); - assertEquals(0, CallbackQueue.size()); - actionSnapshot1.assertEquals(PortletURLSnapshot.createActionUR= L("l1", null, null, new HashMap())); - actionSnapshot2.assertEquals(PortletURLSnapshot.createActionUR= L("l2", null, null, new HashMap())); + return new InvokeGetResponse(response.createResourceURL().toSt= ring()); + } + }); + seq.bindAction(1, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + { + protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException + { + test(response, URLRenderer.ToString); + test(response, URLRenderer.Write); + test(response, URLRenderer.WriteXMLEspaced); = // - actionURL.setPortletMode(PortletMode.EDIT); - actionURL.toString(); - actionSnapshot1 =3D CallbackQueue.next(); - actionSnapshot2 =3D CallbackQueue.next(); - assertEquals(0, CallbackQueue.size()); - actionSnapshot1.assertEquals(PortletURLSnapshot.createActionUR= L("l1", PortletMode.EDIT, null, new HashMap())); - actionSnapshot2.assertEquals(PortletURLSnapshot.createActionUR= L("l2", PortletMode.EDIT, null, new HashMap())); - - // return new EndTestResponse(); } }); } + + protected DriverResponse test(MimeResponse response, URLRenderer render= er) throws PortletException, IOException + { + CallbackQueue.clear(); + PortletURL actionURL =3D response.createActionURL(); + URLGenerationListener1.delegate =3D CallbackQueue.createListener("l1= "); + URLGenerationListener2.delegate =3D CallbackQueue.createListener("l2= "); + assertEquals(0, CallbackQueue.size()); + + // Assert initial state + renderer.render(actionURL); + PortletURLSnapshot actionSnapshot1 =3D CallbackQueue.next(); + PortletURLSnapshot actionSnapshot2 =3D CallbackQueue.next(); + assertEquals(0, CallbackQueue.size()); + actionSnapshot1.assertEquals(PortletURLSnapshot.createActionURL("l1"= , null, null, new HashMap())); + actionSnapshot2.assertEquals(PortletURLSnapshot.createActionURL("l2"= , null, null, new HashMap())); + + // Assert portlet mode change is propagated + actionURL.setPortletMode(PortletMode.EDIT); + renderer.render(actionURL); + actionSnapshot1 =3D CallbackQueue.next(); + actionSnapshot2 =3D CallbackQueue.next(); + assertEquals(0, CallbackQueue.size()); + actionSnapshot1.assertEquals(PortletURLSnapshot.createActionURL("l1"= , PortletMode.EDIT, null, new HashMap())); + actionSnapshot2.assertEquals(PortletURLSnapshot.createActionURL("l2"= , PortletMode.EDIT, null, new HashMap())); + + // Assert parameter change is propagated + actionURL.setParameter("foo", "bar"); + renderer.render(actionURL); + actionSnapshot1 =3D CallbackQueue.next(); + actionSnapshot2 =3D CallbackQueue.next(); + assertEquals(0, CallbackQueue.size()); + actionSnapshot1.assertEquals(PortletURLSnapshot.createActionURL("l1"= , PortletMode.EDIT, null, Collections.singletonMap("foo", new String[]{"bar= "}))); + actionSnapshot2.assertEquals(PortletURLSnapshot.createActionURL("l2"= , PortletMode.EDIT, null, Collections.singletonMap("foo", new String[]{"bar= "}))); + + // + PortletURL renderURL =3D response.createRenderURL(); + assertEquals(0, CallbackQueue.size()); + + // Assert initial state + renderer.render(renderURL); + PortletURLSnapshot renderSnapshot1 =3D CallbackQueue.next(); + PortletURLSnapshot renderSnapshot2 =3D CallbackQueue.next(); + assertEquals(0, CallbackQueue.size()); + renderSnapshot1.assertEquals(PortletURLSnapshot.createRenderURL("l1"= , null, null, new HashMap())); + renderSnapshot2.assertEquals(PortletURLSnapshot.createRenderURL("l2"= , null, null, new HashMap())); + + // Assert portlet mode change is propagated + renderURL.setPortletMode(PortletMode.EDIT); + renderer.render(renderURL); + renderSnapshot1 =3D CallbackQueue.next(); + renderSnapshot2 =3D CallbackQueue.next(); + assertEquals(0, CallbackQueue.size()); + renderSnapshot1.assertEquals(PortletURLSnapshot.createRenderURL("l1"= , PortletMode.EDIT, null, new HashMap())); + renderSnapshot2.assertEquals(PortletURLSnapshot.createRenderURL("l2"= , PortletMode.EDIT, null, new HashMap())); + + // Assert parameter change is propagated + renderURL.setParameter("foo", "bar"); + renderer.render(renderURL); + renderSnapshot1 =3D CallbackQueue.next(); + renderSnapshot2 =3D CallbackQueue.next(); + assertEquals(0, CallbackQueue.size()); + renderSnapshot1.assertEquals(PortletURLSnapshot.createRenderURL("l1"= , PortletMode.EDIT, null, Collections.singletonMap("foo", new String[]{"bar= "}))); + renderSnapshot2.assertEquals(PortletURLSnapshot.createRenderURL("l2"= , PortletMode.EDIT, null, Collections.singletonMap("foo", new String[]{"bar= "}))); + + // + ResourceURL resourceURL =3D response.createResourceURL(); + assertEquals(0, CallbackQueue.size()); + + // Assert initial state + resourceURL.toString(); + PortletURLSnapshot resourceSnapshot1 =3D CallbackQueue.next(); + PortletURLSnapshot resourceSnapshot2 =3D CallbackQueue.next(); + assertEquals(0, CallbackQueue.size()); + resourceSnapshot1.assertEquals(PortletURLSnapshot.createResourceURL(= "l1", new HashMap(), ResourceURL.PAGE)); + resourceSnapshot2.assertEquals(PortletURLSnapshot.createResourceURL(= "l2", new HashMap(), ResourceURL.PAGE)); + + // Assert cacheability change is propagated + resourceURL.setCacheability(ResourceURL.PORTLET); + resourceURL.toString(); + resourceSnapshot1 =3D CallbackQueue.next(); + resourceSnapshot2 =3D CallbackQueue.next(); + assertEquals(0, CallbackQueue.size()); + resourceSnapshot1.assertEquals(PortletURLSnapshot.createResourceURL(= "l1", new HashMap(), ResourceURL.PORTLET)); + resourceSnapshot2.assertEquals(PortletURLSnapshot.createResourceURL(= "l2", new HashMap(), ResourceURL.PORTLET)); + + // Assert parameter change is propagated + resourceURL.setParameter("foo", "bar"); + resourceURL.toString(); + resourceSnapshot1 =3D CallbackQueue.next(); + resourceSnapshot2 =3D CallbackQueue.next(); + assertEquals(0, CallbackQueue.size()); + resourceSnapshot1.assertEquals(PortletURLSnapshot.createResourceURL(= "l1", Collections.singletonMap("foo", new String[]{"bar"}), ResourceURL.POR= TLET)); + resourceSnapshot2.assertEquals(PortletURLSnapshot.createResourceURL(= "l2", Collections.singletonMap("foo", new String[]{"bar"}), ResourceURL.POR= TLET)); + + // + return new EndTestResponse(); + } + + } Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/portleturl/URLRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/URLRenderer.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/URLRenderer.java 2008-02-01 20:46:11 UTC (rev 9705) @@ -0,0 +1,80 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.tck.portleturl; + +import static org.jboss.unit.api.Assert.createFailure; + +import javax.portlet.BaseURL; +import java.io.StringWriter; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public interface URLRenderer +{ + String render(BaseURL url); + + URLRenderer ToString =3D new URLRenderer() + { + public String render(BaseURL url) + { + return url.toString(); + } + }; + + URLRenderer Write =3D new URLRenderer() + { + public String render(BaseURL url) + { + try + { + StringWriter s =3D new StringWriter(); + url.write(s); + return s.toString(); + } + catch (IOException e) + { + throw createFailure(e); + } + } + }; + + URLRenderer WriteXMLEspaced =3D new URLRenderer() + { + public String render(BaseURL url) + { + try + { + StringWriter s =3D new StringWriter(); + url.write(s, false); + return s.toString(); + } + catch (IOException e) + { + throw createFailure(e); + } + } + }; +} Modified: modules/portlet/trunk/test/src/test/resources/test/remote-jboss-u= nit.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xm= l 2008-02-01 20:15:37 UTC (rev 9704) +++ modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xm= l 2008-02-01 20:46:11 UTC (rev 9705) @@ -4,7 +4,10 @@ xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=3D"urn:jboss:jboss-unit:1.0 jboss-unit_1_0.xsd"> = - + + + + --> + + + --> + + + --> + + = - + + + + --> + + = - - @@ -53,9 +50,7 @@ = - --> - - @@ -109,9 +104,7 @@ = - --> - - @@ -153,9 +146,7 @@ = - --> - - @@ -188,24 +179,18 @@ ---> = - - - = - --> - - @@ -218,7 +203,6 @@ ---> = - - - - - - - conf/config.xml - - - - - - - - dtd/= jboss-portlet_2_6.dtd - dtd/jbos= s-app_2_6.dtd - dtd/= portal-object_2_6.dtd - = dtd/portlet-instances_2_6.dtd - - - - - - - - - - - - - - - - portal:service=3DAuthorizationDomainRegi= stry - - - - portal:service=3DPortalAuthorizationMana= gerFactory - portal:service=3DAuthorizationDomainRegi= stry - - - - - - - - - - - - - - - portal:service=3DServletContainerFactory= - - - - true - portal:service=3DModule,type=3DIdentityServiceController - - - - - - - - - - - portal:service=3DInterceptor,type=3DServer,= name=3DSessionLock - portal:service=3DInterceptor,type=3DServer,= name=3DTransaction - portal:service=3DInterceptor,type=3DServer,= name=3DUserEvent - portal:service=3DInterceptor,type=3DServer,= name=3DSessionInvalidator - portal:service=3DInterceptor,type=3DServer,= name=3DUser - portal:service=3DInterceptor,type=3DServer,= name=3DLocale - portal:service=3DInterceptor,type=3DServer,= name=3DContentType - - - - - - - portal:service=3DControlPolicy,type=3DPo= rtal - - - - - - - - - - - - - - portal:service=3DPortalAuthorizationMana= gerFactory - - - - - - - /portal-core - /WEB-INF/jsp/header/header.jsp - /WEB-INF/jsp/header/tabs.jsp - - - portal:service=3DServerConfig - portal:service=3DPortalAuthorizationMana= gerFactory - portal:container=3DPortalObject - = - - - - portal:service=3DListenerRegistry - - - - - portal:service=3DInterceptor,type=3DCommand= ,name=3DResourceAcquisition - portal:service=3DInterceptor,type=3DCommand= ,name=3DAjax - portal:service=3DInterceptor,type=3DCommand= ,name=3DNavigationalState - portal:service=3DInterceptor,type=3DCommand= ,name=3DPortalNode - portal:service=3DInterceptor,type=3DCommand= ,name=3DPolicyEnforcement - portal:service=3DInterceptor,type=3DCommand= ,name=3DPageCustomizer - portal:service=3DInterceptor,type=3DCommand= ,name=3DControl - portal:service=3DInterceptor,type=3DCommand= ,name=3DEventBroadcaster - - - - - - - portal:service=3DPortalAuthorizationManagerFact= ory - - - - - - - - - - - portal:service=3DInterceptor,type=3DPortlet= ,name=3DConsumerCache - portal:service=3DInterceptor,type=3DPortlet= ,name=3DInstanceSecurity - portal:service=3DInterceptor,type=3DPortlet= ,name=3DPortalSessionSynchronization - - - - - - - - - - - - - - - - portal:service=3DServletContainerFactory= - - - - - - - - - - - - - - - - - - - - - - - - - - - - - portal:service=3DInterceptor,type=3DPortlet= ,name=3DValve - portal:service=3DInterceptor,type=3DPortlet= ,name=3DSecureTransport - portal:service=3DInterceptor,type=3DPortlet= ,name=3DContextDispatcher - portal:service=3DInterceptor,type=3DPortlet= ,name=3DContextTracker - portal:service=3DInterceptor,type=3DPortlet= ,name=3DPortletSessionSynchronization - portal:service=3DInterceptor,type=3DPortlet= ,name=3DWindowStates - portal:service=3DInterceptor,type=3DPortlet= ,name=3DBridge - portal:service=3DInterceptor,type=3DPortlet= ,name=3DModes - portal:service=3DInterceptor,type=3DPortlet= ,name=3DAjax - portal:service=3DInterceptor,type=3DPortlet= ,name=3DProducerCache - portal:service=3DInterceptor,type=3DPortlet= ,name=3DHeader - portal:service=3DInterceptor,type=3DPortlet= ,name=3DTransaction - - - - - - - renaissance - - - - generic - divRenderer - - - - portal:service=3DLayoutService - portal:service=3DThemeService - - - - - - - - jboss.jca:service=3DDataSourceBinding,name=3DPortalDS - - true - conf/hibernate/user/hibernate.cfg= .xml - conf/hibernate/user/setup.txt - java:/portal/IdentitySessionFactory - - - - jboss.jca:service=3DDataSourceBinding,name=3DPortalDS - jboss.jca:service=3DDataSourceBinding,name=3DPortalDS - - true - conf/hibernate/instance/hibernate= .cfg.xml - java:/portal/InstanceSessionFactory - - - - jboss.jca:service=3DDataSourceBinding,name=3DPortalDS - - true - conf/hibernate/portal/hibernate.c= fg.xml - java:/portal/PortalObjectSessionFactory= - - - - jboss.jca:service=3DDataSourceBinding,name=3DPortalDS - - true - conf/hibernate/portlet/hibernate.= cfg.xml - java:/portal/PortletSessionFactory - - - - - - - - - portal:service=3DHibernate - portal:service=3DIdentityEventManager - java:/portal/IdentityServiceController<= /attribute> - true - conf/identity/identity-config.xml - conf/identity/standardidentity= -config.xml - - - - - jboss:service=3DMail - portal:service=3DModule,type=3DIdentityServiceController - -1 - localhost - - - false - 100000 - 10000 - java:portal/MailModule - - - - jboss.securi= ty:service=3DXMLLoginConfig - jboss.se= curity:service=3DJaasSecurityManager - conf/login-config.xml - - - - - - - - - - - - - - - - - - - - - - - - - portal:service=3DHibernate,type=3DInstance - java:/portal/InstanceSess= ionFactory - true - - - - - portal:service=3DInstanceContainerContex= t - portal:service=3DInterceptorStackFactory= ,type=3DInstance - portal:service=3DPortletInvoker,type=3DF= ederating - portal:service=3DPortalAuthorizationMana= gerFactory - portal:service=3DAuthorizationDomainRegi= stry - - - - portal:service=3DHibernate,type=3DPortalObject - portal:service=3DPortalAuthorizationMana= gerFactory - portal:service=3DAuthorizationDomainRegi= stry - portal:service=3DContentProviderRegistry= - java:/portal/PortalObject= SessionFactory - true - - - - - - portal:service=3DPortalAuthorizationMana= gerFactory - portal:container=3DInstance - portal:container=3DPortalObject - portal:service=3DModule,type=3DIdentityServiceController - dashboard - - - - - - - - - portlet - portal:service=3DContentProviderRegistry= - portal:service=3DCustomizationManager - portal:container=3DInstance - portal:service=3DPortalAuthorizationMana= gerFactory - - - - - - portal:service=3DIdentityEventManager - portal:service=3DCustomizationManager - - - - portal:service=3DIdentityEventManager - portal:service=3DJAASLoginModule - - - - - - - - - portal:commandFactory=3DDelegating - portal:container=3DPortalObject - - - - - portal:container=3DPortalObject - - - - - portal:service=3DPortalObjectPathMapper,= type=3DDefault - - - - - /portal - portal:commandFactory=3DDelegating - portal:commandFactory=3DPortalObject - - - - - - - /signout - portal:commandFactory=3DDelegating - portal:commandFactory=3DSignOut - - - - portal:service=3DCustomizationManager - portal:container=3DPortalObject - - - - portal:service=3DPortalObjectPathMapper,= type=3DDashboard - - - - - /dashboard - portal:commandFactory=3DDelegating - portal:commandFactory=3DDashboard - - - - - - - /ajax - portal:commandFactory=3DDelegating - portal:commandFactory=3DAjax - - - - - - - - - - /portal - portal:urlFactory=3DDelegating - portal:service=3DPortalObjectPathMapper,= type=3DDefault - - - - /signout - portal:urlFactory=3DDelegating - - - - dashboard - /dashboard - portal:urlFactory=3DDelegating - portal:service=3DPortalObjectPathMapper,= type=3DDashboard - - - - - - - - - - - portal:service=3DInterceptorStackFactory= ,type=3DProducer - portal:service=3DWebAppRegistry - - - - - - portal:service=3DHibernate,type=3DPortlet - java:/portal/PortletSessi= onFactory - - - - true - - - - - - - portal:service=3DPortletInvoker,type=3DC= ontainer - portal:service=3DPersistenceManager,type= =3DProducer - portal:service=3DStateManagementPolicy,t= ype=3DProducer - portal:service=3DStateConverter,type=3DP= roducer - - - - - - local - portal:service=3DPortletInvoker,type=3DP= roducer - portal:service=3DPortletInvoker,type=3DF= ederating - - - - - - - - - - - portal:service=3DPageService - portal:container=3DPortalObject - - - - - - portal:service=3DResponseHandler,type=3D= Classic - portal:service=3DResponseHandler,type=3D= Ajax - - - - - - portal:container=3DPortalObject - - - - portal:container=3DPortalObject - - - - - - portal:service=3DPageService - portal:commandFactory=3DDefaultPortal - portal:urlFactory=3DDelegating - portal:service=3DInterceptorStackFactory= ,type=3DCommand - portal:container=3DPortalObject - portal:container=3DInstance - portal:service=3DPortalAuthorizationMana= gerFactory - portal:service=3DCustomizationManager - portal:service=3DContentProviderRegistry= - portal:service=3DResponseHandler,type=3D= Selector - portal:service=3DControlPolicy,type=3DPa= ge - - - - - - portal:service=3DController - - - - - - portal:service=3DServerConfig - portal:service=3DServletContainerFactory= - - - - - jboss.system:service=3DMainDeployer - portal:container=3DPortalObject - portal:container=3DInstance - portal:service=3DServer - - - - - - - portal:deployer=3DPortalWebApp - portal:container=3DPortalObject - portal:service=3DContentProviderRegistry= - portal:service=3DEntityResolver - conf/data/default-object.xml - - true - - - - - - - - portal:service=3DPortletInvokerRegistration,id=3Dlocal - portal:deployer=3DPortalWebApp - portal:service=3DWebAppRegistry - portal:service=3DServerConfig - portal:service=3DPortletSecurityService<= /depends> - portal:container=3DInstance - portal:service=3DEntityResolver - portal:service=3DEntityResolver - portal:service=3DEntityResolver - conf/st= andardjboss-portlet.xml - org.jboss.portlet.JBo= ssAPIFactory - org.jboss.portal.core.impl.p= ortlet.info.CorePortletInfoFactory - - true - - - - portal:deployer=3DPortalWebApp - portal:service=3DLayoutService - - - - portal:deployer=3DPortalWebApp - portal:service=3DLayoutService - - - - portal:deployer=3DPortalWebApp - portal:service=3DThemeService - - - - jboss.web:service= =3DWebServer - portal:deployer=3DPortalWebApp - portal:service=3DEntityResolver - - - - - portal:service=3DModule,type=3DIdentityServiceController - - - - --===============5360515060445287650==-- From portal-commits at lists.jboss.org Fri Feb 1 17:58:19 2008 Content-Type: multipart/mixed; boundary="===============1909443490159305468==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9708 - in modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/sso/src: main/org/jboss/portal/identity/sso/cas and 1 other directories. Date: Fri, 01 Feb 2008 17:58:18 -0500 Message-ID: --===============1909443490159305468== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sohil.shah(a)jboss.com Date: 2008-02-01 17:58:18 -0500 (Fri, 01 Feb 2008) New Revision: 9708 Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/sso/src/etc/cas/contex= t.xml modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/sso/src/main/org/jboss= /portal/identity/sso/cas/CASAuthenticationValve.java modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/sso/src/main/org/jboss= /portal/identity/sso/josso/JOSSOLogoutValve.java Log: JBPORTAL-1848 - Portal CAS integration does not invalidate the CAS token Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/sso/src/etc/cas= /context.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/sso/src/etc/cas/conte= xt.xml 2008-02-01 21:41:57 UTC (rev 9707) +++ modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/sso/src/etc/cas/conte= xt.xml 2008-02-01 22:58:18 UTC (rev 9708) @@ -2,6 +2,7 @@ --===============1364311053991482507== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-01 18:56:02 -0500 (Fri, 01 Feb 2008) New Revision: 9709 Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portleturl/ListenedURLUpdateTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/resourceserving/ResourceURLParametersTestCase.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/MutablePageNavigationalState.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PageNavigationalState.java Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ageNavigationalState.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/ResourceRequestImpl.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portleturl/URLGenerationListenerTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/resourceserving/DowngradeCacheabilityTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/resourceserving/HTTPMethodTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/resourceserving/ResourceIDTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/base/A= bstractUniversalTestPortlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletURLRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletController.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletControllerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletRequestHandler.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletResourceRequestHandler.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/ViewRequestHandler.java modules/portlet/trunk/test/src/test/resources/jsr286/tck/resourceserving= -war/WEB-INF/portlet.xml Log: - update the controlleur to make the page navigational state immutable in o= rder to preserve the container request not modified - added more test cases ... Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/ResourceRequestImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/ResourceRequestImpl.java 2008-02-01 22:58:18 UTC (rev 9708) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/ResourceRequestImpl.java 2008-02-01 23:56:02 UTC (rev 9709) @@ -26,9 +26,11 @@ import org.jboss.portal.portlet.spi.ResourceInvocationContext; import org.jboss.portal.portlet.impl.jsr168.ResourceRequestParameterMap; import org.jboss.portal.common.util.MultiValuedPropertyMap; +import org.jboss.portal.common.util.ParameterMap; = import javax.portlet.ResourceRequest; import java.util.Map; +import java.util.Collections; = /** * @author Julien Viet @@ -59,7 +61,17 @@ = public Map getPrivateRenderParameterMap() { - return ((ResourceRequestParameterMap)requestParameterMap).getPrivate= RenderParameters(); + ParameterMap parameters =3D ((ResourceRequestParameterMap)requestPar= ameterMap).getPrivateRenderParameters(); + + // + if (parameters !=3D null) + { + return Collections.unmodifiableMap(parameters); + } + else + { + return Collections.emptyMap(); + } } = public String getCacheability() Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/portleturl/ListenedURLUpdateTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/ListenedURLUpdateTestCase.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/ListenedURLUpdateTestCase.java 2008-02-01 23:56:02= UTC (rev 9709) @@ -0,0 +1,202 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.tck.portleturl; + +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.Assertion; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.unit.actions.PortletResourceTestAction; +import org.jboss.portal.unit.actions.PortletActionTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import static org.jboss.unit.api.Assert.*; +import static org.jboss.unit.api.Assert.assertEquals; +import org.jboss.unit.api.Assert; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.PortletURL; +import javax.portlet.PortletMode; +import javax.portlet.ResourceURL; +import javax.portlet.BaseURL; +import javax.portlet.PortletRequest; +import javax.portlet.MimeResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import javax.portlet.PortletURLGenerationListener; +import javax.portlet.PortletModeException; +import javax.portlet.WindowState; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import java.io.IOException; +import java.io.StringWriter; +import java.util.HashMap; +import java.util.Collections; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)TestCase({Assertion.JSR286_50}) +public class ListenedURLUpdateTestCase +{ + public ListenedURLUpdateTestCase(PortletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + URLGenerationListener1.delegate =3D updater; + URLGenerationListener2.delegate =3D null; + + // + PortletURL actionURL =3D response.createActionURL(); + + // + String s =3D actionURL.toString(); + + // + assertEquals(null, actionURL.getPortletMode()); + assertEquals(null, actionURL.getWindowState()); + assertEquals(0, actionURL.getParameterMap().size()); + + // + return new InvokeGetResponse(s); + } + }); + seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestActio= n() + { + protected void run(Portlet portlet, ActionRequest request, Action= Response response, PortletTestContext context) throws PortletException, IOE= xception + { + assertParameterMap(Collections.singletonMap("foo", new String[= ]{"fooAction"}), request); + assertEquals(PortletMode.EDIT, request.getPortletMode()); + assertEquals(WindowState.MAXIMIZED, request.getWindowState()); + } + }); + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + PortletURL renderURL =3D response.createRenderURL(); + + // + String s =3D renderURL.toString(); + + // + assertEquals(null, renderURL.getPortletMode()); + assertEquals(null, renderURL.getWindowState()); + assertEquals(0, renderURL.getParameterMap().size()); + + // + return new InvokeGetResponse(s); + } + }); + seq.bindAction(2, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + assertParameterMap(Collections.singletonMap("foo", new String[= ]{"fooRender"}), request); + assertEquals(PortletMode.VIEW, request.getPortletMode()); + assertEquals(WindowState.NORMAL, request.getWindowState()); + + // + ResourceURL resourceURL =3D response.createResourceURL(); + + // + String s =3D resourceURL.toString(); + + // + assertEquals(ResourceURL.PAGE, resourceURL.getCacheability()); + assertEquals(0, resourceURL.getParameterMap().size()); + + // + return new InvokeGetResponse(s); + } + }); + seq.bindAction(3, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + { + protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException + { + assertParameterMap(Collections.singletonMap("foo", new String[= ]{"fooResource"}), request); + assertEquals("foo_resource_id", request.getResourceID()); + assertEquals(ResourceURL.PORTLET, request.getCacheability()); + + + return new EndTestResponse(); + } + }); + } + + private static final PortletURLGenerationListener updater =3D new Portl= etURLGenerationListener() + { + + + + public void filterActionURL(PortletURL portletURL) + { + try + { + portletURL.setPortletMode(PortletMode.EDIT); + portletURL.setWindowState(WindowState.MAXIMIZED); + portletURL.setParameter("foo", "fooAction"); + } + catch (Exception e) + { + } + } + + public void filterRenderURL(PortletURL portletURL) + { + try + { + portletURL.setPortletMode(PortletMode.VIEW); + portletURL.setWindowState(WindowState.NORMAL); + portletURL.setParameter("foo", "fooRender"); + } + catch (Exception e) + { + } + } + + public void filterResourceURL(ResourceURL resourceURL) + { + try + { + resourceURL.setParameter("foo", "fooResource"); + resourceURL.setResourceID("foo_resource_id"); + resourceURL.setCacheability(ResourceURL.PORTLET); + } + catch (Exception e) + { + } + } + }; + + +} \ No newline at end of file Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/portleturl/URLGenerationListenerTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/URLGenerationListenerTestCase.java 2008-02-01 22:5= 8:18 UTC (rev 9708) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/URLGenerationListenerTestCase.java 2008-02-01 23:5= 6:02 UTC (rev 9709) @@ -65,6 +65,10 @@ { protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException { + URLGenerationListener1.delegate =3D CallbackQueue.createListen= er("l1"); + URLGenerationListener2.delegate =3D CallbackQueue.createListen= er("l2"); + + // test(response, URLRenderer.ToString); test(response, URLRenderer.Write); test(response, URLRenderer.WriteXMLEspaced); @@ -91,8 +95,6 @@ { CallbackQueue.clear(); PortletURL actionURL =3D response.createActionURL(); - URLGenerationListener1.delegate =3D CallbackQueue.createListener("l1= "); - URLGenerationListener2.delegate =3D CallbackQueue.createListener("l2= "); assertEquals(0, CallbackQueue.size()); = // Assert initial state Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/resourceserving/DowngradeCacheabilityTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/resourceserving/DowngradeCacheabilityTestCase.java 2008-02-01= 22:58:18 UTC (rev 9708) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/resourceserving/DowngradeCacheabilityTestCase.java 2008-02-01= 23:56:02 UTC (rev 9709) @@ -29,6 +29,7 @@ import org.jboss.portal.unit.actions.PortletRenderTestAction; import org.jboss.portal.unit.actions.PortletResourceTestAction; import org.jboss.portal.test.portlet.framework.UTP2; +import org.jboss.portal.test.portlet.framework.UTP1; import org.jboss.unit.driver.DriverResponse; import org.jboss.unit.driver.response.EndTestResponse; import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; @@ -73,7 +74,7 @@ { public DowngradeCacheabilityTestCase(PortletTestCase seq) { - seq.bindAction(0, UTP2.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() { protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException { @@ -84,7 +85,7 @@ return new InvokeGetResponse(resourceURL.toString()); } }); - seq.bindAction(1, UTP2.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + seq.bindAction(1, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() { protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException { @@ -133,7 +134,7 @@ return new InvokeGetResponse(resourceURL.toString()); } }); - seq.bindAction(2, UTP2.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + seq.bindAction(2, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() { protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException { @@ -145,7 +146,7 @@ return new InvokeGetResponse(resourceURL.toString()); } }); - seq.bindAction(3, UTP2.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + seq.bindAction(3, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() { protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException { @@ -205,7 +206,7 @@ return new InvokeGetResponse(resourceURL.toString()); } }); - seq.bindAction(4, UTP2.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + seq.bindAction(4, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() { protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException { Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/resourceserving/HTTPMethodTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/resourceserving/HTTPMethodTestCase.java 2008-02-01 22:58:18 U= TC (rev 9708) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/resourceserving/HTTPMethodTestCase.java 2008-02-01 23:56:02 U= TC (rev 9709) @@ -29,6 +29,7 @@ import org.jboss.portal.unit.actions.PortletRenderTestAction; import org.jboss.portal.unit.actions.PortletResourceTestAction; import org.jboss.portal.test.portlet.framework.UTP4; +import org.jboss.portal.test.portlet.framework.UTP1; import org.jboss.unit.driver.DriverResponse; import org.jboss.unit.driver.response.EndTestResponse; import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; @@ -61,7 +62,7 @@ { public HTTPMethodTestCase(PortletTestCase seq) { - seq.bindAction(0, UTP4.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() { protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException { @@ -69,7 +70,7 @@ return new InvokeGetResponse(resourceURL.toString()); } }); - seq.bindAction(1, UTP4.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + seq.bindAction(1, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() { protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException { @@ -81,7 +82,7 @@ return post; } }); - seq.bindAction(2, UTP4.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + seq.bindAction(2, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() { protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException { Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/resourceserving/ResourceIDTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/resourceserving/ResourceIDTestCase.java 2008-02-01 22:58:18 U= TC (rev 9708) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/resourceserving/ResourceIDTestCase.java 2008-02-01 23:56:02 U= TC (rev 9709) @@ -29,6 +29,7 @@ import org.jboss.portal.unit.actions.PortletRenderTestAction; import org.jboss.portal.unit.actions.PortletResourceTestAction; import org.jboss.portal.test.portlet.framework.UTP3; +import org.jboss.portal.test.portlet.framework.UTP1; import org.jboss.unit.driver.DriverResponse; import org.jboss.unit.driver.response.EndTestResponse; import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; @@ -61,7 +62,7 @@ { public ResourceIDTestCase(PortletTestCase seq) { - seq.bindAction(0, UTP3.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() { protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException { @@ -69,7 +70,7 @@ return new InvokeGetResponse(resourceURL.toString()); } }); - seq.bindAction(1, UTP3.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + seq.bindAction(1, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() { protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException { @@ -79,7 +80,7 @@ return new InvokeGetResponse(resourceURL.toString()); } }); - seq.bindAction(2, UTP3.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + seq.bindAction(2, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() { protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException { Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/resourceserving/ResourceURLParametersTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/resourceserving/ResourceURLParametersTestCase.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/resourceserving/ResourceURLParametersTestCase.java 2008-02-01= 23:56:02 UTC (rev 9709) @@ -0,0 +1,214 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.tck.resourceserving; + +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.Assertion; +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.unit.actions.PortletResourceTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; +import org.jboss.unit.remote.driver.handler.http.response.InvokePostRespon= se; +import org.jboss.unit.remote.http.HttpRequest; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.PortletURL; +import javax.portlet.ResourceURL; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import java.io.IOException; +import java.util.Map; +import java.util.HashMap; +import java.util.Collections; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)TestCase({Assertion.JSR286_128}) +public class ResourceURLParametersTestCase +{ + + public ResourceURLParametersTestCase(PortletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + ResourceURL url =3D response.createResourceURL(); + + // + url.setParameter("foo", new String[]{"foo_resource"}); + + // + return new InvokeGetResponse(url.toString()); + } + }); + seq.bindAction(1, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + { + protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException + { + Map expectedParameters =3D Collections.singl= etonMap("foo", new String[]{"foo_resource"}); + assertParameterMap(expectedParameters, request); + assertParameterMap(expectedParameters, request.getPrivateParam= eterMap()); + assertParameterMap(new HashMap(), request.ge= tPrivateRenderParameterMap()); + assertParameterMap(new HashMap(), request.ge= tPublicParameterMap()); + + // + ResourceURL url =3D response.createResourceURL(); + + // + url.setParameter("foo", new String[]{"foo_resource"}); + url.setParameter("bar", new String[]{"bar_resource"}); + + // + InvokePostResponse post =3D new InvokePostResponse(url.toStrin= g()); + post.setContentType(InvokePostResponse.APPLICATION_X_WWW_FORM_= URLENCODED); + HttpRequest.Form form =3D new HttpRequest.Form(); + form.addParameter("bar", new String[]{"bar_form"}); + form.addParameter("juu", new String[]{"juu_form"}); + post.setBody(form); + + // + return post; + } + }); + seq.bindAction(2, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + { + protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException + { + Map expectedParameters =3D new HashMap(); + expectedParameters.put("foo", new String[]{"foo_resource"}); + expectedParameters.put("bar", new String[]{"bar_resource", "ba= r_form"}); + expectedParameters.put("juu", new String[]{"juu_form"}); + assertParameterMap(expectedParameters, request); + assertParameterMap(expectedParameters, request.getPrivateParam= eterMap()); + assertParameterMap(new HashMap(), request.ge= tPrivateRenderParameterMap()); + assertParameterMap(new HashMap(), request.ge= tPublicParameterMap()); + + // + PortletURL renderURL =3D response.createRenderURL(); + renderURL.setParameter("daa", "daa_render"); + renderURL.setParameter("wee", "wee_render"); + renderURL.setParameter("zii", "zii_render"); + + // + return new InvokeGetResponse(renderURL.toString()); + } + }); + seq.bindAction(3, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + ResourceURL url =3D response.createResourceURL(); + + // + url.setParameter("foo", new String[]{"foo_resource"}); + url.setParameter("daa", new String[]{"daa_resource"}); + + // + return new InvokeGetResponse(url.toString()); + } + }); + seq.bindAction(4, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + { + protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException + { + Map expectedPrivateParameters =3D new HashMa= p(); + expectedPrivateParameters.put("foo", new String[]{"foo_resourc= e"}); + expectedPrivateParameters.put("daa", new String[]{"daa_resourc= e"}); + Map expectedParameters =3D new HashMap(); + expectedParameters.put("foo", new String[]{"foo_resource"}); + expectedParameters.put("daa", new String[]{"daa_resource","daa= _render"}); + expectedParameters.put("wee", new String[]{"wee_render"}); + expectedParameters.put("zii", new String[]{"zii_render"}); + Map expectedPrivateRenderParameters =3D new = HashMap(); + expectedPrivateRenderParameters.put("daa", new String[]{"daa_r= ender"}); + expectedPrivateRenderParameters.put("wee", new String[]{"wee_r= ender"}); + expectedPrivateRenderParameters.put("zii", new String[]{"zii_r= ender"}); + assertParameterMap(expectedParameters, request); +// assertParameterMap(expectedPrivateParameters, request.getPri= vateParameterMap()); +// assertParameterMap(expectedPrivateRenderParameters, request.= getPrivateRenderParameterMap()); +// assertParameterMap(new HashMap(), request.= getPublicParameterMap()); + + // + return new EndTestResponse(); + } + }); + + + + + + +// seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAct= ion() +// { +// protected DriverResponse run(Portlet portlet, RenderRequest req= uest, RenderResponse response, PortletTestContext context) throws PortletEx= ception, IOException +// { +// PortletURL url =3D response.createRenderURL(); +// +// // +// url.setParameter("bar", new String[]{"bar_render"}); +// url.setParameter("juu", new String[]{"juu_render"}); +// +// // +// return new InvokeGetResponse(url.toString()); +// } +// }); +// seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAct= ion() +// { +// protected DriverResponse run(Portlet portlet, RenderRequest req= uest, RenderResponse response, PortletTestContext context) throws PortletEx= ception, IOException +// { +// ResourceURL url =3D response.createResourceURL(); +// +// // +// url.setParameter("foo", new String[]{"foo_resource"}); +// url.setParameter("bar", new String[]{"bar_resource"}); +// +// // +// return new InvokeGetResponse(url.toString()); +// } +// }); +// seq.bindAction(2, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTes= tAction() +// { +// protected DriverResponse run(Portlet portlet, ResourceRequest r= equest, ResourceResponse response, PortletTestContext context) throws Portl= etException, IOException +// { +// Map expectedParameters =3D new HashMap(); +// expectedParameters.put("bar", new String[]{"bar_resource","b= ar_render"}); +// expectedParameters.put("foo", new String[]{"foo_resource"}); +// expectedParameters.put("juu", new String[]{"juu_render"}); +// assertParameterMap(expectedParameters, request); +// +// // +// return new EndTestResponse(); +// } +// }); + } +} Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit= /base/AbstractUniversalTestPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/base/= AbstractUniversalTestPortlet.java 2008-02-01 22:58:18 UTC (rev 9708) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/base/= AbstractUniversalTestPortlet.java 2008-02-01 23:56:02 UTC (rev 9709) @@ -221,6 +221,11 @@ // response =3D ((PortletEventTestAction)action).execute(th= is, req, resp, ctx); } + else if (action =3D=3D null) + { + response =3D new FailureResponse(Failure.createAssertion= Failure("Action for " + ctx.getRequestCount() + + " " + NodeId.locate() + " " + actionJoinPoint + " is = null")); + } else { response =3D new FailureResponse(Failure.createAssertion= Failure("Action for " + ctx.getRequestCount() + @@ -291,6 +296,11 @@ // response =3D ((PortletRenderTestAction)action).execute(this, r= eq, resp, ctx); } + else if (action =3D=3D null) + { + response =3D new FailureResponse(Failure.createAssertionFailur= e("Action for " + ctx.getRequestCount() + + " " + NodeId.locate() + " " + resourceJoinPoint + " is null")); + } else { response =3D new FailureResponse(Failure.createAssertionFailur= e("Action for " + ctx.getRequestCount() + @@ -346,6 +356,11 @@ // Get the result that must exist since it is the only joinpoint = invoked during this request response =3D ((PortletResourceTestAction)action).execute(this, re= q, resp, ctx); } + else if (action =3D=3D null) + { + response =3D new FailureResponse(Failure.createAssertionFailure("= Action for " + ctx.getRequestCount() + + " " + NodeId.locate() + " " + resourceJoinPoint + " is null")); + } else { response =3D new FailureResponse(Failure.createAssertionFailure("= Action for " + ctx.getRequestCount() + Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/PageNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PageNavigationalState.java 2008-02-01 22:58:18 UTC (rev 9708) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PageNavigationalState.java 2008-02-01 23:56:02 UTC (rev 9709) @@ -1,110 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.test; - -import org.jboss.portal.common.util.ParameterMap; -import org.jboss.portal.portlet.Portlet; -import org.jboss.portal.portlet.info.PortletInfo; -import org.jboss.portal.portlet.info.ParameterInfo; - -import javax.xml.namespace.QName; -import java.util.Map; -import java.util.HashMap; -import java.util.zip.GZIPOutputStream; -import java.util.zip.GZIPInputStream; -import java.io.Serializable; -import java.io.ObjectOutputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.ByteArrayInputStream; -import java.io.ObjectInputStream; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -public class PageNavigationalState implements Serializable -{ - - /** . */ - private final Map windows =3D new Hash= Map(); - - /** . */ - private final Map page =3D new HashMap(); - - public WindowNavigationalState getWindowNavigationalState(String window= Id) - { - return windows.get(windowId); - } - - public void setWindowNavigationalState(String windowId, WindowNavigatio= nalState windowNS) - { - windows.put(windowId, windowNS); - } - - public Map getPageNavigationalState() - { - return page; - } - - public ParameterMap getPublicNavigationalState(Portlet portlet) - { - PortletInfo portletInfo =3D portlet.getInfo(); - Map pm =3D page; - ParameterMap publicNavigationalState =3D null; - for (ParameterInfo parameterInfo : portletInfo.getNavigation().getPu= blicParameters()) - { - String[] parameterValue =3D pm.get(parameterInfo.getName()); - if (parameterValue !=3D null) - { - String parameterId =3D parameterInfo.getId(); - if (publicNavigationalState =3D=3D null) - { - publicNavigationalState =3D new ParameterMap(); - } - - // - publicNavigationalState.put(parameterId, parameterValue); - } - } - return publicNavigationalState; - } - - public static byte[] serialize(PageNavigationalState object) throws IOE= xception - { - ByteArrayOutputStream baos =3D new ByteArrayOutputStream(); - GZIPOutputStream zos =3D new GZIPOutputStream(baos); - ObjectOutputStream oos =3D new ObjectOutputStream(zos); - oos.writeObject(object); - oos.close(); - return baos.toByteArray(); - } - - public static PageNavigationalState unserialize(byte[] bytes) throws IO= Exception, ClassNotFoundException - { - ByteArrayInputStream bais =3D new ByteArrayInputStream(bytes); - GZIPInputStream zis =3D new GZIPInputStream(bais); - ObjectInputStream ois =3D new ObjectInputStream(zis); - return (PageNavigationalState)ois.readObject(); - } -} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortletURLRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletURLRenderer.java 2008-02-01 22:58:18 UTC (rev 9708) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletURLRenderer.java 2008-02-01 23:56:02 UTC (rev 9709) @@ -35,6 +35,7 @@ import org.jboss.portal.common.util.Tools; import org.jboss.portal.common.io.IOTools; import static org.jboss.portal.portlet.test.URLParameterConstants.*; +import org.jboss.portal.portlet.test.controller.PageNavigationalState; = import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/controller/MutablePageNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/MutablePageNavigationalState.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/MutablePageNavigationalState.java 2008-02-01 23:56:02 UTC (rev 9= 709) @@ -0,0 +1,60 @@ +/*************************************************************************= ***** + * 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.portlet.test.controller; + +import org.jboss.portal.portlet.test.WindowNavigationalState; + +import javax.xml.namespace.QName; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class MutablePageNavigationalState extends PageNavigationalState +{ + + public MutablePageNavigationalState() + { + } + + public MutablePageNavigationalState(PageNavigationalState original) + { + super(original); + } + + public void setWindowNavigationalState(String windowId, WindowNavigatio= nalState windowNS) + { + windows.put(windowId, windowNS); + } + + public void setPublicNavigationalState(QName name, String[] value) + { + // We clone the value in order to keep the state not mutated by a si= de effect + page.put(name, value.clone()); + } + + public void removePublicNavigationalState(QName name) + { + page.remove(name); + } +} \ No newline at end of file Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller/PageNavigationalState.java (from rev 9707, modules/portlet/t= runk/test/src/main/java/org/jboss/portal/portlet/test/PageNavigationalState= .java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PageNavigationalState.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PageNavigationalState.java 2008-02-01 23:56:02 UTC (rev 9709) @@ -0,0 +1,117 @@ +/*************************************************************************= ***** + * 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.portlet.test.controller; + +import org.jboss.portal.common.util.ParameterMap; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.test.WindowNavigationalState; +import org.jboss.portal.portlet.info.PortletInfo; +import org.jboss.portal.portlet.info.ParameterInfo; + +import javax.xml.namespace.QName; +import java.util.Map; +import java.util.HashMap; +import java.util.zip.GZIPOutputStream; +import java.util.zip.GZIPInputStream; +import java.io.Serializable; +import java.io.ObjectOutputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ByteArrayInputStream; +import java.io.ObjectInputStream; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class PageNavigationalState implements Serializable +{ + + /** . */ + protected final Map windows; + + /** . */ + protected final Map page; + + public PageNavigationalState() + { + this.windows =3D new HashMap(); + this.page =3D new HashMap(); + } + + public PageNavigationalState(PageNavigationalState original) + { + this.windows =3D new HashMap(origin= al.windows); + this.page =3D new HashMap(original.page); + } + + public WindowNavigationalState getWindowNavigationalState(String window= Id) + { + return windows.get(windowId); + } + + public ParameterMap getPublicNavigationalState(Portlet portlet) + { + ParameterMap publicNavigationalState =3D null; + for (ParameterInfo parameterInfo : portlet.getInfo().getNavigation()= .getPublicParameters()) + { + String[] parameterValue =3D page.get(parameterInfo.getName()); + + // + if (parameterValue !=3D null) + { + String parameterId =3D parameterInfo.getId(); + + // Lazy create + if (publicNavigationalState =3D=3D null) + { + publicNavigationalState =3D new ParameterMap(); + } + + // We clone the value here so we keep the internal state not p= otentially changed + publicNavigationalState.put(parameterId, parameterValue.clone(= )); + } + } + + // + return publicNavigationalState; + } + + public static byte[] serialize(PageNavigationalState object) throws IOE= xception + { + ByteArrayOutputStream baos =3D new ByteArrayOutputStream(); + GZIPOutputStream zos =3D new GZIPOutputStream(baos); + ObjectOutputStream oos =3D new ObjectOutputStream(zos); + oos.writeObject(object); + oos.close(); + return baos.toByteArray(); + } + + public static PageNavigationalState unserialize(byte[] bytes) throws IO= Exception, ClassNotFoundException + { + ByteArrayInputStream bais =3D new ByteArrayInputStream(bytes); + GZIPInputStream zis =3D new GZIPInputStream(bais); + ObjectInputStream ois =3D new ObjectInputStream(zis); + return (PageNavigationalState)ois.readObject(); + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletController.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletController.java 2008-02-01 22:58:18 UTC (rev 9708) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletController.java 2008-02-01 23:56:02 UTC (rev 9709) @@ -45,7 +45,7 @@ import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.ResponseProperties; import org.jboss.portal.portlet.spi.PortalContext; -import org.jboss.portal.portlet.test.PageNavigationalState; +import org.jboss.portal.portlet.test.controller.PageNavigationalState; import org.jboss.portal.portlet.test.PortletURLRenderer; import org.jboss.portal.portlet.test.TestInstanceContext; import org.jboss.portal.portlet.test.TestRenderContext; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContextImpl.java 2008-02-01 22:58:18 UTC (rev 9= 708) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContextImpl.java 2008-02-01 23:56:02 UTC (rev 9= 709) @@ -36,7 +36,7 @@ import org.jboss.portal.portlet.cache.CacheLevel; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.test.PageNavigationalState; +import org.jboss.portal.portlet.test.controller.PageNavigationalState; import org.jboss.portal.portlet.test.StringCodec; import static org.jboss.portal.portlet.test.URLParameterConstants.*; import org.jboss.portal.portlet.test.WindowNavigationalState; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletRequestHandler.java 2008-02-01 22:58:18 UTC (rev 9708) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletRequestHandler.java 2008-02-01 23:56:02 UTC (rev 9709) @@ -27,7 +27,7 @@ import org.jboss.portal.portlet.invocation.response.ResponseProperties; import org.jboss.portal.portlet.invocation.response.StateResponse; import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStat= eResponse; -import org.jboss.portal.portlet.test.PageNavigationalState; +import org.jboss.portal.portlet.test.controller.PageNavigationalState; import org.jboss.portal.portlet.test.PortletURLRenderer; import org.jboss.portal.portlet.test.TestActionContext; import org.jboss.portal.portlet.test.TestEventContext; @@ -71,8 +71,14 @@ { PortletControllerContext context =3D portletRequest.controllerContex= t; = + // The page navigational state we will operate on during the request + // Either we have nothing in the request so we create a new one + // Or we have one but we copy it as we should not modify the input s= tate provided + MutablePageNavigationalState pageState =3D portletRequest.pageState = =3D=3D null ? new MutablePageNavigationalState() : new MutablePageNavigatio= nalState(portletRequest.pageState); + // PortletContext portletContext =3D portletRequest.controllerContext.g= etPortlet(portletRequest.portletId).getContext(); + // ResponseProperties requestProperties =3D new ResponseProperties(); = @@ -100,7 +106,7 @@ if (response instanceof UpdateNavigationalStateResponse) { UpdateNavigationalStateResponse updateResponse =3D (UpdateNavi= gationalStateResponse)response; - updateNavigationalState(context, portletRequest.portletId, upd= ateResponse, portletRequest.pageState); + updateNavigationalState(context, portletRequest.portletId, upd= ateResponse, pageState); = // ResponseProperties update =3D updateResponse.getProperties(); @@ -129,7 +135,7 @@ Event event =3D eventQueue.removeFirst(); = // - PortletInvocationResponse eventResponse =3D deliverEvent(conte= xt, event, portletRequest.pageState, requestProperties.getCookies()); + PortletInvocationResponse eventResponse =3D deliverEvent(conte= xt, event, pageState, requestProperties.getCookies()); = // if (eventResponse instanceof UpdateNavigationalStateResponse) @@ -137,7 +143,7 @@ UpdateNavigationalStateResponse update =3D (UpdateNavigatio= nalStateResponse)eventResponse; = // Update ns - updateNavigationalState(context, event.getPortletContext().= getId(), update, portletRequest.pageState); + updateNavigationalState(context, event.getPortletContext().= getId(), update, pageState); = // Add events if any for (StateResponse.Event portletEvent : update.getEvents()) @@ -201,7 +207,7 @@ */ = // - controller.render(context, requestProperties, portletRequest.pageSta= te); + controller.render(context, requestProperties, pageState); } = PortletInvocationResponse invoke(PortletRequest portletRequest) throws = PortletInvokerException @@ -346,7 +352,7 @@ } = private void updateNavigationalState(PortletControllerContext context, = String portletId, - UpdateNavigationalStateResponse up= date, PageNavigationalState pageState) + UpdateNavigationalStateResponse up= date, MutablePageNavigationalState pageState) throws PortletInvokerException { Portlet portlet =3D context.getPortlet(portletId); @@ -384,7 +390,6 @@ if (publicNS !=3D null) { NavigationInfo navigationInfo =3D portlet.getInfo().getNavigation= (); - Map pageNS =3D pageState.getPageNavigationalStat= e(); for (Map.Entry entry : publicNS.entrySet()) { String id =3D entry.getKey(); @@ -397,11 +402,11 @@ String[] value =3D entry.getValue(); if (value.length > 0) { - pageNS.put(name, value); + pageState.setPublicNavigationalState(name, value); } else { - pageNS.remove(name); + pageState.removePublicNavigationalState(name); } } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletResourceRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletResourceRequestHandler.java 2008-02-01 22:58:18 UTC (rev = 9708) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletResourceRequestHandler.java 2008-02-01 23:56:02 UTC (rev = 9709) @@ -42,7 +42,7 @@ import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.ResponseProperties; import org.jboss.portal.portlet.spi.ResourceInvocationContext; -import org.jboss.portal.portlet.test.PageNavigationalState; +import org.jboss.portal.portlet.test.controller.PageNavigationalState; import org.jboss.portal.portlet.test.PortletURLRenderer; import org.jboss.portal.portlet.test.ResourceTestContext; import org.jboss.portal.portlet.test.TestInstanceContext; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/ViewRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ViewRequestHandler.java 2008-02-01 22:58:18 UTC (rev 9708) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ViewRequestHandler.java 2008-02-01 23:56:02 UTC (rev 9709) @@ -26,7 +26,7 @@ import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.ResponseProperties; -import org.jboss.portal.portlet.test.PageNavigationalState; +import org.jboss.portal.portlet.test.controller.PageNavigationalState; import static org.jboss.portal.portlet.test.controller.PortletController.C= ontrollerRequest; import static org.jboss.portal.portlet.test.controller.PortletController.V= iewRequest; = Modified: modules/portlet/trunk/test/src/test/resources/jsr286/tck/resource= serving-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/tck/resourceservin= g-war/WEB-INF/portlet.xml 2008-02-01 22:58:18 UTC (rev 9708) +++ modules/portlet/trunk/test/src/test/resources/jsr286/tck/resourceservin= g-war/WEB-INF/portlet.xml 2008-02-01 23:56:02 UTC (rev 9709) @@ -35,28 +35,4 @@ = - - UniversalTestPortletB - org.jboss.portal.test.portlet.framework.UTP2 - - text/html - - - - - UniversalTestPortletC - org.jboss.portal.test.portlet.framework.UTP3 - - text/html - - - - - UniversalTestPortletD - org.jboss.portal.test.portlet.framework.UTP4 - - text/html - - - --===============1364311053991482507==-- From portal-commits at lists.jboss.org Fri Feb 1 21:00:41 2008 Content-Type: multipart/mixed; boundary="===============3499095824760005207==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9710 - in modules/common/trunk/common/src: test/java/org/jboss/portal/test/common/util/typedmap and 1 other directory. Date: Fri, 01 Feb 2008 21:00:40 -0500 Message-ID: --===============3499095824760005207== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-01 21:00:40 -0500 (Fri, 01 Feb 2008) New Revision: 9710 Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/A= bstractTypedMap.java modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/u= til/typedmap/TypedMapKeySetTestCase.java Log: implemented abstract typed map key set equals and hashcode methods Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common= /util/AbstractTypedMap.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/= AbstractTypedMap.java 2008-02-01 23:56:02 UTC (rev 9709) +++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/= AbstractTypedMap.java 2008-02-02 02:00:40 UTC (rev 9710) @@ -182,6 +182,15 @@ return !(left =3D=3D null || right =3D=3D null) && converter.equals(= left, right); } = + /** . */ + private KeySet keySet; + + /** . */ + private TypedEntrySet entrySet; + + /** . */ + private ValueCollection values; + public abstract Converter getKeyConverter(); = public abstract Converter getValueConverter(); @@ -212,7 +221,11 @@ = public final Set keySet() { - return new KeySet(); + if (keySet =3D=3D null) + { + keySet =3D new KeySet(); + } + return keySet; } = public final EV put(EK ek, EV ev) @@ -298,7 +311,11 @@ = public final Set> entrySet() { - return new TypedEntrySet(); + if (entrySet =3D=3D null) + { + entrySet =3D new TypedEntrySet(); + } + return entrySet; } = public final void putAll(Map em) @@ -309,7 +326,11 @@ = public final Collection values() { - return new ValueCollection(); + if (values =3D=3D null) + { + values =3D new ValueCollection(); + } + return values; } = /** Compare to parameters objects. */ @@ -665,6 +686,69 @@ { super(getDelegate().keySet(), getKeyConverter().unwrapper, getKey= Converter().wrapper); } + + public boolean equals(Object obj) + { + if (obj =3D=3D this) + { + return true; + } + if (obj instanceof Set) + { + Set that =3D (Set)obj; + + // + if (size() !=3D that.size()) + { + return false; + } + + // + for (Object o : that) + { + try + { + if (!contains(o)) + { + return false; + } + } + catch (IllegalArgumentException e) + { + return false; + } + catch (ClassCastException e) + { + return false; + } + catch (NullPointerException e) + { + return false; + } + } + + // + return true; + } + return false; + } + + public int hashCode() + { + int hashCode =3D 0; + + // + for (Object o : this) + { + if (o !=3D null) + { + hashCode +=3D o.hashCode(); + } + } + + // + return hashCode; + } } = private final class ValueCollection extends TypedCollection Modified: modules/common/trunk/common/src/test/java/org/jboss/portal/test/c= ommon/util/typedmap/TypedMapKeySetTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/= util/typedmap/TypedMapKeySetTestCase.java 2008-02-01 23:56:02 UTC (rev 9709) +++ modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/= util/typedmap/TypedMapKeySetTestCase.java 2008-02-02 02:00:40 UTC (rev 9710) @@ -28,6 +28,7 @@ import java.util.HashMap; import java.util.Set; import java.util.Iterator; +import java.util.HashSet; = import org.jboss.portal.common.util.Tools; = @@ -668,7 +669,14 @@ = public void testEquals() { - // todo + Set same =3D new HashSet(); + same.add("zero"); + same.add("one"); + + assertTrue(keys.equals(same)); + + + } = public void testHashCode() --===============3499095824760005207==-- From portal-commits at lists.jboss.org Fri Feb 1 21:16:22 2008 Content-Type: multipart/mixed; boundary="===============3988345322542293911==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9711 - in modules/portlet/trunk: portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/resourceserving and 2 other directories. Date: Fri, 01 Feb 2008 21:16:21 -0500 Message-ID: --===============3988345322542293911== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-01 21:16:21 -0500 (Fri, 01 Feb 2008) New Revision: 9711 Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portleturl/ListenedURLUpdateTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/resourceserving/ResourceURLParametersTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/TestAc= tion.java modules/portlet/trunk/test/src/test/resources/jsr286/tck/resourceserving= -war/WEB-INF/portlet.xml Log: - added a test case for resource url parameters - added test case for url listener to test modifications done during listen= ing Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/portleturl/ListenedURLUpdateTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/ListenedURLUpdateTestCase.java 2008-02-02 02:00:40= UTC (rev 9710) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/ListenedURLUpdateTestCase.java 2008-02-02 02:16:21= UTC (rev 9711) @@ -72,8 +72,8 @@ { protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException { - URLGenerationListener1.delegate =3D updater; - URLGenerationListener2.delegate =3D null; + URLGenerationListener1.delegate =3D updater1; + URLGenerationListener2.delegate =3D updater2; = // PortletURL actionURL =3D response.createActionURL(); @@ -143,7 +143,7 @@ { protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException { - assertParameterMap(Collections.singletonMap("foo", new String[= ]{"fooResource"}), request); + assertParameterMap(Collections.singletonMap("foo", new String[= ]{"fooResource","fooRender"}), request); assertEquals("foo_resource_id", request.getResourceID()); assertEquals(ResourceURL.PORTLET, request.getCacheability()); = @@ -153,43 +153,32 @@ }); } = - private static final PortletURLGenerationListener updater =3D new Portl= etURLGenerationListener() + private static final PortletURLGenerationListener updater1 =3D new Port= letURLGenerationListener() { - - - public void filterActionURL(PortletURL portletURL) { try { portletURL.setPortletMode(PortletMode.EDIT); - portletURL.setWindowState(WindowState.MAXIMIZED); - portletURL.setParameter("foo", "fooAction"); } catch (Exception e) { } } - public void filterRenderURL(PortletURL portletURL) { try { portletURL.setPortletMode(PortletMode.VIEW); - portletURL.setWindowState(WindowState.NORMAL); - portletURL.setParameter("foo", "fooRender"); } catch (Exception e) { } } - public void filterResourceURL(ResourceURL resourceURL) { try { - resourceURL.setParameter("foo", "fooResource"); - resourceURL.setResourceID("foo_resource_id"); resourceURL.setCacheability(ResourceURL.PORTLET); } catch (Exception e) @@ -198,5 +187,50 @@ } }; = + private static final PortletURLGenerationListener updater2 =3D new Port= letURLGenerationListener() + { + public void filterActionURL(PortletURL portletURL) + { + try + { + if (portletURL.getPortletMode() =3D=3D PortletMode.EDIT) + { + portletURL.setWindowState(WindowState.MAXIMIZED); + portletURL.setParameter("foo", "fooAction"); + } + } + catch (Exception e) + { + } + } + public void filterRenderURL(PortletURL portletURL) + { + try + { + if (portletURL.getPortletMode() =3D=3D PortletMode.VIEW) + { + portletURL.setWindowState(WindowState.NORMAL); + portletURL.setParameter("foo", "fooRender"); + } + } + catch (Exception e) + { + } + } + public void filterResourceURL(ResourceURL resourceURL) + { + try + { + if (ResourceURL.PORTLET.equals(resourceURL.getCacheability())) + { + resourceURL.setParameter("foo", "fooResource"); + resourceURL.setResourceID("foo_resource_id"); + } + } + catch (Exception e) + { + } + } + }; = } \ No newline at end of file Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/resourceserving/ResourceURLParametersTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/resourceserving/ResourceURLParametersTestCase.java 2008-02-02= 02:00:40 UTC (rev 9710) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/resourceserving/ResourceURLParametersTestCase.java 2008-02-02= 02:16:21 UTC (rev 9711) @@ -65,7 +65,7 @@ ResourceURL url =3D response.createResourceURL(); = // - url.setParameter("foo", new String[]{"foo_resource"}); + url.setParameter("resource", new String[]{"resource_value"}); = // return new InvokeGetResponse(url.toString()); @@ -75,7 +75,7 @@ { protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException { - Map expectedParameters =3D Collections.singl= etonMap("foo", new String[]{"foo_resource"}); + Map expectedParameters =3D Collections.singl= etonMap("resource", new String[]{"resource_value"}); assertParameterMap(expectedParameters, request); assertParameterMap(expectedParameters, request.getPrivateParam= eterMap()); assertParameterMap(new HashMap(), request.ge= tPrivateRenderParameterMap()); @@ -85,15 +85,15 @@ ResourceURL url =3D response.createResourceURL(); = // - url.setParameter("foo", new String[]{"foo_resource"}); - url.setParameter("bar", new String[]{"bar_resource"}); + url.setParameter("resource", new String[]{"resource_value"}); + url.setParameter("resource_form", new String[]{"resource_form_= value1"}); = // InvokePostResponse post =3D new InvokePostResponse(url.toStrin= g()); post.setContentType(InvokePostResponse.APPLICATION_X_WWW_FORM_= URLENCODED); HttpRequest.Form form =3D new HttpRequest.Form(); - form.addParameter("bar", new String[]{"bar_form"}); - form.addParameter("juu", new String[]{"juu_form"}); + form.addParameter("form", new String[]{"form_value"}); + form.addParameter("resource_form", new String[]{"resource_form= _value2"}); post.setBody(form); = // @@ -105,9 +105,9 @@ protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException { Map expectedParameters =3D new HashMap(); - expectedParameters.put("foo", new String[]{"foo_resource"}); - expectedParameters.put("bar", new String[]{"bar_resource", "ba= r_form"}); - expectedParameters.put("juu", new String[]{"juu_form"}); + expectedParameters.put("resource", new String[]{"resource_valu= e"}); + expectedParameters.put("resource_form", new String[]{"resource= _form_value1", "resource_form_value2"}); + expectedParameters.put("form", new String[]{"form_value"}); assertParameterMap(expectedParameters, request); assertParameterMap(expectedParameters, request.getPrivateParam= eterMap()); assertParameterMap(new HashMap(), request.ge= tPrivateRenderParameterMap()); @@ -115,9 +115,10 @@ = // PortletURL renderURL =3D response.createRenderURL(); - renderURL.setParameter("daa", "daa_render"); - renderURL.setParameter("wee", "wee_render"); - renderURL.setParameter("zii", "zii_render"); + renderURL.setParameter("render", "render_value"); + renderURL.setParameter("resource_render", "resource_render_val= ue2"); + renderURL.setParameter("form_render", "form_render_value2"); + renderURL.setParameter("resource_form_render", "resource_form_= render_value3"); = // return new InvokeGetResponse(renderURL.toString()); @@ -130,8 +131,8 @@ ResourceURL url =3D response.createResourceURL(); = // - url.setParameter("foo", new String[]{"foo_resource"}); - url.setParameter("daa", new String[]{"daa_resource"}); + url.setParameter("resource", new String[]{"resource_value"}); + url.setParameter("resource_render", new String[]{"resource_ren= der_value1"}); = // return new InvokeGetResponse(url.toString()); @@ -141,74 +142,158 @@ { protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException { - Map expectedPrivateParameters =3D new HashMa= p(); - expectedPrivateParameters.put("foo", new String[]{"foo_resourc= e"}); - expectedPrivateParameters.put("daa", new String[]{"daa_resourc= e"}); Map expectedParameters =3D new HashMap(); - expectedParameters.put("foo", new String[]{"foo_resource"}); - expectedParameters.put("daa", new String[]{"daa_resource","daa= _render"}); - expectedParameters.put("wee", new String[]{"wee_render"}); - expectedParameters.put("zii", new String[]{"zii_render"}); + expectedParameters.put("resource", new String[]{"resource_valu= e"}); + expectedParameters.put("resource_render", new String[]{"resour= ce_render_value1","resource_render_value2"}); + expectedParameters.put("render", new String[]{"render_value"}); + expectedParameters.put("form_render", new String[]{"form_rende= r_value2"}); + expectedParameters.put("resource_form_render", new String[]{"r= esource_form_render_value3"}); Map expectedPrivateRenderParameters =3D new = HashMap(); - expectedPrivateRenderParameters.put("daa", new String[]{"daa_r= ender"}); - expectedPrivateRenderParameters.put("wee", new String[]{"wee_r= ender"}); - expectedPrivateRenderParameters.put("zii", new String[]{"zii_r= ender"}); + expectedPrivateRenderParameters.put("render", new String[]{"re= nder_value"}); + expectedPrivateRenderParameters.put("resource_render", new Str= ing[]{"resource_render_value2"}); + expectedPrivateRenderParameters.put("form_render", new String[= ]{"form_render_value2"}); + expectedPrivateRenderParameters.put("resource_form_render", ne= w String[]{"resource_form_render_value3"}); assertParameterMap(expectedParameters, request); -// assertParameterMap(expectedPrivateParameters, request.getPri= vateParameterMap()); -// assertParameterMap(expectedPrivateRenderParameters, request.= getPrivateRenderParameterMap()); -// assertParameterMap(new HashMap(), request.= getPublicParameterMap()); + assertParameterMap(expectedParameters, request.getPrivateParam= eterMap()); + assertParameterMap(expectedPrivateRenderParameters, request.ge= tPrivateRenderParameterMap()); + assertParameterMap(new HashMap(), request.ge= tPublicParameterMap()); = // - return new EndTestResponse(); + ResourceURL url =3D response.createResourceURL(); + + // + url.setParameter("resource", new String[]{"resource_value"}); + url.setParameter("resource_form", new String[]{"resource_form_= value1"}); + url.setParameter("resource_render", new String[]{"resource_ren= der_value1"}); + url.setParameter("resource_form_render", new String[]{"resourc= e_form_render_value1"}); + + // + InvokePostResponse post =3D new InvokePostResponse(url.toStrin= g()); + post.setContentType(InvokePostResponse.APPLICATION_X_WWW_FORM_= URLENCODED); + HttpRequest.Form form =3D new HttpRequest.Form(); + form.addParameter("form", new String[]{"form_value"}); + form.addParameter("resource_form", new String[]{"resource_form= _value2"}); + form.addParameter("form_render", new String[]{"form_render_val= ue1"}); + form.addParameter("resource_form_render", new String[]{"resour= ce_form_render_value2"}); + post.setBody(form); + + // + return post; } }); + seq.bindAction(5, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + { + protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException + { + Map expectedParameters =3D new HashMap(); + expectedParameters.put("resource", new String[]{"resource_valu= e"}); + expectedParameters.put("resource_form", new String[]{"resource= _form_value1","resource_form_value2"}); + expectedParameters.put("resource_render", new String[]{"resour= ce_render_value1","resource_render_value2"}); + expectedParameters.put("resource_form_render", new String[]{"r= esource_form_render_value1","resource_form_render_value2","resource_form_re= nder_value3"}); + expectedParameters.put("form", new String[]{"form_value"}); + expectedParameters.put("form_render", new String[]{"form_rende= r_value1","form_render_value2"}); + expectedParameters.put("render", new String[]{"render_value"}); + Map expectedPrivateRenderParameters =3D new = HashMap(); + expectedPrivateRenderParameters.put("render", new String[]{"re= nder_value"}); + expectedPrivateRenderParameters.put("resource_render", new Str= ing[]{"resource_render_value2"}); + expectedPrivateRenderParameters.put("form_render", new String[= ]{"form_render_value2"}); + expectedPrivateRenderParameters.put("resource_form_render", ne= w String[]{"resource_form_render_value3"}); + assertParameterMap(expectedParameters, request); + assertParameterMap(expectedParameters, request.getPrivateParam= eterMap()); + assertParameterMap(expectedPrivateRenderParameters, request.ge= tPrivateRenderParameterMap()); + assertParameterMap(new HashMap(), request.ge= tPublicParameterMap()); = + // + PortletURL renderURL =3D response.createRenderURL(); + renderURL.setParameter("render", "render_value"); + renderURL.setParameter("resource_render", "resource_render_val= ue2"); + renderURL.setParameter("form_render", "form_render_value2"); + renderURL.setParameter("resource_form_render", "resource_form_= render_value3"); + renderURL.setParameter("public", "public_value"); + renderURL.setParameter("resource_public", "resource_public_val= ue2"); + renderURL.setParameter("form_public", "form_public_value2"); + renderURL.setParameter("resource_form_public", "resource_form_= public_value3"); = + // + return new InvokeGetResponse(renderURL.toString()); + } + }); + seq.bindAction(6, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + // + ResourceURL url =3D response.createResourceURL(); = + // + url.setParameter("resource", new String[]{"resource_value"}); + url.setParameter("resource_form", new String[]{"resource_form_= value1"}); + url.setParameter("resource_render", new String[]{"resource_ren= der_value1"}); + url.setParameter("resource_form_render", new String[]{"resourc= e_form_render_value1"}); + url.setParameter("resource_public", new String[]{"resource_pub= lic_value1"}); + url.setParameter("resource_form_public", new String[]{"resourc= e_form_public_value1"}); = + // + InvokePostResponse post =3D new InvokePostResponse(url.toStrin= g()); + post.setContentType(InvokePostResponse.APPLICATION_X_WWW_FORM_= URLENCODED); + HttpRequest.Form form =3D new HttpRequest.Form(); + form.addParameter("form", new String[]{"form_value"}); + form.addParameter("resource_form", new String[]{"resource_form= _value2"}); + form.addParameter("form_render", new String[]{"form_render_val= ue1"}); + form.addParameter("resource_form_render", new String[]{"resour= ce_form_render_value2"}); + form.addParameter("form_public", new String[]{"form_public_val= ue1"}); + form.addParameter("resource_form_public", new String[]{"resour= ce_form_public_value2"}); + post.setBody(form); = + // + return post; + } + }); + seq.bindAction(7, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + { + protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException + { + Map expectedParameters =3D new HashMap(); + expectedParameters.put("resource", new String[]{"resource_valu= e"}); + expectedParameters.put("form", new String[]{"form_value"}); + expectedParameters.put("resource_form", new String[]{"resource= _form_value1","resource_form_value2"}); + expectedParameters.put("resource_render", new String[]{"resour= ce_render_value1","resource_render_value2"}); + expectedParameters.put("resource_form_render", new String[]{"r= esource_form_render_value1","resource_form_render_value2","resource_form_re= nder_value3"}); + expectedParameters.put("form_render", new String[]{"form_rende= r_value1","form_render_value2"}); + expectedParameters.put("render", new String[]{"render_value"}); + expectedParameters.put("resource_public", new String[]{"resour= ce_public_value1","resource_public_value2"}); + expectedParameters.put("resource_form_public", new String[]{"r= esource_form_public_value1","resource_form_public_value2","resource_form_pu= blic_value3"}); + expectedParameters.put("form_public", new String[]{"form_publi= c_value1","form_public_value2"}); + expectedParameters.put("public", new String[]{"public_value"}); + Map expectedPrivateRenderParameters =3D new = HashMap(); + expectedPrivateRenderParameters.put("resource_render", new Str= ing[]{"resource_render_value2"}); + expectedPrivateRenderParameters.put("resource_form_render", ne= w String[]{"resource_form_render_value3"}); + expectedPrivateRenderParameters.put("form_render", new String[= ]{"form_render_value2"}); + expectedPrivateRenderParameters.put("render", new String[]{"re= nder_value"}); + Map expectedPrivateParameters =3D new HashMa= p(); + expectedPrivateParameters.put("resource", new String[]{"resour= ce_value"}); + expectedPrivateParameters.put("form", new String[]{"form_value= "}); + expectedPrivateParameters.put("resource_form", new String[]{"r= esource_form_value1","resource_form_value2"}); + expectedPrivateParameters.put("resource_render", new String[]{= "resource_render_value1","resource_render_value2"}); + expectedPrivateParameters.put("resource_form_render", new Stri= ng[]{"resource_form_render_value1","resource_form_render_value2","resource_= form_render_value3"}); + expectedPrivateParameters.put("form_render", new String[]{"for= m_render_value1","form_render_value2"}); + expectedPrivateParameters.put("render", new String[]{"render_v= alue"}); + expectedPrivateParameters.put("resource_public", new String[]{= "resource_public_value1"}); + expectedPrivateParameters.put("resource_form_public", new Stri= ng[]{"resource_form_public_value1","resource_form_public_value2"}); + expectedPrivateParameters.put("form_public", new String[]{"for= m_public_value1"}); + Map expectedPublicParameters =3D new HashMap= (); + expectedPublicParameters.put("resource_public", new String[]{"= resource_public_value2"}); + expectedPublicParameters.put("resource_form_public", new Strin= g[]{"resource_form_public_value3"}); + expectedPublicParameters.put("form_public", new String[]{"form= _public_value2"}); + expectedPublicParameters.put("public", new String[]{"public_va= lue"}); + assertParameterMap(expectedParameters, request); + assertParameterMap(expectedPrivateParameters, request.getPriva= teParameterMap()); + assertParameterMap(expectedPrivateRenderParameters, request.ge= tPrivateRenderParameterMap()); + assertParameterMap(expectedPublicParameters, request.getPublic= ParameterMap()); = -// seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAct= ion() -// { -// protected DriverResponse run(Portlet portlet, RenderRequest req= uest, RenderResponse response, PortletTestContext context) throws PortletEx= ception, IOException -// { -// PortletURL url =3D response.createRenderURL(); -// -// // -// url.setParameter("bar", new String[]{"bar_render"}); -// url.setParameter("juu", new String[]{"juu_render"}); -// -// // -// return new InvokeGetResponse(url.toString()); -// } -// }); -// seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAct= ion() -// { -// protected DriverResponse run(Portlet portlet, RenderRequest req= uest, RenderResponse response, PortletTestContext context) throws PortletEx= ception, IOException -// { -// ResourceURL url =3D response.createResourceURL(); -// -// // -// url.setParameter("foo", new String[]{"foo_resource"}); -// url.setParameter("bar", new String[]{"bar_resource"}); -// -// // -// return new InvokeGetResponse(url.toString()); -// } -// }); -// seq.bindAction(2, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTes= tAction() -// { -// protected DriverResponse run(Portlet portlet, ResourceRequest r= equest, ResourceResponse response, PortletTestContext context) throws Portl= etException, IOException -// { -// Map expectedParameters =3D new HashMap(); -// expectedParameters.put("bar", new String[]{"bar_resource","b= ar_render"}); -// expectedParameters.put("foo", new String[]{"foo_resource"}); -// expectedParameters.put("juu", new String[]{"juu_render"}); -// assertParameterMap(expectedParameters, request); -// -// // -// return new EndTestResponse(); -// } -// }); + // + return new EndTestResponse(); + } + }); } } Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit= /TestAction.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/TestA= ction.java 2008-02-02 02:00:40 UTC (rev 9710) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/TestA= ction.java 2008-02-02 02:16:21 UTC (rev 9711) @@ -78,7 +78,9 @@ for (Map.Entry entry : expectedMap.entrySet()) { String expectedValue =3D entry.getValue()[0]; - assertEquals(expectedValue, request.getParameter(entry.getKey())); + String actualValue =3D request.getParameter(entry.getKey()); + assertEquals("Was expecting value " + expectedValue + " for key "= + entry.getKey() + " but instead have " + + actualValue, expectedValue, actualValue); } = // Test getParameterValues(String name) @@ -110,7 +112,8 @@ protected final void assertParameterMap(Map expectedM= ap, Map map) throws AssertionError { assertNotNull(map); - assertEquals(expectedMap.size(), map.size()); + assertEquals(expectedMap.keySet(), map.keySet()); +// assertEquals(map.keySet(), expectedMap.keySet()); for (Map.Entry entry : expectedMap.entrySet()) { String[] expectedValues =3D map.get(entry.getKey()); Modified: modules/portlet/trunk/test/src/test/resources/jsr286/tck/resource= serving-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/tck/resourceservin= g-war/WEB-INF/portlet.xml 2008-02-02 02:00:40 UTC (rev 9710) +++ modules/portlet/trunk/test/src/test/resources/jsr286/tck/resourceservin= g-war/WEB-INF/portlet.xml 2008-02-02 02:16:21 UTC (rev 9711) @@ -33,6 +33,30 @@ text/html + public + resource_public + form_public + resource_form_public = + + public + public + + + + resource_public + resource_public + + + + form_public + form_public + + + + resource_form_public + resource_form_public + + --===============3988345322542293911==-- From portal-commits at lists.jboss.org Sat Feb 2 09:07:45 2008 Content-Type: multipart/mixed; boundary="===============2221853185394227112==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9712 - in modules/test/trunk: remote/src/main/java/org/jboss/unit/remote/driver/handler/http and 5 other directories. Date: Sat, 02 Feb 2008 09:07:45 -0500 Message-ID: --===============2221853185394227112== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-02 09:07:45 -0500 (Sat, 02 Feb 2008) New Revision: 9712 Modified: modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/driver/Rem= oteTestDriverClient.java modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/driver/han= dler/http/HTTPConversation.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/de= ployment/Deployer.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/de= ployment/Deployment.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/em= bedded/HibernateSupport.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/em= bedded/opends/OpenDSService.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/em= bedded/opends/OpenDSUtil.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/im= pl/generic/agent/GenericTestAgent.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/ru= nner/BaseRunner.java Log: update jboss unit to use jboss logging Modified: modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/dri= ver/RemoteTestDriverClient.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/driver/Re= moteTestDriverClient.java 2008-02-02 02:16:21 UTC (rev 9711) +++ modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/driver/Re= moteTestDriverClient.java 2008-02-02 14:07:45 UTC (rev 9712) @@ -44,6 +44,7 @@ import org.jboss.unit.driver.response.FailureResponse; import org.jboss.unit.info.TestInfo; import org.jboss.unit.info.impl.SimpleTestInfo; +import org.jboss.logging.Logger; = import java.net.URL; = @@ -54,6 +55,9 @@ public class RemoteTestDriverClient extends BasicBootstrap implements Test= Driver { = + /** . */ + private static Logger log =3D org.jboss.logging.Logger.getLogger(Remote= TestDriverClient.class); + // Config = /** Need to make initial node id configurable somehow. */ @@ -152,11 +156,18 @@ this.serverName =3D context.getProperty("serverName"); = // + log.debug("Initializing remote test driving client"); + log.debug("Archive path =3D " + archivePath); + log.debug("Server name =3D " + serverName); + + // + log.debug("Booting kernel"); run(); = // Install our self first try { + log.debug("Installing TestDriver bean"); AbstractBeanMetaData bmd =3D new AbstractBeanMetaData("TestDriver= ", getClass().getName()); AbstractConstructorMetaData cmd =3D new AbstractConstructorMetaDa= ta(); bmd.setConstructor(cmd); @@ -168,13 +179,21 @@ } catch (Throwable throwable) { - throw new DriverException("Could not start the kernel", throwable= ); + throw new DriverException("Could not install the TestDriver bean"= , throwable); } = // Now deploy beans try { - URL url =3D getClass().getResource("/org/jboss/unit/remote/driver= /jboss-beans.xml"); + String location =3D "/org/jboss/unit/remote/driver/jboss-beans.xm= l"; + URL url =3D getClass().getResource(location); + if (url =3D=3D null) + { + log.debug("The file jboss-beans.xml supposed to be located und= er " + location + " could not be found"); + } + + // + log.debug("Now deploying the beans with url " + url); beanDeployer =3D new BeanXMLDeployer(getKernel()); deployment =3D beanDeployer.deploy(url); beanDeployer.validate(); @@ -183,9 +202,14 @@ String archiveId =3D context.getProperty("archiveId"); if (archiveId !=3D null) { + log.debug("Going to deploy " + archiveId); Node node =3D nodeManager.getNode(NodeId.DEFAULT); deployer.deploy(archivePath, archiveId, node); } + else + { + log.debug("No archive id was provided"); + } } catch (Throwable throwable) { Modified: modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/dri= ver/handler/http/HTTPConversation.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/driver/ha= ndler/http/HTTPConversation.java 2008-02-02 02:16:21 UTC (rev 9711) +++ modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/driver/ha= ndler/http/HTTPConversation.java 2008-02-02 14:07:45 UTC (rev 9712) @@ -34,7 +34,7 @@ import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.auth.AuthScope; import org.apache.commons.httpclient.params.HttpMethodParams; -import org.apache.log4j.Logger; +import org.jboss.logging.Logger; import org.jboss.unit.remote.http.HttpRequest; import org.jboss.unit.remote.http.HttpHeaders; import org.jboss.unit.remote.http.HttpHeader; @@ -67,7 +67,7 @@ { = /** . */ - private final Logger log =3D Logger.getLogger(getClass()); + private final org.jboss.logging.Logger log =3D Logger.getLogger(getClas= s()); = /** . */ private final HttpClient client; Modified: modules/test/trunk/test/src/main/java/org/jboss/portal/test/frame= work/deployment/Deployer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/d= eployment/Deployer.java 2008-02-02 02:16:21 UTC (rev 9711) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/d= eployment/Deployer.java 2008-02-02 14:07:45 UTC (rev 9712) @@ -41,6 +41,9 @@ { = /** . */ + private static final org.jboss.logging.Logger log =3D org.jboss.logging= .Logger.getLogger(Deployer.class); + + /** . */ private Map deployments; = public void create() @@ -85,7 +88,16 @@ = public void deploy(File parent, String childName, Node[] nodes) throws = Exception { - deploy(new File(parent, childName).toURL(), nodes); + File file =3D new File(parent, childName); + if (!file.exists()) + { + String msg =3D "Cannot deploy inexisting file " + file.getAbsolut= ePath(); + log.error(msg); + throw new IllegalArgumentException(msg); + } + + // + deploy(file.toURL(), nodes); } = public void deploy(String url, Node node) throws Exception Modified: modules/test/trunk/test/src/main/java/org/jboss/portal/test/frame= work/deployment/Deployment.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/d= eployment/Deployment.java 2008-02-02 02:16:21 UTC (rev 9711) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/d= eployment/Deployment.java 2008-02-02 14:07:45 UTC (rev 9712) @@ -23,7 +23,7 @@ = package org.jboss.portal.test.framework.deployment; = -import org.apache.log4j.Logger; +import org.jboss.logging.Logger; import org.jboss.portal.test.framework.agent.TestAgent; import org.jboss.portal.test.framework.server.Node; = Modified: modules/test/trunk/test/src/main/java/org/jboss/portal/test/frame= work/embedded/HibernateSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/e= mbedded/HibernateSupport.java 2008-02-02 02:16:21 UTC (rev 9711) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/e= mbedded/HibernateSupport.java 2008-02-02 14:07:45 UTC (rev 9712) @@ -35,7 +35,7 @@ import org.jboss.portal.common.io.IOTools; import org.w3c.dom.Element; import org.w3c.dom.Document; -import org.apache.log4j.Logger; +import org.jboss.logging.Logger; = import javax.transaction.Synchronization; import java.util.Collection; @@ -115,11 +115,11 @@ // if (jndiName =3D=3D null) { - log =3D Logger.getLogger(HibernateSupport.class); + log =3D org.jboss.logging.Logger.getLogger(HibernateSupport.class= ); } else { - log =3D Logger.getLogger(jndiName); + log =3D org.jboss.logging.Logger.getLogger(jndiName); } } = Modified: modules/test/trunk/test/src/main/java/org/jboss/portal/test/frame= work/embedded/opends/OpenDSService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/e= mbedded/opends/OpenDSService.java 2008-02-02 02:16:21 UTC (rev 9711) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/e= mbedded/opends/OpenDSService.java 2008-02-02 14:07:45 UTC (rev 9712) @@ -24,7 +24,6 @@ package org.jboss.portal.test.framework.embedded.opends; = import org.opends.server.core.DirectoryServer; -import org.apache.log4j.Logger; = import java.security.AccessController; import java.security.PrivilegedAction; @@ -44,7 +43,7 @@ public class OpenDSService implements OpenDSServiceMBean { = - private static final Logger log =3D Logger.getLogger(OpenDSService.clas= s); + private static final org.jboss.logging.Logger log =3D org.jboss.logging= .Logger.getLogger(OpenDSService.class); = public static String objectName =3D "portal.test:service=3DOpenDSServic= e"; = Modified: modules/test/trunk/test/src/main/java/org/jboss/portal/test/frame= work/embedded/opends/OpenDSUtil.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/e= mbedded/opends/OpenDSUtil.java 2008-02-02 02:16:21 UTC (rev 9711) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/e= mbedded/opends/OpenDSUtil.java 2008-02-02 14:07:45 UTC (rev 9712) @@ -27,7 +27,6 @@ import org.opends.server.tools.LDAPDelete; import org.opends.server.tools.LDAPModify; import org.opends.server.tools.LDAPSearch; -import org.apache.log4j.Logger; = import java.net.URL; import java.io.File; @@ -44,7 +43,7 @@ */ public class OpenDSUtil { - private static final Logger log =3D Logger.getLogger(OpenDSUtil.class); + private static final org.jboss.logging.Logger log =3D org.jboss.logging= .Logger.getLogger(OpenDSUtil.class); = public OpenDSUtil() { Modified: modules/test/trunk/test/src/main/java/org/jboss/portal/test/frame= work/impl/generic/agent/GenericTestAgent.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/i= mpl/generic/agent/GenericTestAgent.java 2008-02-02 02:16:21 UTC (rev 9711) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/i= mpl/generic/agent/GenericTestAgent.java 2008-02-02 14:07:45 UTC (rev 9712) @@ -33,6 +33,7 @@ import org.codehaus.cargo.container.configuration.Configuration; import org.codehaus.cargo.container.property.RemotePropertySet; import org.codehaus.cargo.container.Container; +import org.jboss.logging.Logger; = import java.net.URL; import java.net.URISyntaxException; @@ -46,6 +47,9 @@ { = /** . */ + private static Logger log =3D org.jboss.logging.Logger.getLogger(Generi= cTestAgent.class); + + /** . */ private Deployer cargoDeployer; = /** . */ @@ -115,13 +119,17 @@ public void deploy(URL url) throws Exception { Deployable deployable =3D createDeployable(url); + log.debug("Going to deploy " + url); cargoDeployer.deploy(deployable); + log.debug("Deployed " + url); } = public void undeploy(URL url) throws Exception { Deployable deployable =3D createDeployable(url); + log.debug("Going to undeploy " + url); cargoDeployer.undeploy(deployable); + log.debug("Undeployed " + url); } = private Deployable createDeployable(URL url) throws URISyntaxException,= IllegalArgumentException Modified: modules/test/trunk/test/src/main/java/org/jboss/portal/test/frame= work/runner/BaseRunner.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/r= unner/BaseRunner.java 2008-02-02 02:16:21 UTC (rev 9711) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/r= unner/BaseRunner.java 2008-02-02 14:07:45 UTC (rev 9712) @@ -26,7 +26,6 @@ import org.jboss.portal.test.framework.server.NodeManager; import org.jboss.portal.test.framework.server.NodeId; import org.jboss.portal.test.framework.mc.TestRuntimeContext; -import org.apache.log4j.Logger; import org.apache.log4j.Appender; import org.apache.log4j.SimpleLayout; import org.apache.log4j.Level; @@ -47,8 +46,8 @@ static { Appender appender =3D new ConsoleAppender(new SimpleLayout()); - Logger.getRoot().addAppender(appender); - Logger.getRoot().setLevel(Level.INFO); + org.jboss.logging.Logger.getRoot().addAppender(appender); + org.jboss.logging.Logger.getRoot().setLevel(Level.INFO); } = /** . */ --===============2221853185394227112==-- From portal-commits at lists.jboss.org Sat Feb 2 09:21:03 2008 Content-Type: multipart/mixed; boundary="===============4905939291668193378==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9713 - modules/portlet/trunk/test/src/test. Date: Sat, 02 Feb 2008 09:21:03 -0500 Message-ID: --===============4905939291668193378== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-02 09:21:03 -0500 (Sat, 02 Feb 2008) New Revision: 9713 Modified: modules/portlet/trunk/test/src/test/build.xml Log: update build.xml to avoid to use the test/target/test-classes directory as = it is used to build jar files Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-02 14:07:45 UTC (= rev 9712) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-02 14:21:03 UTC (= rev 9713) @@ -256,20 +256,29 @@ - - - - - + + + + + - - - + + + + + - + @@ -280,6 +289,8 @@ = + + = @@ -314,7 +325,6 @@ - @@ -328,7 +338,6 @@ - @@ -339,9 +348,7 @@ - - @@ -351,13 +358,12 @@ - - = + @@ -365,11 +371,16 @@ = = - + + + + + = = + = @@ -392,16 +403,20 @@ - - + = - + + + + + = = + = @@ -423,8 +438,7 @@ - - + = @@ -647,7 +661,8 @@ = - + + @@ -664,7 +679,7 @@ = - + = @@ -702,7 +717,7 @@ = - + = = --===============4905939291668193378==-- From portal-commits at lists.jboss.org Sat Feb 2 13:26:59 2008 Content-Type: multipart/mixed; boundary="===============5733519827809659038==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9714 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168 and 2 other directories. Date: Sat, 02 Feb 2008 13:26:59 -0500 Message-ID: --===============5733519827809659038== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-02 13:26:59 -0500 (Sat, 02 Feb 2008) New Revision: 9714 Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/ClassInstanceLifeCycle.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/FilterChainImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/FilterConfigImpl.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerFilterInfo.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerInfoBuilder.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerPortletApplicationInfo.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerPortletInfo.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletApplicationImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletContainerImpl.java modules/portlet/trunk/test/src/test/build.xml Log: implementation of portlet filtering, no unit tests yet (but will follow). Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/info/ContainerFilterInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerFilterInfo.java 2008-02-02 14:21:03 UTC (rev 9713) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerFilterInfo.java 2008-02-02 18:26:59 UTC (rev 9714) @@ -26,6 +26,7 @@ import org.jboss.portal.common.i18n.LocalizedString; = import java.util.Map; +import java.util.Set; = /** * @author Julien Viet @@ -41,7 +42,7 @@ private final String className; = /** . */ - private final LifeCyclePhase lifeCycle; + private final Set lifeCycles; = /** . */ private final LocalizedString displayName; @@ -55,14 +56,14 @@ public ContainerFilterInfo( String name, String className, - LifeCyclePhase lifeCycle, + Set lifeCycles, LocalizedString displayName, LocalizedString description, Map parameters) { this.name =3D name; this.className =3D className; - this.lifeCycle =3D lifeCycle; + this.lifeCycles =3D lifeCycles; this.displayName =3D displayName; this.description =3D description; this.parameters =3D parameters; @@ -78,9 +79,9 @@ return className; } = - public LifeCyclePhase getLifeCycle() + public Set getLifeCycles() { - return lifeCycle; + return lifeCycles; } = public LocalizedString getDisplayName() Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/info/ContainerInfoBuilder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerInfoBuilder.java 2008-02-02 14:21:03 UTC (rev 9713) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerInfoBuilder.java 2008-02-02 18:26:59 UTC (rev 9714) @@ -40,6 +40,7 @@ import org.jboss.portal.portlet.impl.metadata.PublicRenderParameterMetaDat= a; import org.jboss.portal.portlet.impl.metadata.ListenerMetaData; import org.jboss.portal.portlet.impl.metadata.filter.FilterMetaData; +import org.jboss.portal.portlet.impl.metadata.filter.FilterMappingMetaData; import org.jboss.portal.portlet.info.MetaInfo; import org.jboss.portal.portlet.LifeCyclePhase; import org.jboss.portal.common.util.ConversionException; @@ -64,6 +65,7 @@ import java.util.Collection; import java.util.LinkedHashMap; import java.util.Collections; +import java.util.HashSet; import java.net.URI; import java.net.URISyntaxException; = @@ -84,6 +86,51 @@ private static final String[] BUNDLE_KEYS =3D {JAVAX_PORTLET + MetaInfo= .TITLE, JAVAX_PORTLET + MetaInfo.SHORT_TITLE, JAVAX_PORTLET + MetaInfo.KEYW= ORDS}; = /** . */ + private static final List EMPTY_LISTENER_LIST =3D Col= lections.emptyList(); + + /** . */ + private static final List EMPTY_PUBLIC_R= ENDER_PARAMETER_LIST =3D Collections.emptyList(); + + /** . */ + private static final List EMPTY_EVENT_DEFINITI= ON_LIST =3D Collections.emptyList(); + + /** . */ + private static final List EMPPTY_SECURITY_ROLE= _REF_LIST =3D Collections.emptyList(); + + /** . */ + private static final List EMPTY_SECURITY_CO= NSTRAINT_LIST =3D Collections.emptyList(); + + /** . */ + private static final List EMPTY_SUPPORTED_LOCA= LE_LIST =3D Collections.emptyList(); + + /** . */ + private static final List EMPTY_PORTLET_MODE_LIST = =3D Collections.emptyList(); + + /** . */ + private static final List EMPTY_WINDOW_STATE_LIST = =3D Collections.emptyList(); + + /** . */ + private static final Map EMPTY_PORTLE= T_PREFERENCE_MAP =3D Collections.emptyMap(); + + /** . */ + private static final PortletPreferencesMetaData EMPTY_PORTLET_PREFERENC= ES =3D new PortletPreferencesMetaData(); + + /** . */ + private static final List EMPTY_INIT_PARAM_LIST =3D = Collections.emptyList(); + + /** . */ + private static final List EMPTY_STRING_LIST =3D Collections.emp= tyList(); + + /** . */ + private static final List EMPTY_EVENT= _DEFINITION_REFERENCE_LIST =3D Collections.emptyList(); + + /** . */ + private static final Map EMPTY_FILTER_MAP= PING_MAP =3D Collections.emptyMap(); + + /** . */ + private static final Map EMPTY_FILTER_MAP =3D Co= llections.emptyMap(); + + /** . */ private final PortletApplication10MetaData portletApplicationMD; = /** . */ @@ -132,11 +179,11 @@ PortletApplication20MetaData tmp =3D (PortletApplication20MetaDat= a)portletApplicationMD; if (tmp.getEvents() =3D=3D null) { - tmp.setEvents(new ArrayList()); + tmp.setEvents(EMPTY_EVENT_DEFINITION_LIST); } if (tmp.getPublicRenderParameters() =3D=3D null) { - tmp.setPublicRenderParameters(new ArrayList()); + tmp.setPublicRenderParameters(EMPTY_PUBLIC_RENDER_PARAMETER_LI= ST); } if (tmp.getDefaultNamespace() =3D=3D null) { @@ -151,8 +198,16 @@ } if (tmp.getListeners() =3D=3D null) { - tmp.setListeners(new ArrayList()); + tmp.setListeners(EMPTY_LISTENER_LIST); } + if (tmp.getFilters() =3D=3D null) + { + tmp.setFilters(EMPTY_FILTER_MAP); + } + if (tmp.getFilterMapping() =3D=3D null) + { + tmp.setFilterMapping(EMPTY_FILTER_MAPPING_MAP); + } } } = @@ -160,48 +215,48 @@ { if (portletMD.getSecurityRoleRef() =3D=3D null) { - portletMD.setSecurityRoleRef(new ArrayList()); + portletMD.setSecurityRoleRef(EMPPTY_SECURITY_ROLE_REF_LIST); } if (portletMD.getPortletApplication().getSecurityConstraints() =3D= =3D null) { - portletMD.getPortletApplication().setSecurityConstraints(new Arra= yList()); + portletMD.getPortletApplication().setSecurityConstraints(EMPTY_SE= CURITY_CONSTRAINT_LIST); } if (portletMD.getSupportedLocale() =3D=3D null) { - portletMD.setSupportedLocale(new ArrayList()); + portletMD.setSupportedLocale(EMPTY_SUPPORTED_LOCALE_LIST); } for (SupportsMetaData supportsMD : portletMD.getSupports()) { if (supportsMD.getPortletModes() =3D=3D null) { - supportsMD.setPortletModes(new ArrayList(= )); + supportsMD.setPortletModes(EMPTY_PORTLET_MODE_LIST); } if (supportsMD.getWindowStates() =3D=3D null) { - supportsMD.setWindowStates(new ArrayList(= )); + supportsMD.setWindowStates(EMPTY_WINDOW_STATE_LIST); } } if (portletMD.getPortletPreferences() =3D=3D null) { - portletMD.setPortletPreferences(new PortletPreferencesMetaData()); + portletMD.setPortletPreferences(EMPTY_PORTLET_PREFERENCES); } if (portletMD.getPortletPreferences().getPortletPreferences() =3D=3D= null) { - portletMD.getPortletPreferences().setPortletPreferences(new HashM= ap()); + portletMD.getPortletPreferences().setPortletPreferences(EMPTY_POR= TLET_PREFERENCE_MAP); } if (portletMD.getInitParams() =3D=3D null) { - portletMD.setInitParams(new ArrayList()); + portletMD.setInitParams(EMPTY_INIT_PARAM_LIST); } if (portletMD.getSupportedPublicRenderParameters() =3D=3D null) { - portletMD.setSupportedPublicRenderParameters(new ArrayList()); + portletMD.setSupportedPublicRenderParameters(EMPTY_STRING_LIST); } for (PortletPreferenceMetaData portletPreferenceMD : portletMD.getPo= rtletPreferences().getPortletPreferences().values()) { if (portletPreferenceMD.getValue() =3D=3D null) { - portletPreferenceMD.setValue(new ArrayList()); + portletPreferenceMD.setValue(EMPTY_STRING_LIST); } } = @@ -210,11 +265,11 @@ { if (portletMD.getSupportedProcessingEvent() =3D=3D null) { - portletMD.setSupportedProcessingEvent(new ArrayList()); + portletMD.setSupportedProcessingEvent(EMPTY_EVENT_DEFINITION_R= EFERENCE_LIST); } if (portletMD.getSupportedPublishingEvent() =3D=3D null) { - portletMD.setSupportedPublishingEvent(new ArrayList()); + portletMD.setSupportedPublishingEvent(EMPTY_EVENT_DEFINITION_R= EFERENCE_LIST); } } } @@ -272,6 +327,7 @@ // String defaultNamespace =3D XMLConstants.NULL_NS_URI; List listeners =3D Collections.emptyList(); + Map allFilters =3D new HashMap(); if (this.portletApplicationMD instanceof PortletApplication20MetaDat= a) { PortletApplication20MetaData tmp =3D (PortletApplication20MetaDat= a)this.portletApplicationMD; @@ -311,16 +367,16 @@ } listeners =3D Collections.unmodifiableList(listeners); = - // -// for (FilterMetaData filterMD : tmp.getFilterCollection()) -// { -// ContainerFilterInfo filter =3D build(filterMD); -// } + for (FilterMetaData filterMD : tmp.getFilterCollection()) + { + ContainerFilterInfo filter =3D build(filterMD); + allFilters.put(filter.getName(), filter); + } } = // - return new ContainerPortletApplicationInfo(defaultNamespace, listene= rs); + return new ContainerPortletApplicationInfo(defaultNamespace, allFilt= ers.values(), listeners); } = private ContainerListenerInfo build(ListenerMetaData listenerMD) @@ -339,13 +395,11 @@ initParameters.put(initParamMD.getName(), initParamMD.getValue()); } = - LifeCyclePhase lifeCycle; - // return new ContainerFilterInfo( filterMD.getFilterName(), filterMD.getFilterClass(), - null, + Collections.unmodifiableSet(new HashSet(filterMD.= getLifecycle())), filterMD.getDisplayName(), filterMD.getDescription(), Collections.unmodifiableMap(initParameters) @@ -425,6 +479,36 @@ ContainerNavigationInfo containerNavigation =3D buildContainerNav= igationInfo(portletMD); = // + List filters =3D new ArrayList(); + for (FilterMappingMetaData filterMappingMD : ((PortletApplication= 20MetaData)portletApplicationMD).getFilterMapping().values()) + { + for (String portletName : filterMappingMD.getPortletNames()) + { + boolean matches; + if (portletName.length() =3D=3D 0) + { + // Do smth + matches =3D false; + } + else if (portletName.endsWith("*")) + { + String prefix =3D portletName.substring(0, portletName.l= ength() - 1); + matches =3D portletMD.getPortletName().startsWith(prefix= ); + } + else + { + matches =3D portletMD.getPortletName().equals(portletNam= e); + } + + // Add the filter + if (matches) + { + filters.add(filterMappingMD.getName()); + } + } + } + + // containerPortletInfo =3D new ContainerPortletInfo( containerCapabilities, containerPreferences, @@ -434,6 +518,7 @@ containerSession, containerEvents, containerNavigation, + Collections.unmodifiableList(filters), portletMD.getPortletName(), portletMD.getPortletClass(), Collections.unmodifiableMap(initParameters), Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/info/ContainerPortletApplicationInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerPortletApplicationInfo.java 2008-02-02 14:21:03 UTC (rev 9= 713) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerPortletApplicationInfo.java 2008-02-02 18:26:59 UTC (rev 9= 714) @@ -23,6 +23,10 @@ package org.jboss.portal.portlet.impl.info; = import java.util.List; +import java.util.Map; +import java.util.LinkedHashMap; +import java.util.Collections; +import java.util.Collection; = /** * @author Julien Viet @@ -37,12 +41,24 @@ /** . */ private final List listeners; = + /** . */ + private final Map filters; + public ContainerPortletApplicationInfo( String defaultNamespace, + Collection filters, List listeners) { + LinkedHashMap tmp =3D new LinkedHashMap= (); + for (ContainerFilterInfo filter : filters) + { + tmp.put(filter.getName(), filter); + } + + // this.defaultNamespace =3D defaultNamespace; this.listeners =3D listeners; + this.filters =3D Collections.unmodifiableMap(tmp); } = public String getDefaultNamespace() @@ -54,4 +70,9 @@ { return listeners; } + + public Map getFilters() + { + return filters; + } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/info/ContainerPortletInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerPortletInfo.java 2008-02-02 14:21:03 UTC (rev 9713) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerPortletInfo.java 2008-02-02 18:26:59 UTC (rev 9714) @@ -26,8 +26,9 @@ import org.jboss.portal.common.i18n.ResourceBundleManager; = import java.util.Map; -import java.util.HashMap; import java.util.Set; +import java.util.List; +import java.util.Collections; = /** * For now implementation that use the portlet container directly. @@ -78,6 +79,9 @@ /** . */ private final ContainerNavigationInfo navigation; = + /** . */ + private final List filterRefs; + public ContainerPortletInfo( ContainerCapabilitiesInfo capabilities, ContainerPreferencesInfo preferences, @@ -99,6 +103,7 @@ this.session =3D session; this.events =3D new ContainerEventingInfo(); this.navigation =3D new ContainerNavigationInfo(); + this.filterRefs =3D Collections.emptyList(); this.name =3D name; this.className =3D className; this.initParameters =3D initParameters; @@ -115,6 +120,7 @@ ContainerSessionInfo session, ContainerEventingInfo events, ContainerNavigationInfo navigation, + List filterRefs, String name, String className, Map initParameters, @@ -129,6 +135,7 @@ this.session =3D session; this.events =3D events; this.navigation =3D navigation; + this.filterRefs =3D filterRefs; this.name =3D name; this.className =3D className; this.initParameters =3D initParameters; @@ -161,6 +168,11 @@ return initParameters.get(name); } = + public List getFilterRefs() + { + return filterRefs; + } + public ContainerCapabilitiesInfo getCapabilities() { return capabilities; Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/jsr168/ClassInstanceLifeCycle.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/ClassInstanceLifeCycle.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/ClassInstanceLifeCycle.java 2008-02-02 18:26:59 UTC (rev 9714) @@ -0,0 +1,179 @@ +/*************************************************************************= ***** + * 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.portlet.impl.jsr168; + +import org.jboss.portal.portlet.container.PortletInitializationException; +import org.apache.log4j.Logger; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ClassInstanceLifeCycle +{ + + /** . */ + private Logger log; + + /** . */ + private Class expectedClass; + + /** . */ + private ClassLoader classLoader; + + /** . */ + private String className; + + /** . */ + private String type; + + /** . */ + private T instance; + + public ClassInstanceLifeCycle( + Logger log, + Class expectedClass, + ClassLoader classLoader, + String className, + String type) + { + this.log =3D log; + this.expectedClass =3D expectedClass; + this.classLoader =3D classLoader; + this.className =3D className; + this.type =3D type; + } + + public void create() throws PortletInitializationException + { + T instance; + try + { + Class clazz =3D classLoader.loadClass(className); + if (expectedClass.isAssignableFrom(clazz)) + { + Class castedClass =3D clazz.asSubclass(expectedCl= ass); + Constructor ctor =3D castedClass.getConstructor(); + instance =3D ctor.newInstance(); + } + else + { + String msg =3D "Cannot create " + type + " with class " + clas= sName + " because it does not implement the expected interface " + expected= Class.getName(); + throw new PortletInitializationException(msg); + } + } + catch (InvocationTargetException e) + { + String msg =3D "Cannot create " + type + " with class " + classNa= me + " because the class contructor threw an exception"; + throw new PortletInitializationException(msg, e.getCause()); + } + catch (IllegalAccessException e) + { + String msg =3D "Cannot create " + type + " with class " + classNa= me + " because the class is not accessible"; + throw new PortletInitializationException(msg, e); + } + catch (NoSuchMethodException e) + { + String msg =3D "Cannot create " + type + " with class " + classNa= me + " because it does not have an no argument constructor"; + throw new PortletInitializationException(msg, e); + } + catch (ClassNotFoundException e) + { + String msg =3D "Cannot create " + type + " with class " + classNa= me + " because the class cannot be loaded"; + throw new PortletInitializationException(msg, e); + } + catch (InstantiationException e) + { + String msg =3D "Cannot create " + type + " with class " + classNa= me + " because it cannot be instantiated"; + throw new PortletInitializationException(msg, e); + } + catch (Error e) + { + String msg =3D "Cannot create " + type + " with class " + classNa= me + " because of an error"; + throw new PortletInitializationException(msg, e); + } + + // + final ClassLoader previousLoader =3D Thread.currentThread().getConte= xtClassLoader(); + try + { + Thread.currentThread().setContextClassLoader(classLoader); + + // + start(instance); + } + catch (Exception e) + { + String msg =3D "The " + type + " threw an exception during init"; + throw new PortletInitializationException(msg, e); + } + finally + { + Thread.currentThread().setContextClassLoader(previousLoader); + } + + // + this.instance =3D instance; + } + + public void destroy() + { + if (instance =3D=3D null) + { + throw new IllegalStateException("No instance created previously"); + } + + // + try + { + stop(instance); + } + catch (Error e) + { + log.error("Stopping the " + type + " threw an error", e); + } + catch (Exception e) + { + log.error("Stopping the " + type + " threw an exception", e); + } + } + + public T getInstance() + { + return instance; + } + + protected void start(T instance) throws Exception + { + + } + + protected void stop(T instance) + { + + } + +} Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletApplicationImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletApplicationImpl.java 2008-02-02 14:21:03 UTC (rev 9713) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletApplicationImpl.java 2008-02-02 18:26:59 UTC (rev 9714) @@ -24,25 +24,36 @@ = import org.jboss.portal.portlet.impl.jsr168.api.PortletContextImpl; import org.jboss.portal.portlet.impl.jsr168.api.PortletURLGenerationListen= erChain; +import org.jboss.portal.portlet.impl.jsr168.api.FilterConfigImpl; import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory; import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo; import org.jboss.portal.portlet.impl.info.ContainerListenerInfo; +import org.jboss.portal.portlet.impl.info.ContainerFilterInfo; import org.jboss.portal.portlet.metadata.JBossApplicationMetaData; import org.jboss.portal.portlet.container.PortletApplication; import org.jboss.portal.portlet.container.PortletApplicationContext; import org.jboss.portal.portlet.container.PortletContainer; +import org.jboss.portal.portlet.container.PortletInitializationException; +import org.jboss.portal.portlet.LifeCyclePhase; import org.apache.log4j.Logger; = import javax.portlet.PortletContext; import javax.portlet.PortletURLGenerationListener; +import javax.portlet.filter.PortletFilter; +import javax.portlet.filter.ActionFilter; +import javax.portlet.filter.EventFilter; +import javax.portlet.filter.RenderFilter; +import javax.portlet.filter.ResourceFilter; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.Set; import java.util.List; import java.util.LinkedList; import java.util.Collections; -import java.lang.reflect.Constructor; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; = /** * @author Julien Viet @@ -51,6 +62,17 @@ public class PortletApplicationImpl implements PortletApplication { = + private static final EnumMap> phaseToType =3D + new EnumMap>(LifeCycl= ePhase.class); + + static + { + phaseToType.put(LifeCyclePhase.ACTION, ActionFilter.class); + phaseToType.put(LifeCyclePhase.EVENT, EventFilter.class); + phaseToType.put(LifeCyclePhase.RENDER, RenderFilter.class); + phaseToType.put(LifeCyclePhase.RESOURCE, ResourceFilter.class); + } + /** Logger. */ protected final Logger log; = @@ -81,14 +103,11 @@ /** . */ protected PortletURLGenerationListener urlListener; = + /** . */ + protected Map filters; + /** * Todo remove meta data reference and use info instead. - * = - * @param info - * @param metaData - * @param jbossMetaData - * @param context - * @param portletAPIFactory */ public PortletApplicationImpl( ContainerPortletApplicationInfo info, @@ -145,63 +164,94 @@ = public void start() throws Exception { + PortletContextImpl portletContext =3D new PortletContextImpl(context= .getServletContext()); + + // + // List listeners =3D Collections.emptyLi= st(); for (ContainerListenerInfo listenerInfo : info.getListeners()) { - String className =3D listenerInfo.getClassName(); - ClassLoader classLoader =3D context.getClassLoader(); try { - Class clazz =3D classLoader.loadClass(className); - if (PortletURLGenerationListener.class.isAssignableFrom(clazz)) + String className =3D listenerInfo.getClassName(); + + ClassInstanceLifeCycle lifeCycle= =3D new ClassInstanceLifeCycle( + log, + PortletURLGenerationListener.class, + context.getClassLoader(), + className, + "listener" + ); + + // + lifeCycle.create(); + + // + if (listeners.size() =3D=3D 0) { - Constructor ctor =3D clazz.getConstructor(); - PortletURLGenerationListener listener =3D (PortletURLGenera= tionListener)ctor.newInstance(); - if (listeners.size() =3D=3D 0) - { - listeners =3D new LinkedList(); - } - listeners.add(listener); + listeners =3D new LinkedList(= ); } - else - { - log.info("Cannot create filter with class " + className + "= because it does not implement the PortletURLGenerationListener interface"); - } + + // + listeners.add(lifeCycle.getInstance()); } - catch (IllegalAccessException e) + catch (PortletInitializationException e) { - log.error("Cannot create filter with class " + className + " b= ecause the class is not accessible", e); + log.error(e.getMessage(), e); } - catch (NoSuchMethodException e) + } + + // + HashMap filters =3D new HashMap(); + for (ContainerFilterInfo filterInfo : info.getFilters().values()) + { + try { - log.error("Cannot create filter with class " + className + " b= ecause it does not have an no argument constructor", e); + String className =3D filterInfo.getClassName(); + FilterLifecycle lifeCycle =3D new FilterLifecycle( + PortletFilter.class, + context.getClassLoader(), + className, + "filter", + filterInfo.getName()); + + // + lifeCycle.create(); + + // + for (LifeCyclePhase phase : filterInfo.getLifeCycles()) + { + Class type =3D phaseToType.get(pha= se); + FilterKey key =3D new FilterKey(filterInfo.getName(), type); + filters.put(key, lifeCycle); + } } - catch (ClassNotFoundException e) + catch (PortletInitializationException e) { - log.error("Cannot create filter with class " + className + " b= ecause the class cannot be loaded", e); + log.error(e.getMessage(), e); } - catch (InstantiationException e) - { - log.error("Cannot create filter with class " + className + " b= ecause it cannot be instantiated", e); - } - catch (Error e) - { - log.error("Cannot create filter with class " + className + " b= ecause of an error", e); - } } = // this.version =3D metaData.getVersion(); - this.portletContext =3D new PortletContextImpl(context.getServletCon= text()); + this.portletContext =3D portletContext; this.urlListener =3D listeners.size() =3D=3D 0 ? null : new PortletU= RLGenerationListenerChain(Collections.unmodifiableList(listeners)); - + this.filters =3D filters; } = public void stop() { + // Stop filters + for (FilterLifecycle filter : filters.values()) + { + filter.destroy(); + } + + // this.version =3D null; this.portletContext =3D null; this.urlListener =3D null; + this.filters =3D null; } = public String getVersion() @@ -225,6 +275,20 @@ return null; } = + public T getFilter(String filterName, Class phase) + { + FilterLifecycle lifeCycle =3D filters.get(new FilterKey(filterName, = phase)); + + // + if (lifeCycle =3D=3D null) + { + return null; + } + + // Should be ok + return phase.cast(lifeCycle.getInstance()); + } + // WebApp implementation **********************************************= ********************************************** = public Set getPortletContainers() @@ -248,4 +312,73 @@ { return "PortletWebApp[" + metaData.getId() + "]"; } + + private static class FilterKey + { + + /** . */ + private final String name; + + /** . */ + private final Class phase; + + private FilterKey(String name, Class phase) + { + this.name =3D name; + this.phase =3D phase; + } + + public int hashCode() + { + return name.hashCode() + name.hashCode(); + } + + public boolean equals(Object obj) + { + if (obj =3D=3D this) + { + return true; + } + if (obj instanceof FilterKey) + { + FilterKey that =3D (FilterKey)obj; + return name.equals(that.name) && phase =3D=3D that.phase; + } + return false; + } + } + + private class FilterLifecycle extends ClassInstanceLifeCycle + { + + /** . */ + private final String filterName; + + private FilterLifecycle( + Class expectedClass, + ClassLoader classLoader, + String className, + String type, + String filterName) + { + super(log, expectedClass, classLoader, className, type); + + // + this.filterName =3D filterName; + } + + public void start(PortletFilter instance) throws Exception + { + FilterConfigImpl config =3D new FilterConfigImpl(filterName, port= letContext); + + // + instance.init(config); + } + + public void stop(PortletFilter instance) + { + instance.destroy(); + } + } + } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletContainerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletContainerImpl.java 2008-02-02 14:21:03 UTC (rev 9713) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletContainerImpl.java 2008-02-02 18:26:59 UTC (rev 9714) @@ -39,6 +39,7 @@ import org.jboss.portal.portlet.impl.jsr168.api.EventResponseImpl; import org.jboss.portal.portlet.impl.jsr168.api.ResourceRequestImpl; import org.jboss.portal.portlet.impl.jsr168.api.ResourceResponseImpl; +import org.jboss.portal.portlet.impl.jsr168.api.FilterChainImpl; import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory; import org.jboss.portal.portlet.impl.info.ContainerPortletInfo; import org.jboss.portal.portlet.impl.info.ContainerPreferencesInfo; @@ -61,9 +62,27 @@ import javax.portlet.UnavailableException; import javax.portlet.EventPortlet; import javax.portlet.ResourceServingPortlet; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import javax.portlet.filter.PortletFilter; +import javax.portlet.filter.ActionFilter; +import javax.portlet.filter.EventFilter; +import javax.portlet.filter.RenderFilter; +import javax.portlet.filter.ResourceFilter; +import javax.portlet.filter.FilterChain; +import javax.portlet.filter.FilterConfig; import javax.servlet.http.HttpServletRequest; import java.io.IOException; import java.util.Set; +import java.util.List; +import java.util.ArrayList; +import java.util.Collections; = /** * @author Julien Viet @@ -99,6 +118,21 @@ /** User data constraint. */ protected Set userDataConstraints; = + /** . */ + private final Invoker invoker =3D new Invoker(); + + /** . */ + private List actionFilterList; + + /** . */ + private List eventFilterList; + + /** . */ + private List renderFilterList; + + /** . */ + private List resourceFilterList; + /** * The preference validator, this is not exposed as runtime meta data a= s it is only used by the JSR 168 portlet * container implementation. @@ -201,6 +235,9 @@ this.config =3D config; this.started =3D true; = + // + buildFilterChains(); + // Let invocation flow in valve.open(); } @@ -230,6 +267,37 @@ } } = + private void buildFilterChains() + { + List actionFilterList =3D builderFilterList(ActionFilt= er.class); + List eventFilterList =3D builderFilterList(EventFilter.= class); + List renderFilterList =3D builderFilterList(RenderFilt= er.class); + List resourceFilterList =3D builderFilterList(Resour= ceFilter.class); + + // Add invoker + actionFilterList.add(invoker); + eventFilterList.add(invoker); + renderFilterList.add(invoker); + resourceFilterList.add(invoker); + + // + this.actionFilterList =3D Collections.unmodifiableList(actionFilterL= ist); + this.eventFilterList =3D Collections.unmodifiableList(eventFilterLis= t); + this.renderFilterList =3D Collections.unmodifiableList(renderFilterL= ist); + this.resourceFilterList =3D Collections.unmodifiableList(resourceFil= terList); + } + + private List builderFilterList(Class ty= pe) + { + ArrayList list =3D new ArrayList(); + for (String filterRef : info.getFilterRefs()) + { + T filter =3D application.getFilter(filterRef, type); + list.add(filter); + } + return list; + } + public void stop() { // if the portlet is not started, we shouldn't be trying to stop it.= .. @@ -419,7 +487,10 @@ dreq.setAttribute(APIConstants.JAVAX_PORTLET_RESPONSE, resp); dreq.setAttribute(APIConstants.JAVAX_PORTLET_LIFECYCLE_PHASE, "AC= TION_PHASE"); dreq.setAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_= INVOCATION, invocation); - portlet.processAction(req, resp); + + // + FilterChainImpl chain =3D new FilterChainImpl(actionFilterList, ActionFilter.class); + chain.doFilter(req, resp); } finally { @@ -446,7 +517,10 @@ dreq.setAttribute(APIConstants.JAVAX_PORTLET_RESPONSE, resp); dreq.setAttribute(APIConstants.JAVAX_PORTLET_LIFECYCLE_PHASE, "RE= NDER_PHASE"); dreq.setAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_= INVOCATION, invocation); - portlet.render(req, resp); + + // + FilterChainImpl chain =3D new FilterChainImpl(renderFilterList, RenderFilter.class); + chain.doFilter(req, resp); } finally { @@ -466,17 +540,20 @@ = // PortletAPIFactory factory =3D application.getPortletAPIFactory(); - EventRequestImpl ereq =3D factory.createEventRequest(invocation); - EventResponseImpl eresp =3D factory.createEventResponse(invocation, = ereq); + EventRequestImpl req =3D factory.createEventRequest(invocation); + EventResponseImpl resp =3D factory.createEventResponse(invocation, r= eq); HttpServletRequest dreq =3D invocation.getDispatchedRequest(); try { dreq.setAttribute(APIConstants.JAVAX_PORTLET_CONFIG, config); - dreq.setAttribute(APIConstants.JAVAX_PORTLET_REQUEST, ereq); - dreq.setAttribute(APIConstants.JAVAX_PORTLET_RESPONSE, eresp); + dreq.setAttribute(APIConstants.JAVAX_PORTLET_REQUEST, req); + dreq.setAttribute(APIConstants.JAVAX_PORTLET_RESPONSE, resp); dreq.setAttribute(APIConstants.JAVAX_PORTLET_LIFECYCLE_PHASE, "EV= ENT_PHASE"); dreq.setAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_= INVOCATION, invocation); - eventPortlet.processEvent(ereq, eresp); + + // + FilterChainImpl chain =3D new FilterChainImpl(eventFilterList, EventFilter.class); + chain.doFilter(req, resp); } finally { @@ -486,7 +563,7 @@ dreq.removeAttribute(APIConstants.JAVAX_PORTLET_LIFECYCLE_PHASE); dreq.removeAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONE= NT_INVOCATION); } - return eresp.getResponse(); + return resp.getResponse(); } = protected PortletInvocationResponse invokeResource(ResourceInvocation i= nvocation) throws IOException, PortletException @@ -506,7 +583,10 @@ dreq.setAttribute(APIConstants.JAVAX_PORTLET_RESPONSE, resp); dreq.setAttribute(APIConstants.JAVAX_PORTLET_LIFECYCLE_PHASE, "RE= SOURCE_SERVING_PHASE"); dreq.setAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_= INVOCATION, invocation); - eventPortlet.serveResource(req, resp); + + // + FilterChainImpl chain =3D new FilterChainImpl(resourceFilterList, ResourceFilter.class); + chain.doFilter(req, resp); } finally { @@ -520,4 +600,39 @@ // return resp.getResponse(); } + + private class Invoker implements ActionFilter, EventFilter, RenderFilte= r, ResourceFilter + { + + public void doFilter(ActionRequest req, ActionResponse resp, FilterC= hain chain) throws IOException, PortletException + { + portlet.processAction(req, resp); + } + + public void doFilter(EventRequest req, EventResponse resp, FilterCha= in chain) throws IOException, PortletException + { + EventPortlet eventPortlet =3D (EventPortlet)portlet; + eventPortlet.processEvent(req, resp); + } + + public void doFilter(RenderRequest req, RenderResponse resp, FilterC= hain chain) throws IOException, PortletException + { + portlet.render(req, resp); + } + + public void doFilter(ResourceRequest req, ResourceResponse resp, Fil= terChain chain) throws IOException, PortletException + { + ResourceServingPortlet servingPortlet =3D (ResourceServingPortlet= )portlet; + servingPortlet.serveResource(req, resp); + } + + public void init(FilterConfig filterConfig) throws PortletException + { + } + + public void destroy() + { + } + } + } Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/jsr168/api/FilterChainImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/FilterChainImpl.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/FilterChainImpl.java 2008-02-02 18:26:59 UTC (rev 9714) @@ -0,0 +1,165 @@ +/*************************************************************************= ***** + * 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.portlet.impl.jsr168.api; + +import javax.portlet.filter.PortletFilter; +import javax.portlet.filter.ActionFilter; +import javax.portlet.filter.ResourceFilter; +import javax.portlet.filter.RenderFilter; +import javax.portlet.filter.EventFilter; +import javax.portlet.filter.FilterChain; +import javax.portlet.PortletException; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import java.io.IOException; +import java.util.List; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class FilterChainImpl implements FilterCha= in +{ + + /** . */ + private List filters; + + /** . */ + private Class phase; + + /** . */ + private int index; + + public FilterChainImpl(List filters, Class phase) + { + this.filters =3D filters; + this.phase =3D phase; + this.index =3D 0; + } + + public void doFilter(ActionRequest req, ActionResponse resp) throws IOE= xception, PortletException + { + if (!ActionFilter.class.isAssignableFrom(phase)) + { + throw new IllegalStateException(); + } + if (index >=3D filters.size()) + { + throw new IllegalStateException(); + } + + // + int currentIndex =3D index++; + try + { + PortletFilter filter =3D filters.get(currentIndex); + ActionFilter actionFilter =3D ActionFilter.class.cast(filter); + actionFilter.doFilter(req, resp, this); + } + finally + { + index--; + } + } + + public void doFilter(EventRequest req, EventResponse resp) throws IOExc= eption, PortletException + { + if (!EventFilter.class.isAssignableFrom(phase)) + { + throw new IllegalStateException(); + } + if (index >=3D filters.size()) + { + throw new IllegalStateException(); + } + + // + int currentIndex =3D index++; + try + { + PortletFilter filter =3D filters.get(currentIndex); + EventFilter eventFilter =3D EventFilter.class.cast(filter); + eventFilter.doFilter(req, resp, this); + } + finally + { + index--; + } + } + + public void doFilter(RenderRequest req, RenderResponse resp) throws IOE= xception, PortletException + { + if (!RenderFilter.class.isAssignableFrom(phase)) + { + throw new IllegalStateException(); + } + if (index >=3D filters.size()) + { + throw new IllegalStateException(); + } + + // + int currentIndex =3D index++; + try + { + PortletFilter filter =3D filters.get(currentIndex); + RenderFilter renderFilter =3D RenderFilter.class.cast(filter); + renderFilter.doFilter(req, resp, this); + } + finally + { + index--; + } + } + + public void doFilter(ResourceRequest req, ResourceResponse resp) throws= IOException, PortletException + { + if (!ResourceFilter.class.isAssignableFrom(phase)) + { + throw new IllegalStateException(); + } + if (index >=3D filters.size()) + { + throw new IllegalStateException(); + } + + // + int currentIndex =3D index++; + try + { + PortletFilter filter =3D filters.get(currentIndex); + ResourceFilter resourceFilter =3D ResourceFilter.class.cast(filte= r); + resourceFilter.doFilter(req, resp, this); + } + finally + { + index--; + } + } +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/jsr168/api/FilterConfigImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/FilterConfigImpl.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/FilterConfigImpl.java 2008-02-02 18:26:59 UTC (rev 9714) @@ -0,0 +1,69 @@ +/*************************************************************************= ***** + * 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.portlet.impl.jsr168.api; + +import org.jboss.portal.common.NotYetImplemented; + +import javax.portlet.filter.FilterConfig; +import javax.portlet.PortletContext; +import java.util.Enumeration; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class FilterConfigImpl implements FilterConfig +{ + + /** . */ + private final String name; + + /** . */ + private final PortletContext context; + + public FilterConfigImpl(String name, PortletContext context) + { + this.name =3D name; + this.context =3D context; + } + + public String getFilterName() + { + return name; + } + + public PortletContext getPortletContext() + { + return context; + } + + public String getInitParameter(String s) + { + throw new NotYetImplemented(); + } + + public Enumeration getInitParameterNames() + { + throw new NotYetImplemented(); + } +} Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-02 14:21:03 UTC (= rev 9713) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-02 18:26:59 UTC (= rev 9714) @@ -16,7 +16,7 @@ = - + = = --===============5733519827809659038==-- From portal-commits at lists.jboss.org Sat Feb 2 18:18:06 2008 Content-Type: multipart/mixed; boundary="===============0132927525270563649==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9715 - in modules/portlet/trunk: portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck and 8 other directories. Date: Sat, 02 Feb 2008 18:18:06 -0500 Message-ID: --===============0132927525270563649== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-02 18:18:06 -0500 (Sat, 02 Feb 2008) New Revision: 9715 Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portletfilter/ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portletfilter/AbstractPortletFilter.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portletfilter/AbstractRenderFilter.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portletfilter/Filter1.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portletfilter/PortletFilterCounter.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portletfilter/PortletFilterTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portletfilter/TraceFilter.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portletfilter/WildcardTestCase.java modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletfilter-w= ar/ modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletfilter-w= ar/WEB-INF/ modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletfilter-w= ar/WEB-INF/portlet.xml modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletfilter-w= ar/WEB-INF/web.xml Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerInfoBuilder.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/Portle= tTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/Portle= tTestContext.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/Portle= tTestDriver.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/base/A= bstractUniversalTestPortlet.java modules/portlet/trunk/test/src/test/build.xml modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml Log: - start to implement filtering test case Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/info/ContainerInfoBuilder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerInfoBuilder.java 2008-02-02 18:26:59 UTC (rev 9714) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerInfoBuilder.java 2008-02-02 23:18:06 UTC (rev 9715) @@ -204,6 +204,13 @@ { tmp.setFilters(EMPTY_FILTER_MAP); } + for (FilterMetaData filterMD : tmp.getFilters().values()) + { + if (filterMD.getInitParams() =3D=3D null) + { + filterMD.setInitParams(EMPTY_INIT_PARAM_LIST); + } + } if (tmp.getFilterMapping() =3D=3D null) { tmp.setFilterMapping(EMPTY_FILTER_MAPPING_MAP); Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/portletfilter/AbstractPortletFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/AbstractPortletFilter.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/AbstractPortletFilter.java 2008-02-02 23:18:06 = UTC (rev 9715) @@ -0,0 +1,64 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.tck.portletfilter; + +import javax.portlet.filter.FilterConfig; +import javax.portlet.PortletException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public abstract class AbstractPortletFilter +{ + + /** . */ + private FilterConfig config; + + public void init(FilterConfig config) throws PortletException + { + this.config =3D config; + } + + public void destroy() + { + this.config =3D null; + } + + protected FilterConfig getConfig() + { + return config; + } + + protected String getName() + { + if (config !=3D null) + { + return config.getFilterName(); + } + else + { + return null; + } + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/portletfilter/AbstractRenderFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/AbstractRenderFilter.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/AbstractRenderFilter.java 2008-02-02 23:18:06 U= TC (rev 9715) @@ -0,0 +1,42 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.tck.portletfilter; + +import javax.portlet.filter.RenderFilter; +import javax.portlet.filter.FilterChain; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class AbstractRenderFilter extends AbstractPortletFilter implements= RenderFilter +{ + public void doFilter(RenderRequest req, RenderResponse resp, FilterChai= n chain) throws IOException, PortletException + { + chain.doFilter(req, resp); + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/portletfilter/Filter1.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/Filter1.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/Filter1.java 2008-02-02 23:18:06 UTC (rev 9715) @@ -0,0 +1,34 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.tck.portletfilter; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class Filter1 extends AbstractRenderFilter +{ + + = + +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/portletfilter/PortletFilterCounter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/PortletFilterCounter.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/PortletFilterCounter.java 2008-02-02 23:18:06 U= TC (rev 9715) @@ -0,0 +1,50 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.tck.portletfilter; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletFilterCounter extends AbstractRenderFilter +{ + + /** . */ + private static int counter; + + public static int getCounter() + { + synchronized (PortletFilterCounter.class) + { + return counter; + } + } + + public PortletFilterCounter() + { + synchronized (PortletFilterCounter.class) + { + counter++; + } + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/portletfilter/PortletFilterTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/PortletFilterTestCase.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/PortletFilterTestCase.java 2008-02-02 23:18:06 = UTC (rev 9715) @@ -0,0 +1,59 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.tck.portletfilter; + +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.Assertion; +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import static org.jboss.unit.api.Assert.*; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)TestCase({Assertion.JSR286_297}) +public class PortletFilterTestCase +{ + public PortletFilterTestCase(PortletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + assertEquals(1, PortletFilterCounter.getCounter()); + return new EndTestResponse(); + } + }); + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/portletfilter/TraceFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/TraceFilter.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/TraceFilter.java 2008-02-02 23:18:06 UTC (rev 9= 715) @@ -0,0 +1,149 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.tck.portletfilter; + +import javax.portlet.filter.ActionFilter; +import javax.portlet.filter.EventFilter; +import javax.portlet.filter.RenderFilter; +import javax.portlet.filter.ResourceFilter; +import javax.portlet.filter.FilterChain; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.PortletException; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import java.io.IOException; +import java.util.Map; +import java.util.HashMap; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class TraceFilter extends AbstractPortletFilter implements ActionFi= lter, EventFilter, RenderFilter, ResourceFilter +{ + + /** . */ + public static final int ACTION =3D 0; + + /** . */ + public static final int EVENT =3D 1; + + /** . */ + public static final int RENDER =3D 2; + + /** . */ + public static final int RESOURCE =3D 3; + + /** . */ + private static final Map traces =3D new HashMap(); + + public static boolean isActive(String name, int type) + { + return traces.containsKey(name) && traces.get(name) =3D=3D type; + } + + private static void push(String name, int type) + { + if (!traces.containsKey(name)) + { + traces.put(name, type); + } + } + + private static void pop(String name, int type) + { + if (isActive(name, type)) + { + traces.remove(name); + } + } + + public void doFilter(ActionRequest req, ActionResponse resp, FilterChai= n chain) throws IOException, PortletException + { + String name =3D getName(); + + // + push(name, ACTION); + try + { + chain.doFilter(req, resp); + } + finally + { + pop(name, ACTION); + } + } + + public void doFilter(EventRequest req, EventResponse resp, FilterChain = chain) throws IOException, PortletException + { + String name =3D getName(); + + // + push(name, EVENT); + try + { + chain.doFilter(req, resp); + } + finally + { + pop(name, EVENT); + } + } + + public void doFilter(RenderRequest req, RenderResponse resp, FilterChai= n chain) throws IOException, PortletException + { + String name =3D getName(); + + // + push(name, RENDER); + try + { + chain.doFilter(req, resp); + } + finally + { + pop(name, RENDER); + } + } + + public void doFilter(ResourceRequest req, ResourceResponse resp, Filter= Chain chain) throws IOException, PortletException + { + String name =3D getName(); + + // + push(name, RESOURCE); + try + { + chain.doFilter(req, resp); + } + finally + { + pop(name, RESOURCE); + } + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/portletfilter/WildcardTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/WildcardTestCase.java (= rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/WildcardTestCase.java 2008-02-02 23:18:06 UTC (= rev 9715) @@ -0,0 +1,146 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.tck.portletfilter; + +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.Assertion; +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.unit.actions.PortletActionTestAction; +import org.jboss.portal.unit.actions.PortletEventTestAction; +import org.jboss.portal.unit.actions.PortletResourceTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.portal.test.portlet.framework.UTP2; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; +import static org.jboss.unit.api.Assert.*; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)TestCase({Assertion.JSR286_298}) +public class WildcardTestCase +{ + public WildcardTestCase(PortletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + return new InvokeGetResponse(response.createActionURL().toStri= ng()); + } + }); + seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestActio= n() + { + protected void run(Portlet portlet, ActionRequest request, Action= Response response, PortletTestContext context) throws PortletException, IOE= xception + { + assertTrue(TraceFilter.isActive("WildcardFilter", TraceFilter.= ACTION)); + assertFalse((TraceFilter.isActive("PartialWildcardFilter", Tra= ceFilter.ACTION))); + response.setEvent("Event", null); + } + }); + seq.bindAction(1, UTP1.EVENT_JOIN_POINT, new PortletEventTestAction() + { + protected void run(Portlet portlet, EventRequest request, EventRe= sponse response, PortletTestContext context) throws PortletException, IOExc= eption + { + assertTrue(TraceFilter.isActive("WildcardFilter", TraceFilter.= EVENT)); + assertFalse((TraceFilter.isActive("PartialWildcardFilter", Tra= ceFilter.EVENT))); + } + }); + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + assertTrue(TraceFilter.isActive("WildcardFilter", TraceFilter.= RENDER)); + assertFalse((TraceFilter.isActive("PartialWildcardFilter", Tra= ceFilter.RENDER))); + return new InvokeGetResponse(response.createResourceURL().toSt= ring()); + } + }); + seq.bindAction(2, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + { + protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException + { + assertTrue(TraceFilter.isActive("WildcardFilter", TraceFilter.= RESOURCE)); + assertFalse((TraceFilter.isActive("PartialWildcardFilter", Tra= ceFilter.RESOURCE))); + return new InvokeGetResponse(response.createRenderURL().toStri= ng()); + } + }); + seq.bindAction(3, UTP2.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + return new InvokeGetResponse(response.createActionURL().toStri= ng()); + } + }); + seq.bindAction(4, UTP2.ACTION_JOIN_POINT, new PortletActionTestActio= n() + { + protected void run(Portlet portlet, ActionRequest request, Action= Response response, PortletTestContext context) throws PortletException, IOE= xception + { + assertTrue(TraceFilter.isActive("WildcardFilter", TraceFilter.= ACTION)); + assertTrue(TraceFilter.isActive("PartialWildcardFilter", Trace= Filter.ACTION)); + response.setEvent("Event", null); + } + }); + seq.bindAction(4, UTP2.EVENT_JOIN_POINT, new PortletEventTestAction() + { + protected void run(Portlet portlet, EventRequest request, EventRe= sponse response, PortletTestContext context) throws PortletException, IOExc= eption + { + assertTrue(TraceFilter.isActive("WildcardFilter", TraceFilter.= EVENT)); + assertTrue(TraceFilter.isActive("PartialWildcardFilter", Trace= Filter.EVENT)); + } + }); + seq.bindAction(4, UTP2.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + assertTrue(TraceFilter.isActive("WildcardFilter", TraceFilter.= RENDER)); + assertTrue(TraceFilter.isActive("PartialWildcardFilter", Trace= Filter.RENDER)); + return new InvokeGetResponse(response.createResourceURL().toSt= ring()); + } + }); + seq.bindAction(5, UTP2.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + { + protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException + { + assertTrue(TraceFilter.isActive("WildcardFilter", TraceFilter.= RESOURCE)); + assertTrue(TraceFilter.isActive("PartialWildcardFilter", Trace= Filter.RESOURCE)); + return new EndTestResponse(); + } + }); + } +} Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit= /PortletTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/Portl= etTestCase.java 2008-02-02 18:26:59 UTC (rev 9714) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/Portl= etTestCase.java 2008-02-02 23:18:06 UTC (rev 9715) @@ -26,6 +26,8 @@ import org.jboss.portal.unit.JoinPointType; import org.jboss.portal.unit.JoinPoint; = +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; import java.util.HashMap; import java.util.Map; import java.util.Set; @@ -77,7 +79,7 @@ internalBind(requestCount, nodeId, joinPoint, action); } = - public void internalBind(Integer count, NodeId nodeId, JoinPoint joinPo= int, TestAction action) + private void internalBind(Integer count, NodeId nodeId, JoinPoint joinP= oint, TestAction action) { if (action =3D=3D null) { @@ -124,6 +126,19 @@ return null; } = + public Set getJoinPoints(int count) + { + Set joinPoints =3D new HashSet(); + for (Key key : bindings.keySet()) + { + if (key.count =3D=3D count) + { + joinPoints.add(key.joinPoint); + } + } + return joinPoints; + } + public TestAction getAction(int count, NodeId nodeId, JoinPoint joinPoi= nt) { // Try a timed action Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit= /PortletTestContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/Portl= etTestContext.java 2008-02-02 18:26:59 UTC (rev 9714) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/Portl= etTestContext.java 2008-02-02 23:18:06 UTC (rev 9715) @@ -35,6 +35,8 @@ import java.io.Serializable; import java.util.HashMap; import java.util.Map; +import java.util.Set; +import java.util.HashSet; = /** * @author Julien Viet @@ -50,6 +52,9 @@ final PortletTestCase portletTestCase; = /** . */ + final Set invoked; + + /** . */ RequestContext requestContext; = /** . */ @@ -64,6 +69,7 @@ this.testName =3D testName; this.portletTestCase =3D portletTestCase; this.requestContext =3D requestContext; + this.invoked =3D new HashSet(); } = public String getTestName() @@ -71,6 +77,47 @@ return testName; } = + private static class JoinPointInvocation + { + + /** . */ + private final int requestCount; + + /** . */ + private final JoinPoint joinPoint; + + private JoinPointInvocation(int requestCount, JoinPoint joinPoint) + { + this.requestCount =3D requestCount; + this.joinPoint =3D joinPoint; + } + + public boolean equals(Object obj) + { + if (obj =3D=3D this) + { + return true; + } + if (obj instanceof JoinPointInvocation) + { + JoinPointInvocation that =3D (JoinPointInvocation)obj; + return requestCount =3D=3D that.requestCount && joinPoint.equa= ls(that.joinPoint); + } + return false; + } + + public int hashCode() + { + return requestCount + joinPoint.hashCode(); + } + } + + public void setInvoked(JoinPoint joinPoint) + { +// invocations.add(new JoinPointInvocation(requestCount, joinPoint)); + invoked.add(joinPoint); + } + public String getActorId(JoinPointType joinPointType) { return portletTestCase.getActorId(requestContext.getRequestCount(), = joinPointType); Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit= /PortletTestDriver.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/Portl= etTestDriver.java 2008-02-02 18:26:59 UTC (rev 9714) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/Portl= etTestDriver.java 2008-02-02 23:18:06 UTC (rev 9715) @@ -188,6 +188,31 @@ = public ResponseContext popContext(TestId testId) { +// // Ensuite that everything was called +// Set expected =3D portletTestCase.getJoinPoints(conte= xt.requestContext.getRequestCount()); +// +// if (!expected.equals(context.invoked)) +// { +// Set notInvoked =3D new HashSet(expecte= d); +// notInvoked.removeAll(context.invoked); +// +// StringBuffer msg =3D new StringBuffer("Those joinpoints shou= ld have been invoked ["); +// for (Iterator i =3D notInvoked.iterator();i.hasNe= xt();) +// { +// JoinPoint joinPoint =3D i.next(); +// msg.append(joinPoint); +// if (i.hasNext()) +// { +// msg.append(','); +// } +// } +// msg.append(']'); +// +// // +// return new ResponseContext(new FailureResponse(Failure.creat= eErrorFailure(msg.toString())), new HashMap()); +// } + + // return context.responseContext; } = Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit= /base/AbstractUniversalTestPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/base/= AbstractUniversalTestPortlet.java 2008-02-02 18:26:59 UTC (rev 9714) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/base/= AbstractUniversalTestPortlet.java 2008-02-02 23:18:06 UTC (rev 9715) @@ -268,7 +268,6 @@ reset(); } = - // // Get the action TestAction action =3D null; PortletTestCase portletTestCase =3D getSequence(ctx.getTestName()); Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-02 18:26:59 UTC (= rev 9714) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-02 23:18:06 UTC (= rev 9715) @@ -358,6 +358,7 @@ + Added: modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletfilt= er-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletfilter-= war/WEB-INF/portlet.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletfilter-= war/WEB-INF/portlet.xml 2008-02-02 23:18:06 UTC (rev 9715) @@ -0,0 +1,96 @@ + + + + + + + UniversalTestPortletA + org.jboss.portal.test.portlet.framework.UTP1 + + text/html + + + Event + + + Event + + + + + PrefixedUniversalTestPortletB + org.jboss.portal.test.portlet.framework.UTP2 + + text/html + + + Event + + + Event + + + + + PortletFilterCounter + org.jboss.portal.test.portlet.jsr286.tck.portletfilter= .PortletFilterCounter + RENDER_PHASE + + + + WildcardFilter + org.jboss.portal.test.portlet.jsr286.tck.portletfilter= .TraceFilter + ACTION_PHASE + EVENT_PHASE + RENDER_PHASE + RESOURCE_PHASE + + + + PartialWildcardFilter + org.jboss.portal.test.portlet.jsr286.tck.portletfilter= .TraceFilter + ACTION_PHASE + EVENT_PHASE + RENDER_PHASE + RESOURCE_PHASE + + + + WildcardFilter + * + + + + PartialWildcardFilter + Prefixed* + + + + Event + + + Added: modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletfilt= er-war/WEB-INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletfilter-= war/WEB-INF/web.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletfilter-= war/WEB-INF/web.xml 2008-02-02 23:18:06 UTC (rev 9715) @@ -0,0 +1,32 @@ + + + + + + + org.jboss.portal.unit.PortletTestSuite + + Modified: modules/portlet/trunk/test/src/test/resources/test/remote-jboss-u= nit.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xm= l 2008-02-02 18:26:59 UTC (rev 9714) +++ modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xm= l 2008-02-02 23:18:06 UTC (rev 9715) @@ -183,6 +183,10 @@ + + + + = --===============0132927525270563649==-- From portal-commits at lists.jboss.org Sat Feb 2 19:39:44 2008 Content-Type: multipart/mixed; boundary="===============2519018417028831996==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9716 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api and 10 other directories. Date: Sat, 02 Feb 2008 19:39:42 -0500 Message-ID: --===============2519018417028831996== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-02 19:39:42 -0500 (Sat, 02 Feb 2008) New Revision: 9716 Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/common/ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/common/AbstractPortletFilter.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/common/AbstractRenderFilter.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/portletfilter/ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/portletfilter/FilterConfigFilter.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/portletfilter/FilterConfigTestCase.java modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletfilter-w= ar/ modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletfilter-w= ar/WEB-INF/ modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletfilter-w= ar/WEB-INF/portlet.xml modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletfilter-w= ar/WEB-INF/web.xml Removed: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portletfilter/AbstractPortletFilter.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portletfilter/AbstractRenderFilter.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletApplicationImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/FilterConfigImpl.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portletfilter/Filter1.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portletfilter/PortletFilterCounter.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portletfilter/TraceFilter.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portletfilter/WildcardTestCase.java modules/portlet/trunk/test/src/test/build.xml modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml Log: - test case for filter config Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletApplicationImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletApplicationImpl.java 2008-02-02 23:18:06 UTC (rev 9715) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletApplicationImpl.java 2008-02-03 00:39:42 UTC (rev 9716) @@ -213,7 +213,7 @@ context.getClassLoader(), className, "filter", - filterInfo.getName()); + filterInfo); = // lifeCycle.create(); @@ -352,24 +352,24 @@ { = /** . */ - private final String filterName; + private final ContainerFilterInfo info; = private FilterLifecycle( Class expectedClass, ClassLoader classLoader, String className, String type, - String filterName) + ContainerFilterInfo info) { super(log, expectedClass, classLoader, className, type); = // - this.filterName =3D filterName; + this.info =3D info; } = public void start(PortletFilter instance) throws Exception { - FilterConfigImpl config =3D new FilterConfigImpl(filterName, port= letContext); + FilterConfigImpl config =3D new FilterConfigImpl(info, portletCon= text); = // instance.init(config); Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/FilterConfigImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/FilterConfigImpl.java 2008-02-02 23:18:06 UTC (rev 9715) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/FilterConfigImpl.java 2008-02-03 00:39:42 UTC (rev 9716) @@ -23,10 +23,12 @@ package org.jboss.portal.portlet.impl.jsr168.api; = import org.jboss.portal.common.NotYetImplemented; +import org.jboss.portal.portlet.impl.info.ContainerFilterInfo; = import javax.portlet.filter.FilterConfig; import javax.portlet.PortletContext; import java.util.Enumeration; +import java.util.Collections; = /** * @author Julien Viet @@ -36,20 +38,20 @@ { = /** . */ - private final String name; + private final ContainerFilterInfo filterInfo; = /** . */ private final PortletContext context; = - public FilterConfigImpl(String name, PortletContext context) + public FilterConfigImpl(ContainerFilterInfo filterInfo, PortletContext = context) { - this.name =3D name; + this.filterInfo =3D filterInfo; this.context =3D context; } = public String getFilterName() { - return name; + return filterInfo.getName(); } = public PortletContext getPortletContext() @@ -57,13 +59,20 @@ return context; } = - public String getInitParameter(String s) + public String getInitParameter(String name) { - throw new NotYetImplemented(); + if (name !=3D null) + { + return filterInfo.getParameters().get(name); + } + else + { + return null; + } } = public Enumeration getInitParameterNames() { - throw new NotYetImplemented(); + return Collections.enumeration(filterInfo.getParameters().keySet()); } } Copied: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/p= ortlet/jsr286/common/AbstractPortletFilter.java (from rev 9715, modules/por= tlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/p= ortletfilter/AbstractPortletFilter.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/common/AbstractPortletFilter.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/common/AbstractPortletFilter.java 2008-02-03 00:39:42 UTC (rev 97= 16) @@ -0,0 +1,64 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.common; + +import javax.portlet.filter.FilterConfig; +import javax.portlet.PortletException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public abstract class AbstractPortletFilter +{ + + /** . */ + private FilterConfig config; + + public void init(FilterConfig config) throws PortletException + { + this.config =3D config; + } + + public void destroy() + { + this.config =3D null; + } + + protected FilterConfig getConfig() + { + return config; + } + + protected String getName() + { + if (config !=3D null) + { + return config.getFilterName(); + } + else + { + return null; + } + } +} Copied: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/p= ortlet/jsr286/common/AbstractRenderFilter.java (from rev 9715, modules/port= let/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/po= rtletfilter/AbstractRenderFilter.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/common/AbstractRenderFilter.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/common/AbstractRenderFilter.java 2008-02-03 00:39:42 UTC (rev 971= 6) @@ -0,0 +1,42 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.common; + +import javax.portlet.filter.RenderFilter; +import javax.portlet.filter.FilterChain; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class AbstractRenderFilter extends AbstractPortletFilter implements= RenderFilter +{ + public void doFilter(RenderRequest req, RenderResponse resp, FilterChai= n chain) throws IOException, PortletException + { + chain.doFilter(req, resp); + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/ext/portletfilter/FilterConfigFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/portletfilter/FilterConfigFilter.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/portletfilter/FilterConfigFilter.java 2008-02-03 00:39:42 UTC= (rev 9716) @@ -0,0 +1,71 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.ext.portletfilter; + +import org.jboss.portal.test.portlet.jsr286.common.AbstractRenderFilter; + +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.filter.FilterChain; +import java.io.IOException; +import java.util.Map; +import java.util.HashMap; +import java.util.Enumeration; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class FilterConfigFilter extends AbstractRenderFilter +{ + + /** . */ + public static String name; + + /** . */ + public static Map parameters; + + public void init(javax.portlet.filter.FilterConfig config) throws Portl= etException + { + super.init(config); + + // + HashMap tmp =3D new HashMap(); + for (Enumeration e =3D config.getInitParameterNames();e.hasMoreEleme= nts();) + { + String name =3D (String)e.nextElement(); + String value =3D config.getInitParameter(name); + tmp.put(name, value); + } + + // + name =3D config.getFilterName(); + parameters =3D tmp; + } + + public void doFilter(RenderRequest req, RenderResponse resp, FilterChai= n chain) throws IOException, PortletException + { + chain.doFilter(req, resp); + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/ext/portletfilter/FilterConfigTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/portletfilter/FilterConfigTestCase.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/portletfilter/FilterConfigTestCase.java 2008-02-03 00:39:42 U= TC (rev 9716) @@ -0,0 +1,62 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.ext.portletfilter; + +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.portal.common.util.MapBuilder; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import static org.jboss.unit.api.Assert.*; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import java.io.IOException; + +/** + * Test that the init parameters of a filter are correct. + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)TestCase() +public class FilterConfigTestCase +{ + public FilterConfigTestCase(PortletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + assertEquals("FilterConfigFilter", FilterConfigFilter.name); + assertEquals(MapBuilder.hashMap("foo", "foo_value").put("bar",= "bar_value").get(), FilterConfigFilter.parameters); + return new EndTestResponse(); + } + }); + } +} Deleted: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/= portlet/jsr286/tck/portletfilter/AbstractPortletFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/AbstractPortletFilter.java 2008-02-02 23:18:06 = UTC (rev 9715) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/AbstractPortletFilter.java 2008-02-03 00:39:42 = UTC (rev 9716) @@ -1,64 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.jsr286.tck.portletfilter; - -import javax.portlet.filter.FilterConfig; -import javax.portlet.PortletException; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public abstract class AbstractPortletFilter -{ - - /** . */ - private FilterConfig config; - - public void init(FilterConfig config) throws PortletException - { - this.config =3D config; - } - - public void destroy() - { - this.config =3D null; - } - - protected FilterConfig getConfig() - { - return config; - } - - protected String getName() - { - if (config !=3D null) - { - return config.getFilterName(); - } - else - { - return null; - } - } -} Deleted: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/= portlet/jsr286/tck/portletfilter/AbstractRenderFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/AbstractRenderFilter.java 2008-02-02 23:18:06 U= TC (rev 9715) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/AbstractRenderFilter.java 2008-02-03 00:39:42 U= TC (rev 9716) @@ -1,42 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.jsr286.tck.portletfilter; - -import javax.portlet.filter.RenderFilter; -import javax.portlet.filter.FilterChain; -import javax.portlet.RenderRequest; -import javax.portlet.RenderResponse; -import javax.portlet.PortletException; -import java.io.IOException; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class AbstractRenderFilter extends AbstractPortletFilter implements= RenderFilter -{ - public void doFilter(RenderRequest req, RenderResponse resp, FilterChai= n chain) throws IOException, PortletException - { - chain.doFilter(req, resp); - } -} Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/portletfilter/Filter1.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/Filter1.java 2008-02-02 23:18:06 UTC (rev 9715) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/Filter1.java 2008-02-03 00:39:42 UTC (rev 9716) @@ -22,6 +22,8 @@ *************************************************************************= *****/ package org.jboss.portal.test.portlet.jsr286.tck.portletfilter; = +import org.jboss.portal.test.portlet.jsr286.common.AbstractRenderFilter; + /** * @author Julien Viet * @version $Revision: 630 $ Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/portletfilter/PortletFilterCounter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/PortletFilterCounter.java 2008-02-02 23:18:06 U= TC (rev 9715) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/PortletFilterCounter.java 2008-02-03 00:39:42 U= TC (rev 9716) @@ -22,6 +22,8 @@ *************************************************************************= *****/ package org.jboss.portal.test.portlet.jsr286.tck.portletfilter; = +import org.jboss.portal.test.portlet.jsr286.common.AbstractRenderFilter; + /** * @author Julien Viet * @version $Revision: 630 $ Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/portletfilter/TraceFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/TraceFilter.java 2008-02-02 23:18:06 UTC (rev 9= 715) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/TraceFilter.java 2008-02-03 00:39:42 UTC (rev 9= 716) @@ -22,6 +22,8 @@ *************************************************************************= *****/ package org.jboss.portal.test.portlet.jsr286.tck.portletfilter; = +import org.jboss.portal.test.portlet.jsr286.common.AbstractPortletFilter; + import javax.portlet.filter.ActionFilter; import javax.portlet.filter.EventFilter; import javax.portlet.filter.RenderFilter; Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/portletfilter/WildcardTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/WildcardTestCase.java 2008-02-02 23:18:06 UTC (= rev 9715) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/WildcardTestCase.java 2008-02-03 00:39:42 UTC (= rev 9716) @@ -53,7 +53,7 @@ * @author Julien Viet * @version $Revision: 630 $ */ -(a)TestCase({Assertion.JSR286_298}) +(a)TestCase({Assertion.JSR286_298,Assertion.JSR286_300}) public class WildcardTestCase { public WildcardTestCase(PortletTestCase seq) Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-02 23:18:06 UTC (= rev 9715) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-03 00:39:42 UTC (= rev 9716) @@ -263,6 +263,12 @@ includes=3D"org/jboss/portal/test/portlet/@{testsuiteversio= n}/@{testsuitetype}/common/**"/> + + + = Added: modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletfilt= er-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletfilter-= war/WEB-INF/portlet.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletfilter-= war/WEB-INF/portlet.xml 2008-02-03 00:39:42 UTC (rev 9716) @@ -0,0 +1,52 @@ + + + + + + + UniversalTestPortletA + org.jboss.portal.test.portlet.framework.UTP1 + + text/html + + + + + FilterConfigFilter + org.jboss.portal.test.portlet.jsr286.ext.portletfilter= .FilterConfigFilter + RENDER_PHASE + + foo + foo_value + + + bar + bar_value + + + + Added: modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletfilt= er-war/WEB-INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletfilter-= war/WEB-INF/web.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletfilter-= war/WEB-INF/web.xml 2008-02-03 00:39:42 UTC (rev 9716) @@ -0,0 +1,32 @@ + + + + + + + org.jboss.portal.unit.PortletTestSuite + + Modified: modules/portlet/trunk/test/src/test/resources/test/remote-jboss-u= nit.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xm= l 2008-02-02 23:18:06 UTC (rev 9715) +++ modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xm= l 2008-02-03 00:39:42 UTC (rev 9716) @@ -207,6 +207,10 @@ + + + + = + + + + --> + + + --> + + + --> + + = - + + + + --> + + --===============8709692480020919429==-- From portal-commits at lists.jboss.org Sat Feb 2 20:56:50 2008 Content-Type: multipart/mixed; boundary="===============7342708105575685329==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9718 - modules/portlet/trunk/test/src/test/resources/test. Date: Sat, 02 Feb 2008 20:56:50 -0500 Message-ID: --===============7342708105575685329== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-02 20:56:50 -0500 (Sat, 02 Feb 2008) New Revision: 9718 Modified: modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml Log: - test case for filter config Modified: modules/portlet/trunk/test/src/test/resources/test/remote-jboss-u= nit.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xm= l 2008-02-03 01:53:19 UTC (rev 9717) +++ modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xm= l 2008-02-03 01:56:50 UTC (rev 9718) @@ -4,10 +4,7 @@ xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=3D"urn:jboss:jboss-unit:1.0 jboss-unit_1_0.xsd"> = - - - @@ -53,9 +50,7 @@ = - --> - - @@ -109,9 +104,7 @@ = - --> - - @@ -153,9 +146,7 @@ = - --> - - @@ -192,24 +183,18 @@ ---> = - - - = - --> - - @@ -222,7 +207,6 @@ ---> --===============7342708105575685329==-- From portal-commits at lists.jboss.org Sat Feb 2 21:13:02 2008 Content-Type: multipart/mixed; boundary="===============7627825404771626757==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9719 - in modules/portlet/trunk: test/src/test/resources/jsr286/tck/portletfilter-war/WEB-INF and 1 other directory. Date: Sat, 02 Feb 2008 21:13:01 -0500 Message-ID: --===============7627825404771626757== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-02 21:13:01 -0500 (Sat, 02 Feb 2008) New Revision: 9719 Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter1.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter2.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portletfilter/PropagateDoFilterArgsTestCase.java modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletfilter-w= ar/WEB-INF/portlet.xml Log: extend filter test case to the 4 life cycles Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter1.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter1.java 2008-02-03 01= :56:50 UTC (rev 9718) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter1.java 2008-02-03 02= :13:01 UTC (rev 9719) @@ -25,10 +25,22 @@ import org.jboss.portal.test.portlet.jsr286.common.AbstractPortletFilter; import org.jboss.portal.test.portlet.jsr286.common.CustomRenderRequest; import org.jboss.portal.test.portlet.jsr286.common.CustomRenderResponse; +import org.jboss.portal.test.portlet.jsr286.common.CustomEventRequest; +import org.jboss.portal.test.portlet.jsr286.common.CustomEventResponse; +import org.jboss.portal.test.portlet.jsr286.common.CustomActionRequest; +import org.jboss.portal.test.portlet.jsr286.common.CustomActionResponse; +import org.jboss.portal.test.portlet.jsr286.common.CustomResourceRequest; +import org.jboss.portal.test.portlet.jsr286.common.CustomResourceResponse; = import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import javax.portlet.PortletException; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; import javax.portlet.filter.FilterChain; import javax.portlet.filter.RenderFilter; import java.io.IOException; @@ -41,11 +53,29 @@ { = /** . */ + public static CustomActionRequest publishedActionRequest; + + /** . */ + public static CustomActionResponse publishedActionResponse; + + /** . */ + public static CustomEventRequest publishedEventRequest; + + /** . */ + public static CustomEventResponse publishedEventResponse; + + /** . */ public static CustomRenderRequest publishedRenderRequest; = /** . */ public static CustomRenderResponse publishedRenderResponse; = + /** . */ + public static CustomResourceRequest publishedResourceRequest; + + /** . */ + public static CustomResourceResponse publishedResourceResponse; + public void doFilter(RenderRequest req, RenderResponse resp, FilterChai= n chain) throws IOException, PortletException { try @@ -58,4 +88,43 @@ publishedRenderResponse =3D null; } } + + public void doFilter(ActionRequest req, ActionResponse resp, FilterChai= n chain) throws IOException, PortletException + { + try + { + chain.doFilter(publishedActionRequest =3D new CustomActionRequest= (req), publishedActionResponse =3D new CustomActionResponse(resp)); + } + finally + { + publishedActionRequest =3D null; + publishedActionResponse =3D null; + } + } + + public void doFilter(EventRequest req, EventResponse resp, FilterChain = chain) throws IOException, PortletException + { + try + { + chain.doFilter(publishedEventRequest =3D new CustomEventRequest(r= eq), publishedEventResponse =3D new CustomEventResponse(resp)); + } + finally + { + publishedEventRequest =3D null; + publishedEventResponse =3D null; + } + } + + public void doFilter(ResourceRequest req, ResourceResponse resp, Filter= Chain chain) throws IOException, PortletException + { + try + { + chain.doFilter(publishedResourceRequest =3D new CustomResourceReq= uest(req), publishedResourceResponse =3D new CustomResourceResponse(resp)); + } + finally + { + publishedResourceRequest =3D null; + publishedResourceResponse =3D null; + } + } } Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter2.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter2.java 2008-02-03 01= :56:50 UTC (rev 9718) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter2.java 2008-02-03 02= :13:01 UTC (rev 9719) @@ -25,11 +25,23 @@ import org.jboss.portal.test.portlet.jsr286.common.AbstractPortletFilter; import org.jboss.portal.test.portlet.jsr286.common.CustomRenderRequest; import org.jboss.portal.test.portlet.jsr286.common.CustomRenderResponse; +import org.jboss.portal.test.portlet.jsr286.common.CustomActionRequest; +import org.jboss.portal.test.portlet.jsr286.common.CustomActionResponse; +import org.jboss.portal.test.portlet.jsr286.common.CustomEventRequest; +import org.jboss.portal.test.portlet.jsr286.common.CustomEventResponse; +import org.jboss.portal.test.portlet.jsr286.common.CustomResourceRequest; +import org.jboss.portal.test.portlet.jsr286.common.CustomResourceResponse; import static org.jboss.unit.api.Assert.*; = import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import javax.portlet.PortletException; +import javax.portlet.ResourceResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ActionResponse; +import javax.portlet.EventResponse; +import javax.portlet.ActionRequest; +import javax.portlet.EventRequest; import javax.portlet.filter.FilterChain; import javax.portlet.filter.RenderFilter; import java.io.IOException; @@ -42,17 +54,53 @@ { = /** . */ + public static ActionRequest consumedActionRequest; + + /** . */ + public static ActionResponse consumedActionResponse; + + /** . */ + public static EventRequest consumedEventRequest; + + /** . */ + public static EventResponse consumedEventResponse; + + /** . */ public static RenderRequest consumedRenderRequest; = /** . */ public static RenderResponse consumedRenderResponse; = /** . */ + public static ResourceRequest consumedResourceRequest; + + /** . */ + public static ResourceResponse consumedResourceResponse; + + /** . */ + public static CustomActionRequest publishedActionRequest; + + /** . */ + public static CustomActionResponse publishedActionResponse; + + /** . */ + public static CustomEventRequest publishedEventRequest; + + /** . */ + public static CustomEventResponse publishedEventResponse; + + /** . */ public static CustomRenderRequest publishedRenderRequest; = /** . */ public static CustomRenderResponse publishedRenderResponse; = + /** . */ + public static CustomResourceRequest publishedResourceRequest; + + /** . */ + public static CustomResourceResponse publishedResourceResponse; + public void doFilter(RenderRequest req, RenderResponse resp, FilterChai= n chain) throws IOException, PortletException { consumedRenderRequest =3D req; @@ -71,4 +119,61 @@ publishedRenderResponse =3D null; } } + + public void doFilter(ActionRequest req, ActionResponse resp, FilterChai= n chain) throws IOException, PortletException + { + consumedActionRequest =3D req; + consumedActionResponse =3D resp; + + // + try + { + chain.doFilter(publishedActionRequest =3D new CustomActionRequest= (req), publishedActionResponse =3D new CustomActionResponse(resp)); + } + finally + { + consumedActionRequest =3D null; + consumedActionResponse =3D null; + publishedActionRequest =3D null; + publishedActionResponse =3D null; + } + } + + public void doFilter(EventRequest req, EventResponse resp, FilterChain = chain) throws IOException, PortletException + { + consumedEventRequest =3D req; + consumedEventResponse =3D resp; + + // + try + { + chain.doFilter(publishedEventRequest =3D new CustomEventRequest(r= eq), publishedEventResponse =3D new CustomEventResponse(resp)); + } + finally + { + consumedEventRequest =3D null; + consumedEventResponse =3D null; + publishedEventRequest =3D null; + publishedEventResponse =3D null; + } + } + + public void doFilter(ResourceRequest req, ResourceResponse resp, Filter= Chain chain) throws IOException, PortletException + { + consumedResourceRequest =3D req; + consumedResourceResponse =3D resp; + + // + try + { + chain.doFilter(publishedResourceRequest =3D new CustomResourceReq= uest(req), publishedResourceResponse =3D new CustomResourceResponse(resp)); + } + finally + { + consumedResourceRequest =3D null; + consumedResourceResponse =3D null; + publishedResourceRequest =3D null; + publishedResourceResponse =3D null; + } + } } \ No newline at end of file Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/portletfilter/PropagateDoFilterArgsTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/PropagateDoFilterArgsTestCase.java 2008-02-03 0= 1:56:50 UTC (rev 9718) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/PropagateDoFilterArgsTestCase.java 2008-02-03 0= 2:13:01 UTC (rev 9719) @@ -27,15 +27,25 @@ import org.jboss.portal.unit.Assertion; import org.jboss.portal.unit.annotations.TestCase; import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.unit.actions.PortletActionTestAction; +import org.jboss.portal.unit.actions.PortletEventTestAction; +import org.jboss.portal.unit.actions.PortletResourceTestAction; import org.jboss.portal.test.portlet.framework.UTP3; import org.jboss.unit.driver.DriverResponse; import org.jboss.unit.driver.response.EndTestResponse; import static org.jboss.unit.api.Assert.*; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; = import javax.portlet.Portlet; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import javax.portlet.PortletException; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; import java.io.IOException; = /** @@ -51,12 +61,55 @@ { protected DriverResponse run(Portlet portlet, RenderRequest req, = RenderResponse resp, PortletTestContext context) throws PortletException, I= OException { + return new InvokeGetResponse(resp.createActionURL().toString()= ); + } + }); + seq.bindAction(1, UTP3.ACTION_JOIN_POINT, new PortletActionTestActio= n() + { + protected void run(Portlet portlet, ActionRequest req, ActionResp= onse resp, PortletTestContext context) throws PortletException, IOException + { + assertSame(PropagateDoFilterArgsFilter1.publishedActionRequest= , PropagateDoFilterArgsFilter2.consumedActionRequest); + assertSame(PropagateDoFilterArgsFilter1.publishedActionRespons= e, PropagateDoFilterArgsFilter2.consumedActionResponse); + assertSame(PropagateDoFilterArgsFilter2.publishedActionRequest= , req); + assertSame(PropagateDoFilterArgsFilter2.publishedActionRespons= e, resp); + + // + resp.setEvent("Event", null); + } + }); + seq.bindAction(1, UTP3.EVENT_JOIN_POINT, new PortletEventTestAction() + { + protected void run(Portlet portlet, EventRequest req, EventRespon= se resp, PortletTestContext context) throws PortletException, IOException + { + assertSame(PropagateDoFilterArgsFilter1.publishedEventRequest,= PropagateDoFilterArgsFilter2.consumedEventRequest); + assertSame(PropagateDoFilterArgsFilter1.publishedEventResponse= , PropagateDoFilterArgsFilter2.consumedEventResponse); + assertSame(PropagateDoFilterArgsFilter2.publishedEventRequest,= req); + assertSame(PropagateDoFilterArgsFilter2.publishedEventResponse= , resp); + } + }); + seq.bindAction(1, UTP3.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest req, = RenderResponse resp, PortletTestContext context) throws PortletException, I= OException + { assertSame(PropagateDoFilterArgsFilter1.publishedRenderRequest= , PropagateDoFilterArgsFilter2.consumedRenderRequest); assertSame(PropagateDoFilterArgsFilter1.publishedRenderRespons= e, PropagateDoFilterArgsFilter2.consumedRenderResponse); assertSame(PropagateDoFilterArgsFilter2.publishedRenderRequest= , req); assertSame(PropagateDoFilterArgsFilter2.publishedRenderRespons= e, resp); = // + return new InvokeGetResponse(resp.createResourceURL().toString= ()); + } + }); + seq.bindAction(2, UTP3.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + { + protected DriverResponse run(Portlet portlet, ResourceRequest req= , ResourceResponse resp, PortletTestContext context) throws PortletExceptio= n, IOException + { + assertSame(PropagateDoFilterArgsFilter1.publishedResourceReque= st, PropagateDoFilterArgsFilter2.consumedResourceRequest); + assertSame(PropagateDoFilterArgsFilter1.publishedResourceRespo= nse, PropagateDoFilterArgsFilter2.consumedResourceResponse); + assertSame(PropagateDoFilterArgsFilter2.publishedResourceReque= st, req); + assertSame(PropagateDoFilterArgsFilter2.publishedResourceRespo= nse, resp); + + // return new EndTestResponse(); } }); Modified: modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletf= ilter-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletfilter-= war/WEB-INF/portlet.xml 2008-02-03 01:56:50 UTC (rev 9718) +++ modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletfilter-= war/WEB-INF/portlet.xml 2008-02-03 02:13:01 UTC (rev 9719) @@ -96,13 +96,19 @@ PropagateDoFilterArgsFilter1 org.jboss.portal.test.portlet.jsr286.tck.portletfilter= .PropagateDoFilterArgsFilter1 + ACTION_PHASE + EVENT_PHASE RENDER_PHASE + RESOURCE_PHASE = PropagateDoFilterArgsFilter2 org.jboss.portal.test.portlet.jsr286.tck.portletfilter= .PropagateDoFilterArgsFilter2 + ACTION_PHASE + EVENT_PHASE RENDER_PHASE + RESOURCE_PHASE = --===============7627825404771626757==-- From portal-commits at lists.jboss.org Sun Feb 3 06:59:54 2008 Content-Type: multipart/mixed; boundary="===============6143453305843125247==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9720 - in modules/portlet/trunk/portlet/src: main/java/org/jboss/portal/portlet/impl/jsr168/api and 1 other directories. Date: Sun, 03 Feb 2008 06:59:53 -0500 Message-ID: --===============6143453305843125247== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-03 06:59:52 -0500 (Sun, 03 Feb 2008) New Revision: 9720 Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/DispatchedHttpSession.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/DispatchtedRequestDispatcher.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr168/ext/session/HTTPSessionInvalidationInvalidesPortletSessionTestCase= .java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/DispatchedHttpServletRequest.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/DispatchedHttpServletResponse.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletUtils.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletRequestImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletSessionImpl.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr168/ext/session/ObtainNonNullSessionUsingCreateEqualsFalseTestCase.java Log: - rewrote portlet session obtention - rewrote http portlet session wrapper obtention - added test case for portlet session - added http request/response unwrapping for dispatch Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/DispatchedHttpServletRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/DispatchedHttpServletRequest.java 2008-02-03 02:13:01 UTC (rev 97= 19) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/DispatchedHttpServletRequest.java 2008-02-03 11:59:52 UTC (rev 97= 20) @@ -40,6 +40,7 @@ import javax.servlet.http.HttpSession; import javax.servlet.http.HttpServletRequestWrapper; import javax.portlet.PortletSession; +import javax.portlet.PortletRequest; import java.security.Principal; import java.util.Enumeration; import java.util.Locale; @@ -107,7 +108,7 @@ final DispatchType dispatchType; = /** . */ - private final PortletRequestImpl preq; + private final PortletRequest preq; = /** . */ private final HttpServletRequest dreq; @@ -127,6 +128,9 @@ /** . */ private final ServletContext servletContext; = + /** . */ + private DispatchedHttpSession[] session; + public DispatchedHttpServletRequest( Dispatch dispatch, PortletRequestImpl preq, @@ -274,12 +278,12 @@ } = // - return preq.getAttributes().getAttribute(s, (HttpServletRequest)getR= equest()); + return ((PortletRequestImpl)preq).getAttributes().getAttribute(s, (H= ttpServletRequest)getRequest()); } = public final Enumeration getAttributeNames() { - Set names =3D Tools.toSet(preq.getAttributes().getAttributeN= ames(null)); + Set names =3D Tools.toSet(((PortletRequestImpl)preq).getAttr= ibutes().getAttributeNames(null)); = // Add super stuff that is not reserved for (Enumeration e =3D super.getAttributeNames();e.hasMoreElements()= ;) @@ -308,7 +312,7 @@ } = // - preq.getAttributes().setAttribute(s, o); + ((PortletRequestImpl)preq).getAttributes().setAttribute(s, o); } = public final void removeAttribute(String s) @@ -461,7 +465,7 @@ = public final RequestDispatcher getRequestDispatcher(String s) { - return new RequestDispatcherImpl(dreq.getRequestDispatcher(s), s); + return new DispatchtedRequestDispatcher(dreq.getRequestDispatcher(s)= , s); } = public final boolean isUserInRole(String s) @@ -471,12 +475,12 @@ = public final HttpSession getSession(boolean b) { - return preq.getPortletSession(b).getHttpSession(PortletSession.APPLI= CATION_SCOPE); + return getSession(b, PortletSession.APPLICATION_SCOPE); } = public final HttpSession getSession() { - return preq.getPortletSession().getHttpSession(PortletSession.APPLIC= ATION_SCOPE); + return getSession(true); } = public final boolean isRequestedSessionIdFromCookie() @@ -803,4 +807,52 @@ return "GET"; } } + + /** + * Returns the an implementation of javax.servlet.http.HttpSessio= n that wraps this + * portlet session and use the specified scope for manipulating attribu= tes. This session is used + * during the request dispatch to a servlet. + * + * @param scope the scope + * @return the wrapped session + */ + private HttpSession getSession(boolean create, int scope) + { + if (session =3D=3D null) + { + session =3D new DispatchedHttpSession[2]; + } + + // Dereference an existing session if necessary + if (session[scope] !=3D null && !session[scope].isValid()) + { + session[scope] =3D null; + } + + // If we have a session here we are sure it is valid and ok to retur= n it + if (session[scope] !=3D null) + { + // So we do nothing + } + else if (create) + { + // For sure we need a session we will obtain a valid one + PortletSession portletSession =3D preq.getPortletSession(); + session[scope] =3D new DispatchedHttpSession(this, portletSession= , scope); + } + else + { + // Here we can try an existing session but it may return null + PortletSession portletSession =3D preq.getPortletSession(false); + + // + if (portletSession !=3D null) + { + session[scope] =3D new DispatchedHttpSession(this, portletSess= ion, scope); + } + } + + // + return session[scope]; + } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/DispatchedHttpServletResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/DispatchedHttpServletResponse.java 2008-02-03 02:13:01 UTC (rev 9= 719) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/DispatchedHttpServletResponse.java 2008-02-03 11:59:52 UTC (rev 9= 720) @@ -24,7 +24,6 @@ = import org.jboss.portal.portlet.impl.jsr168.api.MimeResponseImpl; import org.jboss.portal.portlet.impl.jsr168.api.StateAwareResponseImpl; -import org.jboss.portal.common.NotYetImplemented; = import javax.portlet.PortletResponse; import javax.servlet.ServletOutputStream; Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/jsr168/DispatchedHttpSession.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/DispatchedHttpSession.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/DispatchedHttpSession.java 2008-02-03 11:59:52 UTC (rev 9720) @@ -0,0 +1,149 @@ +/*************************************************************************= ***** + * 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.portlet.impl.jsr168; + +import javax.servlet.http.HttpSession; +import javax.servlet.http.HttpSessionContext; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.ServletContext; +import javax.portlet.PortletSession; +import java.util.Enumeration; +import java.util.ArrayList; +import java.util.Collections; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class DispatchedHttpSession implements HttpSession +{ + + /** . */ + private final DispatchedHttpServletRequest dispatchedRequest; + + /** . */ + private final PortletSession delegate; + + /** . */ + private final int scope; + + public DispatchedHttpSession(DispatchedHttpServletRequest dispatchedReq= uest, PortletSession delegate, int scope) + { + this.dispatchedRequest =3D dispatchedRequest; + this.delegate =3D delegate; + this.scope =3D scope; + } + + public long getCreationTime() + { + return delegate.getCreationTime(); + } + + public String getId() + { + return delegate.getId(); + } + + public long getLastAccessedTime() + { + return delegate.getLastAccessedTime(); + } + + public ServletContext getServletContext() + { + return ((HttpServletRequest)dispatchedRequest.getRequest()).getSessi= on().getServletContext(); + } + + public void setMaxInactiveInterval(int i) + { + delegate.setMaxInactiveInterval(i); + } + + public int getMaxInactiveInterval() + { + return delegate.getMaxInactiveInterval(); + } + + public HttpSessionContext getSessionContext() + { + throw new UnsupportedOperationException(); + } + + public Object getAttribute(String s) + { + return delegate.getAttribute(s, scope); + } + + public Object getValue(String s) + { + return getAttribute(s); + } + + public Enumeration getAttributeNames() + { + return delegate.getAttributeNames(scope); + } + + public String[] getValueNames() + { + ArrayList names =3D Collections.list(delegate.getAttributeNa= mes()); + + // + return names.toArray(new String[names.size()]); + } + + public void setAttribute(String s, Object o) + { + delegate.setAttribute(s, o, scope); + } + + public void putValue(String s, Object o) + { + setAttribute(s, o); + } + + public void removeAttribute(String s) + { + delegate.removeAttribute(s, scope); + } + + public void removeValue(String s) + { + removeAttribute(s); + } + + public void invalidate() + { + delegate.invalidate(); + } + + public boolean isNew() + { + return delegate.isNew(); + } + + boolean isValid() + { + return true; + } +} Copied: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portle= t/impl/jsr168/DispatchtedRequestDispatcher.java (from rev 9707, modules/por= tlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/Reque= stDispatcherImpl.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/DispatchtedRequestDispatcher.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/DispatchtedRequestDispatcher.java 2008-02-03 11:59:52 UTC (rev 97= 20) @@ -0,0 +1,125 @@ +/*************************************************************************= ***** + * 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.portlet.impl.jsr168; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.ServletException; +import javax.servlet.ServletRequestWrapper; +import javax.servlet.ServletResponseWrapper; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class DispatchtedRequestDispatcher implements RequestDispatcher +{ + + /** . */ + private final RequestDispatcher realDispatcher; + + /** . */ + private final String path; + + public DispatchtedRequestDispatcher(RequestDispatcher realDispatcher, S= tring path) + { + this.realDispatcher =3D realDispatcher; + this.path =3D path; + } + + public void include(ServletRequest req, ServletResponse resp) throws Se= rvletException, IOException + { + DispatchedHttpServletRequest dreq =3D unwrap(req); + unwrap(resp); + + // + dreq.pushDispatch(new Dispatch(DispatchType.INCLUDE, path)); + try + { + realDispatcher.include(req, resp); + } + finally + { + dreq.popDispatch(); + } + } + + public void forward(ServletRequest req, ServletResponse resp) throws Se= rvletException, IOException + { + DispatchedHttpServletRequest dreq =3D unwrap(req); + unwrap(resp); + + // + dreq.pushDispatch(new Dispatch(DispatchType.FORWARD, path)); + try + { + realDispatcher.forward(req, resp); + } + finally + { + dreq.popDispatch(); + } + } + + private static DispatchedHttpServletRequest unwrap(ServletRequest wrapp= ed) + { + while (true) + { + if (wrapped instanceof DispatchedHttpServletRequest) + { + return (DispatchedHttpServletRequest)wrapped; + } + else if (wrapped instanceof ServletRequestWrapper) + { + ServletRequestWrapper wrapper =3D (ServletRequestWrapper)wrapp= ed; + wrapped =3D wrapper.getRequest(); + } + else + { + throw new IllegalArgumentException(); + } + } + } + + private static DispatchedHttpServletResponse unwrap(ServletResponse wra= pped) + { + while (true) + { + if (wrapped instanceof DispatchedHttpServletResponse) + { + return (DispatchedHttpServletResponse)wrapped; + } + else if (wrapped instanceof ServletResponseWrapper) + { + ServletResponseWrapper wrapper =3D (ServletResponseWrapper)wra= pped; + wrapped =3D wrapper.getResponse(); + } + else + { + throw new IllegalArgumentException(); + } + } + } +} Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletUtils.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletUtils.java 2008-02-03 02:13:01 UTC (rev 9719) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletUtils.java 2008-02-03 11:59:52 UTC (rev 9720) @@ -22,8 +22,15 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.impl.jsr168; = +import org.jboss.portal.portlet.impl.jsr168.api.PortletRequestImpl; + import javax.portlet.PortletMode; import javax.portlet.WindowState; +import javax.portlet.PortletRequest; +import javax.portlet.RenderRequest; +import javax.portlet.PortletResponse; +import javax.portlet.filter.PortletRequestWrapper; +import javax.portlet.filter.PortletResponseWrapper; = /** * @author Julien Viet @@ -116,4 +123,44 @@ tmp.append(SUFFIX); return tmp.toString(); } + + public static U unwrap(PortletRequest wrappe= d, Class unwrapped) + { + while (true) + { + if (wrapped instanceof PortletRequestWrapper) + { + PortletRequestWrapper wrapper =3D (PortletRequestWrapper)wrapp= ed; + wrapped =3D wrapper.getRequest(); + } + else if (unwrapped.isInstance(wrapped)) + { + return unwrapped.cast(wrapped); + } + else + { + throw new IllegalArgumentException(); + } + } + } + + public static U unwrap(PortletResponse wrap= ped, Class unwrapped) + { + while (true) + { + if (wrapped instanceof PortletResponseWrapper) + { + PortletResponseWrapper wrapper =3D (PortletResponseWrapper)wra= pped; + wrapped =3D wrapper.getResponse(); + } + else if (unwrapped.isInstance(wrapped)) + { + return unwrapped.cast(wrapped); + } + else + { + throw new IllegalArgumentException(); + } + } + } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/PortletRequestImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletRequestImpl.java 2008-02-03 02:13:01 UTC (rev 9719) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletRequestImpl.java 2008-02-03 11:59:52 UTC (rev 9720) @@ -378,39 +378,36 @@ = public PortletSessionImpl getPortletSession(boolean create) { - // - if (create) + // Dereference an existing session if it is not valid + if (psession !=3D null && !psession.isValid()) { - // Create the session with the dispatched request - HttpSession hsession =3D dreq.getSession(true); + psession =3D null; + } = - // Create portlet session + // If we have a session here we are sure it is valid and ok to retur= n it + if (psession !=3D null) + { + // So we do nothing + } + else if (create) + { + // For sure we need a session we will obtain a valid one + HttpSession hsession =3D dreq.getSession(); PortletApplicationImpl portletApp =3D (PortletApplicationImpl)con= tainer.getApplication(); - psession =3D new PortletSessionImpl( - hsession, - windowContext.getId(), - portletApp.getPortletContext()); + psession =3D new PortletSessionImpl(hsession, windowContext.getId= (), portletApp.getPortletContext()); } - else if (psession =3D=3D null) + else { + // Here we can try an existing session but it may return null HttpSession hsession =3D dreq.getSession(false); = // if (hsession !=3D null) { - // Create portlet session PortletApplicationImpl portletApp =3D (PortletApplicationImpl)= container.getApplication(); - psession =3D new PortletSessionImpl( - hsession, - windowContext.getId(), - portletApp.getPortletContext()); + psession =3D new PortletSessionImpl(hsession, windowContext.ge= tId(), portletApp.getPortletContext()); } } - else if (!psession.isValid()) - { - // If we don't create and the underlying http session is not vali= d we return null - psession =3D null; - } = // return psession; Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/PortletSessionImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletSessionImpl.java 2008-02-03 02:13:01 UTC (rev 9719) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletSessionImpl.java 2008-02-03 11:59:52 UTC (rev 9720) @@ -50,19 +50,11 @@ /** . */ private PortletContext context; = - /** . */ - private HttpPortletSession applicationScopedHttpSession; - - /** . */ - private HttpPortletSession portletScopedHttpSession; - public PortletSessionImpl(HttpSession session, String id, PortletContex= t context) { this.session =3D session; this.prefix =3D "javax.portlet.p." + id + "?"; this.context =3D context; - this.applicationScopedHttpSession =3D null; - this.portletScopedHttpSession =3D null; } = public Object getAttribute(String s) @@ -159,9 +151,6 @@ { // Invalidate the underlying HTTP session session.invalidate(); - - // Mark the session as invalid - // valid =3D false; } = public boolean isNew() @@ -226,35 +215,6 @@ } = /** - * Returns the an implementation of javax.servlet.http.HttpSessio= n that wraps this - * portlet session and use the specified scope for manipulating attribu= tes. This session is used - * during the request dispatch to a servlet. - * - * @param scope the scope - * @return the wrapped session - */ - public HttpSession getHttpSession(int scope) - { - switch (scope) - { - case APPLICATION_SCOPE: - if (applicationScopedHttpSession =3D=3D null) - { - applicationScopedHttpSession =3D new HttpPortletSession(thi= s, APPLICATION_SCOPE); - } - return applicationScopedHttpSession; - case PORTLET_SCOPE: - if (portletScopedHttpSession =3D=3D null) - { - portletScopedHttpSession =3D new HttpPortletSession(this, P= ORTLET_SCOPE); - } - return portletScopedHttpSession; - default: - throw new IllegalArgumentException("Unrecognzed session scope = " + scope); - } - } - - /** * Detect validity of the session based on the underlying session. * * @return true if the session is valid @@ -271,108 +231,4 @@ return false; } } - - private static class HttpPortletSession implements HttpSession - { - - /** . */ - private final PortletSessionImpl delegate; - - /** . */ - private final int scope; - - private HttpPortletSession(PortletSessionImpl delegate, int scope) - { - this.delegate =3D delegate; - this.scope =3D scope; - } - - public long getCreationTime() - { - return delegate.getCreationTime(); - } - - public String getId() - { - return delegate.getId(); - } - - public long getLastAccessedTime() - { - return delegate.getLastAccessedTime(); - } - - public ServletContext getServletContext() - { - return delegate.session.getServletContext(); - } - - public void setMaxInactiveInterval(int i) - { - delegate.setMaxInactiveInterval(i); - } - - public int getMaxInactiveInterval() - { - return delegate.getMaxInactiveInterval(); - } - - public HttpSessionContext getSessionContext() - { - throw new UnsupportedOperationException(); - } - - public Object getAttribute(String s) - { - return delegate.getAttribute(s, scope); - } - - public Object getValue(String s) - { - return getAttribute(s); - } - - public Enumeration getAttributeNames() - { - return delegate.getAttributeNames(scope); - } - - public String[] getValueNames() - { - ArrayList names =3D Collections.list(delegate.getAttribut= eNames()); - - // - return names.toArray(new String[names.size()]); - } - - public void setAttribute(String s, Object o) - { - delegate.setAttribute(s, o, scope); - } - - public void putValue(String s, Object o) - { - setAttribute(s, o); - } - - public void removeAttribute(String s) - { - delegate.removeAttribute(s, scope); - } - - public void removeValue(String s) - { - removeAttribute(s); - } - - public void invalidate() - { - delegate.invalidate(); - } - - public boolean isNew() - { - return delegate.isNew(); - } - } } Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr168/ext/session/HTTPSessionInvalidationInvalidesPortletSessionTest= Case.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/ext/session/HTTPSessionInvalidationInvalidesPortletSessionTestCas= e.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/ext/session/HTTPSessionInvalidationInvalidesPortletSessionTestCas= e.java 2008-02-03 11:59:52 UTC (rev 9720) @@ -0,0 +1,95 @@ +/*************************************************************************= ***** + * 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.portlet.jsr168.ext.session; + +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import static org.jboss.unit.api.Assert.*; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.PortletSession; +import javax.servlet.http.HttpSessionBindingListener; +import javax.servlet.http.HttpSessionBindingEvent; +import javax.servlet.http.HttpSession; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)TestCase +public class HTTPSessionInvalidationInvalidesPortletSessionTestCase +{ + + public HTTPSessionInvalidationInvalidesPortletSessionTestCase(PortletTe= stCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + PortletSession session =3D request.getPortletSession(); + + // Invalidates the real http session + SessionInvalidator invalidator =3D new SessionInvalidator(); + invalidator.invalidate(session); + + // Now it should be null + session =3D request.getPortletSession(false); + assertNull(session); + + // + return new EndTestResponse(); + } + }); + } + + private static class SessionInvalidator implements HttpSessionBindingLi= stener + { + + /** . */ + private HttpSession realSession; + + public void valueBound(HttpSessionBindingEvent event) + { + this.realSession =3D event.getSession(); + } + + public void valueUnbound(HttpSessionBindingEvent event) + { + } + + public void invalidate(PortletSession session) + { + session.setAttribute("foo", this); + realSession.invalidate(); + } + } +} \ No newline at end of file Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr168/ext/session/ObtainNonNullSessionUsingCreateEqualsFalseTestC= ase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/ext/session/ObtainNonNullSessionUsingCreateEqualsFalseTestCase.ja= va 2008-02-03 02:13:01 UTC (rev 9719) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/ext/session/ObtainNonNullSessionUsingCreateEqualsFalseTestCase.ja= va 2008-02-03 11:59:52 UTC (rev 9720) @@ -52,6 +52,10 @@ @TestCase public class ObtainNonNullSessionUsingCreateEqualsFalseTestCase { + + /** . */ + private String sessionId; + public ObtainNonNullSessionUsingCreateEqualsFalseTestCase(PortletTestCa= se seq) { seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() @@ -60,9 +64,9 @@ { PortletSession session =3D request.getPortletSession(); assertNotNull(session); + sessionId =3D session.getId(); session.setAttribute("foo_1", "bar_1"); - InvokeGetResponse igr =3D new InvokeGetResponse(response.creat= eActionURL().toString()); - return igr; + return new InvokeGetResponse(response.createActionURL().toStri= ng()); } }); seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestActio= n() @@ -71,6 +75,7 @@ { PortletSession session =3D request.getPortletSession(false); assertNotNull(session); + assertEquals(sessionId, session.getId()); assertEquals("bar_1", session.getAttribute("foo_1")); session.setAttribute("foo_2", "bar_2"); } @@ -81,6 +86,7 @@ { PortletSession session =3D request.getPortletSession(false); assertNotNull(session); + assertEquals(sessionId, session.getId()); assertEquals("bar_1", session.getAttribute("foo_1")); assertEquals("bar_2", session.getAttribute("foo_2")); return new EndTestResponse(); --===============6143453305843125247==-- From portal-commits at lists.jboss.org Sun Feb 3 11:12:31 2008 Content-Type: multipart/mixed; boundary="===============1674274234609015247==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9721 - in modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168: api and 1 other directory. Date: Sun, 03 Feb 2008 11:12:30 -0500 Message-ID: --===============1674274234609015247== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-03 11:12:29 -0500 (Sun, 03 Feb 2008) New Revision: 9721 Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/Constants.java Removed: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/APIConstants.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/RequestDispatcherImpl.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/DispatchedHttpServletRequest.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/InlineBundle.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletContainerImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletRequestAttributes.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/FilterChainImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletRequestDispatcherImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletRequestImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletResponseImpl.java Log: - improved implementation of PortletRequest delegating to the underlying Ht= tpServletRequest (it should use the most accurate request during a dispatch) Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portl= et/impl/jsr168/APIConstants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/APIConstants.java 2008-02-03 11:59:52 UTC (rev 9720) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/APIConstants.java 2008-02-03 16:12:29 UTC (rev 9721) @@ -1,51 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.impl.jsr168; - -/** - * @author Julien Viet - * @version $Revision: 5448 $ - */ -public interface APIConstants -{ - /** . */ - String JAVAX_PORTLET_TITLE =3D "javax.portlet.title"; - - /** . */ - String JAVAX_PORTLET_SHORT_TITLE =3D "javax.portlet.short-title"; - - /** . */ - String JAVAX_PORTLET_KEYWORDS =3D "javax.portlet.keywords"; - - /** . */ - String JAVAX_PORTLET_CONFIG =3D "javax.portlet.config"; - - /** . */ - String JAVAX_PORTLET_REQUEST =3D "javax.portlet.request"; - - /** . */ - String JAVAX_PORTLET_RESPONSE =3D "javax.portlet.response"; - - /** . */ - String JAVAX_PORTLET_LIFECYCLE_PHASE =3D "javax.portlet.lifecycle_phase= "; -} Copied: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portle= t/impl/jsr168/Constants.java (from rev 9707, modules/portlet/trunk/portlet/= src/main/java/org/jboss/portal/portlet/impl/jsr168/APIConstants.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/Constants.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/Constants.java 2008-02-03 16:12:29 UTC (rev 9721) @@ -0,0 +1,56 @@ +/*************************************************************************= ***** + * 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.portlet.impl.jsr168; + +/** + * @author Julien Viet + * @version $Revision: 5448 $ + */ +public class Constants +{ + + private Constants() + { + } + + /** . */ + public static final String JAVAX_PORTLET_TITLE =3D "javax.portlet.title= "; + + /** . */ + public static final String JAVAX_PORTLET_SHORT_TITLE =3D "javax.portlet= .short-title"; + + /** . */ + public static final String JAVAX_PORTLET_KEYWORDS =3D "javax.portlet.ke= ywords"; + + /** . */ + public static final String JAVAX_PORTLET_CONFIG =3D "javax.portlet.conf= ig"; + + /** . */ + public static final String JAVAX_PORTLET_REQUEST =3D "javax.portlet.req= uest"; + + /** . */ + public static final String JAVAX_PORTLET_RESPONSE =3D "javax.portlet.re= sponse"; + + /** . */ + public static final String JAVAX_PORTLET_LIFECYCLE_PHASE =3D "javax.por= tlet.lifecycle_phase"; +} Property changes on: modules/portlet/trunk/portlet/src/main/java/org/jboss/= portal/portlet/impl/jsr168/Constants.java ___________________________________________________________________ Name: svn:executable + = Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/DispatchedHttpServletRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/DispatchedHttpServletRequest.java 2008-02-03 11:59:52 UTC (rev 97= 20) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/DispatchedHttpServletRequest.java 2008-02-03 16:12:29 UTC (rev 97= 21) @@ -25,22 +25,23 @@ import org.jboss.portal.common.http.QueryStringParser; import org.jboss.portal.common.util.Tools; import org.jboss.portal.common.util.ParameterMap; -import org.jboss.portal.portlet.impl.jsr168.api.RenderRequestImpl; import org.jboss.portal.portlet.impl.jsr168.api.PortletRequestImpl; -import org.jboss.portal.portlet.impl.jsr168.api.ActionRequestImpl; -import org.jboss.portal.portlet.impl.jsr168.api.EventRequestImpl; -import org.jboss.portal.portlet.impl.jsr168.api.ResourceRequestImpl; -import org.jboss.portal.portlet.impl.jsr168.api.ClientDataRequestImpl; = import javax.servlet.RequestDispatcher; import javax.servlet.ServletInputStream; import javax.servlet.ServletContext; +import javax.servlet.ServletRequest; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpServletRequestWrapper; import javax.portlet.PortletSession; import javax.portlet.PortletRequest; +import javax.portlet.ClientDataRequest; +import javax.portlet.ActionRequest; +import javax.portlet.ResourceRequest; +import javax.portlet.EventRequest; +import javax.portlet.RenderRequest; import java.security.Principal; import java.util.Enumeration; import java.util.Locale; @@ -111,7 +112,7 @@ private final PortletRequest preq; = /** . */ - private final HttpServletRequest dreq; + private final HttpServletRequestWrapper dreq; = /** . */ private final Map parameters; @@ -133,8 +134,8 @@ = public DispatchedHttpServletRequest( Dispatch dispatch, - PortletRequestImpl preq, - HttpServletRequest dreq, + PortletRequest preq, + HttpServletRequestWrapper dreq, ServletContext servletContext) { super(dreq); @@ -265,6 +266,8 @@ if (s !=3D null) { Map containerAttributes =3D containerAttributesSt= ack.getLast(); + + // if (containerAttributes.containsKey(s)) { return containerAttributes.get(s); @@ -275,28 +278,23 @@ { return null; } + + // + return preq.getAttribute(s); } - - // - return ((PortletRequestImpl)preq).getAttributes().getAttribute(s, (H= ttpServletRequest)getRequest()); + else + { + return null; + } } = public final Enumeration getAttributeNames() { - Set names =3D Tools.toSet(((PortletRequestImpl)preq).getAttr= ibutes().getAttributeNames(null)); + Set names =3D Tools.toSet(preq.getAttributeNames()); = - // Add super stuff that is not reserved - for (Enumeration e =3D super.getAttributeNames();e.hasMoreElements()= ;) - { - String name =3D (String)e.nextElement(); + // + names.removeAll(ALL_CONTAINER_ATTRIBUTES); = - // - if (!ALL_CONTAINER_ATTRIBUTES.contains(name)) - { - names.add(name); - } - } - // names.addAll(containerAttributesStack.getLast().keySet()); = @@ -505,6 +503,20 @@ return "HTTP/1.1"; } = + // ****** + + public void setRequest(ServletRequest servletRequest) + { + // That's a trick + dreq.setRequest(servletRequest); + } + + public ServletRequest getRequest() + { + // That's a trick + return dreq.getRequest(); + } + String[] pushDispatch(Dispatch dispatch) { String path =3D dispatch.getPath(); @@ -643,6 +655,54 @@ containerAttributesStack.removeLast(); } = + /** + * Returns the an implementation of javax.servlet.http.HttpSessio= n that wraps this + * portlet session and use the specified scope for manipulating attribu= tes. This session is used + * during the request dispatch to a servlet. + * + * @param scope the scope + * @return the wrapped session + */ + private HttpSession getSession(boolean create, int scope) + { + if (session =3D=3D null) + { + session =3D new DispatchedHttpSession[2]; + } + + // Dereference an existing session if necessary + if (session[scope] !=3D null && !session[scope].isValid()) + { + session[scope] =3D null; + } + + // If we have a session here we are sure it is valid and ok to retur= n it + if (session[scope] !=3D null) + { + // So we do nothing + } + else if (create) + { + // For sure we need a session we will obtain a valid one + PortletSession portletSession =3D preq.getPortletSession(); + session[scope] =3D new DispatchedHttpSession(this, portletSession= , scope); + } + else + { + // Here we can try an existing session but it may return null + PortletSession portletSession =3D preq.getPortletSession(false); + + // + if (portletSession !=3D null) + { + session[scope] =3D new DispatchedHttpSession(this, portletSess= ion, scope); + } + } + + // + return session[scope]; + } + // Subclasses = public static abstract class ClientData extends DispatchedHttpServletRe= quest @@ -652,9 +712,9 @@ private PortletServletInputStream in; = /** . */ - private final ClientDataRequestImpl cdreq; + private final ClientDataRequest cdreq; = - public ClientData(Dispatch dispatch, ClientDataRequestImpl cdreq, Ht= tpServletRequest dreq, ServletContext servletContext) + public ClientData(Dispatch dispatch, ClientDataRequest cdreq, HttpSe= rvletRequestWrapper dreq, ServletContext servletContext) { super(dispatch, cdreq, dreq, servletContext); = @@ -707,7 +767,7 @@ /** . */ private final InputStream in; = - private PortletServletInputStream(ClientDataRequestImpl req) thro= ws IOException + private PortletServletInputStream(ClientDataRequest req) throws I= OException { in =3D req.getPortletInputStream(); } @@ -722,7 +782,7 @@ public static final class Action extends ClientData { = - public Action(Dispatch dispatch, ActionRequestImpl areq, HttpServlet= Request dreq, ServletContext servletContext) + public Action(Dispatch dispatch, ActionRequest areq, HttpServletRequ= estWrapper dreq, ServletContext servletContext) { super(dispatch, areq, dreq, servletContext); } @@ -731,7 +791,7 @@ public static final class Resource extends ClientData { = - public Resource(Dispatch dispatch, ResourceRequestImpl rreq, HttpSer= vletRequest dreq, ServletContext servletContext) + public Resource(Dispatch dispatch, ResourceRequest rreq, HttpServlet= RequestWrapper dreq, ServletContext servletContext) { super(dispatch, rreq, dreq, servletContext); } @@ -739,7 +799,7 @@ = public static abstract class Mime extends DispatchedHttpServletRequest { - public Mime(Dispatch dispatch, PortletRequestImpl preq, HttpServletR= equest dreq, ServletContext servletContext) + public Mime(Dispatch dispatch, PortletRequest preq, HttpServletReque= stWrapper dreq, ServletContext servletContext) { super(dispatch, preq, dreq, servletContext); } @@ -778,9 +838,9 @@ { = /** . */ - private final EventRequestImpl ereq; + private final EventRequest ereq; = - public Event(Dispatch dispatch, EventRequestImpl ereq, HttpServletRe= quest dreq, ServletContext servletContext) + public Event(Dispatch dispatch, EventRequest ereq, HttpServletReques= tWrapper dreq, ServletContext servletContext) { super(dispatch, ereq, dreq, servletContext); = @@ -797,7 +857,7 @@ public static final class Render extends Mime { = - public Render(Dispatch dispatch, RenderRequestImpl rreq, HttpServlet= Request dreq, ServletContext servletContext) + public Render(Dispatch dispatch, RenderRequest rreq, HttpServletRequ= estWrapper dreq, ServletContext servletContext) { super(dispatch, rreq, dreq, servletContext); } @@ -807,52 +867,4 @@ return "GET"; } } - - /** - * Returns the an implementation of javax.servlet.http.HttpSessio= n that wraps this - * portlet session and use the specified scope for manipulating attribu= tes. This session is used - * during the request dispatch to a servlet. - * - * @param scope the scope - * @return the wrapped session - */ - private HttpSession getSession(boolean create, int scope) - { - if (session =3D=3D null) - { - session =3D new DispatchedHttpSession[2]; - } - - // Dereference an existing session if necessary - if (session[scope] !=3D null && !session[scope].isValid()) - { - session[scope] =3D null; - } - - // If we have a session here we are sure it is valid and ok to retur= n it - if (session[scope] !=3D null) - { - // So we do nothing - } - else if (create) - { - // For sure we need a session we will obtain a valid one - PortletSession portletSession =3D preq.getPortletSession(); - session[scope] =3D new DispatchedHttpSession(this, portletSession= , scope); - } - else - { - // Here we can try an existing session but it may return null - PortletSession portletSession =3D preq.getPortletSession(false); - - // - if (portletSession !=3D null) - { - session[scope] =3D new DispatchedHttpSession(this, portletSess= ion, scope); - } - } - - // - return session[scope]; - } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/InlineBundle.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/InlineBundle.java 2008-02-03 11:59:52 UTC (rev 9720) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/InlineBundle.java 2008-02-03 16:12:29 UTC (rev 9721) @@ -56,21 +56,21 @@ String title =3D portletInfo.getMeta().getDefaultMetaValue(MetaInfo.= TITLE); if (title !=3D null) { - list.add(new Object[]{APIConstants.JAVAX_PORTLET_TITLE, title}); + list.add(new Object[]{Constants.JAVAX_PORTLET_TITLE, title}); } = // String shortTitle =3D portletInfo.getMeta().getDefaultMetaValue(Meta= Info.SHORT_TITLE); if (shortTitle !=3D null) { - list.add(new Object[]{APIConstants.JAVAX_PORTLET_SHORT_TITLE, sho= rtTitle}); + list.add(new Object[]{Constants.JAVAX_PORTLET_SHORT_TITLE, shortT= itle}); } = // String keywords =3D portletInfo.getMeta().getDefaultMetaValue(MetaIn= fo.KEYWORDS); if (keywords !=3D null) { - list.add(new Object[]{APIConstants.JAVAX_PORTLET_KEYWORDS, keywor= ds}); + list.add(new Object[]{Constants.JAVAX_PORTLET_KEYWORDS, keywords}= ); } = // Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletContainerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletContainerImpl.java 2008-02-03 11:59:52 UTC (rev 9720) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletContainerImpl.java 2008-02-03 16:12:29 UTC (rev 9721) @@ -40,7 +40,8 @@ import org.jboss.portal.portlet.impl.jsr168.api.ResourceRequestImpl; import org.jboss.portal.portlet.impl.jsr168.api.ResourceResponseImpl; import org.jboss.portal.portlet.impl.jsr168.api.FilterChainImpl; -import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory; +import org.jboss.portal.portlet.impl.jsr168.api.PortletRequestImpl; +import org.jboss.portal.portlet.impl.jsr168.api.PortletResponseImpl; import org.jboss.portal.portlet.impl.info.ContainerPortletInfo; import org.jboss.portal.portlet.impl.info.ContainerPreferencesInfo; import org.jboss.portal.portlet.invocation.ActionInvocation; @@ -78,6 +79,7 @@ import javax.portlet.filter.FilterChain; import javax.portlet.filter.FilterConfig; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Set; import java.util.List; @@ -417,28 +419,61 @@ = public PortletInvocationResponse dispatch(PortletInvocation invocation)= throws PortletInvokerException, InvocationException { + HttpServletRequest dreq =3D invocation.getDispatchedRequest(); + HttpServletResponse dresp =3D invocation.getDispatchedResponse(); + + // + PortletRequestImpl req; + PortletResponseImpl resp; + String phase; + FilterChainImpl chain; + if (invocation instanceof ActionInvocation) + { + req =3D new ActionRequestImpl((ActionInvocation)invocation); + resp =3D new ActionResponseImpl((ActionInvocation)invocation, req= ); + phase =3D "ACTION_PHASE"; + chain =3D new FilterChainImpl(actionFilterList, Act= ionFilter.class); + } + else if (invocation instanceof RenderInvocation) + { + req =3D new RenderRequestImpl((RenderInvocation)invocation); + resp =3D new RenderResponseImpl((RenderInvocation)invocation, req= ); + phase =3D "RENDER_PHASE"; + chain =3D new FilterChainImpl(renderFilterList, Ren= derFilter.class); + } + else if (invocation instanceof EventInvocation) + { + req =3D new EventRequestImpl((EventInvocation)invocation); + resp =3D new EventResponseImpl((EventInvocation)invocation, req); + phase =3D "EVENT_PHASE"; + chain =3D new FilterChainImpl(eventFilterList, Event= Filter.class); + } + else if (invocation instanceof ResourceInvocation) + { + req =3D new ResourceRequestImpl((ResourceInvocation)invocation); + resp =3D new ResourceResponseImpl((ResourceInvocation)invocation,= req); + phase =3D "RESOURCE_SERVING_PHASE"; + chain =3D new FilterChainImpl(resourceFilterList,= ResourceFilter.class); + } + else + { + throw new InvocationException("Unexpected invocation " + invocatio= n); + } + + // try { - if (invocation instanceof ActionInvocation) - { - return invokeAction((ActionInvocation)invocation); - } - else if (invocation instanceof RenderInvocation) - { - return invokeRender((RenderInvocation)invocation); - } - else if (invocation instanceof EventInvocation) - { - return invokeEvent((EventInvocation)invocation); - } - else if (invocation instanceof ResourceInvocation) - { - return invokeResource((ResourceInvocation)invocation); - } - else - { - throw new InvocationException("Unexpected invocation " + invoca= tion); - } + dreq.setAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_= INVOCATION, invocation); + dreq.setAttribute(Constants.JAVAX_PORTLET_CONFIG, config); + dreq.setAttribute(Constants.JAVAX_PORTLET_REQUEST, req); + dreq.setAttribute(Constants.JAVAX_PORTLET_RESPONSE, resp); + dreq.setAttribute(Constants.JAVAX_PORTLET_LIFECYCLE_PHASE, phase); + + // + chain.doFilter(req, resp); + + // + return resp.getResponse(); } catch (NoClassDefFoundError e) { @@ -472,135 +507,16 @@ return new ErrorResponse(e); } } - } - - protected PortletInvocationResponse invokeAction(ActionInvocation invoc= ation) throws IOException, PortletException - { - PortletAPIFactory factory =3D application.getPortletAPIFactory(); - ActionRequestImpl req =3D factory.createActionRequest(invocation); - ActionResponseImpl resp =3D factory.createActionResponse(invocation,= req); - HttpServletRequest dreq =3D invocation.getDispatchedRequest(); - try - { - dreq.setAttribute(APIConstants.JAVAX_PORTLET_CONFIG, config); - dreq.setAttribute(APIConstants.JAVAX_PORTLET_REQUEST, req); - dreq.setAttribute(APIConstants.JAVAX_PORTLET_RESPONSE, resp); - dreq.setAttribute(APIConstants.JAVAX_PORTLET_LIFECYCLE_PHASE, "AC= TION_PHASE"); - dreq.setAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_= INVOCATION, invocation); - - // - FilterChainImpl chain =3D new FilterChainImpl(actionFilterList, ActionFilter.class); - chain.doFilter(req, resp); - } finally { - dreq.removeAttribute(APIConstants.JAVAX_PORTLET_CONFIG); - dreq.removeAttribute(APIConstants.JAVAX_PORTLET_REQUEST); - dreq.removeAttribute(APIConstants.JAVAX_PORTLET_RESPONSE); - dreq.removeAttribute(APIConstants.JAVAX_PORTLET_LIFECYCLE_PHASE); dreq.removeAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONE= NT_INVOCATION); + dreq.removeAttribute(Constants.JAVAX_PORTLET_CONFIG); + dreq.removeAttribute(Constants.JAVAX_PORTLET_REQUEST); + dreq.removeAttribute(Constants.JAVAX_PORTLET_RESPONSE); + dreq.removeAttribute(Constants.JAVAX_PORTLET_LIFECYCLE_PHASE); } - - return resp.getResponse(); } = - protected PortletInvocationResponse invokeRender(RenderInvocation invoc= ation) throws IOException, PortletException - { - PortletAPIFactory factory =3D application.getPortletAPIFactory(); - RenderRequestImpl req =3D factory.createRenderRequest(invocation); - RenderResponseImpl resp =3D factory.createRenderResponse(invocation,= req); - HttpServletRequest dreq =3D invocation.getDispatchedRequest(); - try - { - dreq.setAttribute(APIConstants.JAVAX_PORTLET_CONFIG, config); - dreq.setAttribute(APIConstants.JAVAX_PORTLET_REQUEST, req); - dreq.setAttribute(APIConstants.JAVAX_PORTLET_RESPONSE, resp); - dreq.setAttribute(APIConstants.JAVAX_PORTLET_LIFECYCLE_PHASE, "RE= NDER_PHASE"); - dreq.setAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_= INVOCATION, invocation); - - // - FilterChainImpl chain =3D new FilterChainImpl(renderFilterList, RenderFilter.class); - chain.doFilter(req, resp); - } - finally - { - dreq.removeAttribute(APIConstants.JAVAX_PORTLET_CONFIG); - dreq.removeAttribute(APIConstants.JAVAX_PORTLET_REQUEST); - dreq.removeAttribute(APIConstants.JAVAX_PORTLET_RESPONSE); - dreq.removeAttribute(APIConstants.JAVAX_PORTLET_LIFECYCLE_PHASE); - dreq.removeAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONE= NT_INVOCATION); - } - return resp.getResponse(); - } - - protected PortletInvocationResponse invokeEvent(EventInvocation invocat= ion) throws IOException, PortletException - { - // Todo something clever if CCE occues - EventPortlet eventPortlet =3D (EventPortlet)portlet; - - // - PortletAPIFactory factory =3D application.getPortletAPIFactory(); - EventRequestImpl req =3D factory.createEventRequest(invocation); - EventResponseImpl resp =3D factory.createEventResponse(invocation, r= eq); - HttpServletRequest dreq =3D invocation.getDispatchedRequest(); - try - { - dreq.setAttribute(APIConstants.JAVAX_PORTLET_CONFIG, config); - dreq.setAttribute(APIConstants.JAVAX_PORTLET_REQUEST, req); - dreq.setAttribute(APIConstants.JAVAX_PORTLET_RESPONSE, resp); - dreq.setAttribute(APIConstants.JAVAX_PORTLET_LIFECYCLE_PHASE, "EV= ENT_PHASE"); - dreq.setAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_= INVOCATION, invocation); - - // - FilterChainImpl chain =3D new FilterChainImpl(eventFilterList, EventFilter.class); - chain.doFilter(req, resp); - } - finally - { - dreq.removeAttribute(APIConstants.JAVAX_PORTLET_CONFIG); - dreq.removeAttribute(APIConstants.JAVAX_PORTLET_REQUEST); - dreq.removeAttribute(APIConstants.JAVAX_PORTLET_RESPONSE); - dreq.removeAttribute(APIConstants.JAVAX_PORTLET_LIFECYCLE_PHASE); - dreq.removeAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONE= NT_INVOCATION); - } - return resp.getResponse(); - } - - protected PortletInvocationResponse invokeResource(ResourceInvocation i= nvocation) throws IOException, PortletException - { - // Todo something clever if CCE occues - ResourceServingPortlet eventPortlet =3D (ResourceServingPortlet)port= let; - - // - PortletAPIFactory factory =3D application.getPortletAPIFactory(); - ResourceRequestImpl req =3D factory.createResourceRequest(invocation= ); - ResourceResponseImpl resp =3D factory.createResourceResponse(invocat= ion, req); - HttpServletRequest dreq =3D invocation.getDispatchedRequest(); - try - { - dreq.setAttribute(APIConstants.JAVAX_PORTLET_CONFIG, config); - dreq.setAttribute(APIConstants.JAVAX_PORTLET_REQUEST, req); - dreq.setAttribute(APIConstants.JAVAX_PORTLET_RESPONSE, resp); - dreq.setAttribute(APIConstants.JAVAX_PORTLET_LIFECYCLE_PHASE, "RE= SOURCE_SERVING_PHASE"); - dreq.setAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_= INVOCATION, invocation); - - // - FilterChainImpl chain =3D new FilterChainImpl(resourceFilterList, ResourceFilter.class); - chain.doFilter(req, resp); - } - finally - { - dreq.removeAttribute(APIConstants.JAVAX_PORTLET_CONFIG); - dreq.removeAttribute(APIConstants.JAVAX_PORTLET_REQUEST); - dreq.removeAttribute(APIConstants.JAVAX_PORTLET_RESPONSE); - dreq.removeAttribute(APIConstants.JAVAX_PORTLET_LIFECYCLE_PHASE); - dreq.removeAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONE= NT_INVOCATION); - } - - // - return resp.getResponse(); - } - private class Invoker implements ActionFilter, EventFilter, RenderFilte= r, ResourceFilter { = Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletRequestAttributes.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletRequestAttributes.java 2008-02-03 11:59:52 UTC (rev 9720) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletRequestAttributes.java 2008-02-03 16:12:29 UTC (rev 9721) @@ -28,7 +28,7 @@ import org.jboss.portal.portlet.container.PortletContainer; = import javax.portlet.PortletRequest; -import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequestWrapper; import java.util.Map; import java.util.Enumeration; import java.util.Set; @@ -56,20 +56,29 @@ /** Constant object to mark that a request attribute is removed. */ protected static final Object REMOVED_ATTRIBUTE =3D new Object(); = - private PortletContainer container; + /** . */ + private final PortletContainer container; = - private UserContext userContext; + /** . */ + private final UserContext userContext; = + /** . */ + private final HttpServletRequestWrapper wreq; + /** The lazy request attributes map added or removed during the request= of the portlet. */ private Map attributes; = - public PortletRequestAttributes(PortletContainer container, UserContext= userContext) + public PortletRequestAttributes( + PortletContainer container, + UserContext userContext, + HttpServletRequestWrapper wreq) { this.container =3D container; this.userContext =3D userContext; + this.wreq =3D wreq; } = - public Object getAttribute(String name, HttpServletRequest req) + public Object getAttribute(String name) { if (name =3D=3D null) { @@ -107,9 +116,9 @@ { value =3D attributes.get(name); } - if (value =3D=3D null && req !=3D null) + if (value =3D=3D null && wreq !=3D null) { - value =3D req.getAttribute(name); + value =3D wreq.getAttribute(name); } else if (value =3D=3D REMOVED_ATTRIBUTE) { @@ -119,7 +128,7 @@ } } = - public Iterator getAttributeNames(HttpServletRequest req) + public Iterator getAttributeNames() { // Copy the attribute names to avoid ConcurrentModificationException // one test in the TCK getPortalObjectContext the Enumeration then d= ispatch the call to a @@ -127,13 +136,10 @@ Set names =3D new HashSet(); = // - if (req !=3D null) + for (Enumeration e =3D wreq.getAttributeNames();e.hasMoreElements();) { - for (Enumeration e =3D req.getAttributeNames();e.hasMoreElements(= );) - { - // Fixme : when migrated to servlet 2.5 - names.add((String)e.nextElement()); - } + // Fixme : when migrated to servlet 2.5 + names.add((String)e.nextElement()); } = // Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portl= et/impl/jsr168/RequestDispatcherImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/RequestDispatcherImpl.java 2008-02-03 11:59:52 UTC (rev 9720) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/RequestDispatcherImpl.java 2008-02-03 16:12:29 UTC (rev 9721) @@ -1,77 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.impl.jsr168; - -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.ServletException; -import java.io.IOException; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class RequestDispatcherImpl implements RequestDispatcher -{ - - /** . */ - private final RequestDispatcher realDispatcher; - - /** . */ - private final String path; - - public RequestDispatcherImpl(RequestDispatcher realDispatcher, String p= ath) - { - this.realDispatcher =3D realDispatcher; - this.path =3D path; - } - - public void include(ServletRequest req, ServletResponse resp) throws Se= rvletException, IOException - { - Dispatch dispatch =3D new Dispatch(DispatchType.INCLUDE, path); - ((DispatchedHttpServletRequest)req).pushDispatch(dispatch); - try - { - realDispatcher.include(req, resp); - } - finally - { - ((DispatchedHttpServletRequest)req).popDispatch(); - } - } - - public void forward(ServletRequest req, ServletResponse resp) throws Se= rvletException, IOException - { - Dispatch dispatch =3D new Dispatch(DispatchType.FORWARD, path); - ((DispatchedHttpServletRequest)req).pushDispatch(dispatch); - try - { - realDispatcher.forward(req, resp); - } - finally - { - ((DispatchedHttpServletRequest)req).popDispatch(); - } - } -} Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/FilterChainImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/FilterChainImpl.java 2008-02-03 11:59:52 UTC (rev 9720) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/FilterChainImpl.java 2008-02-03 16:12:29 UTC (rev 9721) @@ -37,6 +37,8 @@ import javax.portlet.RenderResponse; import javax.portlet.EventRequest; import javax.portlet.EventResponse; +import javax.portlet.PortletRequest; +import javax.portlet.PortletResponse; import java.io.IOException; import java.util.List; = @@ -63,6 +65,30 @@ this.index =3D 0; } = + public void doFilter(PortletRequest req, PortletResponse resp) throws I= OException, PortletException + { + if (req instanceof ActionRequest && resp instanceof ActionResponse) + { + doFilter((ActionRequest)req, (ActionResponse)resp); + } + else if (req instanceof EventRequest && resp instanceof EventRespons= e) + { + doFilter((EventRequest)req, (EventResponse)resp); + } + else if (req instanceof RenderRequest && resp instanceof RenderRespo= nse) + { + doFilter((RenderRequest)req, (RenderResponse)resp); + } + else if (req instanceof ResourceRequest && resp instanceof ResourceR= esponse) + { + doFilter((ResourceRequest)req, (ResourceResponse)resp); + } + else + { + throw new IllegalArgumentException(); + } + } + public void doFilter(ActionRequest req, ActionResponse resp) throws IOE= xception, PortletException { if (!ActionFilter.class.isAssignableFrom(phase)) Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/PortletRequestDispatcherImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletRequestDispatcherImpl.java 2008-02-03 11:59:52 UTC (re= v 9720) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletRequestDispatcherImpl.java 2008-02-03 16:12:29 UTC (re= v 9721) @@ -22,8 +22,6 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.impl.jsr168.api; = -import org.jboss.portal.portlet.aspects.portlet.ContextDispatcherIntercept= or; -import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.impl.jsr168.DispatchedHttpServletRequest; import org.jboss.portal.portlet.impl.jsr168.DispatchedHttpServletResponse; import org.jboss.portal.portlet.impl.jsr168.DispatchType; @@ -39,11 +37,14 @@ import javax.portlet.PortletResponse; import javax.portlet.ActionRequest; import javax.portlet.EventRequest; +import javax.portlet.ResourceRequest; +import javax.portlet.filter.PortletRequestWrapper; +import javax.portlet.filter.PortletResponseWrapper; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpServletRequestWrapper; +import javax.servlet.http.HttpServletResponseWrapper; import java.io.IOException; = /** @@ -88,48 +89,48 @@ = private void dispatch( DispatchType type, - PortletRequest req, - PortletResponse resp) throws PortletException, IOException + PortletRequest wreq, + PortletResponse wresp) throws PortletException, IOException { + PortletRequestImpl req =3D unwrap(wreq); + PortletResponseImpl resp =3D unwrap(wresp); + + // Dispatch dispatch =3D new Dispatch(type, path); = // try { - // Get the invocation that is still in the request - PortletInvocation invocation =3D (PortletInvocation)req.getAttrib= ute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_INVOCATION); - - // - PortletApplication application =3D ((PortletRequestImpl)req).cont= ainer.getApplication(); + PortletApplication application =3D req.container.getApplication(); PortletApplicationContext applicationContext =3D application.getC= ontext(); ServletContext servletContext =3D applicationContext.getServletCo= ntext(); = // - HttpServletRequest dreq =3D invocation.getDispatchedRequest(); - HttpServletResponse dresp =3D invocation.getDispatchedResponse(); + HttpServletRequestWrapper realReq =3D req.getRealRequest(); + HttpServletResponseWrapper realResp =3D resp.getRealResponse(); = // DispatchedHttpServletRequest direq; DispatchedHttpServletResponse diresp; if (req instanceof ActionRequest) { - direq =3D new DispatchedHttpServletRequest.Action(dispatch, (A= ctionRequestImpl)req, dreq, servletContext); - diresp =3D new DispatchedHttpServletResponse.StateAware(direq,= (StateAwareResponseImpl)resp, dresp); + direq =3D new DispatchedHttpServletRequest.Action(dispatch, (A= ctionRequest)req, realReq, servletContext); + diresp =3D new DispatchedHttpServletResponse.StateAware(direq,= (StateAwareResponseImpl)resp, realResp); } else if (req instanceof EventRequest) { - direq =3D new DispatchedHttpServletRequest.Event(dispatch, (Ev= entRequestImpl)req, dreq, servletContext); - diresp =3D new DispatchedHttpServletResponse.StateAware(direq,= (StateAwareResponseImpl)resp, dresp); + direq =3D new DispatchedHttpServletRequest.Event(dispatch, (Ev= entRequest)req, realReq, servletContext); + diresp =3D new DispatchedHttpServletResponse.StateAware(direq,= (StateAwareResponseImpl)resp, realResp); } else if (req instanceof RenderRequest) { - direq =3D new DispatchedHttpServletRequest.Render(dispatch, (R= enderRequestImpl)req, dreq, servletContext); - diresp =3D new DispatchedHttpServletResponse.Mime(direq, (Mime= ResponseImpl)resp, dresp); + direq =3D new DispatchedHttpServletRequest.Render(dispatch, (R= enderRequest)req, realReq, servletContext); + diresp =3D new DispatchedHttpServletResponse.Mime(direq, (Mime= ResponseImpl)resp, realResp); } else { - direq =3D new DispatchedHttpServletRequest.Resource(dispatch, = (ResourceRequestImpl)req, dreq, servletContext); - diresp =3D new DispatchedHttpServletResponse.Mime(direq, (Mime= ResponseImpl)resp, dresp); + direq =3D new DispatchedHttpServletRequest.Resource(dispatch, = (ResourceRequest)req, realReq, servletContext); + diresp =3D new DispatchedHttpServletResponse.Mime(direq, (Mime= ResponseImpl)resp, realResp); } = // @@ -149,4 +150,44 @@ throw new PortletException(e); } } + + private PortletRequestImpl unwrap(PortletRequest wrapped) + { + while (true) + { + if (wrapped instanceof PortletRequestImpl) + { + return (PortletRequestImpl)wrapped; + } + else if (wrapped instanceof PortletRequestWrapper) + { + PortletRequestWrapper wrapper =3D (PortletRequestWrapper)wrapp= ed; + wrapped =3D wrapper.getRequest(); + } + else + { + throw new IllegalArgumentException(); + } + } + } + + private PortletResponseImpl unwrap(PortletResponse wrapped) + { + while (true) + { + if (wrapped instanceof PortletResponseImpl) + { + return (PortletResponseImpl)wrapped; + } + else if (wrapped instanceof PortletResponseWrapper) + { + PortletResponseWrapper wrapper =3D (PortletResponseWrapper)wra= pped; + wrapped =3D wrapper.getResponse(); + } + else + { + throw new IllegalArgumentException(); + } + } + } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/PortletRequestImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletRequestImpl.java 2008-02-03 11:59:52 UTC (rev 9720) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletRequestImpl.java 2008-02-03 16:12:29 UTC (rev 9721) @@ -56,9 +56,9 @@ import javax.portlet.PreferencesValidator; import javax.portlet.RenderRequest; import javax.portlet.WindowState; -import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequestWrapper; import java.security.Principal; import java.util.Collections; import java.util.Enumeration; @@ -81,18 +81,43 @@ /** . */ protected static final Logger log =3D Logger.getLogger(PortletRequestIm= pl.class); = + /** . */ protected PortletInvocation invocation; + + /** . */ protected ClientContext clientContext; + + /** . */ protected UserContext userContext; + + /** . */ protected SecurityContext securityContext; + + /** . */ protected ServerContext serverContext; + + /** . */ protected WindowContext windowContext; + + /** . */ protected PortletPreferences preferences; + + /** . */ protected PortletContainerImpl container; - protected HttpServletRequest dreq; + + /** . */ + private HttpServletRequestWrapper realReq; + + /** . */ protected PortalContext portalContext; + + /** . */ protected PortletSessionImpl psession; + + /** . */ protected int sessionStatus; + + /** . */ protected ContainerNavigationInfo navigationInfo; = /** . */ @@ -110,6 +135,9 @@ /** . */ protected final Set supportedWindowStates; = + /** . */ + private final String contextPath; + public PortletRequestImpl(PortletInvocation invocation) { PortletContainerImpl container =3D (PortletContainerImpl)invocation.= getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PO= RTLET_CONTAINER); @@ -122,6 +150,7 @@ UserContext userContext =3D invocation.getUserContext(); = // + this.contextPath =3D (String)invocation.getDispatchedRequest().getAt= tribute("javax.servlet.include.context_path"); this.invocation =3D invocation; this.userContext =3D userContext; this.securityContext =3D invocation.getSecurityContext(); @@ -129,9 +158,9 @@ this.clientContext =3D invocation.getClientContext(); this.windowContext =3D invocation.getWindowContext(); this.container =3D container; - this.dreq =3D invocation.getDispatchedRequest(); + this.realReq =3D new HttpServletRequestWrapper(invocation.getDispatc= hedRequest()); this.portalContext =3D new PortalContextImpl(invocation.getPortalCon= text()); - this.attributes =3D new PortletRequestAttributes(container, userCont= ext); + this.attributes =3D new PortletRequestAttributes(container, userCont= ext, realReq); this.preferences =3D new PortletPreferencesImpl(prefs, containerPref= s, validator, mode); this.navigationInfo =3D navigationInfo; this.requestParameterMap =3D PortletRequestParameterMap.create(navig= ationInfo, invocation.getContext()); @@ -145,7 +174,7 @@ { if (name =3D=3D null) { - throw new IllegalArgumentException("Name shoudl not be null"); + throw new IllegalArgumentException("Name should not be null"); } = // @@ -206,15 +235,14 @@ = // PLT.11.1.3 = - public Object getAttribute(String name) throws IllegalArgumentException { - return attributes.getAttribute(name, dreq); + return attributes.getAttribute(name); } = public Enumeration getAttributeNames() { - return Tools.toEnumeration(attributes.getAttributeNames(dreq)); + return Tools.toEnumeration(attributes.getAttributeNames()); } = public void setAttribute(String name, Object value) @@ -273,7 +301,7 @@ = public String getContextPath() { - return (String)dreq.getAttribute("javax.servlet.include.context_path= "); + return contextPath; } = // PLT.11.1.6 @@ -392,14 +420,14 @@ else if (create) { // For sure we need a session we will obtain a valid one - HttpSession hsession =3D dreq.getSession(); + HttpSession hsession =3D realReq.getSession(); PortletApplicationImpl portletApp =3D (PortletApplicationImpl)con= tainer.getApplication(); psession =3D new PortletSessionImpl(hsession, windowContext.getId= (), portletApp.getPortletContext()); } else { // Here we can try an existing session but it may return null - HttpSession hsession =3D dreq.getSession(false); + HttpSession hsession =3D realReq.getSession(false); = // if (hsession !=3D null) @@ -420,12 +448,12 @@ = public String getRequestedSessionId() { - return dreq.getRequestedSessionId(); + return realReq.getRequestedSessionId(); } = public boolean isRequestedSessionIdValid() { - return dreq.isRequestedSessionIdValid(); + return realReq.isRequestedSessionIdValid(); } = public Enumeration getLocales() @@ -510,6 +538,11 @@ } } = + public final HttpServletRequestWrapper getRealRequest() + { + return realReq; + } + private MultiValuedPropertyMap getProperties() { if (properties =3D=3D null) Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/PortletResponseImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletResponseImpl.java 2008-02-03 11:59:52 UTC (rev 9720) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletResponseImpl.java 2008-02-03 16:12:29 UTC (rev 9721) @@ -32,6 +32,7 @@ = import javax.portlet.PortletResponse; import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletResponseWrapper; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; = @@ -57,10 +58,14 @@ /** . */ private ResponseProperties properties; = + /** . */ + private HttpServletResponseWrapper realResp; + protected PortletResponseImpl(PortletInvocation invocation, PortletRequ= estImpl preq) { this.invocation =3D invocation; this.preq =3D preq; + this.realResp =3D new HttpServletResponseWrapper(invocation.getDispa= tchedResponse()); } = public abstract PortletInvocationResponse getResponse(); @@ -133,6 +138,11 @@ return namespace; } = + public final HttpServletResponseWrapper getRealResponse() + { + return realResp; + } + protected final ResponseProperties getProperties() { return getProperties(true); --===============1674274234609015247==-- From portal-commits at lists.jboss.org Sun Feb 3 12:07:39 2008 Content-Type: multipart/mixed; boundary="===============4888332553690018842==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9722 - in modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl: jsr168/api and 1 other directory. Date: Sun, 03 Feb 2008 12:05:57 -0500 Message-ID: --===============4888332553690018842== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-03 12:05:57 -0500 (Sun, 03 Feb 2008) New Revision: 9722 Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerOptionInfo.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerInfoBuilder.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerPortletInfo.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletConfigImpl.java Log: start to add support for container runtime options Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/info/ContainerInfoBuilder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerInfoBuilder.java 2008-02-03 16:12:29 UTC (rev 9721) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerInfoBuilder.java 2008-02-03 17:05:57 UTC (rev 9722) @@ -33,6 +33,7 @@ import org.jboss.portal.portlet.impl.metadata.portlet.PortletInfoMetaData; import org.jboss.portal.portlet.impl.metadata.security.SecurityConstraintM= etaData; import org.jboss.portal.portlet.impl.metadata.common.InitParamMetaData; +import org.jboss.portal.portlet.impl.metadata.common.ContainerRuntimeMetaD= ata; import org.jboss.portal.portlet.impl.metadata.event.EventDefinitionReferen= ceMetaData; import org.jboss.portal.portlet.impl.metadata.event.EventDefinitionMetaDat= a; import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; @@ -131,6 +132,9 @@ private static final Map EMPTY_FILTER_MAP =3D Co= llections.emptyMap(); = /** . */ + private static final Map EMPTY_CONTAIN= ER_RUNTIME_OPTION_MAP =3D Collections.emptyMap(); + + /** . */ private final PortletApplication10MetaData portletApplicationMD; = /** . */ @@ -151,6 +155,9 @@ /** . */ private final Logger log =3D Logger.getLogger(ContainerInfoBuilder.clas= s); = + /** . */ + private Map applicationOptions; + public ContainerInfoBuilder( PortletApplication10MetaData portletApplicationMD, ContainerInfoBuilderContext context) @@ -215,6 +222,10 @@ { tmp.setFilterMapping(EMPTY_FILTER_MAPPING_MAP); } + if (tmp.getContainerRuntimeOptions() =3D=3D null) + { + tmp.setContainerRuntimeOptions(EMPTY_CONTAINER_RUNTIME_OPTION_= MAP); + } } } = @@ -278,6 +289,10 @@ { portletMD.setSupportedPublishingEvent(EMPTY_EVENT_DEFINITION_R= EFERENCE_LIST); } + if (portletMD.getContainerRuntimeOptions() =3D=3D null) + { + portletMD.setContainerRuntimeOptions(EMPTY_CONTAINER_RUNTIME_O= PTION_MAP); + } } } = @@ -366,6 +381,17 @@ } = // + applicationOptions =3D build(tmp.getContainerRuntimeOptions().val= ues()); + if (applicationOptions !=3D null) + { + applicationOptions =3D Collections.unmodifiableMap(application= Options); + } + else + { + applicationOptions =3D Collections.emptyMap(); + } + + // listeners =3D new ArrayList(tmp.getListene= rs().size()); for (ListenerMetaData listenerMD : tmp.getListeners()) { @@ -472,11 +498,19 @@ ContainerSessionInfo containerSession =3D buildContainerSession(port= letMD); = // - Map initParameters =3D new HashMap(); + Map initParameters =3D Collections.emptyMap(); for (InitParamMetaData initParamMD : portletMD.getInitParams()) { + if (initParameters.isEmpty()) + { + initParameters =3D new HashMap(); + } initParameters.put(initParamMD.getName(), initParamMD.getValue()); } + if (initParameters.size() > 0) + { + initParameters =3D Collections.unmodifiableMap(initParameters); + } = // ContainerPortletInfo containerPortletInfo; @@ -486,7 +520,7 @@ ContainerNavigationInfo containerNavigation =3D buildContainerNav= igationInfo(portletMD); = // - List filters =3D new ArrayList(); + List filters =3D Collections.emptyList(); for (FilterMappingMetaData filterMappingMD : ((PortletApplication= 20MetaData)portletApplicationMD).getFilterMapping().values()) { for (String portletName : filterMappingMD.getPortletNames()) @@ -510,12 +544,38 @@ // Add the filter if (matches) { + if (filters.isEmpty()) + { + filters =3D new ArrayList(); + } filters.add(filterMappingMD.getName()); } } } + if (filters.size() > 0) + { + filters =3D Collections.unmodifiableList(filters); + } = // + Map options =3D build(portletMD.getC= ontainerRuntimeOptions().values()); + if (options !=3D null) + { + for (Map.Entry entry : applicatio= nOptions.entrySet()) + { + if (!options.containsKey(entry.getKey())) + { + options.put(entry.getKey(), entry.getValue()); + } + } + options =3D Collections.unmodifiableMap(options); + } + else + { + options =3D applicationOptions; + } + + // containerPortletInfo =3D new ContainerPortletInfo( containerCapabilities, containerPreferences, @@ -525,12 +585,13 @@ containerSession, containerEvents, containerNavigation, - Collections.unmodifiableList(filters), + filters, portletMD.getPortletName(), portletMD.getPortletClass(), - Collections.unmodifiableMap(initParameters), + initParameters, false, - context.getBundleManager(portletMD) + context.getBundleManager(portletMD), + options ); } else @@ -554,6 +615,26 @@ return containerPortletInfo; } = + private Map build(Collection optionsMD) + { + Map options =3D null; + for (ContainerRuntimeMetaData containerRuntimeMD : optionsMD) + { + ContainerOptionInfo optionInfo =3D build(containerRuntimeMD); + if (options =3D=3D null) + { + options =3D new HashMap(); + } + options.put(optionInfo.getName(), optionInfo); + } + return options; + } + + private ContainerOptionInfo build(ContainerRuntimeMetaData containerRun= timeMD) + { + return new ContainerOptionInfo(containerRuntimeMD.getName(), Collect= ions.unmodifiableList(containerRuntimeMD.getValues())); + } + private ContainerNavigationInfo buildContainerNavigationInfo(PortletMet= aData portletMD) { ContainerNavigationInfo navigation =3D new ContainerNavigationInfo(); Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/info/ContainerOptionInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerOptionInfo.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerOptionInfo.java 2008-02-03 17:05:57 UTC (rev 9722) @@ -0,0 +1,55 @@ +/*************************************************************************= ***** + * 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.portlet.impl.info; + +import java.util.List; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ContainerOptionInfo +{ + + /** . */ + private final String name; + + /** . */ + private final List values; + + public ContainerOptionInfo(String name, List values) + { + this.name =3D name; + this.values =3D values; + } + + public String getName() + { + return name; + } + + public List getValues() + { + return values; + } +} Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/info/ContainerPortletInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerPortletInfo.java 2008-02-03 16:12:29 UTC (rev 9721) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerPortletInfo.java 2008-02-03 17:05:57 UTC (rev 9722) @@ -82,6 +82,9 @@ /** . */ private final List filterRefs; = + /** . */ + private final Map options; + public ContainerPortletInfo( ContainerCapabilitiesInfo capabilities, ContainerPreferencesInfo preferences, @@ -109,6 +112,7 @@ this.initParameters =3D initParameters; this.remotable =3D remotable; this.bundleManager =3D bundleManager; + this.options =3D Collections.emptyMap(); } = ContainerPortletInfo( @@ -125,7 +129,8 @@ String className, Map initParameters, Boolean remotable, - ResourceBundleManager bundleManager) + ResourceBundleManager bundleManager, + Map options) { this.capabilities =3D capabilities; this.preferences =3D preferences; @@ -141,6 +146,7 @@ this.initParameters =3D initParameters; this.remotable =3D remotable; this.bundleManager =3D bundleManager; + this.options =3D options; } = public String getName() @@ -148,6 +154,11 @@ return name; } = + public Map getOptions() + { + return options; + } + public ResourceBundleManager getBundleManager() { return bundleManager; Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/PortletConfigImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletConfigImpl.java 2008-02-03 16:12:29 UTC (rev 9721) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletConfigImpl.java 2008-02-03 17:05:57 UTC (rev 9722) @@ -23,9 +23,11 @@ package org.jboss.portal.portlet.impl.jsr168.api; = import org.jboss.portal.common.i18n.ResourceBundleManager; +import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.portlet.impl.info.ContainerParameterInfo; import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo; import org.jboss.portal.portlet.impl.info.ContainerPortletInfo; +import org.jboss.portal.portlet.impl.info.ContainerOptionInfo; = import javax.portlet.PortletConfig; import javax.portlet.PortletContext; @@ -66,6 +68,9 @@ /** . */ private List publicRenderParameterNames; = + /** . */ + private Map containerRuntimeOptions; + public PortletConfigImpl( ContainerPortletInfo portletInfo, ContainerPortletApplicationInfo portletApplicationInfo, @@ -80,6 +85,24 @@ } = // + Map containerRuntimeOptions; + if (portletInfo.getOptions().size() > 0) + { + ParameterMap tmp =3D new ParameterMap(ParameterMap.AccessMode.get= (true, false)); + for (ContainerOptionInfo option : portletInfo.getOptions().values= ()) + { + String name =3D option.getName(); + String[] values =3D option.getValues().toArray(new String[opti= on.getValues().size()]); + tmp.setValues(name, values); + } + containerRuntimeOptions =3D Collections.unmodifiableMap(tmp); + } + else + { + containerRuntimeOptions =3D Collections.emptyMap(); + } + + // this.portletInfo =3D portletInfo; this.portletApplicationInfo =3D portletApplicationInfo; this.portletContext =3D portletContext; @@ -87,6 +110,7 @@ this.publishingEventQNames =3D new ArrayList(portletInfo.getE= venting().getProducedEvents().keySet()); this.processingEventQNames =3D new ArrayList(portletInfo.getE= venting().getConsumedEvents().keySet()); this.publicRenderParameterNames =3D publicRenderParameterNames; + this.containerRuntimeOptions =3D containerRuntimeOptions; } = public String getPortletName() @@ -146,7 +170,6 @@ = public Map getContainerRuntimeOptions() { - // For now we support no container runtime options - return Collections.emptyMap(); + return containerRuntimeOptions; } } --===============4888332553690018842==-- From portal-commits at lists.jboss.org Sun Feb 3 12:21:16 2008 Content-Type: multipart/mixed; boundary="===============0496160177655339332==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9723 - modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet. Date: Sun, 03 Feb 2008 12:17:15 -0500 Message-ID: --===============0496160177655339332== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-03 12:17:14 -0500 (Sun, 03 Feb 2008) New Revision: 9723 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/asp= ects/portlet/ProducerCacheInterceptor.java Log: - update comment on producer cache interceptor Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/aspects/portlet/ProducerCacheInterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/as= pects/portlet/ProducerCacheInterceptor.java 2008-02-03 17:05:57 UTC (rev 97= 22) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/as= pects/portlet/ProducerCacheInterceptor.java 2008-02-03 17:17:14 UTC (rev 97= 23) @@ -28,6 +28,9 @@ import org.apache.log4j.Logger; = /** + * Not removed as it is a place holder to implement producer cache (i.e ca= ching markup + * on the producer side to avoid recomputation). + * * @author Julien Viet * @version $Revision: 7226 $ */ --===============0496160177655339332==-- From portal-commits at lists.jboss.org Sun Feb 3 20:27:58 2008 Content-Type: multipart/mixed; boundary="===============3881643090371934844==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9724 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168 and 9 other directories. Date: Sun, 03 Feb 2008 20:27:57 -0500 Message-ID: --===============3881643090371934844== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-03 20:27:57 -0500 (Sun, 03 Feb 2008) New Revision: 9724 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/asp= ects/portlet/ConsumerCacheInterceptor.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletApplicationImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletRequestParameterMap.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/ResourceRequestParameterMap.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/EventImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/EventRequestImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/EventResponseImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletRequestImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/ResourceRequestImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/ResourceResponseImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/ResourceURLImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/spi/AbstractActionContext.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/spi/AbstractEventContext.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/spi/AbstractPortletInvocationContext.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/spi/AbstractRenderContext.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/spi/AbstractResourceContext.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/inv= ocation/ActionInvocation.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/inv= ocation/EventInvocation.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/inv= ocation/PortletInvocation.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/inv= ocation/ResourceInvocation.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi= /ActionContext.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi= /EventContext.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi= /PortletInvocationContext.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi= /ResourceInvocationContext.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sup= port/spi/ActionContextSupport.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sup= port/spi/PortletInvocationContextSupport.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sup= port/spi/RenderContextSupport.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter1.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter2.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/state/ActionContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/R= esourceTestContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/T= estActionContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/T= estEventContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/T= estRenderContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletController.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletRequestHandler.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletResourceRequestHandler.java Log: - refactor input data for a portlet invocation to be on the invocation inst= ead of being on the invocation context Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/aspects/portlet/ConsumerCacheInterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/as= pects/portlet/ConsumerCacheInterceptor.java 2008-02-03 17:17:14 UTC (rev 97= 23) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/as= pects/portlet/ConsumerCacheInterceptor.java 2008-02-04 01:27:57 UTC (rev 97= 24) @@ -33,7 +33,6 @@ import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.ParametersStateString; import org.jboss.portal.portlet.cache.CacheControl; -import org.jboss.portal.portlet.spi.RenderContext; import org.jboss.portal.common.invocation.InvocationException; import org.jboss.portal.common.invocation.AttributeResolver; import org.jboss.portal.WindowState; @@ -62,12 +61,12 @@ // if (invocation instanceof RenderInvocation) { - RenderContext renderCtx =3D (RenderContext)invocation.getContext(= ); + RenderInvocation renderInvocation =3D (RenderInvocation)invocatio= n; = // - StateString navState =3D renderCtx.getNavigationalState(); - WindowState windowState =3D renderCtx.getWindowState(); - Mode mode =3D renderCtx.getMode(); + StateString navState =3D renderInvocation.getNavigationalState(); + WindowState windowState =3D renderInvocation.getWindowState(); + Mode mode =3D renderInvocation.getMode(); = // CacheEntry cachedEntry =3D (CacheEntry)resolver.getAttribute(scop= eKey); @@ -123,12 +122,10 @@ // If no valid fragment we must invoke if (fragment =3D=3D null || cachedEntry.expirationTimeMillis < Sy= stem.currentTimeMillis()) { - RenderInvocation render =3D (RenderInvocation)invocation; - // Set validation token for revalidation only we have have a f= ragment if (fragment !=3D null) { - render.setValidationToken(cachedEntry.validationToken); + renderInvocation.setValidationToken(cachedEntry.validationT= oken); } = // Invoke Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletApplicationImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletApplicationImpl.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletApplicationImpl.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -222,8 +222,18 @@ for (LifeCyclePhase phase : filterInfo.getLifeCycles()) { Class type =3D phaseToType.get(pha= se); - FilterKey key =3D new FilterKey(filterInfo.getName(), type); - filters.put(key, lifeCycle); + + // + if (type.isInstance(lifeCycle.getInstance())) + { + FilterKey key =3D new FilterKey(filterInfo.getName(), ty= pe); + filters.put(key, lifeCycle); + } + else + { + log.error("Cannot realize filter mapping on phase " + ph= ase + " for filter " + filterInfo.getName() + + " with class " + className + " that does not implemen= t the interface " + type.getName()); + } } } catch (PortletInitializationException e) Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletRequestParameterMap.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletRequestParameterMap.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletRequestParameterMap.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -23,13 +23,13 @@ package org.jboss.portal.portlet.impl.jsr168; = import org.jboss.portal.common.util.ParameterMap; -import org.jboss.portal.portlet.spi.ActionContext; -import org.jboss.portal.portlet.spi.EventContext; -import org.jboss.portal.portlet.spi.RenderContext; -import org.jboss.portal.portlet.spi.ResourceInvocationContext; -import org.jboss.portal.portlet.spi.PortletInvocationContext; import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.ParametersStateString; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.portlet.invocation.EventInvocation; +import org.jboss.portal.portlet.invocation.RenderInvocation; +import org.jboss.portal.portlet.invocation.ActionInvocation; +import org.jboss.portal.portlet.invocation.ResourceInvocation; import org.jboss.portal.portlet.info.NavigationInfo; = import java.util.Iterator; @@ -50,33 +50,33 @@ /** * Factory method that will chose the right builder according to the co= ntext argument type. */ - public static PortletRequestParameterMap create(NavigationInfo navigati= onInfo, PortletInvocationContext context) + public static PortletRequestParameterMap create(NavigationInfo navigati= onInfo, PortletInvocation invocation) { - if (context instanceof EventContext) + if (invocation instanceof EventInvocation) { - return create(navigationInfo, (EventContext)context); + return create(navigationInfo, (EventInvocation)invocation); } - else if (context instanceof ActionContext) + else if (invocation instanceof ActionInvocation) { - return create(navigationInfo, (ActionContext)context); + return create(navigationInfo, (ActionInvocation)invocation); } - else if (context instanceof RenderContext) + else if (invocation instanceof RenderInvocation) { - return create(navigationInfo, (RenderContext)context); + return create(navigationInfo, (RenderInvocation)invocation); } else { - return ResourceRequestParameterMap.create(navigationInfo, (Resour= ceInvocationContext)context); + return ResourceRequestParameterMap.create(navigationInfo, (Resour= ceInvocation)invocation); } } = - public static PortletRequestParameterMap create(NavigationInfo navigati= onInfo, EventContext context) + public static PortletRequestParameterMap create(NavigationInfo navigati= onInfo, EventInvocation invocation) { // Build public parameters - ParameterMap publicParameters =3D safeBuildPublicParameters(navigati= onInfo, context.getPublicNavigationalState()); + ParameterMap publicParameters =3D safeBuildPublicParameters(navigati= onInfo, invocation.getPublicNavigationalState()); = // Get render parameters - ParameterMap privateParameters =3D safeBuildParameters(context.getNa= vigationalState()); + ParameterMap privateParameters =3D safeBuildParameters(invocation.ge= tNavigationalState()); = // Build combined map ParameterMap parameters =3D safeCombine(privateParameters, publicPar= ameters); @@ -85,7 +85,7 @@ return new PortletRequestParameterMap(parameters, privateParameters,= publicParameters); } = - public static PortletRequestParameterMap create(NavigationInfo navigati= onInfo, RenderContext context) + public static PortletRequestParameterMap create(NavigationInfo navigati= onInfo, RenderInvocation context) { // Build public parameters ParameterMap publicParameters =3D safeBuildPublicParameters(navigati= onInfo, context.getPublicNavigationalState()); @@ -109,16 +109,16 @@ * - getPrivateParameterMap() : the interaction parameter + form parame= ter * - getPublicParameterMap() : public render parameter */ - public static PortletRequestParameterMap create(NavigationInfo navigati= onInfo, ActionContext context) + public static PortletRequestParameterMap create(NavigationInfo navigati= onInfo, ActionInvocation invocation) { // Build public parameters - ParameterMap publicParameters =3D safeBuildPublicParameters(navigati= onInfo, context.getPublicNavigationalState()); + ParameterMap publicParameters =3D safeBuildPublicParameters(navigati= onInfo, invocation.getPublicNavigationalState()); = // The private parameters - ParameterMap privateParameters =3D safeBuildParameters(context.getIn= teractionState()); + ParameterMap privateParameters =3D safeBuildParameters(invocation.ge= tInteractionState()); = // Combine form if we have one - privateParameters =3D safeCombine(privateParameters, context.getForm= ()); + privateParameters =3D safeCombine(privateParameters, invocation.getF= orm()); = // Combine to get shared map ParameterMap parameters =3D safeCombine(privateParameters, publicPar= ameters); Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/ResourceRequestParameterMap.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/ResourceRequestParameterMap.java 2008-02-03 17:17:14 UTC (rev 972= 3) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/ResourceRequestParameterMap.java 2008-02-04 01:27:57 UTC (rev 972= 4) @@ -25,6 +25,7 @@ import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.portlet.info.NavigationInfo; import org.jboss.portal.portlet.spi.ResourceInvocationContext; +import org.jboss.portal.portlet.invocation.ResourceInvocation; = /** * @author Julien Viet @@ -70,19 +71,19 @@ * - getPublicParameterMap() : public render parameter * - getPrivateRenderParameterMap() : render parameter */ - public static ResourceRequestParameterMap create(NavigationInfo navigat= ionInfo, ResourceInvocationContext context) + public static ResourceRequestParameterMap create(NavigationInfo navigat= ionInfo, ResourceInvocation invocation) { // Build public parameters - ParameterMap publicParameters =3D safeBuildPublicParameters(navigati= onInfo, context.getPublicNavigationalState()); + ParameterMap publicParameters =3D safeBuildPublicParameters(navigati= onInfo, invocation.getPublicNavigationalState()); = // Combine private render parameters if any - ParameterMap privateRenderParameters =3D safeBuildParameters(context= .getNavigationalState()); + ParameterMap privateRenderParameters =3D safeBuildParameters(invocat= ion.getNavigationalState()); = // The private parameters - ParameterMap privateParameters =3D safeBuildParameters(context.getRe= sourceState()); + ParameterMap privateParameters =3D safeBuildParameters(invocation.ge= tResourceState()); = // Combine form if we have one - privateParameters =3D safeCombine(privateParameters, context.getForm= ()); + privateParameters =3D safeCombine(privateParameters, invocation.getF= orm()); = // Combien with private render parameters privateParameters =3D safeCombine(privateParameters, privateRenderPa= rameters); Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/EventImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/EventImpl.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/EventImpl.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.impl.jsr168.api; = -import org.jboss.portal.portlet.spi.EventContext; +import org.jboss.portal.portlet.invocation.EventInvocation; = import javax.portlet.Event; import javax.xml.namespace.QName; @@ -36,25 +36,25 @@ { = /** . */ - private final EventContext context; + private final EventInvocation invocation; = - public EventImpl(EventContext context) + public EventImpl(EventInvocation invocation) { - this.context =3D context; + this.invocation =3D invocation; } = public QName getQName() { - return context.getName(); + return invocation.getName(); } = public String getName() { - return context.getName().getLocalPart(); + return invocation.getName().getLocalPart(); } = public Serializable getValue() { - return context.getPayload(); + return invocation.getPayload(); } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/EventRequestImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/EventRequestImpl.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/EventRequestImpl.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -23,7 +23,6 @@ package org.jboss.portal.portlet.impl.jsr168.api; = import org.jboss.portal.portlet.invocation.EventInvocation; -import org.jboss.portal.portlet.spi.EventContext; = import javax.portlet.EventRequest; import javax.portlet.Event; @@ -38,16 +37,22 @@ /** . */ private EventImpl event; = + /** . */ + private EventInvocation eventInvocation; + public EventRequestImpl(EventInvocation invocation) { super(invocation); + + // + this.eventInvocation =3D invocation; } = public Event getEvent() { if (event =3D=3D null) { - event =3D new EventImpl((EventContext)invocation.getContext()); + event =3D new EventImpl(eventInvocation); } = // Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/EventResponseImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/EventResponseImpl.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/EventResponseImpl.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -23,8 +23,6 @@ package org.jboss.portal.portlet.impl.jsr168.api; = import org.jboss.portal.portlet.invocation.EventInvocation; -import org.jboss.portal.portlet.spi.PortletInvocationContext; -import org.jboss.portal.portlet.ParametersStateString; = import javax.portlet.EventResponse; import javax.portlet.EventRequest; @@ -54,12 +52,9 @@ } = // - PortletInvocationContext context =3D invocation.getContext(); - - // WantUpdate update =3D wantUpdate(); - update.mode =3D context.getMode(); - update.windowState =3D context.getWindowState(); + update.mode =3D invocation.getMode(); + update.windowState =3D invocation.getWindowState(); = // update.navigationalState =3D ParametersStateString.create(context.= getNavigationalState()).getParameters(); // update.publicNavigationalState =3D context.getPublicNavigationalSt= ate(); Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/PortletRequestImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletRequestImpl.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletRequestImpl.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -163,7 +163,7 @@ this.attributes =3D new PortletRequestAttributes(container, userCont= ext, realReq); this.preferences =3D new PortletPreferencesImpl(prefs, containerPref= s, validator, mode); this.navigationInfo =3D navigationInfo; - this.requestParameterMap =3D PortletRequestParameterMap.create(navig= ationInfo, invocation.getContext()); + this.requestParameterMap =3D PortletRequestParameterMap.create(navig= ationInfo, invocation); this.supportedModes =3D buildSupportedModes(); this.supportedWindowStates =3D buildSupportedWindowState(); } @@ -223,13 +223,13 @@ = public WindowState getWindowState() { - String s =3D invocation.getContext().getWindowState().toString(); + String s =3D invocation.getWindowState().toString(); return PortletUtils.decodeWindowState(s); } = public PortletMode getPortletMode() { - String s =3D invocation.getContext().getMode().toString(); + String s =3D invocation.getMode().toString(); return PortletUtils.decodePortletMode(s); } = Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/ResourceRequestImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/ResourceRequestImpl.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/ResourceRequestImpl.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -23,7 +23,6 @@ package org.jboss.portal.portlet.impl.jsr168.api; = import org.jboss.portal.portlet.invocation.ResourceInvocation; -import org.jboss.portal.portlet.spi.ResourceInvocationContext; import org.jboss.portal.portlet.impl.jsr168.ResourceRequestParameterMap; import org.jboss.portal.common.util.MultiValuedPropertyMap; import org.jboss.portal.common.util.ParameterMap; @@ -40,23 +39,19 @@ { = /** . */ - private final ResourceInvocationContext resourceContext; + private final ResourceInvocation resourceInvocation; = - /** . */ - private final String validationToken; - public ResourceRequestImpl(ResourceInvocation invocation) { super(invocation); = // - this.resourceContext =3D invocation.getContext(); - this.validationToken =3D invocation.getValidationToken(); + this.resourceInvocation =3D invocation; } = public String getResourceID() { - return resourceContext.getResourceId(); + return resourceInvocation.getResourceId(); } = public Map getPrivateRenderParameterMap() @@ -76,19 +71,19 @@ = public String getCacheability() { - return ResourceURLImpl.toJSR168(resourceContext.getCacheLevel()); + return ResourceURLImpl.toJSR168(resourceInvocation.getCacheLevel()); } = public String getETag() { - return validationToken; + return resourceInvocation.getValidationToken(); } = protected void initProperties(MultiValuedPropertyMap properties) { - if (validationToken !=3D null) + if (resourceInvocation.getValidationToken() !=3D null) { - properties.setValue(ETAG, validationToken); + properties.setValue(ETAG, resourceInvocation.getValidationToken()= ); } } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/ResourceResponseImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/ResourceResponseImpl.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/ResourceResponseImpl.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -44,7 +44,7 @@ super(invocation, preq); = // - this.cacheability =3D invocation.getContext().getCacheLevel(); + this.cacheability =3D invocation.getCacheLevel(); } = public void setLocale(Locale locale) Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/ResourceURLImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/ResourceURLImpl.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/ResourceURLImpl.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -81,7 +81,7 @@ // if (invocation instanceof ResourceInvocation) { - url.parentCacheLevel =3D ((ResourceInvocation)invocation).getCont= ext().getCacheLevel(); + url.parentCacheLevel =3D ((ResourceInvocation)invocation).getCach= eLevel(); } } = Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/spi/AbstractActionContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/spi/AbstractActionContext.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/spi/AbstractActionContext.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -23,11 +23,7 @@ package org.jboss.portal.portlet.impl.spi; = import org.jboss.portal.portlet.spi.ActionContext; -import org.jboss.portal.portlet.StateString; -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; import org.jboss.portal.common.util.MarkupInfo; -import org.jboss.portal.common.util.ParameterMap; = /** * @author Julien Viet @@ -35,37 +31,8 @@ */ public abstract class AbstractActionContext extends AbstractPortletInvocat= ionContext implements ActionContext { - - /** . */ - protected StateString interactionState; - - /** . */ - protected ParameterMap form; - - - protected AbstractActionContext( - Mode mode, - WindowState windowState, - StateString navigationalState, - ParameterMap publicNavigationalState, - MarkupInfo markupInfo, - StateString interactionState, - ParameterMap form) + protected AbstractActionContext(MarkupInfo markupInfo) { - super(mode, windowState, navigationalState, publicNavigationalState,= markupInfo); - - // - this.interactionState =3D interactionState; - this.form =3D form; + super(markupInfo); } - - public StateString getInteractionState() - { - return interactionState; - } - - public ParameterMap getForm() - { - return form; - } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/spi/AbstractEventContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/spi/AbstractEventContext.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/spi/AbstractEventContext.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -22,17 +22,9 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.impl.spi; = -import org.jboss.portal.portlet.spi.RenderContext; import org.jboss.portal.portlet.spi.EventContext; -import org.jboss.portal.portlet.StateString; -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; import org.jboss.portal.common.util.MarkupInfo; -import org.jboss.portal.common.util.ParameterMap; = -import javax.xml.namespace.QName; -import java.io.Serializable; - /** * @author Julien Viet * @version $Revision: 1.1 $ @@ -40,35 +32,8 @@ public abstract class AbstractEventContext extends AbstractPortletInvocati= onContext implements EventContext { = - /** . */ - protected QName name; - - /** . */ - protected Serializable payload; - - protected AbstractEventContext( - Mode mode, - WindowState windowState, - StateString navigationalState, - ParameterMap publicNavigationalState, - MarkupInfo markupInfo, - QName name, - Serializable payload) + protected AbstractEventContext(MarkupInfo markupInfo) { - super(mode, windowState, navigationalState, publicNavigationalState,= markupInfo); - - // - this.name =3D name; - this.payload =3D payload; + super(markupInfo); } - - public QName getName() - { - return name; - } - - public Serializable getPayload() - { - return payload; - } } \ No newline at end of file Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/spi/AbstractPortletInvocationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/spi/AbstractPortletInvocationContext.java 2008-02-03 17:17:14 UTC (rev 9= 723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/spi/AbstractPortletInvocationContext.java 2008-02-04 01:27:57 UTC (rev 9= 724) @@ -24,11 +24,7 @@ = import org.jboss.portal.common.invocation.AbstractInvocationContext; import org.jboss.portal.common.util.MarkupInfo; -import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.portlet.spi.PortletInvocationContext; -import org.jboss.portal.portlet.StateString; -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; = import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -45,29 +41,8 @@ /** . */ protected final MarkupInfo markupInfo; = - /** . */ - protected final Mode mode; - - /** . */ - protected final WindowState windowState; - - /** . */ - protected final StateString navigationalState; - - /** . */ - protected final ParameterMap publicNavigationalState; - - protected AbstractPortletInvocationContext( - Mode mode, - WindowState windowState, - StateString navigationalState, - ParameterMap publicNavigationalState, - MarkupInfo markupInfo) + protected AbstractPortletInvocationContext(MarkupInfo markupInfo) { - this.mode =3D mode; - this.windowState =3D windowState; - this.navigationalState =3D navigationalState; - this.publicNavigationalState =3D publicNavigationalState; this.markupInfo =3D markupInfo; } = @@ -105,26 +80,6 @@ throw new IllegalArgumentException("Invalid URL " + url); } = - public Mode getMode() - { - return mode; - } - - public WindowState getWindowState() - { - return windowState; - } - - public ParameterMap getPublicNavigationalState() - { - return publicNavigationalState; - } - - public StateString getNavigationalState() - { - return navigationalState; - } - public MarkupInfo getMarkupInfo() { return markupInfo; Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/spi/AbstractRenderContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/spi/AbstractRenderContext.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/spi/AbstractRenderContext.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -23,11 +23,7 @@ package org.jboss.portal.portlet.impl.spi; = import org.jboss.portal.portlet.spi.RenderContext; -import org.jboss.portal.portlet.StateString; -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; import org.jboss.portal.common.util.MarkupInfo; -import org.jboss.portal.common.util.ParameterMap; = /** * @author Julien Viet @@ -36,13 +32,8 @@ public abstract class AbstractRenderContext extends AbstractPortletInvocat= ionContext implements RenderContext { = - protected AbstractRenderContext( - Mode mode, - WindowState windowState, - StateString navigationalState, - ParameterMap publicNavigationalState, - MarkupInfo markupInfo) + protected AbstractRenderContext(MarkupInfo markupInfo) { - super(mode, windowState, navigationalState, publicNavigationalState,= markupInfo); + super(markupInfo); } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/spi/AbstractResourceContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/spi/AbstractResourceContext.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/spi/AbstractResourceContext.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -22,12 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.impl.spi; = -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; -import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.common.util.MarkupInfo; -import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.cache.CacheLevel; import org.jboss.portal.portlet.spi.ResourceInvocationContext; = /** @@ -37,55 +32,8 @@ public abstract class AbstractResourceContext extends AbstractPortletInvoc= ationContext implements ResourceInvocationContext { = - /** . */ - protected final String resourceId; - - /** . */ - protected final StateString resourceState; - - /** . */ - protected final ParameterMap form; - - /** . */ - protected final CacheLevel cacheLevel; - - public AbstractResourceContext( - String resourceId, - CacheLevel cacheLevel, - Mode mode, - WindowState windowState, - StateString navigationalState, - ParameterMap publicNavigationalState, - StateString resourceState, - ParameterMap form, - MarkupInfo markupInfo) + public AbstractResourceContext(MarkupInfo markupInfo) { - super(mode, windowState, navigationalState, publicNavigationalState,= markupInfo); - - // - this.resourceId =3D resourceId; - this.resourceState =3D resourceState; - this.form =3D form; - this.cacheLevel =3D cacheLevel; + super(markupInfo); } - - public String getResourceId() - { - return resourceId; - } - - public StateString getResourceState() - { - return resourceState; - } - - public ParameterMap getForm() - { - return form; - } - - public CacheLevel getCacheLevel() - { - return cacheLevel; - } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/invocation/ActionInvocation.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/ActionInvocation.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/ActionInvocation.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -24,6 +24,8 @@ = import org.jboss.portal.portlet.spi.ActionContext; import org.jboss.portal.portlet.spi.RequestContext; +import org.jboss.portal.portlet.StateString; +import org.jboss.portal.common.util.ParameterMap; = /** * @author Julien Viet @@ -38,6 +40,12 @@ /** The request context. */ protected RequestContext requestContext; = + /** . */ + protected StateString interactionState; + + /** . */ + protected ParameterMap form; + public ActionInvocation(ActionContext ctx) throws IllegalArgumentExcept= ion { super(ctx); @@ -46,6 +54,26 @@ this.ctx =3D ctx; } = + public StateString getInteractionState() + { + return interactionState; + } + + public void setInteractionState(StateString interactionState) + { + this.interactionState =3D interactionState; + } + + public ParameterMap getForm() + { + return form; + } + + public void setForm(ParameterMap form) + { + this.form =3D form; + } + public ActionContext getContext() { return ctx; Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/invocation/EventInvocation.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/EventInvocation.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/EventInvocation.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -24,6 +24,9 @@ = import org.jboss.portal.portlet.spi.EventContext; = +import javax.xml.namespace.QName; +import java.io.Serializable; + /** * @author Julien Viet * @version $Revision: 630 $ @@ -34,6 +37,12 @@ /** . */ private final EventContext ctx; = + /** . */ + private QName name; + + /** . */ + private Serializable payload; + public EventInvocation(EventContext ctx) throws IllegalArgumentException { super(ctx); @@ -46,4 +55,24 @@ { return ctx; } + + public QName getName() + { + return name; + } + + public void setName(QName name) + { + this.name =3D name; + } + + public Serializable getPayload() + { + return payload; + } + + public void setPayload(Serializable payload) + { + this.payload =3D payload; + } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/invocation/PortletInvocation.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/PortletInvocation.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/PortletInvocation.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -24,6 +24,7 @@ = import org.jboss.portal.common.invocation.Invocation; import org.jboss.portal.common.invocation.Scope; +import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.portlet.spi.InstanceContext; import org.jboss.portal.portlet.spi.PortalContext; import org.jboss.portal.portlet.spi.PortletInvocationContext; @@ -33,6 +34,9 @@ import org.jboss.portal.portlet.spi.WindowContext; import org.jboss.portal.portlet.spi.ClientContext; import org.jboss.portal.portlet.PortletContext; +import org.jboss.portal.portlet.StateString; +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; = import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -61,9 +65,24 @@ /** The response properties. */ public static final Scope RESPONSE_PROPERTIES_SCOPE =3D new Scope("resp= onse_properties"); = + /** . */ + protected StateString navigationalState; + + /** . */ + protected ParameterMap publicNavigationalState; + + /** . */ + protected Mode mode; + + /** . */ + protected WindowState windowState; + /** The target portlet. */ protected PortletContext target; = + /** The invocation context. */ + protected PortletInvocationContext ctx; + /** The portal context. */ protected PortalContext portalContext; = @@ -91,9 +110,6 @@ /** The dispatched response. */ protected HttpServletResponse dresp; = - /** The invocation context. */ - protected PortletInvocationContext ctx; - /** * Create an invocation to a portlet. * @@ -166,6 +182,46 @@ this.dreq =3D dreq; } = + public StateString getNavigationalState() + { + return navigationalState; + } + + public void setNavigationalState(StateString navigationalState) + { + this.navigationalState =3D navigationalState; + } + + public ParameterMap getPublicNavigationalState() + { + return publicNavigationalState; + } + + public void setPublicNavigationalState(ParameterMap publicNavigationalS= tate) + { + this.publicNavigationalState =3D publicNavigationalState; + } + + public Mode getMode() + { + return mode; + } + + public void setMode(Mode mode) + { + this.mode =3D mode; + } + + public WindowState getWindowState() + { + return windowState; + } + + public void setWindowState(WindowState windowState) + { + this.windowState =3D windowState; + } + public PortalContext getPortalContext() { return portalContext; Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/invocation/ResourceInvocation.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/ResourceInvocation.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/ResourceInvocation.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -24,6 +24,9 @@ = import org.jboss.portal.portlet.spi.ResourceInvocationContext; import org.jboss.portal.portlet.spi.RequestContext; +import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.cache.CacheLevel; +import org.jboss.portal.common.util.ParameterMap; = /** * @author Julien Viet @@ -41,6 +44,18 @@ /** . */ private String validationToken; = + /** . */ + private String resourceId; + + /** . */ + private StateString resourceState; + + /** . */ + private ParameterMap form; + + /** . */ + private CacheLevel cacheLevel; + public ResourceInvocation(ResourceInvocationContext ctx) throws Illegal= ArgumentException { super(ctx); @@ -64,6 +79,46 @@ this.validationToken =3D validationToken; } = + public String getResourceId() + { + return resourceId; + } + + public void setResourceId(String resourceId) + { + this.resourceId =3D resourceId; + } + + public StateString getResourceState() + { + return resourceState; + } + + public void setResourceState(StateString resourceState) + { + this.resourceState =3D resourceState; + } + + public ParameterMap getForm() + { + return form; + } + + public void setForm(ParameterMap form) + { + this.form =3D form; + } + + public CacheLevel getCacheLevel() + { + return cacheLevel; + } + + public void setCacheLevel(CacheLevel cacheLevel) + { + this.cacheLevel =3D cacheLevel; + } + public RequestContext getRequestContext() { return requestContext; Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/spi/ActionContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sp= i/ActionContext.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sp= i/ActionContext.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -22,9 +22,6 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.spi; = -import org.jboss.portal.portlet.StateString; -import org.jboss.portal.common.util.ParameterMap; - /** * Extends the generic invocation context to provide action invocation spe= cific input/services. * @@ -33,17 +30,4 @@ */ public interface ActionContext extends PortletInvocationContext { - /** - * Returns the interaction state of the request. - * - * @return the interaction state - */ - StateString getInteractionState(); - - /** - * Returns the form parameters of the request or null if no form could = be decoded by the caller. - * - * @return the request form - */ - ParameterMap getForm(); } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/spi/EventContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sp= i/EventContext.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sp= i/EventContext.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -22,18 +22,10 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.spi; = -import javax.xml.namespace.QName; -import java.io.Serializable; - /** * @author Julien Viet * @version $Revision: 630 $ */ public interface EventContext extends PortletInvocationContext { - - QName getName(); - - Serializable getPayload(); - } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/spi/PortletInvocationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sp= i/PortletInvocationContext.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sp= i/PortletInvocationContext.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -38,35 +38,8 @@ */ public interface PortletInvocationContext extends InvocationContext { - /** - * Returns the navigational state provided to the portlet. - * - * @return the navigational state - */ - StateString getNavigationalState(); = /** - * Returns the public navigational state provided to the portlet. - * - * @return the public navigational state - */ - ParameterMap getPublicNavigationalState(); - - /** - * Returns the mode provided to the portlet. - * - * @return the mode - */ - Mode getMode(); - - /** - * Returns the window state provided to the portlet. - * - * @return the window state - */ - WindowState getWindowState(); - - /** * Return information about the underlying http wire this invocation is= performed. * * @return the stream info Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/spi/ResourceInvocationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sp= i/ResourceInvocationContext.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sp= i/ResourceInvocationContext.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -22,42 +22,10 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.spi; = -import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.cache.CacheLevel; -import org.jboss.portal.common.util.ParameterMap; - /** * @author Julien Viet * @version $Revision: 630 $ */ public interface ResourceInvocationContext extends PortletInvocationContext { - - /** - * Returns the resource id. It may be a null value. - * - * @return the resource id - */ - String getResourceId(); - - /** - * Returns the resource state of the request. - * - * @return the resource state - */ - StateString getResourceState(); - - /** - * Returns the form parameters of the request or null if no form could = be decoded by the caller. - * - * @return the request form - */ - ParameterMap getForm(); - - /** - * Returns the cache level. - * - * @return the cache level - */ - CacheLevel getCacheLevel(); } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/support/spi/ActionContextSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/su= pport/spi/ActionContextSupport.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/su= pport/spi/ActionContextSupport.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -22,53 +22,12 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.support.spi; = -import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.spi.ActionContext; -import org.jboss.portal.common.util.ParameterMap; = -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; - /** * @author Julien Viet * @version $Revision: 5976 $ */ public class ActionContextSupport extends PortletInvocationContextSupport = implements ActionContext { - - public String getCharacterEncoding() - { - throw new UnsupportedOperationException(); - } - - public int getContentLength() - { - throw new UnsupportedOperationException(); - } - - public BufferedReader getReader() throws IOException - { - throw new UnsupportedOperationException(); - } - - public InputStream getInputStream() throws IOException - { - throw new UnsupportedOperationException(); - } - - public String getContentType() - { - throw new UnsupportedOperationException(); - } - - public StateString getInteractionState() - { - throw new UnsupportedOperationException(); - } - - public ParameterMap getForm() - { - throw new UnsupportedOperationException(); - } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/support/spi/PortletInvocationContextSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/su= pport/spi/PortletInvocationContextSupport.java 2008-02-03 17:17:14 UTC (rev= 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/su= pport/spi/PortletInvocationContextSupport.java 2008-02-04 01:27:57 UTC (rev= 9724) @@ -38,26 +38,6 @@ public class PortletInvocationContextSupport extends AbstractInvocationCon= text implements PortletInvocationContext { = - public StateString getNavigationalState() - { - throw new UnsupportedOperationException(); - } - - public Mode getMode() - { - throw new UnsupportedOperationException(); - } - - public WindowState getWindowState() - { - throw new UnsupportedOperationException(); - } - - public ParameterMap getPublicNavigationalState() - { - throw new UnsupportedOperationException(); - } - public MarkupInfo getMarkupInfo() { throw new UnsupportedOperationException(); Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/support/spi/RenderContextSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/su= pport/spi/RenderContextSupport.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/su= pport/spi/RenderContextSupport.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -30,5 +30,4 @@ */ public class RenderContextSupport extends PortletInvocationContextSupport = implements RenderContext { - } Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter1.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter1.java 2008-02-03 17= :17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter1.java 2008-02-04 01= :27:57 UTC (rev 9724) @@ -43,13 +43,17 @@ import javax.portlet.ResourceResponse; import javax.portlet.filter.FilterChain; import javax.portlet.filter.RenderFilter; +import javax.portlet.filter.ResourceFilter; +import javax.portlet.filter.ActionFilter; +import javax.portlet.filter.EventFilter; import java.io.IOException; = /** * @author Julien Viet * @version $Revision: 630 $ */ -public class PropagateDoFilterArgsFilter1 extends AbstractPortletFilter im= plements RenderFilter +public class PropagateDoFilterArgsFilter1 extends AbstractPortletFilter + implements RenderFilter, ResourceFilter, ActionFilter, EventFilter { = /** . */ Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter2.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter2.java 2008-02-03 17= :17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter2.java 2008-02-04 01= :27:57 UTC (rev 9724) @@ -44,13 +44,17 @@ import javax.portlet.EventRequest; import javax.portlet.filter.FilterChain; import javax.portlet.filter.RenderFilter; +import javax.portlet.filter.ResourceFilter; +import javax.portlet.filter.ActionFilter; +import javax.portlet.filter.EventFilter; import java.io.IOException; = /** * @author Julien Viet * @version $Revision: 630 $ */ -public class PropagateDoFilterArgsFilter2 extends AbstractPortletFilter im= plements RenderFilter +public class PropagateDoFilterArgsFilter2 extends AbstractPortletFilter + implements RenderFilter, ResourceFilter, ActionFilter, EventFilter { = /** . */ Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/state/ActionContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/state/ActionContextImpl.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/state/ActionContextImpl.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -22,7 +22,6 @@ *************************************************************************= *****/ package org.jboss.portal.test.portlet.state; = -import org.jboss.portal.Mode; import org.jboss.portal.common.invocation.resolver.MapAttributeResolver; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.support.spi.ActionContextSupport; @@ -33,26 +32,9 @@ */ public class ActionContextImpl extends ActionContextSupport { - - /** . */ - private final Mode mode; - - public ActionContextImpl(Mode mode) + public ActionContextImpl() { - this.mode =3D mode; - - // addResolver(PortletInvocation.REQUEST_SCOPE, new MapAttributeResolve= r()); addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeReso= lver()); } - - public ActionContextImpl() - { - this(Mode.EDIT); - } - - public Mode getMode() - { - return mode; - } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/ResourceTestContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= ResourceTestContext.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= ResourceTestContext.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -22,15 +22,10 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test; = -import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.ContainerURL; -import org.jboss.portal.portlet.cache.CacheLevel; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.impl.spi.AbstractResourceContext; -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; import org.jboss.portal.common.util.MarkupInfo; -import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResol= ver; import org.jboss.portal.common.invocation.resolver.MapAttributeResolver; = @@ -47,28 +42,9 @@ /** . */ private final PortletURLRenderer urlRenderer; = - public ResourceTestContext( - String resourceId, - CacheLevel resourceCacheLevel, - PortletURLRenderer urlRenderer, - Mode mode, - WindowState windowState, - StateString navigationalState, - ParameterMap publicNavigationalState, - StateString resourceState, - ParameterMap form, - MarkupInfo markupInfo) + public ResourceTestContext(PortletURLRenderer urlRenderer, MarkupInfo m= arkupInfo) { - super( - resourceId, - resourceCacheLevel, - mode, - windowState, - navigationalState, - publicNavigationalState, - resourceState, - form, - markupInfo); + super(markupInfo); = // this.urlRenderer =3D urlRenderer; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/TestActionContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= TestActionContext.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= TestActionContext.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -22,14 +22,10 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test; = -import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.ContainerURL; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.impl.spi.AbstractActionContext; -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; import org.jboss.portal.common.util.MarkupInfo; -import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResol= ver; import org.jboss.portal.common.invocation.resolver.MapAttributeResolver; = @@ -46,17 +42,9 @@ /** . */ private final PortletURLRenderer urlRenderer; = - public TestActionContext( - PortletURLRenderer urlRenderer, - Mode mode, - WindowState windowState, - StateString navigationalState, - ParameterMap publicNavigationalState, - MarkupInfo markupInfo, - StateString interactionState, - ParameterMap form) + public TestActionContext(PortletURLRenderer urlRenderer, MarkupInfo mar= kupInfo) { - super(mode, windowState, navigationalState, publicNavigationalState,= markupInfo, interactionState, form); + super(markupInfo); = // this.urlRenderer =3D urlRenderer; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/TestEventContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= TestEventContext.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= TestEventContext.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -48,17 +48,9 @@ /** . */ private final PortletURLRenderer urlRenderer; = - public TestEventContext( - PortletURLRenderer urlRenderer, - Mode mode, - WindowState windowState, - StateString navigationalState, - ParameterMap publicNavigationalState, - MarkupInfo markupInfo, - QName name, - Serializable payload) + public TestEventContext(PortletURLRenderer urlRenderer, MarkupInfo mark= upInfo) { - super(mode, windowState, navigationalState, publicNavigationalState,= markupInfo, name, payload); + super(markupInfo); = // this.urlRenderer =3D urlRenderer; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/TestRenderContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= TestRenderContext.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= TestRenderContext.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -22,14 +22,10 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test; = -import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.ContainerURL; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.impl.spi.AbstractRenderContext; -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; import org.jboss.portal.common.util.MarkupInfo; -import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResol= ver; import org.jboss.portal.common.invocation.resolver.MapAttributeResolver; = @@ -46,15 +42,9 @@ /** . */ private final PortletURLRenderer urlRenderer; = - public TestRenderContext( - PortletURLRenderer urlRenderer, - Mode mode, - WindowState windowState, - StateString navigationalState, - ParameterMap publicNavigationalState, - MarkupInfo markupInfo) + public TestRenderContext(PortletURLRenderer urlRenderer, MarkupInfo mar= kupInfo) { - super(mode, windowState, navigationalState, publicNavigationalState,= markupInfo); + super(markupInfo); = // this.urlRenderer =3D urlRenderer; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletController.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletController.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletController.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -176,12 +176,18 @@ = // TestInstanceContext instanceContext =3D new TestInstanceContex= t(req, portlet.getContext(), false); - TestRenderContext renderContext =3D new TestRenderContext(rend= erer, mode, windowState, portletNS, publicNS, MARKUP_INFO); + TestRenderContext renderContext =3D new TestRenderContext(rend= erer, MARKUP_INFO); = // RenderInvocation render =3D new RenderInvocation(renderContext= ); = // + render.setMode(mode); + render.setWindowState(windowState); + render.setNavigationalState(portletNS); + render.setPublicNavigationalState(publicNS); + + // render.setClientContext(new AbstractClientContext(req, pagePro= perties.getCookies())); render.setServerContext(new AbstractServerContext(req, resp)); render.setInstanceContext(instanceContext); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletRequestHandler.java 2008-02-03 17:17:14 UTC (rev 9723) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletRequestHandler.java 2008-02-04 01:27:57 UTC (rev 9724) @@ -261,18 +261,18 @@ = // TestInstanceContext instanceContext =3D new TestInstanceContext(r= eq, portlet.getContext(), true); - TestActionContext actionContext =3D new TestActionContext( - renderer, - mode, - windowState, - portletActionRequest.windowNavigationalState.getPortletNavigat= ionalState(), - publicNS, - MARKUP_INFO, - portletActionRequest.interactionState, - portletActionRequest.bodyParameters !=3D null ? ParameterMap.c= lone(portletActionRequest.bodyParameters) : null); + TestActionContext actionContext =3D new TestActionContext(rendere= r, MARKUP_INFO); ActionInvocation actionInvocation =3D new ActionInvocation(action= Context); = // + actionInvocation.setMode(mode); + actionInvocation.setWindowState(windowState); + actionInvocation.setNavigationalState(portletActionRequest.window= NavigationalState.getPortletNavigationalState()); + actionInvocation.setPublicNavigationalState(publicNS); + actionInvocation.setInteractionState(portletActionRequest.interac= tionState); + actionInvocation.setForm(portletActionRequest.bodyParameters !=3D= null ? ParameterMap.clone(portletActionRequest.bodyParameters) : null); + + // actionInvocation.setClientContext(new AbstractClientContext(req)); actionInvocation.setServerContext(new AbstractServerContext(req, = resp)); actionInvocation.setInstanceContext(instanceContext); @@ -316,18 +316,18 @@ = // TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), true); - TestEventContext actionContext =3D new TestEventContext( - renderer, - windowNS.getMode(), - windowNS.getWindowState(), - windowNS.getPortletNavigationalState(), - publicNS, - MARKUP_INFO, - event.getName(), - event.getPayload()); + TestEventContext actionContext =3D new TestEventContext(renderer, MA= RKUP_INFO); EventInvocation eventInvocation =3D new EventInvocation(actionContex= t); = // + eventInvocation.setMode(windowNS.getMode()); + eventInvocation.setWindowState(windowNS.getWindowState()); + eventInvocation.setNavigationalState(windowNS.getPortletNavigational= State()); + eventInvocation.setPublicNavigationalState(publicNS); + eventInvocation.setName(event.getName()); + eventInvocation.setPayload(event.getPayload()); + + // eventInvocation.setClientContext(new AbstractClientContext(req, requ= estCookies)); eventInvocation.setServerContext(new AbstractServerContext(req, resp= )); eventInvocation.setInstanceContext(instanceContext); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletResourceRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletResourceRequestHandler.java 2008-02-03 17:17:14 UTC (rev = 9723) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletResourceRequestHandler.java 2008-02-04 01:27:57 UTC (rev = 9724) @@ -196,18 +196,18 @@ = // TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), true); - ResourceInvocationContext resourceInvocationContext =3D new Resource= TestContext( - portletResourceRequest.resourceId, - cacheability, - renderer, - mode, - windowState, - portletNS, - publicNS, - portletResourceRequest.resourceState, - portletResourceRequest.bodyParameters !=3D null ? ParameterMap.cl= one(portletResourceRequest.bodyParameters) : null, - MARKUP_INFO); + ResourceInvocationContext resourceInvocationContext =3D new Resource= TestContext(renderer, MARKUP_INFO); ResourceInvocation resourceInvocation =3D new ResourceInvocation(res= ourceInvocationContext); + = + // + resourceInvocation.setResourceId(portletResourceRequest.resourceId); + resourceInvocation.setCacheLevel(cacheability); + resourceInvocation.setMode(mode); + resourceInvocation.setWindowState(windowState); + resourceInvocation.setNavigationalState(portletNS); + resourceInvocation.setPublicNavigationalState(publicNS); + resourceInvocation.setResourceState(portletResourceRequest.resourceS= tate); + resourceInvocation.setForm(portletResourceRequest.bodyParameters != =3D null ? ParameterMap.clone(portletResourceRequest.bodyParameters) : null= ); = // resourceInvocation.setClientContext(new AbstractClientContext(req)); --===============3881643090371934844==-- From portal-commits at lists.jboss.org Sun Feb 3 23:12:45 2008 Content-Type: multipart/mixed; boundary="===============2971084518968820121==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9725 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Sun, 03 Feb 2008 23:12:45 -0500 Message-ID: --===============2971084518968820121== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-03 23:12:45 -0500 (Sun, 03 Feb 2008) New Revision: 9725 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installa= tion.xml Log: updating 2.3.4. Database Setup 2.3.5. Datasource Configuration Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/i= nstallation.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-04 01:27:57 UTC (rev 9724) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-04 04:12:45 UTC (rev 9725) @@ -377,67 +377,50 @@ - Setting up the database - - Database Setup - You will need a database for JBoss Portal to function, y= ou can use any database - supported by Hibernate. - - - - Create a new Database: - For example purposes we call this new database - jbossportal - - - - - Grant access rights for a = user to your database: - You must make sure the user has access to this new= DB, as JBoss Portal will need to create the - tables and modify data within them. - - - - - Deploy your JDBC connector= : - You must make available a JDBC connector for JBoss= Portal to communicate with your database. The - connector lib should be placed in - JBOSS_HOME/server/default/lib/* - - - - - - - DataSource Configuration - - You will need a valid datasource descriptor, for JBoss Port= al to communicate with your database. Having - obtained the sources and having set your JBOSS_HOME environ= ment variable ( - - ), you can now have the JBoss Portal build system generate = preconfigured datasources for you. - - - Navigate to - JBOSS_PORTAL_HOME_DIRECTORY/core - and type: - build datasource - - - - - - - - Once complete, the datasource build should produce the foll= owing directory and file structure: - - - - - - - At this point, you should configure the one that suits y= ou best with your Database and JDBC - driver. - Database Setup + + A database is required for JBoss Portal to run. JBoss EAP and JBoss = AS include an embedded Hypersonic SQL database that JBoss Portal can use; h= owever, this is only recommended for developer use. The following databases= are recommended for production use, and have had test suites run against t= hem: MySQL 4, MySQL 5, Microsoft SQL Server, PostgreSQL 8, Oracle 9, and Or= acle 10. JBoss Portal can use any database that is supported by Hibernate. + + + To configure a database to use with JBoss Portal: + + + + + + Create a new database: this gu= ide assumes that the new database will be called jbossportal. + + + + + Grant access rights for a user to the jbossportal database: JBoss Portal needs to cr= eate tables and modify table data. Grant access rights to a desired user to= the jbossportal database. Configure the same username= and password in the Datasource descriptor. + + + + + Deploy a RDBMS JDBC connector:= a RDBMS JDBC connector is required for JBoss Portal to communicate with a = database. Copy the connector into the JBOSS_INSTALL_DIRECTORY/ser= ver/default/lib/ directory. For example, a RDBMS JDBC connector = for MySQL can be download from . For the correct RDMBS JDBC connector, please refer = to the database documentation. + + + + + + + Datasource Configuration + + The JBoss Portal binary download that was extracted in , contains pre-configured Datasource descripto= rs for the more popular databases. Datasource descriptors are provided for = the MySQL 4, MySQL 5, PostgreSQL, Microsoft SQL Server, and Oracle database= s, and can be found in the setup subdirectory where th= e JBoss Portal binary was extracted to: + + + + + + + + Copy the Datasource descriptor that matches your database into the JBOSS_INSTALLATION_DIRECTORY/server/configuration/deploy/ directory, where configuration is either all, default, minimal, or production. For example, if = you are using the production configuration, copy the Datasource descriptor = into the JBOSS_INSTALLATION_DIRECTORY/server/production/deploy/ directory. + + + After the Datasource descriptor has been copied into the dep= loy directory, make sure the username, password, connection-url,= and driver-class are correct for your chosen database. Datasource descript= or files can be deployed to test before being used in production. The follo= wing is an example Datasource descriptor for the PostgreSQL database: + + @@ -448,18 +431,11 @@ portalpassword - ]]> - Please verify that the username, password, url, and driver-= class are correct for - your flavor of DB. - - - Now - copy - your datasource descriptor to - JBOSS_HOME/server/default/deploy - - - + ]]> + + For further details about Datasource descriptors, please refer to t= he JBoss JDBC Datasource wiki page. + + Starting and running JBoss Portal --===============2971084518968820121==-- From portal-commits at lists.jboss.org Sun Feb 3 23:44:30 2008 Content-Type: multipart/mixed; boundary="===============3382958380644343397==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9726 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Sun, 03 Feb 2008 23:44:30 -0500 Message-ID: --===============3382958380644343397== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-03 23:44:30 -0500 (Sun, 03 Feb 2008) New Revision: 9726 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installa= tion.xml Log: updating 2.4. Deploying JBoss Portal 2.5. Portal Modules Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/i= nstallation.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-04 04:12:45 UTC (rev 9725) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-04 04:44:30 UTC (rev 9726) @@ -436,37 +436,61 @@ For further details about Datasource descriptors, please refer to t= he JBoss JDBC Datasource wiki page. - - Starting and running JBoss Portal - - Start the Server: - Go to JBOSS_HOME/bin and execute run.bat (run.sh, if Linux) - During the first boot (ever), SQL errors in the log, lik= e the one below, can be safely ignored. They - are thrown when the portal checks for the existence of the = initial tables, before it creates them for - you. - - - - - Point your browser to - http://localhost:8080/portal - , and you should see the Portal HomePage. You can now login us= ing one of the two default accounts: - user/user - or - admin/admin - . - - This installs a bare version of Portal. In previous version= s, several additional modules were deployed as - well but this has since been modularized to provide greater= flexibility. You might want to deploy - additional modules to augment Portal (see - Portal's module list for more - information). You can also deploy all the modules all at on= ce using build deploy-all - in the build directory. - - - - + + + Deploying JBoss Portal + + To start JBoss EAP or JBoss AS and deploy JBoss Portal: + + + + + + Datasource descriptor: if yo= u have not done so already, change into the setup subd= irectory where the JBoss Portal binary was extracted to. Copy the correct D= atasource descriptor file (*-ds.xml) you modified in t= he previous steps into the JBOSS_INSTALLATION_DIRECTORY/server/configuration/deploy/ directory. + + + + + Start the server: change int= o the JBOSS_INSTALLATION_DIRECTORY/bin/ directory. On = Microsoft Windows, execute run.bat. On Linux, run the ./run.sh command. + + + + + Log in to JBoss Portal: usin= g a Web browser, navigate to http://localhost:8080/portal to open the JBoss Portal homepage. Log in using one of the = two default accounts: username user, password user, or username admin, password admin: + + + + + + + + + + + + + SQL Errors + + Tables are automatically created the first time JBoss Portal star= ts. When deployed for the first time, JBoss Portal checks for the existence= of the initial tables, which have not been created yet. This causes errors= such as the following, which can safely be ignored: + + + + + + + + Portal Modules + + The previous steps install a bare version of JBoss Portal. In previous v= ersions, several additional modules were deployed as well, but this has sin= ce been modularized to provide greater flexibility. To deploy additional mo= dules, see the Portal's module list for more information. To deploy al= l modules at once, change into the build directory and= run the build deploy-all command. + + - - - - - - - + --===============3382958380644343397==-- From portal-commits at lists.jboss.org Mon Feb 4 01:49:34 2008 Content-Type: multipart/mixed; boundary="===============3811248937717507028==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9727 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Mon, 04 Feb 2008 01:49:33 -0500 Message-ID: --===============3811248937717507028== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-04 01:49:33 -0500 (Mon, 04 Feb 2008) New Revision: 9727 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installa= tion.xml Log: minor corrections... 2.1. The JBoss Portal and JBoss AS Bundle Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/i= nstallation.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-04 04:44:30 UTC (rev 9726) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-04 06:49:33 UTC (rev 9727) @@ -5,7 +5,7 @@ JBoss Portal Downloads page. Clustered versions of JBoss Port= al must be deployed in the JBOSS_INSTALLATION_DIRECTORY/server/al= l/deploy/ directory. All JBoss AS instances must reference the s= ame datasource. See for details on how to co= nfigure JBoss Portal for clustering. - JBoss Portal and JBoss AS Bundle + The JBoss Portal and JBoss AS Bundle This is the easiest and fastest way to get JBoss Portal instal= led and running. The JBoss Portal and JBoss AS bundle contains JBoss AS, JB= oss Portal, and the embedded Hypersonic SQL database. To install the JBoss = Portal and JBoss AS bundle: @@ -22,7 +22,7 @@ - Start the server: change into = the JBOSS_INSTALLATION_DIRECTORY/bin/ directory. On Mi= crosoft Windows, execute run.bat. On Linux, run the ./run.sh command. + Start the server: change into = the JBOSS_PORTAL_INSTALLATION_DIRECTORY/bin/ directory= . On Microsoft Windows, execute run.bat. On Linux, run t= he ./run.sh command. @@ -163,8 +163,15 @@ - Log in to JBoss Portal: using a Web= browser, navigate to http://localhost:8080/portal to open the JBoss Portal homepage. Log in using one of the two def= ault accounts: username user, password user<= /emphasis>, or username admin, password admi= n. + Log in to JBoss Portal: using a Web= browser, navigate to http://localhost:8080/portal to open the JBoss Portal homepage. Log in using one of the two def= ault accounts: username user, password user<= /emphasis>, or username admin, password admi= n: + + + + + + + @@ -253,11 +260,17 @@ - Setting up the JBoss Application Server + JBoss EAP and JBoss AS Setup JBoss Application Server Setup Before deploying JBoss Portal, make sure you have JBoss EAP or = JBoss AS installed. Customers who have access to the JBoss Customer Support Portal (CSP) should download and install JBoss EAP 4.2. Customers who do not have= access to the JBoss CSP are advised to use JBoss AS. For JBoss AS installation instru= ctions, please refer to the JBoss AS Installation Guide. + + Use the JBoss EAP and JBoss AS zip file + + Only use the JBoss EAP and JBoss AS zip file versions. DO NOT ATTEMPT to deploy JBoss Portal on the installer version = of JBoss EAP or JBoss AS. We are currently working on aligning t= he Application installer with JBoss Portal. + + Operating System Environment Settings @@ -337,11 +350,21 @@ At the end of the build process, the jboss-portal.sar file is copied into the JBOSS_HOME/server/default/deploy/ directory: + + + + + Portal Modules + + The previous steps install a bare version of JBoss Portal. In previous v= ersions, several additional modules were deployed as well, but this has sin= ce been modularized to provide greater flexibility. To deploy additional mo= dules, see the Portal's module list for more information. To deploy al= l modules at once, change into the build directory. If= you are running Linux, run the ./build.sh deploy-all co= mmand. If you are running Microsoft Windows, run the build.bat dep= loy-all command. + = + + To build the clustered version on Linux Operating Systems: @@ -485,12 +508,7 @@ - - Portal Modules - - The previous steps install a bare version of JBoss Portal. In previous v= ersions, several additional modules were deployed as well, but this has sin= ce been modularized to provide greater flexibility. To deploy additional mo= dules, see the Portal's module list for more information. To deploy al= l modules at once, change into the build directory and= run the build deploy-all command. - - + = - - + + = Modified: modules/portlet/tags/JBP_PORTLET_1_0_2/build/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/tags/JBP_PORTLET_1_0_2/build/build.xml 2008-02-04 08:47= :23 UTC (rev 9729) +++ modules/portlet/tags/JBP_PORTLET_1_0_2/build/build.xml 2008-02-04 10:14= :08 UTC (rev 9730) @@ -61,7 +61,7 @@ = - + = Added: modules/portlet/tags/JBP_PORTLET_1_0_2/build/local.properties =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/tags/JBP_PORTLET_1_0_2/build/local.properties = (rev 0) +++ modules/portlet/tags/JBP_PORTLET_1_0_2/build/local.properties 2008-02-0= 4 10:14:08 UTC (rev 9730) @@ -0,0 +1,48 @@ +### =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ### +## = ## +## Local project properties. = ## +## = ## +## Define properties that are local to your environment here. This = ## +## file (local.properties) should not be checked in. Modify the = ## +## example to affect all users. = ## +## = ## +### =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ### + +### General compiler configuration ### + +#build.compiler=3Djikes +#build.warnings=3Dtrue +#build.pedantic=3Dtrue +#javac.depend=3Don + +### Javac/Jikes compiler configuration ### + +javac.optimize=3Doff +javac.debug=3Don +javac.deprecation=3Don + +### Enable verbose build output ### + +#init.verbose=3Dtrue + +### JavaDoc ### +#docs-javadocs.disable=3Dtrue + +### Do we build xdoclet or get it from thirdparty ### +### uncomment for thirdparty: comment to use xdoclet module. +### To use xdoclet module also uncomment the xdoclet line in groups in bui= ld/build.xml +#xdoclet.xdoclet.root=3D${project.root}/thirdparty/xdoclet + +# Portal database, for now : hsqldb, mysql, postgresql are the possible va= lues +portal.database=3Dmysql +# The datasource name used in the JNDI binding +portal.datasource.name=3DPortalDS +# Context root for the portal main servlet +portal.web.context-root=3D/portal +# JBoss server/ directory for JBoss Portal, ie: $JBOSS_HOME/server/de= fault +portal.deploy.dir=3Ddefault/deploy +portal-ha.deploy.dir=3Dall/deploy +# Show SQL or not +portal.sql.show=3Dfalse +# Uncomment if you want to use a specific JBoss home path otherwise the bu= ild will use the JBOSS_HOME env variable +#jboss.home=3D Modified: modules/portlet/tags/JBP_PORTLET_1_0_2/test/src/main/org/jboss/po= rtal/portlet/test/PortletApplicationDeployment.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/tags/JBP_PORTLET_1_0_2/test/src/main/org/jboss/portal/p= ortlet/test/PortletApplicationDeployment.java 2008-02-04 08:47:23 UTC (rev = 9729) +++ modules/portlet/tags/JBP_PORTLET_1_0_2/test/src/main/org/jboss/portal/p= ortlet/test/PortletApplicationDeployment.java 2008-02-04 10:14:08 UTC (rev = 9730) @@ -45,7 +45,9 @@ import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.AbstractInstallMetaData; import org.jboss.beans.metadata.plugins.ThisValueMetaData; +import org.jboss.beans.metadata.spi.InstallMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; +import org.jboss.beans.metadata.spi.PropertyMetaData; import org.apache.log4j.Logger; = import javax.servlet.ServletContext; @@ -53,6 +55,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.Collections; +import java.util.Set; = /** * @author Julien Viet @@ -110,23 +113,23 @@ bmd.setConstructor(ctormd); bmd.setStart(new AbstractLifecycleMetaData("start")); bmd.setStop(new AbstractLifecycleMetaData("stop")); - bmd.setProperties(Collections.singleton(new AbstractPropertyMetaD= ata("application", new AbstractDependencyValueMetaData(id)))); + bmd.setProperties(Collections.singleton((PropertyMetaData)new Abs= tractPropertyMetaData("application", new AbstractDependencyValueMetaData(id= )))); AbstractInstallMetaData deployerinstallmd =3D new AbstractInstall= MetaData(); deployerinstallmd.setBean("PortletApplicationDeployer"); - deployerinstallmd.setParameters(Collections.singletonList(new Abs= tractParameterMetaData(new ThisValueMetaData()))); + deployerinstallmd.setParameters(Collections.singletonList((Parame= terMetaData)new AbstractParameterMetaData(new ThisValueMetaData()))); deployerinstallmd.setMethodName("installPortletContainer"); AbstractInstallMetaData applicationinstallmd =3D new AbstractInst= allMetaData(); applicationinstallmd.setBean(id); - applicationinstallmd.setParameters(Collections.singletonList(new = AbstractParameterMetaData(new ThisValueMetaData()))); + applicationinstallmd.setParameters(Collections.singletonList((Par= ameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData()))); applicationinstallmd.setMethodName("addContainer"); bmd.setInstalls((List)CollectionBuilder.arrayList().add(deployeri= nstallmd).add(applicationinstallmd).get()); AbstractInstallMetaData deployeruninstallmd =3D new AbstractInsta= llMetaData(); deployeruninstallmd.setBean("PortletApplicationDeployer"); - deployeruninstallmd.setParameters(Collections.singletonList(new A= bstractParameterMetaData(new ThisValueMetaData()))); + deployeruninstallmd.setParameters(Collections.singletonList((Para= meterMetaData)new AbstractParameterMetaData(new ThisValueMetaData()))); deployeruninstallmd.setMethodName("uninstallPortletContainer"); AbstractInstallMetaData applicationuninstallmd =3D new AbstractIn= stallMetaData(); applicationuninstallmd.setBean(id); - applicationuninstallmd.setParameters(Collections.singletonList(ne= w AbstractParameterMetaData(new ThisValueMetaData()))); + applicationuninstallmd.setParameters(Collections.singletonList((P= arameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData()))); applicationuninstallmd.setMethodName("removeContainer"); bmd.setUninstalls((List)CollectionBuilder.arrayList().add(deploye= runinstallmd).add(applicationuninstallmd).get()); try @@ -155,14 +158,14 @@ bmd.setStop(new AbstractLifecycleMetaData("stop")); AbstractInstallMetaData installmd =3D new AbstractInstallMetaData(); installmd.setBean("PortletApplicationDeployer"); - installmd.setParameters(Collections.singletonList(new AbstractParame= terMetaData(new ThisValueMetaData()))); + installmd.setParameters(Collections.singletonList((ParameterMetaData= )new AbstractParameterMetaData(new ThisValueMetaData()))); installmd.setMethodName("installPortletApplication"); - bmd.setInstalls(Collections.singletonList(installmd)); + bmd.setInstalls(Collections.singletonList((InstallMetaData)installmd= )); AbstractInstallMetaData uninstallmd =3D new AbstractInstallMetaData(= ); uninstallmd.setBean("PortletApplicationDeployer"); - uninstallmd.setParameters(Collections.singletonList(new AbstractPara= meterMetaData(new ThisValueMetaData()))); + uninstallmd.setParameters(Collections.singletonList((ParameterMetaDa= ta)new AbstractParameterMetaData(new ThisValueMetaData()))); uninstallmd.setMethodName("uninstallPortletApplication"); - bmd.setUninstalls(Collections.singletonList(uninstallmd)); + bmd.setUninstalls(Collections.singletonList((InstallMetaData)uninsta= llmd)); = // try --===============9071912585791434039==-- From portal-commits at lists.jboss.org Mon Feb 4 05:25:04 2008 Content-Type: multipart/mixed; boundary="===============0776277070087799473==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9731 - modules/portlet/tags/JBP_PORTLET_1_0_2/build. Date: Mon, 04 Feb 2008 05:25:04 -0500 Message-ID: --===============0776277070087799473== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-04 05:25:04 -0500 (Mon, 04 Feb 2008) New Revision: 9731 Removed: modules/portlet/tags/JBP_PORTLET_1_0_2/build/local.properties Log: Delete Deleted: modules/portlet/tags/JBP_PORTLET_1_0_2/build/local.properties =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/tags/JBP_PORTLET_1_0_2/build/local.properties 2008-02-0= 4 10:14:08 UTC (rev 9730) +++ modules/portlet/tags/JBP_PORTLET_1_0_2/build/local.properties 2008-02-0= 4 10:25:04 UTC (rev 9731) @@ -1,48 +0,0 @@ -### =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ### -## = ## -## Local project properties. = ## -## = ## -## Define properties that are local to your environment here. This = ## -## file (local.properties) should not be checked in. Modify the = ## -## example to affect all users. = ## -## = ## -### =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ### - -### General compiler configuration ### - -#build.compiler=3Djikes -#build.warnings=3Dtrue -#build.pedantic=3Dtrue -#javac.depend=3Don - -### Javac/Jikes compiler configuration ### - -javac.optimize=3Doff -javac.debug=3Don -javac.deprecation=3Don - -### Enable verbose build output ### - -#init.verbose=3Dtrue - -### JavaDoc ### -#docs-javadocs.disable=3Dtrue - -### Do we build xdoclet or get it from thirdparty ### -### uncomment for thirdparty: comment to use xdoclet module. -### To use xdoclet module also uncomment the xdoclet line in groups in bui= ld/build.xml -#xdoclet.xdoclet.root=3D${project.root}/thirdparty/xdoclet - -# Portal database, for now : hsqldb, mysql, postgresql are the possible va= lues -portal.database=3Dmysql -# The datasource name used in the JNDI binding -portal.datasource.name=3DPortalDS -# Context root for the portal main servlet -portal.web.context-root=3D/portal -# JBoss server/ directory for JBoss Portal, ie: $JBOSS_HOME/server/de= fault -portal.deploy.dir=3Ddefault/deploy -portal-ha.deploy.dir=3Dall/deploy -# Show SQL or not -portal.sql.show=3Dfalse -# Uncomment if you want to use a specific JBoss home path otherwise the bu= ild will use the JBOSS_HOME env variable -#jboss.home=3D --===============0776277070087799473==-- From portal-commits at lists.jboss.org Mon Feb 4 05:27:13 2008 Content-Type: multipart/mixed; boundary="===============8481288772847223117==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9732 - in modules/portlet/branches/JBP_PORTLET_BRANCH_1_0: .settings and 2 other directories. Date: Mon, 04 Feb 2008 05:27:13 -0500 Message-ID: --===============8481288772847223117== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-04 05:27:12 -0500 (Mon, 04 Feb 2008) New Revision: 9732 Added: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/.settings/org.eclipse.jd= t.ui.prefs Removed: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/.settings/org.eclipse.jd= t.core.prefs Modified: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/.classpath modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build/build-thirdparty.x= ml modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build/build.xml modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/test/src/main/org/jboss/= portal/portlet/test/PortletApplicationDeployment.java Log: Fix build Modified: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/.classpath =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/.classpath 2008-02-04 1= 0:25:04 UTC (rev 9731) +++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/.classpath 2008-02-04 1= 0:27:12 UTC (rev 9732) @@ -22,5 +22,6 @@ + Deleted: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/.settings/org.ecli= pse.jdt.core.prefs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/.settings/org.eclipse.j= dt.core.prefs 2008-02-04 10:25:04 UTC (rev 9731) +++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/.settings/org.eclipse.j= dt.core.prefs 2008-02-04 10:27:12 UTC (rev 9732) @@ -1,12 +0,0 @@ -#Wed Sep 12 11:19:13 CEST 2007 -eclipse.preferences.version=3D1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=3Ddisabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=3D1.2 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=3Dpreserve -org.eclipse.jdt.core.compiler.compliance=3D1.4 -org.eclipse.jdt.core.compiler.debug.lineNumber=3Dgenerate -org.eclipse.jdt.core.compiler.debug.localVariable=3Dgenerate -org.eclipse.jdt.core.compiler.debug.sourceFile=3Dgenerate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=3Dwarning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=3Dwarning -org.eclipse.jdt.core.compiler.source=3D1.3 Added: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/.settings/org.eclips= e.jdt.ui.prefs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/.settings/org.eclipse.j= dt.ui.prefs (rev 0) +++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/.settings/org.eclipse.j= dt.ui.prefs 2008-02-04 10:27:12 UTC (rev 9732) @@ -0,0 +1,3 @@ +#Mon Feb 04 10:02:33 CET 2008 +eclipse.preferences.version=3D1 +internal.default.compliance=3Ddefault Modified: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build/build-third= party.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build/build-thirdparty.= xml 2008-02-04 10:25:04 UTC (rev 9731) +++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build/build-thirdparty.= xml 2008-02-04 10:27:12 UTC (rev 9732) @@ -47,8 +47,8 @@ --> = - - + + = Modified: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build/build.xml 2008-02= -04 10:25:04 UTC (rev 9731) +++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build/build.xml 2008-02= -04 10:27:12 UTC (rev 9732) @@ -61,8 +61,8 @@ = - - + + = Modified: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/test/src/main/org= /jboss/portal/portlet/test/PortletApplicationDeployment.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/test/src/main/org/jboss= /portal/portlet/test/PortletApplicationDeployment.java 2008-02-04 10:25:04 = UTC (rev 9731) +++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/test/src/main/org/jboss= /portal/portlet/test/PortletApplicationDeployment.java 2008-02-04 10:27:12 = UTC (rev 9732) @@ -45,7 +45,9 @@ import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.AbstractInstallMetaData; import org.jboss.beans.metadata.plugins.ThisValueMetaData; +import org.jboss.beans.metadata.spi.InstallMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; +import org.jboss.beans.metadata.spi.PropertyMetaData; import org.apache.log4j.Logger; = import javax.servlet.ServletContext; @@ -53,6 +55,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.Collections; +import java.util.Set; = /** * @author Julien Viet @@ -110,23 +113,23 @@ bmd.setConstructor(ctormd); bmd.setStart(new AbstractLifecycleMetaData("start")); bmd.setStop(new AbstractLifecycleMetaData("stop")); - bmd.setProperties(Collections.singleton(new AbstractPropertyMetaD= ata("application", new AbstractDependencyValueMetaData(id)))); + bmd.setProperties(Collections.singleton((PropertyMetaData)new Abs= tractPropertyMetaData("application", new AbstractDependencyValueMetaData(id= )))); AbstractInstallMetaData deployerinstallmd =3D new AbstractInstall= MetaData(); deployerinstallmd.setBean("PortletApplicationDeployer"); - deployerinstallmd.setParameters(Collections.singletonList(new Abs= tractParameterMetaData(new ThisValueMetaData()))); + deployerinstallmd.setParameters(Collections.singletonList((Parame= terMetaData)new AbstractParameterMetaData(new ThisValueMetaData()))); deployerinstallmd.setMethodName("installPortletContainer"); AbstractInstallMetaData applicationinstallmd =3D new AbstractInst= allMetaData(); applicationinstallmd.setBean(id); - applicationinstallmd.setParameters(Collections.singletonList(new = AbstractParameterMetaData(new ThisValueMetaData()))); + applicationinstallmd.setParameters(Collections.singletonList((Par= ameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData()))); applicationinstallmd.setMethodName("addContainer"); bmd.setInstalls((List)CollectionBuilder.arrayList().add(deployeri= nstallmd).add(applicationinstallmd).get()); AbstractInstallMetaData deployeruninstallmd =3D new AbstractInsta= llMetaData(); deployeruninstallmd.setBean("PortletApplicationDeployer"); - deployeruninstallmd.setParameters(Collections.singletonList(new A= bstractParameterMetaData(new ThisValueMetaData()))); + deployeruninstallmd.setParameters(Collections.singletonList((Para= meterMetaData)new AbstractParameterMetaData(new ThisValueMetaData()))); deployeruninstallmd.setMethodName("uninstallPortletContainer"); AbstractInstallMetaData applicationuninstallmd =3D new AbstractIn= stallMetaData(); applicationuninstallmd.setBean(id); - applicationuninstallmd.setParameters(Collections.singletonList(ne= w AbstractParameterMetaData(new ThisValueMetaData()))); + applicationuninstallmd.setParameters(Collections.singletonList((P= arameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData()))); applicationuninstallmd.setMethodName("removeContainer"); bmd.setUninstalls((List)CollectionBuilder.arrayList().add(deploye= runinstallmd).add(applicationuninstallmd).get()); try @@ -155,14 +158,14 @@ bmd.setStop(new AbstractLifecycleMetaData("stop")); AbstractInstallMetaData installmd =3D new AbstractInstallMetaData(); installmd.setBean("PortletApplicationDeployer"); - installmd.setParameters(Collections.singletonList(new AbstractParame= terMetaData(new ThisValueMetaData()))); + installmd.setParameters(Collections.singletonList((ParameterMetaData= )new AbstractParameterMetaData(new ThisValueMetaData()))); installmd.setMethodName("installPortletApplication"); - bmd.setInstalls(Collections.singletonList(installmd)); + bmd.setInstalls(Collections.singletonList((InstallMetaData)installmd= )); AbstractInstallMetaData uninstallmd =3D new AbstractInstallMetaData(= ); uninstallmd.setBean("PortletApplicationDeployer"); - uninstallmd.setParameters(Collections.singletonList(new AbstractPara= meterMetaData(new ThisValueMetaData()))); + uninstallmd.setParameters(Collections.singletonList((ParameterMetaDa= ta)new AbstractParameterMetaData(new ThisValueMetaData()))); uninstallmd.setMethodName("uninstallPortletApplication"); - bmd.setUninstalls(Collections.singletonList(uninstallmd)); + bmd.setUninstalls(Collections.singletonList((InstallMetaData)uninsta= llmd)); = // try --===============8481288772847223117==-- From portal-commits at lists.jboss.org Mon Feb 4 05:31:46 2008 Content-Type: multipart/mixed; boundary="===============5396539699674079928==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9733 - modules/identity/tags. Date: Mon, 04 Feb 2008 05:31:45 -0500 Message-ID: --===============5396539699674079928== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-04 05:31:45 -0500 (Mon, 04 Feb 2008) New Revision: 9733 Added: modules/identity/tags/JBP_IDENTITY_1_0_2/ Log: Tagging identity 1.0.2 Copied: modules/identity/tags/JBP_IDENTITY_1_0_2 (from rev 9732, modules/id= entity/branches/JBP_IDENTITY_BRANCH_1_0) --===============5396539699674079928==-- From portal-commits at lists.jboss.org Mon Feb 4 05:44:53 2008 Content-Type: multipart/mixed; boundary="===============2655127473267756210==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9734 - in modules/identity/tags/JBP_IDENTITY_1_0_2: identity/src/main/org/jboss/portal/identity and 1 other directory. Date: Mon, 04 Feb 2008 05:44:53 -0500 Message-ID: --===============2655127473267756210== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-04 05:44:53 -0500 (Mon, 04 Feb 2008) New Revision: 9734 Removed: modules/identity/tags/JBP_IDENTITY_1_0_2/identity/src/main/org/jboss/por= tal/identity/config/ Modified: modules/identity/tags/JBP_IDENTITY_1_0_2/build/build-thirdparty.xml modules/identity/tags/JBP_IDENTITY_1_0_2/build/build.xml Log: Fix versions Modified: modules/identity/tags/JBP_IDENTITY_1_0_2/build/build-thirdparty.x= ml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/identity/tags/JBP_IDENTITY_1_0_2/build/build-thirdparty.xml 200= 8-02-04 10:31:45 UTC (rev 9733) +++ modules/identity/tags/JBP_IDENTITY_1_0_2/build/build-thirdparty.xml 200= 8-02-04 10:44:53 UTC (rev 9734) @@ -47,8 +47,8 @@ are pushed to the http://repository.jboss.com site. --> = - - + + = Modified: modules/identity/tags/JBP_IDENTITY_1_0_2/build/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/identity/tags/JBP_IDENTITY_1_0_2/build/build.xml 2008-02-04 10:= 31:45 UTC (rev 9733) +++ modules/identity/tags/JBP_IDENTITY_1_0_2/build/build.xml 2008-02-04 10:= 44:53 UTC (rev 9734) @@ -61,7 +61,7 @@ = - + = --===============2655127473267756210==-- From portal-commits at lists.jboss.org Mon Feb 4 05:48:41 2008 Content-Type: multipart/mixed; boundary="===============7484328678308455788==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9735 - in docs/branches/JBoss_Portal_Branch_2_6: readmeFiles and 3 other directories. Date: Mon, 04 Feb 2008 05:48:40 -0500 Message-ID: --===============7484328678308455788== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-04 05:48:40 -0500 (Mon, 04 Feb 2008) New Revision: 9735 Modified: docs/branches/JBoss_Portal_Branch_2_6/quickstartuser/en/master.xml docs/branches/JBoss_Portal_Branch_2_6/readmeFiles/jboss-portal-bin.README docs/branches/JBoss_Portal_Branch_2_6/readmeFiles/jboss-portal-ha-bin.RE= ADME docs/branches/JBoss_Portal_Branch_2_6/readmeFiles/jboss-portal-src.README docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/master.xml docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installa= tion.xml docs/branches/JBoss_Portal_Branch_2_6/userGuide/en/master.xml Log: 2.6.4 update Modified: docs/branches/JBoss_Portal_Branch_2_6/quickstartuser/en/master.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/quickstartuser/en/master.xml 2008= -02-04 10:44:53 UTC (rev 9734) +++ docs/branches/JBoss_Portal_Branch_2_6/quickstartuser/en/master.xml 2008= -02-04 10:48:40 UTC (rev 9735) @@ -11,9 +11,9 @@ ]> - JBoss Portal 2.6.3-SNAPSHOT + JBoss Portal 2.6.4 Quickstart User Guide - Release 2.6.3-SNAPSHOT + Release 2.6.4 = Kevin Modified: docs/branches/JBoss_Portal_Branch_2_6/readmeFiles/jboss-portal-bi= n.README =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/readmeFiles/jboss-portal-bin.READ= ME 2008-02-04 10:44:53 UTC (rev 9734) +++ docs/branches/JBoss_Portal_Branch_2_6/readmeFiles/jboss-portal-bin.READ= ME 2008-02-04 10:48:40 UTC (rev 9735) @@ -1,5 +1,5 @@ = - JBoss Portal 2.6.3-SNAPSHOT = + JBoss Portal 2.6.4 LGPL Licensed (See http://www.gnu.org/copyleft/lesser.html for details o= n the product usage) = JBoss Portal is the next generation open source content management syste= m (CMS) and portal Modified: docs/branches/JBoss_Portal_Branch_2_6/readmeFiles/jboss-portal-ha= -bin.README =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/readmeFiles/jboss-portal-ha-bin.R= EADME 2008-02-04 10:44:53 UTC (rev 9734) +++ docs/branches/JBoss_Portal_Branch_2_6/readmeFiles/jboss-portal-ha-bin.R= EADME 2008-02-04 10:48:40 UTC (rev 9735) @@ -1,5 +1,5 @@ = - JBoss Portal 2.6.3-SNAPSHOT = + JBoss Portal 2.6.4 LGPL Licensed (See http://www.gnu.org/copyleft/lesser.html for details o= n the product usage) = JBoss Portal is the next generation open source content management syste= m (CMS) and portal Modified: docs/branches/JBoss_Portal_Branch_2_6/readmeFiles/jboss-portal-sr= c.README =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/readmeFiles/jboss-portal-src.READ= ME 2008-02-04 10:44:53 UTC (rev 9734) +++ docs/branches/JBoss_Portal_Branch_2_6/readmeFiles/jboss-portal-src.READ= ME 2008-02-04 10:48:40 UTC (rev 9735) @@ -1,5 +1,5 @@ = - JBoss Portal 2.6.3-SNAPSHOT = + JBoss Portal 2.6.4 LGPL Licensed (See http://www.gnu.org/copyleft/lesser.html for details o= n the product usage) = JBoss Portal is the next generation open source content management syste= m (CMS) and portal Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/master.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/master.xml 2008= -02-04 10:44:53 UTC (rev 9734) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/master.xml 2008= -02-04 10:48:40 UTC (rev 9735) @@ -37,10 +37,10 @@ ]> - JBoss Portal 2.6.3-SNAPSHOT + JBoss Portal 2.6.4 Reference Guide - Release 2.6.3-SNAPSHOT - October 2007 + Release 2.6.4 + February 2008 Thomas Heute Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/i= nstallation.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-04 10:44:53 UTC (rev 9734) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-04 10:48:40 UTC (rev 9735) @@ -219,7 +219,7 @@ - Several modules have been extracted from the JBoss Portal SVN reposit= ory. These modules have a different lifecycle and a different version schem= e. The following is a list of modules used in JBoss Portal 2.6.3, and the l= ocations of their source code: + Several modules have been extracted from the JBoss Portal SVN reposit= ory. These modules have a different lifecycle and a different version schem= e. The following is a list of modules used in JBoss Portal 2.6.4, and the l= ocations of their source code: @@ -230,7 +230,7 @@ - JBoss Portal Web 1.1: http://anonsvn.jboss.org/repos/por= tal/modules/web/tags/JBP_WEB_1_1_0 + JBoss Portal Web 1.1.0: http://anonsvn.jboss.org/repos/p= ortal/modules/web/tags/JBP_WEB_1_1_0 @@ -240,12 +240,12 @@ - JBoss Portal Portlet 1.0.1: http://anonsvn.jboss.org/rep= os/portal/modules/portlet/tags/JBP_PORTLET_1_0_1 + JBoss Portal Portlet 1.0.2: http://anonsvn.jboss.org/rep= os/portal/modules/portlet/tags/JBP_PORTLET_1_0_2 - JBoss Portal Identity 1.0.1: http://anonsvn.jboss.org/re= pos/portal/modules/identity/tags/JBP_IDENTITY_1_0_1 + JBoss Portal Identity 1.0.2: http://anonsvn.jboss.org/re= pos/portal/modules/identity/tags/JBP_IDENTITY_1_0_2 Modified: docs/branches/JBoss_Portal_Branch_2_6/userGuide/en/master.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/userGuide/en/master.xml 2008-02-0= 4 10:44:53 UTC (rev 9734) +++ docs/branches/JBoss_Portal_Branch_2_6/userGuide/en/master.xml 2008-02-0= 4 10:48:40 UTC (rev 9735) @@ -13,10 +13,10 @@ ]> - JBoss Portal 2.6.3-SNAPSHOT + JBoss Portal 2.6.4 User Guide - Release 2.6.3-SNAPSHOT "Ninja" - October 2007 + Release 2.6.4 + February 2008 &overview; --===============7484328678308455788==-- From portal-commits at lists.jboss.org Mon Feb 4 05:57:06 2008 Content-Type: multipart/mixed; boundary="===============7328340006933175435==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9736 - in modules/identity/branches/JBP_IDENTITY_BRANCH_1_0: identity/src/main/org/jboss/portal/identity and 1 other directory. Date: Mon, 04 Feb 2008 05:57:06 -0500 Message-ID: --===============7328340006933175435== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-04 05:57:05 -0500 (Mon, 04 Feb 2008) New Revision: 9736 Removed: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/= jboss/portal/identity/config/ Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/build/build-thirdparty= .xml modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/build/build.xml Log: minor Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/build/build-thi= rdparty.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/build/build-thirdpart= y.xml 2008-02-04 10:48:40 UTC (rev 9735) +++ modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/build/build-thirdpart= y.xml 2008-02-04 10:57:05 UTC (rev 9736) @@ -47,8 +47,8 @@ are pushed to the http://repository.jboss.com site. --> = - - + + = Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/build/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/build/build.xml 2008-= 02-04 10:48:40 UTC (rev 9735) +++ modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/build/build.xml 2008-= 02-04 10:57:05 UTC (rev 9736) @@ -61,8 +61,8 @@ = - - + + = --===============7328340006933175435==-- From portal-commits at lists.jboss.org Mon Feb 4 06:10:12 2008 Content-Type: multipart/mixed; boundary="===============5497762458109901489==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9737 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api and 3 other directories. Date: Mon, 04 Feb 2008 06:10:12 -0500 Message-ID: --===============5497762458109901489== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-04 06:10:11 -0500 (Mon, 04 Feb 2008) New Revision: 9737 Removed: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/inv= ocation/response/StateResponse.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletRequestAttributes.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/MimeResponseImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletRequestImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/StateAwareResponseImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/inv= ocation/PortletInvocation.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/inv= ocation/response/FragmentResponse.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/inv= ocation/response/RedirectionResponse.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/inv= ocation/response/UpdateNavigationalStateResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletRequestHandler.java Log: - add notion of output request attributes in fragment and updatens responses - remove the fact that a redirect can be followed by events (it wasnt make = sense actally) and remove the related StateResponse class that was carrying= the events - updated the controller accordingly Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletRequestAttributes.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletRequestAttributes.java 2008-02-04 10:57:05 UTC (rev 9736) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletRequestAttributes.java 2008-02-04 11:10:11 UTC (rev 9737) @@ -73,6 +73,19 @@ UserContext userContext, HttpServletRequestWrapper wreq) { + if (container =3D=3D null) + { + throw new IllegalArgumentException("No null container allowed"); + } + if (userContext =3D=3D null) + { + throw new IllegalArgumentException("No null user context allowed"= ); + } + if (wreq =3D=3D null) + { + throw new IllegalArgumentException("No null wrapped request allow= ed"); + } + this.container =3D container; this.userContext =3D userContext; this.wreq =3D wreq; @@ -193,4 +206,36 @@ } setAttribute(name, null); } + + public void setAttributeMap(Map map) + { + for (Map.Entry attribute : map.entrySet()) + { + setAttribute(attribute.getKey(), attribute.getValue()); + } + } + + public Map getAttributeMap() + { + Map map =3D Collections.emptyMap(); + + // + if (attributes !=3D null) + { + for (Map.Entry attribute : attributes.entrySet()) + { + if (attribute.getValue() !=3D REMOVED_ATTRIBUTE) + { + if (map.size() =3D=3D 0) + { + map =3D new HashMap(attributes.size()); + } + map.put(attribute.getKey(), attribute.getValue()); + } + } + } + + // + return map; + } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/MimeResponseImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/MimeResponseImpl.java 2008-02-04 10:57:05 UTC (rev 9736) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/MimeResponseImpl.java 2008-02-04 11:10:11 UTC (rev 9737) @@ -92,6 +92,7 @@ else { fragment.setProperties(getProperties(false)); + fragment.setAttributes(preq.attributes.getAttributeMap()); = // return fragment; Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/PortletRequestImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletRequestImpl.java 2008-02-04 10:57:05 UTC (rev 9736) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletRequestImpl.java 2008-02-04 11:10:11 UTC (rev 9737) @@ -148,8 +148,16 @@ ContainerPreferencesInfo containerPrefs =3D info.getPreferences(); ContainerNavigationInfo navigationInfo =3D info.getNavigation(); UserContext userContext =3D invocation.getUserContext(); + HttpServletRequestWrapper realReq =3D new HttpServletRequestWrapper(= invocation.getDispatchedRequest()); = // + PortletRequestAttributes attributes =3D new PortletRequestAttributes= (container, userContext, realReq); + if (invocation.getAttributes() !=3D null) + { + attributes.setAttributeMap(invocation.getAttributes()); + } + + // this.contextPath =3D (String)invocation.getDispatchedRequest().getAt= tribute("javax.servlet.include.context_path"); this.invocation =3D invocation; this.userContext =3D userContext; @@ -158,9 +166,9 @@ this.clientContext =3D invocation.getClientContext(); this.windowContext =3D invocation.getWindowContext(); this.container =3D container; - this.realReq =3D new HttpServletRequestWrapper(invocation.getDispatc= hedRequest()); + this.realReq =3D realReq; this.portalContext =3D new PortalContextImpl(invocation.getPortalCon= text()); - this.attributes =3D new PortletRequestAttributes(container, userCont= ext, realReq); + this.attributes =3D attributes; this.preferences =3D new PortletPreferencesImpl(prefs, containerPref= s, validator, mode); this.navigationInfo =3D navigationInfo; this.requestParameterMap =3D PortletRequestParameterMap.create(navig= ationInfo, invocation); Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/StateAwareResponseImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/StateAwareResponseImpl.java 2008-02-04 10:57:05 UTC (rev 9736) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/StateAwareResponseImpl.java 2008-02-04 11:10:11 UTC (rev 9737) @@ -35,7 +35,6 @@ import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.invocation.response.HTTPRedirectionRespons= e; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.invocation.response.StateResponse; import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStat= eResponse; = import javax.portlet.PortletMode; @@ -75,7 +74,7 @@ protected WantRedirect wantRedirect; = /** . */ - private List events; + private List events; = public StateAwareResponseImpl(PortletInvocation invocation, PortletRequ= estImpl preq) { @@ -345,33 +344,16 @@ { if (events =3D=3D null) { - events =3D new LinkedList(); + events =3D new LinkedList(= ); } - events.add(new StateResponse.Event(name, value)); + events.add(new UpdateNavigationalStateResponse.Event(name, value)); } = private abstract class Decision { = - protected StateResponse getResponse() - { - StateResponse response =3D createResponse(); + protected abstract PortletInvocationResponse getResponse(); = - // - if (events !=3D null) - { - for (StateResponse.Event event : events) - { - response.queueEvent(event); - } - } - - // - return response; - } - - protected abstract StateResponse createResponse(); - } = protected class WantUpdate extends Decision @@ -386,12 +368,13 @@ /** The new mode requested. */ protected Mode mode; = - protected StateResponse createResponse() + protected PortletInvocationResponse getResponse() { UpdateNavigationalStateResponse response =3D new UpdateNavigation= alStateResponse(); = // response.setProperties(getProperties(false)); + response.setAttributes(preq.attributes.getAttributeMap()); = // response.setMode(mode); @@ -400,6 +383,15 @@ response.setNavigationalState(ParametersStateString.create(naviga= tionalState.getPrivateMapSnapshot())); = // + if (events !=3D null) + { + for (UpdateNavigationalStateResponse.Event event : events) + { + response.queueEvent(event); + } + } + + // return response; } } @@ -410,7 +402,7 @@ /** . */ protected String location; = - protected StateResponse createResponse() + protected PortletInvocationResponse getResponse() { return new HTTPRedirectionResponse(location); } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/invocation/PortletInvocation.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/PortletInvocation.java 2008-02-04 10:57:05 UTC (rev 9736) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/PortletInvocation.java 2008-02-04 11:10:11 UTC (rev 9737) @@ -41,6 +41,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Set; +import java.util.Map; = /** * @author Julien Viet @@ -80,6 +81,9 @@ /** The target portlet. */ protected PortletContext target; = + /** . */ + protected Map attributes; + /** The invocation context. */ protected PortletInvocationContext ctx; = @@ -291,4 +295,14 @@ { this.windowContext =3D windowContext; } + + public Map getAttributes() + { + return attributes; + } + + public void setAttributes(Map attributes) + { + this.attributes =3D attributes; + } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/invocation/response/FragmentResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/FragmentResponse.java 2008-02-04 10:57:05 UTC (rev 9736) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/FragmentResponse.java 2008-02-04 11:10:11 UTC (rev 9737) @@ -31,6 +31,7 @@ import java.io.PrintWriter; import java.io.StringWriter; import java.util.Set; +import java.util.Map; = /** * Data produced. @@ -54,6 +55,9 @@ private ResponseProperties properties; = /** . */ + private Map attributes; + + /** . */ private ContentBuffer buffer; = /** The title if any. */ @@ -72,6 +76,7 @@ this.cacheControl =3D null; this.properties =3D null; this.nextModes =3D null; + this.attributes =3D null; } = public ResponseProperties getProperties() @@ -94,6 +99,16 @@ this.cacheControl =3D cacheControl; } = + public Map getAttributes() + { + return attributes; + } + + public void setAttributes(Map attributes) + { + this.attributes =3D attributes; + } + public int getType() { return buffer.getType(); Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/invocation/response/RedirectionResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/RedirectionResponse.java 2008-02-04 10:57:05 UTC (rev 973= 6) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/RedirectionResponse.java 2008-02-04 11:10:11 UTC (rev 973= 7) @@ -28,6 +28,6 @@ * @author Julien Viet * @version $Revision: 5448 $ */ -public abstract class RedirectionResponse extends StateResponse +public abstract class RedirectionResponse extends PortletInvocationResponse { } Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portl= et/invocation/response/StateResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/StateResponse.java 2008-02-04 10:57:05 UTC (rev 9736) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/StateResponse.java 2008-02-04 11:10:11 UTC (rev 9737) @@ -1,95 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.invocation.response; - -import javax.xml.namespace.QName; -import java.util.ArrayList; -import java.util.List; -import java.util.Collections; -import java.io.Serializable; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class StateResponse extends PortletInvocationResponse -{ - - /** . */ - private List producedEvents =3D Collections.emptyList(); - - public void queueEvent(Event event) - { - if (event =3D=3D null) - { - throw new IllegalArgumentException("No null event accepted"); - } - - // - if (producedEvents.size() =3D=3D 0) - { - producedEvents =3D new ArrayList(); - } - - // - producedEvents.add(event); - } - - public List getEvents() - { - return producedEvents; - } - - /** - * An event produced by a state response. - */ - public static class Event - { - - /** The optional event. */ - private QName name; - - /** The optional event payload. */ - private Serializable payload; - - public Event(QName name, Serializable payload) - { - if (name =3D=3D null) - { - throw new IllegalArgumentException(); - } - this.name =3D name; - this.payload =3D payload; - } - - public QName getName() - { - return name; - } - - public Serializable getPayload() - { - return payload; - } - } -} Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/invocation/response/UpdateNavigationalStateResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/UpdateNavigationalStateResponse.java 2008-02-04 10:57:05 = UTC (rev 9736) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/UpdateNavigationalStateResponse.java 2008-02-04 11:10:11 = UTC (rev 9737) @@ -24,10 +24,14 @@ = import org.jboss.portal.Mode; import org.jboss.portal.WindowState; -import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.portlet.StateString; = +import javax.xml.namespace.QName; import java.util.Map; +import java.util.List; +import java.util.Collections; +import java.util.ArrayList; +import java.io.Serializable; = /** * Update the navigational state. @@ -35,21 +39,27 @@ * @author Julien Viet * @version $Revision: 5477 $ */ -public class UpdateNavigationalStateResponse extends StateResponse +public class UpdateNavigationalStateResponse extends PortletInvocationResp= onse { = /** . */ private ResponseProperties properties; = /** The navigational state returned. */ - protected StateString navigationalState; + private StateString navigationalState; = /** The new window state requested. */ - protected WindowState windowState; + private WindowState windowState; = /** The new mode requested. */ - protected Mode mode; + private Mode mode; = + /** The attributes snapshot after the request. */ + private Map attributes; + + /** . */ + private List producedEvents; + /** * The update to the public parameters. Each entry having a zero length= value must be interpeted as * a public parameter removal otherwise it must be interpreted as a pub= lic parameter values update. @@ -62,6 +72,7 @@ windowState =3D null; mode =3D null; publicNavigationalStateUpdates =3D null; + producedEvents =3D Collections.emptyList(); } = public ResponseProperties getProperties() @@ -74,6 +85,16 @@ this.properties =3D properties; } = + public Map getAttributes() + { + return attributes; + } + + public void setAttributes(Map attributes) + { + this.attributes =3D attributes; + } + public Mode getMode() { return mode; @@ -113,4 +134,59 @@ { this.publicNavigationalStateUpdates =3D publicNavigationalStateUpdat= es; } + + public void queueEvent(UpdateNavigationalStateResponse.Event event) + { + if (event =3D=3D null) + { + throw new IllegalArgumentException("No null event accepted"); + } + + // + if (producedEvents.size() =3D=3D 0) + { + producedEvents =3D new ArrayList(); + } + + // + producedEvents.add(event); + } + + public List getEvents() + { + return producedEvents; + } + + /** + * An event produced by a state response. + */ + public static class Event + { + + /** The optional event. */ + private QName name; + + /** The optional event payload. */ + private Serializable payload; + + public Event(QName name, Serializable payload) + { + if (name =3D=3D null) + { + throw new IllegalArgumentException(); + } + this.name =3D name; + this.payload =3D payload; + } + + public QName getName() + { + return name; + } + + public Serializable getPayload() + { + return payload; + } + } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletRequestHandler.java 2008-02-04 10:57:05 UTC (rev 9736) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletRequestHandler.java 2008-02-04 11:10:11 UTC (rev 9737) @@ -25,9 +25,7 @@ import org.jboss.portal.portlet.invocation.response.HTTPRedirectionRespons= e; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.ResponseProperties; -import org.jboss.portal.portlet.invocation.response.StateResponse; import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStat= eResponse; -import org.jboss.portal.portlet.test.controller.PageNavigationalState; import org.jboss.portal.portlet.test.PortletURLRenderer; import org.jboss.portal.portlet.test.TestActionContext; import org.jboss.portal.portlet.test.TestEventContext; @@ -100,7 +98,7 @@ // context.getClientResponse().sendError(404, error.getMessage()); } - else if (response instanceof StateResponse) + else if (response instanceof UpdateNavigationalStateResponse) { // Update portlet NS if (response instanceof UpdateNavigationalStateResponse) @@ -118,11 +116,11 @@ = // EventControllerContext eventCC =3D context.getEventControllerCont= ext(); - StateResponse stateResponse =3D (StateResponse)response; + UpdateNavigationalStateResponse stateResponse =3D (UpdateNavigati= onalStateResponse)response; = // Create event list and feed it with the events that may have be= en produced LinkedList eventQueue =3D new LinkedList(); - for (StateResponse.Event portletEvent : stateResponse.getEvents()) + for (UpdateNavigationalStateResponse.Event portletEvent : stateRe= sponse.getEvents()) { Event producedEvent =3D new Event(portletEvent.getName(), port= letEvent.getPayload(), portletContext); List consumedEvents =3D eventCC.getConsumedEvents(produ= cedEvent); @@ -146,7 +144,7 @@ updateNavigationalState(context, event.getPortletContext().= getId(), update, pageState); = // Add events if any - for (StateResponse.Event portletEvent : update.getEvents()) + for (UpdateNavigationalStateResponse.Event portletEvent : u= pdate.getEvents()) { Event producedEvent =3D new Event(portletEvent.getName()= , portletEvent.getPayload(), portletContext); List consumedEvents =3D eventCC.getConsumedEvents= (producedEvent); @@ -169,14 +167,13 @@ // Do something here !!!! } } - - if (response instanceof HTTPRedirectionResponse) - { - HTTPRedirectionResponse redirection =3D (HTTPRedirectionRespon= se)response; - context.getClientResponse().sendRedirect(redirection.getLocati= on()); - return; - } } + else if (response instanceof HTTPRedirectionResponse) + { + HTTPRedirectionResponse redirection =3D (HTTPRedirectionResponse)= response; + context.getClientResponse().sendRedirect(redirection.getLocation(= )); + return; + } else { System.out.println("Not yet handled " + response); --===============5497762458109901489==-- From portal-commits at lists.jboss.org Mon Feb 4 06:20:21 2008 Content-Type: multipart/mixed; boundary="===============4635551346163733999==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9738 - in modules/portlet/branches/JBP_PORTLET_BRANCH_1_0: test and 1 other directories. Date: Mon, 04 Feb 2008 06:20:21 -0500 Message-ID: --===============4635551346163733999== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-04 06:20:20 -0500 (Mon, 04 Feb 2008) New Revision: 9738 Added: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/test/src/main/org/jboss/= portal/portlet/test/PortletUtilsTestCase.java Modified: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jbo= ss/portal/portlet/impl/jsr168/PortletUtils.java modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/test/build.xml Log: JBPORTAL-1875: RenderResponse.getNamespace() generates a not correct value Modified: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/= org/jboss/portal/portlet/impl/jsr168/PortletUtils.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jb= oss/portal/portlet/impl/jsr168/PortletUtils.java 2008-02-04 11:10:11 UTC (r= ev 9737) +++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jb= oss/portal/portlet/impl/jsr168/PortletUtils.java 2008-02-04 11:20:20 UTC (r= ev 9738) @@ -192,7 +192,8 @@ for (int i =3D 0; i < windowId.length(); i++) { char c =3D windowId.charAt(i); - if (Character.isLetterOrDigit(c)) + int charVal =3D c; + if ((charVal >=3D 65 && charVal <=3D 90) || (charVal >=3D 97 && c= harVal <=3D 122) || (charVal >=3D48 && charVal <=3D 57) || (charVal =3D=3D = 95) || charVal =3D=3D 36) { tmp.append(c); } Modified: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/test/build.xml 2008-02-= 04 11:10:11 UTC (rev 9737) +++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/test/build.xml 2008-02-= 04 11:20:20 UTC (rev 9738) @@ -717,6 +717,7 @@ + Added: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/test/src/main/org/jb= oss/portal/portlet/test/PortletUtilsTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/test/src/main/org/jboss= /portal/portlet/test/PortletUtilsTestCase.java (rev= 0) +++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/test/src/main/org/jboss= /portal/portlet/test/PortletUtilsTestCase.java 2008-02-04 11:20:20 UTC (rev= 9738) @@ -0,0 +1,21 @@ +package org.jboss.portal.portlet.test; + +import org.jboss.portal.portlet.impl.jsr168.PortletUtils; + +import junit.framework.TestCase; + +public class PortletUtilsTestCase extends TestCase { + + public void testgenerateNamespaceFrom() + { + String name =3D "_09azAZ$"; + assertEquals(PortletUtils.PREFIX + name + PortletUtils.SUFFIX, PortletUt= ils.generateNamespaceFrom(name)); + + name =3D "_"; + assertEquals(PortletUtils.PREFIX + "_" + PortletUtils.SUFFIX, PortletUti= ls.generateNamespaceFrom(name)); + + name =3D "_=C3=A9"; + assertEquals(PortletUtils.PREFIX + "__e9" + PortletUtils.SUFFIX, Portlet= Utils.generateNamespaceFrom(name)); + } + = +} --===============4635551346163733999==-- From portal-commits at lists.jboss.org Mon Feb 4 06:26:01 2008 Content-Type: multipart/mixed; boundary="===============4722727282642572609==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9739 - in modules/portlet/tags/JBP_PORTLET_1_0_2: test and 1 other directories. Date: Mon, 04 Feb 2008 06:26:00 -0500 Message-ID: --===============4722727282642572609== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-04 06:26:00 -0500 (Mon, 04 Feb 2008) New Revision: 9739 Added: modules/portlet/tags/JBP_PORTLET_1_0_2/test/src/main/org/jboss/portal/po= rtlet/test/PortletUtilsTestCase.java Modified: modules/portlet/tags/JBP_PORTLET_1_0_2/portlet/src/main/org/jboss/portal= /portlet/impl/jsr168/PortletUtils.java modules/portlet/tags/JBP_PORTLET_1_0_2/test/build.xml Log: JBPORTAL-1875: RenderResponse.getNamespace() generates a not correct value Modified: modules/portlet/tags/JBP_PORTLET_1_0_2/portlet/src/main/org/jboss= /portal/portlet/impl/jsr168/PortletUtils.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/tags/JBP_PORTLET_1_0_2/portlet/src/main/org/jboss/porta= l/portlet/impl/jsr168/PortletUtils.java 2008-02-04 11:20:20 UTC (rev 9738) +++ modules/portlet/tags/JBP_PORTLET_1_0_2/portlet/src/main/org/jboss/porta= l/portlet/impl/jsr168/PortletUtils.java 2008-02-04 11:26:00 UTC (rev 9739) @@ -192,7 +192,8 @@ for (int i =3D 0; i < windowId.length(); i++) { char c =3D windowId.charAt(i); - if (Character.isLetterOrDigit(c)) + int charVal =3D c; + if ((charVal >=3D 65 && charVal <=3D 90) || (charVal >=3D 97 && c= harVal <=3D 122) || (charVal >=3D48 && charVal <=3D 57) || (charVal =3D=3D = 95) || charVal =3D=3D 36) { tmp.append(c); } Modified: modules/portlet/tags/JBP_PORTLET_1_0_2/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/tags/JBP_PORTLET_1_0_2/test/build.xml 2008-02-04 11:20:= 20 UTC (rev 9738) +++ modules/portlet/tags/JBP_PORTLET_1_0_2/test/build.xml 2008-02-04 11:26:= 00 UTC (rev 9739) @@ -717,6 +717,7 @@ + Added: modules/portlet/tags/JBP_PORTLET_1_0_2/test/src/main/org/jboss/porta= l/portlet/test/PortletUtilsTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/tags/JBP_PORTLET_1_0_2/test/src/main/org/jboss/portal/p= ortlet/test/PortletUtilsTestCase.java (rev 0) +++ modules/portlet/tags/JBP_PORTLET_1_0_2/test/src/main/org/jboss/portal/p= ortlet/test/PortletUtilsTestCase.java 2008-02-04 11:26:00 UTC (rev 9739) @@ -0,0 +1,21 @@ +package org.jboss.portal.portlet.test; + +import org.jboss.portal.portlet.impl.jsr168.PortletUtils; + +import junit.framework.TestCase; + +public class PortletUtilsTestCase extends TestCase { + + public void testgenerateNamespaceFrom() + { + String name =3D "_09azAZ$"; + assertEquals(PortletUtils.PREFIX + name + PortletUtils.SUFFIX, PortletUt= ils.generateNamespaceFrom(name)); + + name =3D "_"; + assertEquals(PortletUtils.PREFIX + "_" + PortletUtils.SUFFIX, PortletUti= ls.generateNamespaceFrom(name)); + + name =3D "_=C3=A9"; + assertEquals(PortletUtils.PREFIX + "__e9" + PortletUtils.SUFFIX, Portlet= Utils.generateNamespaceFrom(name)); + } + = +} --===============4722727282642572609==-- From portal-commits at lists.jboss.org Mon Feb 4 06:31:55 2008 Content-Type: multipart/mixed; boundary="===============3805441362982898386==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9740 - in modules/portlet/trunk: test/src/main/java/org/jboss/portal/portlet/test and 1 other directories. Date: Mon, 04 Feb 2008 06:31:55 -0500 Message-ID: --===============3805441362982898386== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-04 06:31:55 -0500 (Mon, 04 Feb 2008) New Revision: 9740 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletUtilsTestCase.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletUtils.java modules/portlet/trunk/test/src/test/resources/test/local-jboss-unit.xml Log: JBPORTAL-1875: RenderResponse.getNamespace() generates a not correct value Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletUtils.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletUtils.java 2008-02-04 11:26:00 UTC (rev 9739) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletUtils.java 2008-02-04 11:31:55 UTC (rev 9740) @@ -109,7 +109,8 @@ for (int i =3D 0; i < windowId.length(); i++) { char c =3D windowId.charAt(i); - if (Character.isLetterOrDigit(c)) + int charVal =3D c; + if ((charVal >=3D 65 && charVal <=3D 90) || (charVal >=3D 97 && c= harVal <=3D 122) || (charVal >=3D48 && charVal <=3D 57) || (charVal =3D=3D = 95) || charVal =3D=3D 36) { tmp.append(c); } Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/PortletUtilsTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletUtilsTestCase.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletUtilsTestCase.java 2008-02-04 11:31:55 UTC (rev 9740) @@ -0,0 +1,21 @@ +package org.jboss.portal.portlet.test; + +import org.jboss.portal.portlet.impl.jsr168.PortletUtils; + +import static org.jboss.unit.api.Assert.*; + +public class PortletUtilsTestCase { + + public void testgenerateNamespaceFrom() + { + String name =3D "_09azAZ$"; + assertEquals(PortletUtils.PREFIX + name + PortletUtils.SUFFIX, PortletUt= ils.generateNamespaceFrom(name)); + + name =3D "_"; + assertEquals(PortletUtils.PREFIX + "_" + PortletUtils.SUFFIX, PortletUti= ls.generateNamespaceFrom(name)); + + name =3D "_=C3=A9"; + assertEquals(PortletUtils.PREFIX + "__e9" + PortletUtils.SUFFIX, Portlet= Utils.generateNamespaceFrom(name)); + } + = +} Modified: modules/portlet/trunk/test/src/test/resources/test/local-jboss-un= it.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/test/local-jboss-unit.xml= 2008-02-04 11:26:00 UTC (rev 9739) +++ modules/portlet/trunk/test/src/test/resources/test/local-jboss-unit.xml= 2008-02-04 11:31:55 UTC (rev 9740) @@ -5,6 +5,10 @@ xsi:schemaLocation=3D"urn:jboss:jboss-unit:1.0 jboss-unit_1_0.xsd"> + + + + --===============3805441362982898386==-- From portal-commits at lists.jboss.org Mon Feb 4 07:30:03 2008 Content-Type: multipart/mixed; boundary="===============6486127071475938827==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9741 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Mon, 04 Feb 2008 07:26:03 -0500 Message-ID: --===============6486127071475938827== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-04 07:26:03 -0500 (Mon, 04 Feb 2008) New Revision: 9741 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installa= tion.xml docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/supporte= d.xml Log: minor Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/i= nstallation.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-04 11:31:55 UTC (rev 9740) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-04 12:26:03 UTC (rev 9741) @@ -82,7 +82,7 @@ Use the JBoss EAP and JBoss AS zip file - Only use the JBoss EAP and JBoss AS zip file versions. DO NOT ATTEMPT to deploy JBoss Portal on the installer versi= on of JBoss EAP or JBoss AS. We are currently working on alignin= g the Application installer with JBoss Portal. + Only use the JBoss EAP and JBoss AS zip file versions. DO NOT ATTEMPT to deploy JBoss Portal on the installer versi= on of JBoss EAP or JBoss AS. Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/s= upported.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/support= ed.xml 2008-02-04 11:31:55 UTC (rev 9740) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/support= ed.xml 2008-02-04 12:26:03 UTC (rev 9741) @@ -37,7 +37,7 @@ JBoss Application Server - JBoss Portal 2.6.3 is tested with JBoss Application Server (AS= ) 4.2.1, JBoss AS 4.2.2, and JBoss Enterprise Application Platform (EAP) 4.= 2. It is highly recommended that customers who have access to the JBoss Customer Support P= ortal (CSP) use JBoss EAP 4.2. Customers who do not have access to = the JBoss CSP should use JBos= s AS. + JBoss Portal 2.6.4 is tested with JBoss Application Server (AS= ) 4.2.1, JBoss AS 4.2.2, JBoss Enterprise Application Platform (EAP) 4.2 an= d JBoss EAP 4.3. It is highly recommended that customers who have access to= the JBoss Cust= omer Support Portal (CSP) use JBoss EAP 4.3. Customers who do not h= ave access to the JBoss CSP should use JBoss AS. JBoss AS versions 4.0.x are not = supported. --===============6486127071475938827==-- From portal-commits at lists.jboss.org Mon Feb 4 07:31:01 2008 Content-Type: multipart/mixed; boundary="===============0632408580326896150==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9742 - modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build. Date: Mon, 04 Feb 2008 07:27:00 -0500 Message-ID: --===============0632408580326896150== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-04 07:27:00 -0500 (Mon, 04 Feb 2008) New Revision: 9742 Modified: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build/ Log: minor Property changes on: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build ___________________________________________________________________ Name: svn:ignore + local.properties --===============0632408580326896150==-- From portal-commits at lists.jboss.org Mon Feb 4 08:57:05 2008 Content-Type: multipart/mixed; boundary="===============0439343577664334229==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9743 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/taglib and 8 other directories. Date: Mon, 04 Feb 2008 08:53:04 -0500 Message-ID: --===============0439343577664334229== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-04 08:53:04 -0500 (Mon, 04 Feb 2008) New Revision: 9743 Added: modules/portlet/trunk/portlet/src/main/resources/org/jboss/portal/portle= t/portlet_2_0.tld modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/taglib/ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/taglib/DefineObjectsTestCase.java modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/ modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/WEB-= INF/ modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/WEB-= INF/portlet.xml modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/WEB-= INF/web.xml modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/tagl= ib.jsp Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletSessionImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/taglib/DefineObjectsTag.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/taglib/DefineObjectsTagTEI.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/taglib/GenerateURLTag.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/taglib/NamespaceTag.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/taglib/PortletTag.java modules/portlet/trunk/test/src/test/build.xml modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml Log: - strart of Portlet 2.0 taglib - defineObjects tag and testcase Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/PortletSessionImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletSessionImpl.java 2008-02-04 12:27:00 UTC (rev 9742) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletSessionImpl.java 2008-02-04 13:53:04 UTC (rev 9743) @@ -33,6 +33,7 @@ import java.util.Map; import java.util.Collections; import java.util.ArrayList; +import java.util.HashMap; = /** * @author Julien Viet @@ -206,12 +207,19 @@ = public Map getAttributeMap() { - throw new NotYetImplemented(); + return getAttributeMap(PortletSession.PORTLET_SCOPE); } = public Map getAttributeMap(int i) { - throw new NotYetImplemented(); + Enumeration attributes =3D getAttributeNames(i); + Map attrs =3D new HashMap(); + while (attributes.hasMoreElements()) + { + String name =3D (String)attributes.nextElement(); + attrs.put(name, getAttribute(name)); + } + return Collections.unmodifiableMap(attrs); } = /** Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/taglib/DefineObjectsTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/taglib/DefineObjectsTag.java 2008-02-04 12:27:00 UTC (rev 9742) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/taglib/DefineObjectsTag.java 2008-02-04 13:53:04 UTC (rev 9743) @@ -25,12 +25,24 @@ import javax.portlet.PortletConfig; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; +import javax.portlet.PortletRequest; +import javax.portlet.PortletResponse; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.EventResponse; +import javax.portlet.EventRequest; +import javax.portlet.ResourceResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.PortletSession; +import javax.portlet.PortletPreferences; import javax.servlet.jsp.JspException; +import java.util.Map; = /** * The defineObjects tag for the JSR 168 Portlet specification. * * @author Sherman Wood + * @author Boleslaw Dawidowicz * @version $Revision: 5448 $ * @jsp.tag name=3D"defineObjects" body-content=3D"empty" tei-class=3D"org= .jboss.portal.portlet.impl.jsr168.taglib.DefineObjectsTagTEI" */ @@ -47,12 +59,42 @@ = public int doEndTag() throws JspException { - RenderRequest rreq =3D getRequest(); - RenderResponse rresp =3D getResponse(); + RenderRequest rreq =3D getRenderRequest(); + RenderResponse rresp =3D getRenderResponse(); + ActionRequest areq =3D getActionRequest(); + ActionResponse aresp =3D getActionResponse(); + EventRequest ereq =3D getEventRequest(); + EventResponse eresp =3D getEventResponse(); + ResourceRequest rsreq =3D getResourceRequest(); + ResourceResponse rsresp =3D getResourceResponse(); PortletConfig portletConfig =3D getConfig(); + PortletSession portletSession =3D getSession(); + Map portletSessionScope =3D getPortletSessionScope(); + PortletPreferences portletPreferences =3D getPortletPreferences(); + Map portletPreferencesValues =3D getPortletPrefere= nceValues(); pageContext.setAttribute(DefineObjectsTagTEI.renderRequestVariableNa= me, rreq); pageContext.setAttribute(DefineObjectsTagTEI.renderResponseVariableN= ame, rresp); + pageContext.setAttribute(DefineObjectsTagTEI.actionRequestVariableNa= me, areq); + pageContext.setAttribute(DefineObjectsTagTEI.actionResponseVariableN= ame, aresp); + pageContext.setAttribute(DefineObjectsTagTEI.eventRequestVariableNam= e, ereq); + pageContext.setAttribute(DefineObjectsTagTEI.eventResponseVariableNa= me, eresp); + pageContext.setAttribute(DefineObjectsTagTEI.resourceRequestVariable= Name, rsreq); + pageContext.setAttribute(DefineObjectsTagTEI.resourceResponseVariabl= eName, rsresp); pageContext.setAttribute(DefineObjectsTagTEI.portletConfigVariableNa= me, portletConfig); + pageContext.setAttribute(DefineObjectsTagTEI.portletSessionVariableN= ame, portletSession); + pageContext.setAttribute(DefineObjectsTagTEI.portletSessionScopeVari= ableName, portletSessionScope); + pageContext.setAttribute(DefineObjectsTagTEI.portletPreferencesVaria= bleName, portletPreferences); + pageContext.setAttribute(DefineObjectsTagTEI.portletPreferencesValue= sVariableName, portletPreferencesValues); + + +// RenderRequest rreq =3D (RenderRequest)getPortletRequest(); +// RenderResponse rresp =3D (RenderResponse)getPortletResponse(); +// PortletConfig portletConfig =3D getConfig(); +// pageContext.setAttribute(DefineObjectsTagTEI.renderRequestVariable= Name, rreq); +// pageContext.setAttribute(DefineObjectsTagTEI.renderResponseVariabl= eName, rresp); +// pageContext.setAttribute(DefineObjectsTagTEI.portletConfigVariable= Name, portletConfig); + + = return EVAL_PAGE; } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/taglib/DefineObjectsTagTEI.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/taglib/DefineObjectsTagTEI.java 2008-02-04 12:27:00 UTC (rev 9742) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/taglib/DefineObjectsTagTEI.java 2008-02-04 13:53:04 UTC (rev 9743) @@ -25,14 +25,25 @@ import javax.portlet.PortletConfig; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.PortletSession; +import javax.portlet.PortletPreferences; import javax.servlet.jsp.tagext.TagData; import javax.servlet.jsp.tagext.TagExtraInfo; import javax.servlet.jsp.tagext.VariableInfo; +import java.util.Map; +import java.util.HashMap; = /** * The additional variable definitions for the defineObjects tag for the J= SR 168 Portlet specification. * * @author Sherman Wood + * @author Boleslaw Dawidowicz * @version $Revision: 5448 $ */ public class DefineObjectsTagTEI extends TagExtraInfo @@ -40,6 +51,16 @@ public static final String portletConfigVariableName =3D "portletConfig= "; public static final String renderRequestVariableName =3D "renderRequest= "; public static final String renderResponseVariableName =3D "renderRespon= se"; + public static final String actionRequestVariableName =3D "actionRequest= "; + public static final String actionResponseVariableName =3D "actionRespon= se"; + public static final String resourceRequestVariableName =3D "resourceReq= uest"; + public static final String resourceResponseVariableName =3D "resourceRe= sponse"; + public static final String eventRequestVariableName =3D "eventRequest"; + public static final String eventResponseVariableName =3D "eventResponse= "; + public static final String portletSessionVariableName =3D "portletSessi= on"; + public static final String portletSessionScopeVariableName =3D "portlet= SessionScope"; + public static final String portletPreferencesVariableName =3D "portletP= references"; + public static final String portletPreferencesValuesVariableName =3D "po= rtletPreferencesValues"; = public VariableInfo[] getVariableInfo(TagData data) { @@ -49,7 +70,30 @@ RenderRequest.class.getName(), true, VariableInfo.AT_END); VariableInfo info3 =3D new VariableInfo(renderResponseVariableName, RenderResponse.class.getName(), true, VariableInfo.AT_END); - VariableInfo[] info =3D {info1, info2, info3}; + VariableInfo info4 =3D new VariableInfo(actionRequestVariableName, + ActionRequest.class.getName(), true, VariableInfo.AT_END); + VariableInfo info5 =3D new VariableInfo(actionResponseVariableName, + ActionResponse.class.getName(), true, VariableInfo.AT_END); + VariableInfo info6 =3D new VariableInfo(resourceRequestVariableName, + ResourceRequest.class.getName(), true, VariableInfo.AT_END); + VariableInfo info7 =3D new VariableInfo(resourceResponseVariableName, + ResourceResponse.class.getName(), true, VariableInfo.AT_END); + VariableInfo info8 =3D new VariableInfo(eventRequestVariableName, + EventRequest.class.getName(), true, VariableInfo.AT_END); + VariableInfo info9 =3D new VariableInfo(eventResponseVariableName, + EventResponse.class.getName(), true, VariableInfo.AT_END); + VariableInfo info10 =3D new VariableInfo(portletSessionVariableName, + PortletSession.class.getName(), true, VariableInfo.AT_END); + VariableInfo info11 =3D new VariableInfo(portletSessionScopeVariable= Name, + Map.class.getName(), true, VariableInfo.AT_END); + VariableInfo info12 =3D new VariableInfo(portletPreferencesVariableN= ame, + PortletPreferences.class.getName(), true, VariableInfo.AT_END); + VariableInfo info13 =3D new VariableInfo(portletPreferencesValuesVar= iableName, + Map.class.getName(), true, VariableInfo.AT_END); + + + + VariableInfo[] info =3D {info1, info2, info3, info4, info5, info6, i= nfo7, info8, info9, info10, info11, info12, info13}; return info; } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/taglib/GenerateURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/taglib/GenerateURLTag.java 2008-02-04 12:27:00 UTC (rev 9742) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/taglib/GenerateURLTag.java 2008-02-04 13:53:04 UTC (rev 9743) @@ -24,6 +24,7 @@ = import org.jboss.portal.portlet.impl.jsr168.api.RenderRequestImpl; import org.jboss.portal.portlet.impl.jsr168.api.PortletURLImpl; +import org.jboss.portal.portlet.impl.jsr168.api.PortletRequestImpl; = import javax.portlet.PortletMode; import javax.portlet.PortletModeException; @@ -31,6 +32,7 @@ import javax.portlet.PortletURL; import javax.portlet.WindowState; import javax.portlet.WindowStateException; +import javax.portlet.RenderRequest; import javax.servlet.jsp.JspException; import java.util.ArrayList; import java.util.HashMap; @@ -186,7 +188,7 @@ */ private PortletURL getBasePortletEnvironmentAndURL() { - RenderRequestImpl preq =3D getRequest(); + PortletRequestImpl preq =3D (PortletRequestImpl)getPortletRequest(); = // Create the URL if ("action".equals(getTypeValue())) Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/taglib/NamespaceTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/taglib/NamespaceTag.java 2008-02-04 12:27:00 UTC (rev 9742) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/taglib/NamespaceTag.java 2008-02-04 13:53:04 UTC (rev 9743) @@ -23,6 +23,7 @@ package org.jboss.portal.portlet.impl.jsr168.taglib; = import javax.portlet.RenderResponse; +import javax.portlet.PortletResponse; import javax.servlet.jsp.JspException; import java.io.IOException; = @@ -54,7 +55,7 @@ { try { - RenderResponse resp =3D getResponse(); + PortletResponse resp =3D getPortletResponse(); String namespace =3D resp.getNamespace(); pageContext.getOut().print(namespace); } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/taglib/PortletTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/taglib/PortletTag.java 2008-02-04 12:27:00 UTC (rev 9742) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/taglib/PortletTag.java 2008-02-04 13:53:04 UTC (rev 9743) @@ -28,9 +28,23 @@ = import javax.portlet.PortletConfig; import javax.portlet.RenderResponse; +import javax.portlet.PortletRequest; +import javax.portlet.PortletResponse; +import javax.portlet.RenderRequest; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import javax.portlet.PortletSession; +import javax.portlet.PortletPreferences; import javax.servlet.ServletRequest; import javax.servlet.http.HttpServletRequest; import javax.servlet.jsp.tagext.TagSupport; +import java.util.Map; +import java.util.Collections; +import java.util.HashMap; = /** * Superclass of the portlet tags for the JSR 168 Portlet specification. @@ -38,6 +52,7 @@ * Provides hooks into the portlet environment * * @author Sherman Wood + * @author Boleslaw Dawidowicz * @version $Revision: 5448 $ */ public class PortletTag extends TagSupport @@ -52,16 +67,16 @@ return invocation.getDispatchedRequest(); } = - protected RenderRequestImpl getRequest() + protected PortletRequest getPortletRequest() { HttpServletRequest dreq =3D getDispatchedRequest(); - return (RenderRequestImpl)dreq.getAttribute("javax.portlet.request"); + return (PortletRequest)dreq.getAttribute("javax.portlet.request"); } = - protected RenderResponse getResponse() + protected PortletResponse getPortletResponse() { HttpServletRequest dreq =3D getDispatchedRequest(); - return (RenderResponse)dreq.getAttribute("javax.portlet.response"); + return (PortletResponse)dreq.getAttribute("javax.portlet.response"); } = protected PortletConfig getConfig() @@ -70,6 +85,128 @@ return (PortletConfig)dreq.getAttribute("javax.portlet.config"); } = + protected RenderRequest getRenderRequest() + { + if (getPortletRequest() instanceof RenderRequest) + { + return (RenderRequest)getPortletRequest(); + } + else + { + return null; + } + } + protected RenderResponse getRenderResponse() + { + if (getPortletResponse() instanceof RenderResponse) + { + return (RenderResponse)getPortletResponse(); + } + else + { + return null; + } + } + + protected ActionRequest getActionRequest() + { + if (getPortletRequest() instanceof ActionRequest) + { + return (ActionRequest)getPortletRequest(); + } + else + { + return null; + } + } + protected ActionResponse getActionResponse() + { + if (getPortletResponse() instanceof ActionResponse) + { + return (ActionResponse)getPortletResponse(); + } + else + { + return null; + } + } + + protected EventRequest getEventRequest() + { + if (getPortletRequest() instanceof EventRequest) + { + return (EventRequest)getPortletRequest(); + } + else + { + return null; + } + } + protected EventResponse getEventResponse() + { + if (getPortletResponse() instanceof EventResponse) + { + return (EventResponse)getPortletResponse(); + } + else + { + return null; + } + } + + protected ResourceRequest getResourceRequest() + { + if (getPortletRequest() instanceof ResourceRequest) + { + return (ResourceRequest)getPortletRequest(); + } + else + { + return null; + } + } + protected ResourceResponse getResourceResponse() + { + if (getPortletResponse() instanceof ResourceResponse) + { + return (ResourceResponse)getPortletResponse(); + } + else + { + return null; + } + } + + + + + protected PortletSession getSession() + { + return getPortletRequest().getPortletSession(false); + } + + protected Map getPortletSessionScope() + { + if (getSession() !=3D null) + { + return getSession().getAttributeMap(); + } + else + { + return new HashMap(); + } + } + + protected PortletPreferences getPortletPreferences() + { + return getPortletRequest().getPreferences(); + } + + protected Map getPortletPreferenceValues() + { + return getPortletPreferences().getMap(); + } + /** * Set up the environment for accessing the portlat environment * Added: modules/portlet/trunk/portlet/src/main/resources/org/jboss/portal/po= rtlet/portlet_2_0.tld =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/resources/org/jboss/portal/portl= et/portlet_2_0.tld (rev 0) +++ modules/portlet/trunk/portlet/src/main/resources/org/jboss/portal/portl= et/portlet_2_0.tld 2008-02-04 13:53:04 UTC (rev 9743) @@ -0,0 +1,108 @@ + + + + + Portlet 2.0 Tag Library + Portlet 2.0 Tags + 2.0 + portlet + http://java.sun.com/portlet_2_0 + + + + param + org.jboss.portal.portlet.impl.jsr168.taglib.URLParameterT= ag + empty + + + name + true + true + + + + value + true + true + + + + + + + renderURL + org.jboss.portal.portlet.impl.jsr168.taglib.RenderURLTag<= /tag-class> + org.jboss.portal.portlet.impl.jsr168.taglib.GenerateURLTa= gTEI + JSP + + + portletMode + true + + + + secure + true + + + + var + true + + + + windowState + true + + + + + + + defineObjects + org.jboss.portal.portlet.impl.jsr168.taglib.DefineObjects= Tag + org.jboss.portal.portlet.impl.jsr168.taglib.DefineObjects= TagTEI + empty + + + + + actionURL + org.jboss.portal.portlet.impl.jsr168.taglib.ActionURLTag<= /tag-class> + org.jboss.portal.portlet.impl.jsr168.taglib.GenerateURLTa= gTEI + JSP + + + portletMode + true + + + + secure + true + + + + var + true + + + + windowState + true + + + + + + + namespace + org.jboss.portal.portlet.impl.jsr168.taglib.NamespaceTag<= /tag-class> + empty + + + + Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/taglib/DefineObjectsTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/taglib/DefineObjectsTestCase.java (re= v 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/taglib/DefineObjectsTestCase.java 2008-02-04 13:53:04 UTC (re= v 9743) @@ -0,0 +1,148 @@ +/* +* 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.portlet.jsr286.tck.taglib; + +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.Assertion; +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.base.AbstractUniversalTestPortlet; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.unit.actions.PortletActionTestAction; +import org.jboss.portal.unit.actions.PortletEventTestAction; +import org.jboss.portal.unit.actions.PortletResourceTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; +import static org.jboss.unit.api.Assert.*; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.PortletRequestDispatcher; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import java.io.IOException; +import java.io.Writer; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +(a)TestCase({ + Assertion.JSR286_113 + }) +public class DefineObjectsTestCase +{ + + //TODO: doesn't test include from action/event - the actionRequest/acti= onResponse/eventRequest/eventResponse objects + + private String startTag; + private String endTag; + + public DefineObjectsTestCase(PortletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + response.setContentType("text/html"); + PortletRequestDispatcher dispatcher =3D ((AbstractUniversalTes= tPortlet)portlet).getPortletContext().getRequestDispatcher("/taglib.jsp"); + + startTag =3D "
"; + endTag =3D "
"; + + Writer writer =3D response.getWriter(); + + writer.write(startTag); + dispatcher.include(request, response); + writer.write(endTag); + + + return new InvokeGetResponse(response.createRenderURL().toStri= ng()); + } + }); + + + + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + response.setContentType("text/html"); + + String prevResponse =3D new String(context.getResponseBody()); + + String portletResp =3D prevResponse.substring(prevResponse.ind= exOf(startTag) + startTag.length(), prevResponse.indexOf(endTag)); + + assertEquals("jspDispatch,renderRequest,renderResponse,portlet= Config,portletSession,portletSessionScope," + + "portletPreferences,portletPreferencesValues", portletResp.= trim()); + + return new InvokeGetResponse(response.createResourceURL().toSt= ring()); + } + }); + + seq.bindAction(2, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + { + protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws IOExcep= tion, PortletException + { + response.setContentType("text/html"); + PortletRequestDispatcher dispatcher =3D ((AbstractUniversalTes= tPortlet)portlet).getPortletContext().getRequestDispatcher("/taglib.jsp"); + + startTag =3D "
"; + endTag =3D "
"; + + Writer writer =3D response.getWriter(); + + writer.write(startTag); + dispatcher.include(request, response); + writer.write(endTag); + + return new InvokeGetResponse(response.createRenderURL().toStri= ng()); + } + }); + + seq.bindAction(3, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + response.setContentType("text/html"); + + String prevResponse =3D new String(context.getResponseBody()); + + String portletResp =3D prevResponse.substring(prevResponse.ind= exOf(startTag) + startTag.length(), prevResponse.indexOf(endTag)); + + assertEquals("jspDispatch,resourceRequest,resourceResponse,por= tletConfig,portletSession,portletSessionScope," + + "portletPreferences,portletPreferencesValues", portletResp.= trim()); + + return new EndTestResponse(); + } + }); + } +} Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-04 12:27:00 UTC (= rev 9742) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-04 13:53:04 UTC (= rev 9743) @@ -304,6 +304,10 @@ src=3D"${dependency.portal-portlet.jar}" includes=3D"org/jboss/portal/portlet/portlet.tld" fullpath=3D"META-INF/portlet.tld"/> + = @@ -365,6 +369,7 @@ + @@ -607,7 +612,7 @@ - + Added: modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/= WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/WEB= -INF/portlet.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/WEB= -INF/portlet.xml 2008-02-04 13:53:04 UTC (rev 9743) @@ -0,0 +1,38 @@ + + + + + + + UniversalTestPortletA + org.jboss.portal.test.portlet.framework.UTP1 + + text/html + + + = + Added: modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/= WEB-INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/WEB= -INF/web.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/WEB= -INF/web.xml 2008-02-04 13:53:04 UTC (rev 9743) @@ -0,0 +1,32 @@ + + + + + + + org.jboss.portal.unit.PortletTestSuite + + Added: modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/= taglib.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/tag= lib.jsp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/tag= lib.jsp 2008-02-04 13:53:04 UTC (rev 9743) @@ -0,0 +1,73 @@ +<%@ page import=3D"org.jboss.unit.api.Assert" %> +<%@ page import=3D"javax.portlet.RenderRequest" %> +<%@ page import=3D"javax.portlet.RenderResponse" %> +<%@ page import=3D"javax.portlet.ActionRequest" %> +<%@ page import=3D"javax.portlet.ActionResponse" %> +<%@ page import=3D"javax.portlet.EventRequest" %> +<%@ page import=3D"javax.portlet.EventResponse" %> +<%@ page import=3D"javax.portlet.ResourceRequest" %> +<%@ page import=3D"javax.portlet.ResourceResponse" %> +<%@ page import=3D"javax.portlet.PortletConfig" %> +<%@ page import=3D"javax.portlet.PortletSession" %> +<%@ page import=3D"java.util.Map" %> +<%@ page import=3D"javax.portlet.PortletPreferences" %> +<%@ page language=3D"java" %> +<%@ taglib uri=3D"http://java.sun.com/portlet_2_0" prefix=3D"portlet" %> + +<% + out.print("jspDispatch"); + + if (renderRequest !=3D null && renderRequest instanceof RenderRequest) + { + out.print(",renderRequest"); + } + if (renderResponse !=3D null && renderResponse instanceof RenderRespons= e) + { + out.print(",renderResponse"); + } + if (actionRequest !=3D null && actionRequest instanceof ActionRequest) + { + out.print(",actionRequest"); + } + if (actionResponse !=3D null && actionResponse instanceof ActionRespons= e) + { + out.print(",actionResponse"); + } + if (eventRequest !=3D null && eventRequest instanceof EventRequest) + { + out.print(",eventRequest"); + } + if (eventResponse !=3D null && eventResponse instanceof EventResponse) + { + out.print(",eventResponse"); + } + if (resourceRequest !=3D null && resourceRequest instanceof ResourceReq= uest) + { + out.print(",resourceRequest"); + } + if (resourceResponse !=3D null && resourceResponse instanceof ResourceR= esponse) + { + out.print(",resourceResponse"); + } + if (portletConfig !=3D null && portletConfig instanceof PortletConfig) + { + out.print(",portletConfig"); + } + if (portletSession !=3D null && portletSession instanceof PortletSessio= n) + { + out.print(",portletSession"); + } + if (portletSessionScope !=3D null && portletSessionScope instanceof Map) + { + out.print(",portletSessionScope"); + } + if (portletPreferences !=3D null && portletPreferences instanceof Portl= etPreferences) + { + out.print(",portletPreferences"); + } + if (portletPreferencesValues !=3D null && portletPreferencesValues inst= anceof Map) + { + out.print(",portletPreferencesValues"); + } + +%> \ No newline at end of file Modified: modules/portlet/trunk/test/src/test/resources/test/remote-jboss-u= nit.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xm= l 2008-02-04 12:27:00 UTC (rev 9742) +++ modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xm= l 2008-02-04 13:53:04 UTC (rev 9743) @@ -187,6 +187,10 @@ + + + + = --===============0439343577664334229==-- From portal-commits at lists.jboss.org Mon Feb 4 09:09:42 2008 Content-Type: multipart/mixed; boundary="===============2935799484880982632==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9744 - in modules/portlet/trunk/portlet/src/main: java/org/jboss/portal/portlet/impl/jsr168/taglib and 3 other directories. Date: Mon, 04 Feb 2008 09:05:42 -0500 Message-ID: --===============2935799484880982632== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-04 09:05:42 -0500 (Mon, 04 Feb 2008) New Revision: 9744 Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr286/ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr286/taglib/ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr286/taglib/DefineObjects286Tag.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr286/taglib/DefineObjects286TagTEI.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/taglib/DefineObjectsTag.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/taglib/DefineObjectsTagTEI.java modules/portlet/trunk/portlet/src/main/resources/org/jboss/portal/portle= t/portlet_2_0.tld Log: make 286 taglib impl separate from 168 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/taglib/DefineObjectsTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/taglib/DefineObjectsTag.java 2008-02-04 13:53:04 UTC (rev 9743) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/taglib/DefineObjectsTag.java 2008-02-04 14:05:42 UTC (rev 9744) @@ -59,41 +59,13 @@ = public int doEndTag() throws JspException { - RenderRequest rreq =3D getRenderRequest(); - RenderResponse rresp =3D getRenderResponse(); - ActionRequest areq =3D getActionRequest(); - ActionResponse aresp =3D getActionResponse(); - EventRequest ereq =3D getEventRequest(); - EventResponse eresp =3D getEventResponse(); - ResourceRequest rsreq =3D getResourceRequest(); - ResourceResponse rsresp =3D getResourceResponse(); + + RenderRequest rreq =3D (RenderRequest)getPortletRequest(); + RenderResponse rresp =3D (RenderResponse)getPortletResponse(); PortletConfig portletConfig =3D getConfig(); - PortletSession portletSession =3D getSession(); - Map portletSessionScope =3D getPortletSessionScope(); - PortletPreferences portletPreferences =3D getPortletPreferences(); - Map portletPreferencesValues =3D getPortletPrefere= nceValues(); pageContext.setAttribute(DefineObjectsTagTEI.renderRequestVariableNa= me, rreq); pageContext.setAttribute(DefineObjectsTagTEI.renderResponseVariableN= ame, rresp); - pageContext.setAttribute(DefineObjectsTagTEI.actionRequestVariableNa= me, areq); - pageContext.setAttribute(DefineObjectsTagTEI.actionResponseVariableN= ame, aresp); - pageContext.setAttribute(DefineObjectsTagTEI.eventRequestVariableNam= e, ereq); - pageContext.setAttribute(DefineObjectsTagTEI.eventResponseVariableNa= me, eresp); - pageContext.setAttribute(DefineObjectsTagTEI.resourceRequestVariable= Name, rsreq); - pageContext.setAttribute(DefineObjectsTagTEI.resourceResponseVariabl= eName, rsresp); pageContext.setAttribute(DefineObjectsTagTEI.portletConfigVariableNa= me, portletConfig); - pageContext.setAttribute(DefineObjectsTagTEI.portletSessionVariableN= ame, portletSession); - pageContext.setAttribute(DefineObjectsTagTEI.portletSessionScopeVari= ableName, portletSessionScope); - pageContext.setAttribute(DefineObjectsTagTEI.portletPreferencesVaria= bleName, portletPreferences); - pageContext.setAttribute(DefineObjectsTagTEI.portletPreferencesValue= sVariableName, portletPreferencesValues); - - -// RenderRequest rreq =3D (RenderRequest)getPortletRequest(); -// RenderResponse rresp =3D (RenderResponse)getPortletResponse(); -// PortletConfig portletConfig =3D getConfig(); -// pageContext.setAttribute(DefineObjectsTagTEI.renderRequestVariable= Name, rreq); -// pageContext.setAttribute(DefineObjectsTagTEI.renderResponseVariabl= eName, rresp); -// pageContext.setAttribute(DefineObjectsTagTEI.portletConfigVariable= Name, portletConfig); - = return EVAL_PAGE; } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/taglib/DefineObjectsTagTEI.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/taglib/DefineObjectsTagTEI.java 2008-02-04 13:53:04 UTC (rev 9743) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/taglib/DefineObjectsTagTEI.java 2008-02-04 14:05:42 UTC (rev 9744) @@ -51,16 +51,6 @@ public static final String portletConfigVariableName =3D "portletConfig= "; public static final String renderRequestVariableName =3D "renderRequest= "; public static final String renderResponseVariableName =3D "renderRespon= se"; - public static final String actionRequestVariableName =3D "actionRequest= "; - public static final String actionResponseVariableName =3D "actionRespon= se"; - public static final String resourceRequestVariableName =3D "resourceReq= uest"; - public static final String resourceResponseVariableName =3D "resourceRe= sponse"; - public static final String eventRequestVariableName =3D "eventRequest"; - public static final String eventResponseVariableName =3D "eventResponse= "; - public static final String portletSessionVariableName =3D "portletSessi= on"; - public static final String portletSessionScopeVariableName =3D "portlet= SessionScope"; - public static final String portletPreferencesVariableName =3D "portletP= references"; - public static final String portletPreferencesValuesVariableName =3D "po= rtletPreferencesValues"; = public VariableInfo[] getVariableInfo(TagData data) { @@ -70,30 +60,9 @@ RenderRequest.class.getName(), true, VariableInfo.AT_END); VariableInfo info3 =3D new VariableInfo(renderResponseVariableName, RenderResponse.class.getName(), true, VariableInfo.AT_END); - VariableInfo info4 =3D new VariableInfo(actionRequestVariableName, - ActionRequest.class.getName(), true, VariableInfo.AT_END); - VariableInfo info5 =3D new VariableInfo(actionResponseVariableName, - ActionResponse.class.getName(), true, VariableInfo.AT_END); - VariableInfo info6 =3D new VariableInfo(resourceRequestVariableName, - ResourceRequest.class.getName(), true, VariableInfo.AT_END); - VariableInfo info7 =3D new VariableInfo(resourceResponseVariableName, - ResourceResponse.class.getName(), true, VariableInfo.AT_END); - VariableInfo info8 =3D new VariableInfo(eventRequestVariableName, - EventRequest.class.getName(), true, VariableInfo.AT_END); - VariableInfo info9 =3D new VariableInfo(eventResponseVariableName, - EventResponse.class.getName(), true, VariableInfo.AT_END); - VariableInfo info10 =3D new VariableInfo(portletSessionVariableName, - PortletSession.class.getName(), true, VariableInfo.AT_END); - VariableInfo info11 =3D new VariableInfo(portletSessionScopeVariable= Name, - Map.class.getName(), true, VariableInfo.AT_END); - VariableInfo info12 =3D new VariableInfo(portletPreferencesVariableN= ame, - PortletPreferences.class.getName(), true, VariableInfo.AT_END); - VariableInfo info13 =3D new VariableInfo(portletPreferencesValuesVar= iableName, - Map.class.getName(), true, VariableInfo.AT_END); = = - - VariableInfo[] info =3D {info1, info2, info3, info4, info5, info6, i= nfo7, info8, info9, info10, info11, info12, info13}; + VariableInfo[] info =3D {info1, info2, info3}; return info; } } Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/jsr286/taglib/DefineObjects286Tag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/DefineObjects286Tag.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/DefineObjects286Tag.java 2008-02-04 14:05:42 UTC (rev 9744) @@ -0,0 +1,86 @@ +/* +* 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.portlet.impl.jsr286.taglib; + +import org.jboss.portal.portlet.impl.jsr168.taglib.PortletTag; + +import javax.servlet.jsp.JspException; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import javax.portlet.PortletConfig; +import javax.portlet.PortletSession; +import javax.portlet.PortletPreferences; +import java.util.Map; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +public class DefineObjects286Tag extends PortletTag +{ + /** The serialVersionUID */ + private static final long serialVersionUID =3D -8640865649772583292L; + + public int doStartTag() throws JspException + { + return SKIP_BODY; + } + + public int doEndTag() throws JspException + { + RenderRequest rreq =3D getRenderRequest(); + RenderResponse rresp =3D getRenderResponse(); + ActionRequest areq =3D getActionRequest(); + ActionResponse aresp =3D getActionResponse(); + EventRequest ereq =3D getEventRequest(); + EventResponse eresp =3D getEventResponse(); + ResourceRequest rsreq =3D getResourceRequest(); + ResourceResponse rsresp =3D getResourceResponse(); + PortletConfig portletConfig =3D getConfig(); + PortletSession portletSession =3D getSession(); + Map portletSessionScope =3D getPortletSessionScope(); + PortletPreferences portletPreferences =3D getPortletPreferences(); + Map portletPreferencesValues =3D getPortletPrefere= nceValues(); + pageContext.setAttribute(DefineObjects286TagTEI.renderRequestVariabl= eName, rreq); + pageContext.setAttribute(DefineObjects286TagTEI.renderResponseVariab= leName, rresp); + pageContext.setAttribute(DefineObjects286TagTEI.actionRequestVariabl= eName, areq); + pageContext.setAttribute(DefineObjects286TagTEI.actionResponseVariab= leName, aresp); + pageContext.setAttribute(DefineObjects286TagTEI.eventRequestVariable= Name, ereq); + pageContext.setAttribute(DefineObjects286TagTEI.eventResponseVariabl= eName, eresp); + pageContext.setAttribute(DefineObjects286TagTEI.resourceRequestVaria= bleName, rsreq); + pageContext.setAttribute(DefineObjects286TagTEI.resourceResponseVari= ableName, rsresp); + pageContext.setAttribute(DefineObjects286TagTEI.portletConfigVariabl= eName, portletConfig); + pageContext.setAttribute(DefineObjects286TagTEI.portletSessionVariab= leName, portletSession); + pageContext.setAttribute(DefineObjects286TagTEI.portletSessionScopeV= ariableName, portletSessionScope); + pageContext.setAttribute(DefineObjects286TagTEI.portletPreferencesVa= riableName, portletPreferences); + pageContext.setAttribute(DefineObjects286TagTEI.portletPreferencesVa= luesVariableName, portletPreferencesValues); + + return EVAL_PAGE; + } +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/jsr286/taglib/DefineObjects286TagTEI.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/DefineObjects286TagTEI.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/DefineObjects286TagTEI.java 2008-02-04 14:05:42 UTC (rev 9= 744) @@ -0,0 +1,95 @@ +/* +* 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.portlet.impl.jsr286.taglib; + +import javax.servlet.jsp.tagext.VariableInfo; +import javax.servlet.jsp.tagext.TagData; +import javax.servlet.jsp.tagext.TagExtraInfo; +import javax.portlet.PortletConfig; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.PortletSession; +import javax.portlet.PortletPreferences; +import java.util.Map; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +public class DefineObjects286TagTEI extends TagExtraInfo +{ + public static final String portletConfigVariableName =3D "portletConfig= "; + public static final String renderRequestVariableName =3D "renderRequest= "; + public static final String renderResponseVariableName =3D "renderRespon= se"; + public static final String actionRequestVariableName =3D "actionRequest= "; + public static final String actionResponseVariableName =3D "actionRespon= se"; + public static final String resourceRequestVariableName =3D "resourceReq= uest"; + public static final String resourceResponseVariableName =3D "resourceRe= sponse"; + public static final String eventRequestVariableName =3D "eventRequest"; + public static final String eventResponseVariableName =3D "eventResponse= "; + public static final String portletSessionVariableName =3D "portletSessi= on"; + public static final String portletSessionScopeVariableName =3D "portlet= SessionScope"; + public static final String portletPreferencesVariableName =3D "portletP= references"; + public static final String portletPreferencesValuesVariableName =3D "po= rtletPreferencesValues"; + + public VariableInfo[] getVariableInfo(TagData data) + { + VariableInfo info1 =3D new VariableInfo(portletConfigVariableName, + PortletConfig.class.getName(), true, VariableInfo.AT_END); + VariableInfo info2 =3D new VariableInfo(renderRequestVariableName, + RenderRequest.class.getName(), true, VariableInfo.AT_END); + VariableInfo info3 =3D new VariableInfo(renderResponseVariableName, + RenderResponse.class.getName(), true, VariableInfo.AT_END); + VariableInfo info4 =3D new VariableInfo(actionRequestVariableName, + ActionRequest.class.getName(), true, VariableInfo.AT_END); + VariableInfo info5 =3D new VariableInfo(actionResponseVariableName, + ActionResponse.class.getName(), true, VariableInfo.AT_END); + VariableInfo info6 =3D new VariableInfo(resourceRequestVariableName, + ResourceRequest.class.getName(), true, VariableInfo.AT_END); + VariableInfo info7 =3D new VariableInfo(resourceResponseVariableName, + ResourceResponse.class.getName(), true, VariableInfo.AT_END); + VariableInfo info8 =3D new VariableInfo(eventRequestVariableName, + EventRequest.class.getName(), true, VariableInfo.AT_END); + VariableInfo info9 =3D new VariableInfo(eventResponseVariableName, + EventResponse.class.getName(), true, VariableInfo.AT_END); + VariableInfo info10 =3D new VariableInfo(portletSessionVariableName, + PortletSession.class.getName(), true, VariableInfo.AT_END); + VariableInfo info11 =3D new VariableInfo(portletSessionScopeVariable= Name, + Map.class.getName(), true, VariableInfo.AT_END); + VariableInfo info12 =3D new VariableInfo(portletPreferencesVariableN= ame, + PortletPreferences.class.getName(), true, VariableInfo.AT_END); + VariableInfo info13 =3D new VariableInfo(portletPreferencesValuesVar= iableName, + Map.class.getName(), true, VariableInfo.AT_END); + + + + VariableInfo[] info =3D {info1, info2, info3, info4, info5, info6, i= nfo7, info8, info9, info10, info11, info12, info13}; + return info; + } +} Modified: modules/portlet/trunk/portlet/src/main/resources/org/jboss/portal= /portlet/portlet_2_0.tld =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/resources/org/jboss/portal/portl= et/portlet_2_0.tld 2008-02-04 13:53:04 UTC (rev 9743) +++ modules/portlet/trunk/portlet/src/main/resources/org/jboss/portal/portl= et/portlet_2_0.tld 2008-02-04 14:05:42 UTC (rev 9744) @@ -63,8 +63,8 @@ = defineObjects - org.jboss.portal.portlet.impl.jsr168.taglib.DefineObjects= Tag - org.jboss.portal.portlet.impl.jsr168.taglib.DefineObjects= TagTEI + org.jboss.portal.portlet.impl.jsr286.taglib.DefineObjects= 286Tag + org.jboss.portal.portlet.impl.jsr286.taglib.DefineObjects= 286TagTEI empty = --===============2935799484880982632==-- From portal-commits at lists.jboss.org Mon Feb 4 11:04:17 2008 Content-Type: multipart/mixed; boundary="===============3704143494818560227==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9745 - in modules/portlet/trunk: portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext and 8 other directories. Date: Mon, 04 Feb 2008 11:04:08 -0500 Message-ID: --===============3704143494818560227== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-04 11:04:08 -0500 (Mon, 04 Feb 2008) New Revision: 9745 Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/asp= ects/portlet/RequestAttributeConversationInterceptor.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/portletcontext/ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/portletcontext/ClearScopeTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/portletcontext/EventPhaseCreateNewScopeForRenderedScopesTestCa= se.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/portletcontext/RefreshScopedRenderPhaseTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/portletcontext/RenderURLCreateNewScopeTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/portletcontext/ScopePropagationToEventPhaseTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/portletcontext/ScopePropagationToRenderPhaseTestCase.java modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletcontext-= war/ modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletcontext-= war/WEB-INF/ modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletcontext-= war/WEB-INF/portlet.xml modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletcontext-= war/WEB-INF/web.xml Modified: modules/portlet/trunk/test/src/test/build.xml modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/j= boss-beans.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= jboss-beans.xml modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml Log: implementation of request scoped action attributes Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /aspects/portlet/RequestAttributeConversationInterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/as= pects/portlet/RequestAttributeConversationInterceptor.java = (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/as= pects/portlet/RequestAttributeConversationInterceptor.java 2008-02-04 16:04= :08 UTC (rev 9745) @@ -0,0 +1,314 @@ +/*************************************************************************= ***** + * 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.portlet.aspects.portlet; + +import org.jboss.portal.portlet.invocation.PortletInterceptor; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.portlet.invocation.ActionInvocation; +import org.jboss.portal.portlet.invocation.RenderInvocation; +import org.jboss.portal.portlet.invocation.EventInvocation; +import org.jboss.portal.portlet.invocation.ResourceInvocation; +import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStat= eResponse; +import org.jboss.portal.portlet.container.PortletContainer; +import org.jboss.portal.portlet.container.PortletContainerInvoker; +import org.jboss.portal.portlet.impl.info.ContainerPortletInfo; +import org.jboss.portal.portlet.impl.info.ContainerOptionInfo; +import org.jboss.portal.portlet.ParametersStateString; +import org.jboss.portal.common.invocation.InvocationException; +import org.jboss.portal.common.util.UUIDGenerator; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; +import javax.servlet.http.HttpSessionBindingListener; +import javax.servlet.http.HttpSessionBindingEvent; +import java.util.Map; +import java.util.HashMap; +import java.util.Collections; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class RequestAttributeConversationInterceptor extends PortletInterc= eptor +{ + + /** . */ + private static final UUIDGenerator generator =3D new UUIDGenerator(); + + protected Object invoke(PortletInvocation invocation) throws Exception,= InvocationException + { + PortletContainer container =3D (PortletContainer)invocation.getAttri= bute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CO= NTAINER); + ContainerPortletInfo containerInfo =3D (ContainerPortletInfo)contain= er.getInfo(); + + // + Map options =3D containerInfo.getOption= s(); + ContainerOptionInfo scopingOption =3D options.get("javax.portlet.act= ionScopedRequestAttributes"); + + // + boolean active =3D scopingOption !=3D null && "true".equals(scopingO= ption.getValues().get(0)); + + // + if (active) + { + if (invocation instanceof ActionInvocation) + { + return invoke((ActionInvocation)invocation); + } + else if (invocation instanceof EventInvocation) + { + return invoke((EventInvocation)invocation); + } + else if (invocation instanceof RenderInvocation) + { + return invoke((RenderInvocation)invocation); + } + else if (invocation instanceof ResourceInvocation) + { + return invoke((ResourceInvocation)invocation); + } + else + { + return invocation.invokeNext(); + } + } + else + { + return invocation.invokeNext(); + } + } + + private Object invoke(ActionInvocation actionInvocation) throws Excepti= on, InvocationException + { + return invokeWithConversation(new Conversation(), actionInvocation); + } + + private Object invoke(EventInvocation eventInvocation) throws Exception= , InvocationException + { + Conversation conversation =3D loadConversation(eventInvocation); + + // + if (conversation =3D=3D null || conversation.rendered) + { + conversation =3D new Conversation(); + } + + // + return invokeWithConversation(conversation, eventInvocation); + } + + private Object invoke(RenderInvocation renderInvocation) throws Excepti= on, InvocationException + { + Conversation conversation =3D loadConversation(renderInvocation); + + // + if (conversation !=3D null) + { + conversation.rendered =3D true; + + // + return invokeWithConversation(conversation, renderInvocation); + } + else + { + return renderInvocation.invokeNext(); + } + } + + private Object invoke(ResourceInvocation resourceInvocation) throws Exc= eption, InvocationException + { + return resourceInvocation.invokeNext(); + } + + private Conversation loadConversation(PortletInvocation invocation) + { + ParametersStateString parameters =3D (ParametersStateString)invocati= on.getNavigationalState(); + + // + if (parameters !=3D null) + { + String id =3D parameters.getValue("javax.portlet.as"); + + // + if (id !=3D null) + { + // Get the http session + HttpServletRequest request =3D invocation.getDispatchedRequest= (); + + // No need to create an unnecessary session + HttpSession session =3D request.getSession(false); + + // + if (session !=3D null) + { + // Generate key + String key =3D "org.jboss.portal.portlet.conversation." + i= d; + + // Get attributes + return (Conversation)session.getAttribute(key); + } + } + } + + // + return null; + } + + private Object invokeWithConversation(Conversation conversation, Portle= tInvocation invocation) throws Exception, InvocationException + { + invocation.setAttributes(conversation.getAttributes()); + + // Set the id parameter + ParametersStateString inNS =3D (ParametersStateString)invocation.get= NavigationalState(); + if (inNS =3D=3D null) + { + inNS =3D ParametersStateString.create(); + invocation.setNavigationalState(inNS); + } + inNS.setValue("javax.portlet.as", conversation.id); + + // + Object response =3D invocation.invokeNext(); + + // + if (response instanceof UpdateNavigationalStateResponse) + { + UpdateNavigationalStateResponse update =3D (UpdateNavigationalSta= teResponse)response; + + // + Map attributes =3D update.getAttributes(); + + // + if (attributes !=3D null && attributes.size() > 0) + { + ParametersStateString outNS =3D (ParametersStateString)update.= getNavigationalState(); + outNS.setValue("javax.portlet.as", conversation.id); + + // + conversation.setAttributes(attributes); + + // + if (!conversation.stored) + { + // Get the http session + HttpServletRequest request =3D invocation.getDispatchedRequ= est(); + + // + HttpSession session =3D request.getSession(); + + // + String key =3D "org.jboss.portal.portlet.conversation." + c= onversation.id; + + // + session.setAttribute(key, conversation); + } + } + else + { + if (conversation.stored) + { + // Get the http session + HttpServletRequest request =3D invocation.getDispatchedRequ= est(); + + // = + HttpSession session =3D request.getSession(); + + // + String key =3D "org.jboss.portal.portlet.conversation." + c= onversation.id; + + // + session.removeAttribute(key); + } + } + } + + // + return response; + } + + private static class Conversation implements HttpSessionBindingListener + { + + private static final Map EMPTY_ATTRIBUTES =3D Collec= tions.emptyMap(); + + /** . */ + private final String id =3D generator.generateKey(); + + /** . */ + private boolean rendered; + + /** . */ +// private long lastModifiedMillis; + + /** . */ + private Map attributes; + + /** . */ + private Map unmodifiableAttributes; + + /** . */ + private boolean stored; + + private Conversation() + { + this.rendered =3D false; + this.attributes =3D null; + this.unmodifiableAttributes =3D EMPTY_ATTRIBUTES; + } + + private Conversation(Map attributes) + { + this.rendered =3D false; + this.attributes =3D new HashMap(attributes); + this.unmodifiableAttributes =3D Collections.unmodifiableMap(attri= butes); + } + + public Map getAttributes() + { + return unmodifiableAttributes; + } + + public void setAttributes(Map attributes) + { + if (this.attributes =3D=3D null) + { + this.attributes =3D new HashMap(attributes); + this.unmodifiableAttributes =3D Collections.unmodifiableMap(th= is.attributes); + } + else + { + this.attributes.clear(); + this.attributes.putAll(attributes); + } + } + + public void valueBound(HttpSessionBindingEvent event) + { + this.stored =3D true; + } + + public void valueUnbound(HttpSessionBindingEvent event) + { + this.stored =3D false; + } + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/ext/portletcontext/ClearScopeTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/portletcontext/ClearScopeTestCase.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/portletcontext/ClearScopeTestCase.java 2008-02-04 16:04:08 UT= C (rev 9745) @@ -0,0 +1,115 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.ext.portletcontext; + +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.unit.actions.PortletActionTestAction; +import org.jboss.portal.unit.actions.PortletEventTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; +import static org.jboss.unit.api.Assert.*; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.PortletRequest; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)TestCase +public class ClearScopeTestCase +{ + public ClearScopeTestCase(PortletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID= )); + return new InvokeGetResponse(response.createActionURL().toStri= ng()); + } + }); + seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestActio= n() + { + protected void run(Portlet portlet, ActionRequest request, Action= Response response, PortletTestContext context) throws PortletException, IOE= xception + { + assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID= )); + request.setAttribute("foo", "foo"); + request.removeAttribute("foo"); + } + }); + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + assertEquals(null, request.getAttribute("foo")); + assertEquals(null, request.getParameter(PortletRequest.ACTION_= SCOPE_ID)); + + // + return new InvokeGetResponse(response.createActionURL().toStri= ng()); + } + }); + seq.bindAction(2, UTP1.ACTION_JOIN_POINT, new PortletActionTestActio= n() + { + protected void run(Portlet portlet, ActionRequest request, Action= Response response, PortletTestContext context) throws PortletException, IOE= xception + { + assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID= )); + request.setAttribute("foo", "foo"); + response.setEvent("Event", null); + } + }); + seq.bindAction(2, UTP1.EVENT_JOIN_POINT, new PortletEventTestAction() + { + protected void run(Portlet portlet, EventRequest request, EventRe= sponse response, PortletTestContext context) throws PortletException, IOExc= eption + { + assertNotNull(request.getParameter(PortletRequest.ACTION_SCOPE= _ID)); + assertEquals("foo", request.getAttribute("foo")); + request.removeAttribute("foo"); + } + }); + seq.bindAction(2, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + assertEquals(null, request.getAttribute("foo")); + assertEquals(null, request.getParameter(PortletRequest.ACTION_= SCOPE_ID)); + + // + return new EndTestResponse(); + } + }); + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/ext/portletcontext/EventPhaseCreateNewScopeForRenderedScopesTe= stCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/portletcontext/EventPhaseCreateNewScopeForRenderedScopesTestC= ase.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/portletcontext/EventPhaseCreateNewScopeForRenderedScopesTestC= ase.java 2008-02-04 16:04:08 UTC (rev 9745) @@ -0,0 +1,133 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.ext.portletcontext; + +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.unit.actions.PortletActionTestAction; +import org.jboss.portal.unit.actions.PortletEventTestAction; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.portal.test.portlet.framework.UTP2; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; +import static org.jboss.unit.api.Assert.*; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.PortletRequest; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)TestCase +public class EventPhaseCreateNewScopeForRenderedScopesTestCase +{ + + /** . */ + private String scopedId1; + + /** . */ + private String scopedId2; + + public EventPhaseCreateNewScopeForRenderedScopesTestCase(PortletTestCas= e seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID= )); + return new InvokeGetResponse(response.createActionURL().toStri= ng()); + } + }); + seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestActio= n() + { + protected void run(Portlet portlet, ActionRequest request, Action= Response response, PortletTestContext context) throws PortletException, IOE= xception + { + assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID= )); + request.setAttribute("foo", "foo_1"); + } + }); + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + scopedId1 =3D assertNotNull(request.getParameter(PortletReques= t.ACTION_SCOPE_ID)); + assertEquals("foo_1", request.getAttribute("foo")); + + // + return null; + } + }); + seq.bindAction(1, UTP2.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID= )); + return new InvokeGetResponse(response.createActionURL().toStri= ng()); + } + }); + seq.bindAction(2, UTP2.ACTION_JOIN_POINT, new PortletActionTestActio= n() + { + protected void run(Portlet portlet, ActionRequest request, Action= Response response, PortletTestContext context) throws PortletException, IOE= xception + { + // Send an event to UTP1 which should create a new scope + assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID= )); + response.setEvent("Event", null); + } + }); + seq.bindAction(2, UTP1.EVENT_JOIN_POINT, new PortletEventTestAction() + { + protected void run(Portlet portlet, EventRequest request, EventRe= sponse response, PortletTestContext context) throws PortletException, IOExc= eption + { + scopedId2 =3D assertNotNull(request.getParameter(PortletReques= t.ACTION_SCOPE_ID)); + assertNotEquals(scopedId1, scopedId2); + assertEquals(null, request.getAttribute("foo")); + + // + request.setAttribute("foo", "foo_2"); + } + }); + seq.bindAction(2, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + assertEquals(scopedId2, request.getParameter(PortletRequest.AC= TION_SCOPE_ID)); + assertEquals("foo_2", request.getAttribute("foo")); + + // + return new EndTestResponse(); + } + }); + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/ext/portletcontext/RefreshScopedRenderPhaseTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/portletcontext/RefreshScopedRenderPhaseTestCase.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/portletcontext/RefreshScopedRenderPhaseTestCase.java 2008-02-= 04 16:04:08 UTC (rev 9745) @@ -0,0 +1,161 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.ext.portletcontext; + +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.unit.actions.PortletActionTestAction; +import org.jboss.portal.unit.actions.PortletEventTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.portal.test.portlet.framework.UTP2; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; +import static org.jboss.unit.api.Assert.*; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.PortletRequest; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)TestCase +public class RefreshScopedRenderPhaseTestCase +{ + + /** . */ + private String scopedId1; + + /** . */ + private String scopedId2; + + /** . */ + private String refresh1; + + /** . */ + private String refresh2; + + public RefreshScopedRenderPhaseTestCase(PortletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID= )); + return new InvokeGetResponse(response.createActionURL().toStri= ng()); + } + }); + seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestActio= n() + { + protected void run(Portlet portlet, ActionRequest request, Action= Response response, PortletTestContext context) throws PortletException, IOE= xception + { + assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID= )); + request.setAttribute("foo", "foo_1"); + } + }); + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + scopedId1 =3D assertNotNull(request.getParameter(PortletReques= t.ACTION_SCOPE_ID)); + assertEquals("foo_1", request.getAttribute("foo")); + + // + return new InvokeGetResponse(response.createActionURL().toStri= ng()); + } + }); + seq.bindAction(1, UTP2.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + refresh1 =3D response.createRenderURL().toString(); + + // + return null; + } + }); + seq.bindAction(2, UTP1.ACTION_JOIN_POINT, new PortletActionTestActio= n() + { + protected void run(Portlet portlet, ActionRequest request, Action= Response response, PortletTestContext context) throws PortletException, IOE= xception + { + assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID= )); + request.setAttribute("foo", "foo_2"); + } + }); + seq.bindAction(2, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + scopedId2 =3D assertNotNull(request.getParameter(PortletReques= t.ACTION_SCOPE_ID)); + assertNotEquals(scopedId1, scopedId2); + assertEquals("foo_2", request.getAttribute("foo")); + + // + return new InvokeGetResponse(refresh1); + } + }); + seq.bindAction(2, UTP2.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + refresh2 =3D response.createRenderURL().toString(); + + // + return null; + } + }); + seq.bindAction(3, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + assertEquals(scopedId1, request.getParameter(PortletRequest.AC= TION_SCOPE_ID)); + assertEquals("foo_1", request.getAttribute("foo")); + + // + return new InvokeGetResponse(refresh2); + } + }); + seq.bindAction(4, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + assertEquals(scopedId2, request.getParameter(PortletRequest.AC= TION_SCOPE_ID)); + assertEquals("foo_2", request.getAttribute("foo")); + + // + return new EndTestResponse(); + } + }); + } +} \ No newline at end of file Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/ext/portletcontext/RenderURLCreateNewScopeTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/portletcontext/RenderURLCreateNewScopeTestCase.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/portletcontext/RenderURLCreateNewScopeTestCase.java 2008-02-0= 4 16:04:08 UTC (rev 9745) @@ -0,0 +1,94 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.ext.portletcontext; + +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.unit.actions.PortletActionTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; +import static org.jboss.unit.api.Assert.*; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.PortletRequest; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)TestCase +public class RenderURLCreateNewScopeTestCase +{ + + public RenderURLCreateNewScopeTestCase(PortletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID= )); + return new InvokeGetResponse(response.createActionURL().toStri= ng()); + } + }); + seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestActio= n() + { + protected void run(Portlet portlet, ActionRequest request, Action= Response response, PortletTestContext context) throws PortletException, IOE= xception + { + assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID= )); + request.setAttribute("foo", "foo_1"); + } + }); + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + assertNotNull(request.getParameter(PortletRequest.ACTION_SCOPE= _ID)); + assertEquals("foo_1", request.getAttribute("foo")); + + // + return new InvokeGetResponse(response.createRenderURL().toStri= ng()); + } + }); + seq.bindAction(2, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID= )); + assertEquals(null, request.getAttribute("foo")); + + // + return new EndTestResponse(); + } + }); + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/ext/portletcontext/ScopePropagationToEventPhaseTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/portletcontext/ScopePropagationToEventPhaseTestCase.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/portletcontext/ScopePropagationToEventPhaseTestCase.java 2008= -02-04 16:04:08 UTC (rev 9745) @@ -0,0 +1,129 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.ext.portletcontext; + +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.unit.actions.PortletActionTestAction; +import org.jboss.portal.unit.actions.PortletEventTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.portal.test.portlet.framework.UTP2; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; +import static org.jboss.unit.api.Assert.*; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)TestCase +public class ScopePropagationToEventPhaseTestCase +{ + public ScopePropagationToEventPhaseTestCase(PortletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + return new InvokeGetResponse(response.createActionURL().toStri= ng()); + } + }); + seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestActio= n() + { + protected void run(Portlet portlet, ActionRequest request, Action= Response response, PortletTestContext context) throws PortletException, IOE= xception + { + request.setAttribute("action_attr1", "action_attr1_action_valu= e"); + request.setAttribute("action_attr2", "action_attr2_action_valu= e"); + request.setAttribute("action_attr3", "action_attr3_action_valu= e"); + request.setAttribute("action_attr4", "action_attr4_action_valu= e"); + response.setEvent("Event", null); + } + }); + seq.bindAction(1, UTP1.EVENT_JOIN_POINT, new PortletEventTestAction() + { + protected void run(Portlet portlet, EventRequest request, EventRe= sponse response, PortletTestContext context) throws PortletException, IOExc= eption + { + if (request.getEvent().getValue() =3D=3D null) + { + assertEquals("action_attr1_action_value", request.getAttrib= ute("action_attr1")); + assertEquals("action_attr2_action_value", request.getAttrib= ute("action_attr2")); + assertEquals("action_attr3_action_value", request.getAttrib= ute("action_attr3")); + assertEquals("action_attr4_action_value", request.getAttrib= ute("action_attr4")); + + // + request.setAttribute("action_attr2", "action_attr2_event0_v= alue"); + request.setAttribute("action_attr3", "action_attr3_event0_v= alue"); + request.setAttribute("event_attr1", "event_attr1_event0_val= ue"); + request.setAttribute("event_attr2", "event_attr2_event0_val= ue"); + + // + response.setEvent("Event", "this string is a non null objec= t"); + } + else + { + assertEquals("action_attr1_action_value", request.getAttrib= ute("action_attr1")); + assertEquals("action_attr2_event0_value", request.getAttrib= ute("action_attr2")); + assertEquals("action_attr3_event0_value", request.getAttrib= ute("action_attr3")); + assertEquals("action_attr4_action_value", request.getAttrib= ute("action_attr4")); + assertEquals("event_attr1_event0_value", request.getAttribu= te("event_attr1")); + assertEquals("event_attr2_event0_value", request.getAttribu= te("event_attr2")); + + // + request.setAttribute("action_attr3", "action_attr3_event1_v= alue"); + request.setAttribute("action_attr4", "action_attr3_event1_v= alue"); + request.setAttribute("event_attr2", "event_attr2_event1_val= ue"); + request.setAttribute("event_attr3", "event_attr3_event1_val= ue"); + } + } + }); + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + assertEquals("action_attr1_action_value", request.getAttribute= ("action_attr1")); + assertEquals("action_attr2_event0_value", request.getAttribute= ("action_attr2")); + assertEquals("action_attr3_event1_value", request.getAttribute= ("action_attr3")); + assertEquals("action_attr3_event1_value", request.getAttribute= ("action_attr4")); + assertEquals("event_attr1_event0_value", request.getAttribute(= "event_attr1")); + assertEquals("event_attr2_event1_value", request.getAttribute(= "event_attr2")); + assertEquals("event_attr3_event1_value", request.getAttribute(= "event_attr3")); + + // + return new EndTestResponse(); + } + }); + } +} \ No newline at end of file Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/ext/portletcontext/ScopePropagationToRenderPhaseTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/portletcontext/ScopePropagationToRenderPhaseTestCase.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/portletcontext/ScopePropagationToRenderPhaseTestCase.java 200= 8-02-04 16:04:08 UTC (rev 9745) @@ -0,0 +1,81 @@ +/*************************************************************************= ***** + * 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.portlet.jsr286.ext.portletcontext; + +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.unit.actions.PortletActionTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; +import static org.jboss.unit.api.Assert.*; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.PortletRequest; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)TestCase +public class ScopePropagationToRenderPhaseTestCase +{ + public ScopePropagationToRenderPhaseTestCase(PortletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID= )); + return new InvokeGetResponse(response.createActionURL().toStri= ng()); + } + }); + seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestActio= n() + { + protected void run(Portlet portlet, ActionRequest request, Action= Response response, PortletTestContext context) throws PortletException, IOE= xception + { + assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID= )); + request.setAttribute("foo", "bar"); + } + }); + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + assertNotNull(request.getParameter(PortletRequest.ACTION_SCOPE= _ID)); + Object bar =3D request.getAttribute("foo"); + assertEquals("bar", bar); + return new EndTestResponse(); + } + }); + } +} Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-04 14:05:42 UTC (= rev 9744) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-04 16:04:08 UTC (= rev 9745) @@ -375,6 +375,7 @@ + = Added: modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletcont= ext-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletcontext= -war/WEB-INF/portlet.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletcontext= -war/WEB-INF/portlet.xml 2008-02-04 16:04:08 UTC (rev 9745) @@ -0,0 +1,63 @@ + + + + + + + UniversalTestPortletA + org.jboss.portal.test.portlet.framework.UTP1 + + text/html + + + Event + + + Event + + + javax.portlet.actionScopedRequestAttributes + true + + + + + UniversalTestPortletB + org.jboss.portal.test.portlet.framework.UTP2 + + text/html + + + Event + + + + + Event + + + Added: modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletcont= ext-war/WEB-INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletcontext= -war/WEB-INF/web.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletcontext= -war/WEB-INF/web.xml 2008-02-04 16:04:08 UTC (rev 9745) @@ -0,0 +1,32 @@ + + + + + + + org.jboss.portal.unit.PortletTestSuite + + Modified: modules/portlet/trunk/test/src/test/resources/portlet-test-war/WE= B-INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/= jboss-beans.xml 2008-02-04 14:05:42 UTC (rev 9744) +++ modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/= jboss-beans.xml 2008-02-04 16:04:08 UTC (rev 9745) @@ -83,6 +83,7 @@ + @@ -90,6 +91,7 @@ + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-beans.xml 2008-02-04 14:05:42 UTC (rev 9744) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-beans.xml 2008-02-04 16:04:08 UTC (rev 9745) @@ -71,6 +71,7 @@ + @@ -78,6 +79,7 @@ + Modified: modules/portlet/trunk/test/src/test/resources/test/remote-jboss-u= nit.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xm= l 2008-02-04 14:05:42 UTC (rev 9744) +++ modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xm= l 2008-02-04 16:04:08 UTC (rev 9745) @@ -215,6 +215,10 @@ + + + + = = + + + + = @@ -730,12 +733,26 @@ = = - + + + - = + = + + + + + + + + =
= + + \ No newline at end of file --===============0962469652859155009==-- From portal-commits at lists.jboss.org Tue Feb 5 01:44:49 2008 Content-Type: multipart/mixed; boundary="===============6293299680963006426==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9765 - branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command. Date: Tue, 05 Feb 2008 01:44:48 -0500 Message-ID: --===============6293299680963006426== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sohil.shah(a)jboss.com Date: 2008-02-05 01:44:48 -0500 (Tue, 05 Feb 2008) New Revision: 9765 Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/= jcr/command/FileUpdateAndVersionCommand.java branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/= jcr/command/FileUpdateCommand.java Log: JBPORTAL-1801 - CMS content shows incorrect 'Created' and 'Modified' timest= amps Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cm= s/impl/jcr/command/FileUpdateAndVersionCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl= /jcr/command/FileUpdateAndVersionCommand.java 2008-02-05 06:12:30 UTC (rev = 9764) +++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl= /jcr/command/FileUpdateAndVersionCommand.java 2008-02-05 06:44:48 UTC (rev = 9765) @@ -58,12 +58,14 @@ Node contentNode =3D (Node)context.getSession().getItem(mFile.get= Content().getBasePath()); contentNode.checkout(); = + DateValue timestamp =3D new DateValue(Calendar.getInstance()); + = contentNode.setProperty("portalcms:description", mFile.getContent= ().getDescription()); contentNode.setProperty("portalcms:title", mFile.getContent().get= Title()); contentNode.setProperty("portalcms:language", mFile.getContent().= getLocale().getLanguage()); contentNode.setProperty("jcr:encoding", "UTF-8"); contentNode.setProperty("jcr:data", new BinaryValue(mFile.getCont= ent().getBytes())); - contentNode.setProperty("jcr:lastModified", new DateValue(Calenda= r.getInstance())); + contentNode.setProperty("jcr:lastModified", timestamp); = if (mFile.getContent().getMimeType() !=3D null) { @@ -87,6 +89,11 @@ //make a new version live version Node versionNode =3D (Node)context.getSession().getItem(mFile.get= Content().getBasePath()); VersionUtil.createVersion(versionNode, this.bMakeLive); + = + //Update the lastModified Property of the FileNode of this content + Node fileNode =3D (Node)context.getSession().getItem(mFile.getBas= ePath()); + fileNode.setProperty("jcr:lastModified", timestamp); + fileNode.save(); } catch (Exception e) { Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cm= s/impl/jcr/command/FileUpdateCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl= /jcr/command/FileUpdateCommand.java 2008-02-05 06:12:30 UTC (rev 9764) +++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl= /jcr/command/FileUpdateCommand.java 2008-02-05 06:44:48 UTC (rev 9765) @@ -55,13 +55,15 @@ { Node contentNode =3D (Node)context.getSession().getItem(mFile.get= Content().getBasePath()); contentNode.checkout(); + = + DateValue timestamp =3D new DateValue(Calendar.getInstance()); = contentNode.setProperty("portalcms:description", mFile.getContent= ().getDescription()); contentNode.setProperty("portalcms:title", mFile.getContent().get= Title()); contentNode.setProperty("portalcms:language", mFile.getContent().= getLocale().getLanguage()); contentNode.setProperty("jcr:encoding", "UTF-8"); contentNode.setProperty("jcr:data", new BinaryValue(mFile.getCont= ent().getBytes())); - contentNode.setProperty("jcr:lastModified", new DateValue(Calenda= r.getInstance())); + contentNode.setProperty("jcr:lastModified", timestamp); = if (mFile.getContent().getMimeType() !=3D null) { @@ -81,6 +83,11 @@ } } contentNode.save(); + = + //Update the lastModified Property of the FileNode of this content + Node fileNode =3D (Node)context.getSession().getItem(mFile.getBas= ePath()); + fileNode.setProperty("jcr:lastModified", timestamp); + fileNode.save(); } catch (Exception e) { --===============6293299680963006426==-- From portal-commits at lists.jboss.org Tue Feb 5 06:29:48 2008 Content-Type: multipart/mixed; boundary="===============1863443863003488872==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9766 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Tue, 05 Feb 2008 06:29:47 -0500 Message-ID: --===============1863443863003488872== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-05 06:29:47 -0500 (Tue, 05 Feb 2008) New Revision: 9766 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configur= ation.xml Log: revising 3.1. Changing the Port Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/c= onfiguration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configu= ration.xml 2008-02-05 06:44:48 UTC (rev 9765) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configu= ration.xml 2008-02-05 11:29:47 UTC (rev 9766) @@ -14,12 +14,12 @@ Customizing your Installation - This chapter describes how to customize a default installation of JBos= s Portal. This includes the listening port, email and proxy settings, and d= atabase dialect settings. For further configuration details, please see and . + This chapter describes how to customize the default installation. This= includes the JBoss EAP or JBoss AS listening port, email and proxy setting= s, and database dialect settings. For further configuration details, please= see and . Changing the Port - It is common for web services to run on port 80, instead of the JBo= ss EAP and JBoss AS default port of 8080. If you can not use po= rt forwarding, it is recommended to change the default port in $JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml. To change the default port, open the $JBOSS_HOME/server/de= fault/deploy/jboss-web.deployer/server.xml file, and edit the Connector port value for the jboss.web service: + It is common for web services to run on port 80. By default, JBoss = EAP and JBoss AS use port 8080. If you can not use port forward= ing, it is recommended to change the port JBoss EAP or JBoss AS lis= tens on. To change the default port, open the $JBOSS_HOME/server/= default/deploy/jboss-web.deployer/server.xml file, and edit the = Connector port value for the jboss.web service: @@ -31,19 +31,19 @@ This example changes the default port to port 8088. The JBoss EAP or JBo= ss AS server must be restarted before the new port settings will take affec= t. - The default SSL port is 8843. To enable HTTPS support, refer to JBoss AS Guide. For further information, please see the Tomcat's SS= L configuration how-to. - - + The default SSL port is 8843. To enable HTTPS support, refer to the JBoss AS Guide. For further information, please see the <= ulink url=3D"http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html">Tomcat= 's SSL configuration how-to. + + + Please refer to to update the WSRP servic= e after having changed the port. + + - root user priviliges + Root user Privileges Linux systems require root user privileges to run a server on a p= ort less than 1024. Starting JBoss EAP or JBoss AS on port 80 as a non-priv= ileged user will not work. Running JBoss EAP or JBoss AS as the root user c= ould lead to security breaches. - - Please refer to to update the WSRP= service after having changed the port. - Changing the context path --===============1863443863003488872==-- From portal-commits at lists.jboss.org Tue Feb 5 06:38:42 2008 Content-Type: multipart/mixed; boundary="===============6697435394692622607==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9767 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test: controller and 1 other directories. Date: Tue, 05 Feb 2008 06:38:39 -0500 Message-ID: --===============6697435394692622607== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-05 06:38:38 -0500 (Tue, 05 Feb 2008) New Revision: 9767 Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/W= indowNavigationalState.java Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/T= estPortletInvocationContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletController.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletRequestHandler.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletResourceRequestHandler.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/PageUpdateRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/PortletControllerContextImpl.java Log: - actually delegate to the PortletControllerContext the createion of hte Po= rtalInvocationContext, this way the controller does not care about context = managmeent Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/TestPortletInvocationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= TestPortletInvocationContext.java 2008-02-05 11:29:47 UTC (rev 9766) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= TestPortletInvocationContext.java 2008-02-05 11:38:38 UTC (rev 9767) @@ -23,8 +23,8 @@ package org.jboss.portal.portlet.test; = import org.jboss.portal.portlet.ContainerURL; -import org.jboss.portal.portlet.test.controller.PortletControllerContext; import org.jboss.portal.portlet.test.controller.PageNavigationalState; +import org.jboss.portal.portlet.test.controller2.PortletURLRenderer; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext; import org.jboss.portal.common.util.MarkupInfo; @@ -42,7 +42,7 @@ { = /** . */ - private final PortletControllerContext controllerContext; + private final PortletURLRenderer urlRenderer; = /** . */ private final String windowId; @@ -50,8 +50,15 @@ /** . */ private final PageNavigationalState pageState; = + /** . */ + private final HttpServletRequest clientRequest; + + /** . */ + private final HttpServletResponse clientResponse; + public TestPortletInvocationContext( - PortletControllerContext controllerContext, + HttpServletRequest clientRequest, + HttpServletResponse clientResponse, String windowId, PageNavigationalState pageState, MarkupInfo markupInfo) @@ -59,12 +66,14 @@ super(markupInfo); = // + this.clientRequest =3D clientRequest; + this.clientResponse =3D clientResponse; this.windowId =3D windowId; this.pageState =3D pageState; - this.controllerContext =3D controllerContext; + this.urlRenderer =3D new PortletURLRenderer(pageState, windowId, cli= entRequest, clientResponse); = // - addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttribut= eResolver(controllerContext.getClientRequest())); + addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttribut= eResolver(clientRequest)); addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeReso= lver()); addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, new MapAttri= buteResolver()); addResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, new MapAttr= ibuteResolver()); @@ -73,16 +82,16 @@ = public HttpServletRequest getClientRequest() throws IllegalStateExcepti= on { - return controllerContext.getClientRequest(); + return clientRequest; } = public HttpServletResponse getClientResponse() throws IllegalStateExcep= tion { - return controllerContext.getClientResponse(); + return clientResponse; } = public String renderURL(ContainerURL containerURL, Boolean wantSecure, = Boolean wantAuthenticated, boolean relative) { - return controllerContext.renderURL(windowId, pageState, containerURL= , wantSecure, wantAuthenticated, relative); + return urlRenderer.renderURL(containerURL, wantSecure, wantAuthentic= ated, relative); } } Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/WindowNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= WindowNavigationalState.java 2008-02-05 11:29:47 UTC (rev 9766) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= WindowNavigationalState.java 2008-02-05 11:38:38 UTC (rev 9767) @@ -1,75 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.test; - -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; -import org.jboss.portal.portlet.StateString; - -import java.io.Serializable; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -public class WindowNavigationalState implements Serializable -{ - - /** . */ - private final StateString portletNavigationalState; - - /** . */ - private final Mode mode; - - /** . */ - private final WindowState windowState; - - public WindowNavigationalState() - { - this.portletNavigationalState =3D null; - this.mode =3D Mode.VIEW; - this.windowState =3D WindowState.NORMAL; - } - - public WindowNavigationalState(StateString portletNavigationalState, Mo= de mode, WindowState windowState) - { - this.portletNavigationalState =3D portletNavigationalState; - this.mode =3D mode; - this.windowState =3D windowState; - } - - public StateString getPortletNavigationalState() - { - return portletNavigationalState; - } - - public Mode getMode() - { - return mode; - } - - public WindowState getWindowState() - { - return windowState; - } -} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletController.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletController.java 2008-02-05 11:29:47 UTC (rev 9766) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletController.java 2008-02-05 11:38:38 UTC (rev 9767) @@ -38,10 +38,6 @@ */ public class PortletController { - - /** . */ - public static final MarkupInfo MARKUP_INFO =3D new MarkupInfo(MediaType= .HTML, "UTF8"); - public ControllerResponse process(ControllerRequest controllerRequest) = throws IOException, PortletInvokerException { RequestHandler handler; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContext.java 2008-02-05 11:29:47 UTC (rev 9766) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContext.java 2008-02-05 11:38:38 UTC (rev 9767) @@ -22,9 +22,8 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.controller; = -import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.ContainerURL; +import org.jboss.portal.portlet.spi.PortletInvocationContext; import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.invocation.ActionInvocation; @@ -55,6 +54,8 @@ = PortletInfo getPortletInfo(String windowId) throws PortletInvokerExcept= ion; = + PortletInvocationContext createPortletInvocationContext(String windowId= , PageNavigationalState pageState); + PortletInvocationResponse invoke(String windowId, ActionInvocation acti= onInvocation) throws PortletInvokerException; = PortletInvocationResponse invoke(String windowId, List requestC= ookies, EventInvocation eventInvocation) throws PortletInvokerException; @@ -63,15 +64,6 @@ = EventControllerContext getEventControllerContext(); = - String renderURL( - String windowId, - PageNavigationalState pageState, - ContainerURL containerURL, - Boolean wantSecure, - Boolean wantAuthenticated, - boolean relative); - - // To be removed, now only used in controller2 PortletInvocationResponse invoke(PortletInvocation invocation) throws P= ortletInvokerException; } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletRequestHandler.java 2008-02-05 11:29:47 UTC (rev 9766) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletRequestHandler.java 2008-02-05 11:38:38 UTC (rev 9767) @@ -9,6 +9,7 @@ import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.spi.PortletInvocationContext; import org.jboss.portal.portlet.info.NavigationInfo; import org.jboss.portal.portlet.info.ParameterInfo; import org.jboss.portal.portlet.info.PortletInfo; @@ -205,11 +206,7 @@ = // ParameterMap publicNS =3D pageState.getPublicNavigationalState(po= rtlet); - TestPortletInvocationContext portletInvocationContext =3D new Tes= tPortletInvocationContext( - context, - portletRequest.getWindowId(), - pageState, - MARKUP_INFO); + PortletInvocationContext portletInvocationContext =3D context.cre= atePortletInvocationContext(portletRequest.getWindowId(), pageState); ActionInvocation actionInvocation =3D new ActionInvocation(portle= tInvocationContext); = // @@ -244,12 +241,8 @@ ParameterMap publicNS =3D pageState.getPublicNavigationalState(portl= et); = // - TestPortletInvocationContext actionContext =3D new TestPortletInvoca= tionContext( - context, - event.getWindowId(), - pageState, - MARKUP_INFO); - EventInvocation eventInvocation =3D new EventInvocation(actionContex= t); + PortletInvocationContext portletInvocationContext =3D context.create= PortletInvocationContext(event.getWindowId(), pageState); + EventInvocation eventInvocation =3D new EventInvocation(portletInvoc= ationContext); = // eventInvocation.setMode(windowNS.getMode()); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletResourceRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletResourceRequestHandler.java 2008-02-05 11:29:47 UTC (rev = 9766) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletResourceRequestHandler.java 2008-02-05 11:38:38 UTC (rev = 9767) @@ -28,14 +28,13 @@ import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.spi.PortletInvocationContext; import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.cache.CacheLevel; import org.jboss.portal.portlet.invocation.ResourceInvocation; import org.jboss.portal.portlet.invocation.response.ErrorResponse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.test.TestPortletInvocationContext; -import static org.jboss.portal.portlet.test.controller.PortletController.*; import org.jboss.portal.portlet.test.controller.request.ControllerRequest; import org.jboss.portal.portlet.test.controller.request.PageScopedFullPort= letResourceRequest; import org.jboss.portal.portlet.test.controller.request.PortletResourceReq= uest; @@ -82,7 +81,7 @@ // Mode mode =3D null; WindowState windowState =3D null; - PageNavigationalState pageNS =3D null; + PageNavigationalState pageState =3D null; ParameterMap publicNS =3D null; StateString portletNS =3D null; CacheLevel cacheability; @@ -104,13 +103,13 @@ if (portletResourceRequest instanceof PageScopedFullPortletResour= ceRequest) { PageScopedFullPortletResourceRequest pageScopedRequest =3D (Pa= geScopedFullPortletResourceRequest)portletResourceRequest; - pageNS =3D pageScopedRequest.getPageState(); + pageState =3D pageScopedRequest.getPageState(); cacheability =3D CacheLevel.PAGE; = // - if (pageNS !=3D null) + if (pageState !=3D null) { - publicNS =3D pageNS.getPublicNavigationalState(portlet); + publicNS =3D pageState.getPublicNavigationalState(portlet); } } else @@ -134,12 +133,8 @@ } = // - TestPortletInvocationContext resourceInvocationContext =3D new TestP= ortletInvocationContext( - context, - portletResourceRequest.getWindowId(), - pageNS, - MARKUP_INFO); - ResourceInvocation resourceInvocation =3D new ResourceInvocation(res= ourceInvocationContext); + PortletInvocationContext portletInvocationContext =3D context.create= PortletInvocationContext(portletResourceRequest.getWindowId(), pageState); + ResourceInvocation resourceInvocation =3D new ResourceInvocation(por= tletInvocationContext); = // resourceInvocation.setResourceId(portletResourceRequest.getResourceI= d()); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller2/PageUpdateRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PageUpdateRenderer.java 2008-02-05 11:29:47 UTC (rev 9766) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PageUpdateRenderer.java 2008-02-05 11:38:38 UTC (rev 9767) @@ -31,6 +31,7 @@ import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.spi.PortletInvocationContext; import org.jboss.portal.portlet.impl.spi.AbstractClientContext; import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; import org.jboss.portal.portlet.impl.spi.AbstractServerContext; @@ -44,10 +45,8 @@ import org.jboss.portal.portlet.test.TestInstanceContext; import org.jboss.portal.portlet.test.controller.WindowNavigationalState; import org.jboss.portal.portlet.test.TestPortalContext; -import org.jboss.portal.portlet.test.TestPortletInvocationContext; import org.jboss.portal.portlet.test.controller.PageNavigationalState; import org.jboss.portal.portlet.test.controller.PortletControllerContext; -import org.jboss.portal.portlet.test.controller.PortletController; import org.jboss.portal.portlet.test.controller.response.PageUpdate; import org.w3c.dom.Element; = @@ -229,11 +228,7 @@ // TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), false); = - TestPortletInvocationContext renderContext =3D new TestPortletInvoca= tionContext( - context, - portlet.getContext().getId(), - pageNS, - PortletController.MARKUP_INFO); + PortletInvocationContext renderContext =3D context.createPortletInvo= cationContext(portlet.getContext().getId(), pageNS); = // RenderInvocation render =3D new RenderInvocation(renderContext); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller2/PortletControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PortletControllerContextImpl.java 2008-02-05 11:29:47 UTC (rev = 9766) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PortletControllerContextImpl.java 2008-02-05 11:38:38 UTC (rev = 9767) @@ -27,6 +27,8 @@ import org.jboss.portal.common.io.IOTools; import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.common.util.Tools; +import org.jboss.portal.common.util.MarkupInfo; +import org.jboss.portal.common.util.MediaType; import org.jboss.portal.portlet.ParametersStateString; import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletContext; @@ -34,6 +36,7 @@ import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.ContainerURL; +import org.jboss.portal.portlet.spi.PortletInvocationContext; import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.impl.spi.AbstractClientContext; import org.jboss.portal.portlet.impl.spi.AbstractServerContext; @@ -50,7 +53,7 @@ import org.jboss.portal.portlet.test.StringCodec; import org.jboss.portal.portlet.test.TestInstanceContext; import org.jboss.portal.portlet.test.TestPortalContext; -import org.jboss.portal.portlet.test.controller2.PortletURLRenderer; +import org.jboss.portal.portlet.test.TestPortletInvocationContext; import static org.jboss.portal.portlet.test.URLParameterConstants.*; import org.jboss.portal.portlet.test.controller.WindowNavigationalState; import org.jboss.portal.portlet.test.controller.PortletControllerContext; @@ -84,6 +87,9 @@ { = /** . */ + public static final MarkupInfo MARKUP_INFO =3D new MarkupInfo(MediaType= .HTML, "UTF8"); + + /** . */ public static final int NAV_SCOPE =3D 0; = /** . */ @@ -368,4 +374,9 @@ = return invoke(resourceInvocation); } + + public PortletInvocationContext createPortletInvocationContext(String w= indowId, PageNavigationalState pageState) + { + return new TestPortletInvocationContext(req, resp, windowId, pageSta= te, MARKUP_INFO); + } } --===============6697435394692622607==-- From portal-commits at lists.jboss.org Tue Feb 5 08:17:15 2008 Content-Type: multipart/mixed; boundary="===============0621250764120727295==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9768 - branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command. Date: Tue, 05 Feb 2008 08:17:15 -0500 Message-ID: --===============0621250764120727295== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-05 08:17:15 -0500 (Tue, 05 Feb 2008) New Revision: 9768 Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/= jcr/command/FileCreateCommand.java branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/= jcr/command/FileUpdateAndVersionCommand.java branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/= jcr/command/FileUpdateCommand.java Log: Update folder last modified timestamp Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cm= s/impl/jcr/command/FileCreateCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl= /jcr/command/FileCreateCommand.java 2008-02-05 11:38:38 UTC (rev 9767) +++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl= /jcr/command/FileCreateCommand.java 2008-02-05 13:17:15 UTC (rev 9768) @@ -59,6 +59,7 @@ Node parentNode =3D (Node)context.getSession().getItem(parentP= ath); Node fileNode =3D parentNode.addNode(nodeName, "portalcms:file= "); parentNode.setProperty("jcr:lastModified", new DateValue(Calen= dar.getInstance())); + parentNode.setProperty("portalcms:lastmodified", new DateValue= (Calendar.getInstance())); fileNode.setProperty("jcr:lastModified", new DateValue(Calenda= r.getInstance())); parentNode.save(); } Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cm= s/impl/jcr/command/FileUpdateAndVersionCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl= /jcr/command/FileUpdateAndVersionCommand.java 2008-02-05 11:38:38 UTC (rev = 9767) +++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl= /jcr/command/FileUpdateAndVersionCommand.java 2008-02-05 13:17:15 UTC (rev = 9768) @@ -84,7 +84,6 @@ contentNode.setProperty("jcr:mimeType", "application/octet-= stream"); } } - contentNode.save(); = //make a new version live version Node versionNode =3D (Node)context.getSession().getItem(mFile.get= Content().getBasePath()); @@ -93,7 +92,12 @@ //Update the lastModified Property of the FileNode of this content Node fileNode =3D (Node)context.getSession().getItem(mFile.getBas= ePath()); fileNode.setProperty("jcr:lastModified", timestamp); - fileNode.save(); + = + // Update the folder modified date + fileNode.getParent().setProperty("portalcms:lastmodified", timest= amp); + + contentNode.getSession().save(); + } catch (Exception e) { Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cm= s/impl/jcr/command/FileUpdateCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl= /jcr/command/FileUpdateCommand.java 2008-02-05 11:38:38 UTC (rev 9767) +++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl= /jcr/command/FileUpdateCommand.java 2008-02-05 13:17:15 UTC (rev 9768) @@ -29,6 +29,7 @@ import org.jboss.portal.cms.model.File; = import javax.jcr.Node; + import java.util.Calendar; = /** @author Roy Russo */ @@ -82,12 +83,15 @@ contentNode.setProperty("jcr:mimeType", "application/octet-= stream"); } } - contentNode.save(); = //Update the lastModified Property of the FileNode of this content Node fileNode =3D (Node)context.getSession().getItem(mFile.getBas= ePath()); fileNode.setProperty("jcr:lastModified", timestamp); - fileNode.save(); + = + // Update the folder modified date + fileNode.getParent().setProperty("portalcms:lastmodified", timest= amp); + + contentNode.getSession().save(); } catch (Exception e) { @@ -95,4 +99,5 @@ } return null; } + = } --===============0621250764120727295==-- From portal-commits at lists.jboss.org Tue Feb 5 08:30:18 2008 Content-Type: multipart/mixed; boundary="===============7641106565630802842==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9769 - tags. Date: Tue, 05 Feb 2008 08:30:18 -0500 Message-ID: --===============7641106565630802842== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-05 08:30:18 -0500 (Tue, 05 Feb 2008) New Revision: 9769 Added: tags/JBoss_Portal_2_6_4/ Log: Tagging 2.6.4 Copied: tags/JBoss_Portal_2_6_4 (from rev 9768, branches/JBoss_Portal_Branc= h_2_6) --===============7641106565630802842==-- From portal-commits at lists.jboss.org Tue Feb 5 08:37:45 2008 Content-Type: multipart/mixed; boundary="===============8408871349129691162==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9770 - in modules/portlet/trunk/test/src: main/java/org/jboss/portal/portlet/test/controller2 and 2 other directories. Date: Tue, 05 Feb 2008 08:37:45 -0500 Message-ID: --===============8408871349129691162== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-05 08:37:45 -0500 (Tue, 05 Feb 2008) New Revision: 9770 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/TestInstanceContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/TestPortalContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/TestPortletInvocationContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/TestPortletInvoker.java Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletRequestHandler.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/PageUpdateRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/PortletControllerContextImpl.java modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/j= boss-beans.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= jboss-beans.xml Log: moved Test*Context to controller2 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContext.java 2008-02-05 13:30:18 UTC (rev 9769) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContext.java 2008-02-05 13:37:45 UTC (rev 9770) @@ -31,7 +31,6 @@ import org.jboss.portal.portlet.invocation.ResourceInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.test.controller.event.EventControllerConte= xt; -import org.jboss.portal.portlet.test.TestInstanceContext; = import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletRequestHandler.java 2008-02-05 13:30:18 UTC (rev 9769) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletRequestHandler.java 2008-02-05 13:37:45 UTC (rev 9770) @@ -20,8 +20,6 @@ import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.ResponseProperties; import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStat= eResponse; -import org.jboss.portal.portlet.test.TestPortletInvocationContext; -import static org.jboss.portal.portlet.test.controller.PortletController.*; import org.jboss.portal.portlet.test.controller.event.Event; import org.jboss.portal.portlet.test.controller.event.EventControllerConte= xt; import org.jboss.portal.portlet.test.controller.request.ControllerRequest; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller2/PageUpdateRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PageUpdateRenderer.java 2008-02-05 13:30:18 UTC (rev 9769) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PageUpdateRenderer.java 2008-02-05 13:37:45 UTC (rev 9770) @@ -42,9 +42,9 @@ import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.ResponseProperties; -import org.jboss.portal.portlet.test.TestInstanceContext; +import org.jboss.portal.portlet.test.controller2.TestInstanceContext; import org.jboss.portal.portlet.test.controller.WindowNavigationalState; -import org.jboss.portal.portlet.test.TestPortalContext; +import org.jboss.portal.portlet.test.controller2.TestPortalContext; import org.jboss.portal.portlet.test.controller.PageNavigationalState; import org.jboss.portal.portlet.test.controller.PortletControllerContext; import org.jboss.portal.portlet.test.controller.response.PageUpdate; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller2/PortletControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PortletControllerContextImpl.java 2008-02-05 13:30:18 UTC (rev = 9769) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PortletControllerContextImpl.java 2008-02-05 13:37:45 UTC (rev = 9770) @@ -51,9 +51,9 @@ import org.jboss.portal.portlet.invocation.ResourceInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.test.StringCodec; -import org.jboss.portal.portlet.test.TestInstanceContext; -import org.jboss.portal.portlet.test.TestPortalContext; -import org.jboss.portal.portlet.test.TestPortletInvocationContext; +import org.jboss.portal.portlet.test.controller2.TestInstanceContext; +import org.jboss.portal.portlet.test.controller2.TestPortalContext; +import org.jboss.portal.portlet.test.controller2.TestPortletInvocationCont= ext; import static org.jboss.portal.portlet.test.URLParameterConstants.*; import org.jboss.portal.portlet.test.controller.WindowNavigationalState; import org.jboss.portal.portlet.test.controller.PortletControllerContext; Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller2/TestInstanceContext.java (from rev 9765, modules/portlet/tr= unk/test/src/main/java/org/jboss/portal/portlet/test/TestInstanceContext.ja= va) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/TestInstanceContext.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/TestInstanceContext.java 2008-02-05 13:37:45 UTC (rev 9770) @@ -0,0 +1,102 @@ +/*************************************************************************= ***** + * 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.portlet.test.controller2; + +import org.jboss.portal.portlet.state.AccessMode; +import org.jboss.portal.portlet.PortletContext; +import org.jboss.portal.portlet.StateEvent; +import org.jboss.portal.portlet.spi.InstanceContext; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class TestInstanceContext implements InstanceContext +{ + + /** . */ + private HttpServletRequest req; + + /** . */ + private boolean modifiable; + + /** . */ + private PortletContext target; + + /** . */ + private boolean useClone; + + /** . */ + private String id; + + public TestInstanceContext( + HttpServletRequest req, + PortletContext portletContext, + boolean modifiable) + { + String id =3D portletContext.getId(); + PortletContext target =3D portletContext; + boolean useClone =3D false; + HttpSession session =3D req.getSession(false); + if (session !=3D null) + { + PortletContext clone =3D (PortletContext)session.getAttribute("cl= one." + id); + if (clone !=3D null) + { + target =3D clone; + useClone =3D true; + } + } + + // + this.req =3D req; + this.useClone =3D useClone; + this.target =3D target; + this.id =3D id; + this.modifiable =3D modifiable; + } + + public PortletContext getTarget() + { + return target; + } + + public String getId() + { + return id; + } + + public AccessMode getAccessMode() + { + return modifiable ? (useClone ? AccessMode.READ_WRITE : AccessMode.C= LONE_BEFORE_WRITE) : AccessMode.READ_ONLY; + } + + public void onStateEvent(StateEvent event) + { + target =3D event.getPortletContext(); + req.getSession().setAttribute("clone." + id, target); + } +} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller2/TestPortalContext.java (from rev 9765, modules/portlet/trun= k/test/src/main/java/org/jboss/portal/portlet/test/TestPortalContext.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/TestPortalContext.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/TestPortalContext.java 2008-02-05 13:37:45 UTC (rev 9770) @@ -0,0 +1,40 @@ +/*************************************************************************= ***** + * 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.portlet.test.controller2; + +import org.jboss.portal.portlet.impl.spi.AbstractPortalContext; + +import java.util.Map; +import java.util.Collections; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class TestPortalContext extends AbstractPortalContext +{ + public TestPortalContext() + { + super(Collections.singletonMap("javax.portlet.markup.head.element.su= pport", "true")); + } +} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller2/TestPortletInvocationContext.java (from rev 9767, modules/p= ortlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletIn= vocationContext.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/TestPortletInvocationContext.java (rev = 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/TestPortletInvocationContext.java 2008-02-05 13:37:45 UTC (rev = 9770) @@ -0,0 +1,97 @@ +/*************************************************************************= ***** + * 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.portlet.test.controller2; + +import org.jboss.portal.portlet.ContainerURL; +import org.jboss.portal.portlet.test.controller.PageNavigationalState; +import org.jboss.portal.portlet.test.controller2.PortletURLRenderer; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext; +import org.jboss.portal.common.util.MarkupInfo; +import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResol= ver; +import org.jboss.portal.common.invocation.resolver.MapAttributeResolver; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class TestPortletInvocationContext extends AbstractPortletInvocatio= nContext +{ + + /** . */ + private final PortletURLRenderer urlRenderer; + + /** . */ + private final String windowId; + + /** . */ + private final PageNavigationalState pageState; + + /** . */ + private final HttpServletRequest clientRequest; + + /** . */ + private final HttpServletResponse clientResponse; + + public TestPortletInvocationContext( + HttpServletRequest clientRequest, + HttpServletResponse clientResponse, + String windowId, + PageNavigationalState pageState, + MarkupInfo markupInfo) + { + super(markupInfo); + + // + this.clientRequest =3D clientRequest; + this.clientResponse =3D clientResponse; + this.windowId =3D windowId; + this.pageState =3D pageState; + this.urlRenderer =3D new PortletURLRenderer(pageState, windowId, cli= entRequest, clientResponse); + + // + addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttribut= eResolver(clientRequest)); + addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeReso= lver()); + addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, new MapAttri= buteResolver()); + addResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, new MapAttr= ibuteResolver()); + addResolver(PortletInvocation.REQUEST_SCOPE, new MapAttributeResolve= r()); + } + + public HttpServletRequest getClientRequest() throws IllegalStateExcepti= on + { + return clientRequest; + } + + public HttpServletResponse getClientResponse() throws IllegalStateExcep= tion + { + return clientResponse; + } + + public String renderURL(ContainerURL containerURL, Boolean wantSecure, = Boolean wantAuthenticated, boolean relative) + { + return urlRenderer.renderURL(containerURL, wantSecure, wantAuthentic= ated, relative); + } +} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller2/TestPortletInvoker.java (from rev 9765, modules/portlet/tru= nk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletInvoker.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/TestPortletInvoker.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/TestPortletInvoker.java 2008-02-05 13:37:45 UTC (rev 9770) @@ -0,0 +1,158 @@ +/*************************************************************************= ***** + * 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.portlet.test.controller2; + +import org.jboss.portal.portlet.PortletInvoker; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletContext; +import org.jboss.portal.portlet.state.PropertyMap; +import org.jboss.portal.portlet.state.PropertyChange; +import org.jboss.portal.portlet.state.DestroyCloneFailure; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.common.invocation.InterceptorStackFactory; +import org.jboss.portal.common.invocation.InvocationHandler; +import org.jboss.portal.common.invocation.Invocation; +import org.jboss.portal.common.invocation.InvocationException; + +import java.util.Set; +import java.util.List; + +/** + * A simple consumer. + * + * @author Julien Viet + * @version $Revision: 6712 $ + */ +public class TestPortletInvoker implements PortletInvoker +{ + + /** . */ + private InterceptorStackFactory stackFactory; + + /** . */ + private PortletInvoker producer; + + /** . */ + private InvocationHandler handler =3D new InvocationHandler() + { + public Object invoke(Invocation invocation) throws Exception, Invoca= tionException + { + PortletInvocation portletInvocation =3D (PortletInvocation)invoca= tion; + try + { + portletInvocation.setHandler(null); + return producer.invoke(portletInvocation); + } + finally + { + portletInvocation.setHandler(this); + } + } + }; + + public InterceptorStackFactory getStackFactory() + { + return stackFactory; + } + + public void setStackFactory(InterceptorStackFactory stackFactory) + { + this.stackFactory =3D stackFactory; + } + + public PortletInvoker getProducer() + { + return producer; + } + + public void setProducer(PortletInvoker producer) + { + this.producer =3D producer; + } + + public Set getPortlets() throws PortletInvokerException + { + return producer.getPortlets(); + } + + public Portlet getPortlet(PortletContext portletContext) throws Illegal= ArgumentException, PortletInvokerException + { + return producer.getPortlet(portletContext); + } + + public PortletInvocationResponse invoke(PortletInvocation invocation) t= hrows PortletInvokerException + { + InvocationHandler prevHandler =3D invocation.getHandler(); + try + { + invocation.setHandler(handler); + return (PortletInvocationResponse)invocation.invoke(stackFactory.= getInterceptorStack()); + } + catch (Exception e) + { + if (e instanceof PortletInvokerException) + { + throw(PortletInvokerException)e; + } + else if (e instanceof RuntimeException) + { + throw(RuntimeException)e; + } + else + { + throw new PortletInvokerException(e); + } + } + finally + { + invocation.setHandler(prevHandler); + } + } + + public PortletContext createClone(PortletContext portletContext) throws= IllegalArgumentException, PortletInvokerException, UnsupportedOperationExc= eption + { + throw new UnsupportedOperationException(); + } + + public List destroyClones(List por= tletContexts) throws IllegalArgumentException, PortletInvokerException, Uns= upportedOperationException + { + throw new UnsupportedOperationException(); + } + + public PropertyMap getProperties(PortletContext portletContext, Set key= s) throws IllegalArgumentException, PortletInvokerException, UnsupportedOpe= rationException + { + throw new UnsupportedOperationException(); + } + + public PropertyMap getProperties(PortletContext portletContext) throws = IllegalArgumentException, PortletInvokerException, UnsupportedOperationExce= ption + { + throw new UnsupportedOperationException(); + } + + public PortletContext setProperties(PortletContext portletContext, Prop= ertyChange[] changes) throws IllegalArgumentException, PortletInvokerExcept= ion, UnsupportedOperationException + { + throw new UnsupportedOperationException(); + } +} Modified: modules/portlet/trunk/test/src/test/resources/portlet-test-war/WE= B-INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/= jboss-beans.xml 2008-02-05 13:30:18 UTC (rev 9769) +++ modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/= jboss-beans.xml 2008-02-05 13:37:45 UTC (rev 9770) @@ -70,7 +70,7 @@ = - + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-beans.xml 2008-02-05 13:30:18 UTC (rev 9769) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-beans.xml 2008-02-05 13:37:45 UTC (rev 9770) @@ -58,7 +58,7 @@ = - + --===============8408871349129691162==-- From portal-commits at lists.jboss.org Tue Feb 5 09:21:21 2008 Content-Type: multipart/mixed; boundary="===============2327620746152455124==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9771 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal: portlet/test/controller and 3 other directories. Date: Tue, 05 Feb 2008 09:21:20 -0500 Message-ID: --===============2327620746152455124== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-05 09:21:20 -0500 (Tue, 05 Feb 2008) New Revision: 9771 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/response/PageUpdateResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/response/PortletResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/response/ResourceResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/PageRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/Renderer.java Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/response/ErrorControllerResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/response/PageUpdate.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/response/RedirectControllerResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/response/ResourceControllerResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/ControllerResponseRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/PageUpdateRenderer.java Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortalServlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletRequestHandler.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletResourceRequestHandler.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/AbstractMarkupRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/ControllerResponseRendererFactory.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/ErrorResponseRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/RedirectResponseRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/ResourceRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimpleP= ortalServlet.java Log: - reuse more the portlet response types in order to avoid to mirror them Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortalServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortalServlet.java 2008-02-05 13:37:45 UTC (rev 9770) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortalServlet.java 2008-02-05 14:21:20 UTC (rev 9771) @@ -23,12 +23,12 @@ package org.jboss.portal.portlet.test; = import org.jboss.portal.portlet.test.controller.response.ControllerRespons= e; -import org.jboss.portal.portlet.test.controller.response.PageUpdate; import org.jboss.portal.portlet.test.controller.PortletController; import org.jboss.portal.portlet.test.controller2.PortletControllerContextI= mpl; import org.jboss.portal.portlet.test.controller.PageNavigationalState; import org.jboss.portal.portlet.test.controller2.ControllerResponseRendere= rFactory; -import org.jboss.portal.portlet.test.controller2.ControllerResponseRendere= r; +import org.jboss.portal.portlet.test.controller2.Renderer; +import org.jboss.portal.portlet.test.controller2.PageRenderer; import org.jboss.portal.portlet.invocation.response.ResponseProperties; = import javax.servlet.ServletException; @@ -81,19 +81,16 @@ ControllerResponse response =3D controller.process(context.getReq= uest()); = // - ControllerResponseRenderer renderer =3D ControllerResponseRender= erFactory.getRenderer(response); + Renderer renderer =3D ControllerResponseRendererFactory.getRende= rer(response); = // renderer.render(context); } else { - PageUpdate pageUpdate =3D new PageUpdate(new ResponseProperties()= , new PageNavigationalState()); - + PageRenderer renderer =3D new PageRenderer(new ResponseProperties= (), new PageNavigationalState()); + = // - ControllerResponseRenderer renderer =3D ControllerResponseRender= erFactory.getRenderer(pageUpdate); - - // renderer.render(context); } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletRequestHandler.java 2008-02-05 13:37:45 UTC (rev 9770) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletRequestHandler.java 2008-02-05 14:21:20 UTC (rev 9771) @@ -16,7 +16,6 @@ import org.jboss.portal.portlet.invocation.ActionInvocation; import org.jboss.portal.portlet.invocation.EventInvocation; import org.jboss.portal.portlet.invocation.response.ErrorResponse; -import org.jboss.portal.portlet.invocation.response.HTTPRedirectionRespons= e; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.ResponseProperties; import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStat= eResponse; @@ -27,9 +26,8 @@ import org.jboss.portal.portlet.test.controller.request.PortletRenderReque= st; import org.jboss.portal.portlet.test.controller.request.PortletRequest; import org.jboss.portal.portlet.test.controller.response.ControllerRespons= e; -import org.jboss.portal.portlet.test.controller.response.ErrorControllerRe= sponse; -import org.jboss.portal.portlet.test.controller.response.RedirectControlle= rResponse; -import org.jboss.portal.portlet.test.controller.response.PageUpdate; +import org.jboss.portal.portlet.test.controller.response.PageUpdateRespons= e; +import org.jboss.portal.portlet.test.controller.response.PortletResponse; = import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; @@ -75,12 +73,8 @@ ResponseProperties requestProperties =3D new ResponseProperties(); = // - if (response instanceof ErrorResponse) + if (response instanceof UpdateNavigationalStateResponse) { - return new ErrorControllerResponse((ErrorResponse)response); - } - else if (response instanceof UpdateNavigationalStateResponse) - { // Update portlet NS UpdateNavigationalStateResponse updateResponse =3D (UpdateNavigat= ionalStateResponse)response; updateNavigationalState(context, portletRequest.getWindowId(), up= dateResponse, pageState); @@ -145,18 +139,14 @@ // Do something here !!!! } } + + // + return new PageUpdateResponse(updateResponse, requestProperties, = pageState); } - else if (response instanceof HTTPRedirectionResponse) - { - return new RedirectControllerResponse((HTTPRedirectionResponse)re= sponse); - } else { - System.out.println("Not yet handled " + response); + return new PortletResponse(response); } - - // - return new PageUpdate(requestProperties, pageState); } = PortletInvocationResponse invoke(PortletRequest portletRequest) throws = PortletInvokerException Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletResourceRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletResourceRequestHandler.java 2008-02-05 13:37:45 UTC (rev = 9770) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletResourceRequestHandler.java 2008-02-05 14:21:20 UTC (rev = 9771) @@ -32,16 +32,13 @@ import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.cache.CacheLevel; import org.jboss.portal.portlet.invocation.ResourceInvocation; -import org.jboss.portal.portlet.invocation.response.ErrorResponse; -import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.test.controller.request.ControllerRequest; import org.jboss.portal.portlet.test.controller.request.PageScopedFullPort= letResourceRequest; import org.jboss.portal.portlet.test.controller.request.PortletResourceReq= uest; import org.jboss.portal.portlet.test.controller.request.PortletScopedPortl= etResourceRequest; import org.jboss.portal.portlet.test.controller.response.ControllerRespons= e; -import org.jboss.portal.portlet.test.controller.response.ErrorControllerRe= sponse; -import org.jboss.portal.portlet.test.controller.response.ResourceControlle= rResponse; +import org.jboss.portal.portlet.test.controller.response.ResourceResponse; = import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -60,19 +57,7 @@ = ControllerResponse processResponse(PortletResourceRequest request, Port= letInvocationResponse response) throws IOException, PortletInvokerException { - // - if (response instanceof FragmentResponse) - { - FragmentResponse fragment =3D (FragmentResponse)response; - - return new ResourceControllerResponse(fragment); - } - else - { - // todo - } - - return new ErrorControllerResponse(new ErrorResponse("Couldn't handl= e resource request")); + return new ResourceResponse(response); } = PortletInvocationResponse invoke(PortletResourceRequest portletResource= Request) throws PortletInvokerException Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/response/ErrorControllerResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/response/ErrorControllerResponse.java 2008-02-05 13:37:45 UTC (r= ev 9770) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/response/ErrorControllerResponse.java 2008-02-05 14:21:20 UTC (r= ev 9771) @@ -1,44 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ - -package org.jboss.portal.portlet.test.controller.response; - -import org.jboss.portal.portlet.invocation.response.ErrorResponse; - -/** - * @author Chris Laprun - * @version $Revision$ - */ -public class ErrorControllerResponse extends ControllerResponse -{ - - /** . */ - public ErrorResponse error; - - - public ErrorControllerResponse(ErrorResponse error) - { - this.error =3D error; - } - -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/response/PageUpdate.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/response/PageUpdate.java 2008-02-05 13:37:45 UTC (rev 9770) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/response/PageUpdate.java 2008-02-05 14:21:20 UTC (rev 9771) @@ -1,57 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.test.controller.response; - -import org.jboss.portal.portlet.invocation.response.ResponseProperties; -import org.jboss.portal.portlet.test.controller.response.ControllerRespons= e; -import org.jboss.portal.portlet.test.controller.PageNavigationalState; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class PageUpdate extends ControllerResponse -{ - - /** . */ - private ResponseProperties properties; - - /** . */ - private PageNavigationalState pageState; - - public PageUpdate(ResponseProperties properties, PageNavigationalState = pageState) - { - this.properties =3D properties; - this.pageState =3D pageState; - } - - public ResponseProperties getProperties() - { - return properties; - } - - public PageNavigationalState getPageState() - { - return pageState; - } -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller/response/PageUpdateResponse.java (from rev 9770, modules/por= tlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/resp= onse/PageUpdate.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/response/PageUpdateResponse.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/response/PageUpdateResponse.java 2008-02-05 14:21:20 UTC (rev 97= 71) @@ -0,0 +1,64 @@ +/*************************************************************************= ***** + * 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.portlet.test.controller.response; + +import org.jboss.portal.portlet.invocation.response.ResponseProperties; +import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStat= eResponse; +import org.jboss.portal.portlet.test.controller.response.ControllerRespons= e; +import org.jboss.portal.portlet.test.controller.PageNavigationalState; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PageUpdateResponse extends PortletResponse +{ + + /** . */ + private ResponseProperties properties; + + /** . */ + private PageNavigationalState pageState; + + public PageUpdateResponse( + UpdateNavigationalStateResponse update, + ResponseProperties properties, + PageNavigationalState pageState) + { + super(update); + + // + this.properties =3D properties; + this.pageState =3D pageState; + } + + public ResponseProperties getProperties() + { + return properties; + } + + public PageNavigationalState getPageState() + { + return pageState; + } +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/controller/response/PortletResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/response/PortletResponse.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/response/PortletResponse.java 2008-02-05 14:21:20 UTC (rev 9771) @@ -0,0 +1,41 @@ +/*************************************************************************= ***** + * 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.portlet.test.controller.response; + +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletResponse extends ControllerResponse +{ + + /** . */ + public final PortletInvocationResponse response; + + public PortletResponse(PortletInvocationResponse response) + { + this.response =3D response; + } +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/response/RedirectControllerResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/response/RedirectControllerResponse.java 2008-02-05 13:37:45 UTC= (rev 9770) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/response/RedirectControllerResponse.java 2008-02-05 14:21:20 UTC= (rev 9771) @@ -1,42 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ - -package org.jboss.portal.portlet.test.controller.response; - -import org.jboss.portal.portlet.invocation.response.HTTPRedirectionRespons= e; - -/** - * @author Chris Laprun - * @version $Revision$ - */ -public class RedirectControllerResponse extends ControllerResponse -{ - - /** . */ - public HTTPRedirectionResponse redirection; - - public RedirectControllerResponse(HTTPRedirectionResponse redirection) - { - this.redirection =3D redirection; - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/response/ResourceControllerResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/response/ResourceControllerResponse.java 2008-02-05 13:37:45 UTC= (rev 9770) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/response/ResourceControllerResponse.java 2008-02-05 14:21:20 UTC= (rev 9771) @@ -1,42 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ - -package org.jboss.portal.portlet.test.controller.response; - -import org.jboss.portal.portlet.invocation.response.FragmentResponse; - -/** - * @author Chris Laprun - * @version $Revision$ - */ -public class ResourceControllerResponse extends ControllerResponse -{ - - /** . */ - public FragmentResponse fragment; - - public ResourceControllerResponse(FragmentResponse fragment) - { - this.fragment =3D fragment; - } -} \ No newline at end of file Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller/response/ResourceResponse.java (from rev 9770, modules/portl= et/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/respon= se/ResourceControllerResponse.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/response/ResourceResponse.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/response/ResourceResponse.java 2008-02-05 14:21:20 UTC (rev 9771) @@ -0,0 +1,42 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.test.controller.response; + +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; + +/** + * @author Chris Laprun + * @version $Revision$ + */ +public class ResourceResponse extends ControllerResponse +{ + + /** . */ + public PortletInvocationResponse response; + + public ResourceResponse(PortletInvocationResponse response) + { + this.response =3D response; + } +} \ No newline at end of file Property changes on: modules/portlet/trunk/test/src/main/java/org/jboss/por= tal/portlet/test/controller/response/ResourceResponse.java ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller2/AbstractMarkupRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/AbstractMarkupRenderer.java 2008-02-05 13:37:45 UTC (rev 9770) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/AbstractMarkupRenderer.java 2008-02-05 14:21:20 UTC (rev 9771) @@ -35,7 +35,7 @@ * @author Julien Viet * @version $Revision: 630 $ */ -public abstract class AbstractMarkupRenderer implements ControllerResponse= Renderer +public abstract class AbstractMarkupRenderer implements Renderer { = /** . */ Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller2/ControllerResponseRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/ControllerResponseRenderer.java 2008-02-05 13:37:45 UTC (rev 97= 70) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/ControllerResponseRenderer.java 2008-02-05 14:21:20 UTC (rev 97= 71) @@ -1,36 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.test.controller2; - -import org.jboss.portal.portlet.test.controller.PortletControllerContext; - -import java.io.IOException; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public interface ControllerResponseRenderer -{ - void render(PortletControllerContext context) throws IOException; -} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller2/ControllerResponseRendererFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/ControllerResponseRendererFactory.java 2008-02-05 13:37:45 UTC = (rev 9770) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/ControllerResponseRendererFactory.java 2008-02-05 14:21:20 UTC = (rev 9771) @@ -23,10 +23,13 @@ package org.jboss.portal.portlet.test.controller2; = import org.jboss.portal.portlet.test.controller.response.ControllerRespons= e; -import org.jboss.portal.portlet.test.controller.response.ErrorControllerRe= sponse; -import org.jboss.portal.portlet.test.controller.response.PageUpdate; -import org.jboss.portal.portlet.test.controller.response.RedirectControlle= rResponse; -import org.jboss.portal.portlet.test.controller.response.ResourceControlle= rResponse; +import org.jboss.portal.portlet.test.controller.response.PageUpdateRespons= e; +import org.jboss.portal.portlet.test.controller.response.ResourceResponse; +import org.jboss.portal.portlet.test.controller.response.PortletResponse; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.response.HTTPRedirectionRespons= e; +import org.jboss.portal.portlet.invocation.response.ErrorResponse; +import org.jboss.portal.portlet.invocation.response.FragmentResponse; = /** * @author Julien Viet @@ -34,26 +37,51 @@ */ public class ControllerResponseRendererFactory { - public static ControllerResponseRenderer getRenderer(ControllerResponse= response) + public static Renderer getRenderer(ControllerResponse response) { - if (response instanceof PageUpdate) + if (response instanceof PageUpdateResponse) { - return new PageUpdateRenderer((PageUpdate)response); + PageUpdateResponse pageUpdate =3D (PageUpdateResponse)response; + + // + return new PageRenderer(pageUpdate.getProperties(), pageUpdate.ge= tPageState()); } - else if (response instanceof RedirectControllerResponse) + else if (response instanceof PortletResponse) { - return new RedirectResponseRenderer((RedirectControllerResponse)r= esponse); + return getRenderer(((PortletResponse)response).response); } - else if (response instanceof ErrorControllerResponse) + else if (response instanceof ResourceResponse) { - return new ErrorResponseRenderer((ErrorControllerResponse)respons= e); + ResourceResponse resourceResponse =3D (ResourceResponse)response; + + // + if (resourceResponse.response instanceof FragmentResponse) + { + return new ResourceRenderer((FragmentResponse)resourceResponse= .response); + } + else + { + return getRenderer(((PortletResponse)response).response); + } } - else if (response instanceof ResourceControllerResponse) + + // + throw new IllegalArgumentException("Unknown response type: " + respo= nse); + } + + private static Renderer getRenderer(PortletInvocationResponse response) + { + if (response instanceof HTTPRedirectionResponse) { - return new ResourceRenderer((ResourceControllerResponse)response); + return new RedirectResponseRenderer((HTTPRedirectionResponse)resp= onse); } + else if (response instanceof ErrorResponse) + { + return new ErrorResponseRenderer((ErrorResponse)response); + } = // throw new IllegalArgumentException("Unknown response type: " + respo= nse); } + } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller2/ErrorResponseRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/ErrorResponseRenderer.java 2008-02-05 13:37:45 UTC (rev 9770) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/ErrorResponseRenderer.java 2008-02-05 14:21:20 UTC (rev 9771) @@ -22,8 +22,8 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.controller2; = -import org.jboss.portal.portlet.test.controller.response.ErrorControllerRe= sponse; import org.jboss.portal.portlet.test.controller.PortletControllerContext; +import org.jboss.portal.portlet.invocation.response.ErrorResponse; import org.apache.log4j.Logger; = import java.io.IOException; @@ -32,33 +32,32 @@ * @author Julien Viet * @version $Revision: 630 $ */ -public class ErrorResponseRenderer implements ControllerResponseRenderer +public class ErrorResponseRenderer implements Renderer { = /** . */ - private static final Logger log =3D Logger.getLogger(ErrorControllerRes= ponse.class); + private static final Logger log =3D Logger.getLogger(ErrorResponseRende= rer.class); = /** . */ - private ErrorControllerResponse response; + private ErrorResponse response; = - public ErrorResponseRenderer(ErrorControllerResponse response) + public ErrorResponseRenderer(ErrorResponse response) { this.response =3D response; } = public void render(PortletControllerContext context) throws IOException { - // - if (response.error.getCause() !=3D null) + if (response.getCause() !=3D null) { - log.error("Portlet action threw an error: " + response.error.getM= essage(), response.error.getCause()); + log.error("Portlet action threw an error: " + response.getMessage= (), response.getCause()); } else { - log.error("Portlet action threw an error: " + response.error.getM= essage()); + log.error("Portlet action threw an error: " + response.getMessage= ()); } = // - context.getClientResponse().sendError(404, response.error.getMessage= ()); + context.getClientResponse().sendError(404, response.getMessage()); } } Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller2/PageRenderer.java (from rev 9770, modules/portlet/trunk/tes= t/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRendere= r.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PageRenderer.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PageRenderer.java 2008-02-05 14:21:20 UTC (rev 9771) @@ -0,0 +1,249 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.test.controller2; + +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; +import org.jboss.portal.common.util.MultiValuedPropertyMap; +import org.jboss.portal.common.util.ParameterMap; +import org.jboss.portal.common.xml.XMLTools; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.spi.PortletInvocationContext; +import org.jboss.portal.portlet.impl.spi.AbstractClientContext; +import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; +import org.jboss.portal.portlet.impl.spi.AbstractServerContext; +import org.jboss.portal.portlet.impl.spi.AbstractUserContext; +import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; +import org.jboss.portal.portlet.invocation.RenderInvocation; +import org.jboss.portal.portlet.invocation.response.ErrorResponse; +import org.jboss.portal.portlet.invocation.response.FragmentResponse; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.response.ResponseProperties; +import org.jboss.portal.portlet.test.controller2.TestInstanceContext; +import org.jboss.portal.portlet.test.controller.WindowNavigationalState; +import org.jboss.portal.portlet.test.controller2.TestPortalContext; +import org.jboss.portal.portlet.test.controller.PageNavigationalState; +import org.jboss.portal.portlet.test.controller.PortletControllerContext; +import org.jboss.portal.portlet.test.controller.response.PageUpdateRespons= e; +import org.w3c.dom.Element; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +/** + * @author Chris Laprun + * @version $Revision: 9748 $ + */ +public class PageRenderer extends AbstractMarkupRenderer +{ + + private FragmentRenderer fragmentRenderer =3D new SimpleFragmentRendere= r(); + private List fragments; + private List errors; + private PageNavigationalState pageState; + + public PageRenderer(ResponseProperties properties, PageNavigationalStat= e pageState) + { + super(properties); + + // + this.pageState =3D pageState; + } + + public void setFragmentRenderer(FragmentRenderer fragmentRenderer) + { + this.fragmentRenderer =3D fragmentRenderer; + } + + protected void renderContent(HttpServletResponse resp) throws IOExcepti= on + { + // + resp.setContentType("text/html"); + PrintWriter writer =3D resp.getWriter(); + writer.print(""); + + // Render the head contributions + writer.print(""); + MultiValuedPropertyMap markupHeaders =3D properties.getMark= upHeaders(); + List headElement =3D markupHeaders.getValues("javax.portlet= .markup.head.element"); + if (headElement !=3D null) + { + for (Element headerValue : headElement) + { + try + { + String serializedElement =3D XMLTools.toString(headerValue); + writer.print(serializedElement); + } + catch (Exception e) + { + // todo + e.printStackTrace(); + } + } + } + writer.print(""); + + + writer.print(""); + for (FragmentResponse fragment : fragments) + { + writer.print(fragmentRenderer.renderPortlet(fragment)); + + } + + for (ErrorResponse error : errors) + { + writer.print(fragmentRenderer.renderError(error)); + } + + writer.print(""); + } + + protected void prepareRendering(PortletControllerContext context) + { + + // What we collect during the different renders + // we don't reuse the render properties argument since we want to av= oid that + // a portlet rendition affects another rendition of a portlet on the= same page + ResponseProperties renderProperties =3D new ResponseProperties(); + + // + try + { + Collection portlets =3D ((PortletControllerContextImpl)c= ontext).getPortlets(); + + int capacity =3D portlets.size(); + fragments =3D new ArrayList(capacity); + errors =3D new ArrayList(capacity); + + for (Portlet portlet : portlets) + { + WindowNavigationalState windowNS =3D pageState.getWindowNaviga= tionalState(portlet.getContext().getId()); + + // + Mode mode =3D Mode.VIEW; + WindowState windowState =3D WindowState.NORMAL; + StateString portletNS =3D null; + + // + if (windowNS !=3D null) + { + if (windowNS.getMode() !=3D null) + { + mode =3D windowNS.getMode(); + } + if (windowNS.getWindowState() !=3D null) + { + windowState =3D windowNS.getWindowState(); + } + if (windowNS.getPortletNavigationalState() !=3D null) + { + portletNS =3D windowNS.getPortletNavigationalState(); + } + } + + // + ParameterMap publicNS =3D pageState.getPublicNavigationalState= (portlet.getInfo()); + + RenderInvocation render =3D createRenderInvocation(context, pr= operties, pageState, portlet, windowNS, mode, windowState, portletNS, publi= cNS); + + // + try + { + PortletInvocationResponse response =3D context.invoke(rende= r); + + if (response instanceof FragmentResponse) + { + FragmentResponse fragment =3D (FragmentResponse)response; + + // + fragments.add(fragment); + + // + ResponseProperties fragmentProperties =3D fragment.getPr= operties(); + if (fragmentProperties !=3D null) + { + renderProperties.append(fragmentProperties); + } + } + else if (response instanceof ErrorResponse) + { + ErrorResponse error =3D (ErrorResponse)response; + errors.add(error); + } + + } + catch (PortletInvokerException e) + { + e.printStackTrace(); + } + } + } + catch (PortletInvokerException e) + { + // todo + e.printStackTrace(); + } + + // Now we combine the render properties with the page properties + properties.append(renderProperties); + } + + protected RenderInvocation createRenderInvocation( + PortletControllerContext context, ResponseProperties pageProperties,= PageNavigationalState pageNS, Portlet portlet, + WindowNavigationalState windowNS, Mode mode, WindowState windowState= , StateString portletNS, ParameterMap publicNS) + { + HttpServletRequest req =3D context.getClientRequest(); + HttpServletResponse resp =3D context.getClientResponse(); + + // + TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), false); + + PortletInvocationContext renderContext =3D context.createPortletInvo= cationContext(portlet.getContext().getId(), pageNS); + + // + RenderInvocation render =3D new RenderInvocation(renderContext); + render.setClientContext(new AbstractClientContext(req, pagePropertie= s.getCookies())); + render.setServerContext(new AbstractServerContext(req, resp)); + render.setInstanceContext(instanceContext); + render.setUserContext(new AbstractUserContext(req)); + render.setWindowContext(new AbstractWindowContext(portlet.getContext= ().getId())); + render.setPortalContext(new TestPortalContext()); + render.setSecurityContext(new AbstractSecurityContext(req)); + render.setTarget(instanceContext.getTarget()); + render.setMode(mode); + render.setWindowState(windowState); + render.setNavigationalState(portletNS); + render.setPublicNavigationalState(publicNS); + return render; + } +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller2/PageUpdateRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PageUpdateRenderer.java 2008-02-05 13:37:45 UTC (rev 9770) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PageUpdateRenderer.java 2008-02-05 14:21:20 UTC (rev 9771) @@ -1,249 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ - -package org.jboss.portal.portlet.test.controller2; - -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; -import org.jboss.portal.common.util.MultiValuedPropertyMap; -import org.jboss.portal.common.util.ParameterMap; -import org.jboss.portal.common.xml.XMLTools; -import org.jboss.portal.portlet.Portlet; -import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.spi.PortletInvocationContext; -import org.jboss.portal.portlet.impl.spi.AbstractClientContext; -import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; -import org.jboss.portal.portlet.impl.spi.AbstractServerContext; -import org.jboss.portal.portlet.impl.spi.AbstractUserContext; -import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; -import org.jboss.portal.portlet.invocation.RenderInvocation; -import org.jboss.portal.portlet.invocation.response.ErrorResponse; -import org.jboss.portal.portlet.invocation.response.FragmentResponse; -import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.invocation.response.ResponseProperties; -import org.jboss.portal.portlet.test.controller2.TestInstanceContext; -import org.jboss.portal.portlet.test.controller.WindowNavigationalState; -import org.jboss.portal.portlet.test.controller2.TestPortalContext; -import org.jboss.portal.portlet.test.controller.PageNavigationalState; -import org.jboss.portal.portlet.test.controller.PortletControllerContext; -import org.jboss.portal.portlet.test.controller.response.PageUpdate; -import org.w3c.dom.Element; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -/** - * @author Chris Laprun - * @version $Revision: 9748 $ - */ -public class PageUpdateRenderer extends AbstractMarkupRenderer -{ - - private FragmentRenderer fragmentRenderer =3D new SimpleFragmentRendere= r(); - private List fragments; - private List errors; - private PageNavigationalState pageState; - - public PageUpdateRenderer(PageUpdate pageUpdate) - { - super(pageUpdate.getProperties()); - - // - this.pageState =3D pageUpdate.getPageState(); - } - - public void setFragmentRenderer(FragmentRenderer fragmentRenderer) - { - this.fragmentRenderer =3D fragmentRenderer; - } - - protected void renderContent(HttpServletResponse resp) throws IOExcepti= on - { - // - resp.setContentType("text/html"); - PrintWriter writer =3D resp.getWriter(); - writer.print(""); - - // Render the head contributions - writer.print(""); - MultiValuedPropertyMap markupHeaders =3D properties.getMark= upHeaders(); - List headElement =3D markupHeaders.getValues("javax.portlet= .markup.head.element"); - if (headElement !=3D null) - { - for (Element headerValue : headElement) - { - try - { - String serializedElement =3D XMLTools.toString(headerValue); - writer.print(serializedElement); - } - catch (Exception e) - { - // todo - e.printStackTrace(); - } - } - } - writer.print(""); - - - writer.print(""); - for (FragmentResponse fragment : fragments) - { - writer.print(fragmentRenderer.renderPortlet(fragment)); - - } - - for (ErrorResponse error : errors) - { - writer.print(fragmentRenderer.renderError(error)); - } - - writer.print(""); - } - - protected void prepareRendering(PortletControllerContext context) - { - - // What we collect during the different renders - // we don't reuse the render properties argument since we want to av= oid that - // a portlet rendition affects another rendition of a portlet on the= same page - ResponseProperties renderProperties =3D new ResponseProperties(); - - // - try - { - Collection portlets =3D ((PortletControllerContextImpl)c= ontext).getPortlets(); - - int capacity =3D portlets.size(); - fragments =3D new ArrayList(capacity); - errors =3D new ArrayList(capacity); - - for (Portlet portlet : portlets) - { - WindowNavigationalState windowNS =3D pageState.getWindowNaviga= tionalState(portlet.getContext().getId()); - - // - Mode mode =3D Mode.VIEW; - WindowState windowState =3D WindowState.NORMAL; - StateString portletNS =3D null; - - // - if (windowNS !=3D null) - { - if (windowNS.getMode() !=3D null) - { - mode =3D windowNS.getMode(); - } - if (windowNS.getWindowState() !=3D null) - { - windowState =3D windowNS.getWindowState(); - } - if (windowNS.getPortletNavigationalState() !=3D null) - { - portletNS =3D windowNS.getPortletNavigationalState(); - } - } - - // - ParameterMap publicNS =3D pageState.getPublicNavigationalState= (portlet.getInfo()); - - RenderInvocation render =3D createRenderInvocation(context, pr= operties, pageState, portlet, windowNS, mode, windowState, portletNS, publi= cNS); - - // - try - { - PortletInvocationResponse response =3D context.invoke(rende= r); - - if (response instanceof FragmentResponse) - { - FragmentResponse fragment =3D (FragmentResponse)response; - - // - fragments.add(fragment); - - // - ResponseProperties fragmentProperties =3D fragment.getPr= operties(); - if (fragmentProperties !=3D null) - { - renderProperties.append(fragmentProperties); - } - } - else if (response instanceof ErrorResponse) - { - ErrorResponse error =3D (ErrorResponse)response; - errors.add(error); - } - - } - catch (PortletInvokerException e) - { - e.printStackTrace(); - } - } - } - catch (PortletInvokerException e) - { - // todo - e.printStackTrace(); - } - - // Now we combine the render properties with the page properties - properties.append(renderProperties); - } - - protected RenderInvocation createRenderInvocation( - PortletControllerContext context, ResponseProperties pageProperties,= PageNavigationalState pageNS, Portlet portlet, - WindowNavigationalState windowNS, Mode mode, WindowState windowState= , StateString portletNS, ParameterMap publicNS) - { - HttpServletRequest req =3D context.getClientRequest(); - HttpServletResponse resp =3D context.getClientResponse(); - - // - TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), false); - - PortletInvocationContext renderContext =3D context.createPortletInvo= cationContext(portlet.getContext().getId(), pageNS); - - // - RenderInvocation render =3D new RenderInvocation(renderContext); - render.setClientContext(new AbstractClientContext(req, pagePropertie= s.getCookies())); - render.setServerContext(new AbstractServerContext(req, resp)); - render.setInstanceContext(instanceContext); - render.setUserContext(new AbstractUserContext(req)); - render.setWindowContext(new AbstractWindowContext(portlet.getContext= ().getId())); - render.setPortalContext(new TestPortalContext()); - render.setSecurityContext(new AbstractSecurityContext(req)); - render.setTarget(instanceContext.getTarget()); - render.setMode(mode); - render.setWindowState(windowState); - render.setNavigationalState(portletNS); - render.setPublicNavigationalState(publicNS); - return render; - } -} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller2/RedirectResponseRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/RedirectResponseRenderer.java 2008-02-05 13:37:45 UTC (rev 9770) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/RedirectResponseRenderer.java 2008-02-05 14:21:20 UTC (rev 9771) @@ -23,7 +23,7 @@ package org.jboss.portal.portlet.test.controller2; = import org.jboss.portal.portlet.test.controller.PortletControllerContext; -import org.jboss.portal.portlet.test.controller.response.RedirectControlle= rResponse; +import org.jboss.portal.portlet.invocation.response.HTTPRedirectionRespons= e; = import java.io.IOException; = @@ -31,19 +31,19 @@ * @author Julien Viet * @version $Revision: 630 $ */ -public class RedirectResponseRenderer implements ControllerResponseRenderer +public class RedirectResponseRenderer implements Renderer { = /** . */ - private RedirectControllerResponse response; + private HTTPRedirectionResponse response; = - public RedirectResponseRenderer(RedirectControllerResponse response) + public RedirectResponseRenderer(HTTPRedirectionResponse response) { this.response =3D response; } = public void render(PortletControllerContext context) throws IOException { - context.getClientResponse().sendRedirect(response.redirection.getLoc= ation()); + context.getClientResponse().sendRedirect(response.getLocation()); } } Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller2/Renderer.java (from rev 9770, modules/portlet/trunk/test/sr= c/main/java/org/jboss/portal/portlet/test/controller2/ControllerResponseRen= derer.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/Renderer.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/Renderer.java 2008-02-05 14:21:20 UTC (rev 9771) @@ -0,0 +1,36 @@ +/*************************************************************************= ***** + * 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.portlet.test.controller2; + +import org.jboss.portal.portlet.test.controller.PortletControllerContext; + +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public interface Renderer +{ + void render(PortletControllerContext context) throws IOException; +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller2/ResourceRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/ResourceRenderer.java 2008-02-05 13:37:45 UTC (rev 9770) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/ResourceRenderer.java 2008-02-05 14:21:20 UTC (rev 9771) @@ -23,7 +23,6 @@ package org.jboss.portal.portlet.test.controller2; = import org.jboss.portal.portlet.invocation.response.FragmentResponse; -import org.jboss.portal.portlet.test.controller.response.ResourceControlle= rResponse; import org.jboss.portal.common.io.IOTools; = import javax.servlet.http.HttpServletResponse; @@ -41,12 +40,12 @@ /** . */ private FragmentResponse fragment; = - public ResourceRenderer(ResourceControllerResponse response) + public ResourceRenderer(FragmentResponse response) { - super(response.fragment.getProperties()); + super(response.getProperties()); = // - this.fragment =3D response.fragment; + this.fragment =3D response; } = protected void renderContent(HttpServletResponse resp) throws IOExcepti= on Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/= SimplePortalServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/Simple= PortalServlet.java 2008-02-05 13:37:45 UTC (rev 9770) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/Simple= PortalServlet.java 2008-02-05 14:21:20 UTC (rev 9771) @@ -26,10 +26,10 @@ import org.jboss.portal.portlet.test.controller.PageNavigationalState; import org.jboss.portal.portlet.test.controller.PortletController; import org.jboss.portal.portlet.test.controller.response.ControllerRespons= e; -import org.jboss.portal.portlet.test.controller.response.PageUpdate; -import org.jboss.portal.portlet.test.controller2.ControllerResponseRendere= r; +import org.jboss.portal.portlet.test.controller2.Renderer; import org.jboss.portal.portlet.test.controller2.ControllerResponseRendere= rFactory; import org.jboss.portal.portlet.test.controller2.PortletControllerContextI= mpl; +import org.jboss.portal.portlet.test.controller2.PageRenderer; = import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; @@ -81,19 +81,16 @@ ControllerResponse response =3D controller.process(context.getReq= uest()); = // - ControllerResponseRenderer renderer =3D ControllerResponseRendere= rFactory.getRenderer(response); + Renderer renderer =3D ControllerResponseRendererFactory.getRender= er(response); = // renderer.render(context); } else { - PageUpdate pageUpdate =3D new PageUpdate(new ResponseProperties()= , new PageNavigationalState()); + PageRenderer renderer =3D new PageRenderer(new ResponseProperties= (), new PageNavigationalState()); = // - ControllerResponseRenderer renderer =3D ControllerResponseRendere= rFactory.getRenderer(pageUpdate); - - // renderer.render(context); } } --===============2327620746152455124==-- From portal-commits at lists.jboss.org Tue Feb 5 09:32:02 2008 Content-Type: multipart/mixed; boundary="===============0784598978669536744==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9772 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test: controller2 and 1 other directory. Date: Tue, 05 Feb 2008 09:32:02 -0500 Message-ID: --===============0784598978669536744== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-05 09:32:02 -0500 (Tue, 05 Feb 2008) New Revision: 9772 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletController.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/PageRenderer.java Log: removed a method from an interface when it only the impl should define it (= even if propbably it shold not be in the impl) Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletController.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletController.java 2008-02-05 14:21:20 UTC (rev 9771) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletController.java 2008-02-05 14:32:02 UTC (rev 9772) @@ -33,6 +33,9 @@ import java.io.IOException; = /** + * The portlet controller which handles the page state management and the = interactions between + * the action phase and the event phase. It really only does that and not = more. + * * @author Julien Viet * @version $Revision: 1.1 $ */ Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContext.java 2008-02-05 14:21:20 UTC (rev 9771) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContext.java 2008-02-05 14:32:02 UTC (rev 9772) @@ -25,7 +25,6 @@ import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.spi.PortletInvocationContext; import org.jboss.portal.portlet.info.PortletInfo; -import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.invocation.ActionInvocation; import org.jboss.portal.portlet.invocation.EventInvocation; import org.jboss.portal.portlet.invocation.ResourceInvocation; @@ -39,6 +38,8 @@ import java.util.List; = /** + * The context provided to call the portlet controller. + * * @author Julien Viet * @version $Revision: 1.1 $ */ @@ -63,6 +64,4 @@ = EventControllerContext getEventControllerContext(); = - // To be removed, now only used in controller2 - PortletInvocationResponse invoke(PortletInvocation invocation) throws P= ortletInvokerException; } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller2/PageRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PageRenderer.java 2008-02-05 14:21:20 UTC (rev 9771) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PageRenderer.java 2008-02-05 14:32:02 UTC (rev 9772) @@ -42,12 +42,9 @@ import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.ResponseProperties; -import org.jboss.portal.portlet.test.controller2.TestInstanceContext; import org.jboss.portal.portlet.test.controller.WindowNavigationalState; -import org.jboss.portal.portlet.test.controller2.TestPortalContext; import org.jboss.portal.portlet.test.controller.PageNavigationalState; import org.jboss.portal.portlet.test.controller.PortletControllerContext; -import org.jboss.portal.portlet.test.controller.response.PageUpdateRespons= e; import org.w3c.dom.Element; = import javax.servlet.http.HttpServletRequest; @@ -179,7 +176,7 @@ // try { - PortletInvocationResponse response =3D context.invoke(rende= r); + PortletInvocationResponse response =3D ((PortletControllerC= ontextImpl)context).invoke(render); = if (response instanceof FragmentResponse) { --===============0784598978669536744==-- From portal-commits at lists.jboss.org Tue Feb 5 09:34:50 2008 Content-Type: multipart/mixed; boundary="===============0983888174725452235==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9773 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test. Date: Tue, 05 Feb 2008 09:34:50 -0500 Message-ID: --===============0983888174725452235== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-05 09:34:50 -0500 (Tue, 05 Feb 2008) New Revision: 9773 Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/T= estInstanceContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/T= estPortalContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/T= estPortletApplicationDeployer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/T= estPortletInvocationContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/T= estPortletInvoker.java Log: those files should have been deleted... Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/TestInstanceContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= TestInstanceContext.java 2008-02-05 14:32:02 UTC (rev 9772) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= TestInstanceContext.java 2008-02-05 14:34:50 UTC (rev 9773) @@ -1,102 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.test; - -import org.jboss.portal.portlet.state.AccessMode; -import org.jboss.portal.portlet.PortletContext; -import org.jboss.portal.portlet.StateEvent; -import org.jboss.portal.portlet.spi.InstanceContext; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -public class TestInstanceContext implements InstanceContext -{ - - /** . */ - private HttpServletRequest req; - - /** . */ - private boolean modifiable; - - /** . */ - private PortletContext target; - - /** . */ - private boolean useClone; - - /** . */ - private String id; - - public TestInstanceContext( - HttpServletRequest req, - PortletContext portletContext, - boolean modifiable) - { - String id =3D portletContext.getId(); - PortletContext target =3D portletContext; - boolean useClone =3D false; - HttpSession session =3D req.getSession(false); - if (session !=3D null) - { - PortletContext clone =3D (PortletContext)session.getAttribute("cl= one." + id); - if (clone !=3D null) - { - target =3D clone; - useClone =3D true; - } - } - - // - this.req =3D req; - this.useClone =3D useClone; - this.target =3D target; - this.id =3D id; - this.modifiable =3D modifiable; - } - - public PortletContext getTarget() - { - return target; - } - - public String getId() - { - return id; - } - - public AccessMode getAccessMode() - { - return modifiable ? (useClone ? AccessMode.READ_WRITE : AccessMode.C= LONE_BEFORE_WRITE) : AccessMode.READ_ONLY; - } - - public void onStateEvent(StateEvent event) - { - target =3D event.getPortletContext(); - req.getSession().setAttribute("clone." + id, target); - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/TestPortalContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= TestPortalContext.java 2008-02-05 14:32:02 UTC (rev 9772) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= TestPortalContext.java 2008-02-05 14:34:50 UTC (rev 9773) @@ -1,40 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.test; - -import org.jboss.portal.portlet.impl.spi.AbstractPortalContext; - -import java.util.Map; -import java.util.Collections; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class TestPortalContext extends AbstractPortalContext -{ - public TestPortalContext() - { - super(Collections.singletonMap("javax.portlet.markup.head.element.su= pport", "true")); - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/TestPortletApplicationDeployer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= TestPortletApplicationDeployer.java 2008-02-05 14:32:02 UTC (rev 9772) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= TestPortletApplicationDeployer.java 2008-02-05 14:34:50 UTC (rev 9773) @@ -1,55 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ - -package org.jboss.portal.portlet.test; - -import org.jboss.portal.web.WebApp; - -/** - * @author Chris Laprun - * @version $Revision$ - */ -public class TestPortletApplicationDeployer extends PortletApplicationDepl= oyer -{ - /** . */ - private Object driver; - - public Object getDriver() - { - return driver; - } - - public void setDriver(Object driver) - { - this.driver =3D driver; - } - - @Override - protected void add(WebApp webApp) - { - // Set the driver for the web app - webApp.getServletContext().setAttribute("TestDriverServer", driver); - - super.add(webApp); - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/TestPortletInvocationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= TestPortletInvocationContext.java 2008-02-05 14:32:02 UTC (rev 9772) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= TestPortletInvocationContext.java 2008-02-05 14:34:50 UTC (rev 9773) @@ -1,97 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.test; - -import org.jboss.portal.portlet.ContainerURL; -import org.jboss.portal.portlet.test.controller.PageNavigationalState; -import org.jboss.portal.portlet.test.controller2.PortletURLRenderer; -import org.jboss.portal.portlet.invocation.PortletInvocation; -import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext; -import org.jboss.portal.common.util.MarkupInfo; -import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResol= ver; -import org.jboss.portal.common.invocation.resolver.MapAttributeResolver; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -public class TestPortletInvocationContext extends AbstractPortletInvocatio= nContext -{ - - /** . */ - private final PortletURLRenderer urlRenderer; - - /** . */ - private final String windowId; - - /** . */ - private final PageNavigationalState pageState; - - /** . */ - private final HttpServletRequest clientRequest; - - /** . */ - private final HttpServletResponse clientResponse; - - public TestPortletInvocationContext( - HttpServletRequest clientRequest, - HttpServletResponse clientResponse, - String windowId, - PageNavigationalState pageState, - MarkupInfo markupInfo) - { - super(markupInfo); - - // - this.clientRequest =3D clientRequest; - this.clientResponse =3D clientResponse; - this.windowId =3D windowId; - this.pageState =3D pageState; - this.urlRenderer =3D new PortletURLRenderer(pageState, windowId, cli= entRequest, clientResponse); - - // - addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttribut= eResolver(clientRequest)); - addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeReso= lver()); - addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, new MapAttri= buteResolver()); - addResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, new MapAttr= ibuteResolver()); - addResolver(PortletInvocation.REQUEST_SCOPE, new MapAttributeResolve= r()); - } - - public HttpServletRequest getClientRequest() throws IllegalStateExcepti= on - { - return clientRequest; - } - - public HttpServletResponse getClientResponse() throws IllegalStateExcep= tion - { - return clientResponse; - } - - public String renderURL(ContainerURL containerURL, Boolean wantSecure, = Boolean wantAuthenticated, boolean relative) - { - return urlRenderer.renderURL(containerURL, wantSecure, wantAuthentic= ated, relative); - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/TestPortletInvoker.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= TestPortletInvoker.java 2008-02-05 14:32:02 UTC (rev 9772) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= TestPortletInvoker.java 2008-02-05 14:34:50 UTC (rev 9773) @@ -1,158 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.test; - -import org.jboss.portal.portlet.PortletInvoker; -import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.Portlet; -import org.jboss.portal.portlet.PortletContext; -import org.jboss.portal.portlet.state.PropertyMap; -import org.jboss.portal.portlet.state.PropertyChange; -import org.jboss.portal.portlet.state.DestroyCloneFailure; -import org.jboss.portal.portlet.invocation.PortletInvocation; -import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.common.invocation.InterceptorStackFactory; -import org.jboss.portal.common.invocation.InvocationHandler; -import org.jboss.portal.common.invocation.Invocation; -import org.jboss.portal.common.invocation.InvocationException; - -import java.util.Set; -import java.util.List; - -/** - * A simple consumer. - * - * @author Julien Viet - * @version $Revision: 6712 $ - */ -public class TestPortletInvoker implements PortletInvoker -{ - - /** . */ - private InterceptorStackFactory stackFactory; - - /** . */ - private PortletInvoker producer; - - /** . */ - private InvocationHandler handler =3D new InvocationHandler() - { - public Object invoke(Invocation invocation) throws Exception, Invoca= tionException - { - PortletInvocation portletInvocation =3D (PortletInvocation)invoca= tion; - try - { - portletInvocation.setHandler(null); - return producer.invoke(portletInvocation); - } - finally - { - portletInvocation.setHandler(this); - } - } - }; - - public InterceptorStackFactory getStackFactory() - { - return stackFactory; - } - - public void setStackFactory(InterceptorStackFactory stackFactory) - { - this.stackFactory =3D stackFactory; - } - - public PortletInvoker getProducer() - { - return producer; - } - - public void setProducer(PortletInvoker producer) - { - this.producer =3D producer; - } - - public Set getPortlets() throws PortletInvokerException - { - return producer.getPortlets(); - } - - public Portlet getPortlet(PortletContext portletContext) throws Illegal= ArgumentException, PortletInvokerException - { - return producer.getPortlet(portletContext); - } - - public PortletInvocationResponse invoke(PortletInvocation invocation) t= hrows PortletInvokerException - { - InvocationHandler prevHandler =3D invocation.getHandler(); - try - { - invocation.setHandler(handler); - return (PortletInvocationResponse)invocation.invoke(stackFactory.= getInterceptorStack()); - } - catch (Exception e) - { - if (e instanceof PortletInvokerException) - { - throw(PortletInvokerException)e; - } - else if (e instanceof RuntimeException) - { - throw(RuntimeException)e; - } - else - { - throw new PortletInvokerException(e); - } - } - finally - { - invocation.setHandler(prevHandler); - } - } - - public PortletContext createClone(PortletContext portletContext) throws= IllegalArgumentException, PortletInvokerException, UnsupportedOperationExc= eption - { - throw new UnsupportedOperationException(); - } - - public List destroyClones(List por= tletContexts) throws IllegalArgumentException, PortletInvokerException, Uns= upportedOperationException - { - throw new UnsupportedOperationException(); - } - - public PropertyMap getProperties(PortletContext portletContext, Set key= s) throws IllegalArgumentException, PortletInvokerException, UnsupportedOpe= rationException - { - throw new UnsupportedOperationException(); - } - - public PropertyMap getProperties(PortletContext portletContext) throws = IllegalArgumentException, PortletInvokerException, UnsupportedOperationExce= ption - { - throw new UnsupportedOperationException(); - } - - public PortletContext setProperties(PortletContext portletContext, Prop= ertyChange[] changes) throws IllegalArgumentException, PortletInvokerExcept= ion, UnsupportedOperationException - { - throw new UnsupportedOperationException(); - } -} --===============0983888174725452235==-- From portal-commits at lists.jboss.org Tue Feb 5 09:59:44 2008 Content-Type: multipart/mixed; boundary="===============8564275610364709574==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9774 - tags/JBoss_Portal_2_6_4/build. Date: Tue, 05 Feb 2008 09:59:43 -0500 Message-ID: --===============8564275610364709574== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-05 09:59:43 -0500 (Tue, 05 Feb 2008) New Revision: 9774 Modified: tags/JBoss_Portal_2_6_4/build/build-thirdparty.xml tags/JBoss_Portal_2_6_4/build/build.xml tags/JBoss_Portal_2_6_4/build/distrib.xml Log: 2.6.4 Modified: tags/JBoss_Portal_2_6_4/build/build-thirdparty.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- tags/JBoss_Portal_2_6_4/build/build-thirdparty.xml 2008-02-05 14:34:50 = UTC (rev 9773) +++ tags/JBoss_Portal_2_6_4/build/build-thirdparty.xml 2008-02-05 14:59:43 = UTC (rev 9774) @@ -50,8 +50,8 @@ - - + + Modified: tags/JBoss_Portal_2_6_4/build/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- tags/JBoss_Portal_2_6_4/build/build.xml 2008-02-05 14:34:50 UTC (rev 97= 73) +++ tags/JBoss_Portal_2_6_4/build/build.xml 2008-02-05 14:59:43 UTC (rev 97= 74) @@ -61,8 +61,8 @@ = - - + + = @@ -538,4 +538,4 @@
= = - \ No newline at end of file + Modified: tags/JBoss_Portal_2_6_4/build/distrib.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- tags/JBoss_Portal_2_6_4/build/distrib.xml 2008-02-05 14:34:50 UTC (rev = 9773) +++ tags/JBoss_Portal_2_6_4/build/distrib.xml 2008-02-05 14:59:43 UTC (rev = 9774) @@ -2,7 +2,7 @@ = - + = --===============8564275610364709574==-- From portal-commits at lists.jboss.org Tue Feb 5 10:13:09 2008 Content-Type: multipart/mixed; boundary="===============5439664470523033119==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9775 - docs/tags. Date: Tue, 05 Feb 2008 10:13:09 -0500 Message-ID: --===============5439664470523033119== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-05 10:13:09 -0500 (Tue, 05 Feb 2008) New Revision: 9775 Added: docs/tags/JBoss_Portal_2_6_4/ Log: Tagging doc Copied: docs/tags/JBoss_Portal_2_6_4 (from rev 9774, docs/branches/JBoss_Po= rtal_Branch_2_6) --===============5439664470523033119==-- From portal-commits at lists.jboss.org Tue Feb 5 10:23:28 2008 Content-Type: multipart/mixed; boundary="===============7694548113036859215==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9776 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test. Date: Tue, 05 Feb 2008 10:23:27 -0500 Message-ID: --===============7694548113036859215== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-05 10:23:27 -0500 (Tue, 05 Feb 2008) New Revision: 9776 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/T= estPortletApplicationDeployer.java Log: I deleted that file by mistake in my previous commit Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/TestPortletApplicationDeployer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= TestPortletApplicationDeployer.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= TestPortletApplicationDeployer.java 2008-02-05 15:23:27 UTC (rev 9776) @@ -0,0 +1,55 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.test; + +import org.jboss.portal.web.WebApp; + +/** + * @author Chris Laprun + * @version $Revision$ + */ +public class TestPortletApplicationDeployer extends PortletApplicationDepl= oyer +{ + /** . */ + private Object driver; + + public Object getDriver() + { + return driver; + } + + public void setDriver(Object driver) + { + this.driver =3D driver; + } + + @Override + protected void add(WebApp webApp) + { + // Set the driver for the web app + webApp.getServletContext().setAttribute("TestDriverServer", driver); + + super.add(webApp); + } +} --===============7694548113036859215==-- From portal-commits at lists.jboss.org Tue Feb 5 10:42:52 2008 Content-Type: multipart/mixed; boundary="===============5175076830949422376==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9777 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal: portlet/controller and 6 other directories. Date: Tue, 05 Feb 2008 10:38:52 -0500 Message-ID: --===============5175076830949422376== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-05 10:38:52 -0500 (Tue, 05 Feb 2008) New Revision: 9777 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/ Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/ Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/MutablePageNavigationalState.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/PageNavigationalState.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/PortletController.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/PortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/PortletRequestHandler.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/PortletResourceRequestHandler.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/RequestHandler.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/WindowNavigationalState.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/event/Event.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/event/EventControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/event/EventControllerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/ContainerRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/ControllerRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/FullScopedCacheablePortletResourceRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/PageScopedFullPortletResourceRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/PortletActionRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/PortletRenderRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/PortletRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/PortletResourceRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/PortletScopedPortletResourceRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/response/ControllerResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/response/PageUpdateResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/response/PortletResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/response/ResourceResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortalServlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/AbstractMarkupRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/ControllerResponseRendererFactory.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/ErrorResponseRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/PageRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/PortletControllerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/PortletURLRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/RedirectResponseRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/Renderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/TestPortletInvocationContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimpleP= ortalServlet.java Log: move controller package to org/jboss/portal/portlet Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/c= ontroller (from rev 9775, modules/portlet/trunk/test/src/main/java/org/jbos= s/portal/portlet/test/controller) Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/MutablePageNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/MutablePageNavigationalState.java 2008-02-05 15:13:09 UTC (rev 9= 775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/MutablePageNavigationalState.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -20,9 +20,9 @@ * 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.portlet.test.controller; +package org.jboss.portal.portlet.controller; = -import org.jboss.portal.portlet.test.controller.WindowNavigationalState; +import org.jboss.portal.portlet.controller.WindowNavigationalState; = import javax.xml.namespace.QName; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/PageNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PageNavigationalState.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PageNavigationalState.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -20,10 +20,9 @@ * 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.portlet.test.controller; +package org.jboss.portal.portlet.controller; = import org.jboss.portal.common.util.ParameterMap; -import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.info.ParameterInfo; import org.jboss.portal.portlet.info.PortletInfo; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/PortletController.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletController.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletController.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -20,15 +20,13 @@ * 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.portlet.test.controller; +package org.jboss.portal.portlet.controller; = -import org.jboss.portal.common.util.MarkupInfo; -import org.jboss.portal.common.util.MediaType; import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.test.controller.request.ControllerRequest; -import org.jboss.portal.portlet.test.controller.request.PortletRequest; -import org.jboss.portal.portlet.test.controller.request.PortletResourceReq= uest; -import org.jboss.portal.portlet.test.controller.response.ControllerRespons= e; +import org.jboss.portal.portlet.controller.request.ControllerRequest; +import org.jboss.portal.portlet.controller.request.PortletRequest; +import org.jboss.portal.portlet.controller.request.PortletResourceRequest; +import org.jboss.portal.portlet.controller.response.ControllerResponse; = import java.io.IOException; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/PortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContext.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletControllerContext.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -20,7 +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.portlet.test.controller; +package org.jboss.portal.portlet.controller; = import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.spi.PortletInvocationContext; @@ -29,7 +29,7 @@ import org.jboss.portal.portlet.invocation.EventInvocation; import org.jboss.portal.portlet.invocation.ResourceInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.test.controller.event.EventControllerConte= xt; +import org.jboss.portal.portlet.controller.event.EventControllerContext; = import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/PortletRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletRequestHandler.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletRequestHandler.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -2,7 +2,7 @@ * Copyright (c) 2008, Your Corporation. All Rights Reserved. */ = -package org.jboss.portal.portlet.test.controller; +package org.jboss.portal.portlet.controller; = import org.jboss.portal.Mode; import org.jboss.portal.WindowState; @@ -19,15 +19,15 @@ import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.ResponseProperties; import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStat= eResponse; -import org.jboss.portal.portlet.test.controller.event.Event; -import org.jboss.portal.portlet.test.controller.event.EventControllerConte= xt; -import org.jboss.portal.portlet.test.controller.request.ControllerRequest; -import org.jboss.portal.portlet.test.controller.request.PortletActionReque= st; -import org.jboss.portal.portlet.test.controller.request.PortletRenderReque= st; -import org.jboss.portal.portlet.test.controller.request.PortletRequest; -import org.jboss.portal.portlet.test.controller.response.ControllerRespons= e; -import org.jboss.portal.portlet.test.controller.response.PageUpdateRespons= e; -import org.jboss.portal.portlet.test.controller.response.PortletResponse; +import org.jboss.portal.portlet.controller.event.Event; +import org.jboss.portal.portlet.controller.event.EventControllerContext; +import org.jboss.portal.portlet.controller.request.ControllerRequest; +import org.jboss.portal.portlet.controller.request.PortletActionRequest; +import org.jboss.portal.portlet.controller.request.PortletRenderRequest; +import org.jboss.portal.portlet.controller.request.PortletRequest; +import org.jboss.portal.portlet.controller.response.ControllerResponse; +import org.jboss.portal.portlet.controller.response.PageUpdateResponse; +import org.jboss.portal.portlet.controller.response.PortletResponse; = import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/PortletResourceRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletResourceRequestHandler.java 2008-02-05 15:13:09 UTC (rev = 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletResourceRequestHandler.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -21,7 +21,7 @@ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * *************************************************************************= *****/ = -package org.jboss.portal.portlet.test.controller; +package org.jboss.portal.portlet.controller; = import org.jboss.portal.Mode; import org.jboss.portal.WindowState; @@ -33,12 +33,12 @@ import org.jboss.portal.portlet.cache.CacheLevel; import org.jboss.portal.portlet.invocation.ResourceInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.test.controller.request.ControllerRequest; -import org.jboss.portal.portlet.test.controller.request.PageScopedFullPort= letResourceRequest; -import org.jboss.portal.portlet.test.controller.request.PortletResourceReq= uest; -import org.jboss.portal.portlet.test.controller.request.PortletScopedPortl= etResourceRequest; -import org.jboss.portal.portlet.test.controller.response.ControllerRespons= e; -import org.jboss.portal.portlet.test.controller.response.ResourceResponse; +import org.jboss.portal.portlet.controller.request.ControllerRequest; +import org.jboss.portal.portlet.controller.request.PageScopedFullPortletRe= sourceRequest; +import org.jboss.portal.portlet.controller.request.PortletResourceRequest; +import org.jboss.portal.portlet.controller.request.PortletScopedPortletRes= ourceRequest; +import org.jboss.portal.portlet.controller.response.ControllerResponse; +import org.jboss.portal.portlet.controller.response.ResourceResponse; = import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/RequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/RequestHandler.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/RequestHandler.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -2,12 +2,12 @@ * Copyright (c) 2008, Your Corporation. All Rights Reserved. */ = -package org.jboss.portal.portlet.test.controller; +package org.jboss.portal.portlet.controller; = import org.apache.log4j.Logger; import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.test.controller.request.ControllerRequest; -import org.jboss.portal.portlet.test.controller.response.ControllerRespons= e; +import org.jboss.portal.portlet.controller.request.ControllerRequest; +import org.jboss.portal.portlet.controller.response.ControllerResponse; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; = import java.io.IOException; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/WindowNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/WindowNavigationalState.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/WindowNavigationalState.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -20,7 +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.portlet.test.controller; +package org.jboss.portal.portlet.controller; = import org.jboss.portal.Mode; import org.jboss.portal.WindowState; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/event/Event.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/event/Event.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/event/Event.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -20,10 +20,8 @@ * 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.portlet.test.controller.event; +package org.jboss.portal.portlet.controller.event; = -import org.jboss.portal.portlet.PortletContext; - import javax.xml.namespace.QName; import java.io.Serializable; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/event/EventControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/event/EventControllerContext.java 2008-02-05 15:13:09 UTC (rev 9= 775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/event/EventControllerContext.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -20,7 +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.portlet.test.controller.event; +package org.jboss.portal.portlet.controller.event; = import java.util.List; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/event/EventControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/event/EventControllerContextImpl.java 2008-02-05 15:13:09 UTC (r= ev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/event/EventControllerContextImpl.java 2008-02-05 15:38:52 UTC (rev 97= 77) @@ -20,7 +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.portlet.test.controller.event; +package org.jboss.portal.portlet.controller.event; = import org.jboss.portal.portlet.PortletInvoker; import org.jboss.portal.portlet.Portlet; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/ContainerRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/request/ContainerRequest.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/ContainerRequest.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -20,9 +20,9 @@ * 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.portlet.test.controller.request; +package org.jboss.portal.portlet.controller.request; = -import org.jboss.portal.portlet.test.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.PortletControllerContext; = /** * @author Julien Viet Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/ControllerRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/request/ControllerRequest.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/ControllerRequest.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -20,9 +20,9 @@ * 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.portlet.test.controller.request; +package org.jboss.portal.portlet.controller.request; = -import org.jboss.portal.portlet.test.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.PortletControllerContext; = /** * @author Julien Viet Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/FullScopedCacheablePortletResourceRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/request/FullScopedCacheablePortletResourceRequest.java 2008-02-0= 5 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/FullScopedCacheablePortletResourceRequest.java 2008-02-05 15:= 38:52 UTC (rev 9777) @@ -20,10 +20,10 @@ * 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.portlet.test.controller.request; +package org.jboss.portal.portlet.controller.request; = import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.test.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.PortletControllerContext; import org.jboss.portal.common.util.ParameterMap; = /** Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/PageScopedFullPortletResourceRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/request/PageScopedFullPortletResourceRequest.java 2008-02-05 15:= 13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PageScopedFullPortletResourceRequest.java 2008-02-05 15:38:52= UTC (rev 9777) @@ -20,12 +20,12 @@ * 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.portlet.test.controller.request; +package org.jboss.portal.portlet.controller.request; = import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.test.controller.WindowNavigationalState; -import org.jboss.portal.portlet.test.controller.PageNavigationalState; -import org.jboss.portal.portlet.test.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.WindowNavigationalState; +import org.jboss.portal.portlet.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.PortletControllerContext; import org.jboss.portal.common.util.ParameterMap; = /** Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/PortletActionRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/request/PortletActionRequest.java 2008-02-05 15:13:09 UTC (rev 9= 775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletActionRequest.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -20,12 +20,12 @@ * 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.portlet.test.controller.request; +package org.jboss.portal.portlet.controller.request; = import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.test.controller.WindowNavigationalState; -import org.jboss.portal.portlet.test.controller.PortletControllerContext; -import org.jboss.portal.portlet.test.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.WindowNavigationalState; +import org.jboss.portal.portlet.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.PageNavigationalState; import org.jboss.portal.common.util.ParameterMap; = /** Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/PortletRenderRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/request/PortletRenderRequest.java 2008-02-05 15:13:09 UTC (rev 9= 775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletRenderRequest.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -20,11 +20,11 @@ * 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.portlet.test.controller.request; +package org.jboss.portal.portlet.controller.request; = -import org.jboss.portal.portlet.test.controller.WindowNavigationalState; -import org.jboss.portal.portlet.test.controller.PortletControllerContext; -import org.jboss.portal.portlet.test.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.WindowNavigationalState; +import org.jboss.portal.portlet.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.PageNavigationalState; = import java.util.Map; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/PortletRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/request/PortletRequest.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletRequest.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -20,11 +20,11 @@ * 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.portlet.test.controller.request; +package org.jboss.portal.portlet.controller.request; = -import org.jboss.portal.portlet.test.controller.WindowNavigationalState; -import org.jboss.portal.portlet.test.controller.PageNavigationalState; -import org.jboss.portal.portlet.test.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.WindowNavigationalState; +import org.jboss.portal.portlet.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.PortletControllerContext; = /** * @author Julien Viet Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/PortletResourceRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/request/PortletResourceRequest.java 2008-02-05 15:13:09 UTC (rev= 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletResourceRequest.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -20,11 +20,11 @@ * 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.portlet.test.controller.request; +package org.jboss.portal.portlet.controller.request; = import org.jboss.portal.portlet.cache.CacheLevel; import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.test.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.PortletControllerContext; import org.jboss.portal.common.util.ParameterMap; = import java.util.Map; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/PortletScopedPortletResourceRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/request/PortletScopedPortletResourceRequest.java 2008-02-05 15:1= 3:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletScopedPortletResourceRequest.java 2008-02-05 15:38:52 = UTC (rev 9777) @@ -20,10 +20,10 @@ * 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.portlet.test.controller.request; +package org.jboss.portal.portlet.controller.request; = -import org.jboss.portal.portlet.test.controller.WindowNavigationalState; -import org.jboss.portal.portlet.test.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.WindowNavigationalState; +import org.jboss.portal.portlet.controller.PortletControllerContext; import org.jboss.portal.portlet.StateString; import org.jboss.portal.common.util.ParameterMap; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/response/ControllerResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/response/ControllerResponse.java 2008-02-05 15:13:09 UTC (rev 97= 75) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/response/ControllerResponse.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -21,7 +21,7 @@ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * *************************************************************************= *****/ = -package org.jboss.portal.portlet.test.controller.response; +package org.jboss.portal.portlet.controller.response; = /** * Must be used as base class for high level response provided by the cont= roller that will be translated into something Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/response/PageUpdateResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/response/PageUpdateResponse.java 2008-02-05 15:13:09 UTC (rev 97= 75) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/response/PageUpdateResponse.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -20,12 +20,11 @@ * 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.portlet.test.controller.response; +package org.jboss.portal.portlet.controller.response; = import org.jboss.portal.portlet.invocation.response.ResponseProperties; import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStat= eResponse; -import org.jboss.portal.portlet.test.controller.response.ControllerRespons= e; -import org.jboss.portal.portlet.test.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.PageNavigationalState; = /** * @author Julien Viet Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/response/PortletResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/response/PortletResponse.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/response/PortletResponse.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -20,7 +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.portlet.test.controller.response; +package org.jboss.portal.portlet.controller.response; = import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/response/ResourceResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/response/ResourceResponse.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/response/ResourceResponse.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -21,7 +21,7 @@ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * *************************************************************************= *****/ = -package org.jboss.portal.portlet.test.controller.response; +package org.jboss.portal.portlet.controller.response; = import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortalServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortalServlet.java 2008-02-05 15:23:27 UTC (rev 9776) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortalServlet.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -22,10 +22,10 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test; = -import org.jboss.portal.portlet.test.controller.response.ControllerRespons= e; -import org.jboss.portal.portlet.test.controller.PortletController; +import org.jboss.portal.portlet.controller.response.ControllerResponse; +import org.jboss.portal.portlet.controller.PortletController; import org.jboss.portal.portlet.test.controller2.PortletControllerContextI= mpl; -import org.jboss.portal.portlet.test.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.PageNavigationalState; import org.jboss.portal.portlet.test.controller2.ControllerResponseRendere= rFactory; import org.jboss.portal.portlet.test.controller2.Renderer; import org.jboss.portal.portlet.test.controller2.PageRenderer; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller2/AbstractMarkupRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/AbstractMarkupRenderer.java 2008-02-05 15:23:27 UTC (rev 9776) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/AbstractMarkupRenderer.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -23,7 +23,7 @@ package org.jboss.portal.portlet.test.controller2; = import org.jboss.portal.portlet.invocation.response.ResponseProperties; -import org.jboss.portal.portlet.test.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.PortletControllerContext; import org.jboss.portal.common.util.MultiValuedPropertyMap; = import javax.servlet.http.HttpServletResponse; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller2/ControllerResponseRendererFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/ControllerResponseRendererFactory.java 2008-02-05 15:23:27 UTC = (rev 9776) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/ControllerResponseRendererFactory.java 2008-02-05 15:38:52 UTC = (rev 9777) @@ -22,10 +22,10 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.controller2; = -import org.jboss.portal.portlet.test.controller.response.ControllerRespons= e; -import org.jboss.portal.portlet.test.controller.response.PageUpdateRespons= e; -import org.jboss.portal.portlet.test.controller.response.ResourceResponse; -import org.jboss.portal.portlet.test.controller.response.PortletResponse; +import org.jboss.portal.portlet.controller.response.ControllerResponse; +import org.jboss.portal.portlet.controller.response.PageUpdateResponse; +import org.jboss.portal.portlet.controller.response.ResourceResponse; +import org.jboss.portal.portlet.controller.response.PortletResponse; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.HTTPRedirectionRespons= e; import org.jboss.portal.portlet.invocation.response.ErrorResponse; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller2/ErrorResponseRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/ErrorResponseRenderer.java 2008-02-05 15:23:27 UTC (rev 9776) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/ErrorResponseRenderer.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.controller2; = -import org.jboss.portal.portlet.test.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.PortletControllerContext; import org.jboss.portal.portlet.invocation.response.ErrorResponse; import org.apache.log4j.Logger; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller2/PageRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PageRenderer.java 2008-02-05 15:23:27 UTC (rev 9776) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PageRenderer.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -42,9 +42,9 @@ import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.ResponseProperties; -import org.jboss.portal.portlet.test.controller.WindowNavigationalState; -import org.jboss.portal.portlet.test.controller.PageNavigationalState; -import org.jboss.portal.portlet.test.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.WindowNavigationalState; +import org.jboss.portal.portlet.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.PortletControllerContext; import org.w3c.dom.Element; = import javax.servlet.http.HttpServletRequest; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller2/PortletControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PortletControllerContextImpl.java 2008-02-05 15:23:27 UTC (rev = 9776) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PortletControllerContextImpl.java 2008-02-05 15:38:52 UTC (rev = 9777) @@ -55,17 +55,17 @@ import org.jboss.portal.portlet.test.controller2.TestPortalContext; import org.jboss.portal.portlet.test.controller2.TestPortletInvocationCont= ext; import static org.jboss.portal.portlet.test.URLParameterConstants.*; -import org.jboss.portal.portlet.test.controller.WindowNavigationalState; -import org.jboss.portal.portlet.test.controller.PortletControllerContext; -import org.jboss.portal.portlet.test.controller.PageNavigationalState; -import org.jboss.portal.portlet.test.controller.request.PortletRenderReque= st; -import org.jboss.portal.portlet.test.controller.request.ControllerRequest; -import org.jboss.portal.portlet.test.controller.request.PortletScopedPortl= etResourceRequest; -import org.jboss.portal.portlet.test.controller.request.FullScopedCacheabl= ePortletResourceRequest; -import org.jboss.portal.portlet.test.controller.request.PageScopedFullPort= letResourceRequest; -import org.jboss.portal.portlet.test.controller.request.PortletActionReque= st; -import org.jboss.portal.portlet.test.controller.event.EventControllerConte= xt; -import org.jboss.portal.portlet.test.controller.event.EventControllerConte= xtImpl; +import org.jboss.portal.portlet.controller.WindowNavigationalState; +import org.jboss.portal.portlet.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.request.PortletRenderRequest; +import org.jboss.portal.portlet.controller.request.ControllerRequest; +import org.jboss.portal.portlet.controller.request.PortletScopedPortletRes= ourceRequest; +import org.jboss.portal.portlet.controller.request.FullScopedCacheablePort= letResourceRequest; +import org.jboss.portal.portlet.controller.request.PageScopedFullPortletRe= sourceRequest; +import org.jboss.portal.portlet.controller.request.PortletActionRequest; +import org.jboss.portal.portlet.controller.event.EventControllerContext; +import org.jboss.portal.portlet.controller.event.EventControllerContextImp= l; import org.jboss.portal.web.Body; import org.jboss.portal.web.IllegalRequestException; import org.jboss.portal.web.WebRequest; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller2/PortletURLRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PortletURLRenderer.java 2008-02-05 15:23:27 UTC (rev 9776) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PortletURLRenderer.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -28,15 +28,13 @@ import org.jboss.portal.common.util.Tools; import org.jboss.portal.portlet.ActionURL; import org.jboss.portal.portlet.ContainerURL; -import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletURL; import org.jboss.portal.portlet.RenderURL; import org.jboss.portal.portlet.ResourceURL; import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.cache.CacheLevel; import static org.jboss.portal.portlet.test.URLParameterConstants.*; -import org.jboss.portal.portlet.test.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.PageNavigationalState; import org.jboss.portal.portlet.test.StringCodec; = import javax.servlet.http.HttpServletRequest; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller2/RedirectResponseRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/RedirectResponseRenderer.java 2008-02-05 15:23:27 UTC (rev 9776) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/RedirectResponseRenderer.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.controller2; = -import org.jboss.portal.portlet.test.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.PortletControllerContext; import org.jboss.portal.portlet.invocation.response.HTTPRedirectionRespons= e; = import java.io.IOException; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller2/Renderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/Renderer.java 2008-02-05 15:23:27 UTC (rev 9776) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/Renderer.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.controller2; = -import org.jboss.portal.portlet.test.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.PortletControllerContext; = import java.io.IOException; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller2/TestPortletInvocationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/TestPortletInvocationContext.java 2008-02-05 15:23:27 UTC (rev = 9776) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/TestPortletInvocationContext.java 2008-02-05 15:38:52 UTC (rev = 9777) @@ -23,7 +23,7 @@ package org.jboss.portal.portlet.test.controller2; = import org.jboss.portal.portlet.ContainerURL; -import org.jboss.portal.portlet.test.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.PageNavigationalState; import org.jboss.portal.portlet.test.controller2.PortletURLRenderer; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/= SimplePortalServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/Simple= PortalServlet.java 2008-02-05 15:23:27 UTC (rev 9776) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/Simple= PortalServlet.java 2008-02-05 15:38:52 UTC (rev 9777) @@ -23,9 +23,9 @@ package org.jboss.portal.simple; = import org.jboss.portal.portlet.invocation.response.ResponseProperties; -import org.jboss.portal.portlet.test.controller.PageNavigationalState; -import org.jboss.portal.portlet.test.controller.PortletController; -import org.jboss.portal.portlet.test.controller.response.ControllerRespons= e; +import org.jboss.portal.portlet.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.PortletController; +import org.jboss.portal.portlet.controller.response.ControllerResponse; import org.jboss.portal.portlet.test.controller2.Renderer; import org.jboss.portal.portlet.test.controller2.ControllerResponseRendere= rFactory; import org.jboss.portal.portlet.test.controller2.PortletControllerContextI= mpl; --===============5175076830949422376==-- From portal-commits at lists.jboss.org Tue Feb 5 10:50:22 2008 Content-Type: multipart/mixed; boundary="===============1385300744351619543==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9778 - in modules/portlet/trunk/test/src: main/java/org/jboss/portal/portlet/test/controller and 3 other directories. Date: Tue, 05 Feb 2008 10:46:21 -0500 Message-ID: --===============1385300744351619543== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-05 10:46:21 -0500 (Tue, 05 Feb 2008) New Revision: 9778 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/AbstractMarkupRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/ControllerResponseRendererFactory.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/ErrorResponseRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/FragmentRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PageRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletControllerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletURLRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/RedirectResponseRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/Renderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/ResourceRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/SimpleFragmentRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestInstanceContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestPortalContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestPortletInvocationContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestPortletInvoker.java Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/AbstractMarkupRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/ControllerResponseRendererFactory.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/ErrorResponseRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/FragmentRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PageRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletControllerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletURLRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/RedirectResponseRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/Renderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/ResourceRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/SimpleFragmentRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestInstanceContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestPortalContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestPortletInvocationContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestPortletInvoker.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller2/ Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortalServlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimpleP= ortalServlet.java modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/j= boss-beans.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= jboss-beans.xml Log: renamed controller2 package to controller as the previous controller packag= e moved to org.jboss.portal.portlet Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortalServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortalServlet.java 2008-02-05 15:38:52 UTC (rev 9777) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortalServlet.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -24,11 +24,11 @@ = import org.jboss.portal.portlet.controller.response.ControllerResponse; import org.jboss.portal.portlet.controller.PortletController; -import org.jboss.portal.portlet.test.controller2.PortletControllerContextI= mpl; +import org.jboss.portal.portlet.test.controller.PortletControllerContextIm= pl; import org.jboss.portal.portlet.controller.PageNavigationalState; -import org.jboss.portal.portlet.test.controller2.ControllerResponseRendere= rFactory; -import org.jboss.portal.portlet.test.controller2.Renderer; -import org.jboss.portal.portlet.test.controller2.PageRenderer; +import org.jboss.portal.portlet.test.controller.ControllerResponseRenderer= Factory; +import org.jboss.portal.portlet.test.controller.Renderer; +import org.jboss.portal.portlet.test.controller.PageRenderer; import org.jboss.portal.portlet.invocation.response.ResponseProperties; = import javax.servlet.ServletException; Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller (from rev 9775, modules/portlet/trunk/test/src/main/java/org= /jboss/portal/portlet/test/controller2) Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/AbstractMarkupRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/AbstractMarkupRenderer.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractMarkupRenderer.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -1,91 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.test.controller2; - -import org.jboss.portal.portlet.invocation.response.ResponseProperties; -import org.jboss.portal.portlet.test.controller.PortletControllerContext; -import org.jboss.portal.common.util.MultiValuedPropertyMap; - -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.Cookie; -import java.io.IOException; -import java.util.List; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public abstract class AbstractMarkupRenderer implements Renderer -{ - - /** . */ - protected ResponseProperties properties; - - public AbstractMarkupRenderer(ResponseProperties properties) - { - this.properties =3D properties; - } - - public void render(PortletControllerContext context) throws IOException - { - prepareRendering(context); - HttpServletResponse resp =3D context.getClientResponse(); - - // Render the headers and cookies - if (properties !=3D null) - { - renderTransportHeaders(properties, resp); - renderCookies(properties, resp); - } - - renderContent(resp); - } - - protected abstract void renderContent(HttpServletResponse resp) throws = IOException; - - private void renderCookies(ResponseProperties pageProperties, HttpServl= etResponse resp) - { - List cookies =3D pageProperties.getCookies(); - for (Cookie cookie : cookies) - { - resp.addCookie(cookie); - } - } - - private void renderTransportHeaders(ResponseProperties pageProperties, = HttpServletResponse resp) - { - MultiValuedPropertyMap transportHeaders =3D pageProperties.g= etTransportHeaders(); - for (String headerName : transportHeaders.keySet()) - { - for (String headerValue : transportHeaders.getValues(headerName)) - { - resp.addHeader(headerName, headerValue); - } - } - } - - protected void prepareRendering(PortletControllerContext context) - { - // default behavior does nothing - } -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller/AbstractMarkupRenderer.java (from rev 9777, modules/portlet/= trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/Abstract= MarkupRenderer.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractMarkupRenderer.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractMarkupRenderer.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -0,0 +1,91 @@ +/*************************************************************************= ***** + * 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.portlet.test.controller; + +import org.jboss.portal.portlet.invocation.response.ResponseProperties; +import org.jboss.portal.portlet.controller.PortletControllerContext; +import org.jboss.portal.common.util.MultiValuedPropertyMap; + +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.Cookie; +import java.io.IOException; +import java.util.List; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public abstract class AbstractMarkupRenderer implements Renderer +{ + + /** . */ + protected ResponseProperties properties; + + public AbstractMarkupRenderer(ResponseProperties properties) + { + this.properties =3D properties; + } + + public void render(PortletControllerContext context) throws IOException + { + prepareRendering(context); + HttpServletResponse resp =3D context.getClientResponse(); + + // Render the headers and cookies + if (properties !=3D null) + { + renderTransportHeaders(properties, resp); + renderCookies(properties, resp); + } + + renderContent(resp); + } + + protected abstract void renderContent(HttpServletResponse resp) throws = IOException; + + private void renderCookies(ResponseProperties pageProperties, HttpServl= etResponse resp) + { + List cookies =3D pageProperties.getCookies(); + for (Cookie cookie : cookies) + { + resp.addCookie(cookie); + } + } + + private void renderTransportHeaders(ResponseProperties pageProperties, = HttpServletResponse resp) + { + MultiValuedPropertyMap transportHeaders =3D pageProperties.g= etTransportHeaders(); + for (String headerName : transportHeaders.keySet()) + { + for (String headerValue : transportHeaders.getValues(headerName)) + { + resp.addHeader(headerName, headerValue); + } + } + } + + protected void prepareRendering(PortletControllerContext context) + { + // default behavior does nothing + } +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/ControllerResponseRendererFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/ControllerResponseRendererFactory.java 2008-02-05 15:13:09 UTC = (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ControllerResponseRendererFactory.java 2008-02-05 15:46:21 UTC (= rev 9778) @@ -1,87 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.test.controller2; - -import org.jboss.portal.portlet.test.controller.response.ControllerRespons= e; -import org.jboss.portal.portlet.test.controller.response.PageUpdateRespons= e; -import org.jboss.portal.portlet.test.controller.response.ResourceResponse; -import org.jboss.portal.portlet.test.controller.response.PortletResponse; -import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.invocation.response.HTTPRedirectionRespons= e; -import org.jboss.portal.portlet.invocation.response.ErrorResponse; -import org.jboss.portal.portlet.invocation.response.FragmentResponse; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class ControllerResponseRendererFactory -{ - public static Renderer getRenderer(ControllerResponse response) - { - if (response instanceof PageUpdateResponse) - { - PageUpdateResponse pageUpdate =3D (PageUpdateResponse)response; - - // - return new PageRenderer(pageUpdate.getProperties(), pageUpdate.ge= tPageState()); - } - else if (response instanceof PortletResponse) - { - return getRenderer(((PortletResponse)response).response); - } - else if (response instanceof ResourceResponse) - { - ResourceResponse resourceResponse =3D (ResourceResponse)response; - - // - if (resourceResponse.response instanceof FragmentResponse) - { - return new ResourceRenderer((FragmentResponse)resourceResponse= .response); - } - else - { - return getRenderer(((PortletResponse)response).response); - } - } - - // - throw new IllegalArgumentException("Unknown response type: " + respo= nse); - } - - private static Renderer getRenderer(PortletInvocationResponse response) - { - if (response instanceof HTTPRedirectionResponse) - { - return new RedirectResponseRenderer((HTTPRedirectionResponse)resp= onse); - } - else if (response instanceof ErrorResponse) - { - return new ErrorResponseRenderer((ErrorResponse)response); - } - - // - throw new IllegalArgumentException("Unknown response type: " + respo= nse); - } - -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller/ControllerResponseRendererFactory.java (from rev 9777, modul= es/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controlle= r2/ControllerResponseRendererFactory.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ControllerResponseRendererFactory.java (= rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ControllerResponseRendererFactory.java 2008-02-05 15:46:21 UTC (= rev 9778) @@ -0,0 +1,87 @@ +/*************************************************************************= ***** + * 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.portlet.test.controller; + +import org.jboss.portal.portlet.controller.response.ControllerResponse; +import org.jboss.portal.portlet.controller.response.PageUpdateResponse; +import org.jboss.portal.portlet.controller.response.ResourceResponse; +import org.jboss.portal.portlet.controller.response.PortletResponse; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.response.HTTPRedirectionRespons= e; +import org.jboss.portal.portlet.invocation.response.ErrorResponse; +import org.jboss.portal.portlet.invocation.response.FragmentResponse; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ControllerResponseRendererFactory +{ + public static Renderer getRenderer(ControllerResponse response) + { + if (response instanceof PageUpdateResponse) + { + PageUpdateResponse pageUpdate =3D (PageUpdateResponse)response; + + // + return new PageRenderer(pageUpdate.getProperties(), pageUpdate.ge= tPageState()); + } + else if (response instanceof PortletResponse) + { + return getRenderer(((PortletResponse)response).response); + } + else if (response instanceof ResourceResponse) + { + ResourceResponse resourceResponse =3D (ResourceResponse)response; + + // + if (resourceResponse.response instanceof FragmentResponse) + { + return new ResourceRenderer((FragmentResponse)resourceResponse= .response); + } + else + { + return getRenderer(((PortletResponse)response).response); + } + } + + // + throw new IllegalArgumentException("Unknown response type: " + respo= nse); + } + + private static Renderer getRenderer(PortletInvocationResponse response) + { + if (response instanceof HTTPRedirectionResponse) + { + return new RedirectResponseRenderer((HTTPRedirectionResponse)resp= onse); + } + else if (response instanceof ErrorResponse) + { + return new ErrorResponseRenderer((ErrorResponse)response); + } + + // + throw new IllegalArgumentException("Unknown response type: " + respo= nse); + } + +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/ErrorResponseRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/ErrorResponseRenderer.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ErrorResponseRenderer.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -1,63 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.test.controller2; - -import org.jboss.portal.portlet.test.controller.PortletControllerContext; -import org.jboss.portal.portlet.invocation.response.ErrorResponse; -import org.apache.log4j.Logger; - -import java.io.IOException; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class ErrorResponseRenderer implements Renderer -{ - - /** . */ - private static final Logger log =3D Logger.getLogger(ErrorResponseRende= rer.class); - - /** . */ - private ErrorResponse response; - - public ErrorResponseRenderer(ErrorResponse response) - { - this.response =3D response; - } - - public void render(PortletControllerContext context) throws IOException - { - if (response.getCause() !=3D null) - { - log.error("Portlet action threw an error: " + response.getMessage= (), response.getCause()); - } - else - { - log.error("Portlet action threw an error: " + response.getMessage= ()); - } - - // - context.getClientResponse().sendError(404, response.getMessage()); - } -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller/ErrorResponseRenderer.java (from rev 9777, modules/portlet/t= runk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ErrorResp= onseRenderer.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ErrorResponseRenderer.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ErrorResponseRenderer.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -0,0 +1,63 @@ +/*************************************************************************= ***** + * 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.portlet.test.controller; + +import org.jboss.portal.portlet.controller.PortletControllerContext; +import org.jboss.portal.portlet.invocation.response.ErrorResponse; +import org.apache.log4j.Logger; + +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ErrorResponseRenderer implements Renderer +{ + + /** . */ + private static final Logger log =3D Logger.getLogger(ErrorResponseRende= rer.class); + + /** . */ + private ErrorResponse response; + + public ErrorResponseRenderer(ErrorResponse response) + { + this.response =3D response; + } + + public void render(PortletControllerContext context) throws IOException + { + if (response.getCause() !=3D null) + { + log.error("Portlet action threw an error: " + response.getMessage= (), response.getCause()); + } + else + { + log.error("Portlet action threw an error: " + response.getMessage= ()); + } + + // + context.getClientResponse().sendError(404, response.getMessage()); + } +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/FragmentRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/FragmentRenderer.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/FragmentRenderer.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -1,38 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ - -package org.jboss.portal.portlet.test.controller2; - -import org.jboss.portal.portlet.invocation.response.ErrorResponse; -import org.jboss.portal.portlet.invocation.response.FragmentResponse; - -/** - * @author Chris Laprun - * @version $Revision: 9748 $ - */ -public interface FragmentRenderer -{ - String renderPortlet(FragmentResponse fragment); - - String renderError(ErrorResponse error); -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller/FragmentRenderer.java (from rev 9777, modules/portlet/trunk/= test/src/main/java/org/jboss/portal/portlet/test/controller2/FragmentRender= er.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/FragmentRenderer.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/FragmentRenderer.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -0,0 +1,38 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.test.controller; + +import org.jboss.portal.portlet.invocation.response.ErrorResponse; +import org.jboss.portal.portlet.invocation.response.FragmentResponse; + +/** + * @author Chris Laprun + * @version $Revision: 9748 $ + */ +public interface FragmentRenderer +{ + String renderPortlet(FragmentResponse fragment); + + String renderError(ErrorResponse error); +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/PageRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PageRenderer.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PageRenderer.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -1,246 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ - -package org.jboss.portal.portlet.test.controller2; - -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; -import org.jboss.portal.common.util.MultiValuedPropertyMap; -import org.jboss.portal.common.util.ParameterMap; -import org.jboss.portal.common.xml.XMLTools; -import org.jboss.portal.portlet.Portlet; -import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.spi.PortletInvocationContext; -import org.jboss.portal.portlet.impl.spi.AbstractClientContext; -import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; -import org.jboss.portal.portlet.impl.spi.AbstractServerContext; -import org.jboss.portal.portlet.impl.spi.AbstractUserContext; -import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; -import org.jboss.portal.portlet.invocation.RenderInvocation; -import org.jboss.portal.portlet.invocation.response.ErrorResponse; -import org.jboss.portal.portlet.invocation.response.FragmentResponse; -import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.invocation.response.ResponseProperties; -import org.jboss.portal.portlet.test.controller.WindowNavigationalState; -import org.jboss.portal.portlet.test.controller.PageNavigationalState; -import org.jboss.portal.portlet.test.controller.PortletControllerContext; -import org.w3c.dom.Element; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -/** - * @author Chris Laprun - * @version $Revision: 9748 $ - */ -public class PageRenderer extends AbstractMarkupRenderer -{ - - private FragmentRenderer fragmentRenderer =3D new SimpleFragmentRendere= r(); - private List fragments; - private List errors; - private PageNavigationalState pageState; - - public PageRenderer(ResponseProperties properties, PageNavigationalStat= e pageState) - { - super(properties); - - // - this.pageState =3D pageState; - } - - public void setFragmentRenderer(FragmentRenderer fragmentRenderer) - { - this.fragmentRenderer =3D fragmentRenderer; - } - - protected void renderContent(HttpServletResponse resp) throws IOExcepti= on - { - // - resp.setContentType("text/html"); - PrintWriter writer =3D resp.getWriter(); - writer.print(""); - - // Render the head contributions - writer.print(""); - MultiValuedPropertyMap markupHeaders =3D properties.getMark= upHeaders(); - List headElement =3D markupHeaders.getValues("javax.portlet= .markup.head.element"); - if (headElement !=3D null) - { - for (Element headerValue : headElement) - { - try - { - String serializedElement =3D XMLTools.toString(headerValue); - writer.print(serializedElement); - } - catch (Exception e) - { - // todo - e.printStackTrace(); - } - } - } - writer.print(""); - - - writer.print(""); - for (FragmentResponse fragment : fragments) - { - writer.print(fragmentRenderer.renderPortlet(fragment)); - - } - - for (ErrorResponse error : errors) - { - writer.print(fragmentRenderer.renderError(error)); - } - - writer.print(""); - } - - protected void prepareRendering(PortletControllerContext context) - { - - // What we collect during the different renders - // we don't reuse the render properties argument since we want to av= oid that - // a portlet rendition affects another rendition of a portlet on the= same page - ResponseProperties renderProperties =3D new ResponseProperties(); - - // - try - { - Collection portlets =3D ((PortletControllerContextImpl)c= ontext).getPortlets(); - - int capacity =3D portlets.size(); - fragments =3D new ArrayList(capacity); - errors =3D new ArrayList(capacity); - - for (Portlet portlet : portlets) - { - WindowNavigationalState windowNS =3D pageState.getWindowNaviga= tionalState(portlet.getContext().getId()); - - // - Mode mode =3D Mode.VIEW; - WindowState windowState =3D WindowState.NORMAL; - StateString portletNS =3D null; - - // - if (windowNS !=3D null) - { - if (windowNS.getMode() !=3D null) - { - mode =3D windowNS.getMode(); - } - if (windowNS.getWindowState() !=3D null) - { - windowState =3D windowNS.getWindowState(); - } - if (windowNS.getPortletNavigationalState() !=3D null) - { - portletNS =3D windowNS.getPortletNavigationalState(); - } - } - - // - ParameterMap publicNS =3D pageState.getPublicNavigationalState= (portlet.getInfo()); - - RenderInvocation render =3D createRenderInvocation(context, pr= operties, pageState, portlet, windowNS, mode, windowState, portletNS, publi= cNS); - - // - try - { - PortletInvocationResponse response =3D ((PortletControllerC= ontextImpl)context).invoke(render); - - if (response instanceof FragmentResponse) - { - FragmentResponse fragment =3D (FragmentResponse)response; - - // - fragments.add(fragment); - - // - ResponseProperties fragmentProperties =3D fragment.getPr= operties(); - if (fragmentProperties !=3D null) - { - renderProperties.append(fragmentProperties); - } - } - else if (response instanceof ErrorResponse) - { - ErrorResponse error =3D (ErrorResponse)response; - errors.add(error); - } - - } - catch (PortletInvokerException e) - { - e.printStackTrace(); - } - } - } - catch (PortletInvokerException e) - { - // todo - e.printStackTrace(); - } - - // Now we combine the render properties with the page properties - properties.append(renderProperties); - } - - protected RenderInvocation createRenderInvocation( - PortletControllerContext context, ResponseProperties pageProperties,= PageNavigationalState pageNS, Portlet portlet, - WindowNavigationalState windowNS, Mode mode, WindowState windowState= , StateString portletNS, ParameterMap publicNS) - { - HttpServletRequest req =3D context.getClientRequest(); - HttpServletResponse resp =3D context.getClientResponse(); - - // - TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), false); - - PortletInvocationContext renderContext =3D context.createPortletInvo= cationContext(portlet.getContext().getId(), pageNS); - - // - RenderInvocation render =3D new RenderInvocation(renderContext); - render.setClientContext(new AbstractClientContext(req, pagePropertie= s.getCookies())); - render.setServerContext(new AbstractServerContext(req, resp)); - render.setInstanceContext(instanceContext); - render.setUserContext(new AbstractUserContext(req)); - render.setWindowContext(new AbstractWindowContext(portlet.getContext= ().getId())); - render.setPortalContext(new TestPortalContext()); - render.setSecurityContext(new AbstractSecurityContext(req)); - render.setTarget(instanceContext.getTarget()); - render.setMode(mode); - render.setWindowState(windowState); - render.setNavigationalState(portletNS); - render.setPublicNavigationalState(publicNS); - return render; - } -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller/PageRenderer.java (from rev 9777, modules/portlet/trunk/test= /src/main/java/org/jboss/portal/portlet/test/controller2/PageRenderer.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PageRenderer.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PageRenderer.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -0,0 +1,246 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.test.controller; + +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; +import org.jboss.portal.common.util.MultiValuedPropertyMap; +import org.jboss.portal.common.util.ParameterMap; +import org.jboss.portal.common.xml.XMLTools; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.spi.PortletInvocationContext; +import org.jboss.portal.portlet.impl.spi.AbstractClientContext; +import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; +import org.jboss.portal.portlet.impl.spi.AbstractServerContext; +import org.jboss.portal.portlet.impl.spi.AbstractUserContext; +import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; +import org.jboss.portal.portlet.invocation.RenderInvocation; +import org.jboss.portal.portlet.invocation.response.ErrorResponse; +import org.jboss.portal.portlet.invocation.response.FragmentResponse; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.response.ResponseProperties; +import org.jboss.portal.portlet.controller.WindowNavigationalState; +import org.jboss.portal.portlet.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.PortletControllerContext; +import org.w3c.dom.Element; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +/** + * @author Chris Laprun + * @version $Revision: 9748 $ + */ +public class PageRenderer extends AbstractMarkupRenderer +{ + + private FragmentRenderer fragmentRenderer =3D new SimpleFragmentRendere= r(); + private List fragments; + private List errors; + private PageNavigationalState pageState; + + public PageRenderer(ResponseProperties properties, PageNavigationalStat= e pageState) + { + super(properties); + + // + this.pageState =3D pageState; + } + + public void setFragmentRenderer(FragmentRenderer fragmentRenderer) + { + this.fragmentRenderer =3D fragmentRenderer; + } + + protected void renderContent(HttpServletResponse resp) throws IOExcepti= on + { + // + resp.setContentType("text/html"); + PrintWriter writer =3D resp.getWriter(); + writer.print(""); + + // Render the head contributions + writer.print(""); + MultiValuedPropertyMap markupHeaders =3D properties.getMark= upHeaders(); + List headElement =3D markupHeaders.getValues("javax.portlet= .markup.head.element"); + if (headElement !=3D null) + { + for (Element headerValue : headElement) + { + try + { + String serializedElement =3D XMLTools.toString(headerValue); + writer.print(serializedElement); + } + catch (Exception e) + { + // todo + e.printStackTrace(); + } + } + } + writer.print(""); + + + writer.print(""); + for (FragmentResponse fragment : fragments) + { + writer.print(fragmentRenderer.renderPortlet(fragment)); + + } + + for (ErrorResponse error : errors) + { + writer.print(fragmentRenderer.renderError(error)); + } + + writer.print(""); + } + + protected void prepareRendering(PortletControllerContext context) + { + + // What we collect during the different renders + // we don't reuse the render properties argument since we want to av= oid that + // a portlet rendition affects another rendition of a portlet on the= same page + ResponseProperties renderProperties =3D new ResponseProperties(); + + // + try + { + Collection portlets =3D ((PortletControllerContextImpl)c= ontext).getPortlets(); + + int capacity =3D portlets.size(); + fragments =3D new ArrayList(capacity); + errors =3D new ArrayList(capacity); + + for (Portlet portlet : portlets) + { + WindowNavigationalState windowNS =3D pageState.getWindowNaviga= tionalState(portlet.getContext().getId()); + + // + Mode mode =3D Mode.VIEW; + WindowState windowState =3D WindowState.NORMAL; + StateString portletNS =3D null; + + // + if (windowNS !=3D null) + { + if (windowNS.getMode() !=3D null) + { + mode =3D windowNS.getMode(); + } + if (windowNS.getWindowState() !=3D null) + { + windowState =3D windowNS.getWindowState(); + } + if (windowNS.getPortletNavigationalState() !=3D null) + { + portletNS =3D windowNS.getPortletNavigationalState(); + } + } + + // + ParameterMap publicNS =3D pageState.getPublicNavigationalState= (portlet.getInfo()); + + RenderInvocation render =3D createRenderInvocation(context, pr= operties, pageState, portlet, windowNS, mode, windowState, portletNS, publi= cNS); + + // + try + { + PortletInvocationResponse response =3D ((PortletControllerC= ontextImpl)context).invoke(render); + + if (response instanceof FragmentResponse) + { + FragmentResponse fragment =3D (FragmentResponse)response; + + // + fragments.add(fragment); + + // + ResponseProperties fragmentProperties =3D fragment.getPr= operties(); + if (fragmentProperties !=3D null) + { + renderProperties.append(fragmentProperties); + } + } + else if (response instanceof ErrorResponse) + { + ErrorResponse error =3D (ErrorResponse)response; + errors.add(error); + } + + } + catch (PortletInvokerException e) + { + e.printStackTrace(); + } + } + } + catch (PortletInvokerException e) + { + // todo + e.printStackTrace(); + } + + // Now we combine the render properties with the page properties + properties.append(renderProperties); + } + + protected RenderInvocation createRenderInvocation( + PortletControllerContext context, ResponseProperties pageProperties,= PageNavigationalState pageNS, Portlet portlet, + WindowNavigationalState windowNS, Mode mode, WindowState windowState= , StateString portletNS, ParameterMap publicNS) + { + HttpServletRequest req =3D context.getClientRequest(); + HttpServletResponse resp =3D context.getClientResponse(); + + // + TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), false); + + PortletInvocationContext renderContext =3D context.createPortletInvo= cationContext(portlet.getContext().getId(), pageNS); + + // + RenderInvocation render =3D new RenderInvocation(renderContext); + render.setClientContext(new AbstractClientContext(req, pagePropertie= s.getCookies())); + render.setServerContext(new AbstractServerContext(req, resp)); + render.setInstanceContext(instanceContext); + render.setUserContext(new AbstractUserContext(req)); + render.setWindowContext(new AbstractWindowContext(portlet.getContext= ().getId())); + render.setPortalContext(new TestPortalContext()); + render.setSecurityContext(new AbstractSecurityContext(req)); + render.setTarget(instanceContext.getTarget()); + render.setMode(mode); + render.setWindowState(windowState); + render.setNavigationalState(portletNS); + render.setPublicNavigationalState(publicNS); + return render; + } +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/PortletControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PortletControllerContextImpl.java 2008-02-05 15:13:09 UTC (rev = 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContextImpl.java 2008-02-05 15:46:21 UTC (rev 9= 778) @@ -1,382 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.test.controller2; - -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; -import org.jboss.portal.common.io.IOTools; -import org.jboss.portal.common.util.ParameterMap; -import org.jboss.portal.common.util.Tools; -import org.jboss.portal.common.util.MarkupInfo; -import org.jboss.portal.common.util.MediaType; -import org.jboss.portal.portlet.ParametersStateString; -import org.jboss.portal.portlet.Portlet; -import org.jboss.portal.portlet.PortletContext; -import org.jboss.portal.portlet.PortletInvoker; -import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.ContainerURL; -import org.jboss.portal.portlet.spi.PortletInvocationContext; -import org.jboss.portal.portlet.info.PortletInfo; -import org.jboss.portal.portlet.impl.spi.AbstractClientContext; -import org.jboss.portal.portlet.impl.spi.AbstractServerContext; -import org.jboss.portal.portlet.impl.spi.AbstractUserContext; -import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; -import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; -import org.jboss.portal.portlet.impl.spi.AbstractRequestContext; -import org.jboss.portal.portlet.cache.CacheLevel; -import org.jboss.portal.portlet.invocation.PortletInvocation; -import org.jboss.portal.portlet.invocation.ActionInvocation; -import org.jboss.portal.portlet.invocation.EventInvocation; -import org.jboss.portal.portlet.invocation.ResourceInvocation; -import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.test.StringCodec; -import org.jboss.portal.portlet.test.controller2.TestInstanceContext; -import org.jboss.portal.portlet.test.controller2.TestPortalContext; -import org.jboss.portal.portlet.test.controller2.TestPortletInvocationCont= ext; -import static org.jboss.portal.portlet.test.URLParameterConstants.*; -import org.jboss.portal.portlet.test.controller.WindowNavigationalState; -import org.jboss.portal.portlet.test.controller.PortletControllerContext; -import org.jboss.portal.portlet.test.controller.PageNavigationalState; -import org.jboss.portal.portlet.test.controller.request.PortletRenderReque= st; -import org.jboss.portal.portlet.test.controller.request.ControllerRequest; -import org.jboss.portal.portlet.test.controller.request.PortletScopedPortl= etResourceRequest; -import org.jboss.portal.portlet.test.controller.request.FullScopedCacheabl= ePortletResourceRequest; -import org.jboss.portal.portlet.test.controller.request.PageScopedFullPort= letResourceRequest; -import org.jboss.portal.portlet.test.controller.request.PortletActionReque= st; -import org.jboss.portal.portlet.test.controller.event.EventControllerConte= xt; -import org.jboss.portal.portlet.test.controller.event.EventControllerConte= xtImpl; -import org.jboss.portal.web.Body; -import org.jboss.portal.web.IllegalRequestException; -import org.jboss.portal.web.WebRequest; - -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.Cookie; -import java.io.IOException; -import java.util.Collection; -import java.util.Map; -import java.util.List; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -public class PortletControllerContextImpl implements PortletControllerCont= ext -{ - - /** . */ - public static final MarkupInfo MARKUP_INFO =3D new MarkupInfo(MediaType= .HTML, "UTF8"); - - /** . */ - public static final int NAV_SCOPE =3D 0; - - /** . */ - public static final int SESSION_SCOPE =3D 1; - - /** . */ - private final HttpServletRequest req; - - /** . */ - private final HttpServletResponse resp; - - /** . */ - private final ServletContext servletContext; - - /** . */ - private final ControllerRequest request; - - /** . */ - private final PortletInvoker invoker; - - /** . */ - private final EventControllerContext eventControllerContext; - - public PortletControllerContextImpl( - HttpServletRequest req, - HttpServletResponse resp, - ServletContext servletContext) - throws IllegalRequestException, IOException, ClassNotFoundException - { - PortletInvoker invoker =3D (PortletInvoker)servletContext.getAttribu= te("ConsumerPortletInvoker"); - - // The nav state provided with the request - PageNavigationalState pageState =3D null; - - // The request decoded if not null - ControllerRequest request =3D null; - - // Process - String pathInfo =3D req.getPathInfo(); - if (pathInfo !=3D null && pathInfo.startsWith("/") && pathInfo.lengt= h() > 1) - { - // Get the target portlet - String targetId =3D StringCodec.decode(pathInfo.substring(1)); - - // Helper - WebRequest ri =3D new WebRequest(req); - - // Unmarshall portal navigational state if it is provided - String context =3D req.getParameter(PAGE_STATE); - if (context !=3D null) - { - byte[] bytes =3D Tools.fromHexString(context); - pageState =3D PageNavigationalState.unserialize(bytes); - } - - // - Mode mode =3D null; - if (req.getParameter(MODE) !=3D null) - { - mode =3D Mode.create(req.getParameter(MODE)); - } - - // - WindowState windowState =3D null; - if (req.getParameter(WINDOW_STATE) !=3D null) - { - windowState =3D WindowState.create(req.getParameter(WINDOW_STA= TE)); - } - - // - String navigationalStateString =3D req.getParameter(NAVIGATIONAL_= STATE); - StateString navigationalState =3D null; - if (navigationalStateString !=3D null) - { - navigationalState =3D ParametersStateString.create(navigationa= lStateString); - } - - // - WindowNavigationalState windowNavigationalState =3D new WindowNav= igationalState(navigationalState, mode, windowState); - - // - String type =3D req.getParameter(LIFECYCLE_TYPE); - if (RESOURCE_LIFECYCLE.equals(type)) - { - StateString resourceState =3D ParametersStateString.create(req= .getParameter(RESOURCE_STATE)); - String resourceId =3D req.getParameter(RESOURCE_ID); - - // - ParameterMap formParameters =3D null; - if (ri.getBody() instanceof Body.Form) - { - formParameters =3D ((Body.Form)ri.getBody()).getParameters(= ); - } - - // - CacheLevel resourceCacheLevel =3D CacheLevel.valueOf(req.getPa= rameter(RESOURCE_CACHEABILITY)); - - // - switch (resourceCacheLevel) - { - case FULL: - request =3D new FullScopedCacheablePortletResourceReques= t( - this, - targetId, - resourceId, - resourceState, - formParameters); - break; - case PORTLET: - request =3D new PortletScopedPortletResourceRequest( - this, - targetId, - resourceId, - resourceState, - formParameters, - windowNavigationalState); - break; - case PAGE: - request =3D new PageScopedFullPortletResourceRequest( - this, - targetId, - resourceId, - resourceState, - formParameters, - pageState, - windowNavigationalState); - break; - } - } - else - { - if (ACTION_LIFECYCLE.equals(type)) - { - ParameterMap formParameters =3D null; - if (ri.getBody() instanceof Body.Form) - { - formParameters =3D ((Body.Form)ri.getBody()).getParamete= rs(); - } - - // - StateString interactionState =3D ParametersStateString.crea= te(req.getParameter(INTERACTION_STATE)); - - // - request =3D new PortletActionRequest( - this, - targetId, - interactionState, - formParameters, - windowNavigationalState, - pageState); - } - else - { - Map publicNavigationalStateChanges =3D (M= ap)IOTools.unserialize(Tools.fromHexString(req.getParamet= er(PUBLIC_NAVIGATIONAL_STATE_CHANGES))); - - // - request =3D new PortletRenderRequest( - this, - targetId, - windowNavigationalState, - publicNavigationalStateChanges, - pageState); - } - } - } - - // - this.request =3D request; - this.req =3D req; - this.resp =3D resp; - this.servletContext =3D servletContext; - this.invoker =3D invoker; - this.eventControllerContext =3D new EventControllerContextImpl(invok= er); - } - - public ControllerRequest getRequest() - { - return request; - } - - public ServletContext getServletContext() - { - return servletContext; - } - - public HttpServletRequest getClientRequest() - { - return req; - } - - public HttpServletResponse getClientResponse() - { - return resp; - } - - public PortletInfo getPortletInfo(String windowId) throws PortletInvoke= rException - { - return _getPortlet(windowId).getInfo(); - } - - private Portlet _getPortlet(String windowId) throws PortletInvokerExcep= tion - { - return invoker.getPortlet(PortletContext.createPortletContext(window= Id)); - } - - public PortletInvocationResponse invoke(PortletInvocation invocation) t= hrows PortletInvokerException - { - return invoker.invoke(invocation); - } - - public Collection getPortlets() throws PortletInvokerException - { - return invoker.getPortlets(); - } - - public EventControllerContext getEventControllerContext() - { - return eventControllerContext; - } - - public String renderURL(String windowId, PageNavigationalState pageStat= e, ContainerURL containerURL, Boolean wantSecure, Boolean wantAuthenticated= , boolean relative) - { - PortletURLRenderer renderer =3D new PortletURLRenderer(pageState, wi= ndowId, req, resp); - - // - return renderer.renderURL(containerURL, wantSecure, wantAuthenticate= d, relative); - } - - public PortletInvocationResponse invoke(String windowId, ActionInvocati= on actionInvocation) throws PortletInvokerException - { - - Portlet portlet =3D_getPortlet(windowId); - - TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), true); - - actionInvocation.setClientContext(new AbstractClientContext(req)); - actionInvocation.setServerContext(new AbstractServerContext(req, res= p)); - actionInvocation.setInstanceContext(instanceContext); - actionInvocation.setUserContext(new AbstractUserContext(req)); - actionInvocation.setWindowContext(new AbstractWindowContext(portlet.= getContext().getId())); - actionInvocation.setPortalContext(new TestPortalContext()); - actionInvocation.setSecurityContext(new AbstractSecurityContext(req)= ); - actionInvocation.setRequestContext(new AbstractRequestContext(req)); - actionInvocation.setTarget(instanceContext.getTarget()); - - return invoke(actionInvocation); - } - - public PortletInvocationResponse invoke(String windowId, List r= equestCookies, EventInvocation eventInvocation) throws PortletInvokerExcept= ion - { - Portlet portlet =3D _getPortlet(windowId); - - TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), true); - - eventInvocation.setClientContext(new AbstractClientContext(req, requ= estCookies)); - eventInvocation.setServerContext(new AbstractServerContext(req, resp= )); - eventInvocation.setInstanceContext(instanceContext); - eventInvocation.setUserContext(new AbstractUserContext(req)); - eventInvocation.setWindowContext(new AbstractWindowContext(windowId)= ); - eventInvocation.setPortalContext(new TestPortalContext()); - eventInvocation.setSecurityContext(new AbstractSecurityContext(req)); - eventInvocation.setTarget(instanceContext.getTarget()); - - return invoke(eventInvocation); - } - - public PortletInvocationResponse invoke(String windowId, ResourceInvoca= tion resourceInvocation) throws PortletInvokerException - { - Portlet portlet =3D _getPortlet(windowId); - - TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), true); - - resourceInvocation.setClientContext(new AbstractClientContext(req)); - resourceInvocation.setServerContext(new AbstractServerContext(req, r= esp)); - resourceInvocation.setInstanceContext(instanceContext); - resourceInvocation.setUserContext(new AbstractUserContext(req)); - resourceInvocation.setWindowContext(new AbstractWindowContext(portle= t.getContext().getId())); - resourceInvocation.setPortalContext(new TestPortalContext()); - resourceInvocation.setSecurityContext(new AbstractSecurityContext(re= q)); - resourceInvocation.setRequestContext(new AbstractRequestContext(req)= ); - resourceInvocation.setTarget(instanceContext.getTarget()); - = - return invoke(resourceInvocation); - } - - public PortletInvocationContext createPortletInvocationContext(String w= indowId, PageNavigationalState pageState) - { - return new TestPortletInvocationContext(req, resp, windowId, pageSta= te, MARKUP_INFO); - } -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller/PortletControllerContextImpl.java (from rev 9777, modules/po= rtlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/Po= rtletControllerContextImpl.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContextImpl.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContextImpl.java 2008-02-05 15:46:21 UTC (rev 9= 778) @@ -0,0 +1,382 @@ +/*************************************************************************= ***** + * 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.portlet.test.controller; + +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; +import org.jboss.portal.common.io.IOTools; +import org.jboss.portal.common.util.ParameterMap; +import org.jboss.portal.common.util.Tools; +import org.jboss.portal.common.util.MarkupInfo; +import org.jboss.portal.common.util.MediaType; +import org.jboss.portal.portlet.ParametersStateString; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletContext; +import org.jboss.portal.portlet.PortletInvoker; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.ContainerURL; +import org.jboss.portal.portlet.spi.PortletInvocationContext; +import org.jboss.portal.portlet.info.PortletInfo; +import org.jboss.portal.portlet.impl.spi.AbstractClientContext; +import org.jboss.portal.portlet.impl.spi.AbstractServerContext; +import org.jboss.portal.portlet.impl.spi.AbstractUserContext; +import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; +import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; +import org.jboss.portal.portlet.impl.spi.AbstractRequestContext; +import org.jboss.portal.portlet.cache.CacheLevel; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.portlet.invocation.ActionInvocation; +import org.jboss.portal.portlet.invocation.EventInvocation; +import org.jboss.portal.portlet.invocation.ResourceInvocation; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.test.StringCodec; +import org.jboss.portal.portlet.test.controller.TestInstanceContext; +import org.jboss.portal.portlet.test.controller.TestPortalContext; +import org.jboss.portal.portlet.test.controller.TestPortletInvocationConte= xt; +import static org.jboss.portal.portlet.test.URLParameterConstants.*; +import org.jboss.portal.portlet.controller.WindowNavigationalState; +import org.jboss.portal.portlet.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.request.PortletRenderRequest; +import org.jboss.portal.portlet.controller.request.ControllerRequest; +import org.jboss.portal.portlet.controller.request.PortletScopedPortletRes= ourceRequest; +import org.jboss.portal.portlet.controller.request.FullScopedCacheablePort= letResourceRequest; +import org.jboss.portal.portlet.controller.request.PageScopedFullPortletRe= sourceRequest; +import org.jboss.portal.portlet.controller.request.PortletActionRequest; +import org.jboss.portal.portlet.controller.event.EventControllerContext; +import org.jboss.portal.portlet.controller.event.EventControllerContextImp= l; +import org.jboss.portal.web.Body; +import org.jboss.portal.web.IllegalRequestException; +import org.jboss.portal.web.WebRequest; + +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.Cookie; +import java.io.IOException; +import java.util.Collection; +import java.util.Map; +import java.util.List; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class PortletControllerContextImpl implements PortletControllerCont= ext +{ + + /** . */ + public static final MarkupInfo MARKUP_INFO =3D new MarkupInfo(MediaType= .HTML, "UTF8"); + + /** . */ + public static final int NAV_SCOPE =3D 0; + + /** . */ + public static final int SESSION_SCOPE =3D 1; + + /** . */ + private final HttpServletRequest req; + + /** . */ + private final HttpServletResponse resp; + + /** . */ + private final ServletContext servletContext; + + /** . */ + private final ControllerRequest request; + + /** . */ + private final PortletInvoker invoker; + + /** . */ + private final EventControllerContext eventControllerContext; + + public PortletControllerContextImpl( + HttpServletRequest req, + HttpServletResponse resp, + ServletContext servletContext) + throws IllegalRequestException, IOException, ClassNotFoundException + { + PortletInvoker invoker =3D (PortletInvoker)servletContext.getAttribu= te("ConsumerPortletInvoker"); + + // The nav state provided with the request + PageNavigationalState pageState =3D null; + + // The request decoded if not null + ControllerRequest request =3D null; + + // Process + String pathInfo =3D req.getPathInfo(); + if (pathInfo !=3D null && pathInfo.startsWith("/") && pathInfo.lengt= h() > 1) + { + // Get the target portlet + String targetId =3D StringCodec.decode(pathInfo.substring(1)); + + // Helper + WebRequest ri =3D new WebRequest(req); + + // Unmarshall portal navigational state if it is provided + String context =3D req.getParameter(PAGE_STATE); + if (context !=3D null) + { + byte[] bytes =3D Tools.fromHexString(context); + pageState =3D PageNavigationalState.unserialize(bytes); + } + + // + Mode mode =3D null; + if (req.getParameter(MODE) !=3D null) + { + mode =3D Mode.create(req.getParameter(MODE)); + } + + // + WindowState windowState =3D null; + if (req.getParameter(WINDOW_STATE) !=3D null) + { + windowState =3D WindowState.create(req.getParameter(WINDOW_STA= TE)); + } + + // + String navigationalStateString =3D req.getParameter(NAVIGATIONAL_= STATE); + StateString navigationalState =3D null; + if (navigationalStateString !=3D null) + { + navigationalState =3D ParametersStateString.create(navigationa= lStateString); + } + + // + WindowNavigationalState windowNavigationalState =3D new WindowNav= igationalState(navigationalState, mode, windowState); + + // + String type =3D req.getParameter(LIFECYCLE_TYPE); + if (RESOURCE_LIFECYCLE.equals(type)) + { + StateString resourceState =3D ParametersStateString.create(req= .getParameter(RESOURCE_STATE)); + String resourceId =3D req.getParameter(RESOURCE_ID); + + // + ParameterMap formParameters =3D null; + if (ri.getBody() instanceof Body.Form) + { + formParameters =3D ((Body.Form)ri.getBody()).getParameters(= ); + } + + // + CacheLevel resourceCacheLevel =3D CacheLevel.valueOf(req.getPa= rameter(RESOURCE_CACHEABILITY)); + + // + switch (resourceCacheLevel) + { + case FULL: + request =3D new FullScopedCacheablePortletResourceReques= t( + this, + targetId, + resourceId, + resourceState, + formParameters); + break; + case PORTLET: + request =3D new PortletScopedPortletResourceRequest( + this, + targetId, + resourceId, + resourceState, + formParameters, + windowNavigationalState); + break; + case PAGE: + request =3D new PageScopedFullPortletResourceRequest( + this, + targetId, + resourceId, + resourceState, + formParameters, + pageState, + windowNavigationalState); + break; + } + } + else + { + if (ACTION_LIFECYCLE.equals(type)) + { + ParameterMap formParameters =3D null; + if (ri.getBody() instanceof Body.Form) + { + formParameters =3D ((Body.Form)ri.getBody()).getParamete= rs(); + } + + // + StateString interactionState =3D ParametersStateString.crea= te(req.getParameter(INTERACTION_STATE)); + + // + request =3D new PortletActionRequest( + this, + targetId, + interactionState, + formParameters, + windowNavigationalState, + pageState); + } + else + { + Map publicNavigationalStateChanges =3D (M= ap)IOTools.unserialize(Tools.fromHexString(req.getParamet= er(PUBLIC_NAVIGATIONAL_STATE_CHANGES))); + + // + request =3D new PortletRenderRequest( + this, + targetId, + windowNavigationalState, + publicNavigationalStateChanges, + pageState); + } + } + } + + // + this.request =3D request; + this.req =3D req; + this.resp =3D resp; + this.servletContext =3D servletContext; + this.invoker =3D invoker; + this.eventControllerContext =3D new EventControllerContextImpl(invok= er); + } + + public ControllerRequest getRequest() + { + return request; + } + + public ServletContext getServletContext() + { + return servletContext; + } + + public HttpServletRequest getClientRequest() + { + return req; + } + + public HttpServletResponse getClientResponse() + { + return resp; + } + + public PortletInfo getPortletInfo(String windowId) throws PortletInvoke= rException + { + return _getPortlet(windowId).getInfo(); + } + + private Portlet _getPortlet(String windowId) throws PortletInvokerExcep= tion + { + return invoker.getPortlet(PortletContext.createPortletContext(window= Id)); + } + + public PortletInvocationResponse invoke(PortletInvocation invocation) t= hrows PortletInvokerException + { + return invoker.invoke(invocation); + } + + public Collection getPortlets() throws PortletInvokerException + { + return invoker.getPortlets(); + } + + public EventControllerContext getEventControllerContext() + { + return eventControllerContext; + } + + public String renderURL(String windowId, PageNavigationalState pageStat= e, ContainerURL containerURL, Boolean wantSecure, Boolean wantAuthenticated= , boolean relative) + { + PortletURLRenderer renderer =3D new PortletURLRenderer(pageState, wi= ndowId, req, resp); + + // + return renderer.renderURL(containerURL, wantSecure, wantAuthenticate= d, relative); + } + + public PortletInvocationResponse invoke(String windowId, ActionInvocati= on actionInvocation) throws PortletInvokerException + { + + Portlet portlet =3D_getPortlet(windowId); + + TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), true); + + actionInvocation.setClientContext(new AbstractClientContext(req)); + actionInvocation.setServerContext(new AbstractServerContext(req, res= p)); + actionInvocation.setInstanceContext(instanceContext); + actionInvocation.setUserContext(new AbstractUserContext(req)); + actionInvocation.setWindowContext(new AbstractWindowContext(portlet.= getContext().getId())); + actionInvocation.setPortalContext(new TestPortalContext()); + actionInvocation.setSecurityContext(new AbstractSecurityContext(req)= ); + actionInvocation.setRequestContext(new AbstractRequestContext(req)); + actionInvocation.setTarget(instanceContext.getTarget()); + + return invoke(actionInvocation); + } + + public PortletInvocationResponse invoke(String windowId, List r= equestCookies, EventInvocation eventInvocation) throws PortletInvokerExcept= ion + { + Portlet portlet =3D _getPortlet(windowId); + + TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), true); + + eventInvocation.setClientContext(new AbstractClientContext(req, requ= estCookies)); + eventInvocation.setServerContext(new AbstractServerContext(req, resp= )); + eventInvocation.setInstanceContext(instanceContext); + eventInvocation.setUserContext(new AbstractUserContext(req)); + eventInvocation.setWindowContext(new AbstractWindowContext(windowId)= ); + eventInvocation.setPortalContext(new TestPortalContext()); + eventInvocation.setSecurityContext(new AbstractSecurityContext(req)); + eventInvocation.setTarget(instanceContext.getTarget()); + + return invoke(eventInvocation); + } + + public PortletInvocationResponse invoke(String windowId, ResourceInvoca= tion resourceInvocation) throws PortletInvokerException + { + Portlet portlet =3D _getPortlet(windowId); + + TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), true); + + resourceInvocation.setClientContext(new AbstractClientContext(req)); + resourceInvocation.setServerContext(new AbstractServerContext(req, r= esp)); + resourceInvocation.setInstanceContext(instanceContext); + resourceInvocation.setUserContext(new AbstractUserContext(req)); + resourceInvocation.setWindowContext(new AbstractWindowContext(portle= t.getContext().getId())); + resourceInvocation.setPortalContext(new TestPortalContext()); + resourceInvocation.setSecurityContext(new AbstractSecurityContext(re= q)); + resourceInvocation.setRequestContext(new AbstractRequestContext(req)= ); + resourceInvocation.setTarget(instanceContext.getTarget()); + = + return invoke(resourceInvocation); + } + + public PortletInvocationContext createPortletInvocationContext(String w= indowId, PageNavigationalState pageState) + { + return new TestPortletInvocationContext(req, resp, windowId, pageSta= te, MARKUP_INFO); + } +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/PortletURLRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/PortletURLRenderer.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -1,246 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.test.controller2; - -import org.jboss.portal.common.io.IOTools; -import org.jboss.portal.common.text.CharBuffer; -import org.jboss.portal.common.text.FastURLEncoder; -import org.jboss.portal.common.util.Tools; -import org.jboss.portal.portlet.ActionURL; -import org.jboss.portal.portlet.ContainerURL; -import org.jboss.portal.portlet.Portlet; -import org.jboss.portal.portlet.PortletURL; -import org.jboss.portal.portlet.RenderURL; -import org.jboss.portal.portlet.ResourceURL; -import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.info.PortletInfo; -import org.jboss.portal.portlet.cache.CacheLevel; -import static org.jboss.portal.portlet.test.URLParameterConstants.*; -import org.jboss.portal.portlet.test.controller.PageNavigationalState; -import org.jboss.portal.portlet.test.StringCodec; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -public class PortletURLRenderer -{ - - /** . */ - final String windowId; - - /** . */ - final HttpServletRequest clientReq; - - /** . */ - final HttpServletResponse clientResp; - - /** . */ - final PageNavigationalState pageNS; - - public PortletURLRenderer( - PageNavigationalState pageNS, - String windowId, - HttpServletRequest clientReq, - HttpServletResponse clientResp) - { - this.pageNS =3D pageNS; - this.windowId =3D windowId; - this.clientReq =3D clientReq; - this.clientResp =3D clientResp; - } - - public String renderURL(ContainerURL containerURL, Boolean wantSecure, = Boolean wantAuthenticated, boolean relative) - { - CharBuffer buffer =3D new CharBuffer(); - buffer.append(clientReq.getScheme()); - buffer.append("://"); - buffer.append(clientReq.getServerName()); - buffer.append(':'); - buffer.append(Integer.toString(clientReq.getServerPort())); - buffer.append(clientReq.getContextPath()); - buffer.append('/'); - buffer.append(StringCodec.encode(windowId)); - - // - Map parameters =3D new HashMap(); - - // - String type; - if (containerURL instanceof ActionURL) - { - type =3D ACTION_LIFECYCLE; - } - else if (containerURL instanceof RenderURL) - { - type =3D RENDER_LIFECYCLE; - } - else if (containerURL instanceof ResourceURL) - { - type =3D RESOURCE_LIFECYCLE; - } - else - { - throw new Error(); - } - parameters.put(LIFECYCLE_TYPE, type); - - // - String pageState; - try - { - byte[] bytes =3D PageNavigationalState.serialize(pageNS); - pageState =3D Tools.toHexString(bytes); - } - catch (IOException e) - { - throw new Error(e); // - } - - // - if (containerURL instanceof PortletURL) - { - PortletURL portletURL =3D (PortletURL)containerURL; - - if (portletURL.getMode() !=3D null) - { - parameters.put(MODE, portletURL.getMode().toString()); - } - - // - if (portletURL.getWindowState() !=3D null) - { - parameters.put(WINDOW_STATE, portletURL.getWindowState().toStr= ing()); - } - - // - parameters.put(PAGE_STATE, pageState); - - // - if (containerURL instanceof ActionURL) - { - ActionURL actionURL =3D (ActionURL)containerURL; - - // - if (actionURL.getNavigationalState() !=3D null) - { - parameters.put(NAVIGATIONAL_STATE, actionURL.getNavigationa= lState().getStringValue()); - } - - // - StateString interactionState =3D actionURL.getInteractionState= (); - parameters.put(INTERACTION_STATE, interactionState.getStringVa= lue()); - } - else - { - RenderURL renderURL =3D (RenderURL)containerURL; - - // - try - { - Map changes =3D renderURL.getPublicNaviga= tionalStateChanges(); - HashMap serialiableChanges =3D new HashMa= p(changes); - byte[] bytes =3D IOTools.serialize(serialiableChanges); - String ns =3D Tools.toHexString(bytes); - parameters.put(PUBLIC_NAVIGATIONAL_STATE_CHANGES, ns); - } - catch (IOException e) - { - throw new Error(e); - } - - // - StateString navigationalState =3D renderURL.getNavigationalSta= te(); - parameters.put(NAVIGATIONAL_STATE, navigationalState.getString= Value()); - } - } - else - { - ResourceURL resourceURL =3D (ResourceURL)containerURL; - - // - StateString resourceState =3D resourceURL.getResourceState(); - parameters.put(RESOURCE_STATE, resourceState.getStringValue()); - - // - String resourceId =3D resourceURL.getResourceId(); - if (resourceId !=3D null) - { - parameters.put(RESOURCE_ID, resourceId); - } - - // - CacheLevel cacheability =3D resourceURL.getCacheability(); - parameters.put(RESOURCE_CACHEABILITY, cacheability.name()); - - // - if (cacheability !=3D CacheLevel.FULL) - { - if (resourceURL.getNavigationalState() !=3D null) - { - parameters.put(NAVIGATIONAL_STATE, resourceURL.getNavigatio= nalState().getStringValue()); - } - - // - if (resourceURL.getMode() !=3D null) - { - parameters.put(MODE, resourceURL.getMode().toString()); - } - - // - if (resourceURL.getWindowState() !=3D null) - { - parameters.put(WINDOW_STATE, resourceURL.getWindowState().t= oString()); - } - - if (cacheability =3D=3D CacheLevel.PAGE) - { - parameters.put(PAGE_STATE, pageState); - } - } - } - - // - boolean first =3D true; - for (Map.Entry entry : parameters.entrySet()) - { - String name =3D entry.getKey(); - String value =3D entry.getValue(); - buffer.append(first ? '?' : '&'); - buffer.append(name, FastURLEncoder.getUTF8Instance()); - buffer.append('=3D'); - buffer.append(value, FastURLEncoder.getUTF8Instance()); - first =3D false; - } - - // - String url =3D buffer.asString(); - return clientResp.encodeURL(url); - } -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller/PortletURLRenderer.java (from rev 9777, modules/portlet/trun= k/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletURLRe= nderer.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -0,0 +1,244 @@ +/*************************************************************************= ***** + * 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.portlet.test.controller; + +import org.jboss.portal.common.io.IOTools; +import org.jboss.portal.common.text.CharBuffer; +import org.jboss.portal.common.text.FastURLEncoder; +import org.jboss.portal.common.util.Tools; +import org.jboss.portal.portlet.ActionURL; +import org.jboss.portal.portlet.ContainerURL; +import org.jboss.portal.portlet.PortletURL; +import org.jboss.portal.portlet.RenderURL; +import org.jboss.portal.portlet.ResourceURL; +import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.cache.CacheLevel; +import static org.jboss.portal.portlet.test.URLParameterConstants.*; +import org.jboss.portal.portlet.controller.PageNavigationalState; +import org.jboss.portal.portlet.test.StringCodec; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class PortletURLRenderer +{ + + /** . */ + final String windowId; + + /** . */ + final HttpServletRequest clientReq; + + /** . */ + final HttpServletResponse clientResp; + + /** . */ + final PageNavigationalState pageNS; + + public PortletURLRenderer( + PageNavigationalState pageNS, + String windowId, + HttpServletRequest clientReq, + HttpServletResponse clientResp) + { + this.pageNS =3D pageNS; + this.windowId =3D windowId; + this.clientReq =3D clientReq; + this.clientResp =3D clientResp; + } + + public String renderURL(ContainerURL containerURL, Boolean wantSecure, = Boolean wantAuthenticated, boolean relative) + { + CharBuffer buffer =3D new CharBuffer(); + buffer.append(clientReq.getScheme()); + buffer.append("://"); + buffer.append(clientReq.getServerName()); + buffer.append(':'); + buffer.append(Integer.toString(clientReq.getServerPort())); + buffer.append(clientReq.getContextPath()); + buffer.append('/'); + buffer.append(StringCodec.encode(windowId)); + + // + Map parameters =3D new HashMap(); + + // + String type; + if (containerURL instanceof ActionURL) + { + type =3D ACTION_LIFECYCLE; + } + else if (containerURL instanceof RenderURL) + { + type =3D RENDER_LIFECYCLE; + } + else if (containerURL instanceof ResourceURL) + { + type =3D RESOURCE_LIFECYCLE; + } + else + { + throw new Error(); + } + parameters.put(LIFECYCLE_TYPE, type); + + // + String pageState; + try + { + byte[] bytes =3D PageNavigationalState.serialize(pageNS); + pageState =3D Tools.toHexString(bytes); + } + catch (IOException e) + { + throw new Error(e); // + } + + // + if (containerURL instanceof PortletURL) + { + PortletURL portletURL =3D (PortletURL)containerURL; + + if (portletURL.getMode() !=3D null) + { + parameters.put(MODE, portletURL.getMode().toString()); + } + + // + if (portletURL.getWindowState() !=3D null) + { + parameters.put(WINDOW_STATE, portletURL.getWindowState().toStr= ing()); + } + + // + parameters.put(PAGE_STATE, pageState); + + // + if (containerURL instanceof ActionURL) + { + ActionURL actionURL =3D (ActionURL)containerURL; + + // + if (actionURL.getNavigationalState() !=3D null) + { + parameters.put(NAVIGATIONAL_STATE, actionURL.getNavigationa= lState().getStringValue()); + } + + // + StateString interactionState =3D actionURL.getInteractionState= (); + parameters.put(INTERACTION_STATE, interactionState.getStringVa= lue()); + } + else + { + RenderURL renderURL =3D (RenderURL)containerURL; + + // + try + { + Map changes =3D renderURL.getPublicNaviga= tionalStateChanges(); + HashMap serialiableChanges =3D new HashMa= p(changes); + byte[] bytes =3D IOTools.serialize(serialiableChanges); + String ns =3D Tools.toHexString(bytes); + parameters.put(PUBLIC_NAVIGATIONAL_STATE_CHANGES, ns); + } + catch (IOException e) + { + throw new Error(e); + } + + // + StateString navigationalState =3D renderURL.getNavigationalSta= te(); + parameters.put(NAVIGATIONAL_STATE, navigationalState.getString= Value()); + } + } + else + { + ResourceURL resourceURL =3D (ResourceURL)containerURL; + + // + StateString resourceState =3D resourceURL.getResourceState(); + parameters.put(RESOURCE_STATE, resourceState.getStringValue()); + + // + String resourceId =3D resourceURL.getResourceId(); + if (resourceId !=3D null) + { + parameters.put(RESOURCE_ID, resourceId); + } + + // + CacheLevel cacheability =3D resourceURL.getCacheability(); + parameters.put(RESOURCE_CACHEABILITY, cacheability.name()); + + // + if (cacheability !=3D CacheLevel.FULL) + { + if (resourceURL.getNavigationalState() !=3D null) + { + parameters.put(NAVIGATIONAL_STATE, resourceURL.getNavigatio= nalState().getStringValue()); + } + + // + if (resourceURL.getMode() !=3D null) + { + parameters.put(MODE, resourceURL.getMode().toString()); + } + + // + if (resourceURL.getWindowState() !=3D null) + { + parameters.put(WINDOW_STATE, resourceURL.getWindowState().t= oString()); + } + + if (cacheability =3D=3D CacheLevel.PAGE) + { + parameters.put(PAGE_STATE, pageState); + } + } + } + + // + boolean first =3D true; + for (Map.Entry entry : parameters.entrySet()) + { + String name =3D entry.getKey(); + String value =3D entry.getValue(); + buffer.append(first ? '?' : '&'); + buffer.append(name, FastURLEncoder.getUTF8Instance()); + buffer.append('=3D'); + buffer.append(value, FastURLEncoder.getUTF8Instance()); + first =3D false; + } + + // + String url =3D buffer.asString(); + return clientResp.encodeURL(url); + } +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/RedirectResponseRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/RedirectResponseRenderer.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/RedirectResponseRenderer.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -1,49 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.test.controller2; - -import org.jboss.portal.portlet.test.controller.PortletControllerContext; -import org.jboss.portal.portlet.invocation.response.HTTPRedirectionRespons= e; - -import java.io.IOException; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class RedirectResponseRenderer implements Renderer -{ - - /** . */ - private HTTPRedirectionResponse response; - - public RedirectResponseRenderer(HTTPRedirectionResponse response) - { - this.response =3D response; - } - - public void render(PortletControllerContext context) throws IOException - { - context.getClientResponse().sendRedirect(response.getLocation()); - } -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller/RedirectResponseRenderer.java (from rev 9777, modules/portle= t/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/Redire= ctResponseRenderer.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/RedirectResponseRenderer.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/RedirectResponseRenderer.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -0,0 +1,49 @@ +/*************************************************************************= ***** + * 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.portlet.test.controller; + +import org.jboss.portal.portlet.controller.PortletControllerContext; +import org.jboss.portal.portlet.invocation.response.HTTPRedirectionRespons= e; + +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class RedirectResponseRenderer implements Renderer +{ + + /** . */ + private HTTPRedirectionResponse response; + + public RedirectResponseRenderer(HTTPRedirectionResponse response) + { + this.response =3D response; + } + + public void render(PortletControllerContext context) throws IOException + { + context.getClientResponse().sendRedirect(response.getLocation()); + } +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/Renderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/Renderer.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/Renderer.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -1,36 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.test.controller2; - -import org.jboss.portal.portlet.test.controller.PortletControllerContext; - -import java.io.IOException; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public interface Renderer -{ - void render(PortletControllerContext context) throws IOException; -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller/Renderer.java (from rev 9777, modules/portlet/trunk/test/src= /main/java/org/jboss/portal/portlet/test/controller2/Renderer.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/Renderer.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/Renderer.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -0,0 +1,36 @@ +/*************************************************************************= ***** + * 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.portlet.test.controller; + +import org.jboss.portal.portlet.controller.PortletControllerContext; + +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public interface Renderer +{ + void render(PortletControllerContext context) throws IOException; +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/ResourceRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/ResourceRenderer.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ResourceRenderer.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -1,95 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.test.controller2; - -import org.jboss.portal.portlet.invocation.response.FragmentResponse; -import org.jboss.portal.common.io.IOTools; - -import javax.servlet.http.HttpServletResponse; -import javax.servlet.ServletOutputStream; -import java.io.IOException; -import java.io.Writer; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class ResourceRenderer extends AbstractMarkupRenderer -{ - - /** . */ - private FragmentResponse fragment; - - public ResourceRenderer(FragmentResponse response) - { - super(response.getProperties()); - - // - this.fragment =3D response; - } - - protected void renderContent(HttpServletResponse resp) throws IOExcepti= on - { - // - if (fragment.getType() =3D=3D FragmentResponse.TYPE_EMPTY) - { - resp.setStatus(HttpServletResponse.SC_NO_CONTENT); - } - else - { - String contentType =3D fragment.getContentType(); - if (contentType !=3D null) - { - resp.setContentType(contentType); - } - - // - if (fragment.getType() =3D=3D FragmentResponse.TYPE_BYTES) - { - ServletOutputStream out =3D null; - try - { - out =3D resp.getOutputStream(); - out.write(fragment.getBytes().toByteArray()); - } - finally - { - IOTools.safeClose(out); - } - } - else - { - Writer writer =3D null; - try - { - writer =3D resp.getWriter(); - writer.write(fragment.getChars().toString()); - } - finally - { - writer.close(); - } - } - } - } -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller/ResourceRenderer.java (from rev 9777, modules/portlet/trunk/= test/src/main/java/org/jboss/portal/portlet/test/controller2/ResourceRender= er.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ResourceRenderer.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ResourceRenderer.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -0,0 +1,95 @@ +/*************************************************************************= ***** + * 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.portlet.test.controller; + +import org.jboss.portal.portlet.invocation.response.FragmentResponse; +import org.jboss.portal.common.io.IOTools; + +import javax.servlet.http.HttpServletResponse; +import javax.servlet.ServletOutputStream; +import java.io.IOException; +import java.io.Writer; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ResourceRenderer extends AbstractMarkupRenderer +{ + + /** . */ + private FragmentResponse fragment; + + public ResourceRenderer(FragmentResponse response) + { + super(response.getProperties()); + + // + this.fragment =3D response; + } + + protected void renderContent(HttpServletResponse resp) throws IOExcepti= on + { + // + if (fragment.getType() =3D=3D FragmentResponse.TYPE_EMPTY) + { + resp.setStatus(HttpServletResponse.SC_NO_CONTENT); + } + else + { + String contentType =3D fragment.getContentType(); + if (contentType !=3D null) + { + resp.setContentType(contentType); + } + + // + if (fragment.getType() =3D=3D FragmentResponse.TYPE_BYTES) + { + ServletOutputStream out =3D null; + try + { + out =3D resp.getOutputStream(); + out.write(fragment.getBytes().toByteArray()); + } + finally + { + IOTools.safeClose(out); + } + } + else + { + Writer writer =3D null; + try + { + writer =3D resp.getWriter(); + writer.write(fragment.getChars().toString()); + } + finally + { + writer.close(); + } + } + } + } +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/SimpleFragmentRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/SimpleFragmentRenderer.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/SimpleFragmentRenderer.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -1,69 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ - -package org.jboss.portal.portlet.test.controller2; - -import org.jboss.portal.portlet.invocation.response.ErrorResponse; -import org.jboss.portal.portlet.invocation.response.FragmentResponse; - -/** - * @author Chris Laprun - * @version $Revision: 9748 $ - */ -public class SimpleFragmentRenderer implements FragmentRenderer -{ - public String renderPortlet(FragmentResponse fragment) - { - - if (fragment.getType() !=3D FragmentResponse.TYPE_EMPTY) - { - String frag; - - // - if (fragment.getType() =3D=3D FragmentResponse.TYPE_BYTES) - { - frag =3D fragment.getBytes().toString(); - } - else - { - frag =3D fragment.getChars().toString(); - } - - StringBuilder builder =3D new StringBuilder(frag.length() + 50); - builder.append("
").append(frag).append("=
"); - return builder.toString(); - } - else - { - return "
"; - } - } - - public String renderError(ErrorResponse error) - { - String html =3D error.toHTML(); - StringBuilder builder =3D new StringBuilder(html + 50); - builder.append("
").append(html).append("
"= ); - return builder.toString(); - } -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller/SimpleFragmentRenderer.java (from rev 9777, modules/portlet/= trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/SimpleFr= agmentRenderer.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/SimpleFragmentRenderer.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/SimpleFragmentRenderer.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -0,0 +1,69 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.test.controller; + +import org.jboss.portal.portlet.invocation.response.ErrorResponse; +import org.jboss.portal.portlet.invocation.response.FragmentResponse; + +/** + * @author Chris Laprun + * @version $Revision: 9748 $ + */ +public class SimpleFragmentRenderer implements FragmentRenderer +{ + public String renderPortlet(FragmentResponse fragment) + { + + if (fragment.getType() !=3D FragmentResponse.TYPE_EMPTY) + { + String frag; + + // + if (fragment.getType() =3D=3D FragmentResponse.TYPE_BYTES) + { + frag =3D fragment.getBytes().toString(); + } + else + { + frag =3D fragment.getChars().toString(); + } + + StringBuilder builder =3D new StringBuilder(frag.length() + 50); + builder.append("
").append(frag).append("=
"); + return builder.toString(); + } + else + { + return "
"; + } + } + + public String renderError(ErrorResponse error) + { + String html =3D error.toHTML(); + StringBuilder builder =3D new StringBuilder(html + 50); + builder.append("
").append(html).append("
"= ); + return builder.toString(); + } +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/TestInstanceContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/TestInstanceContext.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestInstanceContext.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -1,102 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.test.controller2; - -import org.jboss.portal.portlet.state.AccessMode; -import org.jboss.portal.portlet.PortletContext; -import org.jboss.portal.portlet.StateEvent; -import org.jboss.portal.portlet.spi.InstanceContext; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -public class TestInstanceContext implements InstanceContext -{ - - /** . */ - private HttpServletRequest req; - - /** . */ - private boolean modifiable; - - /** . */ - private PortletContext target; - - /** . */ - private boolean useClone; - - /** . */ - private String id; - - public TestInstanceContext( - HttpServletRequest req, - PortletContext portletContext, - boolean modifiable) - { - String id =3D portletContext.getId(); - PortletContext target =3D portletContext; - boolean useClone =3D false; - HttpSession session =3D req.getSession(false); - if (session !=3D null) - { - PortletContext clone =3D (PortletContext)session.getAttribute("cl= one." + id); - if (clone !=3D null) - { - target =3D clone; - useClone =3D true; - } - } - - // - this.req =3D req; - this.useClone =3D useClone; - this.target =3D target; - this.id =3D id; - this.modifiable =3D modifiable; - } - - public PortletContext getTarget() - { - return target; - } - - public String getId() - { - return id; - } - - public AccessMode getAccessMode() - { - return modifiable ? (useClone ? AccessMode.READ_WRITE : AccessMode.C= LONE_BEFORE_WRITE) : AccessMode.READ_ONLY; - } - - public void onStateEvent(StateEvent event) - { - target =3D event.getPortletContext(); - req.getSession().setAttribute("clone." + id, target); - } -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller/TestInstanceContext.java (from rev 9777, modules/portlet/tru= nk/test/src/main/java/org/jboss/portal/portlet/test/controller2/TestInstanc= eContext.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestInstanceContext.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestInstanceContext.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -0,0 +1,102 @@ +/*************************************************************************= ***** + * 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.portlet.test.controller; + +import org.jboss.portal.portlet.state.AccessMode; +import org.jboss.portal.portlet.PortletContext; +import org.jboss.portal.portlet.StateEvent; +import org.jboss.portal.portlet.spi.InstanceContext; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class TestInstanceContext implements InstanceContext +{ + + /** . */ + private HttpServletRequest req; + + /** . */ + private boolean modifiable; + + /** . */ + private PortletContext target; + + /** . */ + private boolean useClone; + + /** . */ + private String id; + + public TestInstanceContext( + HttpServletRequest req, + PortletContext portletContext, + boolean modifiable) + { + String id =3D portletContext.getId(); + PortletContext target =3D portletContext; + boolean useClone =3D false; + HttpSession session =3D req.getSession(false); + if (session !=3D null) + { + PortletContext clone =3D (PortletContext)session.getAttribute("cl= one." + id); + if (clone !=3D null) + { + target =3D clone; + useClone =3D true; + } + } + + // + this.req =3D req; + this.useClone =3D useClone; + this.target =3D target; + this.id =3D id; + this.modifiable =3D modifiable; + } + + public PortletContext getTarget() + { + return target; + } + + public String getId() + { + return id; + } + + public AccessMode getAccessMode() + { + return modifiable ? (useClone ? AccessMode.READ_WRITE : AccessMode.C= LONE_BEFORE_WRITE) : AccessMode.READ_ONLY; + } + + public void onStateEvent(StateEvent event) + { + target =3D event.getPortletContext(); + req.getSession().setAttribute("clone." + id, target); + } +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/TestPortalContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/TestPortalContext.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortalContext.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -1,40 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.test.controller2; - -import org.jboss.portal.portlet.impl.spi.AbstractPortalContext; - -import java.util.Map; -import java.util.Collections; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class TestPortalContext extends AbstractPortalContext -{ - public TestPortalContext() - { - super(Collections.singletonMap("javax.portlet.markup.head.element.su= pport", "true")); - } -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller/TestPortalContext.java (from rev 9777, modules/portlet/trunk= /test/src/main/java/org/jboss/portal/portlet/test/controller2/TestPortalCon= text.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortalContext.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortalContext.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -0,0 +1,39 @@ +/*************************************************************************= ***** + * 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.portlet.test.controller; + +import org.jboss.portal.portlet.impl.spi.AbstractPortalContext; + +import java.util.Collections; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class TestPortalContext extends AbstractPortalContext +{ + public TestPortalContext() + { + super(Collections.singletonMap("javax.portlet.markup.head.element.su= pport", "true")); + } +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/TestPortletInvocationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/TestPortletInvocationContext.java 2008-02-05 15:13:09 UTC (rev = 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvocationContext.java 2008-02-05 15:46:21 UTC (rev 9= 778) @@ -1,97 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.test.controller2; - -import org.jboss.portal.portlet.ContainerURL; -import org.jboss.portal.portlet.test.controller.PageNavigationalState; -import org.jboss.portal.portlet.test.controller2.PortletURLRenderer; -import org.jboss.portal.portlet.invocation.PortletInvocation; -import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext; -import org.jboss.portal.common.util.MarkupInfo; -import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResol= ver; -import org.jboss.portal.common.invocation.resolver.MapAttributeResolver; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -public class TestPortletInvocationContext extends AbstractPortletInvocatio= nContext -{ - - /** . */ - private final PortletURLRenderer urlRenderer; - - /** . */ - private final String windowId; - - /** . */ - private final PageNavigationalState pageState; - - /** . */ - private final HttpServletRequest clientRequest; - - /** . */ - private final HttpServletResponse clientResponse; - - public TestPortletInvocationContext( - HttpServletRequest clientRequest, - HttpServletResponse clientResponse, - String windowId, - PageNavigationalState pageState, - MarkupInfo markupInfo) - { - super(markupInfo); - - // - this.clientRequest =3D clientRequest; - this.clientResponse =3D clientResponse; - this.windowId =3D windowId; - this.pageState =3D pageState; - this.urlRenderer =3D new PortletURLRenderer(pageState, windowId, cli= entRequest, clientResponse); - - // - addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttribut= eResolver(clientRequest)); - addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeReso= lver()); - addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, new MapAttri= buteResolver()); - addResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, new MapAttr= ibuteResolver()); - addResolver(PortletInvocation.REQUEST_SCOPE, new MapAttributeResolve= r()); - } - - public HttpServletRequest getClientRequest() throws IllegalStateExcepti= on - { - return clientRequest; - } - - public HttpServletResponse getClientResponse() throws IllegalStateExcep= tion - { - return clientResponse; - } - - public String renderURL(ContainerURL containerURL, Boolean wantSecure, = Boolean wantAuthenticated, boolean relative) - { - return urlRenderer.renderURL(containerURL, wantSecure, wantAuthentic= ated, relative); - } -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller/TestPortletInvocationContext.java (from rev 9777, modules/po= rtlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/Te= stPortletInvocationContext.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvocationContext.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvocationContext.java 2008-02-05 15:46:21 UTC (rev 9= 778) @@ -0,0 +1,97 @@ +/*************************************************************************= ***** + * 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.portlet.test.controller; + +import org.jboss.portal.portlet.ContainerURL; +import org.jboss.portal.portlet.controller.PageNavigationalState; +import org.jboss.portal.portlet.test.controller.PortletURLRenderer; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext; +import org.jboss.portal.common.util.MarkupInfo; +import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResol= ver; +import org.jboss.portal.common.invocation.resolver.MapAttributeResolver; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class TestPortletInvocationContext extends AbstractPortletInvocatio= nContext +{ + + /** . */ + private final PortletURLRenderer urlRenderer; + + /** . */ + private final String windowId; + + /** . */ + private final PageNavigationalState pageState; + + /** . */ + private final HttpServletRequest clientRequest; + + /** . */ + private final HttpServletResponse clientResponse; + + public TestPortletInvocationContext( + HttpServletRequest clientRequest, + HttpServletResponse clientResponse, + String windowId, + PageNavigationalState pageState, + MarkupInfo markupInfo) + { + super(markupInfo); + + // + this.clientRequest =3D clientRequest; + this.clientResponse =3D clientResponse; + this.windowId =3D windowId; + this.pageState =3D pageState; + this.urlRenderer =3D new PortletURLRenderer(pageState, windowId, cli= entRequest, clientResponse); + + // + addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttribut= eResolver(clientRequest)); + addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeReso= lver()); + addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, new MapAttri= buteResolver()); + addResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, new MapAttr= ibuteResolver()); + addResolver(PortletInvocation.REQUEST_SCOPE, new MapAttributeResolve= r()); + } + + public HttpServletRequest getClientRequest() throws IllegalStateExcepti= on + { + return clientRequest; + } + + public HttpServletResponse getClientResponse() throws IllegalStateExcep= tion + { + return clientResponse; + } + + public String renderURL(ContainerURL containerURL, Boolean wantSecure, = Boolean wantAuthenticated, boolean relative) + { + return urlRenderer.renderURL(containerURL, wantSecure, wantAuthentic= ated, relative); + } +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/TestPortletInvoker.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller2/TestPortletInvoker.java 2008-02-05 15:13:09 UTC (rev 9775) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvoker.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -1,158 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.test.controller2; - -import org.jboss.portal.portlet.PortletInvoker; -import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.Portlet; -import org.jboss.portal.portlet.PortletContext; -import org.jboss.portal.portlet.state.PropertyMap; -import org.jboss.portal.portlet.state.PropertyChange; -import org.jboss.portal.portlet.state.DestroyCloneFailure; -import org.jboss.portal.portlet.invocation.PortletInvocation; -import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.common.invocation.InterceptorStackFactory; -import org.jboss.portal.common.invocation.InvocationHandler; -import org.jboss.portal.common.invocation.Invocation; -import org.jboss.portal.common.invocation.InvocationException; - -import java.util.Set; -import java.util.List; - -/** - * A simple consumer. - * - * @author Julien Viet - * @version $Revision: 6712 $ - */ -public class TestPortletInvoker implements PortletInvoker -{ - - /** . */ - private InterceptorStackFactory stackFactory; - - /** . */ - private PortletInvoker producer; - - /** . */ - private InvocationHandler handler =3D new InvocationHandler() - { - public Object invoke(Invocation invocation) throws Exception, Invoca= tionException - { - PortletInvocation portletInvocation =3D (PortletInvocation)invoca= tion; - try - { - portletInvocation.setHandler(null); - return producer.invoke(portletInvocation); - } - finally - { - portletInvocation.setHandler(this); - } - } - }; - - public InterceptorStackFactory getStackFactory() - { - return stackFactory; - } - - public void setStackFactory(InterceptorStackFactory stackFactory) - { - this.stackFactory =3D stackFactory; - } - - public PortletInvoker getProducer() - { - return producer; - } - - public void setProducer(PortletInvoker producer) - { - this.producer =3D producer; - } - - public Set getPortlets() throws PortletInvokerException - { - return producer.getPortlets(); - } - - public Portlet getPortlet(PortletContext portletContext) throws Illegal= ArgumentException, PortletInvokerException - { - return producer.getPortlet(portletContext); - } - - public PortletInvocationResponse invoke(PortletInvocation invocation) t= hrows PortletInvokerException - { - InvocationHandler prevHandler =3D invocation.getHandler(); - try - { - invocation.setHandler(handler); - return (PortletInvocationResponse)invocation.invoke(stackFactory.= getInterceptorStack()); - } - catch (Exception e) - { - if (e instanceof PortletInvokerException) - { - throw(PortletInvokerException)e; - } - else if (e instanceof RuntimeException) - { - throw(RuntimeException)e; - } - else - { - throw new PortletInvokerException(e); - } - } - finally - { - invocation.setHandler(prevHandler); - } - } - - public PortletContext createClone(PortletContext portletContext) throws= IllegalArgumentException, PortletInvokerException, UnsupportedOperationExc= eption - { - throw new UnsupportedOperationException(); - } - - public List destroyClones(List por= tletContexts) throws IllegalArgumentException, PortletInvokerException, Uns= upportedOperationException - { - throw new UnsupportedOperationException(); - } - - public PropertyMap getProperties(PortletContext portletContext, Set key= s) throws IllegalArgumentException, PortletInvokerException, UnsupportedOpe= rationException - { - throw new UnsupportedOperationException(); - } - - public PropertyMap getProperties(PortletContext portletContext) throws = IllegalArgumentException, PortletInvokerException, UnsupportedOperationExce= ption - { - throw new UnsupportedOperationException(); - } - - public PortletContext setProperties(PortletContext portletContext, Prop= ertyChange[] changes) throws IllegalArgumentException, PortletInvokerExcept= ion, UnsupportedOperationException - { - throw new UnsupportedOperationException(); - } -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/controller/TestPortletInvoker.java (from rev 9777, modules/portlet/trun= k/test/src/main/java/org/jboss/portal/portlet/test/controller2/TestPortletI= nvoker.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvoker.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvoker.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -0,0 +1,158 @@ +/*************************************************************************= ***** + * 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.portlet.test.controller; + +import org.jboss.portal.portlet.PortletInvoker; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletContext; +import org.jboss.portal.portlet.state.PropertyMap; +import org.jboss.portal.portlet.state.PropertyChange; +import org.jboss.portal.portlet.state.DestroyCloneFailure; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.common.invocation.InterceptorStackFactory; +import org.jboss.portal.common.invocation.InvocationHandler; +import org.jboss.portal.common.invocation.Invocation; +import org.jboss.portal.common.invocation.InvocationException; + +import java.util.Set; +import java.util.List; + +/** + * A simple consumer. + * + * @author Julien Viet + * @version $Revision: 6712 $ + */ +public class TestPortletInvoker implements PortletInvoker +{ + + /** . */ + private InterceptorStackFactory stackFactory; + + /** . */ + private PortletInvoker producer; + + /** . */ + private InvocationHandler handler =3D new InvocationHandler() + { + public Object invoke(Invocation invocation) throws Exception, Invoca= tionException + { + PortletInvocation portletInvocation =3D (PortletInvocation)invoca= tion; + try + { + portletInvocation.setHandler(null); + return producer.invoke(portletInvocation); + } + finally + { + portletInvocation.setHandler(this); + } + } + }; + + public InterceptorStackFactory getStackFactory() + { + return stackFactory; + } + + public void setStackFactory(InterceptorStackFactory stackFactory) + { + this.stackFactory =3D stackFactory; + } + + public PortletInvoker getProducer() + { + return producer; + } + + public void setProducer(PortletInvoker producer) + { + this.producer =3D producer; + } + + public Set getPortlets() throws PortletInvokerException + { + return producer.getPortlets(); + } + + public Portlet getPortlet(PortletContext portletContext) throws Illegal= ArgumentException, PortletInvokerException + { + return producer.getPortlet(portletContext); + } + + public PortletInvocationResponse invoke(PortletInvocation invocation) t= hrows PortletInvokerException + { + InvocationHandler prevHandler =3D invocation.getHandler(); + try + { + invocation.setHandler(handler); + return (PortletInvocationResponse)invocation.invoke(stackFactory.= getInterceptorStack()); + } + catch (Exception e) + { + if (e instanceof PortletInvokerException) + { + throw(PortletInvokerException)e; + } + else if (e instanceof RuntimeException) + { + throw(RuntimeException)e; + } + else + { + throw new PortletInvokerException(e); + } + } + finally + { + invocation.setHandler(prevHandler); + } + } + + public PortletContext createClone(PortletContext portletContext) throws= IllegalArgumentException, PortletInvokerException, UnsupportedOperationExc= eption + { + throw new UnsupportedOperationException(); + } + + public List destroyClones(List por= tletContexts) throws IllegalArgumentException, PortletInvokerException, Uns= upportedOperationException + { + throw new UnsupportedOperationException(); + } + + public PropertyMap getProperties(PortletContext portletContext, Set key= s) throws IllegalArgumentException, PortletInvokerException, UnsupportedOpe= rationException + { + throw new UnsupportedOperationException(); + } + + public PropertyMap getProperties(PortletContext portletContext) throws = IllegalArgumentException, PortletInvokerException, UnsupportedOperationExce= ption + { + throw new UnsupportedOperationException(); + } + + public PortletContext setProperties(PortletContext portletContext, Prop= ertyChange[] changes) throws IllegalArgumentException, PortletInvokerExcept= ion, UnsupportedOperationException + { + throw new UnsupportedOperationException(); + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/= SimplePortalServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/Simple= PortalServlet.java 2008-02-05 15:38:52 UTC (rev 9777) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/Simple= PortalServlet.java 2008-02-05 15:46:21 UTC (rev 9778) @@ -26,10 +26,10 @@ import org.jboss.portal.portlet.controller.PageNavigationalState; import org.jboss.portal.portlet.controller.PortletController; import org.jboss.portal.portlet.controller.response.ControllerResponse; -import org.jboss.portal.portlet.test.controller2.Renderer; -import org.jboss.portal.portlet.test.controller2.ControllerResponseRendere= rFactory; -import org.jboss.portal.portlet.test.controller2.PortletControllerContextI= mpl; -import org.jboss.portal.portlet.test.controller2.PageRenderer; +import org.jboss.portal.portlet.test.controller.Renderer; +import org.jboss.portal.portlet.test.controller.ControllerResponseRenderer= Factory; +import org.jboss.portal.portlet.test.controller.PortletControllerContextIm= pl; +import org.jboss.portal.portlet.test.controller.PageRenderer; = import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; Modified: modules/portlet/trunk/test/src/test/resources/portlet-test-war/WE= B-INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/= jboss-beans.xml 2008-02-05 15:38:52 UTC (rev 9777) +++ modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/= jboss-beans.xml 2008-02-05 15:46:21 UTC (rev 9778) @@ -70,7 +70,7 @@ = - + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-beans.xml 2008-02-05 15:38:52 UTC (rev 9777) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-beans.xml 2008-02-05 15:46:21 UTC (rev 9778) @@ -58,7 +58,7 @@ = - + --===============1385300744351619543==-- From portal-commits at lists.jboss.org Tue Feb 5 11:07:25 2008 Content-Type: multipart/mixed; boundary="===============8872456565770108931==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9779 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller. Date: Tue, 05 Feb 2008 11:07:25 -0500 Message-ID: --===============8872456565770108931== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-05 11:07:25 -0500 (Tue, 05 Feb 2008) New Revision: 9779 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/PortletController.java Log: added a few todos Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/PortletController.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletController.java 2008-02-05 15:46:21 UTC (rev 9778) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletController.java 2008-02-05 16:07:25 UTC (rev 9779) @@ -34,6 +34,15 @@ * The portlet controller which handles the page state management and the = interactions between * the action phase and the event phase. It really only does that and not = more. * + * 1/ introduce EventRequest so the portal can send events directly to a p= ortlet + * + * 2/ make the event controller return a decision for a given event. Toda= y it just returns a list + * of events to process. An event can be handled in various manners by th= e controller: + * - produce new events (what exists today) + * - make it a portal event which delivers the event to the portal + * + * 3/ delegate public render parameter wiring to the context + * * @author Julien Viet * @version $Revision: 1.1 $ */ --===============8872456565770108931==-- From portal-commits at lists.jboss.org Tue Feb 5 12:17:28 2008 Content-Type: multipart/mixed; boundary="===============4356270173936299713==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9780 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal: portlet/controller/impl and 8 other directories. Date: Tue, 05 Feb 2008 12:17:28 -0500 Message-ID: --===============4356270173936299713== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-05 12:17:28 -0500 (Tue, 05 Feb 2008) New Revision: 9780 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/event/ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/event/EventControllerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/state/ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/state/MutablePageNavigationalState.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/state/PageNavigationalStateImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/state/StateControllerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/state/ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/state/PageNavigationalState.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/state/StateControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/state/WindowNavigationalState.java Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/PageNavigationalState.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/WindowNavigationalState.java Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/PortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/PortletRequestHandler.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/PortletResourceRequestHandler.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/PageScopedFullPortletResourceRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/PortletActionRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/PortletRenderRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/PortletRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/PortletScopedPortletResourceRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/response/PageUpdateResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortalServlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PageRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletControllerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletURLRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestPortletInvocationContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimpleP= ortalServlet.java Log: - introduce state controller context class Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= controller/PageNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PageNavigationalState.java 2008-02-05 16:07:25 UTC (rev 9779) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PageNavigationalState.java 2008-02-05 17:17:28 UTC (rev 9780) @@ -1,115 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.controller; - -import org.jboss.portal.common.util.ParameterMap; -import org.jboss.portal.portlet.info.ParameterInfo; -import org.jboss.portal.portlet.info.PortletInfo; - -import javax.xml.namespace.QName; -import java.util.Map; -import java.util.HashMap; -import java.util.zip.GZIPOutputStream; -import java.util.zip.GZIPInputStream; -import java.io.Serializable; -import java.io.ObjectOutputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.ByteArrayInputStream; -import java.io.ObjectInputStream; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -public class PageNavigationalState implements Serializable -{ - - /** . */ - protected final Map windows; - - /** . */ - protected final Map page; - - public PageNavigationalState() - { - this.windows =3D new HashMap(); - this.page =3D new HashMap(); - } - - public PageNavigationalState(PageNavigationalState original) - { - this.windows =3D new HashMap(origin= al.windows); - this.page =3D new HashMap(original.page); - } - - public WindowNavigationalState getWindowNavigationalState(String window= Id) - { - return windows.get(windowId); - } - - public ParameterMap getPublicNavigationalState(PortletInfo portlet) - { - ParameterMap publicNavigationalState =3D null; - for (ParameterInfo parameterInfo : portlet.getNavigation().getPublic= Parameters()) - { - String[] parameterValue =3D page.get(parameterInfo.getName()); - - // - if (parameterValue !=3D null) - { - String parameterId =3D parameterInfo.getId(); - - // Lazy create - if (publicNavigationalState =3D=3D null) - { - publicNavigationalState =3D new ParameterMap(); - } - - // We clone the value here so we keep the internal state not p= otentially changed - publicNavigationalState.put(parameterId, parameterValue.clone(= )); - } - } - - // - return publicNavigationalState; - } - - public static byte[] serialize(PageNavigationalState object) throws IOE= xception - { - ByteArrayOutputStream baos =3D new ByteArrayOutputStream(); - GZIPOutputStream zos =3D new GZIPOutputStream(baos); - ObjectOutputStream oos =3D new ObjectOutputStream(zos); - oos.writeObject(object); - oos.close(); - return baos.toByteArray(); - } - - public static PageNavigationalState unserialize(byte[] bytes) throws IO= Exception, ClassNotFoundException - { - ByteArrayInputStream bais =3D new ByteArrayInputStream(bytes); - GZIPInputStream zis =3D new GZIPInputStream(bais); - ObjectInputStream ois =3D new ObjectInputStream(zis); - return (PageNavigationalState)ois.readObject(); - } -} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/PortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletControllerContext.java 2008-02-05 16:07:25 UTC (rev 9779) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletControllerContext.java 2008-02-05 17:17:28 UTC (rev 9780) @@ -30,6 +30,8 @@ import org.jboss.portal.portlet.invocation.ResourceInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.controller.event.EventControllerContext; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.StateControllerContext; = import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; @@ -64,4 +66,6 @@ = EventControllerContext getEventControllerContext(); = + StateControllerContext getStateControllerContext(); + } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/PortletRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletRequestHandler.java 2008-02-05 16:07:25 UTC (rev 9779) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletRequestHandler.java 2008-02-05 17:17:28 UTC (rev 9780) @@ -28,6 +28,9 @@ import org.jboss.portal.portlet.controller.response.ControllerResponse; import org.jboss.portal.portlet.controller.response.PageUpdateResponse; import org.jboss.portal.portlet.controller.response.PortletResponse; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; +import org.jboss.portal.portlet.controller.state.StateControllerContext; = import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; @@ -64,10 +67,20 @@ { PortletControllerContext context =3D portletRequest.getControllerCon= text(); = + StateControllerContext stateContext =3D context.getStateControllerCo= ntext(); + // The page navigational state we will operate on during the request // Either we have nothing in the request so we create a new one // Or we have one but we copy it as we should not modify the input s= tate provided - MutablePageNavigationalState pageState =3D portletRequest.getPageSta= te() =3D=3D null ? new MutablePageNavigationalState() : new MutablePageNavi= gationalState(portletRequest.getPageState()); + PageNavigationalState pageState =3D portletRequest.getPageState(); + if (pageState =3D=3D null) + { + pageState =3D stateContext.createPageState(); + } + else + { + pageState =3D stateContext.clonePageState(pageState); + } = // ResponseProperties requestProperties =3D new ResponseProperties(); @@ -244,8 +257,11 @@ return context.invoke(event.getWindowId(), requestCookies, eventInvo= cation); } = - private void updateNavigationalState(PortletControllerContext context, = String windowId, - UpdateNavigationalStateResponse up= date, MutablePageNavigationalState pageState) + private void updateNavigationalState( + PortletControllerContext context, + String windowId, + UpdateNavigationalStateResponse update, = + PageNavigationalState pageState) throws PortletInvokerException { PortletInfo portlet =3D context.getPortletInfo(windowId); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/PortletResourceRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletResourceRequestHandler.java 2008-02-05 16:07:25 UTC (rev 9779) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletResourceRequestHandler.java 2008-02-05 17:17:28 UTC (rev 9780) @@ -39,6 +39,7 @@ import org.jboss.portal.portlet.controller.request.PortletScopedPortletRes= ourceRequest; import org.jboss.portal.portlet.controller.response.ControllerResponse; import org.jboss.portal.portlet.controller.response.ResourceResponse; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; = import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= controller/WindowNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/WindowNavigationalState.java 2008-02-05 16:07:25 UTC (rev 9779) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/WindowNavigationalState.java 2008-02-05 17:17:28 UTC (rev 9780) @@ -1,75 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.controller; - -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; -import org.jboss.portal.portlet.StateString; - -import java.io.Serializable; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -public class WindowNavigationalState implements Serializable -{ - - /** . */ - private final StateString portletNavigationalState; - - /** . */ - private final Mode mode; - - /** . */ - private final WindowState windowState; - - public WindowNavigationalState() - { - this.portletNavigationalState =3D null; - this.mode =3D Mode.VIEW; - this.windowState =3D WindowState.NORMAL; - } - - public WindowNavigationalState(StateString portletNavigationalState, Mo= de mode, WindowState windowState) - { - this.portletNavigationalState =3D portletNavigationalState; - this.mode =3D mode; - this.windowState =3D windowState; - } - - public StateString getPortletNavigationalState() - { - return portletNavigationalState; - } - - public Mode getMode() - { - return mode; - } - - public WindowState getWindowState() - { - return windowState; - } -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/c= ontroller/impl/event/EventControllerContextImpl.java (from rev 9779, module= s/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/even= t/EventControllerContextImpl.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/event/EventControllerContextImpl.java (r= ev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/event/EventControllerContextImpl.java 2008-02-05 17:17:28 UTC (r= ev 9780) @@ -0,0 +1,75 @@ +/*************************************************************************= ***** + * 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.portlet.controller.impl.event; + +import org.jboss.portal.portlet.PortletInvoker; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.controller.event.EventControllerContext; +import org.jboss.portal.portlet.controller.event.Event; +import org.jboss.portal.portlet.info.PortletInfo; + +import java.util.List; +import java.util.Collections; +import java.util.ArrayList; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class EventControllerContextImpl implements EventControllerContext +{ + + /** . */ + private PortletInvoker invoker; + + public EventControllerContextImpl(PortletInvoker invoker) + { + this.invoker =3D invoker; + } + + public List getConsumedEvents(Event producedEvent) + { + try + { + ArrayList consumedEvents =3D new ArrayList(); + for (Portlet portlet : invoker.getPortlets()) + { + PortletInfo portletInfo =3D portlet.getInfo(); + if (portletInfo.getEventing().getConsumedEvents().containsKey(= producedEvent.getName())) + { + Event consumedEvent =3D new Event(producedEvent.getName(), = producedEvent.getPayload(), portlet.getContext().getId()); + consumedEvents.add(consumedEvent); + } + } + return consumedEvents; + } + catch (PortletInvokerException e) + { + System.out.println("e =3D " + e); + + // + return Collections.emptyList(); + } + } +} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/c= ontroller/impl/state/MutablePageNavigationalState.java (from rev 9779, modu= les/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/Mu= tablePageNavigationalState.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/MutablePageNavigationalState.java = (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/MutablePageNavigationalState.java 2008-02-05 17:17:28 UTC = (rev 9780) @@ -0,0 +1,60 @@ +/*************************************************************************= ***** + * 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.portlet.controller.impl.state; + +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; + +import javax.xml.namespace.QName; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +class MutablePageNavigationalState extends PageNavigationalStateImpl +{ + + public MutablePageNavigationalState() + { + } + + public MutablePageNavigationalState(PageNavigationalStateImpl original) + { + super(original); + } + + public void setWindowNavigationalState(String windowId, WindowNavigatio= nalState windowNS) + { + windows.put(windowId, windowNS); + } + + public void setPublicNavigationalState(QName name, String[] value) + { + // We clone the value in order to keep the state not mutated by a si= de effect + page.put(name, value.clone()); + } + + public void removePublicNavigationalState(QName name) + { + page.remove(name); + } +} \ No newline at end of file Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/co= ntroller/impl/state/PageNavigationalStateImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/PageNavigationalStateImpl.java (re= v 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/PageNavigationalStateImpl.java 2008-02-05 17:17:28 UTC (re= v 9780) @@ -0,0 +1,115 @@ +/*************************************************************************= ***** + * 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.portlet.controller.impl.state; + +import org.jboss.portal.common.util.ParameterMap; +import org.jboss.portal.portlet.info.ParameterInfo; +import org.jboss.portal.portlet.info.PortletInfo; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; + +import javax.xml.namespace.QName; +import java.util.Map; +import java.util.HashMap; +import java.util.zip.GZIPOutputStream; +import java.util.zip.GZIPInputStream; +import java.io.Serializable; +import java.io.ObjectOutputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ByteArrayInputStream; +import java.io.ObjectInputStream; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +class PageNavigationalStateImpl implements PageNavigationalState, Serializ= able +{ + + /** . */ + protected final Map windows; + + /** . */ + protected final Map page; + + public PageNavigationalStateImpl() + { + this.windows =3D new HashMap(); + this.page =3D new HashMap(); + } + + public PageNavigationalStateImpl(PageNavigationalStateImpl original) + { + this.windows =3D new HashMap(origin= al.windows); + this.page =3D new HashMap(original.page); + } + + public WindowNavigationalState getWindowNavigationalState(String window= Id) + { + return windows.get(windowId); + } + + public ParameterMap getPublicNavigationalState(PortletInfo portlet) + { + ParameterMap publicNavigationalState =3D null; + for (ParameterInfo parameterInfo : portlet.getNavigation().getPublic= Parameters()) + { + String[] parameterValue =3D page.get(parameterInfo.getName()); + + // + if (parameterValue !=3D null) + { + String parameterId =3D parameterInfo.getId(); + + // Lazy create + if (publicNavigationalState =3D=3D null) + { + publicNavigationalState =3D new ParameterMap(); + } + + // We clone the value here so we keep the internal state not p= otentially changed + publicNavigationalState.put(parameterId, parameterValue.clone(= )); + } + } + + // + return publicNavigationalState; + } + + public void setWindowNavigationalState(String windowId, WindowNavigatio= nalState windowNS) throws UnsupportedOperationException + { + throw new UnsupportedOperationException(); + } + + public void setPublicNavigationalState(QName name, String[] value) thro= ws UnsupportedOperationException + { + throw new UnsupportedOperationException(); + } + + public void removePublicNavigationalState(QName name) throws Unsupporte= dOperationException + { + throw new UnsupportedOperationException(); + } + +} \ No newline at end of file Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/co= ntroller/impl/state/StateControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/StateControllerContextImpl.java (r= ev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/StateControllerContextImpl.java 2008-02-05 17:17:28 UTC (r= ev 9780) @@ -0,0 +1,70 @@ +/*************************************************************************= ***** + * 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.portlet.controller.impl.state; + +import org.jboss.portal.portlet.controller.state.StateControllerContext; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; + +import java.io.IOException; +import java.io.ByteArrayOutputStream; +import java.io.ObjectOutputStream; +import java.io.ByteArrayInputStream; +import java.io.ObjectInputStream; +import java.util.zip.GZIPOutputStream; +import java.util.zip.GZIPInputStream; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class StateControllerContextImpl implements StateControllerContext +{ + + public PageNavigationalState clonePageState(PageNavigationalState pageS= tate) + { + return new MutablePageNavigationalState((PageNavigationalStateImpl)p= ageState); + } + + public PageNavigationalState createPageState() + { + return new MutablePageNavigationalState(); + } + + public static byte[] serialize(PageNavigationalState object) throws IOE= xception + { + ByteArrayOutputStream baos =3D new ByteArrayOutputStream(); + GZIPOutputStream zos =3D new GZIPOutputStream(baos); + ObjectOutputStream oos =3D new ObjectOutputStream(zos); + oos.writeObject(object); + oos.close(); + return baos.toByteArray(); + } + + public static PageNavigationalState unserialize(byte[] bytes) throws IO= Exception, ClassNotFoundException + { + ByteArrayInputStream bais =3D new ByteArrayInputStream(bytes); + GZIPInputStream zis =3D new GZIPInputStream(bais); + ObjectInputStream ois =3D new ObjectInputStream(zis); + return (PageNavigationalState)ois.readObject(); + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/PageScopedFullPortletResourceRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PageScopedFullPortletResourceRequest.java 2008-02-05 16:07:25= UTC (rev 9779) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PageScopedFullPortletResourceRequest.java 2008-02-05 17:17:28= UTC (rev 9780) @@ -23,8 +23,8 @@ package org.jboss.portal.portlet.controller.request; = import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.controller.WindowNavigationalState; -import org.jboss.portal.portlet.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.PortletControllerContext; import org.jboss.portal.common.util.ParameterMap; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/PortletActionRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletActionRequest.java 2008-02-05 16:07:25 UTC (rev 9779) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletActionRequest.java 2008-02-05 17:17:28 UTC (rev 9780) @@ -23,9 +23,9 @@ package org.jboss.portal.portlet.controller.request; = import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.controller.WindowNavigationalState; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; import org.jboss.portal.portlet.controller.PortletControllerContext; -import org.jboss.portal.portlet.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.common.util.ParameterMap; = /** Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/PortletRenderRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletRenderRequest.java 2008-02-05 16:07:25 UTC (rev 9779) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletRenderRequest.java 2008-02-05 17:17:28 UTC (rev 9780) @@ -22,9 +22,9 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.controller.request; = -import org.jboss.portal.portlet.controller.WindowNavigationalState; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; import org.jboss.portal.portlet.controller.PortletControllerContext; -import org.jboss.portal.portlet.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; = import java.util.Map; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/PortletRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletRequest.java 2008-02-05 16:07:25 UTC (rev 9779) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletRequest.java 2008-02-05 17:17:28 UTC (rev 9780) @@ -22,8 +22,8 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.controller.request; = -import org.jboss.portal.portlet.controller.WindowNavigationalState; -import org.jboss.portal.portlet.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.PortletControllerContext; = /** Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/PortletScopedPortletResourceRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletScopedPortletResourceRequest.java 2008-02-05 16:07:25 = UTC (rev 9779) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletScopedPortletResourceRequest.java 2008-02-05 17:17:28 = UTC (rev 9780) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.controller.request; = -import org.jboss.portal.portlet.controller.WindowNavigationalState; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; import org.jboss.portal.portlet.controller.PortletControllerContext; import org.jboss.portal.portlet.StateString; import org.jboss.portal.common.util.ParameterMap; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/response/PageUpdateResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/response/PageUpdateResponse.java 2008-02-05 16:07:25 UTC (rev 9779) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/response/PageUpdateResponse.java 2008-02-05 17:17:28 UTC (rev 9780) @@ -24,7 +24,7 @@ = import org.jboss.portal.portlet.invocation.response.ResponseProperties; import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStat= eResponse; -import org.jboss.portal.portlet.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; = /** * @author Julien Viet Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/c= ontroller/state/PageNavigationalState.java (from rev 9779, modules/portlet/= trunk/test/src/main/java/org/jboss/portal/portlet/controller/PageNavigation= alState.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/PageNavigationalState.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/PageNavigationalState.java 2008-02-05 17:17:28 UTC (rev 9780) @@ -0,0 +1,46 @@ +/*************************************************************************= ***** + * 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.portlet.controller.state; + +import org.jboss.portal.common.util.ParameterMap; +import org.jboss.portal.portlet.info.PortletInfo; + +import javax.xml.namespace.QName; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public interface PageNavigationalState +{ + + WindowNavigationalState getWindowNavigationalState(String windowId); + + ParameterMap getPublicNavigationalState(PortletInfo portlet); + + void setWindowNavigationalState(String windowId, WindowNavigationalStat= e windowNS) throws UnsupportedOperationException; + + void setPublicNavigationalState(QName name, String[] value) throws Unsu= pportedOperationException; + + void removePublicNavigationalState(QName name) throws UnsupportedOperat= ionException; +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/co= ntroller/state/StateControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/StateControllerContext.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/StateControllerContext.java 2008-02-05 17:17:28 UTC (rev 9780) @@ -0,0 +1,36 @@ +/*************************************************************************= ***** + * 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.portlet.controller.state; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public interface StateControllerContext +{ + + PageNavigationalState clonePageState(PageNavigationalState pageState); + + PageNavigationalState createPageState(); + +} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/c= ontroller/state/WindowNavigationalState.java (from rev 9779, modules/portle= t/trunk/test/src/main/java/org/jboss/portal/portlet/controller/WindowNaviga= tionalState.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/WindowNavigationalState.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/WindowNavigationalState.java 2008-02-05 17:17:28 UTC (rev 9780) @@ -0,0 +1,75 @@ +/*************************************************************************= ***** + * 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.portlet.controller.state; + +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; +import org.jboss.portal.portlet.StateString; + +import java.io.Serializable; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class WindowNavigationalState implements Serializable +{ + + /** . */ + private final StateString portletNavigationalState; + + /** . */ + private final Mode mode; + + /** . */ + private final WindowState windowState; + + public WindowNavigationalState() + { + this.portletNavigationalState =3D null; + this.mode =3D Mode.VIEW; + this.windowState =3D WindowState.NORMAL; + } + + public WindowNavigationalState(StateString portletNavigationalState, Mo= de mode, WindowState windowState) + { + this.portletNavigationalState =3D portletNavigationalState; + this.mode =3D mode; + this.windowState =3D windowState; + } + + public StateString getPortletNavigationalState() + { + return portletNavigationalState; + } + + public Mode getMode() + { + return mode; + } + + public WindowState getWindowState() + { + return windowState; + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortalServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortalServlet.java 2008-02-05 16:07:25 UTC (rev 9779) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortalServlet.java 2008-02-05 17:17:28 UTC (rev 9780) @@ -25,7 +25,7 @@ import org.jboss.portal.portlet.controller.response.ControllerResponse; import org.jboss.portal.portlet.controller.PortletController; import org.jboss.portal.portlet.test.controller.PortletControllerContextIm= pl; -import org.jboss.portal.portlet.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.test.controller.ControllerResponseRenderer= Factory; import org.jboss.portal.portlet.test.controller.Renderer; import org.jboss.portal.portlet.test.controller.PageRenderer; @@ -88,7 +88,7 @@ } else { - PageRenderer renderer =3D new PageRenderer(new ResponseProperties= (), new PageNavigationalState()); + PageRenderer renderer =3D new PageRenderer(new ResponseProperties= (), context.getStateControllerContext().createPageState()); = // renderer.render(context); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PageRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PageRenderer.java 2008-02-05 16:07:25 UTC (rev 9779) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PageRenderer.java 2008-02-05 17:17:28 UTC (rev 9780) @@ -42,8 +42,8 @@ import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.ResponseProperties; -import org.jboss.portal.portlet.controller.WindowNavigationalState; -import org.jboss.portal.portlet.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.PortletControllerContext; import org.w3c.dom.Element; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContextImpl.java 2008-02-05 16:07:25 UTC (rev 9= 779) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContextImpl.java 2008-02-05 17:17:28 UTC (rev 9= 780) @@ -51,13 +51,13 @@ import org.jboss.portal.portlet.invocation.ResourceInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.test.StringCodec; -import org.jboss.portal.portlet.test.controller.TestInstanceContext; -import org.jboss.portal.portlet.test.controller.TestPortalContext; -import org.jboss.portal.portlet.test.controller.TestPortletInvocationConte= xt; import static org.jboss.portal.portlet.test.URLParameterConstants.*; -import org.jboss.portal.portlet.controller.WindowNavigationalState; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; import org.jboss.portal.portlet.controller.PortletControllerContext; -import org.jboss.portal.portlet.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; +import org.jboss.portal.portlet.controller.impl.event.EventControllerConte= xtImpl; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.StateControllerContext; import org.jboss.portal.portlet.controller.request.PortletRenderRequest; import org.jboss.portal.portlet.controller.request.ControllerRequest; import org.jboss.portal.portlet.controller.request.PortletScopedPortletRes= ourceRequest; @@ -65,7 +65,6 @@ import org.jboss.portal.portlet.controller.request.PageScopedFullPortletRe= sourceRequest; import org.jboss.portal.portlet.controller.request.PortletActionRequest; import org.jboss.portal.portlet.controller.event.EventControllerContext; -import org.jboss.portal.portlet.controller.event.EventControllerContextImp= l; import org.jboss.portal.web.Body; import org.jboss.portal.web.IllegalRequestException; import org.jboss.portal.web.WebRequest; @@ -113,6 +112,9 @@ /** . */ private final EventControllerContext eventControllerContext; = + /** . */ + private final StateControllerContext stateControllerContext; + public PortletControllerContextImpl( HttpServletRequest req, HttpServletResponse resp, @@ -142,7 +144,7 @@ if (context !=3D null) { byte[] bytes =3D Tools.fromHexString(context); - pageState =3D PageNavigationalState.unserialize(bytes); + pageState =3D StateControllerContextImpl.unserialize(bytes); } = // @@ -263,6 +265,7 @@ this.servletContext =3D servletContext; this.invoker =3D invoker; this.eventControllerContext =3D new EventControllerContextImpl(invok= er); + this.stateControllerContext =3D new StateControllerContextImpl(); } = public ControllerRequest getRequest() @@ -310,6 +313,11 @@ return eventControllerContext; } = + public StateControllerContext getStateControllerContext() + { + return stateControllerContext; + } + public String renderURL(String windowId, PageNavigationalState pageStat= e, ContainerURL containerURL, Boolean wantSecure, Boolean wantAuthenticated= , boolean relative) { PortletURLRenderer renderer =3D new PortletURLRenderer(pageState, wi= ndowId, req, resp); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletURLRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-05 16:07:25 UTC (rev 9779) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-05 17:17:28 UTC (rev 9780) @@ -34,7 +34,8 @@ import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.cache.CacheLevel; import static org.jboss.portal.portlet.test.URLParameterConstants.*; -import org.jboss.portal.portlet.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; import org.jboss.portal.portlet.test.StringCodec; = import javax.servlet.http.HttpServletRequest; @@ -113,7 +114,7 @@ String pageState; try { - byte[] bytes =3D PageNavigationalState.serialize(pageNS); + byte[] bytes =3D StateControllerContextImpl.serialize(pageNS); pageState =3D Tools.toHexString(bytes); } catch (IOException e) Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/TestPortletInvocationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvocationContext.java 2008-02-05 16:07:25 UTC (rev 9= 779) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvocationContext.java 2008-02-05 17:17:28 UTC (rev 9= 780) @@ -23,7 +23,7 @@ package org.jboss.portal.portlet.test.controller; = import org.jboss.portal.portlet.ContainerURL; -import org.jboss.portal.portlet.controller.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.test.controller.PortletURLRenderer; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/= SimplePortalServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/Simple= PortalServlet.java 2008-02-05 16:07:25 UTC (rev 9779) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/Simple= PortalServlet.java 2008-02-05 17:17:28 UTC (rev 9780) @@ -23,7 +23,6 @@ package org.jboss.portal.simple; = import org.jboss.portal.portlet.invocation.response.ResponseProperties; -import org.jboss.portal.portlet.controller.PageNavigationalState; import org.jboss.portal.portlet.controller.PortletController; import org.jboss.portal.portlet.controller.response.ControllerResponse; import org.jboss.portal.portlet.test.controller.Renderer; @@ -88,7 +87,7 @@ } else { - PageRenderer renderer =3D new PageRenderer(new ResponseProperties= (), new PageNavigationalState()); + PageRenderer renderer =3D new PageRenderer(new ResponseProperties= (), context.getStateControllerContext().createPageState()); = // renderer.render(context); --===============4356270173936299713==-- From portal-commits at lists.jboss.org Tue Feb 5 12:52:30 2008 Content-Type: multipart/mixed; boundary="===============8697208062368157694==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9781 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet: controller/event and 3 other directories. Date: Tue, 05 Feb 2008 12:52:29 -0500 Message-ID: --===============8697208062368157694== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-05 12:52:29 -0500 (Tue, 05 Feb 2008) New Revision: 9781 Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/MutablePageNavigationalState.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/event/EventControllerContextImpl.java Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/PortletRequestHandler.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/PortletResourceRequestHandler.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/state/MutablePageNavigationalState.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/state/PageNavigationalStateImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/state/StateControllerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/state/PageNavigationalState.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PageRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletControllerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletURLRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestPortletInvocationContext.java Log: use window id in PageNavigationalState instead of "Portlet" for the public = render parameter retrieval Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= controller/MutablePageNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/MutablePageNavigationalState.java 2008-02-05 17:17:28 UTC (rev 9780) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/MutablePageNavigationalState.java 2008-02-05 17:52:29 UTC (rev 9781) @@ -1,60 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.controller; - -import org.jboss.portal.portlet.controller.WindowNavigationalState; - -import javax.xml.namespace.QName; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -public class MutablePageNavigationalState extends PageNavigationalState -{ - - public MutablePageNavigationalState() - { - } - - public MutablePageNavigationalState(PageNavigationalState original) - { - super(original); - } - - public void setWindowNavigationalState(String windowId, WindowNavigatio= nalState windowNS) - { - windows.put(windowId, windowNS); - } - - public void setPublicNavigationalState(QName name, String[] value) - { - // We clone the value in order to keep the state not mutated by a si= de effect - page.put(name, value.clone()); - } - - public void removePublicNavigationalState(QName name) - { - page.remove(name); - } -} \ No newline at end of file Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/PortletRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletRequestHandler.java 2008-02-05 17:17:28 UTC (rev 9780) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletRequestHandler.java 2008-02-05 17:52:29 UTC (rev 9781) @@ -206,7 +206,7 @@ } = // - ParameterMap publicNS =3D pageState.getPublicNavigationalState(po= rtlet); + ParameterMap publicNS =3D pageState.getPublicNavigationalState(po= rtletRequest.getWindowId()); PortletInvocationContext portletInvocationContext =3D context.cre= atePortletInvocationContext(portletRequest.getWindowId(), pageState); ActionInvocation actionInvocation =3D new ActionInvocation(portle= tInvocationContext); = @@ -239,7 +239,7 @@ } = // - ParameterMap publicNS =3D pageState.getPublicNavigationalState(portl= et); + ParameterMap publicNS =3D pageState.getPublicNavigationalState(event= .getWindowId()); = // PortletInvocationContext portletInvocationContext =3D context.create= PortletInvocationContext(event.getWindowId(), pageState); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/PortletResourceRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletResourceRequestHandler.java 2008-02-05 17:17:28 UTC (rev 9780) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletResourceRequestHandler.java 2008-02-05 17:52:29 UTC (rev 9781) @@ -95,7 +95,7 @@ // if (pageState !=3D null) { - publicNS =3D pageState.getPublicNavigationalState(portlet); + publicNS =3D pageState.getPublicNavigationalState(portletRe= sourceRequest.getWindowId()); } } else Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= controller/event/EventControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/event/EventControllerContextImpl.java 2008-02-05 17:17:28 UTC (rev 97= 80) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/event/EventControllerContextImpl.java 2008-02-05 17:52:29 UTC (rev 97= 81) @@ -1,73 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.controller.event; - -import org.jboss.portal.portlet.PortletInvoker; -import org.jboss.portal.portlet.Portlet; -import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.info.PortletInfo; - -import java.util.List; -import java.util.Collections; -import java.util.ArrayList; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class EventControllerContextImpl implements EventControllerContext -{ - - /** . */ - private PortletInvoker invoker; - - public EventControllerContextImpl(PortletInvoker invoker) - { - this.invoker =3D invoker; - } - - public List getConsumedEvents(Event producedEvent) - { - try - { - ArrayList consumedEvents =3D new ArrayList(); - for (Portlet portlet : invoker.getPortlets()) - { - PortletInfo portletInfo =3D portlet.getInfo(); - if (portletInfo.getEventing().getConsumedEvents().containsKey(= producedEvent.getName())) - { - Event consumedEvent =3D new Event(producedEvent.getName(), = producedEvent.getPayload(), portlet.getContext().getId()); - consumedEvents.add(consumedEvent); - } - } - return consumedEvents; - } - catch (PortletInvokerException e) - { - System.out.println("e =3D " + e); - - // - return Collections.emptyList(); - } - } -} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/impl/state/MutablePageNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/MutablePageNavigationalState.java 2008-02-05 17:17:28 UTC = (rev 9780) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/MutablePageNavigationalState.java 2008-02-05 17:52:29 UTC = (rev 9781) @@ -33,8 +33,9 @@ class MutablePageNavigationalState extends PageNavigationalStateImpl { = - public MutablePageNavigationalState() + MutablePageNavigationalState(StateControllerContextImpl context) { + super(context); } = public MutablePageNavigationalState(PageNavigationalStateImpl original) Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/impl/state/PageNavigationalStateImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/PageNavigationalStateImpl.java 2008-02-05 17:17:28 UTC (re= v 9780) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/PageNavigationalStateImpl.java 2008-02-05 17:52:29 UTC (re= v 9781) @@ -27,18 +27,12 @@ import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; +import org.jboss.portal.portlet.PortletInvokerException; = import javax.xml.namespace.QName; import java.util.Map; import java.util.HashMap; -import java.util.zip.GZIPOutputStream; -import java.util.zip.GZIPInputStream; import java.io.Serializable; -import java.io.ObjectOutputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.ByteArrayInputStream; -import java.io.ObjectInputStream; = /** * @author Julien Viet @@ -47,20 +41,25 @@ class PageNavigationalStateImpl implements PageNavigationalState, Serializ= able { = + /** We don't save it. */ + protected transient StateControllerContextImpl context; + /** . */ protected final Map windows; = /** . */ protected final Map page; = - public PageNavigationalStateImpl() + public PageNavigationalStateImpl(StateControllerContextImpl context) { + this.context =3D context; this.windows =3D new HashMap(); this.page =3D new HashMap(); } = public PageNavigationalStateImpl(PageNavigationalStateImpl original) { + this.context =3D original.context; this.windows =3D new HashMap(origin= al.windows); this.page =3D new HashMap(original.page); } @@ -70,28 +69,36 @@ return windows.get(windowId); } = - public ParameterMap getPublicNavigationalState(PortletInfo portlet) + public ParameterMap getPublicNavigationalState(String windowId) { ParameterMap publicNavigationalState =3D null; - for (ParameterInfo parameterInfo : portlet.getNavigation().getPublic= Parameters()) + try { - String[] parameterValue =3D page.get(parameterInfo.getName()); - - // - if (parameterValue !=3D null) + PortletInfo info =3D context.portletControllerContext.getPortletI= nfo(windowId); + for (ParameterInfo parameterInfo : info.getNavigation().getPublic= Parameters()) { - String parameterId =3D parameterInfo.getId(); + String[] parameterValue =3D page.get(parameterInfo.getName()); = - // Lazy create - if (publicNavigationalState =3D=3D null) + // + if (parameterValue !=3D null) { - publicNavigationalState =3D new ParameterMap(); + String parameterId =3D parameterInfo.getId(); + + // Lazy create + if (publicNavigationalState =3D=3D null) + { + publicNavigationalState =3D new ParameterMap(); + } + + // We clone the value here so we keep the internal state no= t potentially changed + publicNavigationalState.put(parameterId, parameterValue.clo= ne()); } - - // We clone the value here so we keep the internal state not p= otentially changed - publicNavigationalState.put(parameterId, parameterValue.clone(= )); } } + catch (PortletInvokerException e) + { + e.printStackTrace(); + } = // return publicNavigationalState; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/impl/state/StateControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/StateControllerContextImpl.java 2008-02-05 17:17:28 UTC (r= ev 9780) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/StateControllerContextImpl.java 2008-02-05 17:52:29 UTC (r= ev 9781) @@ -24,6 +24,7 @@ = import org.jboss.portal.portlet.controller.state.StateControllerContext; import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.PortletControllerContext; = import java.io.IOException; import java.io.ByteArrayOutputStream; @@ -40,6 +41,14 @@ public class StateControllerContextImpl implements StateControllerContext { = + /** . */ + protected final PortletControllerContext portletControllerContext; + + public StateControllerContextImpl(PortletControllerContext portletContr= ollerContext) + { + this.portletControllerContext =3D portletControllerContext; + } + public PageNavigationalState clonePageState(PageNavigationalState pageS= tate) { return new MutablePageNavigationalState((PageNavigationalStateImpl)p= ageState); @@ -47,10 +56,10 @@ = public PageNavigationalState createPageState() { - return new MutablePageNavigationalState(); + return new MutablePageNavigationalState(this); } = - public static byte[] serialize(PageNavigationalState object) throws IOE= xception + public byte[] serialize(PageNavigationalState object) throws IOException { ByteArrayOutputStream baos =3D new ByteArrayOutputStream(); GZIPOutputStream zos =3D new GZIPOutputStream(baos); @@ -60,11 +69,13 @@ return baos.toByteArray(); } = - public static PageNavigationalState unserialize(byte[] bytes) throws IO= Exception, ClassNotFoundException + public PageNavigationalState unserialize(byte[] bytes) throws IOExcepti= on, ClassNotFoundException { ByteArrayInputStream bais =3D new ByteArrayInputStream(bytes); GZIPInputStream zis =3D new GZIPInputStream(bais); ObjectInputStream ois =3D new ObjectInputStream(zis); - return (PageNavigationalState)ois.readObject(); + PageNavigationalStateImpl state =3D (PageNavigationalStateImpl)ois.r= eadObject(); + state.context =3D this; + return state; } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/state/PageNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/PageNavigationalState.java 2008-02-05 17:17:28 UTC (rev 9780) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/PageNavigationalState.java 2008-02-05 17:52:29 UTC (rev 9781) @@ -36,7 +36,7 @@ = WindowNavigationalState getWindowNavigationalState(String windowId); = - ParameterMap getPublicNavigationalState(PortletInfo portlet); + ParameterMap getPublicNavigationalState(String windowId); = void setWindowNavigationalState(String windowId, WindowNavigationalStat= e windowNS) throws UnsupportedOperationException; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PageRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PageRenderer.java 2008-02-05 17:17:28 UTC (rev 9780) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PageRenderer.java 2008-02-05 17:52:29 UTC (rev 9781) @@ -169,7 +169,7 @@ } = // - ParameterMap publicNS =3D pageState.getPublicNavigationalState= (portlet.getInfo()); + ParameterMap publicNS =3D pageState.getPublicNavigationalState= (portlet.getContext().getId()); = RenderInvocation render =3D createRenderInvocation(context, pr= operties, pageState, portlet, windowNS, mode, windowState, portletNS, publi= cNS); = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContextImpl.java 2008-02-05 17:17:28 UTC (rev 9= 780) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContextImpl.java 2008-02-05 17:52:29 UTC (rev 9= 781) @@ -113,7 +113,7 @@ private final EventControllerContext eventControllerContext; = /** . */ - private final StateControllerContext stateControllerContext; + private final StateControllerContextImpl stateControllerContext; = public PortletControllerContextImpl( HttpServletRequest req, @@ -123,6 +123,9 @@ { PortletInvoker invoker =3D (PortletInvoker)servletContext.getAttribu= te("ConsumerPortletInvoker"); = + // + StateControllerContextImpl tmp =3D new StateControllerContextImpl(th= is); + // The nav state provided with the request PageNavigationalState pageState =3D null; = @@ -144,7 +147,7 @@ if (context !=3D null) { byte[] bytes =3D Tools.fromHexString(context); - pageState =3D StateControllerContextImpl.unserialize(bytes); + pageState =3D tmp.unserialize(bytes); } = // @@ -265,7 +268,7 @@ this.servletContext =3D servletContext; this.invoker =3D invoker; this.eventControllerContext =3D new EventControllerContextImpl(invok= er); - this.stateControllerContext =3D new StateControllerContextImpl(); + this.stateControllerContext =3D tmp; } = public ControllerRequest getRequest() @@ -320,7 +323,7 @@ = public String renderURL(String windowId, PageNavigationalState pageStat= e, ContainerURL containerURL, Boolean wantSecure, Boolean wantAuthenticated= , boolean relative) { - PortletURLRenderer renderer =3D new PortletURLRenderer(pageState, wi= ndowId, req, resp); + PortletURLRenderer renderer =3D new PortletURLRenderer(stateControll= erContext, pageState, windowId, req, resp); = // return renderer.renderURL(containerURL, wantSecure, wantAuthenticate= d, relative); @@ -385,6 +388,6 @@ = public PortletInvocationContext createPortletInvocationContext(String w= indowId, PageNavigationalState pageState) { - return new TestPortletInvocationContext(req, resp, windowId, pageSta= te, MARKUP_INFO); + return new TestPortletInvocationContext(stateControllerContext, req,= resp, windowId, pageState, MARKUP_INFO); } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletURLRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-05 17:17:28 UTC (rev 9780) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-05 17:52:29 UTC (rev 9781) @@ -52,6 +52,9 @@ { = /** . */ + final StateControllerContextImpl stateContext; + + /** . */ final String windowId; = /** . */ @@ -64,11 +67,13 @@ final PageNavigationalState pageNS; = public PortletURLRenderer( + StateControllerContextImpl stateContext, = PageNavigationalState pageNS, String windowId, HttpServletRequest clientReq, HttpServletResponse clientResp) { + this.stateContext =3D stateContext; this.pageNS =3D pageNS; this.windowId =3D windowId; this.clientReq =3D clientReq; @@ -114,7 +119,7 @@ String pageState; try { - byte[] bytes =3D StateControllerContextImpl.serialize(pageNS); + byte[] bytes =3D stateContext.serialize(pageNS); pageState =3D Tools.toHexString(bytes); } catch (IOException e) Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/TestPortletInvocationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvocationContext.java 2008-02-05 17:17:28 UTC (rev 9= 780) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvocationContext.java 2008-02-05 17:52:29 UTC (rev 9= 781) @@ -24,6 +24,7 @@ = import org.jboss.portal.portlet.ContainerURL; import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; import org.jboss.portal.portlet.test.controller.PortletURLRenderer; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext; @@ -42,6 +43,9 @@ { = /** . */ + private final StateControllerContextImpl stateContext; + + /** . */ private final PortletURLRenderer urlRenderer; = /** . */ @@ -57,6 +61,7 @@ private final HttpServletResponse clientResponse; = public TestPortletInvocationContext( + StateControllerContextImpl stateContext, HttpServletRequest clientRequest, HttpServletResponse clientResponse, String windowId, @@ -66,11 +71,12 @@ super(markupInfo); = // + this.stateContext =3D stateContext; this.clientRequest =3D clientRequest; this.clientResponse =3D clientResponse; this.windowId =3D windowId; this.pageState =3D pageState; - this.urlRenderer =3D new PortletURLRenderer(pageState, windowId, cli= entRequest, clientResponse); + this.urlRenderer =3D new PortletURLRenderer(stateContext, pageState,= windowId, clientRequest, clientResponse); = // addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttribut= eResolver(clientRequest)); --===============8697208062368157694==-- From portal-commits at lists.jboss.org Tue Feb 5 13:14:57 2008 Content-Type: multipart/mixed; boundary="===============1485491594212967629==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9782 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller: impl/state and 1 other directories. Date: Tue, 05 Feb 2008 13:14:57 -0500 Message-ID: --===============1485491594212967629== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-05 13:14:56 -0500 (Tue, 05 Feb 2008) New Revision: 9782 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/PortletRequestHandler.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/state/MutablePageNavigationalState.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/state/PageNavigationalStateImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/state/PageNavigationalState.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/state/StateControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/state/WindowNavigationalState.java Log: - now delegates the update of public nav state of a window to the context b= ecause it can have several interpretations/implementations Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/PortletRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletRequestHandler.java 2008-02-05 17:52:29 UTC (rev 9781) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletRequestHandler.java 2008-02-05 18:14:56 UTC (rev 9782) @@ -10,8 +10,6 @@ import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.spi.PortletInvocationContext; -import org.jboss.portal.portlet.info.NavigationInfo; -import org.jboss.portal.portlet.info.ParameterInfo; import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.invocation.ActionInvocation; import org.jboss.portal.portlet.invocation.EventInvocation; @@ -35,7 +33,6 @@ import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.xml.namespace.QName; import java.io.IOException; import java.util.LinkedList; import java.util.List; @@ -298,27 +295,7 @@ Map publicNS =3D update.getPublicNavigationalState= Updates(); if (publicNS !=3D null) { - NavigationInfo navigationInfo =3D portlet.getNavigation(); - for (Map.Entry entry : publicNS.entrySet()) - { - String id =3D entry.getKey(); - ParameterInfo parameterInfo =3D navigationInfo.getPublicParame= ter(id); - - // - if (parameterInfo !=3D null) - { - QName name =3D parameterInfo.getName(); - String[] value =3D entry.getValue(); - if (value.length > 0) - { - pageState.setPublicNavigationalState(name, value); - } - else - { - pageState.removePublicNavigationalState(name); - } - } - } + pageState.setPublicNavigationalState(windowId, publicNS); } } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/impl/state/MutablePageNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/MutablePageNavigationalState.java 2008-02-05 17:52:29 UTC = (rev 9781) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/MutablePageNavigationalState.java 2008-02-05 18:14:56 UTC = (rev 9782) @@ -23,8 +23,13 @@ package org.jboss.portal.portlet.controller.impl.state; = import org.jboss.portal.portlet.controller.state.WindowNavigationalState; +import org.jboss.portal.portlet.info.NavigationInfo; +import org.jboss.portal.portlet.info.ParameterInfo; +import org.jboss.portal.portlet.info.PortletInfo; +import org.jboss.portal.portlet.PortletInvokerException; = import javax.xml.namespace.QName; +import java.util.Map; = /** * @author Julien Viet @@ -43,11 +48,47 @@ super(original); } = - public void setWindowNavigationalState(String windowId, WindowNavigatio= nalState windowNS) + public void setWindowNavigationalState(String windowId, WindowNavigatio= nalState windowState) { - windows.put(windowId, windowNS); + windows.put(windowId, windowState); } = + public void setPublicNavigationalState(String windowId, Map update) + { + try + { + PortletInfo info =3D context.portletControllerContext.getPortletI= nfo(windowId); + + NavigationInfo navigationInfo =3D info.getNavigation(); + for (Map.Entry entry : update.entrySet()) + { + String id =3D entry.getKey(); + + // + ParameterInfo parameterInfo =3D navigationInfo.getPublicParame= ter(id); + + // + if (parameterInfo !=3D null) + { + QName name =3D parameterInfo.getName(); + String[] value =3D entry.getValue(); + if (value.length > 0) + { + setPublicNavigationalState(name, value); + } + else + { + removePublicNavigationalState(name); + } + } + } + } + catch (PortletInvokerException e) + { + e.printStackTrace(); + } + } + public void setPublicNavigationalState(QName name, String[] value) { // We clone the value in order to keep the state not mutated by a si= de effect Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/impl/state/PageNavigationalStateImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/PageNavigationalStateImpl.java 2008-02-05 17:52:29 UTC (re= v 9781) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/PageNavigationalStateImpl.java 2008-02-05 18:14:56 UTC (re= v 9782) @@ -104,11 +104,16 @@ return publicNavigationalState; } = - public void setWindowNavigationalState(String windowId, WindowNavigatio= nalState windowNS) throws UnsupportedOperationException + public void setWindowNavigationalState(String windowId, WindowNavigatio= nalState windowState) throws UnsupportedOperationException { throw new UnsupportedOperationException(); } = + public void setPublicNavigationalState(String windowId, Map update) + { + throw new UnsupportedOperationException(); + } + public void setPublicNavigationalState(QName name, String[] value) thro= ws UnsupportedOperationException { throw new UnsupportedOperationException(); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/state/PageNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/PageNavigationalState.java 2008-02-05 17:52:29 UTC (rev 9781) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/PageNavigationalState.java 2008-02-05 18:14:56 UTC (rev 9782) @@ -23,24 +23,55 @@ package org.jboss.portal.portlet.controller.state; = import org.jboss.portal.common.util.ParameterMap; -import org.jboss.portal.portlet.info.PortletInfo; = -import javax.xml.namespace.QName; +import java.util.Map; = /** + * Defines the page navigational state that the controller needs. + * * @author Julien Viet * @version $Revision: 1.1 $ */ public interface PageNavigationalState { = + /** + * Returns the navigational state of a window or null if it does not ex= ist. + * + * @param windowId the window + * @return the window navigational state + */ WindowNavigationalState getWindowNavigationalState(String windowId); = + /** + * Update the navigational state of a window. + * + * @param windowId the window id + * @param windowState the window state + * @throws UnsupportedOperationException if the page state is read only + */ + void setWindowNavigationalState(String windowId, WindowNavigationalStat= e windowState) throws UnsupportedOperationException; + + /** + * Obtain the public navigational state of a window. The interpretation= of what should + * be retrieved is left up to the implementor. An example of implementa= tion would use the mapping + * between qnames and name provided by the referenced portlet info. + * + * @param windowId the window id + * @return the public navigational state + */ ParameterMap getPublicNavigationalState(String windowId); = - void setWindowNavigationalState(String windowId, WindowNavigationalStat= e windowNS) throws UnsupportedOperationException; - - void setPublicNavigationalState(QName name, String[] value) throws Unsu= pportedOperationException; - - void removePublicNavigationalState(QName name) throws UnsupportedOperat= ionException; + /** + * Update the public navigational state of a window. The interpretation= of what should be updated + * is left up to the implementor. An example of implementation would us= e the mapping + * between qname and name provided by the referenced portlet info. + * + * The update argument values with a length of zero should be treated a= s removals. + * + * @param windowId the window id + * @param update the updates + * @throws UnsupportedOperationException if the page state is read only + */ + void setPublicNavigationalState(String windowId, Map = update) throws UnsupportedOperationException; } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/state/StateControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/StateControllerContext.java 2008-02-05 17:52:29 UTC (rev 9781) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/StateControllerContext.java 2008-02-05 18:14:56 UTC (rev 9782) @@ -23,14 +23,27 @@ package org.jboss.portal.portlet.controller.state; = /** + * The context used by the controller to manage state. + * * @author Julien Viet * @version $Revision: 630 $ */ public interface StateControllerContext { = + /** + * Clone an existing page state object. + * + * @param pageState the page state to clone + * @return the page state clone + */ PageNavigationalState clonePageState(PageNavigationalState pageState); = + /** + * Create a new page state object. + * + * @return the new page state + */ PageNavigationalState createPageState(); = } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/state/WindowNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/WindowNavigationalState.java 2008-02-05 17:52:29 UTC (rev 9781) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/WindowNavigationalState.java 2008-02-05 18:14:56 UTC (rev 9782) @@ -29,6 +29,8 @@ import java.io.Serializable; = /** + * The navigational state of a window that contains the portlet navigation= al state, the mode and window state. + * * @author Julien Viet * @version $Revision: 1.1 $ */ --===============1485491594212967629==-- From portal-commits at lists.jboss.org Tue Feb 5 13:17:47 2008 Content-Type: multipart/mixed; boundary="===============5061199952487462210==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9783 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller. Date: Tue, 05 Feb 2008 13:17:46 -0500 Message-ID: --===============5061199952487462210== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-05 13:17:46 -0500 (Tue, 05 Feb 2008) New Revision: 9783 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/PortletRequestHandler.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/PortletResourceRequestHandler.java Log: remove a bit of non used code Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/PortletRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletRequestHandler.java 2008-02-05 18:14:56 UTC (rev 9782) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletRequestHandler.java 2008-02-05 18:17:46 UTC (rev 9783) @@ -10,7 +10,6 @@ import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.spi.PortletInvocationContext; -import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.invocation.ActionInvocation; import org.jboss.portal.portlet.invocation.EventInvocation; import org.jboss.portal.portlet.invocation.response.ErrorResponse; @@ -31,8 +30,6 @@ import org.jboss.portal.portlet.controller.state.StateControllerContext; = import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.LinkedList; import java.util.List; @@ -162,9 +159,6 @@ PortletInvocationResponse invoke(PortletRequest portletRequest) throws = PortletInvokerException { PortletControllerContext context =3D portletRequest.getControllerCon= text(); - PortletInfo portlet =3D context.getPortletInfo(portletRequest.getWin= dowId()); - HttpServletRequest req =3D context.getClientRequest(); - HttpServletResponse resp =3D context.getClientResponse(); = // if (portletRequest instanceof PortletRenderRequest) @@ -224,9 +218,6 @@ PageNavigationalState pa= geState, List requestCookies) throws PortletInvokerException { - PortletInfo portlet =3D context.getPortletInfo(event.getWindowId()); - HttpServletRequest req =3D context.getClientRequest(); - HttpServletResponse resp =3D context.getClientResponse(); WindowNavigationalState windowNS =3D pageState.getWindowNavigational= State(event.getWindowId()); = // @@ -261,9 +252,6 @@ PageNavigationalState pageState) throws PortletInvokerException { - PortletInfo portlet =3D context.getPortletInfo(windowId); - - // WindowNavigationalState windowNS =3D pageState.getWindowNavigational= State(windowId); = // Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/PortletResourceRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletResourceRequestHandler.java 2008-02-05 18:14:56 UTC (rev 9782) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletResourceRequestHandler.java 2008-02-05 18:17:46 UTC (rev 9783) @@ -29,7 +29,6 @@ import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.spi.PortletInvocationContext; -import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.cache.CacheLevel; import org.jboss.portal.portlet.invocation.ResourceInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; @@ -41,8 +40,6 @@ import org.jboss.portal.portlet.controller.response.ResourceResponse; import org.jboss.portal.portlet.controller.state.PageNavigationalState; = -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import java.io.IOException; = /** @@ -73,9 +70,6 @@ CacheLevel cacheability; = PortletControllerContext context =3D portletResourceRequest.getContr= ollerContext(); - PortletInfo portlet =3D context.getPortletInfo(portletResourceReques= t.getWindowId()); - HttpServletRequest req =3D context.getClientRequest(); - HttpServletResponse resp =3D context.getClientResponse(); = // if (portletResourceRequest instanceof PortletScopedPortletResourceRe= quest) --===============5061199952487462210==-- From portal-commits at lists.jboss.org Tue Feb 5 13:18:57 2008 Content-Type: multipart/mixed; boundary="===============4510084317471289558==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9784 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller. Date: Tue, 05 Feb 2008 13:18:56 -0500 Message-ID: --===============4510084317471289558== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-05 13:18:56 -0500 (Tue, 05 Feb 2008) New Revision: 9784 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/PortletController.java Log: removed a done todo Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/PortletController.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletController.java 2008-02-05 18:17:46 UTC (rev 9783) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletController.java 2008-02-05 18:18:56 UTC (rev 9784) @@ -41,8 +41,6 @@ * - produce new events (what exists today) * - make it a portal event which delivers the event to the portal * - * 3/ delegate public render parameter wiring to the context - * * @author Julien Viet * @version $Revision: 1.1 $ */ --===============4510084317471289558==-- From portal-commits at lists.jboss.org Tue Feb 5 16:10:46 2008 Content-Type: multipart/mixed; boundary="===============3862077992483343216==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9785 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller. Date: Tue, 05 Feb 2008 16:10:46 -0500 Message-ID: --===============3862077992483343216== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-05 16:10:46 -0500 (Tue, 05 Feb 2008) New Revision: 9785 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/SimpleFragmentRenderer.java Log: - Fixed incorrect implementation of renderError Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/SimpleFragmentRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/SimpleFragmentRenderer.java 2008-02-05 18:18:56 UTC (rev 9784) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/SimpleFragmentRenderer.java 2008-02-05 21:10:46 UTC (rev 9785) @@ -62,7 +62,7 @@ public String renderError(ErrorResponse error) { String html =3D error.toHTML(); - StringBuilder builder =3D new StringBuilder(html + 50); + StringBuilder builder =3D new StringBuilder(html.length() + 50); builder.append("
").append(html).append("
"= ); return builder.toString(); } --===============3862077992483343216==-- From portal-commits at lists.jboss.org Tue Feb 5 16:52:39 2008 Content-Type: multipart/mixed; boundary="===============4406566152794816775==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9786 - in modules/portlet/trunk/test/src: test and 5 other directories. Date: Tue, 05 Feb 2008 16:52:39 -0500 Message-ID: --===============4406566152794816775== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/GoogleClippingPortlet.java 2008-02-05 21:10:46 UTC (rev 9785) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/GoogleClippingPortlet.java 2008-02-05 21:52:39 UTC (rev 9786) @@ -50,18 +50,14 @@ { protected static final String A =3D "Zip Code:
\n" + - " \n" + + " \n" + "
\n" + " \n" + " \n" + Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 @@ - + @@ -202,7 +202,7 @@ = = - + @@ -460,13 +460,13 @@ = = - + - - - + + + = @@ -579,10 +579,10 @@ = = - - - - + + + + = --> - + = @@ -687,7 +687,6 @@ = - = @@ -749,10 +748,25 @@ = = + = - + + + + + + + + = + + + + + + + + + \ No newline at end of file Added: modules/portlet/trunk/test/src/test/resources/google-map-portlet-war= /WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WE= B-INF/portlet.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WE= B-INF/portlet.xml 2008-02-05 21:52:39 UTC (rev 9786) @@ -0,0 +1,43 @@ + + + + + GoogleMap + org.jboss.portal.simple.samples.GoogleClippingPortlet= + + text/html + + g:zipcode + + + + zipcode + g:zipcode + + + + Added: modules/portlet/trunk/test/src/test/resources/google-map-portlet-war= /WEB-INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WE= B-INF/web.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WE= B-INF/web.xml 2008-02-05 21:52:39 UTC (rev 9786) @@ -0,0 +1,27 @@ + + + + + Added: modules/portlet/trunk/test/src/test/resources/google-weather-portlet= -war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/google-weather-portlet-wa= r/WEB-INF/portlet.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/google-weather-portlet-wa= r/WEB-INF/portlet.xml 2008-02-05 21:52:39 UTC (rev 9786) @@ -0,0 +1,43 @@ + + + + + GoogleWeather + org.jboss.portal.simple.samples.GoogleWeatherClipping= Portlet + + text/html + + g:zipcode + + + + zipcode + g:zipcode + + + + Added: modules/portlet/trunk/test/src/test/resources/google-weather-portlet= -war/WEB-INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/google-weather-portlet-wa= r/WEB-INF/web.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/google-weather-portlet-wa= r/WEB-INF/web.xml 2008-02-05 21:52:39 UTC (rev 9786) @@ -0,0 +1,28 @@ + + + + + + --===============4406566152794816775==-- From portal-commits at lists.jboss.org Tue Feb 5 16:59:47 2008 Content-Type: multipart/mixed; boundary="===============6689395982175598487==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9787 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet: controller/event and 10 other directories. Date: Tue, 05 Feb 2008 16:59:47 -0500 Message-ID: --===============6689395982175598487== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-05 16:59:46 -0500 (Tue, 05 Feb 2008) New Revision: 9787 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/PortletController.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/PortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/PortletRequestHandler.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/RequestHandler.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/event/Event.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/event/EventControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/event/EventControllerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/state/MutablePageNavigationalState.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/state/PageNavigationalStateImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/state/StateControllerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/ContainerRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/ControllerRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/FullScopedCacheablePortletResourceRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/PageScopedFullPortletResourceRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/PortletActionRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/PortletRenderRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/PortletRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/PortletResourceRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/request/PortletScopedPortletResourceRequest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/response/PageUpdateResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/response/PortletResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/state/PageNavigationalState.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/state/StateControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/state/WindowNavigationalState.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/I= nterceptorStackFactoryImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortalServlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletApplicationDeployer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletApplicationDeployment.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletUtilsTestCase.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/S= tringCodec.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/S= tringCodecTestCase.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/U= RLParameterConstants.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/AbstractMarkupRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/ControllerResponseRendererFactory.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/ErrorResponseRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletControllerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletURLRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/RedirectResponseRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/Renderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/ResourceRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestInstanceContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestPortalContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestPortletInvocationContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestPortletInvoker.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/m= etadata/factory/LocalizedStringBuilder.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/m= etadata/factory/PortletApplicationModelFactory.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/m= etadata/impl/AnnotationPortletApplication10MetaData.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/m= etadata/impl/AnnotationPortletApplication20MetaData.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/m= etadata/impl/PortletApplicationMetaDataException.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/m= etadata/impl/ValueTrimmingFilter.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/u= rl/CodecBuilder.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/u= rl/ParameterDecoder.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/u= rl/ParameterEncoder.java Log: - Update copyright... Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/PortletController.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletController.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletController.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -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.portlet.controller; = import org.jboss.portal.portlet.PortletInvokerException; @@ -31,16 +32,15 @@ import java.io.IOException; = /** - * The portlet controller which handles the page state management and the = interactions between - * the action phase and the event phase. It really only does that and not = more. - * + * The portlet controller which handles the page state management and the = interactions between the action phase and the + * event phase. It really only does that and not more. + *

* 1/ introduce EventRequest so the portal can send events directly to a p= ortlet + *

+ * 2/ make the event controller return a decision for a given event. Today= it just returns a list of events to process. + * An event can be handled in various manners by the controller: - produce= new events (what exists today) - make it a + * portal event which delivers the event to the portal * - * 2/ make the event controller return a decision for a given event. Toda= y it just returns a list - * of events to process. An event can be handled in various manners by th= e controller: - * - produce new events (what exists today) - * - make it a portal event which delivers the event to the portal - * * @author Julien Viet * @version $Revision: 1.1 $ */ Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/PortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletControllerContext.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletControllerContext.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -23,20 +23,20 @@ package org.jboss.portal.portlet.controller; = import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.spi.PortletInvocationContext; +import org.jboss.portal.portlet.controller.event.EventControllerContext; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.StateControllerContext; import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.invocation.ActionInvocation; import org.jboss.portal.portlet.invocation.EventInvocation; import org.jboss.portal.portlet.invocation.ResourceInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.controller.event.EventControllerContext; -import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.controller.state.StateControllerContext; +import org.jboss.portal.portlet.spi.PortletInvocationContext; = import javax.servlet.ServletContext; +import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.Cookie; import java.util.List; = /** Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/PortletRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletRequestHandler.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletRequestHandler.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,25 @@ -/* - * Copyright (c) 2008, Your Corporation. All Rights Reserved. - */ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ = package org.jboss.portal.portlet.controller; = @@ -9,13 +28,6 @@ import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.spi.PortletInvocationContext; -import org.jboss.portal.portlet.invocation.ActionInvocation; -import org.jboss.portal.portlet.invocation.EventInvocation; -import org.jboss.portal.portlet.invocation.response.ErrorResponse; -import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.invocation.response.ResponseProperties; -import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStat= eResponse; import org.jboss.portal.portlet.controller.event.Event; import org.jboss.portal.portlet.controller.event.EventControllerContext; import org.jboss.portal.portlet.controller.request.ControllerRequest; @@ -26,8 +38,15 @@ import org.jboss.portal.portlet.controller.response.PageUpdateResponse; import org.jboss.portal.portlet.controller.response.PortletResponse; import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.StateControllerContext; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; -import org.jboss.portal.portlet.controller.state.StateControllerContext; +import org.jboss.portal.portlet.invocation.ActionInvocation; +import org.jboss.portal.portlet.invocation.EventInvocation; +import org.jboss.portal.portlet.invocation.response.ErrorResponse; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.response.ResponseProperties; +import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStat= eResponse; +import org.jboss.portal.portlet.spi.PortletInvocationContext; = import javax.servlet.http.Cookie; import java.io.IOException; @@ -248,7 +267,7 @@ private void updateNavigationalState( PortletControllerContext context, String windowId, - UpdateNavigationalStateResponse update, = + UpdateNavigationalStateResponse update, PageNavigationalState pageState) throws PortletInvokerException { Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/RequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/RequestHandler.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/RequestHandler.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,25 @@ -/* - * Copyright (c) 2008, Your Corporation. All Rights Reserved. - */ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ = package org.jboss.portal.portlet.controller; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/event/Event.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/event/Event.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/event/Event.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/event/EventControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/event/EventControllerContext.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/event/EventControllerContext.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -37,6 +37,6 @@ * @param producedEvent the produced event * @return the list of event to be consumed */ - List getConsumedEvents(Event producedEvent); = + List getConsumedEvents(Event producedEvent); = } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/impl/event/EventControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/event/EventControllerContextImpl.java 2008-02-05 21:52:39 UTC (r= ev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/event/EventControllerContextImpl.java 2008-02-05 21:59:46 UTC (r= ev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -22,16 +22,16 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.controller.impl.event; = +import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletInvoker; -import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.controller.event.Event; import org.jboss.portal.portlet.controller.event.EventControllerContext; -import org.jboss.portal.portlet.controller.event.Event; import org.jboss.portal.portlet.info.PortletInfo; = +import java.util.ArrayList; +import java.util.Collections; import java.util.List; -import java.util.Collections; -import java.util.ArrayList; = /** * @author Julien Viet Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/impl/state/MutablePageNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/MutablePageNavigationalState.java 2008-02-05 21:52:39 UTC = (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/MutablePageNavigationalState.java 2008-02-05 21:59:46 UTC = (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -22,11 +22,11 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.controller.impl.state; = +import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; import org.jboss.portal.portlet.info.NavigationInfo; import org.jboss.portal.portlet.info.ParameterInfo; import org.jboss.portal.portlet.info.PortletInfo; -import org.jboss.portal.portlet.PortletInvokerException; = import javax.xml.namespace.QName; import java.util.Map; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/impl/state/PageNavigationalStateImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/PageNavigationalStateImpl.java 2008-02-05 21:52:39 UTC (re= v 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/PageNavigationalStateImpl.java 2008-02-05 21:59:46 UTC (re= v 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -23,16 +23,16 @@ package org.jboss.portal.portlet.controller.impl.state; = import org.jboss.portal.common.util.ParameterMap; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; import org.jboss.portal.portlet.info.ParameterInfo; import org.jboss.portal.portlet.info.PortletInfo; -import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.controller.state.WindowNavigationalState; -import org.jboss.portal.portlet.PortletInvokerException; = import javax.xml.namespace.QName; +import java.io.Serializable; +import java.util.HashMap; import java.util.Map; -import java.util.HashMap; -import java.io.Serializable; = /** * @author Julien Viet Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/impl/state/StateControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/StateControllerContextImpl.java 2008-02-05 21:52:39 UTC (r= ev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/StateControllerContextImpl.java 2008-02-05 21:59:46 UTC (r= ev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -22,17 +22,17 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.controller.impl.state; = +import org.jboss.portal.portlet.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.StateControllerContext; -import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.controller.PortletControllerContext; = +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; import java.io.ObjectOutputStream; -import java.io.ByteArrayInputStream; -import java.io.ObjectInputStream; +import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; -import java.util.zip.GZIPInputStream; = /** * @author Julien Viet Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/ContainerRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/ContainerRequest.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/ContainerRequest.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/ControllerRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/ControllerRequest.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/ControllerRequest.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/FullScopedCacheablePortletResourceRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/FullScopedCacheablePortletResourceRequest.java 2008-02-05 21:= 52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/FullScopedCacheablePortletResourceRequest.java 2008-02-05 21:= 59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -22,9 +22,9 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.controller.request; = +import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.controller.PortletControllerContext; -import org.jboss.portal.common.util.ParameterMap; = /** * @author Julien Viet Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/PageScopedFullPortletResourceRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PageScopedFullPortletResourceRequest.java 2008-02-05 21:52:39= UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PageScopedFullPortletResourceRequest.java 2008-02-05 21:59:46= UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -22,11 +22,11 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.controller.request; = +import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; -import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.controller.PortletControllerContext; -import org.jboss.portal.common.util.ParameterMap; = /** * @author Julien Viet Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/PortletActionRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletActionRequest.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletActionRequest.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -22,11 +22,11 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.controller.request; = +import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.controller.state.WindowNavigationalState; import org.jboss.portal.portlet.controller.PortletControllerContext; import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.common.util.ParameterMap; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; = /** * @author Julien Viet Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/PortletRenderRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletRenderRequest.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletRenderRequest.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -22,9 +22,9 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.controller.request; = -import org.jboss.portal.portlet.controller.state.WindowNavigationalState; import org.jboss.portal.portlet.controller.PortletControllerContext; import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; = import java.util.Map; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/PortletRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletRequest.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletRequest.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -22,9 +22,9 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.controller.request; = +import org.jboss.portal.portlet.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; -import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.controller.PortletControllerContext; = /** * @author Julien Viet Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/PortletResourceRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletResourceRequest.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletResourceRequest.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -22,13 +22,13 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.controller.request; = +import org.jboss.portal.common.util.ParameterMap; +import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.cache.CacheLevel; -import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.controller.PortletControllerContext; -import org.jboss.portal.common.util.ParameterMap; = +import java.util.HashMap; import java.util.Map; -import java.util.HashMap; = /** * @author Julien Viet Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/request/PortletScopedPortletResourceRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletScopedPortletResourceRequest.java 2008-02-05 21:52:39 = UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/request/PortletScopedPortletResourceRequest.java 2008-02-05 21:59:46 = UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -22,10 +22,10 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.controller.request; = +import org.jboss.portal.common.util.ParameterMap; +import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.controller.PortletControllerContext; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; -import org.jboss.portal.portlet.controller.PortletControllerContext; -import org.jboss.portal.portlet.StateString; -import org.jboss.portal.common.util.ParameterMap; = /** * @author Julien Viet Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/response/PageUpdateResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/response/PageUpdateResponse.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/response/PageUpdateResponse.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -22,9 +22,9 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.controller.response; = +import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.invocation.response.ResponseProperties; import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStat= eResponse; -import org.jboss.portal.portlet.controller.state.PageNavigationalState; = /** * @author Julien Viet Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/response/PortletResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/response/PortletResponse.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/response/PortletResponse.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/state/PageNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/PageNavigationalState.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/PageNavigationalState.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -46,16 +46,16 @@ /** * Update the navigational state of a window. * - * @param windowId the window id + * @param windowId the window id * @param windowState the window state * @throws UnsupportedOperationException if the page state is read only */ void setWindowNavigationalState(String windowId, WindowNavigationalStat= e windowState) throws UnsupportedOperationException; = /** - * Obtain the public navigational state of a window. The interpretation= of what should - * be retrieved is left up to the implementor. An example of implementa= tion would use the mapping - * between qnames and name provided by the referenced portlet info. + * Obtain the public navigational state of a window. The interpretation= of what should be retrieved is left up to the + * implementor. An example of implementation would use the mapping betw= een qnames and name provided by the referenced + * portlet info. * * @param windowId the window id * @return the public navigational state @@ -63,14 +63,14 @@ ParameterMap getPublicNavigationalState(String windowId); = /** - * Update the public navigational state of a window. The interpretation= of what should be updated - * is left up to the implementor. An example of implementation would us= e the mapping - * between qname and name provided by the referenced portlet info. - * + * Update the public navigational state of a window. The interpretation= of what should be updated is left up to the + * implementor. An example of implementation would use the mapping betw= een qname and name provided by the referenced + * portlet info. + *

* The update argument values with a length of zero should be treated a= s removals. * * @param windowId the window id - * @param update the updates + * @param update the updates * @throws UnsupportedOperationException if the page state is read only */ void setPublicNavigationalState(String windowId, Map = update) throws UnsupportedOperationException; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/state/StateControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/StateControllerContext.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/StateControllerContext.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/state/WindowNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/WindowNavigationalState.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/WindowNavigationalState.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/InterceptorStackFactoryImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= InterceptorStackFactoryImpl.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= InterceptorStackFactoryImpl.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -22,8 +22,8 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test; = +import org.jboss.portal.common.invocation.Interceptor; import org.jboss.portal.common.invocation.InterceptorStack; -import org.jboss.portal.common.invocation.Interceptor; import org.jboss.portal.common.invocation.InterceptorStackFactory; = /** Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortalServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortalServlet.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortalServlet.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -22,14 +22,13 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test; = -import org.jboss.portal.portlet.controller.response.ControllerResponse; import org.jboss.portal.portlet.controller.PortletController; -import org.jboss.portal.portlet.test.controller.PortletControllerContextIm= pl; -import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.response.ControllerResponse; +import org.jboss.portal.portlet.invocation.response.ResponseProperties; import org.jboss.portal.portlet.test.controller.ControllerResponseRenderer= Factory; -import org.jboss.portal.portlet.test.controller.Renderer; import org.jboss.portal.portlet.test.controller.PageRenderer; -import org.jboss.portal.portlet.invocation.response.ResponseProperties; +import org.jboss.portal.portlet.test.controller.PortletControllerContextIm= pl; +import org.jboss.portal.portlet.test.controller.Renderer; = import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; @@ -81,7 +80,7 @@ ControllerResponse response =3D controller.process(context.getReq= uest()); = // - Renderer renderer =3D ControllerResponseRendererFactory.getRende= rer(response); + Renderer renderer =3D ControllerResponseRendererFactory.getRender= er(response); = // renderer.render(context); @@ -89,7 +88,7 @@ else { PageRenderer renderer =3D new PageRenderer(new ResponseProperties= (), context.getStateControllerContext().createPageState()); - = + // renderer.render(context); } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortletApplicationDeployer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployer.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployer.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortletApplicationDeployment.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployment.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployment.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -22,42 +22,42 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test; = +import org.apache.log4j.Logger; +import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; +import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; +import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; +import org.jboss.beans.metadata.plugins.AbstractInstallMetaData; +import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData; +import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; +import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; +import org.jboss.beans.metadata.plugins.ThisValueMetaData; +import org.jboss.beans.metadata.spi.InstallMetaData; +import org.jboss.beans.metadata.spi.ParameterMetaData; +import org.jboss.beans.metadata.spi.PropertyMetaData; +import org.jboss.dependency.spi.ControllerState; +import org.jboss.kernel.Kernel; +import org.jboss.kernel.spi.dependency.KernelController; +import org.jboss.kernel.spi.dependency.KernelControllerContext; +import org.jboss.portal.common.NotYetImplemented; +import org.jboss.portal.common.util.Tools; import org.jboss.portal.portlet.container.PortletApplicationContext; +import org.jboss.portal.portlet.impl.info.ContainerInfoBuilder; +import org.jboss.portal.portlet.impl.info.ContainerInfoBuilderContext; +import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo; +import org.jboss.portal.portlet.impl.info.ContainerPortletInfo; +import org.jboss.portal.portlet.impl.jsr168.ContainerInfoBuilderContextImp= l; import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl; import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl; -import org.jboss.portal.portlet.impl.jsr168.ContainerInfoBuilderContextImp= l; import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory; import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; -import org.jboss.portal.portlet.impl.info.ContainerPortletInfo; -import org.jboss.portal.portlet.impl.info.ContainerInfoBuilder; -import org.jboss.portal.portlet.impl.info.ContainerInfoBuilderContext; -import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo; import org.jboss.portal.portlet.metadata.JBossApplicationMetaData; import org.jboss.portal.web.WebApp; -import org.jboss.portal.common.util.Tools; -import org.jboss.portal.common.NotYetImplemented; -import org.jboss.kernel.Kernel; -import org.jboss.kernel.spi.dependency.KernelController; -import org.jboss.kernel.spi.dependency.KernelControllerContext; -import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; -import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; -import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; -import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; -import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData; -import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; -import org.jboss.beans.metadata.plugins.AbstractInstallMetaData; -import org.jboss.beans.metadata.plugins.ThisValueMetaData; -import org.jboss.beans.metadata.spi.PropertyMetaData; -import org.jboss.beans.metadata.spi.ParameterMetaData; -import org.jboss.beans.metadata.spi.InstallMetaData; -import org.jboss.dependency.spi.ControllerState; -import org.apache.log4j.Logger; = import javax.servlet.ServletContext; -import java.util.List; import java.util.ArrayList; import java.util.Collections; import java.util.LinkedHashMap; +import java.util.List; = /** * @author Julien Viet @@ -100,7 +100,7 @@ = void start() { - = + log.debug("Starting installation"); = // @@ -190,7 +190,7 @@ } catch (Throwable throwable) { - log.debug("Installation of bean " + beanName + " produced an = error", throwable); + log.debug("Installation of bean " + beanName + " produced an e= rror", throwable); } } = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortletUtilsTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletUtilsTestCase.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletUtilsTestCase.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,21 +1,44 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + package org.jboss.portal.portlet.test; = import org.jboss.portal.portlet.impl.jsr168.PortletUtils; +import static org.jboss.unit.api.Assert.assertEquals; = -import static org.jboss.unit.api.Assert.*; +public class PortletUtilsTestCase +{ = -public class PortletUtilsTestCase { + public void testgenerateNamespaceFrom() + { + String name =3D "_09azAZ$"; + assertEquals(PortletUtils.PREFIX + name + PortletUtils.SUFFIX, Portl= etUtils.generateNamespaceFrom(name)); = - public void testgenerateNamespaceFrom() - { - String name =3D "_09azAZ$"; - assertEquals(PortletUtils.PREFIX + name + PortletUtils.SUFFIX, PortletUt= ils.generateNamespaceFrom(name)); + name =3D "_"; + assertEquals(PortletUtils.PREFIX + "_" + PortletUtils.SUFFIX, Portle= tUtils.generateNamespaceFrom(name)); = - name =3D "_"; - assertEquals(PortletUtils.PREFIX + "_" + PortletUtils.SUFFIX, PortletUti= ls.generateNamespaceFrom(name)); + name =3D "_=C3=A9"; + assertEquals(PortletUtils.PREFIX + "__e9" + PortletUtils.SUFFIX, Por= tletUtils.generateNamespaceFrom(name)); + } = - name =3D "_=C3=A9"; - assertEquals(PortletUtils.PREFIX + "__e9" + PortletUtils.SUFFIX, Portlet= Utils.generateNamespaceFrom(name)); - } - = } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/StringCodec.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= StringCodec.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= StringCodec.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -22,14 +22,8 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test; = -import java.io.OutputStreamWriter; -import java.io.OutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; import java.io.ByteArrayOutputStream; -import java.nio.charset.Charset; -import java.nio.charset.CharsetEncoder; +import java.io.UnsupportedEncodingException; = /** * @author Julien Viet @@ -47,7 +41,7 @@ { StringBuffer buffer =3D new StringBuffer(); char[] tmp =3D new char[1]; - for (int i =3D 0;i < decodedValue.length();i++) + for (int i =3D 0; i < decodedValue.length(); i++) { char c =3D decodedValue.charAt(i); if (Character.isLetterOrDigit(c)) @@ -77,7 +71,7 @@ try { ByteArrayOutputStream baos =3D new ByteArrayOutputStream(encodedV= alue.length()); - for (int i =3D 0;i < encodedValue.length();i++) + for (int i =3D 0; i < encodedValue.length(); i++) { char c =3D encodedValue.charAt(i); if (Character.isLetterOrDigit(c)) @@ -109,5 +103,4 @@ } = = - } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/StringCodecTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= StringCodecTestCase.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= StringCodecTestCase.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -22,10 +22,9 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test; = +import static org.jboss.unit.api.Assert.assertEquals; import org.jboss.unit.api.pojo.annotations.Test; = -import static org.jboss.unit.api.Assert.*; - /** * @author Julien Viet * @version $Revision: 1.1 $ @@ -58,7 +57,7 @@ assertEquals("/", StringCodec.decode(StringCodec.encode("/"))); assertEquals("@", StringCodec.decode(StringCodec.encode("@"))); assertEquals(Character.toString(EURO_CHAR), StringCodec.decode(Strin= gCodec.encode(Character.toString(EURO_CHAR)))); - assertEquals("A" + EURO_CHAR +"B(a)C", StringCodec.decode(StringCode= c.encode("A" + EURO_CHAR + "B(a)C"))); + assertEquals("A" + EURO_CHAR + "B(a)C", StringCodec.decode(StringCod= ec.encode("A" + EURO_CHAR + "B(a)C"))); } = } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/URLParameterConstants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= URLParameterConstants.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= URLParameterConstants.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -39,64 +39,40 @@ */ public static final String LIFECYCLE_TYPE =3D "type"; = - /** - * The portlet mode. - */ + /** The portlet mode. */ public static final String MODE =3D "mode"; = - /** - * The window state. - */ + /** The window state. */ public static final String WINDOW_STATE =3D "windowstate"; = - /** - * The portlet navigational state for any type of lifecycle. - */ + /** The portlet navigational state for any type of lifecycle. */ public static final String NAVIGATIONAL_STATE =3D "navigationalstate"; = - /** - * The portlet resource state for lifecycle of type RENDER_LIFECY= CLE. - */ + /** The portlet resource state for lifecycle of type RENDER_LIFEC= YCLE. */ public static final String RESOURCE_STATE =3D "resourcestate"; = - /** - * The portlet interaction state for lifecycle of type ACTION_LIF= ECYCLE. - */ + /** The portlet interaction state for lifecycle of type ACTION_LI= FECYCLE. */ public static final String INTERACTION_STATE =3D "interactionstate"; = - /** - * The page state for any kind of lifecycle. - */ + /** The page state for any kind of lifecycle. */ public static final String PAGE_STATE =3D "pagestate"; = - /** - * The public navigational state changes of a portlet for lifecycle of = type RENDER_LIFECYCLE. - */ + /** The public navigational state changes of a portlet for lifecycle of= type RENDER_LIFECYCLE. */ public static final String PUBLIC_NAVIGATIONAL_STATE_CHANGES =3D "publi= cnavigationalstatechanges"; = - /** - * The resource id for lifecycle of type RESOURCE_LIFECYCLE. - */ + /** The resource id for lifecycle of type RESOURCE_LIFECYCLE. */ public static final String RESOURCE_ID =3D "resourceid"; = - /** - * The resource cacheability for lifecycle of type RENDER_LIFECYC= LE. - */ + /** The resource cacheability for lifecycle of type RENDER_LIFECY= CLE. */ public static final String RESOURCE_CACHEABILITY =3D "resourcecacheabil= ity"; = - /** - * Denotes an action lifecycle operation. - */ + /** Denotes an action lifecycle operation. */ public static final String ACTION_LIFECYCLE =3D "action"; = - /** - * Denotes a render lifecycle operation. - */ + /** Denotes a render lifecycle operation. */ public static final String RENDER_LIFECYCLE =3D "render"; = - /** - * Denotes a resource lifecycle operation. - */ + /** Denotes a resource lifecycle operation. */ public static final String RESOURCE_LIFECYCLE =3D "resource"; = } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/AbstractMarkupRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractMarkupRenderer.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractMarkupRenderer.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -20,14 +20,15 @@ * 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.portlet.test.controller; = +import org.jboss.portal.common.util.MultiValuedPropertyMap; +import org.jboss.portal.portlet.controller.PortletControllerContext; import org.jboss.portal.portlet.invocation.response.ResponseProperties; -import org.jboss.portal.portlet.controller.PortletControllerContext; -import org.jboss.portal.common.util.MultiValuedPropertyMap; = +import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.Cookie; import java.io.IOException; import java.util.List; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/ControllerResponseRendererFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ControllerResponseRendererFactory.java 2008-02-05 21:52:39 UTC (= rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ControllerResponseRendererFactory.java 2008-02-05 21:59:46 UTC (= rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -20,16 +20,17 @@ * 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.portlet.test.controller; = import org.jboss.portal.portlet.controller.response.ControllerResponse; import org.jboss.portal.portlet.controller.response.PageUpdateResponse; +import org.jboss.portal.portlet.controller.response.PortletResponse; import org.jboss.portal.portlet.controller.response.ResourceResponse; -import org.jboss.portal.portlet.controller.response.PortletResponse; -import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.invocation.response.HTTPRedirectionRespons= e; import org.jboss.portal.portlet.invocation.response.ErrorResponse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; +import org.jboss.portal.portlet.invocation.response.HTTPRedirectionRespons= e; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; = /** * @author Julien Viet Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/ErrorResponseRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ErrorResponseRenderer.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ErrorResponseRenderer.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -20,11 +20,12 @@ * 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.portlet.test.controller; = +import org.apache.log4j.Logger; import org.jboss.portal.portlet.controller.PortletControllerContext; import org.jboss.portal.portlet.invocation.response.ErrorResponse; -import org.apache.log4j.Logger; = import java.io.IOException; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContextImpl.java 2008-02-05 21:52:39 UTC (rev 9= 786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContextImpl.java 2008-02-05 21:59:46 UTC (rev 9= 787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -20,63 +20,64 @@ * 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.portlet.test.controller; = import org.jboss.portal.Mode; import org.jboss.portal.WindowState; import org.jboss.portal.common.io.IOTools; +import org.jboss.portal.common.util.MarkupInfo; +import org.jboss.portal.common.util.MediaType; import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.common.util.Tools; -import org.jboss.portal.common.util.MarkupInfo; -import org.jboss.portal.common.util.MediaType; +import org.jboss.portal.portlet.ContainerURL; import org.jboss.portal.portlet.ParametersStateString; import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletContext; import org.jboss.portal.portlet.PortletInvoker; import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.ContainerURL; -import org.jboss.portal.portlet.spi.PortletInvocationContext; -import org.jboss.portal.portlet.info.PortletInfo; +import org.jboss.portal.portlet.cache.CacheLevel; +import org.jboss.portal.portlet.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.event.EventControllerContext; +import org.jboss.portal.portlet.controller.impl.event.EventControllerConte= xtImpl; +import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; +import org.jboss.portal.portlet.controller.request.ControllerRequest; +import org.jboss.portal.portlet.controller.request.FullScopedCacheablePort= letResourceRequest; +import org.jboss.portal.portlet.controller.request.PageScopedFullPortletRe= sourceRequest; +import org.jboss.portal.portlet.controller.request.PortletActionRequest; +import org.jboss.portal.portlet.controller.request.PortletRenderRequest; +import org.jboss.portal.portlet.controller.request.PortletScopedPortletRes= ourceRequest; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.StateControllerContext; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; import org.jboss.portal.portlet.impl.spi.AbstractClientContext; +import org.jboss.portal.portlet.impl.spi.AbstractRequestContext; +import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; import org.jboss.portal.portlet.impl.spi.AbstractServerContext; import org.jboss.portal.portlet.impl.spi.AbstractUserContext; import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; -import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; -import org.jboss.portal.portlet.impl.spi.AbstractRequestContext; -import org.jboss.portal.portlet.cache.CacheLevel; -import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.invocation.ActionInvocation; import org.jboss.portal.portlet.invocation.EventInvocation; +import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.invocation.ResourceInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.spi.PortletInvocationContext; import org.jboss.portal.portlet.test.StringCodec; import static org.jboss.portal.portlet.test.URLParameterConstants.*; -import org.jboss.portal.portlet.controller.state.WindowNavigationalState; -import org.jboss.portal.portlet.controller.PortletControllerContext; -import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; -import org.jboss.portal.portlet.controller.impl.event.EventControllerConte= xtImpl; -import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.controller.state.StateControllerContext; -import org.jboss.portal.portlet.controller.request.PortletRenderRequest; -import org.jboss.portal.portlet.controller.request.ControllerRequest; -import org.jboss.portal.portlet.controller.request.PortletScopedPortletRes= ourceRequest; -import org.jboss.portal.portlet.controller.request.FullScopedCacheablePort= letResourceRequest; -import org.jboss.portal.portlet.controller.request.PageScopedFullPortletRe= sourceRequest; -import org.jboss.portal.portlet.controller.request.PortletActionRequest; -import org.jboss.portal.portlet.controller.event.EventControllerContext; import org.jboss.portal.web.Body; import org.jboss.portal.web.IllegalRequestException; import org.jboss.portal.web.WebRequest; = import javax.servlet.ServletContext; +import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.Cookie; import java.io.IOException; import java.util.Collection; +import java.util.List; import java.util.Map; -import java.util.List; = /** * @author Julien Viet @@ -332,7 +333,7 @@ public PortletInvocationResponse invoke(String windowId, ActionInvocati= on actionInvocation) throws PortletInvokerException { = - Portlet portlet =3D_getPortlet(windowId); + Portlet portlet =3D _getPortlet(windowId); = TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), true); = @@ -382,7 +383,7 @@ resourceInvocation.setSecurityContext(new AbstractSecurityContext(re= q)); resourceInvocation.setRequestContext(new AbstractRequestContext(req)= ); resourceInvocation.setTarget(instanceContext.getTarget()); - = + return invoke(resourceInvocation); } = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletURLRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -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.portlet.test.controller; = import org.jboss.portal.common.io.IOTools; @@ -33,10 +34,10 @@ import org.jboss.portal.portlet.ResourceURL; import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.cache.CacheLevel; -import static org.jboss.portal.portlet.test.URLParameterConstants.*; +import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; import org.jboss.portal.portlet.test.StringCodec; +import static org.jboss.portal.portlet.test.URLParameterConstants.*; = import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -67,7 +68,7 @@ final PageNavigationalState pageNS; = public PortletURLRenderer( - StateControllerContextImpl stateContext, = + StateControllerContextImpl stateContext, PageNavigationalState pageNS, String windowId, HttpServletRequest clientReq, Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/RedirectResponseRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/RedirectResponseRenderer.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/RedirectResponseRenderer.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -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.portlet.test.controller; = import org.jboss.portal.portlet.controller.PortletControllerContext; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/Renderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/Renderer.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/Renderer.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -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.portlet.test.controller; = import org.jboss.portal.portlet.controller.PortletControllerContext; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/ResourceRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ResourceRenderer.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ResourceRenderer.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -20,13 +20,14 @@ * 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.portlet.test.controller; = +import org.jboss.portal.common.io.IOTools; import org.jboss.portal.portlet.invocation.response.FragmentResponse; -import org.jboss.portal.common.io.IOTools; = +import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; -import javax.servlet.ServletOutputStream; import java.io.IOException; import java.io.Writer; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/TestInstanceContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestInstanceContext.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestInstanceContext.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -20,12 +20,13 @@ * 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.portlet.test.controller; = -import org.jboss.portal.portlet.state.AccessMode; import org.jboss.portal.portlet.PortletContext; import org.jboss.portal.portlet.StateEvent; import org.jboss.portal.portlet.spi.InstanceContext; +import org.jboss.portal.portlet.state.AccessMode; = import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/TestPortalContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortalContext.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortalContext.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -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.portlet.test.controller; = import org.jboss.portal.portlet.impl.spi.AbstractPortalContext; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/TestPortletInvocationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvocationContext.java 2008-02-05 21:52:39 UTC (rev 9= 786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvocationContext.java 2008-02-05 21:59:46 UTC (rev 9= 787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -20,17 +20,17 @@ * 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.portlet.test.controller; = +import org.jboss.portal.common.invocation.resolver.MapAttributeResolver; +import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResol= ver; +import org.jboss.portal.common.util.MarkupInfo; import org.jboss.portal.portlet.ContainerURL; +import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; -import org.jboss.portal.portlet.test.controller.PortletURLRenderer; +import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext; import org.jboss.portal.portlet.invocation.PortletInvocation; -import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext; -import org.jboss.portal.common.util.MarkupInfo; -import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResol= ver; -import org.jboss.portal.common.invocation.resolver.MapAttributeResolver; = import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/TestPortletInvoker.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvoker.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvoker.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -20,24 +20,25 @@ * 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.portlet.test.controller; = +import org.jboss.portal.common.invocation.InterceptorStackFactory; +import org.jboss.portal.common.invocation.Invocation; +import org.jboss.portal.common.invocation.InvocationException; +import org.jboss.portal.common.invocation.InvocationHandler; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletContext; import org.jboss.portal.portlet.PortletInvoker; import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.Portlet; -import org.jboss.portal.portlet.PortletContext; -import org.jboss.portal.portlet.state.PropertyMap; -import org.jboss.portal.portlet.state.PropertyChange; -import org.jboss.portal.portlet.state.DestroyCloneFailure; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.common.invocation.InterceptorStackFactory; -import org.jboss.portal.common.invocation.InvocationHandler; -import org.jboss.portal.common.invocation.Invocation; -import org.jboss.portal.common.invocation.InvocationException; +import org.jboss.portal.portlet.state.DestroyCloneFailure; +import org.jboss.portal.portlet.state.PropertyChange; +import org.jboss.portal.portlet.state.PropertyMap; = +import java.util.List; import java.util.Set; -import java.util.List; = /** * A simple consumer. @@ -114,11 +115,11 @@ { if (e instanceof PortletInvokerException) { - throw(PortletInvokerException)e; + throw (PortletInvokerException)e; } else if (e instanceof RuntimeException) { - throw(RuntimeException)e; + throw (RuntimeException)e; } else { Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/metadata/factory/LocalizedStringBuilder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= metadata/factory/LocalizedStringBuilder.java 2008-02-05 21:52:39 UTC (rev 9= 786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= metadata/factory/LocalizedStringBuilder.java 2008-02-05 21:59:46 UTC (rev 9= 787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -20,18 +20,19 @@ * 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.portlet.test.metadata.factory; = +import org.apache.log4j.Logger; +import org.jboss.portal.common.i18n.LocalizedString; +import org.jboss.portal.portlet.impl.metadata.adapter.LocalizedStringAdapt= er; +import org.jboss.portal.portlet.impl.metadata.common.LocalizedDescriptionM= etaData; + import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; = -import org.apache.log4j.Logger; -import org.jboss.portal.common.i18n.LocalizedString; -import org.jboss.portal.portlet.impl.metadata.adapter.LocalizedStringAdapt= er; -import org.jboss.portal.portlet.impl.metadata.common.LocalizedDescriptionM= etaData; - /** * @author Emanuel Muckenhuber * @version $Revision$ Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/metadata/factory/PortletApplicationModelFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= metadata/factory/PortletApplicationModelFactory.java 2008-02-05 21:52:39 UT= C (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= metadata/factory/PortletApplicationModelFactory.java 2008-02-05 21:59:46 UT= C (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -20,11 +20,9 @@ * 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.portlet.test.metadata.factory; = -import java.net.URI; -import java.net.URISyntaxException; - import org.apache.log4j.Logger; import org.jboss.portal.Mode; import org.jboss.portal.WindowState; @@ -34,12 +32,12 @@ import org.jboss.portal.portlet.impl.metadata.CustomPortletModeMetaData; import org.jboss.portal.portlet.impl.metadata.CustomWindowStateMetaData; import org.jboss.portal.portlet.impl.metadata.ListenerMetaData; +import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData; +import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConsta= nts.DEFAULT_LOCALE; +import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConsta= nts.PORTLET_JSR_286_NS; import org.jboss.portal.portlet.impl.metadata.PublicRenderParameterMetaDat= a; import org.jboss.portal.portlet.impl.metadata.UserAttributeMetaData; -import org.jboss.portal.portlet.test.metadata.impl.AnnotationPortletApplic= ation10MetaData; -import org.jboss.portal.portlet.test.metadata.impl.AnnotationPortletApplic= ation20MetaData; -import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; import org.jboss.portal.portlet.impl.metadata.common.ContainerRuntimeMetaD= ata; import org.jboss.portal.portlet.impl.metadata.common.DescribableMetaData; import org.jboss.portal.portlet.impl.metadata.common.InitParamMetaData; @@ -61,11 +59,14 @@ import org.jboss.portal.portlet.impl.metadata.security.PortletCollectionMe= taData; import org.jboss.portal.portlet.impl.metadata.security.SecurityConstraintM= etaData; import org.jboss.portal.portlet.impl.metadata.security.UserDataConstraintM= etaData; +import org.jboss.portal.portlet.test.metadata.impl.AnnotationPortletApplic= ation10MetaData; +import org.jboss.portal.portlet.test.metadata.impl.AnnotationPortletApplic= ation20MetaData; import org.jboss.xb.binding.GenericObjectModelFactory; import org.jboss.xb.binding.UnmarshallingContext; import org.xml.sax.Attributes; = -import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConsta= nts.*; +import java.net.URI; +import java.net.URISyntaxException; = /** * @author Emanuel Muckenhuber @@ -91,8 +92,8 @@ = // portlet-app 2.0 or 1.0 PortletApplication10MetaData md =3D PORTLET_JSR_286_NS.equals(nsURI) - ? new AnnotationPortletApplication20MetaData() - : new AnnotationPortletApplication10MetaData(); + ? new AnnotationPortletApplication20MetaData() + : new AnnotationPortletApplication10MetaData(); = // Set portlet-app id md.setId(id); @@ -302,7 +303,7 @@ = if (child instanceof DescribableMetaData) { - DescribableMetaData md =3D (DescribableMetaData) child; + DescribableMetaData md =3D (DescribableMetaData)child; LocalizedString d =3D this.descriptions.getLocalizedString(md); md.setDescription(d); } @@ -310,33 +311,33 @@ // portlet app if (parent instanceof PortletApplication10MetaData) { - PortletApplication10MetaData md =3D (PortletApplication10MetaData= ) parent; + PortletApplication10MetaData md =3D (PortletApplication10MetaData= )parent; // add portlet if (child instanceof PortletMetaData) { - PortletMetaData portlet =3D (PortletMetaData) child; + PortletMetaData portlet =3D (PortletMetaData)child; portlet.setDisplayName(this.displayNames.getLocalizedString(po= rtlet)); md.addPortlet(portlet); } // add custom-portlet-mode else if (child instanceof CustomPortletModeMetaData) { - md.addCustomPortletMode((CustomPortletModeMetaData) child); + md.addCustomPortletMode((CustomPortletModeMetaData)child); } // add custom window state else if (child instanceof CustomWindowStateMetaData) { - md.addCustomWindowState((CustomWindowStateMetaData) child); + md.addCustomWindowState((CustomWindowStateMetaData)child); } // add user-attribute else if (child instanceof UserAttributeMetaData) { - md.addUserAttribute((UserAttributeMetaData) child); + md.addUserAttribute((UserAttributeMetaData)child); } // add security-constraint else if (child instanceof SecurityConstraintMetaData) { - SecurityConstraintMetaData security =3D (SecurityConstraintMet= aData) child; + SecurityConstraintMetaData security =3D (SecurityConstraintMet= aData)child; // display-name security.setDisplayName(this.displayNames.getLocalizedString(s= ecurity)); md.addSecurityConstraint(security); @@ -346,38 +347,38 @@ // portlet-app 2.0 if (parent instanceof PortletApplication20MetaData) { - PortletApplication20MetaData md =3D (PortletApplication20MetaData= ) parent; + PortletApplication20MetaData md =3D (PortletApplication20MetaData= )parent; // add public-render-parameter if (child instanceof PublicRenderParameterMetaData) { - md.addPublicRenderParameter((PublicRenderParameterMetaData) ch= ild); + md.addPublicRenderParameter((PublicRenderParameterMetaData)chi= ld); } // add event-defintion else if (child instanceof EventDefinitionMetaData) { - md.addEventDefinition((EventDefinitionMetaData) child); + md.addEventDefinition((EventDefinitionMetaData)child); } // add filter else if (child instanceof FilterMetaData) { - FilterMetaData filter =3D (FilterMetaData) child; + FilterMetaData filter =3D (FilterMetaData)child; filter.setDisplayName(this.displayNames.getLocalizedString(fil= ter)); md.addFilter(filter); } // add filter-mapping else if (child instanceof FilterMappingMetaData) { - md.addFilterMapping((FilterMappingMetaData) child); + md.addFilterMapping((FilterMappingMetaData)child); } // add container-runtime-option else if (child instanceof ContainerRuntimeMetaData) { - md.addContainerRuntime((ContainerRuntimeMetaData) child); + md.addContainerRuntime((ContainerRuntimeMetaData)child); } // add listener else if (child instanceof ListenerMetaData) { - ListenerMetaData listener =3D (ListenerMetaData) child; + ListenerMetaData listener =3D (ListenerMetaData)child; listener.setDisplayName(this.displayNames.getLocalizedString(l= istener)); md.addListener(listener); } @@ -386,104 +387,104 @@ // portlet if (parent instanceof PortletMetaData) { - PortletMetaData md =3D (PortletMetaData) parent; + PortletMetaData md =3D (PortletMetaData)parent; // init-param if (child instanceof InitParamMetaData) { - md.addInitParam((InitParamMetaData) child); + md.addInitParam((InitParamMetaData)child); } // supports else if (child instanceof SupportsMetaData) { - md.addSupport((SupportsMetaData) child); + md.addSupport((SupportsMetaData)child); } // supported-locale else if (child instanceof SupportedLocaleMetaData) { - md.addSupportedLocale((SupportedLocaleMetaData) child); + md.addSupportedLocale((SupportedLocaleMetaData)child); } // portlet-info else if (child instanceof PortletInfoMetaData) { - md.setPortletInfo((PortletInfoMetaData) child); + md.setPortletInfo((PortletInfoMetaData)child); } // portlet-preferences else if (child instanceof PortletPreferencesMetaData) { - md.setPortletPreferences((PortletPreferencesMetaData) child); + md.setPortletPreferences((PortletPreferencesMetaData)child); } // security-role-ref else if (child instanceof SecurityRoleRefMetaData) { - md.addSecurityRoleRef((SecurityRoleRefMetaData) child); + md.addSecurityRoleRef((SecurityRoleRefMetaData)child); } // supported-events else if (child instanceof EventDefinitionReferenceMetaData) { if ("supported-processing-event".equals(localName)) { - md.addSupportedProcessingEvent((EventDefinitionReferenceMet= aData) child); + md.addSupportedProcessingEvent((EventDefinitionReferenceMet= aData)child); } else if ("supported-publishing-event".equals(localName)) { - md.addSupportedPublishingEvent((EventDefinitionReferenceMet= aData) child); + md.addSupportedPublishingEvent((EventDefinitionReferenceMet= aData)child); } } // container-runtime-option else if (child instanceof ContainerRuntimeMetaData) { - md.addContainerRuntime((ContainerRuntimeMetaData) child); + md.addContainerRuntime((ContainerRuntimeMetaData)child); } } = // adding user-data-constraint and portlet-name(s) to security-const= raint if (parent instanceof SecurityConstraintMetaData) { - SecurityConstraintMetaData md =3D (SecurityConstraintMetaData) pa= rent; + SecurityConstraintMetaData md =3D (SecurityConstraintMetaData)par= ent; // add user-data-constraint if (child instanceof UserDataConstraintMetaData) { - md.setUserDataConstraint((UserDataConstraintMetaData) child); + md.setUserDataConstraint((UserDataConstraintMetaData)child); } // add portlet-collection else if (child instanceof PortletCollectionMetaData) { - md.setPortletList((PortletCollectionMetaData) child); + md.setPortletList((PortletCollectionMetaData)child); } } = // filter if (parent instanceof FilterMetaData) { - FilterMetaData md =3D (FilterMetaData) parent; + FilterMetaData md =3D (FilterMetaData)parent; // add init-param if (child instanceof InitParamMetaData) { - md.addInitParam((InitParamMetaData) child); + md.addInitParam((InitParamMetaData)child); } } = // add portlet-mode and window-state if (parent instanceof SupportsMetaData) { - SupportsMetaData md =3D (SupportsMetaData) parent; + SupportsMetaData md =3D (SupportsMetaData)parent; if (child instanceof PortletModeMetaData) { - md.addPortletMode((PortletModeMetaData) child); + md.addPortletMode((PortletModeMetaData)child); } else if (child instanceof WindowStateMetaData) { - md.addWindowState((WindowStateMetaData) child); + md.addWindowState((WindowStateMetaData)child); } } = // add preference if (parent instanceof PortletPreferencesMetaData) { - PortletPreferencesMetaData md =3D (PortletPreferencesMetaData) pa= rent; + PortletPreferencesMetaData md =3D (PortletPreferencesMetaData)par= ent; if (child instanceof PortletPreferenceMetaData) { - md.addPortletPreference((PortletPreferenceMetaData) child); + md.addPortletPreference((PortletPreferenceMetaData)child); } } } @@ -494,7 +495,7 @@ // JSR 286 portlet-app attributes - default-namespace and resource-b= undle. if (object instanceof PortletApplication20MetaData) { - PortletApplication20MetaData md =3D (PortletApplication20MetaData= ) object; + PortletApplication20MetaData md =3D (PortletApplication20MetaData= )object; if ("resource-bundle".equals(localName)) { md.setResourceBundle(value); @@ -515,7 +516,7 @@ // portlet if (object instanceof PortletMetaData) { - PortletMetaData md =3D (PortletMetaData) object; + PortletMetaData md =3D (PortletMetaData)object; if ("portlet-name".equals(localName)) { md.setPortletName(value); @@ -544,7 +545,7 @@ = if (object instanceof LocalizedDescriptionMetaData) { - LocalizedDescriptionMetaData localized =3D (LocalizedDescriptionM= etaData) object; + LocalizedDescriptionMetaData localized =3D (LocalizedDescriptionM= etaData)object; if ("description".equals(localName)) { localized.setDescription(value); @@ -558,7 +559,7 @@ // init-param if (object instanceof InitParamMetaData) { - InitParamMetaData md =3D (InitParamMetaData) object; + InitParamMetaData md =3D (InitParamMetaData)object; if ("name".equals(localName)) { md.setName(value); @@ -572,7 +573,7 @@ // supports if (object instanceof SupportsMetaData) { - SupportsMetaData md =3D (SupportsMetaData) object; + SupportsMetaData md =3D (SupportsMetaData)object; if ("mime-type".equals(localName)) { md.setMimeType(value); @@ -582,7 +583,7 @@ // supports --- portlet-mode if (object instanceof PortletModeMetaData) { - PortletModeMetaData md =3D (PortletModeMetaData) object; + PortletModeMetaData md =3D (PortletModeMetaData)object; if ("portlet-mode".equals(localName)) { md.setPortletMode(Mode.create(value)); @@ -592,7 +593,7 @@ // supports --- window-state if (object instanceof WindowStateMetaData) { - WindowStateMetaData md =3D (WindowStateMetaData) object; + WindowStateMetaData md =3D (WindowStateMetaData)object; if ("window-state".equals(localName)) { md.setWindowState(WindowState.create(value)); @@ -602,7 +603,7 @@ // supported-locale if (object instanceof SupportedLocaleMetaData) { - SupportedLocaleMetaData md =3D (SupportedLocaleMetaData) object; + SupportedLocaleMetaData md =3D (SupportedLocaleMetaData)object; if ("supported-locale".equals(localName)) { md.setLocale(value); @@ -612,7 +613,7 @@ // portlet-info if (object instanceof PortletInfoMetaData) { - PortletInfoMetaData md =3D (PortletInfoMetaData) object; + PortletInfoMetaData md =3D (PortletInfoMetaData)object; if ("title".equals(localName)) { md.setTitle(value); @@ -630,7 +631,7 @@ // portlet-preferences if (object instanceof PortletPreferencesMetaData) { - PortletPreferencesMetaData md =3D (PortletPreferencesMetaData) ob= ject; + PortletPreferencesMetaData md =3D (PortletPreferencesMetaData)obj= ect; if ("preferences-validator".equals(localName)) { md.setPreferenceValidator(value); @@ -640,7 +641,7 @@ // preference if (object instanceof PortletPreferenceMetaData) { - PortletPreferenceMetaData md =3D (PortletPreferenceMetaData) obje= ct; + PortletPreferenceMetaData md =3D (PortletPreferenceMetaData)objec= t; if ("name".equals(localName)) { md.setName(value); @@ -658,7 +659,7 @@ // security-role-ref if (object instanceof SecurityRoleRefMetaData) { - SecurityRoleRefMetaData md =3D (SecurityRoleRefMetaData) object; + SecurityRoleRefMetaData md =3D (SecurityRoleRefMetaData)object; if ("role-name".equals(localName)) { md.setRoleName(value); @@ -672,7 +673,7 @@ // supported events if (object instanceof EventDefinitionReferenceMetaData) { - EventDefinitionReferenceMetaData md =3D (EventDefinitionReference= MetaData) object; + EventDefinitionReferenceMetaData md =3D (EventDefinitionReference= MetaData)object; if ("qname".equals(localName)) { md.setQname(nav.resolveQName(value)); @@ -686,7 +687,7 @@ // custom-portlet-mode if (object instanceof CustomPortletModeMetaData) { - CustomPortletModeMetaData mode =3D (CustomPortletModeMetaData) ob= ject; + CustomPortletModeMetaData mode =3D (CustomPortletModeMetaData)obj= ect; if ("portlet-mode".equals(localName)) { mode.setPortletMode(value); @@ -700,7 +701,7 @@ // custom-window-state if (object instanceof CustomWindowStateMetaData) { - CustomWindowStateMetaData md =3D (CustomWindowStateMetaData) obje= ct; + CustomWindowStateMetaData md =3D (CustomWindowStateMetaData)objec= t; if ("window-state".equals(localName)) { md.setWindowState(value); @@ -710,7 +711,7 @@ // user-attribute if (object instanceof UserAttributeMetaData) { - UserAttributeMetaData md =3D (UserAttributeMetaData) object; + UserAttributeMetaData md =3D (UserAttributeMetaData)object; if ("name".equals(localName)) { md.setName(value); @@ -720,7 +721,7 @@ // user-data-constraint if (object instanceof UserDataConstraintMetaData) { - UserDataConstraintMetaData md =3D (UserDataConstraintMetaData) ob= ject; + UserDataConstraintMetaData md =3D (UserDataConstraintMetaData)obj= ect; if ("transport-guarantee".equals(localName)) { md.setTransportQuarantee(TransportGuarantee.valueOf(value)); @@ -730,7 +731,7 @@ // portlet-collection in security-constraint if (object instanceof PortletCollectionMetaData) { - PortletCollectionMetaData md =3D (PortletCollectionMetaData) obje= ct; + PortletCollectionMetaData md =3D (PortletCollectionMetaData)objec= t; if ("portlet-name".equals(localName)) { md.addPortletname(value); @@ -740,7 +741,7 @@ // filter if (object instanceof FilterMetaData && PORTLET_JSR_286_NS.equals(ns= URI)) { - FilterMetaData md =3D (FilterMetaData) object; + FilterMetaData md =3D (FilterMetaData)object; if ("filter-class".equals(localName)) { md.setFilterClass(value); @@ -751,12 +752,12 @@ } else if ("lifecycle".equals(localName)) { - String lifeCycle =3D value.substring(0 , value.length() - "_PH= ASE".length()); + String lifeCycle =3D value.substring(0, value.length() - "_PHA= SE".length()); try { md.addLifecycle(LifeCyclePhase.valueOf(lifeCycle)); } - catch(IllegalArgumentException e) + catch (IllegalArgumentException e) { throw new IllegalArgumentException("Invalid value for lifec= ycle. Valid values are [RENDER_PHASE, RESOURCE_PHASE, ACTION_PHASE, EVENT_P= HASE]"); } @@ -766,7 +767,7 @@ // filter-mapping if (object instanceof FilterMappingMetaData && PORTLET_JSR_286_NS.eq= uals(nsURI)) { - FilterMappingMetaData md =3D (FilterMappingMetaData) object; + FilterMappingMetaData md =3D (FilterMappingMetaData)object; if ("filter-name".equals(localName)) { md.setName(value); @@ -780,7 +781,7 @@ // event-defintion if (object instanceof EventDefinitionMetaData && PORTLET_JSR_286_NS.= equals(nsURI)) { - EventDefinitionMetaData md =3D (EventDefinitionMetaData) object; + EventDefinitionMetaData md =3D (EventDefinitionMetaData)object; if ("name".equals(localName)) { md.setName(value); @@ -802,7 +803,7 @@ // public-render-parameter if (object instanceof PublicRenderParameterMetaData && PORTLET_JSR_2= 86_NS.equals(nsURI)) { - PublicRenderParameterMetaData md =3D (PublicRenderParameterMetaDa= ta) object; + PublicRenderParameterMetaData md =3D (PublicRenderParameterMetaDa= ta)object; if ("identifier".equals(localName)) { md.setIdentifier(value); @@ -824,7 +825,7 @@ // container-runtime-option if (object instanceof ContainerRuntimeMetaData && PORTLET_JSR_286_NS= .equals(nsURI)) { - ContainerRuntimeMetaData md =3D (ContainerRuntimeMetaData) object; + ContainerRuntimeMetaData md =3D (ContainerRuntimeMetaData)object; if ("name".equals(localName)) { md.setName(value); @@ -838,7 +839,7 @@ // listener if (object instanceof ListenerMetaData && PORTLET_JSR_286_NS.equals(= nsURI)) { - ListenerMetaData md =3D (ListenerMetaData) object; + ListenerMetaData md =3D (ListenerMetaData)object; if ("listener-class".equals(localName)) { md.setListenerClass(value); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/metadata/impl/AnnotationPortletApplication10MetaData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= metadata/impl/AnnotationPortletApplication10MetaData.java 2008-02-05 21:52:= 39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= metadata/impl/AnnotationPortletApplication10MetaData.java 2008-02-05 21:59:= 46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -20,17 +20,18 @@ * 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.portlet.test.metadata.impl; = +import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; +import org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants; +import org.jboss.xb.annotations.JBossXmlSchema; + +import javax.xml.bind.annotation.XmlNs; import javax.xml.bind.annotation.XmlNsForm; -import javax.xml.bind.annotation.XmlNs; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; = -import org.jboss.xb.annotations.JBossXmlSchema; -import org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants; -import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; - /** * @author Emanuel Muckenhuber * @version $Revision$ @@ -38,9 +39,9 @@ @XmlRootElement(name =3D "portlet-app") @XmlType(name =3D "portlet-appType") @JBossXmlSchema(xmlns =3D {@XmlNs(namespaceURI =3D PortletMetaDataConstant= s.PORTLET_JSR_168_NS, prefix =3D "portlet")}, - ignoreUnresolvedFieldOrClass =3D false, - namespace =3D PortletMetaDataConstants.PORTLET_JSR_168_NS, - elementFormDefault =3D XmlNsForm.QUALIFIED) + ignoreUnresolvedFieldOrClass =3D false, + namespace =3D PortletMetaDataConstants.PORTLET_JSR_168_NS, + elementFormDefault =3D XmlNsForm.QUALIFIED) public class AnnotationPortletApplication10MetaData extends PortletApplica= tion10MetaData { } \ No newline at end of file Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/metadata/impl/AnnotationPortletApplication20MetaData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= metadata/impl/AnnotationPortletApplication20MetaData.java 2008-02-05 21:52:= 39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= metadata/impl/AnnotationPortletApplication20MetaData.java 2008-02-05 21:59:= 46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -20,17 +20,18 @@ * 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.portlet.test.metadata.impl; = +import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData; +import org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants; +import org.jboss.xb.annotations.JBossXmlSchema; + import javax.xml.bind.annotation.XmlNs; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; = -import org.jboss.xb.annotations.JBossXmlSchema; -import org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants; -import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData; - /** * @author Emanuel Muckenhuber * @version $Revision$ @@ -39,9 +40,9 @@ @XmlRootElement(name =3D "portlet-app") @XmlType(name =3D "portlet-appType") @JBossXmlSchema(xmlns =3D {@XmlNs(namespaceURI =3D PortletMetaDataConstant= s.PORTLET_JSR_286_NS, prefix =3D "portlet")}, - ignoreUnresolvedFieldOrClass =3D false, - namespace =3D PortletMetaDataConstants.PORTLET_JSR_286_NS, - elementFormDefault =3D XmlNsForm.QUALIFIED) + ignoreUnresolvedFieldOrClass =3D false, + namespace =3D PortletMetaDataConstants.PORTLET_JSR_286_NS, + elementFormDefault =3D XmlNsForm.QUALIFIED) public class AnnotationPortletApplication20MetaData extends PortletApplica= tion20MetaData { } \ No newline at end of file Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/metadata/impl/PortletApplicationMetaDataException.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= metadata/impl/PortletApplicationMetaDataException.java 2008-02-05 21:52:39 = UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= metadata/impl/PortletApplicationMetaDataException.java 2008-02-05 21:59:46 = UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -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.portlet.test.metadata.impl; = /** Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/metadata/impl/ValueTrimmingFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= metadata/impl/ValueTrimmingFilter.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= metadata/impl/ValueTrimmingFilter.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -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.portlet.test.metadata.impl; = import org.jboss.xb.binding.GenericObjectModelFactory; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/url/CodecBuilder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= url/CodecBuilder.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= url/CodecBuilder.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -22,7 +22,6 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.url; = -import java.util.LinkedHashSet; import java.util.ArrayList; = /** Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/url/ParameterDecoder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= url/ParameterDecoder.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= url/ParameterDecoder.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * @@ -89,7 +89,7 @@ } = // - for (int i =3D builder.metaParameterNames.size() - 1;reservedParamet= er > 0;) + for (int i =3D builder.metaParameterNames.size() - 1; reservedParame= ter > 0;) { if (i < 0) { @@ -132,7 +132,7 @@ } = // - for (Iterator i =3D parameters.entrySet().iterator();i.hasNext();) + for (Iterator i =3D parameters.entrySet().iterator(); i.hasNext();) { Map.Entry entry =3D (Map.Entry)i.next(); String parameterName =3D (String)entry.getKey(); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/url/ParameterEncoder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= url/ParameterEncoder.java 2008-02-05 21:52:39 UTC (rev 9786) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= url/ParameterEncoder.java 2008-02-05 21:59:46 UTC (rev 9787) @@ -1,6 +1,6 @@ /*************************************************************************= ***** * JBoss, a division of Red Hat = * - * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * 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. = * --===============6689395982175598487==-- From portal-commits at lists.jboss.org Tue Feb 5 18:52:20 2008 Content-Type: multipart/mixed; boundary="===============1914274981733212382==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9788 - in modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet: impl/jsr168 and 2 other directories. Date: Tue, 05 Feb 2008 18:52:19 -0500 Message-ID: --===============1914274981733212382== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-05 18:52:19 -0500 (Tue, 05 Feb 2008) New Revision: 9788 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerInfoBuilder.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerInfoBuilderContext.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerPortletInfo.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/ContainerInfoBuilderContextImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/inf= o/PortletInfo.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sup= port/info/PortletInfoSupport.java Log: add name/applicationName on portlet info which expose portlet name and appl= ication name (context path name more or less). Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/info/ContainerInfoBuilder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerInfoBuilder.java 2008-02-05 21:59:46 UTC (rev 9787) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerInfoBuilder.java 2008-02-05 23:52:19 UTC (rev 9788) @@ -587,6 +587,7 @@ containerNavigation, filters, portletMD.getPortletName(), + context.getApplicationName(), portletMD.getPortletClass(), initParameters, false, @@ -604,6 +605,7 @@ containerCache, containerSession, portletMD.getPortletName(), + context.getApplicationName(), portletMD.getPortletClass(), Collections.unmodifiableMap(initParameters), false, Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/info/ContainerInfoBuilderContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerInfoBuilderContext.java 2008-02-05 21:59:46 UTC (rev 9787) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerInfoBuilderContext.java 2008-02-05 23:52:19 UTC (rev 9788) @@ -33,6 +33,8 @@ public interface ContainerInfoBuilderContext { = + String getApplicationName(); + ResourceBundleManager getBundleManager(); = ResourceBundleManager getBundleManager(PortletMetaData portletMD); Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/info/ContainerPortletInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerPortletInfo.java 2008-02-05 21:59:46 UTC (rev 9787) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerPortletInfo.java 2008-02-05 23:52:19 UTC (rev 9788) @@ -65,6 +65,9 @@ private final String name; = /** . */ + private final String applicationName; + + /** . */ private final String className; = /** . */ @@ -94,6 +97,7 @@ ContainerSessionInfo session, String name, String className, + String applicationName, Map initParameters, Boolean remotable, ResourceBundleManager bundleManager) @@ -108,6 +112,7 @@ this.navigation =3D new ContainerNavigationInfo(); this.filterRefs =3D Collections.emptyList(); this.name =3D name; + this.applicationName =3D applicationName; this.className =3D className; this.initParameters =3D initParameters; this.remotable =3D remotable; @@ -126,6 +131,7 @@ ContainerNavigationInfo navigation, List filterRefs, String name, + String applicationName, String className, Map initParameters, Boolean remotable, @@ -142,6 +148,7 @@ this.navigation =3D navigation; this.filterRefs =3D filterRefs; this.name =3D name; + this.applicationName =3D applicationName; this.className =3D className; this.initParameters =3D initParameters; this.remotable =3D remotable; @@ -154,6 +161,11 @@ return name; } = + public String getApplicationName() + { + return null; + } + public Map getOptions() { return options; Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/ContainerInfoBuilderContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/ContainerInfoBuilderContextImpl.java 2008-02-05 21:59:46 UTC (rev= 9787) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/ContainerInfoBuilderContextImpl.java 2008-02-05 23:52:19 UTC (rev= 9788) @@ -41,20 +41,34 @@ public class ContainerInfoBuilderContextImpl implements ContainerInfoBuild= erContext { = - private PortletApplication10MetaData metaData; + /** . */ + private final PortletApplication10MetaData metaData; = - private WebApp webApp; + /** . */ + private final WebApp webApp; = - private final Map portletBundleMgrs =3D = new HashMap(); + /** . */ + private final Map portletBundleMgrs; = + /** . */ private ResourceBundleManager applicationBundleMgr; = + /** . */ + private final String applicationName; + public ContainerInfoBuilderContextImpl(PortletApplication10MetaData met= aData, WebApp webApp) { this.metaData =3D metaData; this.webApp =3D webApp; + this.portletBundleMgrs =3D new HashMap(); + this.applicationName =3D webApp.getContextPath().substring(1); } = + public String getApplicationName() + { + return applicationName; + } + public ResourceBundleManager getBundleManager() { if (applicationBundleMgr =3D=3D null) Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/info/PortletInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= fo/PortletInfo.java 2008-02-05 21:59:46 UTC (rev 9787) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= fo/PortletInfo.java 2008-02-05 23:52:19 UTC (rev 9788) @@ -31,7 +31,22 @@ */ public interface PortletInfo { + /** + * Returns the portlet name. + * + * @return the portlet name + */ + String getName(); + + /** + * Returns the portlet application name. + * + * @return the portlet application name + */ + String getApplicationName(); + + /** * Retrieves the capabilities of supported by the described portlet. * * @return the capabilities of the portlet Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/support/info/PortletInfoSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/su= pport/info/PortletInfoSupport.java 2008-02-05 21:59:46 UTC (rev 9787) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/su= pport/info/PortletInfoSupport.java 2008-02-05 23:52:19 UTC (rev 9788) @@ -32,6 +32,8 @@ public class PortletInfoSupport implements PortletInfo { = + private String name; + private String applicationName; private Boolean remotable; private PreferencesInfoSupport preferencesSupport =3D new PreferencesIn= foSupport(); private SecurityInfoSupport securitySupport =3D new SecurityInfoSupport= (); @@ -41,6 +43,26 @@ private EventingInfoSupport eventsSupport =3D new EventingInfoSupport(); private NavigationInfoSupport navigationSupport =3D new NavigationInfoS= upport(); = + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name =3D name; + } + + public String getApplicationName() + { + return applicationName; + } + + public void setApplicationName(String applicationName) + { + this.applicationName =3D applicationName; + } + public CapabilitiesInfo getCapabilities() { throw new UnsupportedOperationException("Implement me"); --===============1914274981733212382==-- From portal-commits at lists.jboss.org Tue Feb 5 18:59:17 2008 Content-Type: multipart/mixed; boundary="===============6778176298773477291==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9789 - modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF. Date: Tue, 05 Feb 2008 18:59:17 -0500 Message-ID: --===============6778176298773477291== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-05 18:59:16 -0500 (Tue, 05 Feb 2008) New Revision: 9789 Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= portal.xml Log: add sample file describing portal structure Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-= INF/portal.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.xml 2008-02-05 23:59:16 UTC (rev 9789) @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + --===============6778176298773477291==-- From portal-commits at lists.jboss.org Tue Feb 5 19:58:13 2008 Content-Type: multipart/mixed; boundary="===============3875498062617845156==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9790 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Tue, 05 Feb 2008 19:58:13 -0500 Message-ID: --===============3875498062617845156== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-05 19:58:13 -0500 (Tue, 05 Feb 2008) New Revision: 9790 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configur= ation.xml Log: revising/adding content to: 3.2. Changing the Context Path Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/c= onfiguration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configu= ration.xml 2008-02-05 23:59:16 UTC (rev 9789) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configu= ration.xml 2008-02-06 00:58:13 UTC (rev 9790) @@ -46,43 +46,22 @@ - Changing the context path - By default, the "main" page of JBoss portal will be accessible= at - http://localhost:8080/portal/index.html - . You may want to change that - either to a different name or to - http://localhost:8080/index.html - . - - - By default, Tomcat holds on to the root context '/'. You may need= to either remove - $JBOSS_HOME/server/default/deploy/jboss-web.deployer/ROO= T.war - or add a jboss-web.xml file (declaring another= context-root other than '/') under - ROOT.war/WEB-INF directory for the below chang= es to take effect on restart. - - - /tomcat-root -]]> - - You can accomplish this, with either a deployed jboss-portal.s= ar or before you build from source: - - - - Binary method: - - - Open - - JBOSS_INSTALL_DIRECTORY/server/default/deplo= y/jboss-portal.sar/portal-server.war/WEB-INF/jboss-web.xml - + Changing the Context Path + By default, the main JBoss Portal page is accessible by naviga= ting to http://localhost:8080/portal/index.html. This +can be changed to a different path, for example, +http://localhost:8080/index.html. The context path ca= n be changed when using the deployed jboss-portal.sar/= , or before building from source. To change the context path when using the= JBoss Portal binary package: + + + + + Open the $JBOSS_HOME/server/default/depl= oy/jboss-portal.sar/portal-server.war/WEB-INF/jboss-web.xml file= . If this file does not exist, copy and save the following example: java:jaas/portal /portal - SET_AND_GET + SET SYNC @@ -94,34 +73,72 @@ Edit the - context-root - element to whatever you desire. - /]]> - + <context-root> element with the desired context path: + + + +/testing]]> + + + + Using this example, the JBoss Portal main page would be reached by nav= igating to http://localhost:8080/testing. + - + + To change the context path before building from source: + + + - Source method: - Edit the file - $PORTAL_HOME/build/local.properties - (You can copy the file - $PORTAL_HOME/build/etc/local.properties-example= - and modify it for your - own settings.) and change - portal.web.context-root - to anything you want. - Now clean the project (ant clean) then build JBoss= portal (ant) and redeploy it for the context - path changes to take - effect. For build instructions, please see: - - - - - - + Copy the JBOSS_PORTAL_INSTALLATION_DIRECTORY/build/etc/= local.properties-example and save it as JBOSS_PORTAL_I= NSTALLATION_DIRECTORY/build/local.properties. + + + + + Open the JBOSS_PORTAL_INSTALLATION_DIRECTORY/build/local.pro= perties file and edit the portal.web.context-roo= t section with the desired context path: + + + +# Context root for the portal main servlet +portal.web.context-root=3D/testing + + + + Using this example, the JBoss Portal main page would be reached by nav= igating to http://localhost:8080/testing. + + + + = + + To clean the project, make sure you are connected to the Internet, and= change into the JBOSS_PORTAL_INSTALLATION_DIRECTORY/build/ directory. Run the ant clean command. + + + + + Re-build and re-deploy JBoss Portal. See for build instructions. + + + + + + + + By default, Tomcat holds on to the root context, /. You may need to remove the $JBOSS_HOME/server/default/de= ploy/jboss-web.deployer/ROOT.war/ directory, + or add a jboss-web.xml file, which declares = another + context-root other than /, under the $JBOSS_HOME/server/default/deploy/jboss-web.deployer/ROOT.war/WEB-INF/ directory, for the above changes to take affect. The following is= an example jboss-web.xml file, which changes the cont= ext path to /tomcat-root: + + + + + /tomcat-root +]]> + + + Forcing the DB dialect --===============3875498062617845156==-- From portal-commits at lists.jboss.org Tue Feb 5 20:25:05 2008 Content-Type: multipart/mixed; boundary="===============1316905223436329008==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9791 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Tue, 05 Feb 2008 20:25:04 -0500 Message-ID: --===============1316905223436329008== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-05 20:25:04 -0500 (Tue, 05 Feb 2008) New Revision: 9791 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configur= ation.xml Log: minor corrections Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/c= onfiguration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configu= ration.xml 2008-02-06 00:58:13 UTC (rev 9790) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configu= ration.xml 2008-02-06 01:25:04 UTC (rev 9791) @@ -62,7 +62,6 @@ /portal SET - SYNC jdbc/PortalDS @@ -81,24 +80,24 @@ - Using this example, the JBoss Portal main page would be reached by nav= igating to http://localhost:8080/testing. + Using this example, the main JBoss Portal page would be reached by nav= igating to http://localhost:8080/testing. - To change the context path before building from source: + To change the context path when building from source: - Copy the JBOSS_PORTAL_INSTALLATION_DIRECTORY/build/etc/= local.properties-example and save it as JBOSS_PORTAL_I= NSTALLATION_DIRECTORY/build/local.properties. + Change into the directory where the JBoss Portal Source= Code zip file was extracted to, or where the source from SVN wa= s checked out to. Copy the build/etc/local.properties-example file and save it as build/local.properties. - Open the JBOSS_PORTAL_INSTALLATION_DIRECTORY/build/local.pro= perties file and edit the portal.web.context-roo= t section with the desired context path: + Open the build/local.properties file and edit the= portal.web.context-root option with the d= esired context path: @@ -107,13 +106,13 @@ - Using this example, the JBoss Portal main page would be reached by nav= igating to http://localhost:8080/testing. + Using this example, the main JBoss Portal page would be reached by nav= igating to http://localhost:8080/testing. = - To clean the project, make sure you are connected to the Internet, and= change into the JBOSS_PORTAL_INSTALLATION_DIRECTORY/build/ directory. Run the ant clean command. + To clean the project, make sure you are connected to the Internet, and= change into the build/ directory. Run the an= t clean command. @@ -128,7 +127,7 @@ By default, Tomcat holds on to the root context, /. You may need to remove the $JBOSS_HOME/server/default/de= ploy/jboss-web.deployer/ROOT.war/ directory, or add a jboss-web.xml file, which declares = another - context-root other than /, under the $JBOSS_HOME/server/default/deploy/jboss-web.deployer/ROOT.war/WEB-INF/ directory, for the above changes to take affect. The following is= an example jboss-web.xml file, which changes the cont= ext path to /tomcat-root: + context-root other than /, under the $JBOSS_HOME/server/default/deploy/jboss-web.deployer/ROOT.war/WEB-INF/ directory, for the above changes to take affect. The following is= an example jboss-web.xml file, which changes the Tomc= at context path to /tomcat-root: --===============6263033069302550056== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-05 21:37:14 -0500 (Tue, 05 Feb 2008) New Revision: 9792 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/SimpleFragmentRenderer.java 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= /GoogleWeatherClippingPortlet.java modules/portlet/trunk/test/src/test/build.xml modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WEB= -INF/portlet.xml modules/portlet/trunk/test/src/test/resources/google-weather-portlet-war= /WEB-INF/portlet.xml Log: - Fixed sample portlets deployment and code. Should now work with public re= nder parameters. Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/SimpleFragmentRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/SimpleFragmentRenderer.java 2008-02-06 01:25:04 UTC (rev 9791) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/SimpleFragmentRenderer.java 2008-02-06 02:37:14 UTC (rev 9792) @@ -50,7 +50,7 @@ } = StringBuilder builder =3D new StringBuilder(frag.length() + 50); - builder.append("

").append(frag).append("=
"); + builder.append("
").append(frag).append("
"); return builder.toString(); } else @@ -63,7 +63,7 @@ { String html =3D error.toHTML(); StringBuilder builder =3D new StringBuilder(html.length() + 50); - builder.append("
").append(html).append("
"= ); + builder.append("
").append(html).append("
"); return builder.toString(); } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/= samples/GoogleClippingPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/GoogleClippingPortlet.java 2008-02-06 01:25:04 UTC (rev 9791) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/GoogleClippingPortlet.java 2008-02-06 02:37:14 UTC (rev 9792) @@ -33,6 +33,7 @@ import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import java.io.BufferedInputStream; +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; @@ -66,24 +67,10 @@ URLConnection connection =3D url.openConnection(); connection.setRequestProperty("User-Agent", "Mozilla/5.0"); = - InputStream in =3D new BufferedInputStream(connection.getInputStream= ()); - StringBuilder tmp =3D new StringBuilder(8192); - byte[] buffer =3D new byte[4096]; - while (true) - { - int i =3D in.read(buffer); - if (i =3D=3D 0) - { - continue; - } - if (i =3D=3D -1) - { - break; - } - tmp.append(new String(buffer, "UTF-8"), 0, i); - } + BufferedInputStream in =3D new BufferedInputStream(connection.getInp= utStream()); + String html =3D new String(getBytes(in, 16384), "UTF-8"); + in.close(); = - String html =3D tmp.toString(); String beg =3D "
"; String end =3D ""; int begIndex =3D html.indexOf(beg); @@ -173,4 +160,26 @@ { return GOOGLE + zip; } + + private byte[] getBytes(InputStream in, int bufferSize) throws IOExcept= ion, IllegalArgumentException + { + ByteArrayOutputStream out =3D new ByteArrayOutputStream(); + + byte[] buffer =3D new byte[bufferSize]; + while (true) + { + int i =3D in.read(buffer); + if (i =3D=3D 0) + { + continue; + } + if (i =3D=3D -1) + { + break; + } + out.write(buffer, 0, i); + } + return out.toByteArray(); + } + } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/= samples/GoogleWeatherClippingPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/GoogleWeatherClippingPortlet.java 2008-02-06 01:25:04 UTC (rev 9791) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/GoogleWeatherClippingPortlet.java 2008-02-06 02:37:14 UTC (rev 9792) @@ -30,7 +30,7 @@ public class GoogleWeatherClippingPortlet extends GoogleClippingPortlet { private final static String WEATHER_URL =3D "http://www.google.com/sear= ch?q=3Dweather+"; - private static final String A_END =3D ""; = protected String getQueryString(String zip) { @@ -49,9 +49,9 @@ if (begIndex !=3D -1) { endIndex =3D html.indexOf(A_END, begIndex); - tmp =3D tmp.substring(0, begIndex) + html.substring(endIndex); + tmp =3D tmp.substring(0, begIndex) + html.substring(endIndex + A_= END.length()); } = - return tmp; + return super.postProcessHTML(tmp); } } Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-06 01:25:04 UTC (= rev 9791) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-06 02:37:14 UTC (= rev 9792) @@ -716,13 +716,6 @@ = - - - - - - - @@ -740,9 +733,11 @@ = - - - + + + + + = Modified: modules/portlet/trunk/test/src/test/resources/google-map-portlet-= war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WE= B-INF/portlet.xml 2008-02-06 01:25:04 UTC (rev 9791) +++ modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WE= B-INF/portlet.xml 2008-02-06 02:37:14 UTC (rev 9792) @@ -26,12 +26,27 @@ xsi:schemaLocation=3D"http://java.sun.com/xml/ns/portlet/port= let-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version=3D"2.0"> + Portlet displaying a location on Google Maps GoogleMap + Google Map Portlet org.jboss.portal.simple.samples.GoogleClippingPortlet= text/html + VIEW + EDIT - g:zipcode + + Google Map Portlet + sample,map,google + + + + zipcode + 94102 + false + + + zipcode = Modified: modules/portlet/trunk/test/src/test/resources/google-weather-port= let-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/google-weather-portlet-wa= r/WEB-INF/portlet.xml 2008-02-06 01:25:04 UTC (rev 9791) +++ modules/portlet/trunk/test/src/test/resources/google-weather-portlet-wa= r/WEB-INF/portlet.xml 2008-02-06 02:37:14 UTC (rev 9792) @@ -26,12 +26,27 @@ xsi:schemaLocation=3D"http://java.sun.com/xml/ns/portlet/port= let-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version=3D"2.0"> + Portlet displaying the weather forecast for the specifi= ed location GoogleWeather + Google Weather Portlet org.jboss.portal.simple.samples.GoogleWeatherClipping= Portlet text/html + VIEW + EDIT - g:zipcode + + Google Weather Portlet + sample,weather,google + + + + zipcode + 94102 + false + + + zipcode = --===============6263033069302550056==-- From portal-commits at lists.jboss.org Tue Feb 5 21:43:46 2008 Content-Type: multipart/mixed; boundary="===============4103192759060033374==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9793 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Tue, 05 Feb 2008 21:43:46 -0500 Message-ID: --===============4103192759060033374== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-05 21:43:45 -0500 (Tue, 05 Feb 2008) New Revision: 9793 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configur= ation.xml Log: updating/revising, adding another example to: 3.3.1. Database Dialect Settings for JBoss Portal Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/c= onfiguration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configu= ration.xml 2008-02-06 02:37:14 UTC (rev 9792) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configu= ration.xml 2008-02-06 02:43:45 UTC (rev 9793) @@ -140,27 +140,40 @@ - Forcing the DB dialect - If you encounter that the Hibernate dialect is not working pro= perly and would like to - override the default behavior, follow the instructions contained = in this section: - Under most common circumstances, the auto-detect feature sh= ould work fine. + Forcing the Database Dialect + + This sections describes how to override the Database (DB) dialect s= ettings. Under most circumstances, the auto-detect feature will work. If th= e Hibernate dialect is not working correctly, override the default behavior= by following the instructions in this section. - DB Dialect settings for Portal - You will need to modify all the hibernate.cfg.xml<= /literal> files in all the Portal modules you - intend to use by uncommenting the following line in these file= s and using the appropriate dialect (see - here - for a list of supported dialects in Hibernate 3): - Database Dialect Settings for JBoss Portal + + All hibernate.cfg.xml files in all JBoss Portal mo= dules you intend to use need to be modified. The hibernate.cfg.xm= l files are found in the jboss-portal.sar/module/conf/hibernate/directory/<= /filename> directory, where module is the module= name, and directory is a directory that, depend= ing on the module, may or may not exist. + + + To modify these files to force the DB dialect, un-comment the following= line from each hibernate.cfg.xml file in each JBoss P= ortal module you intend to use: + + + ]]> - - These files are found in jboss-portal.sar/[module]= /conf/hibernate/[directory]/hibernate.cfg.xml - where [module] is a module name and [directory] is a directory that - may or may not be present. - +--> +]]> + + + + After un-commenting, the hibernate.cfg.xml will loo= k as follows: + + + +org.hibernate.dialect.PostgreSQLDialect +]]> + + + + Note: these examples are for a PostgreSQL database. If you use another d= atabase, you will need to modify org.hibernate.dialect.Post= greSQLDialect to reflect the correct database. + DB Dialect settings for the CMS component --===============4103192759060033374==-- From portal-commits at lists.jboss.org Tue Feb 5 22:23:05 2008 Content-Type: multipart/mixed; boundary="===============5977894525677304168==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9794 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Tue, 05 Feb 2008 22:23:05 -0500 Message-ID: --===============5977894525677304168== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-05 22:23:05 -0500 (Tue, 05 Feb 2008) New Revision: 9794 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configur= ation.xml Log: revising 3.3.2. DB Dialect Settings for the CMS Component Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/c= onfiguration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configu= ration.xml 2008-02-06 02:43:45 UTC (rev 9793) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configu= ration.xml 2008-02-06 03:23:05 UTC (rev 9794) @@ -130,11 +130,11 @@ context-root other than /, under the $JBOSS_HOME/server/default/deploy/jboss-web.deployer/ROOT.war/WEB-INF/ directory, for the above changes to take affect. The following is= an example jboss-web.xml file, which changes the Tomc= at context path to /tomcat-root: - /tomcat-root -]]> +]]> @@ -150,44 +150,47 @@ All hibernate.cfg.xml files in all JBoss Portal mo= dules you intend to use need to be modified. The hibernate.cfg.xm= l files are found in the jboss-portal.sar/module/conf/hibernate/directory/<= /filename> directory, where module is the module= name, and directory is a directory that, depend= ing on the module, may or may not exist. - To modify these files to force the DB dialect, un-comment the following= line from each hibernate.cfg.xml file in each JBoss P= ortal module you intend to use: + To modify these files to force the DB dialect, un-comment the following= line from each hibernate.cfg.xml file in each JBoss P= ortal module you intend to use, so that it looks like the following: - -]]> - +]]> - After un-commenting, the hibernate.cfg.xml will loo= k as follows: + Note: this example is for a PostgreSQL database. If you use another data= base, you will need to modify org.hibernate.dialect.Postgre= SQLDialect to reflect the correct database. For a list of = supported dialects, refer to the dialects list on the Hibernate website. - + + + DB Dialect Settings for the CMS Component + + To modify the DB dialect setting for the JBoss Portal CMS component: + + + + + + Open the jboss-portal.sar/portal-cms.sar/conf/hibernate/cm= s/hibernate.cfg.xml file. + + + + + Un-comment the following line, so that it looks like the following: + + org.hibernate.dialect.PostgreSQLDialect -]]> - +]]> + + + - Note: these examples are for a PostgreSQL database. If you use another d= atabase, you will need to modify org.hibernate.dialect.Post= greSQLDialect to reflect the correct database. + Note: this example is for a PostgreSQL database. If you use another data= base, you will need to modify org.hibernate.dialect.Postgre= SQLDialect to reflect the correct database. For a list of = supported dialects, refer to the dialects list on the Hibernate website. - - DB Dialect settings for the CMS component - Modify jboss-portal.sar/portal-cms.sar/conf/hibern= ate/cms/hibernate.cfg.xml by - uncommenting the following line in these files and using the a= ppropriate dialect (see - here - for a list of supported dialects in Hibernate 3): - -]]> - - Setting up the email service --===============5977894525677304168==-- From portal-commits at lists.jboss.org Wed Feb 6 01:11:41 2008 Content-Type: multipart/mixed; boundary="===============2204925966633130080==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9795 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Wed, 06 Feb 2008 01:11:37 -0500 Message-ID: --===============2204925966633130080== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-06 01:11:36 -0500 (Wed, 06 Feb 2008) New Revision: 9795 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configur= ation.xml Log: revising 3.4. Setting up the Email Service Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/c= onfiguration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configu= ration.xml 2008-02-06 03:23:05 UTC (rev 9794) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configu= ration.xml 2008-02-06 06:11:36 UTC (rev 9795) @@ -193,52 +193,62 @@ - Setting up the email service - To be able to use the email service (for example to verify use= r emails when someone subscribes or for CMS - workflow notifications) it has to be configured correctly. To config= ure it, go to - jboss-portal.sar/portal-core.sar/META-INF/jboss-service.xml= . - In this file, the mail module is configured like this: - - - jboss:service=3DMail - portal:service=3DModule,type=3DIdentityServiceController - -1 - localhost - - - false - 100000 - 10000 - java:portal/MailModule -]]> - Here you can specify a different SMTP server than localhost, then= precise the SMTP username and SMTP password to - use to send emails. - For example, to use GMail's SMTP server: - - - jboss:service=3DMail - portal:service=3DModule,type=3DIdentityServiceController - -1 - smtp.gmail.com - username(a)gmail.com - myPassword - false - 100000 - 10000 - java:portal/MailModule -]]> + Setting up the Email Service + + If you have a standard setup and a mail server installed, the email= service should work without any extra configuration. Most Linux distributi= ons have a mail server installed by default. The email service, for example= , can be used to verify a user's email address when a user subscribes, or f= or CMS workflow notifications. - If you have a 'standard' setup and a mail server install= ed - (That's the case on most Linux distribution out of the box), it will= work out of the box. - + + The email service is configured using the $JBOSS_HOME/ser= ver/default/deploy/jboss-portal.sar/META-INF/jboss-service.xml f= ile. The following is an example of the section which is used to configure = the email service: + + + + +jboss:service=3DMail +portal:service=3DModule,type=3DIdentityServiceController +-1 +localhost + + +false +100000 +10000 +java:portal/MailModule +]]> + + + + A different SMTP server (other than localhost) can be configured, along = with a SMTP username and an SMTP password. The following is an example conf= iguration that uses the Gmail SMTP server: + + + + +jboss:service=3DMail +portal:service=3DModule,type=3DIdentityServiceController +-1 +smtp.gmail.com +username(a)gmail.com +myPassword +false +100000 +10000 +java:portal/MailModule +]]> + + + + Using this example, replace username(a)gmail.com and myPassword with your correct= Gmail username and password. + + Setting up proxy settings There are a couple of scenarios where you will need your proxy= to be correctly defined at the JVM --===============2204925966633130080==-- From portal-commits at lists.jboss.org Wed Feb 6 02:04:43 2008 Content-Type: multipart/mixed; boundary="===============3132436281095329158==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9796 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Wed, 06 Feb 2008 02:04:41 -0500 Message-ID: --===============3132436281095329158== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-06 02:04:41 -0500 (Wed, 06 Feb 2008) New Revision: 9796 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configur= ation.xml Log: rephrasing 3.6. Disabling Dynamic Proxy Un-wrapping Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/c= onfiguration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configu= ration.xml 2008-02-06 06:11:36 UTC (rev 9795) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configu= ration.xml 2008-02-06 07:04:41 UTC (rev 9796) @@ -250,7 +250,7 @@ - Setting up proxy settings + Configuring proxy settings There are a couple of scenarios where you will need your proxy= to be correctly defined at the JVM level so that you can access documents from Internet. It could be to= get the thirdparty libraries if you decided to build JBoss Portal from the sources, to access RSS feeds = or weather information in the samples @@ -261,19 +261,20 @@ is enough. - Disabling dynamic proxy unwrapping - JBoss Portal use the JBoss Microkernel for the service infr= astructure. The JBoss Microkernel provides - injection of services into other services, also known as wiring. = Unfortunately it is only possible to inject - dynamic proxies that talks to the MBeanServer due to the fact the= Microkernel is JMX based. The overhead - at runtime is minimal since the Microkernel implementation is hig= hly optimized, however when it is used - with Java 5 a noticeable bottleneck appears due to the fact that = the implementation - of the JMX API classes javax.management.* pr= ovided by the Java Platform performs synchronization. This does - not happen under JDK 1.4 since those classes are implemented by J= Boss MX. - JBoss Portal services use a special kind of Model MBean cal= led JBossServiceModelMBean which allows to - unwrap the injected dynamic proxies and replace them by the real = POJO services. This allows to remove the - bottleneck with Java 5 and provide an extra boost of performances= on JDK 1.4. By default that feature - is enabled but it is possible to disabled it using command line a= rguments. - run.sh -Dportal.kernel.no_proxies=3Dfalse]]> + Disabling Dynamic Proxy Un-wrapping + JBoss Portal uses the JBoss Microkernel for the service inf= rastructure. The JBoss Microkernel provides injection of services into othe= r services, also known as wiring. It is only possible to inject + dynamic proxies that talk to the MBeanServer, due to the Microker= nel being JMX based. The overhead + at runtime is minimal since the Microkernel implementation is hig= hly optimized; however, when it is used + with Java 5, a noticeable bottleneck appears due to the fact that= the implementation + of the JMX API classes, javax.management.*, = provided by the Java Platform, performs synchronization. This does not occu= r under JDK 1.4 since those classes are implemented by JBoss MX. + + + JBoss Portal services use a special kind of Model MBean called JBossServiceModelMBean, which allows the un-wrapping of inject= ed dynamic proxies, and replaces them with real plain old java object (POJO= ) services. This allows the removal of the bottleneck with Java 5, and also= provides a performance boost on JDK 1.4. By default this feature is enable= d, but it is possible to disabled is using the following command: + + + + + --===============3132436281095329158==-- From portal-commits at lists.jboss.org Wed Feb 6 02:59:21 2008 Content-Type: multipart/mixed; boundary="===============1008490203286143752==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9797 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Wed, 06 Feb 2008 02:55:21 -0500 Message-ID: --===============1008490203286143752== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-06 02:55:21 -0500 (Wed, 06 Feb 2008) New Revision: 9797 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configur= ation.xml Log: minor corrections to my revision: 3.6. Disabling Dynamic Proxy Un-wrapping Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/c= onfiguration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configu= ration.xml 2008-02-06 07:04:41 UTC (rev 9796) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configu= ration.xml 2008-02-06 07:55:21 UTC (rev 9797) @@ -262,19 +262,23 @@ Disabling Dynamic Proxy Un-wrapping - JBoss Portal uses the JBoss Microkernel for the service inf= rastructure. The JBoss Microkernel provides injection of services into othe= r services, also known as wiring. It is only possible to inject - dynamic proxies that talk to the MBeanServer, due to the Microker= nel being JMX based. The overhead - at runtime is minimal since the Microkernel implementation is hig= hly optimized; however, when it is used - with Java 5, a noticeable bottleneck appears due to the fact that= the implementation - of the JMX API classes, javax.management.*, = provided by the Java Platform, performs synchronization. This does not occu= r under JDK 1.4 since those classes are implemented by JBoss MX. + JBoss Portal uses the JBoss Microkernel for the service infras= tructure. The JBoss Microkernel provides injection of services into other s= ervices, otherwise known as wiring. Due to the Microkernel being JMX based,= tt is only possible to inject dynamic proxies that talk to the MBeanServer= . The overhead at runtime is minimal since the Microkernel implementation i= s highly optimized; however, when it is used with Java 5, a noticeable bott= leneck appears due to the fact that the implementation of the JMX API class= es, javax.management.*, provided by the Java Platform,= performs synchronization. This does not occur under JDK 1.4 since those cl= asses are implemented by JBoss MX. - JBoss Portal services use a special kind of Model MBean called JBossServiceModelMBean, which allows the un-wrapping of inject= ed dynamic proxies, and replaces them with real plain old java object (POJO= ) services. This allows the removal of the bottleneck with Java 5, and also= provides a performance boost on JDK 1.4. By default this feature is enable= d, but it is possible to disabled is using the following command: + JBoss Portal services use a special kind of Model MBean called JBossServiceModelMBean, which allows the un-wrapping of inject= ed dynamic proxies, and replaces them with real plain old java object (POJO= ) services. This allows the removal of the bottleneck with Java 5, and also= provides a performance boost on JDK 1.4. By default this feature is enable= d, but it is possible to disable. To do this on Linux systems, change into = the $JBOSS_HOME/bin/ directory and run the following c= ommand: - + +./run.sh -Dportal.kernel.no_proxies=3Dfalse + + On Microsoft Windows systems, run the following command: + + + +run.bat -Dportal.kernel.no_proxies=3Dfalse + + --===============1008490203286143752==-- From portal-commits at lists.jboss.org Wed Feb 6 09:10:01 2008 Content-Type: multipart/mixed; boundary="===============3703467594509137225==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9798 - modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF. Date: Wed, 06 Feb 2008 09:10:01 -0500 Message-ID: --===============3703467594509137225== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-06 09:10:01 -0500 (Wed, 06 Feb 2008) New Revision: 9798 Removed: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= portal.xml Log: remove portal.xml after all, we'll use a jsp taglib Deleted: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WE= B-INF/portal.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.xml 2008-02-06 07:55:21 UTC (rev 9797) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.xml 2008-02-06 14:10:01 UTC (rev 9798) @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - --===============3703467594509137225==-- From portal-commits at lists.jboss.org Wed Feb 6 09:28:44 2008 Content-Type: multipart/mixed; boundary="===============1034704858516198166==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9799 - modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api. Date: Wed, 06 Feb 2008 09:28:44 -0500 Message-ID: --===============1034704858516198166== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-06 09:28:44 -0500 (Wed, 06 Feb 2008) New Revision: 9799 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletContextImpl.java Log: implement PortletContext container runtime options support Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/PortletContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletContextImpl.java 2008-02-06 14:10:01 UTC (rev 9798) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletContextImpl.java 2008-02-06 14:28:44 UTC (rev 9799) @@ -23,6 +23,7 @@ package org.jboss.portal.portlet.impl.jsr168.api; = import org.jboss.portal.common.NotYetImplemented; +import org.jboss.portal.common.util.Tools; import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo; = import javax.portlet.PortletContext; @@ -34,6 +35,7 @@ import java.net.URL; import java.util.Enumeration; import java.util.Set; +import java.util.Collections; = /** * @author Julien Viet @@ -48,6 +50,9 @@ /** . */ private ContainerPortletApplicationInfo info; = + /** . */ + private final Set supportedOptions =3D Tools.toSet("javax.portl= et.actionScopedRequestAttributes","javax.portlet.escapeXml"); + public PortletContextImpl(ServletContext servletContext) { this.servletContext =3D servletContext; @@ -190,6 +195,6 @@ = public Enumeration getContainerRuntimeOptions() { - throw new NotYetImplemented(); + return Collections.enumeration(supportedOptions); } } --===============1034704858516198166==-- From portal-commits at lists.jboss.org Wed Feb 6 09:33:26 2008 Content-Type: multipart/mixed; boundary="===============3665113968712924573==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9800 - modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api. Date: Wed, 06 Feb 2008 09:33:26 -0500 Message-ID: --===============3665113968712924573== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-06 09:33:26 -0500 (Wed, 06 Feb 2008) New Revision: 9800 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletConfigImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletContextImpl.java Log: implement PortletContext container runtime options support Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/PortletConfigImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletConfigImpl.java 2008-02-06 14:28:44 UTC (rev 9799) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletConfigImpl.java 2008-02-06 14:33:26 UTC (rev 9800) @@ -85,16 +85,27 @@ } = // - Map containerRuntimeOptions; - if (portletInfo.getOptions().size() > 0) + ParameterMap tmp =3D null; + for (ContainerOptionInfo option : portletInfo.getOptions().values()) { - ParameterMap tmp =3D new ParameterMap(ParameterMap.AccessMode.get= (true, false)); - for (ContainerOptionInfo option : portletInfo.getOptions().values= ()) + String name =3D option.getName(); + if (PortletContextImpl.SUPPORTED_OPTIONS.contains(name)) { - String name =3D option.getName(); + if (tmp =3D=3D null) + { + tmp =3D new ParameterMap(ParameterMap.AccessMode.get(true, = false)); + } + + // String[] values =3D option.getValues().toArray(new String[opti= on.getValues().size()]); tmp.setValues(name, values); } + } + + // + Map containerRuntimeOptions; + if (tmp !=3D null) + { containerRuntimeOptions =3D Collections.unmodifiableMap(tmp); } else Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/PortletContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletContextImpl.java 2008-02-06 14:28:44 UTC (rev 9799) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletContextImpl.java 2008-02-06 14:33:26 UTC (rev 9800) @@ -22,7 +22,6 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.impl.jsr168.api; = -import org.jboss.portal.common.NotYetImplemented; import org.jboss.portal.common.util.Tools; import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo; = @@ -51,7 +50,7 @@ private ContainerPortletApplicationInfo info; = /** . */ - private final Set supportedOptions =3D Tools.toSet("javax.portl= et.actionScopedRequestAttributes","javax.portlet.escapeXml"); + public static final Set SUPPORTED_OPTIONS =3D Collections.unmod= ifiableSet(Tools.toSet("javax.portlet.actionScopedRequestAttributes","javax= .portlet.escapeXml")); = public PortletContextImpl(ServletContext servletContext) { @@ -195,6 +194,6 @@ = public Enumeration getContainerRuntimeOptions() { - return Collections.enumeration(supportedOptions); + return Collections.enumeration(SUPPORTED_OPTIONS); } } --===============3665113968712924573==-- From portal-commits at lists.jboss.org Wed Feb 6 09:34:18 2008 Content-Type: multipart/mixed; boundary="===============0949539137986230802==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9801 - modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api. Date: Wed, 06 Feb 2008 09:34:17 -0500 Message-ID: --===============0949539137986230802== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-06 09:34:17 -0500 (Wed, 06 Feb 2008) New Revision: 9801 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletContextImpl.java Log: update server info in PortletContext Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/PortletContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletContextImpl.java 2008-02-06 14:33:26 UTC (rev 9800) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletContextImpl.java 2008-02-06 14:34:17 UTC (rev 9801) @@ -59,7 +59,7 @@ = public String getServerInfo() { - return "JBossPortal/" + 1 + "." + 0; + return "JBossPortletContainer/" + 2 + "." + 0; } = public PortletRequestDispatcher getRequestDispatcher(String path) --===============0949539137986230802==-- From portal-commits at lists.jboss.org Wed Feb 6 10:25:42 2008 Content-Type: multipart/mixed; boundary="===============8784705281178220319==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9802 - modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info. Date: Wed, 06 Feb 2008 10:25:41 -0500 Message-ID: --===============8784705281178220319== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-06 10:25:41 -0500 (Wed, 06 Feb 2008) New Revision: 9802 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerInfoBuilder.java Log: fixed an issue I introduced yesterday Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/info/ContainerInfoBuilder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerInfoBuilder.java 2008-02-06 14:34:17 UTC (rev 9801) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerInfoBuilder.java 2008-02-06 15:25:41 UTC (rev 9802) @@ -605,8 +605,8 @@ containerCache, containerSession, portletMD.getPortletName(), + portletMD.getPortletClass(), context.getApplicationName(), - portletMD.getPortletClass(), Collections.unmodifiableMap(initParameters), false, context.getBundleManager(portletMD) --===============8784705281178220319==-- From portal-commits at lists.jboss.org Wed Feb 6 11:10:42 2008 Content-Type: multipart/mixed; boundary="===============8541962681059475414==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9803 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api and 2 other directories. Date: Wed, 06 Feb 2008 11:10:42 -0500 Message-ID: --===============8541962681059475414== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-06 11:10:42 -0500 (Wed, 06 Feb 2008) New Revision: 9803 Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/dispatcher/AbstractDispatchedSessionTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/dispatcher/ApplicationScopeDispatchedSessionTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/dispatcher/PortletScopeDispatchedSessionTestCase.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/DispatchedHttpServletRequest.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletContextImpl.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/dispatcher/ContentTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/dispatcher/DispatchingFilterTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/dispatcher/FiltersTestCase.java modules/portlet/trunk/test/src/test/resources/jsr286/ext/dispatcher-war/= WEB-INF/portlet.xml Log: implement and test javax.portlet.servletDefaultSessionScope feature Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/DispatchedHttpServletRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/DispatchedHttpServletRequest.java 2008-02-06 15:25:41 UTC (rev 98= 02) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/DispatchedHttpServletRequest.java 2008-02-06 16:10:42 UTC (rev 98= 03) @@ -32,7 +32,6 @@ import javax.servlet.ServletContext; import javax.servlet.ServletRequest; import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpServletRequestWrapper; import javax.portlet.PortletSession; @@ -42,6 +41,7 @@ import javax.portlet.ResourceRequest; import javax.portlet.EventRequest; import javax.portlet.RenderRequest; +import javax.portlet.PortletConfig; import java.security.Principal; import java.util.Enumeration; import java.util.Locale; @@ -118,7 +118,7 @@ private final Map parameters; = /** . */ - private final int sessionScope =3D PortletSession.APPLICATION_SCOPE; + private final int sessionScope; = /** . */ private final LinkedList> containerAttributesStack; @@ -130,7 +130,7 @@ private final ServletContext servletContext; = /** . */ - private DispatchedHttpSession[] session; + private DispatchedHttpSession session; = public DispatchedHttpServletRequest( Dispatch dispatch, @@ -140,12 +140,22 @@ { super(dreq); = + PortletConfig config =3D (PortletConfig)dreq.getAttribute(Constants.= JAVAX_PORTLET_CONFIG); + Map options =3D config.getContainerRuntimeOptions(= ); + String[] sessionScopeOption =3D options.get("javax.portlet.servletDe= faultSessionScope"); + int sessionScope =3D PortletSession.APPLICATION_SCOPE; + if (sessionScopeOption !=3D null && sessionScopeOption.length > 0 &&= "PORTLET_SCOPE".equals(sessionScopeOption[0])) + { + sessionScope =3D PortletSession.PORTLET_SCOPE; + } + // this.dispatchType =3D dispatch.getType(); this.preq =3D preq; this.dreq =3D dreq; this.servletContext =3D servletContext; this.containerAttributesStack =3D new LinkedList= >(); + this.sessionScope =3D sessionScope; = // Push dispatch this.infos =3D pushDispatch(dispatch); @@ -473,7 +483,7 @@ = public final HttpSession getSession(boolean b) { - return getSession(b, PortletSession.APPLICATION_SCOPE); + return getSession(b, sessionScope); } = public final HttpSession getSession() @@ -665,19 +675,14 @@ */ private HttpSession getSession(boolean create, int scope) { - if (session =3D=3D null) - { - session =3D new DispatchedHttpSession[2]; - } - // Dereference an existing session if necessary - if (session[scope] !=3D null && !session[scope].isValid()) + if (session !=3D null && !session.isValid()) { - session[scope] =3D null; + session =3D null; } = // If we have a session here we are sure it is valid and ok to retur= n it - if (session[scope] !=3D null) + if (session !=3D null) { // So we do nothing } @@ -685,7 +690,7 @@ { // For sure we need a session we will obtain a valid one PortletSession portletSession =3D preq.getPortletSession(); - session[scope] =3D new DispatchedHttpSession(this, portletSession= , scope); + session =3D new DispatchedHttpSession(this, portletSession, scope= ); } else { @@ -695,12 +700,12 @@ // if (portletSession !=3D null) { - session[scope] =3D new DispatchedHttpSession(this, portletSess= ion, scope); + session =3D new DispatchedHttpSession(this, portletSession, sc= ope); } } = // - return session[scope]; + return session; } = // Subclasses Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/PortletContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletContextImpl.java 2008-02-06 15:25:41 UTC (rev 9802) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletContextImpl.java 2008-02-06 16:10:42 UTC (rev 9803) @@ -50,7 +50,10 @@ private ContainerPortletApplicationInfo info; = /** . */ - public static final Set SUPPORTED_OPTIONS =3D Collections.unmod= ifiableSet(Tools.toSet("javax.portlet.actionScopedRequestAttributes","javax= .portlet.escapeXml")); + public static final Set SUPPORTED_OPTIONS =3D Collections.unmod= ifiableSet(Tools.toSet( + "javax.portlet.actionScopedRequestAttributes", + "javax.portlet.escapeXml", + "javax.portlet.servletDefaultSessionScope")); = public PortletContextImpl(ServletContext servletContext) { Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/ext/dispatcher/AbstractDispatchedSessionTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/dispatcher/AbstractDispatchedSessionTestCase.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/dispatcher/AbstractDispatchedSessionTestCase.java 2008-02-06 = 16:10:42 UTC (rev 9803) @@ -0,0 +1,153 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.test.portlet.jsr286.ext.dispatcher; + +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.JoinPoint; +import org.jboss.portal.unit.base.AbstractUniversalTestPortlet; +import org.jboss.portal.unit.actions.ServletServiceTestAction; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.portal.test.portlet.framework.UTS1; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import static org.jboss.unit.api.Assert.*; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; + +import javax.servlet.Servlet; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; +import javax.portlet.PortletException; +import javax.portlet.RenderResponse; +import javax.portlet.Portlet; +import javax.portlet.PortletRequestDispatcher; +import javax.portlet.RenderRequest; +import javax.portlet.PortletSession; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public abstract class AbstractDispatchedSessionTestCase +{ + public AbstractDispatchedSessionTestCase( + PortletTestCase seq, + JoinPoint portletJoinPoint, + final int sessionScope) + { + seq.bindAction(0, portletJoinPoint, new PortletRenderTestAction() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + PortletRequestDispatcher dispatcher =3D ((AbstractUniversalTes= tPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA= "); + assertNotNull(dispatcher); + dispatcher.include(request, response); + + // + PortletSession session =3D request.getPortletSession(false); + assertNotNull(session); + assertTrue(session.isNew()); + assertEquals("foo_dispatched_value", session.getAttribute("foo= ", sessionScope)); + + // + return new InvokeGetResponse(response.createRenderURL().toStri= ng()); + } + }); + seq.bindAction(0, UTS1.SERVICE_JOIN_POINT, new ServletServiceTestAct= ion() + { + public DriverResponse execute(Servlet servlet, HttpServletRequest= request, HttpServletResponse response, PortletTestContext context) throws = ServletException, IOException + { + HttpSession session =3D request.getSession(false); + assertNull(session); + + // + session =3D request.getSession(); + assertNotNull(session); + assertTrue(session.isNew()); + session.setAttribute("foo", "foo_dispatched_value"); + assertEquals("foo_dispatched_value", session.getAttribute("foo= ")); + + // + return null; + } + }); + seq.bindAction(1, portletJoinPoint, new PortletRenderTestAction() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + PortletSession session =3D request.getPortletSession(false); + assertNotNull(session); + assertFalse(session.isNew()); + assertEquals("foo_dispatched_value", session.getAttribute("foo= ", sessionScope)); + + // + PortletRequestDispatcher dispatcher =3D ((AbstractUniversalTes= tPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA= "); + assertNotNull(dispatcher); + dispatcher.include(request, response); + + // + try + { + session.isNew(); + fail(); + } + catch (IllegalStateException ignore) + { + } + + // + return new EndTestResponse(); + } + }); + seq.bindAction(1, UTS1.SERVICE_JOIN_POINT, new ServletServiceTestAct= ion() + { + public DriverResponse execute(Servlet servlet, HttpServletRequest= request, HttpServletResponse response, PortletTestContext context) throws = ServletException, IOException + { + HttpSession session =3D request.getSession(false); + assertNotNull(session); + assertFalse(session.isNew()); + assertEquals("foo_dispatched_value", session.getAttribute("foo= ")); + + // + session.invalidate(); + + try + { + session.isNew(); + fail(); + } + catch (IllegalStateException ignore) + { + } + + // + return null; + } + }); + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/ext/dispatcher/ApplicationScopeDispatchedSessionTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/dispatcher/ApplicationScopeDispatchedSessionTestCase.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/dispatcher/ApplicationScopeDispatchedSessionTestCase.java 200= 8-02-06 16:10:42 UTC (rev 9803) @@ -0,0 +1,43 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.test.portlet.jsr286.ext.dispatcher; + +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.JoinPoint; +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.test.portlet.framework.UTP1; + +import javax.portlet.PortletSession; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)TestCase +public class ApplicationScopeDispatchedSessionTestCase extends AbstractDis= patchedSessionTestCase +{ + public ApplicationScopeDispatchedSessionTestCase(PortletTestCase seq) + { + super(seq, UTP1.RENDER_JOIN_POINT, PortletSession.APPLICATION_SCOPE); + } +} Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/ext/dispatcher/ContentTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/dispatcher/ContentTestCase.java 2008-02-06 15:25:41 UTC (rev = 9802) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/dispatcher/ContentTestCase.java 2008-02-06 16:10:42 UTC (rev = 9803) @@ -27,6 +27,7 @@ import org.jboss.portal.unit.annotations.TestCase; import org.jboss.portal.unit.actions.PortletRenderTestAction; import org.jboss.portal.test.portlet.framework.UTP4; +import org.jboss.portal.test.portlet.framework.UTP1; import org.jboss.unit.driver.DriverResponse; import org.jboss.unit.driver.response.EndTestResponse; import static org.jboss.unit.api.Assert.*; @@ -49,7 +50,7 @@ { public ContentTestCase(PortletTestCase seq) { - seq.bindAction(0, UTP4.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() { protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException { @@ -69,7 +70,7 @@ return new InvokeGetResponse(response.createRenderURL().toStri= ng()); } }); - seq.bindAction(1, UTP4.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() { protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException { @@ -95,7 +96,7 @@ return new InvokeGetResponse(response.createRenderURL().toStri= ng()); } }); - seq.bindAction(2, UTP4.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + seq.bindAction(2, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() { protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException { @@ -122,7 +123,7 @@ return new InvokeGetResponse(response.createRenderURL().toStri= ng()); } }); - seq.bindAction(3, UTP4.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + seq.bindAction(3, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() { protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException { @@ -149,7 +150,7 @@ return new InvokeGetResponse(response.createRenderURL().toStri= ng()); } }); - seq.bindAction(4, UTP4.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + seq.bindAction(4, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() { protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException { Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/ext/dispatcher/DispatchingFilterTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/dispatcher/DispatchingFilterTestCase.java 2008-02-06 15:25:41= UTC (rev 9802) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/dispatcher/DispatchingFilterTestCase.java 2008-02-06 16:10:42= UTC (rev 9803) @@ -26,6 +26,7 @@ import org.jboss.portal.unit.PortletTestContext; import org.jboss.portal.unit.actions.PortletRenderTestAction; import org.jboss.portal.test.portlet.framework.UTP3; +import org.jboss.portal.test.portlet.framework.UTP1; import org.jboss.portal.unit.annotations.TestCase; import org.jboss.unit.driver.DriverResponse; import org.jboss.unit.driver.response.EndTestResponse; @@ -47,7 +48,7 @@ { public DispatchingFilterTestCase(PortletTestCase seq) { - seq.bindAction(0, UTP3.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() { protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException { Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/ext/dispatcher/FiltersTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/dispatcher/FiltersTestCase.java 2008-02-06 15:25:41 UTC (rev = 9802) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/dispatcher/FiltersTestCase.java 2008-02-06 16:10:42 UTC (rev = 9803) @@ -26,6 +26,7 @@ import org.jboss.portal.unit.PortletTestContext; import org.jboss.portal.unit.actions.PortletRenderTestAction; import org.jboss.portal.test.portlet.framework.UTP2; +import org.jboss.portal.test.portlet.framework.UTP1; import org.jboss.portal.common.util.Tools; import org.jboss.portal.unit.annotations.TestCase; import org.jboss.unit.driver.DriverResponse; @@ -50,7 +51,7 @@ { public FiltersTestCase(PortletTestCase seq) { - seq.bindAction(0, UTP2.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() { protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException { Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/ext/dispatcher/PortletScopeDispatchedSessionTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/dispatcher/PortletScopeDispatchedSessionTestCase.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/dispatcher/PortletScopeDispatchedSessionTestCase.java 2008-02= -06 16:10:42 UTC (rev 9803) @@ -0,0 +1,44 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.test.portlet.jsr286.ext.dispatcher; + +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.JoinPoint; +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.portal.test.portlet.framework.UTP2; + +import javax.portlet.PortletSession; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)TestCase +public class PortletScopeDispatchedSessionTestCase extends AbstractDispatc= hedSessionTestCase +{ + public PortletScopeDispatchedSessionTestCase(PortletTestCase seq) + { + super(seq, UTP2.RENDER_JOIN_POINT, PortletSession.PORTLET_SCOPE); + } +} \ No newline at end of file Modified: modules/portlet/trunk/test/src/test/resources/jsr286/ext/dispatch= er-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/ext/dispatcher-war= /WEB-INF/portlet.xml 2008-02-06 15:25:41 UTC (rev 9802) +++ modules/portlet/trunk/test/src/test/resources/jsr286/ext/dispatcher-war= /WEB-INF/portlet.xml 2008-02-06 16:10:42 UTC (rev 9803) @@ -22,10 +22,10 @@ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. = ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~--> = - + xsi:schemaLocation=3D"http://java.sun.com/xml/ns/portlet/port= let-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" + version=3D"2.0"> = = @@ -48,28 +48,10 @@ + + javax.portlet.servletDefaultSessionScope + PORTLET_SCOPE + = - - TestUniversalPortletC - org.jboss.portal.test.portlet.framework.UTP3 - - text/html - - - - - - - - TestUniversalPortletD - org.jboss.portal.test.portlet.framework.UTP4 - - text/html - - - - - - --===============8541962681059475414==-- From portal-commits at lists.jboss.org Wed Feb 6 11:52:29 2008 Content-Type: multipart/mixed; boundary="===============7495978176569319967==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9804 - in modules/portlet/trunk/test/src: main/java/org/jboss/portal/portlet/test/taglib and 2 other directories. Date: Wed, 06 Feb 2008 11:52:29 -0500 Message-ID: --===============7495978176569319967== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-06 11:52:29 -0500 (Wed, 06 Feb 2008) New Revision: 9804 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/t= aglib/ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/t= aglib/PageTag.java modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= portal.tld modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.jsp Log: taglib blah Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/taglib/PageTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= taglib/PageTag.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= taglib/PageTag.java 2008-02-06 16:52:29 UTC (rev 9804) @@ -0,0 +1,50 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.taglib; + +import javax.servlet.jsp.tagext.TagSupport; +import javax.servlet.jsp.tagext.BodyTagSupport; +import javax.servlet.jsp.JspException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PageTag extends BodyTagSupport +{ + + public int doStartTag() throws JspException + { + System.out.println("START"); + + + return EVAL_BODY_INCLUDE; + } + + public int doEndTag() throws JspException + { + System.out.println("END"); + + return EVAL_PAGE; + } +} Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-= INF/portal.tld =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.tld (rev 0) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.tld 2008-02-06 16:52:29 UTC (rev 9804) @@ -0,0 +1,17 @@ + + + + + 1.0 + portal + + + page + org.jboss.portal.portlet.test.taglib.PageTag + JSP + + + Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/inde= x.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-06 16:52:29 UTC (rev 9804) @@ -0,0 +1,11 @@ +<%@ page language=3D"java" %> +<%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> +<%@ taglib uri=3D"http://java.sun.com/portlet" prefix=3D"portlet" %> +<%@ page isELIgnored=3D"false" %> + + + + HELLO!!! + + + --===============7495978176569319967==-- From portal-commits at lists.jboss.org Wed Feb 6 13:53:08 2008 Content-Type: multipart/mixed; boundary="===============7999126831064611902==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9805 - in modules/portlet/trunk/test/src: main/java/org/jboss/portal/portlet/test/controller and 6 other directories. Date: Wed, 06 Feb 2008 13:49:08 -0500 Message-ID: --===============7999126831064611902== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-06 13:49:08 -0500 (Wed, 06 Feb 2008) New Revision: 9805 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerServlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/BufferingResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/BytesChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/CharsChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/Chunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/PortletChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/ResponseBuffer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTag.java Removed: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= classes/ Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletURLRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PageTag.java modules/portlet/trunk/test/src/test/build.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= portal.tld modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= web.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.jsp Log: add support for response buffering Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletURLRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-06 16:52:29 UTC (rev 9804) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-06 18:49:08 UTC (rev 9805) @@ -90,6 +90,7 @@ buffer.append(':'); buffer.append(Integer.toString(clientReq.getServerPort())); buffer.append(clientReq.getContextPath()); + buffer.append(clientReq.getServletPath()); buffer.append('/'); buffer.append(StringCodec.encode(windowId)); = Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/ControllerServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerServlet.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerServlet.java 2008-02-06 18:49:08 UTC (rev 9805) @@ -0,0 +1,87 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp; + +import org.jboss.portal.portlet.test.jsp.response.ResponseBuffer; +import org.jboss.portal.portlet.test.jsp.response.Chunk; +import org.jboss.portal.portlet.test.jsp.response.BytesChunk; +import org.jboss.portal.portlet.test.jsp.response.CharsChunk; +import org.jboss.portal.portlet.test.jsp.response.PortletChunk; +import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; + +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.ServletException; +import javax.servlet.RequestDispatcher; +import java.io.IOException; +import java.io.PrintWriter; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ControllerServlet extends HttpServlet +{ + + + protected void service(HttpServletRequest req, HttpServletResponse resp= ) throws ServletException, IOException + { + RequestDispatcher dispatcher =3D req.getRequestDispatcher("/index.js= p"); + + // + BufferingResponse bufferingResponse =3D new BufferingResponse(resp); + + // + dispatcher.include(req, bufferingResponse); + + // + ResponseBuffer buffer =3D bufferingResponse.getBuffer(); + buffer.close(); + + // + resp.setContentType("text/html"); + PrintWriter writer =3D resp.getWriter(); + for (Chunk chunk : buffer.getChunks()) + { + if (chunk instanceof BytesChunk) + { + BytesChunk bytesChunk =3D (BytesChunk)chunk; + writer.write(new String(bytesChunk.getBytes())); + } + else if (chunk instanceof CharsChunk) + { + CharsChunk bytesChunk =3D (CharsChunk)chunk; + writer.write(bytesChunk.getChars()); + } + else if (chunk instanceof PortletChunk) + { + PortletChunk portletChunk =3D (PortletChunk)chunk; + writer.write("Portlet[" + portletChunk.getPortletName() + "," = + portletChunk.getApplicationName() + "]"); + } + } + + // + writer.close(); + } +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/response/BufferingResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/BufferingResponse.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/BufferingResponse.java 2008-02-06 18:49:08 UTC (rev 9805) @@ -0,0 +1,73 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.response; + +import org.jboss.portal.portlet.test.jsp.response.ResponseBuffer; +import org.jboss.portal.portlet.test.jsp.response.Chunk; + +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpServletResponseWrapper; +import javax.servlet.ServletOutputStream; +import java.io.IOException; +import java.io.PrintWriter; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class BufferingResponse extends HttpServletResponseWrapper +{ + + /** . */ + private final ResponseBuffer buffer =3D new ResponseBuffer(); + + public BufferingResponse(HttpServletResponse response) + { + super(response); + } + + public ResponseBuffer getBuffer() + { + return buffer; + } + + public ServletOutputStream getOutputStream() throws IOException + { + return buffer.getOutputStream(); + } + + public PrintWriter getWriter() throws IOException + { + return buffer.getWriter(); + } + + public void close() + { + buffer.close(); + } + + public void addChunk(Chunk chunk) + { + buffer.addChunk(chunk); + } +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/response/BytesChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/BytesChunk.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/BytesChunk.java 2008-02-06 18:49:08 UTC (rev 9805) @@ -0,0 +1,44 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.response; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class BytesChunk extends Chunk +{ + + /** . */ + private final byte[] bytes; + + public BytesChunk(byte[] bytes) + { + this.bytes =3D bytes; + } + + public byte[] getBytes() + { + return bytes; + } +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/response/CharsChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/CharsChunk.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/CharsChunk.java 2008-02-06 18:49:08 UTC (rev 9805) @@ -0,0 +1,44 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.response; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class CharsChunk extends Chunk +{ + + /** . */ + private final char[] chars; + + public CharsChunk(char[] chars) + { + this.chars =3D chars; + } + + public char[] getChars() + { + return chars; + } +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/response/Chunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/Chunk.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/Chunk.java 2008-02-06 18:49:08 UTC (rev 9805) @@ -0,0 +1,34 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.response; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class Chunk +{ + + = + +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/response/PortletChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/PortletChunk.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/PortletChunk.java 2008-02-06 18:49:08 UTC (rev 9805) @@ -0,0 +1,53 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.response; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletChunk extends Chunk +{ + + /** . */ + private final String portletName; + + /** . */ + private final String applicationName; + + public PortletChunk(String portletName, String applicationName) + { + this.portletName =3D portletName; + this.applicationName =3D applicationName; + } + + public String getPortletName() + { + return portletName; + } + + public String getApplicationName() + { + return applicationName; + } +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/response/ResponseBuffer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/ResponseBuffer.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/ResponseBuffer.java 2008-02-06 18:49:08 UTC (rev 9805) @@ -0,0 +1,181 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.response; + +import javax.servlet.ServletOutputStream; +import java.io.IOException; +import java.io.ByteArrayOutputStream; +import java.io.StringWriter; +import java.io.PrintWriter; +import java.util.LinkedList; +import java.util.List; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ResponseBuffer +{ + + /** . */ + private final List chunks =3D new LinkedList(); + + /** . */ + private ChunkOutputStream chunkOutputStream; + + /** . */ + private ChunkWriter chunkWriter; + + /** . */ + private PrintWriter writer; + + public List getChunks() + { + return chunks; + } + + public void close() + { + try + { + if (chunkWriter !=3D null) + { + chunkWriter.close(); + } + else if (chunkOutputStream !=3D null) + { + chunkOutputStream.close(); + } + } + catch (IOException e) + { + e.printStackTrace(); + } + } + + public ServletOutputStream getOutputStream() + { + if (chunkOutputStream =3D=3D null) + { + if (writer !=3D null) + { + throw new IllegalStateException(); + } + + // + chunkOutputStream =3D new ChunkOutputStream(); + } + + // + return chunkOutputStream; + } + + public PrintWriter getWriter() + { + if (chunkWriter =3D=3D null) + { + if (chunkOutputStream !=3D null) + { + throw new IllegalStateException(); + } + + // + chunkWriter =3D new ChunkWriter(); + writer =3D new PrintWriter(chunkWriter); + } + + // + return writer; + } + + public void addChunk(Chunk chunk) + { + if (chunkWriter !=3D null) + { + chunkWriter.writeChunk(); + } + else if (chunkOutputStream !=3D null) + { + chunkOutputStream.writeChunk(); + } + + // + chunks.add(chunk); + } + + private class ChunkWriter extends StringWriter + { + + public void writeChunk() + { + StringBuffer sb =3D getBuffer(); + if (sb.length() > 0) + { + char[] chars =3D new char[sb.length()]; + sb.getChars(0, sb.length(), chars, 0); + CharsChunk chunk =3D new CharsChunk(chars); + chunks.add(chunk); + sb.setLength(0); + } + } + + public void close() throws IOException + { + super.close(); + + // + writeChunk(); + } + } + + private class ChunkOutputStream extends ServletOutputStream + { + + /** . */ + private final ByteArrayOutputStream bytebuffer =3D new ByteArrayOutp= utStream(); + + public void write(int b) throws IOException + { + bytebuffer.write(b); + } + + public void writeChunk() + { + if (bytebuffer.size() > 0) + { + byte[] bytes =3D bytebuffer.toByteArray(); + bytebuffer.reset(); + BytesChunk chunk =3D new BytesChunk(bytes); + chunks.add(chunk); + } + } + + public void close() throws IOException + { + super.close(); + + // + writeChunk(); + } + } +} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/jsp/taglib (from rev 9804, modules/portlet/trunk/test/src/main/java/org= /jboss/portal/portlet/test/taglib) Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PageTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= taglib/PageTag.java 2008-02-06 16:52:29 UTC (rev 9804) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageTag.java 2008-02-06 18:49:08 UTC (rev 9805) @@ -20,9 +20,8 @@ * 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.portlet.test.taglib; +package org.jboss.portal.portlet.test.jsp.taglib; = -import javax.servlet.jsp.tagext.TagSupport; import javax.servlet.jsp.tagext.BodyTagSupport; import javax.servlet.jsp.JspException; = Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/taglib/PortletTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-06 18:49:08 UTC (rev 9805) @@ -0,0 +1,73 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.taglib; + +import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; +import org.jboss.portal.portlet.test.jsp.response.PortletChunk; + +import javax.servlet.jsp.tagext.SimpleTagSupport; +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.PageContext; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletTag extends SimpleTagSupport +{ + + /** . */ + private String name; + + /** . */ + private String applicationName; + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name =3D name; + } + + public String getApplicationName() + { + return applicationName; + } + + public void setApplicationName(String applicationName) + { + this.applicationName =3D applicationName; + } + + public void doTag() throws JspException, IOException + { + PageContext pageCtx =3D (PageContext)getJspContext(); + pageCtx.getOut().flush(); + BufferingResponse response =3D (BufferingResponse)pageCtx.getRespons= e(); + response.addChunk(new PortletChunk(name, applicationName)); + } +} Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-06 16:52:29 UTC (= rev 9804) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-06 18:49:08 UTC (= rev 9805) @@ -15,9 +15,6 @@ = - - - = Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/portal.tld =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.tld 2008-02-06 16:52:29 UTC (rev 9804) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.tld 2008-02-06 18:49:08 UTC (rev 9805) @@ -10,8 +10,24 @@ = page - org.jboss.portal.portlet.test.taglib.PageTag + org.jboss.portal.portlet.test.jsp.taglib.PageTag JSP = + + portlet + org.jboss.portal.portlet.test.jsp.taglib.PortletTag + empty + + name + true + java.lang.String + + + applicationName + true + java.lang.String + + + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /web.xml 2008-02-06 16:52:29 UTC (rev 9804) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /web.xml 2008-02-06 18:49:08 UTC (rev 9805) @@ -38,8 +38,16 @@ PortalServlet org.jboss.portal.simple.SimplePortalServlet + + ControllerServlet + org.jboss.portal.portlet.test.jsp.ControllerServlet + PortalServlet - /* + / + + ControllerServlet + /jsp/* + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/i= ndex.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-06 16:52:29 UTC (rev 9804) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-06 18:49:08 UTC (rev 9805) @@ -5,7 +5,11 @@ - HELLO!!! + BEFORE + + AFTER --===============7999126831064611902==-- From portal-commits at lists.jboss.org Wed Feb 6 14:06:10 2008 Content-Type: multipart/mixed; boundary="===============1421916223868970075==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9806 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/taglib and 9 other directories. Date: Wed, 06 Feb 2008 14:02:10 -0500 Message-ID: --===============1421916223868970075== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-06 14:02:10 -0500 (Wed, 06 Feb 2008) New Revision: 9806 Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr286/taglib/ActionURL286Tag.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr286/taglib/GenerateURL286Tag.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr286/taglib/GenerateURL286TagTEI.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr286/taglib/Namespace286Tag.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr286/taglib/RenderURL286Tag.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr286/taglib/ResourceURL286Tag.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr286/taglib/ResourceURL286TagTEI.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr286/taglib/URLParameter286Tag.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr286/taglib/URLProperty286Tag.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr168/ext/taglib/ActionURLTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr168/ext/taglib/DefineObjectsTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr168/ext/taglib/NamespaceTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr168/ext/taglib/RenderURLTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/taglib/ActionURLTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/taglib/NamespaceTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/taglib/RenderURLTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/taglib/ResourceURLTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/taglib/TaglibTestCase.java modules/portlet/trunk/test/src/test/resources/jsr168/ext/taglib-war/acti= onURL.jsp modules/portlet/trunk/test/src/test/resources/jsr168/ext/taglib-war/defi= neObjects.jsp modules/portlet/trunk/test/src/test/resources/jsr168/ext/taglib-war/name= space.jsp modules/portlet/trunk/test/src/test/resources/jsr168/ext/taglib-war/rend= erURL.jsp modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/acti= onURL.jsp modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/defi= neObjects.jsp modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/name= space.jsp modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/rend= erURL.jsp modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/reso= urceURL.jsp Removed: modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/tagl= ib.jsp Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/BaseURLImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/taglib/ActionURLTag.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/taglib/GenerateURLTag.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/taglib/RenderURLTag.java modules/portlet/trunk/portlet/src/main/resources/org/jboss/portal/portle= t/portlet_2_0.tld modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr168/ext/taglib/TaglibTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/taglib/DefineObjectsTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/Assert= ion.java modules/portlet/trunk/test/src/test/resources/jsr168/ext/taglib-war/WEB-= INF/portlet.xml modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/WEB-= INF/portlet.xml Log: - JSR 286 taglib impl Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/BaseURLImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/BaseURLImpl.java 2008-02-06 18:49:08 UTC (rev 9805) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/BaseURLImpl.java 2008-02-06 19:02:10 UTC (rev 9806) @@ -109,17 +109,35 @@ = public void write(Writer writer, boolean b) throws IOException { - EntityEncoder.FULL.encode(toString(), new WriterCharWriter(writer)); + if (b) + { + EntityEncoder.FULL.encode(toString(), new WriterCharWriter(writer= )); + } + else + { + EntityEncoder.BASIC.encode(toString(), new WriterCharWriter(write= r)); = + } } = public void addProperty(String s, String s1) { - throw new NotYetImplemented(); + if (s =3D=3D null) + { + throw new IllegalArgumentException("property name cannot be null"= ); + } + + //TODO: + } = public void setProperty(String s, String s1) { - throw new NotYetImplemented(); + if (s =3D=3D null) + { + throw new IllegalArgumentException("property name cannot be null"= ); + } + + //TODO: } = public String toString() Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/taglib/ActionURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/taglib/ActionURLTag.java 2008-02-06 18:49:08 UTC (rev 9805) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/taglib/ActionURLTag.java 2008-02-06 19:02:10 UTC (rev 9806) @@ -22,6 +22,9 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.impl.jsr168.taglib; = +import javax.portlet.PortletURL; +import javax.portlet.BaseURL; + /** * The actionURL tag for the JSR 168 Portlet specification. *

@@ -45,4 +48,15 @@ { return typeParameter; } + + protected BaseURL generateURL() throws Exception + { + PortletURL newPortletURL =3D (PortletURL)super.generateURL(); + + setWindowState(newPortletURL); + + setPortletMode(newPortletURL); + + return newPortletURL; + } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/taglib/GenerateURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/taglib/GenerateURLTag.java 2008-02-06 18:49:08 UTC (rev 9805) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/taglib/GenerateURLTag.java 2008-02-06 19:02:10 UTC (rev 9806) @@ -22,7 +22,6 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.impl.jsr168.taglib; = -import org.jboss.portal.portlet.impl.jsr168.api.RenderRequestImpl; import org.jboss.portal.portlet.impl.jsr168.api.PortletURLImpl; import org.jboss.portal.portlet.impl.jsr168.api.PortletRequestImpl; = @@ -32,7 +31,7 @@ import javax.portlet.PortletURL; import javax.portlet.WindowState; import javax.portlet.WindowStateException; -import javax.portlet.RenderRequest; +import javax.portlet.BaseURL; import javax.servlet.jsp.JspException; import java.util.ArrayList; import java.util.HashMap; @@ -49,7 +48,7 @@ * @author Sherman Wood * @version $Revision: 5448 $ */ -abstract class GenerateURLTag extends PortletTag +public abstract class GenerateURLTag extends PortletTag { private String windowState; private String portletMode; @@ -186,7 +185,7 @@ * * @return The PortelURL to decorate */ - private PortletURL getBasePortletEnvironmentAndURL() + protected BaseURL getBasePortletEnvironmentAndURL() { PortletRequestImpl preq =3D (PortletRequestImpl)getPortletRequest(); = @@ -212,7 +211,7 @@ * @param portletURL * @throws WindowStateException */ - private void setWindowState(PortletURL portletURL) throws WindowStateEx= ception + protected void setWindowState(PortletURL portletURL) throws WindowState= Exception { if (getWindowState() !=3D null && getWindowState().trim().length() >= 0) { @@ -227,7 +226,7 @@ * @param portletURL * @throws PortletModeException */ - private void setPortletMode(PortletURL portletURL) throws PortletModeEx= ception + protected void setPortletMode(PortletURL portletURL) throws PortletMode= Exception { if (getPortletMode() !=3D null && getPortletMode().trim().length() >= 0) { @@ -242,7 +241,7 @@ * @param portletURL * @throws PortletSecurityException */ - private void setSecure(PortletURL portletURL) throws PortletSecurityExc= eption + protected void setSecure(BaseURL portletURL) throws PortletSecurityExce= ption { if (getSecure() !=3D null && getSecure().trim().length() > 0) { @@ -255,7 +254,7 @@ } } = - private void clearPreviousTag() + protected void clearPreviousTag() { parameters =3D new HashMap(5); // windowCtx =3D null; @@ -276,42 +275,44 @@ return EVAL_BODY_INCLUDE; } = - /** Generate the URL */ - public int doEndTag() throws JspException + protected BaseURL generateURL() throws Exception { - String resultingURL =3D null; - try - { + BaseURL newPortletURL =3D getBasePortletEnvironmentAndURL(); = - PortletURL newPortletURL =3D getBasePortletEnvironmentAndURL(); + setSecure(newPortletURL); = - setWindowState(newPortletURL); + // Include parameters as part of the tag request. = - setPortletMode(newPortletURL); + if (!parameters.isEmpty()) + { + newPortletURL.setParameters(getURLParameters()); + } + return newPortletURL; + } = - setSecure(newPortletURL); + protected void writeURL(BaseURL portletURL) throws Exception + { = - // Include parameters as part of the tag request. + // If a variable was given in the tag to be set in the pageContext, + // do that. Otherwise, just write out the URL to the page. = - if (!parameters.isEmpty()) - { - newPortletURL.setParameters(getURLParameters()); - } + if (getVar() !=3D null) + { + pageContext.setAttribute(getVar(), portletURL.toString()); + } + else + { + pageContext.getOut().print(portletURL.toString()); + } + } = - resultingURL =3D newPortletURL.toString(); = - // If a variable was given in the tag to be set in the pageContex= t, - // do that. Otherwise, just write out the URL to the page. - - if (getVar() !=3D null) - { - pageContext.setAttribute(getVar(), resultingURL); - } - else - { - pageContext.getOut().print(resultingURL); - } - + /** Generate the URL */ + public int doEndTag() throws JspException + { + try + { + writeURL(generateURL()); } catch (Exception e) { @@ -320,4 +321,6 @@ } return EVAL_PAGE; } + + } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/taglib/RenderURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/taglib/RenderURLTag.java 2008-02-06 18:49:08 UTC (rev 9805) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/taglib/RenderURLTag.java 2008-02-06 19:02:10 UTC (rev 9806) @@ -22,6 +22,9 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.impl.jsr168.taglib; = +import javax.portlet.PortletURL; +import javax.portlet.BaseURL; + /** * The renderURL tag for the JSR 168 Portlet specification. *

@@ -45,4 +48,15 @@ { return typeParameter; } + = + protected BaseURL generateURL() throws Exception + { + PortletURL newPortletURL =3D (PortletURL)super.generateURL(); + + setWindowState(newPortletURL); + + setPortletMode(newPortletURL); + + return newPortletURL; + } } Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/jsr286/taglib/ActionURL286Tag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/ActionURL286Tag.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/ActionURL286Tag.java 2008-02-06 19:02:10 UTC (rev 9806) @@ -0,0 +1,80 @@ +/* +* 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.portlet.impl.jsr286.taglib; + +import javax.portlet.PortletURL; +import javax.portlet.BaseURL; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +public class ActionURL286Tag extends GenerateURL286Tag +{ + /** The serialVersionUID */ + private static final long serialVersionUID =3D 7920291581022525492L; + public static String typeParameter =3D "action"; + + private String name; + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name =3D name; + } + + protected void setName(PortletURL portletURL) + { + if (name !=3D null) + { + portletURL.setParameter("javax.portlet.action", name); + } + } + + /* (non-Javadoc) + * @see org.jboss.portal.portlet.taglib.GenerateURLTag#addTypeParameter= () + */ + protected String getTypeValue() + { + return typeParameter; + } + + protected BaseURL generateURL() throws Exception + { + PortletURL newPortletURL =3D (PortletURL)super.generateURL(); + + setWindowState(newPortletURL); + + setPortletMode(newPortletURL); + + setCopyCurrentRenderParameters(newPortletURL); + + setName(newPortletURL); + + return newPortletURL; + } +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/jsr286/taglib/GenerateURL286Tag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/GenerateURL286Tag.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/GenerateURL286Tag.java 2008-02-06 19:02:10 UTC (rev 9806) @@ -0,0 +1,185 @@ +/* +* 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.portlet.impl.jsr286.taglib; + +import org.jboss.portal.portlet.impl.jsr168.taglib.GenerateURLTag; +import org.jboss.portal.portlet.impl.jsr168.api.PortletRequestImpl; +import org.jboss.portal.portlet.impl.jsr168.api.ResourceURLImpl; + +import javax.portlet.PortletURL; +import javax.portlet.PortletContext; +import javax.portlet.BaseURL; +import java.util.Map; +import java.util.HashMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Enumeration; +import java.io.StringWriter; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +public abstract class GenerateURL286Tag extends GenerateURLTag +{ + private Map properties; + + private String escapeXml; + + private String copyCurrentRenderParameters; + + private StringWriter stringWriter; + + public String getEscapeXml() + { + return escapeXml; + } + + public void setEscapeXml(String escapeXml) + { + this.escapeXml =3D escapeXml; + } + + public String getCopyCurrentRenderParameters() + { + return copyCurrentRenderParameters; + } + + public void setCopyCurrentRenderParameters(String copyCurrentRenderPara= meters) + { + this.copyCurrentRenderParameters =3D copyCurrentRenderParameters; + } + + protected void setCopyCurrentRenderParameters(PortletURL portletURL) + { + //default is false + if (copyCurrentRenderParameters !=3D null && copyCurrentRenderParame= ters.equalsIgnoreCase("true")) + { + portletURL.setParameters(getPortletRequest().getPrivateParameterM= ap()); + } + } + + protected boolean isEscapeXml() + { + + boolean def =3D true; + + String[] runtime =3D getConfig().getContainerRuntimeOptions().get("j= avax.portlet.escapeXml"); + + if (runtime !=3D null && runtime.length > 0) + { + if (runtime[0].equalsIgnoreCase("true")) + { + def =3D true; + } + else if (runtime[0].equalsIgnoreCase("false")) + { + def =3D false; + } + } + + if(escapeXml !=3D null) + { + return Boolean.parseBoolean(escapeXml); + } + + return def; + } + + /** + * Add a named property. Cater for multiple properties with the same na= me by storing them in a list. + * + * @param name + * @param value + */ + public void addProperty(String name, String value) + { + List l =3D properties.get(name); + if (l =3D=3D null) + { + l =3D new ArrayList(5); + properties.put(name, l); + } + + l.add(value); + } + + protected void clearPreviousTag() + { + stringWriter =3D new StringWriter(); + properties =3D new HashMap(); + + super.clearPreviousTag(); + } + + protected BaseURL getBasePortletEnvironmentAndURL() + { + PortletRequestImpl preq =3D (PortletRequestImpl)getPortletRequest(); + + if ("resource".equals(getTypeValue())) + { + return ResourceURLImpl.createResourceURL(getInvocation(), preq); + } + else + { + return super.getBasePortletEnvironmentAndURL(); + } + } + + protected BaseURL generateURL() throws Exception + { + BaseURL newPortletURL =3D super.generateURL(); + + if (!properties.isEmpty()) + { + for (String name : properties.keySet()) + { + List props =3D properties.get(name); + for (String prop : props) + { + newPortletURL.setProperty(name, prop); + } + } + } + + return newPortletURL; + } + + protected void writeURL(BaseURL portletURL) throws Exception + { + + // If a variable was given in the tag to be set in the pageContext, + // do that. Otherwise, just write out the URL to the page. + + portletURL.write(stringWriter, isEscapeXml()); + + if (getVar() !=3D null) + { + pageContext.setAttribute(getVar(), stringWriter.toString()); + } + else + { + pageContext.getOut().print(stringWriter.toString()); + } + } +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/jsr286/taglib/GenerateURL286TagTEI.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/GenerateURL286TagTEI.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/GenerateURL286TagTEI.java 2008-02-06 19:02:10 UTC (rev 980= 6) @@ -0,0 +1,93 @@ +/* +* 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.portlet.impl.jsr286.taglib; + +import org.jboss.portal.portlet.impl.jsr168.taglib.GenerateURLTagTEI; + +import javax.servlet.jsp.tagext.TagData; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +public class GenerateURL286TagTEI extends GenerateURLTagTEI +{ + + public boolean isValid(TagData data) + { + return true; +// if (super.isValid(data) && +// isEscapeXmlValid(data) && +// isCopyCurrentRenderParameters(data)) +// { +// return true; +// } + //return false; + } + + public boolean isEscapeXmlValid(TagData data) + { + Object o =3D data.getAttribute("escapeXml"); + if (o !=3D null && o !=3D TagData.REQUEST_TIME_VALUE) + { + String s =3D (String)o; + if (s.toLowerCase().equals("true") || + s.toLowerCase().equals("false")) + { + return true; + } + else + { + return false; + } + } + else + { + return true; + } + } + + public boolean isCopyCurrentRenderParameters(TagData data) + { + Object o =3D data.getAttribute("copyCurrentRenderParameters"); + if (o !=3D null && o !=3D TagData.REQUEST_TIME_VALUE) + { + String s =3D (String)o; + if (s.toLowerCase().equals("true") || + s.toLowerCase().equals("false")) + { + return true; + } + else + { + return false; + } + } + else + { + return true; + } + } + + +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/jsr286/taglib/Namespace286Tag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/Namespace286Tag.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/Namespace286Tag.java 2008-02-06 19:02:10 UTC (rev 9806) @@ -0,0 +1,33 @@ +/* +* 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.portlet.impl.jsr286.taglib; + +import org.jboss.portal.portlet.impl.jsr168.taglib.NamespaceTag; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +public class Namespace286Tag extends NamespaceTag +{ +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/jsr286/taglib/RenderURL286Tag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/RenderURL286Tag.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/RenderURL286Tag.java 2008-02-06 19:02:10 UTC (rev 9806) @@ -0,0 +1,59 @@ +/* +* 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.portlet.impl.jsr286.taglib; + +import javax.portlet.PortletURL; +import javax.portlet.BaseURL; +import javax.portlet.ResourceURL; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +public class RenderURL286Tag extends GenerateURL286Tag +{ + /** The serialVersionUID */ + private static final long serialVersionUID =3D -4232451651940217557L; + public static String typeParameter =3D "render"; + + /* (non-Javadoc) + * @see org.jboss.portal.portlet.taglib.GenerateURLTag#addTypeParameter= () + */ + protected String getTypeValue() + { + return typeParameter; + } + + protected BaseURL generateURL() throws Exception + { + PortletURL newPortletURL =3D (PortletURL)super.generateURL(); + + setWindowState(newPortletURL); + + setPortletMode(newPortletURL); + + setCopyCurrentRenderParameters(newPortletURL); + + return newPortletURL; + } +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/jsr286/taglib/ResourceURL286Tag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/ResourceURL286Tag.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/ResourceURL286Tag.java 2008-02-06 19:02:10 UTC (rev 9806) @@ -0,0 +1,104 @@ +/* +* 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.portlet.impl.jsr286.taglib; + +import javax.portlet.PortletURL; +import javax.portlet.ResourceURL; +import javax.portlet.BaseURL; + + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +public class ResourceURL286Tag extends GenerateURL286Tag +{ + /** The serialVersionUID */ + private static final long serialVersionUID =3D -4132423536342433557L; + public static String typeParameter =3D "resource"; + + private String id; + + private String cacheability; + + public String getId() + { + return id; + } + + public void setId(String id) + { + this.id =3D id; + } + + public String getCacheability() + { + return cacheability; + } + + protected void setId(ResourceURL resourceURL) + { + if (id !=3D null) + { + resourceURL.setResourceID(id); + } + } + + public void setCacheability(ResourceURL resourceURL) + { + if (cacheability !=3D null) + { + resourceURL.setCacheability(cacheability); + } + else + { + resourceURL.setCacheability("PAGE"); + } + } + + + public void setCacheability(String cacheability) + { + this.cacheability =3D cacheability; + } + + /* (non-Javadoc) + * @see org.jboss.portal.portlet.taglib.GenerateURLTag#addTypeParameter= () + */ + protected String getTypeValue() + { + return typeParameter; + } + + protected BaseURL generateURL() throws Exception + { + BaseURL newPortletURL =3D super.generateURL(); + + setId((ResourceURL)newPortletURL); + setCacheability((ResourceURL)newPortletURL); + + return newPortletURL; + } + +} + Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/jsr286/taglib/ResourceURL286TagTEI.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/ResourceURL286TagTEI.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/ResourceURL286TagTEI.java 2008-02-06 19:02:10 UTC (rev 980= 6) @@ -0,0 +1,66 @@ +/* +* 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.portlet.impl.jsr286.taglib; + +import javax.servlet.jsp.tagext.TagData; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +public class ResourceURL286TagTEI extends GenerateURL286TagTEI +{ + + public boolean isValid(TagData data) + { + if (super.isValid(data) && + isCacheability(data)) + { + return true; + } + return false; + } + + public boolean isCacheability(TagData data) + { + Object o =3D data.getAttribute("cacheability"); + if (o !=3D null && o !=3D TagData.REQUEST_TIME_VALUE) + { + String s =3D (String)o; + if (s.toLowerCase().equals("full") || + s.toLowerCase().equals("portlet") || + s.toLowerCase().equals("page")) + { + return true; + } + else + { + return false; + } + } + else + { + return true; + } + } +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/jsr286/taglib/URLParameter286Tag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/URLParameter286Tag.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/URLParameter286Tag.java 2008-02-06 19:02:10 UTC (rev 9806) @@ -0,0 +1,33 @@ +/* +* 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.portlet.impl.jsr286.taglib; + +import org.jboss.portal.portlet.impl.jsr168.taglib.URLParameterTag; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +public class URLParameter286Tag extends URLParameterTag +{ +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/jsr286/taglib/URLProperty286Tag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/URLProperty286Tag.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/URLProperty286Tag.java 2008-02-06 19:02:10 UTC (rev 9806) @@ -0,0 +1,155 @@ +/* +* 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.portlet.impl.jsr286.taglib; + +import org.jboss.portal.portlet.impl.jsr168.taglib.GenerateURLTag; + +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.tagext.TagSupport; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +public class URLProperty286Tag extends TagSupport +{ + /** The serialVersionUID */ + private static final long serialVersionUID =3D 1432342354333218087L; + private String name; + private String value; + + /** + * The name of the property to add to the URL. + *

+ * If null or empty, no action is performed. + * + * @return Returns the name. + * @jsp.attribute required=3D"true" rtexprvalue=3D"true" + */ + public String getName() + { + return name; + } + + /** @param name The name to set. */ + public void setName(String name) + { + this.name =3D name; + } + + /** + * The value of the property to add to the URL. + *

+ * If null, it is processed as an empty value. + * + * @return Returns the value. + * @jsp.attribute required=3D"true" rtexprvalue=3D"true" + */ + public String getValue() + { + return value; + } + + /** @param value The value to set. */ + public void setValue(String value) + { + this.value =3D value; + } + + /** + * No body to process + * + * @see javax.servlet.jsp.tagext.Tag#doStartTag() + */ + public int doStartTag() throws JspException + { + return SKIP_BODY; + } + + /** + * Include the property in the surround tag properties + * + * @see javax.servlet.jsp.tagext.Tag#doEndTag() + */ + public int doEndTag() throws JspException + { + try + { + GenerateURL286Tag ancestorTag =3D + (GenerateURL286Tag)findAncestorWithClass(this, GenerateURL286T= ag.class); + + Property p =3D new Property(getName(), getValue()); + + if (p.isValid()) + { + ancestorTag.addProperty(p.getName(), p.getValue()); + } + else + { + // Should throw a JspException? + // Not according to the JSR 286 spec. Ignore it + } + + } + catch (Exception e) + { + e.printStackTrace(); + throw new JspException(e); + } + return EVAL_PAGE; + } + + public class Property + { + private String name; + private String value; + + /** @return Returns the name. */ + public String getName() + { + return name; + } + + /** + * Per JSR 286 spec, if null, return an empty value + * + * @return Returns the value. + */ + public String getValue() + { + return value; + } + + public Property(String name, String value) + { + this.name =3D name; + this.value =3D value; + } + + public boolean isValid() + { + return name !=3D null && name.length() > 0; + } + } + +} Modified: modules/portlet/trunk/portlet/src/main/resources/org/jboss/portal= /portlet/portlet_2_0.tld =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/resources/org/jboss/portal/portl= et/portlet_2_0.tld 2008-02-06 18:49:08 UTC (rev 9805) +++ modules/portlet/trunk/portlet/src/main/resources/org/jboss/portal/portl= et/portlet_2_0.tld 2008-02-06 19:02:10 UTC (rev 9806) @@ -14,7 +14,7 @@ = param - org.jboss.portal.portlet.impl.jsr168.taglib.URLParameterT= ag + org.jboss.portal.portlet.impl.jsr286.taglib.URLParameter2= 86Tag empty = @@ -33,9 +33,29 @@ = + property + org.jboss.portal.portlet.impl.jsr286.taglib.URLProperty28= 6Tag + empty + + + name + true + true + + + + value + true + true + + + + + + renderURL - org.jboss.portal.portlet.impl.jsr168.taglib.RenderURLTag<= /tag-class> - org.jboss.portal.portlet.impl.jsr168.taglib.GenerateURLTa= gTEI + org.jboss.portal.portlet.impl.jsr286.taglib.RenderURL286T= ag + org.jboss.portal.portlet.impl.jsr286.taglib.GenerateURL28= 6TagTEI JSP = @@ -58,7 +78,17 @@ true = + + escapeXml + true = + + + copyCurrentRenderParameters + true + + + = @@ -71,8 +101,8 @@ = actionURL - org.jboss.portal.portlet.impl.jsr168.taglib.ActionURLTag<= /tag-class> - org.jboss.portal.portlet.impl.jsr168.taglib.GenerateURLTa= gTEI + org.jboss.portal.portlet.impl.jsr286.taglib.ActionURL286T= ag + org.jboss.portal.portlet.impl.jsr286.taglib.GenerateURL28= 6TagTEI JSP = @@ -95,12 +125,62 @@ true = + + escapeXml + true = + + + copyCurrentRenderParameters + true + + + + name + true + + + + = + resourceURL + org.jboss.portal.portlet.impl.jsr286.taglib.ResourceURL28= 6Tag + org.jboss.portal.portlet.impl.jsr286.taglib.ResourceURL28= 6TagTEI + JSP + + + secure + true + + + + var + true + + + + escapeXml + true + + + + cacheability + true + + + + id + true + + + + + + namespace - org.jboss.portal.portlet.impl.jsr168.taglib.NamespaceTag<= /tag-class> + org.jboss.portal.portlet.impl.jsr286.taglib.Namespace286T= ag empty = Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr168/ext/taglib/ActionURLTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/ext/taglib/ActionURLTestCase.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/ext/taglib/ActionURLTestCase.java 2008-02-06 19:02:10 UTC (rev 98= 06) @@ -0,0 +1,111 @@ +/* +* 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.portlet.jsr168.ext.taglib; + +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.base.AbstractUniversalTestPortlet; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.portlet.impl.jsr168.api.PortletURLImpl; +import org.jboss.portal.portlet.impl.jsr168.api.PortletRequestImpl; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.PortletRequestDispatcher; +import javax.portlet.PortletURL; +import javax.portlet.WindowState; +import javax.portlet.PortletMode; +import java.io.IOException; +import java.io.StringWriter; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +(a)TestCase +public class ActionURLTestCase extends TaglibTestCase +{ + public ActionURLTestCase(PortletTestCase seq) + { + + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + response.setContentType("text/html"); + PortletRequestDispatcher dispatcher =3D ((AbstractUniversalTes= tPortlet)portlet).getPortletContext(). + getRequestDispatcher("/actionURL.jsp"); + + PortletURL pu1 =3D response.createActionURL(); + + pu1.setWindowState(WindowState.MAXIMIZED); + pu1.setPortletMode(PortletMode.EDIT); + pu1.setSecure(true); + + PortletURL pu2 =3D response.createActionURL(); + pu2.setSecure(false); + + pu2.setParameter("testParam", new String[] {"testParamValue", = "testParamValue2"}); + pu2.setParameter("secondParam", "testParamValue"); + = + // Create session + request.getPortletSession(); + + // escapeXml=3Dtrue + String url1 =3D response.encodeURL(pu1.toString()); + + // escapeXml=3Dfalse + String url2 =3D response.encodeURL(pu2.toString()); + = + expectedResults =3D new String[]{ url1 , url1 , url2 }; + + include(dispatcher, request, response); + + + return new InvokeGetResponse(response.createRenderURL().toStri= ng()); + } + }); + + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + response.setContentType("text/html"); + + assertResults(context); + + return new EndTestResponse(); + } + }); + + + } +} \ No newline at end of file Copied: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/p= ortlet/jsr168/ext/taglib/DefineObjectsTestCase.java (from rev 9794, modules= /portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/t= ck/taglib/DefineObjectsTestCase.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/ext/taglib/DefineObjectsTestCase.java (re= v 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/ext/taglib/DefineObjectsTestCase.java 2008-02-06 19:02:10 UTC (re= v 9806) @@ -0,0 +1,95 @@ +/* +* 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.portlet.jsr168.ext.taglib; + +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.Assertion; +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.base.AbstractUniversalTestPortlet; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.unit.actions.PortletActionTestAction; +import org.jboss.portal.unit.actions.PortletEventTestAction; +import org.jboss.portal.unit.actions.PortletResourceTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.portal.test.portlet.jsr286.tck.taglib.*; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; +import static org.jboss.unit.api.Assert.*; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.PortletRequestDispatcher; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import java.io.IOException; +import java.io.Writer; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +(a)TestCase({ + Assertion.JSR286_113 + }) +public class DefineObjectsTestCase extends TaglibTestCase +{ + + //TODO: doesn't test include from action/event - the actionRequest/acti= onResponse/eventRequest/eventResponse objects + + public DefineObjectsTestCase(PortletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + response.setContentType("text/html"); + PortletRequestDispatcher dispatcher =3D ((AbstractUniversalTes= tPortlet)portlet).getPortletContext().getRequestDispatcher("/defineObjects.= jsp"); + + include(dispatcher, request, response); + + expectedResult =3D "jspDispatch,renderRequest,renderResponse,p= ortletConfig"; + + + return new InvokeGetResponse(response.createRenderURL().toStri= ng()); + } + }); + + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + assertResult(context); + + return new EndTestResponse(); + } + }); + } +} \ No newline at end of file Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr168/ext/taglib/NamespaceTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/ext/taglib/NamespaceTestCase.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/ext/taglib/NamespaceTestCase.java 2008-02-06 19:02:10 UTC (rev 98= 06) @@ -0,0 +1,89 @@ +/* +* 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.portlet.jsr168.ext.taglib; + +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.base.AbstractUniversalTestPortlet; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.unit.actions.PortletResourceTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.portal.test.portlet.jsr286.tck.taglib.*; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; +import static org.jboss.unit.api.Assert.assertEquals; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.PortletRequestDispatcher; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import java.io.IOException; +import java.io.Writer; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +(a)TestCase +public class NamespaceTestCase extends TaglibTestCase +{ + + public NamespaceTestCase(PortletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + response.setContentType("text/html"); + PortletRequestDispatcher dispatcher =3D ((AbstractUniversalTes= tPortlet)portlet).getPortletContext(). + getRequestDispatcher("/namespace.jsp"); + + expectedResult =3D response.getNamespace(); + + include(dispatcher, request, response); + + + return new InvokeGetResponse(response.createRenderURL().toStri= ng()); + } + }); + + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + response.setContentType("text/html"); + + assertResult(context); + + return new EndTestResponse(); + } + }); + + + } +} \ No newline at end of file Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr168/ext/taglib/RenderURLTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/ext/taglib/RenderURLTestCase.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/ext/taglib/RenderURLTestCase.java 2008-02-06 19:02:10 UTC (rev 98= 06) @@ -0,0 +1,125 @@ +/* +* 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.portlet.jsr168.ext.taglib; + +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.base.AbstractUniversalTestPortlet; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.portal.test.portlet.jsr286.tck.taglib.*; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.PortletURL; +import javax.portlet.PortletRequestDispatcher; +import javax.portlet.WindowState; +import javax.portlet.PortletMode; +import java.io.IOException; +import java.io.StringWriter; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +(a)TestCase +public class RenderURLTestCase extends TaglibTestCase +{ + public RenderURLTestCase(PortletTestCase seq) + { + + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + response.setContentType("text/html"); + PortletRequestDispatcher dispatcher =3D ((AbstractUniversalTes= tPortlet)portlet).getPortletContext(). + getRequestDispatcher("/renderURL.jsp"); + + PortletURL pu1 =3D response.createRenderURL(); + + pu1.setWindowState(WindowState.NORMAL); + pu1.setPortletMode(PortletMode.EDIT); + pu1.setSecure(true); + + PortletURL pu2 =3D response.createRenderURL(); + pu2.setSecure(false); + + pu2.setParameter("testParam", new String[] {"testParamValue", = "testParamValue2"}); + pu2.setParameter("secondParam", "testParamValue"); + + // Create session + request.getPortletSession(); + + // escapeXml=3Dtrue + String url1 =3D response.encodeURL(pu1.toString()); + + + // escapeXml=3Dfalse + String url2 =3D response.encodeURL(pu2.toString()); + + + expectedResults =3D new String[]{ url2 }; + + include(dispatcher, request, response); + + +// +// +// +// +// +//<% +// //Put url placed as page variable +// out.print(pageContext.getAttribute("testVar")); +//%> +// +// + + return new InvokeGetResponse(response.createRenderURL().toStri= ng()); + + + } + }); + + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + response.setContentType("text/html"); + + assertResults(context); + + return new EndTestResponse(); + } + }); + + + } +} \ No newline at end of file Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr168/ext/taglib/TaglibTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/ext/taglib/TaglibTestCase.java 2008-02-06 18:49:08 UTC (rev 9805) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/ext/taglib/TaglibTestCase.java 2008-02-06 19:02:10 UTC (rev 9806) @@ -31,6 +31,8 @@ import org.jboss.portal.unit.annotations.TestCase; import org.jboss.portal.unit.PortletTestContext; import org.jboss.portal.unit.base.AbstractUniversalTestPortlet; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.portlet.aspects.portlet.ContextDispatcherIntercept= or; import org.jboss.unit.driver.DriverResponse; import org.jboss.unit.driver.response.EndTestResponse; import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; @@ -42,12 +44,14 @@ import javax.portlet.PortletSession; import javax.portlet.PortletRequestDispatcher; import javax.portlet.PortletException; +import javax.portlet.PortletRequest; import javax.servlet.Servlet; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.IOException; +import java.io.Writer; = /** * The goal is to test that cross context session attributes are set in co= ntainer and are accessible from the direct @@ -59,20 +63,58 @@ * @author Julien Viet * @version $Revision: 1.1 $ */ -(a)TestCase -public class TaglibTestCase +public abstract class TaglibTestCase { - public TaglibTestCase(PortletTestCase seq) + + protected String startTag; + protected String endTag; + protected String expectedResult; + protected String[] expectedResults; + + + protected void include(PortletRequestDispatcher dispatcher, RenderReque= st request, RenderResponse response) throws IOException, PortletException { - seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + startTag =3D "

"; + endTag =3D "
"; + + Writer writer =3D response.getWriter(); + + writer.write(startTag); + dispatcher.include(request, response); + writer.write(endTag); + } + + protected void assertResult(PortletTestContext context) + { + String prevResponse =3D new String(context.getResponseBody()); + + String portletResp =3D prevResponse.substring(prevResponse.indexOf(s= tartTag) + startTag.length(), prevResponse.indexOf(endTag)); + + assertEquals(expectedResult, portletResp.trim()); + } + + protected void assertResults(PortletTestContext context) + { + String prevResponse =3D new String(context.getResponseBody()); + + String portletResp =3D prevResponse.substring(prevResponse.indexOf(s= tartTag) + startTag.length(), prevResponse.indexOf(endTag)); + + String[] results =3D portletResp.split(""); + + // Trim all results + for (int i =3D 0; i < results.length; i++) { - protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException - { - response.setContentType("text/html"); - PortletRequestDispatcher dispatcher =3D ((AbstractUniversalTes= tPortlet)portlet).getPortletContext().getRequestDispatcher("/usetaglib.jsp"= ); - dispatcher.include(request, response); - return new EndTestResponse(); - } - }); + results[i] =3D results[i].trim(); + + } + + + assertEquals(expectedResults, results); } -} \ No newline at end of file + + protected PortletInvocation getInvocation(PortletRequest req) + { + // Get the invocation + return (PortletInvocation)req.getAttribute(ContextDispatcherIntercep= tor.REQ_ATT_COMPONENT_INVOCATION); + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/taglib/ActionURLTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/taglib/ActionURLTestCase.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/taglib/ActionURLTestCase.java 2008-02-06 19:02:10 UTC (rev 98= 06) @@ -0,0 +1,142 @@ +/* +* 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.portlet.jsr286.tck.taglib; + +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.base.AbstractUniversalTestPortlet; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.portlet.impl.jsr168.api.PortletURLImpl; +import org.jboss.portal.portlet.impl.jsr168.api.PortletRequestImpl; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.PortletRequestDispatcher; +import javax.portlet.PortletURL; +import javax.portlet.WindowState; +import javax.portlet.PortletMode; +import java.io.IOException; +import java.io.StringWriter; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +(a)TestCase +public class ActionURLTestCase extends TaglibTestCase +{ + public ActionURLTestCase(PortletTestCase seq) + { + + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + + PortletURL url =3D response.createRenderURL(); + url.setParameter("testParamOne", "testValue1"); + url.setParameter("testParameterTwo", "testValue2"); + + + return new InvokeGetResponse(url.toString()); + } + }); + + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + response.setContentType("text/html"); + PortletRequestDispatcher dispatcher =3D ((AbstractUniversalTes= tPortlet)portlet).getPortletContext(). + getRequestDispatcher("/actionURL.jsp"); + + PortletURL pu1 =3D response.createActionURL(); + = + pu1.setWindowState(WindowState.MAXIMIZED); + pu1.setPortletMode(PortletMode.EDIT); + pu1.setSecure(true); + pu1.setParameter("javax.portlet.action", "testAction"); + + // Params from previos request = + pu1.setParameter("testParamOne", "testValue1"); + pu1.setParameter("testParameterTwo", "testValue2"); + + PortletURL pu2 =3D response.createActionURL(); + pu2.setSecure(false); + pu2.setParameter("javax.portlet.action", "testAction"); + + pu2.setParameter("testParam", new String[] {"testParamValue", = "testParamValue2"}); + pu2.setParameter("secondParam", "testParamValue"); + pu2.setProperty("testProperty", "testPropValue"); + pu2.setProperty("testProperty", "testPropValue2"); + pu2.setProperty("secondProperty", "testPropValue"); + + StringWriter sw =3D new StringWriter(); + + // Create session + request.getPortletSession(); + + // escapeXml=3Dtrue + pu1.write(sw, true); + String url1 =3D response.encodeURL(sw.toString()); + + sw =3D new StringWriter(); + = + // escapeXml=3Dfalse + pu2.write(sw, false); + String url2 =3D response.encodeURL(sw.toString()); + sw.flush(); + + + expectedResults =3D new String[]{ url1, url1, url2}; + + include(dispatcher, request, response); + + + return new InvokeGetResponse(response.createRenderURL().toStri= ng()); + } + }); + + seq.bindAction(2, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + response.setContentType("text/html"); + + assertResults(context); + + return new EndTestResponse(); + } + }); + + + } +} Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/taglib/DefineObjectsTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/taglib/DefineObjectsTestCase.java 2008-02-06 18:49:08 UTC (re= v 9805) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/taglib/DefineObjectsTestCase.java 2008-02-06 19:02:10 UTC (re= v 9806) @@ -58,14 +58,11 @@ @TestCase({ Assertion.JSR286_113 }) -public class DefineObjectsTestCase +public class DefineObjectsTestCase extends TaglibTestCase { = //TODO: doesn't test include from action/event - the actionRequest/acti= onResponse/eventRequest/eventResponse objects = - private String startTag; - private String endTag; - public DefineObjectsTestCase(PortletTestCase seq) { seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() @@ -73,18 +70,14 @@ protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException { response.setContentType("text/html"); - PortletRequestDispatcher dispatcher =3D ((AbstractUniversalTes= tPortlet)portlet).getPortletContext().getRequestDispatcher("/taglib.jsp"); + PortletRequestDispatcher dispatcher =3D ((AbstractUniversalTes= tPortlet)portlet).getPortletContext().getRequestDispatcher("/defineObjects.= jsp"); = - startTag =3D "
"; - endTag =3D "
"; + include(dispatcher, request, response); = - Writer writer =3D response.getWriter(); + expectedResult =3D "jspDispatch,renderRequest,renderResponse,p= ortletConfig,portletSession,portletSessionScope," + + "portletPreferences,portletPreferencesValues"; = - writer.write(startTag); - dispatcher.include(request, response); - writer.write(endTag); = - return new InvokeGetResponse(response.createRenderURL().toStri= ng()); } }); @@ -95,15 +88,8 @@ { protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException { - response.setContentType("text/html"); - - String prevResponse =3D new String(context.getResponseBody()); - - String portletResp =3D prevResponse.substring(prevResponse.ind= exOf(startTag) + startTag.length(), prevResponse.indexOf(endTag)); - - assertEquals("jspDispatch,renderRequest,renderResponse,portlet= Config,portletSession,portletSessionScope," + - "portletPreferences,portletPreferencesValues", portletResp.= trim()); - + assertResult(context); + = return new InvokeGetResponse(response.createResourceURL().toSt= ring()); } }); @@ -113,7 +99,7 @@ protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws IOExcep= tion, PortletException { response.setContentType("text/html"); - PortletRequestDispatcher dispatcher =3D ((AbstractUniversalTes= tPortlet)portlet).getPortletContext().getRequestDispatcher("/taglib.jsp"); + PortletRequestDispatcher dispatcher =3D ((AbstractUniversalTes= tPortlet)portlet).getPortletContext().getRequestDispatcher("/defineObjects.= jsp"); = startTag =3D "
"; endTag =3D "
"; @@ -124,6 +110,9 @@ dispatcher.include(request, response); writer.write(endTag); = + expectedResult =3D "jspDispatch,resourceRequest,resourceRespon= se,portletConfig,portletSession,portletSessionScope," + + "portletPreferences,portletPreferencesValues"; + return new InvokeGetResponse(response.createRenderURL().toStri= ng()); } }); @@ -132,15 +121,8 @@ { protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException { - response.setContentType("text/html"); + assertResult(context); = - String prevResponse =3D new String(context.getResponseBody()); - - String portletResp =3D prevResponse.substring(prevResponse.ind= exOf(startTag) + startTag.length(), prevResponse.indexOf(endTag)); - - assertEquals("jspDispatch,resourceRequest,resourceResponse,por= tletConfig,portletSession,portletSessionScope," + - "portletPreferences,portletPreferencesValues", portletResp.= trim()); - return new EndTestResponse(); } }); Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/taglib/NamespaceTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/taglib/NamespaceTestCase.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/taglib/NamespaceTestCase.java 2008-02-06 19:02:10 UTC (rev 98= 06) @@ -0,0 +1,88 @@ +/* +* 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.portlet.jsr286.tck.taglib; + +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.base.AbstractUniversalTestPortlet; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.unit.actions.PortletResourceTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; +import static org.jboss.unit.api.Assert.assertEquals; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.PortletRequestDispatcher; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import java.io.IOException; +import java.io.Writer; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +(a)TestCase +public class NamespaceTestCase extends TaglibTestCase +{ + = + public NamespaceTestCase(PortletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + response.setContentType("text/html"); + PortletRequestDispatcher dispatcher =3D ((AbstractUniversalTes= tPortlet)portlet).getPortletContext(). + getRequestDispatcher("/namespace.jsp"); + + expectedResult =3D response.getNamespace(); + + include(dispatcher, request, response); + + + return new InvokeGetResponse(response.createRenderURL().toStri= ng()); + } + }); + + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + response.setContentType("text/html"); + + assertResult(context); + + return new EndTestResponse(); + } + }); + + = + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/taglib/RenderURLTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/taglib/RenderURLTestCase.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/taglib/RenderURLTestCase.java 2008-02-06 19:02:10 UTC (rev 98= 06) @@ -0,0 +1,137 @@ +/* +* 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.portlet.jsr286.tck.taglib; + +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.base.AbstractUniversalTestPortlet; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.PortletURL; +import javax.portlet.PortletRequestDispatcher; +import javax.portlet.WindowState; +import javax.portlet.PortletMode; +import java.io.IOException; +import java.io.StringWriter; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +(a)TestCase +public class RenderURLTestCase extends TaglibTestCase +{ + public RenderURLTestCase(PortletTestCase seq) + { + + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + + PortletURL url =3D response.createRenderURL(); + url.setParameter("testParamOne", "testValue1"); + url.setParameter("testParameterTwo", "testValue2"); + + + return new InvokeGetResponse(url.toString()); + } + }); + + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + response.setContentType("text/html"); + PortletRequestDispatcher dispatcher =3D ((AbstractUniversalTes= tPortlet)portlet).getPortletContext(). + getRequestDispatcher("/renderURL.jsp"); + + PortletURL pu1 =3D response.createRenderURL(); + + pu1.setWindowState(WindowState.NORMAL); + pu1.setPortletMode(PortletMode.EDIT); + pu1.setSecure(true); + + // Params from previos request + pu1.setParameter("testParamOne", "testValue1"); + pu1.setParameter("testParameterTwo", "testValue2"); + + PortletURL pu2 =3D response.createRenderURL(); + pu2.setSecure(false); + + pu2.setParameter("testParam", new String[] {"testParamValue", = "testParamValue2"}); + pu2.setParameter("secondParam", "testParamValue"); + pu2.setProperty("testProperty", "testPropValue"); + pu2.setProperty("testProperty", "testPropValue2"); + pu2.setProperty("secondProperty", "testPropValue"); + + StringWriter sw =3D new StringWriter(); + + // Create session + request.getPortletSession(); + + // escapeXml=3Dtrue + pu1.write(sw, true); + String url1 =3D response.encodeURL(sw.toString()); + + sw =3D new StringWriter(); + + // escapeXml=3Dfalse + pu2.write(sw, false); + String url2 =3D response.encodeURL(sw.toString()); + sw.flush(); + + + expectedResults =3D new String[]{ url1, url1, url2}; + + include(dispatcher, request, response); + + + return new InvokeGetResponse(response.createRenderURL().toStri= ng()); + } + }); + + seq.bindAction(2, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + response.setContentType("text/html"); + + assertResults(context); + + return new EndTestResponse(); + } + }); + + + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/taglib/ResourceURLTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/taglib/ResourceURLTestCase.java (rev = 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/taglib/ResourceURLTestCase.java 2008-02-06 19:02:10 UTC (rev = 9806) @@ -0,0 +1,131 @@ +/* +* 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.portlet.jsr286.tck.taglib; + +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.base.AbstractUniversalTestPortlet; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.PortletURL; +import javax.portlet.PortletRequestDispatcher; +import javax.portlet.WindowState; +import javax.portlet.PortletMode; +import javax.portlet.ResourceURL; +import java.io.IOException; +import java.io.StringWriter; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +(a)TestCase +public class ResourceURLTestCase extends TaglibTestCase +{ + public ResourceURLTestCase(PortletTestCase seq) + { + + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + response.setContentType("text/html"); + PortletRequestDispatcher dispatcher =3D ((AbstractUniversalTes= tPortlet)portlet).getPortletContext(). + getRequestDispatcher("/resourceURL.jsp"); + + ResourceURL pu1 =3D response.createResourceURL(); + + pu1.setSecure(true); + pu1.setCacheability("FULL"); + + ResourceURL pu2 =3D response.createResourceURL(); + + pu2.setSecure(true); + pu2.setResourceID("testId1"); + + + ResourceURL pu3 =3D response.createResourceURL(); + pu3.setSecure(false); + + pu3.setParameter("testParam", new String[] {"testParamValue", = "testParamValue2"}); + pu3.setParameter("secondParam", "testParamValue"); + pu3.setProperty("testProperty", "testPropValue"); + pu3.setProperty("testProperty", "testPropValue2"); + pu3.setProperty("secondProperty", "testPropValue"); + + + StringWriter sw =3D new StringWriter(); + + // Create session + request.getPortletSession(); + + // escapeXml=3Dtrue + pu1.write(sw, true); + String url1 =3D response.encodeURL(sw.toString()); + + sw =3D new StringWriter(); + + // escapeXml=3Dtrue + pu2.write(sw, true); + String url2 =3D response.encodeURL(sw.toString()); + + sw =3D new StringWriter(); + + // escapeXml=3Dfalse + pu3.write(sw, false); + String url3 =3D response.encodeURL(sw.toString()); + + + expectedResults =3D new String[]{ url1, url2, url3}; + + include(dispatcher, request, response); + + + return new InvokeGetResponse(response.createRenderURL().toStri= ng()); + } + }); + + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + response.setContentType("text/html"); + + assertResults(context); + + return new EndTestResponse(); + } + }); + + + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/taglib/TaglibTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/taglib/TaglibTestCase.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/taglib/TaglibTestCase.java 2008-02-06 19:02:10 UTC (rev 9806) @@ -0,0 +1,99 @@ +/* +* 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.portlet.jsr286.tck.taglib; + +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.portlet.aspects.portlet.ContextDispatcherIntercept= or; +import static org.jboss.unit.api.Assert.assertEquals; + +import javax.portlet.PortletRequestDispatcher; +import javax.portlet.PortletRequest; +import javax.portlet.PortletResponse; +import javax.portlet.RenderResponse; +import javax.portlet.RenderRequest; +import javax.portlet.PortletException; +import javax.servlet.ServletRequest; +import java.io.Writer; +import java.io.IOException; + + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +public abstract class TaglibTestCase +{ + + protected String startTag; + protected String endTag; + protected String expectedResult; + protected String[] expectedResults; + + + protected void include(PortletRequestDispatcher dispatcher, RenderReque= st request, RenderResponse response) throws IOException, PortletException + { + startTag =3D "
"; + endTag =3D "
"; + + Writer writer =3D response.getWriter(); + + writer.write(startTag); + dispatcher.include(request, response); + writer.write(endTag); + } + + protected void assertResult(PortletTestContext context) + { + String prevResponse =3D new String(context.getResponseBody()); + + String portletResp =3D prevResponse.substring(prevResponse.indexOf(s= tartTag) + startTag.length(), prevResponse.indexOf(endTag)); + + assertEquals(expectedResult, portletResp.trim()); + } + + protected void assertResults(PortletTestContext context) + { + String prevResponse =3D new String(context.getResponseBody()); + + String portletResp =3D prevResponse.substring(prevResponse.indexOf(s= tartTag) + startTag.length(), prevResponse.indexOf(endTag)); + + String[] results =3D portletResp.split(""); + + // Trim all results + for (int i =3D 0; i < results.length; i++) + { + results[i] =3D results[i].trim(); + + } + + + assertEquals(expectedResults, results); + } + + protected PortletInvocation getInvocation(PortletRequest req) + { + // Get the invocation + return (PortletInvocation)req.getAttribute(ContextDispatcherIntercep= tor.REQ_ATT_COMPONENT_INVOCATION); + } +} Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit= /Assertion.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/Asser= tion.java 2008-02-06 18:49:08 UTC (rev 9805) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/Asser= tion.java 2008-02-06 19:02:10 UTC (rev 9806) @@ -1280,37 +1280,78 @@ "that the portlet must have when this link is executed, if no error = condition ocurred"), JSR286_319(new TCK(319), "PLT.26.2", "If the specified portlet mode is = illegal for the current request, a " + "JspException must be thrown."), - JSR286_320(new TCK(320), "PLT.26.2", ""), - JSR286_321(new TCK(321), "PLT.26.2", ""), - JSR286_322(new TCK(322), "PLT.26.2", ""), - JSR286_323(new TCK(323), Status.specUntestable(""), "PLT.26.2", ""), - JSR286_324(new TCK(324), Status.specUntestable(""), "PLT.26.2", ""), - JSR286_325(new TCK(325), Status.specUntestable(""), "PLT.26.2", ""), - JSR286_326(new TCK(326), Status.specUntestable(""), "PLT.26.2", ""), - JSR286_327(new TCK(327), "PLT.26.3", ""), - JSR286_328(new TCK(328), "PLT.26.3", ""), - JSR286_329(new TCK(329), "PLT.26.3", ""), - JSR286_330(new TCK(330), "PLT.26.3", ""), - JSR286_331(new TCK(331), "PLT.26.3", ""), - JSR286_332(new TCK(332), "PLT.26.3", ""), - JSR286_333(new TCK(333), "PLT.26.3", ""), - JSR286_334(new TCK(334), "PLT.26.3", ""), - JSR286_335(new TCK(335), Status.specUntestable(""), "PLT.26.3", ""), - JSR286_336(new TCK(336), Status.specUntestable(""), "PLT.26.3", ""), - JSR286_337(new TCK(337), Status.specUntestable(""), "PLT.26.3", ""), - JSR286_338(new TCK(338), Status.specUntestable(""), "PLT.26.3", ""), - JSR286_339(new TCK(339), "PLT.26.4", ""), - JSR286_340(new TCK(340), "PLT.26.4", ""), - JSR286_341(new TCK(341), "PLT.26.4", ""), - JSR286_342(new TCK(342), "PLT.26.4", ""), - JSR286_343(new TCK(343), "PLT.26.4", ""), - JSR286_344(new TCK(344), "PLT.26.4", ""), - JSR286_345(new TCK(345), "PLT.26.4", ""), - JSR286_346(new TCK(346), "PLT.26.5", ""), - JSR286_347(new TCK(347), "PLT.26.6", ""), - JSR286_348(new TCK(348), "PLT.26.6", ""), - JSR286_349(new TCK(349), "PLT.26.6", ""), - JSR286_350(new TCK(350), "PLT.26.6", "") + JSR286_320(new TCK(320), "PLT.26.2", "If a portlet mode is not set for = a URL, it must stay the same as the mode of " + + "the current request."), + JSR286_321(new TCK(321), "PLT.26.2", "If the result is exported as a JS= P scoped variable, defined via the var " + + "attributes, nothing is written to the current JspWriter."), + JSR286_322(new TCK(322), "PLT.26.2", "If the given variable name alread= y exists in the scope of the page or it " + + "is used within an iteration loop, the new value overwrites the old = one."), + JSR286_323(new TCK(323), Status.specUntestable(""), "PLT.26.2", "If the= specified security setting is not supported " + + "by the run-time environment, a JspException must be thrown"), + JSR286_324(new TCK(324), Status.specUntestable(""), "PLT.26.2", "copyCu= rrentRenderParameters (Type: boolean, " + + "non-required) =E2=80=93 if set to true requests that the private re= nder parameters of the portlet of the current " + + "request must be attached to this URL."), + JSR286_325(new TCK(325), Status.specUntestable(""), "PLT.26.2", "If add= itional tags are specified " + + "parameters with the same name as an existing render parameter will = get merged and the value defined in " + + "additional tags must be pre-pended."), + JSR286_326(new TCK(326), Status.specUntestable(""), "PLT.26.2", "escape= Xml (Type: boolean, non-required) =E2=80=93 " + + "determines whether characters <,>,&,=E2=80=99,=E2=80=9D in the resu= lting output should be converted to their corresponding " + + "character entity codes (=E2=80=98<=E2=80=99 gets converted to =E2= =80=98<=E2=80=99, =E2=80=98>=E2=80=99 gets converted to =E2=80=98>=E2= =80=99 =E2=80=98&=E2=80=99 gets converted to " + + "=E2=80=98&=E2=80=99, =E2=80=98=E2=80=98=E2=80=99 gets converted= to =E2=80=98'=E2=80=99, =E2=80=98=E2=80=9D=E2=80=99 gets converted to= =E2=80=98"=E2=80=99)."), + JSR286_327(new TCK(327), "PLT.26.3", "The portlet renderURL tag creates= a URL that must point to the current " + + "portlet and must trigger a render request with the supplied paramet= ers."), + JSR286_328(new TCK(328), "PLT.26.3", "If the specified window state is = illegal for the current request, a " + + "JspException must be thrown."), + JSR286_329(new TCK(329), "PLT.26.3", "If a window state is not set for = a URL, it should stay the same as the " + + "window state of the current request."), + JSR286_330(new TCK(330), "PLT.26.3", "portletMode (Type: String, non-re= quired) =E2=80=93 indicates the portlet mode that " + + "the portlet must have when this link is executed, if not error cond= ition ocurred."), + JSR286_331(new TCK(331), "PLT.26.3", "If the specified portlet mode is = illegal for the current request, a " + + "JspException must be thrown."), + JSR286_332(new TCK(332), "PLT.26.3", "If a portlet mode is not set for = a URL, it must stay the same as the " + + "mode of the current request."), + JSR286_333(new TCK(333), "PLT.26.3", "If the result is exported as a JS= P scoped variable, defined via the var " + + "attributes, nothing is written to the current JspWriter."), + JSR286_334(new TCK(334), "PLT.26.3", "If the given variable name alread= y exists in the scope of the page or it " + + "is used within an iteration loop, the new value overwrites the old = one"), + JSR286_335(new TCK(335), Status.specUntestable(""), "PLT.26.3", "If the= security is not set for a URL, it must " + + "stay the same as the security setting of the current request."), + JSR286_336(new TCK(336), Status.specUntestable(""), "PLT.26.3", "copyCu= rrentRenderParameters (Type: boolean, " + + "non-required) =E2=80=93 if set to true requests that the private re= nder parameters of the portlet of the current " + + "request must attached to this URL."), + JSR286_337(new TCK(337), Status.specUntestable(""), "PLT.26.3", "If add= itional tags are specified " + + "parameters with the same name as an existing render parameter will = get merged and the value defined in " + + "additional tags must be pre-pended."), + JSR286_338(new TCK(338), Status.specUntestable(""), "PLT.26.3", "escape= Xml (Type: boolean, non-required) =E2=80=93 " + + "deterrmines whether characters <,>,&,=E2=80=99,=E2=80=9D in the res= ulting output should be converted to their corresponding " + + "character entity codes (=E2=80=98<=E2=80=99 gets converted to =E2= =80=98<=E2=80=99, =E2=80=98>=E2=80=99 gets converted to =E2=80=98>=E2= =80=99 =E2=80=98&=E2=80=99 gets converted to " + + "=E2=80=98&=E2=80=99, =E2=80=98=E2=80=98=E2=80=99 gets converted= to =E2=80=98'=E2=80=99, =E2=80=98=E2=80=9D=E2=80=99 gets converted to= =E2=80=98"=E2=80=99)."), + JSR286_339(new TCK(339), "PLT.26.4", "The portlet resourceURL tag creat= es a URL that must point to the current " + + "portlet and must trigger a serveResource request with the supplied = parameters"), + JSR286_340(new TCK(340), "PLT.26.4", "The resourceURL must preserve the= current portlet mode, window state and " + + "render parameters."), + JSR286_341(new TCK(341), "PLT.26.4", "If such a parameter has the same = name as a render parameter in this URL, " + + "the render parameter value must be the last value in the attribute = value array."), + JSR286_342(new TCK(342), "PLT.26.4", "If the result is exported as a JS= P scoped variable, defined via the var " + + "attributes, nothing is written to the current JspWriter"), + JSR286_343(new TCK(343), "PLT.26.4", "If the given variable name alread= y exists in the scope of the page or it " + + "is used within an iteration loop, the new value overwrites the old = one."), + JSR286_344(new TCK(344), Status.specUntestable(""), "PLT.26.4", "If the= security is not set for a URL, it must " + + "stay the same as the security setting of the current request."), + JSR286_345(new TCK(345), Status.specUntestable(""), "PLT.26.4", "escape= Xml (Type: boolean, non-required) =E2=80=93 " + + "determines whether characters <,>,&,=E2=80=99,=E2=80=9D in the resu= lting output should be converted to their corresponding " + + "character entity codes (=E2=80=98<=E2=80=99 gets converted to =E2= =80=98<=E2=80=99, =E2=80=98>=E2=80=99 gets converted to =E2=80=98>=E2= =80=99 =E2=80=98&=E2=80=99 gets converted to " + + "=E2=80=98&=E2=80=99, =E2=80=98=E2=80=98=E2=80=99 gets converted= to =E2=80=98'=E2=80=99, =E2=80=98=E2=80=9D=E2=80=99 gets converted to= =E2=80=98"=E2=80=99)."), + JSR286_346(new TCK(346), "PLT.26.5", "This tag produces a unique value = for the current portlet and must match " + + "the value of PortletResponse.getNamespace method."), + JSR286_347(new TCK(347), "PLT.26.6", "This tag defines a parameter that= may be added to an actionURL, renderURL " + + "or resourceURL."), + JSR286_348(new TCK(348), Status.specUntestable(""), "PLT.26.6", "The pa= ram tag must not contain any body content."), + JSR286_349(new TCK(349), "PLT.26.6", "If the param tag has an empty val= ue the specified parameter name must be " + + "removed from the URL."), + JSR286_350(new TCK(350), "PLT.26.6", "If the same name of a parameter o= ccurs more than once within an actionURL, " + + "renderURL or resourceURL the values must be delivered as parameter = value array with the values in the order " + + "of the declaration within the URL tag.") = ; = Modified: modules/portlet/trunk/test/src/test/resources/jsr168/ext/taglib-w= ar/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr168/ext/taglib-war/WEB= -INF/portlet.xml 2008-02-06 18:49:08 UTC (rev 9805) +++ modules/portlet/trunk/test/src/test/resources/jsr168/ext/taglib-war/WEB= -INF/portlet.xml 2008-02-06 19:02:10 UTC (rev 9806) @@ -31,7 +31,8 @@ UniversalTestPortletA org.jboss.portal.test.portlet.framework.UTP1 - text/html + text/html + EDIT Added: modules/portlet/trunk/test/src/test/resources/jsr168/ext/taglib-war/= actionURL.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr168/ext/taglib-war/act= ionURL.jsp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr168/ext/taglib-war/act= ionURL.jsp 2008-02-06 19:02:10 UTC (rev 9806) @@ -0,0 +1,23 @@ +<%@ page language=3D"java" %> +<%@ taglib uri=3D"http://java.sun.com/portlet" prefix=3D"portlet" %> + + + + + + + +<% + //Put url placed as page variable + out.print(pageContext.getAttribute("testVar")); +%> + + + + + + + + + + Added: modules/portlet/trunk/test/src/test/resources/jsr168/ext/taglib-war/= defineObjects.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr168/ext/taglib-war/def= ineObjects.jsp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr168/ext/taglib-war/def= ineObjects.jsp 2008-02-06 19:02:10 UTC (rev 9806) @@ -0,0 +1,23 @@ +<%@ page import=3D"javax.portlet.RenderRequest" %> +<%@ page import=3D"javax.portlet.RenderResponse" %> +<%@ page import=3D"javax.portlet.PortletConfig" %> +<%@ page language=3D"java" %> +<%@ taglib uri=3D"http://java.sun.com/portlet" prefix=3D"portlet" %> + +<% + out.print("jspDispatch"); + + if (renderRequest !=3D null && renderRequest instanceof RenderRequest) + { + out.print(",renderRequest"); + } + if (renderResponse !=3D null && renderResponse instanceof RenderRespons= e) + { + out.print(",renderResponse"); + } + if (portletConfig !=3D null && portletConfig instanceof PortletConfig) + { + out.print(",portletConfig"); + } + +%> \ No newline at end of file Added: modules/portlet/trunk/test/src/test/resources/jsr168/ext/taglib-war/= namespace.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr168/ext/taglib-war/nam= espace.jsp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr168/ext/taglib-war/nam= espace.jsp 2008-02-06 19:02:10 UTC (rev 9806) @@ -0,0 +1,4 @@ +<%@ page language=3D"java" %> +<%@ taglib uri=3D"http://java.sun.com/portlet" prefix=3D"portlet" %> + + \ No newline at end of file Added: modules/portlet/trunk/test/src/test/resources/jsr168/ext/taglib-war/= renderURL.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr168/ext/taglib-war/ren= derURL.jsp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr168/ext/taglib-war/ren= derURL.jsp 2008-02-06 19:02:10 UTC (rev 9806) @@ -0,0 +1,9 @@ +<%@ page language=3D"java" %> +<%@ taglib uri=3D"http://java.sun.com/portlet" prefix=3D"portlet" %> + + + + + + + \ No newline at end of file Modified: modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-w= ar/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/WEB= -INF/portlet.xml 2008-02-06 18:49:08 UTC (rev 9805) +++ modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/WEB= -INF/portlet.xml 2008-02-06 19:02:10 UTC (rev 9806) @@ -32,6 +32,7 @@ org.jboss.portal.test.portlet.framework.UTP1 text/html + EDIT = Added: modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/= actionURL.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/act= ionURL.jsp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/act= ionURL.jsp 2008-02-06 19:02:10 UTC (rev 9806) @@ -0,0 +1,29 @@ +<%@ page language=3D"java" %> +<%@ taglib uri=3D"http://java.sun.com/portlet_2_0" prefix=3D"portlet" %> + + + + + + + +<% + //Put url placed as page variable + out.print(pageContext.getAttribute("testVar")); +%> + + + + + + + + + + + + + + Copied: modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war= /defineObjects.jsp (from rev 9794, modules/portlet/trunk/test/src/test/reso= urces/jsr286/tck/taglib-war/taglib.jsp) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/def= ineObjects.jsp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/def= ineObjects.jsp 2008-02-06 19:02:10 UTC (rev 9806) @@ -0,0 +1,73 @@ +<%@ page import=3D"org.jboss.unit.api.Assert" %> +<%@ page import=3D"javax.portlet.RenderRequest" %> +<%@ page import=3D"javax.portlet.RenderResponse" %> +<%@ page import=3D"javax.portlet.ActionRequest" %> +<%@ page import=3D"javax.portlet.ActionResponse" %> +<%@ page import=3D"javax.portlet.EventRequest" %> +<%@ page import=3D"javax.portlet.EventResponse" %> +<%@ page import=3D"javax.portlet.ResourceRequest" %> +<%@ page import=3D"javax.portlet.ResourceResponse" %> +<%@ page import=3D"javax.portlet.PortletConfig" %> +<%@ page import=3D"javax.portlet.PortletSession" %> +<%@ page import=3D"java.util.Map" %> +<%@ page import=3D"javax.portlet.PortletPreferences" %> +<%@ page language=3D"java" %> +<%@ taglib uri=3D"http://java.sun.com/portlet_2_0" prefix=3D"portlet" %> + +<% + out.print("jspDispatch"); + + if (renderRequest !=3D null && renderRequest instanceof RenderRequest) + { + out.print(",renderRequest"); + } + if (renderResponse !=3D null && renderResponse instanceof RenderRespons= e) + { + out.print(",renderResponse"); + } + if (actionRequest !=3D null && actionRequest instanceof ActionRequest) + { + out.print(",actionRequest"); + } + if (actionResponse !=3D null && actionResponse instanceof ActionRespons= e) + { + out.print(",actionResponse"); + } + if (eventRequest !=3D null && eventRequest instanceof EventRequest) + { + out.print(",eventRequest"); + } + if (eventResponse !=3D null && eventResponse instanceof EventResponse) + { + out.print(",eventResponse"); + } + if (resourceRequest !=3D null && resourceRequest instanceof ResourceReq= uest) + { + out.print(",resourceRequest"); + } + if (resourceResponse !=3D null && resourceResponse instanceof ResourceR= esponse) + { + out.print(",resourceResponse"); + } + if (portletConfig !=3D null && portletConfig instanceof PortletConfig) + { + out.print(",portletConfig"); + } + if (portletSession !=3D null && portletSession instanceof PortletSessio= n) + { + out.print(",portletSession"); + } + if (portletSessionScope !=3D null && portletSessionScope instanceof Map) + { + out.print(",portletSessionScope"); + } + if (portletPreferences !=3D null && portletPreferences instanceof Portl= etPreferences) + { + out.print(",portletPreferences"); + } + if (portletPreferencesValues !=3D null && portletPreferencesValues inst= anceof Map) + { + out.print(",portletPreferencesValues"); + } + +%> \ No newline at end of file Added: modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/= namespace.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/nam= espace.jsp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/nam= espace.jsp 2008-02-06 19:02:10 UTC (rev 9806) @@ -0,0 +1,4 @@ +<%@ page language=3D"java" %> +<%@ taglib uri=3D"http://java.sun.com/portlet_2_0" prefix=3D"portlet" %> + + \ No newline at end of file Added: modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/= renderURL.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/ren= derURL.jsp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/ren= derURL.jsp 2008-02-06 19:02:10 UTC (rev 9806) @@ -0,0 +1,27 @@ +<%@ page language=3D"java" %> +<%@ taglib uri=3D"http://java.sun.com/portlet_2_0" prefix=3D"portlet" %> + + + + + + + +<% + //Put url placed as page variable + out.print(pageContext.getAttribute("testVar")); +%> + + + + + + + + + + + + \ No newline at end of file Added: modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/= resourceURL.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/res= ourceURL.jsp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/res= ourceURL.jsp 2008-02-06 19:02:10 UTC (rev 9806) @@ -0,0 +1,26 @@ +<%@ page language=3D"java" %> +<%@ taglib uri=3D"http://java.sun.com/portlet_2_0" prefix=3D"portlet" %> + + + + + + + + +<% + //Put url placed as page variable + out.print(pageContext.getAttribute("testVar")); +%> + + + + + + + + + + + + Deleted: modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-wa= r/taglib.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/tag= lib.jsp 2008-02-06 18:49:08 UTC (rev 9805) +++ modules/portlet/trunk/test/src/test/resources/jsr286/tck/taglib-war/tag= lib.jsp 2008-02-06 19:02:10 UTC (rev 9806) @@ -1,73 +0,0 @@ -<%@ page import=3D"org.jboss.unit.api.Assert" %> -<%@ page import=3D"javax.portlet.RenderRequest" %> -<%@ page import=3D"javax.portlet.RenderResponse" %> -<%@ page import=3D"javax.portlet.ActionRequest" %> -<%@ page import=3D"javax.portlet.ActionResponse" %> -<%@ page import=3D"javax.portlet.EventRequest" %> -<%@ page import=3D"javax.portlet.EventResponse" %> -<%@ page import=3D"javax.portlet.ResourceRequest" %> -<%@ page import=3D"javax.portlet.ResourceResponse" %> -<%@ page import=3D"javax.portlet.PortletConfig" %> -<%@ page import=3D"javax.portlet.PortletSession" %> -<%@ page import=3D"java.util.Map" %> -<%@ page import=3D"javax.portlet.PortletPreferences" %> -<%@ page language=3D"java" %> -<%@ taglib uri=3D"http://java.sun.com/portlet_2_0" prefix=3D"portlet" %> - -<% - out.print("jspDispatch"); - - if (renderRequest !=3D null && renderRequest instanceof RenderRequest) - { - out.print(",renderRequest"); - } - if (renderResponse !=3D null && renderResponse instanceof RenderRespons= e) - { - out.print(",renderResponse"); - } - if (actionRequest !=3D null && actionRequest instanceof ActionRequest) - { - out.print(",actionRequest"); - } - if (actionResponse !=3D null && actionResponse instanceof ActionRespons= e) - { - out.print(",actionResponse"); - } - if (eventRequest !=3D null && eventRequest instanceof EventRequest) - { - out.print(",eventRequest"); - } - if (eventResponse !=3D null && eventResponse instanceof EventResponse) - { - out.print(",eventResponse"); - } - if (resourceRequest !=3D null && resourceRequest instanceof ResourceReq= uest) - { - out.print(",resourceRequest"); - } - if (resourceResponse !=3D null && resourceResponse instanceof ResourceR= esponse) - { - out.print(",resourceResponse"); - } - if (portletConfig !=3D null && portletConfig instanceof PortletConfig) - { - out.print(",portletConfig"); - } - if (portletSession !=3D null && portletSession instanceof PortletSessio= n) - { - out.print(",portletSession"); - } - if (portletSessionScope !=3D null && portletSessionScope instanceof Map) - { - out.print(",portletSessionScope"); - } - if (portletPreferences !=3D null && portletPreferences instanceof Portl= etPreferences) - { - out.print(",portletPreferences"); - } - if (portletPreferencesValues !=3D null && portletPreferencesValues inst= anceof Map) - { - out.print(",portletPreferencesValues"); - } - -%> \ No newline at end of file --===============1421916223868970075==-- From portal-commits at lists.jboss.org Wed Feb 6 15:02:07 2008 Content-Type: multipart/mixed; boundary="===============8178067305071830242==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9808 - tags/JBoss_Portal_2_6_4/server/src/main/org/jboss/portal/server. Date: Wed, 06 Feb 2008 15:02:05 -0500 Message-ID: --===============8178067305071830242== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: prabhat.jha(a)jboss.com Date: 2008-02-06 15:02:05 -0500 (Wed, 06 Feb 2008) New Revision: 9808 Modified: tags/JBoss_Portal_2_6_4/server/src/main/org/jboss/portal/server/PortalCo= nstants.java Log: updating the version number Modified: tags/JBoss_Portal_2_6_4/server/src/main/org/jboss/portal/server/P= ortalConstants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- tags/JBoss_Portal_2_6_4/server/src/main/org/jboss/portal/server/PortalC= onstants.java 2008-02-06 19:58:09 UTC (rev 9807) +++ tags/JBoss_Portal_2_6_4/server/src/main/org/jboss/portal/server/PortalC= onstants.java 2008-02-06 20:02:05 UTC (rev 9808) @@ -36,7 +36,7 @@ { = /** Current version. */ - public static final Version VERSION =3D new Version("JBoss Portal", 2, = 6, 3, new Version.Qualifier(Version.Qualifier.Prefix.SNAPSHOT), "Ninja"); + public static final Version VERSION =3D new Version("JBoss Portal", 2, = 6, 4, new Version.Qualifier(Version.Qualifier.Prefix.GA), "Ninja"); = /** The default portal name. */ public static final String DEFAULT_PORTAL_NAME =3D "default"; --===============8178067305071830242==-- From portal-commits at lists.jboss.org Wed Feb 6 15:39:58 2008 Content-Type: multipart/mixed; boundary="===============1729991072659202277==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9809 - modules/portlet/trunk/test/src/test/resources/google-weather-portlet-war/WEB-INF. Date: Wed, 06 Feb 2008 15:39:58 -0500 Message-ID: --===============1729991072659202277== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-06 15:39:58 -0500 (Wed, 06 Feb 2008) New Revision: 9809 Modified: modules/portlet/trunk/test/src/test/resources/google-weather-portlet-war= /WEB-INF/portlet.xml Log: - Changed initial zip code so that it's more obvious when the public render= parameters are used. Modified: modules/portlet/trunk/test/src/test/resources/google-weather-port= let-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/google-weather-portlet-wa= r/WEB-INF/portlet.xml 2008-02-06 20:02:05 UTC (rev 9808) +++ modules/portlet/trunk/test/src/test/resources/google-weather-portlet-wa= r/WEB-INF/portlet.xml 2008-02-06 20:39:58 UTC (rev 9809) @@ -42,7 +42,7 @@ zipcode - 94102 + 80201 false --===============1729991072659202277==-- From portal-commits at lists.jboss.org Wed Feb 6 16:56:21 2008 Content-Type: multipart/mixed; boundary="===============8164619514810313740==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9810 - in modules/portlet/trunk/test/src: test and 3 other directories. Date: Wed, 06 Feb 2008 16:56:20 -0500 Message-ID: --===============8164619514810313740== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-06 16:56:20 -0500 (Wed, 06 Feb 2008) New Revision: 9810 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples= /RemoteControlResourcePortlet.java modules/portlet/trunk/test/src/test/resources/remotecontrol-portlet-war/ modules/portlet/trunk/test/src/test/resources/remotecontrol-portlet-war/= WEB-INF/ modules/portlet/trunk/test/src/test/resources/remotecontrol-portlet-war/= WEB-INF/portlet.xml modules/portlet/trunk/test/src/test/resources/remotecontrol-portlet-war/= WEB-INF/web.xml Modified: modules/portlet/trunk/test/src/test/build.xml Log: - Resource serving portlet supposed to act as a remote control... doesn't r= eally work right now. Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sam= ples/RemoteControlResourcePortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/RemoteControlResourcePortlet.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/RemoteControlResourcePortlet.java 2008-02-06 21:56:20 UTC (rev 9810) @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2008, Your Corporation. All Rights Reserved. + */ + +package org.jboss.portal.simple.samples; + +import javax.portlet.GenericPortlet; +import javax.portlet.PortletException; +import javax.portlet.PortletURL; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import javax.portlet.ResourceURL; +import javax.portlet.WindowState; +import java.io.IOException; +import java.io.PrintWriter; + +/** + * @author Chris Laprun + * @version $Revision$ + */ +public class RemoteControlResourcePortlet extends GenericPortlet +{ + private static final String ZIPCODE =3D "zipcode"; + + @Override + protected void doView(RenderRequest renderRequest, RenderResponse rende= rResponse) throws PortletException, IOException + { + renderResponse.setContentType("text/html"); + PrintWriter printWriter =3D renderResponse.getWriter(); + printWriter.print("

Open remote control!

"); + } + + @Override + public void serveResource(ResourceRequest resourceRequest, ResourceResp= onse resourceResponse) throws PortletException, IOException + { + resourceResponse.setContentType("text/html"); + PrintWriter writer =3D resourceResponse.getWriter(); + PortletURL url =3D resourceResponse.createRenderURL(); + url.setWindowState(WindowState.MINIMIZED); + writer.print("
  • min= imize
  • "); + url.setWindowState(WindowState.MAXIMIZED); + writer.print("
  • maximize
  • "); + url.setWindowState(WindowState.NORMAL); + writer.print("
  • normal
"); + writer.print("

'zipcode' public render parameter value: " += resourceRequest.getParameter(ZIPCODE) + "
"); + writer.print("

Set value of 'zipcode' public render paramet= er to:"); + url.setParameter(ZIPCODE, "80201"); + writer.print("

  • Denver"); + url.setParameter(ZIPCODE, "94102"); + writer.print("
  • San Francisco"); + url.setParameter(ZIPCODE, "20001"); + writer.print("
  • Washington, DC"); + writer.print("

    "); + } +} Property changes on: modules/portlet/trunk/test/src/main/java/org/jboss/por= tal/simple/samples/RemoteControlResourcePortlet.java ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-06 20:39:58 UTC (= rev 9809) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-06 21:56:20 UTC (= rev 9810) @@ -759,6 +759,15 @@ + + + + + + + + = \ No newline at end of file Copied: modules/portlet/trunk/test/src/test/resources/remotecontrol-portlet= -war/WEB-INF/portlet.xml (from rev 9803, modules/portlet/trunk/test/src/tes= t/resources/google-map-portlet-war/WEB-INF/portlet.xml) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/remotecontrol-portlet-war= /WEB-INF/portlet.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/remotecontrol-portlet-war= /WEB-INF/portlet.xml 2008-02-06 21:56:20 UTC (rev 9810) @@ -0,0 +1,49 @@ + + + + + Portlet controlling display of other portlets + RemoteControl + Remote Control Resource Portlet + org.jboss.portal.simple.samples.RemoteControlResource= Portlet + + text/html + VIEW + + + Remote Control Resource Portlet + sample,resource,remotecontrol + + zipcode + + + + zipcode + g:zipcode + + + Copied: modules/portlet/trunk/test/src/test/resources/remotecontrol-portlet= -war/WEB-INF/web.xml (from rev 9803, modules/portlet/trunk/test/src/test/re= sources/google-map-portlet-war/WEB-INF/web.xml) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/remotecontrol-portlet-war= /WEB-INF/web.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/remotecontrol-portlet-war= /WEB-INF/web.xml 2008-02-06 21:56:20 UTC (rev 9810) @@ -0,0 +1,28 @@ + + + + + + --===============8164619514810313740==-- From portal-commits at lists.jboss.org Wed Feb 6 17:12:02 2008 Content-Type: multipart/mixed; boundary="===============2520161241992060133==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9811 - in modules/portlet/trunk: test/src/main/java/org/jboss/portal/portlet/test and 3 other directories. Date: Wed, 06 Feb 2008 17:12:02 -0500 Message-ID: --===============2520161241992060133== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-06 17:12:01 -0500 (Wed, 06 Feb 2008) New Revision: 9811 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/AbstractPortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/Page.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PagePortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/Window.java Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/t= aglib/ Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerPortletInfo.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletControllerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerServlet.java modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.jsp Log: more implementation of the taglib Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/info/ContainerPortletInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerPortletInfo.java 2008-02-06 21:56:20 UTC (rev 9810) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerPortletInfo.java 2008-02-06 22:12:01 UTC (rev 9811) @@ -163,7 +163,7 @@ = public String getApplicationName() { - return null; + return applicationName; } = public Map getOptions() Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/controller/AbstractPortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java (r= ev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-06 22:12:01 UTC (r= ev 9811) @@ -0,0 +1,357 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.test.controller; + +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; +import org.jboss.portal.common.io.IOTools; +import org.jboss.portal.common.util.MarkupInfo; +import org.jboss.portal.common.util.MediaType; +import org.jboss.portal.common.util.ParameterMap; +import org.jboss.portal.common.util.Tools; +import org.jboss.portal.portlet.ContainerURL; +import org.jboss.portal.portlet.ParametersStateString; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.cache.CacheLevel; +import org.jboss.portal.portlet.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.event.EventControllerContext; +import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; +import org.jboss.portal.portlet.controller.request.ControllerRequest; +import org.jboss.portal.portlet.controller.request.FullScopedCacheablePort= letResourceRequest; +import org.jboss.portal.portlet.controller.request.PageScopedFullPortletRe= sourceRequest; +import org.jboss.portal.portlet.controller.request.PortletActionRequest; +import org.jboss.portal.portlet.controller.request.PortletRenderRequest; +import org.jboss.portal.portlet.controller.request.PortletScopedPortletRes= ourceRequest; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.StateControllerContext; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; +import org.jboss.portal.portlet.impl.spi.AbstractClientContext; +import org.jboss.portal.portlet.impl.spi.AbstractRequestContext; +import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; +import org.jboss.portal.portlet.impl.spi.AbstractServerContext; +import org.jboss.portal.portlet.impl.spi.AbstractUserContext; +import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; +import org.jboss.portal.portlet.info.PortletInfo; +import org.jboss.portal.portlet.invocation.ActionInvocation; +import org.jboss.portal.portlet.invocation.EventInvocation; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.portlet.invocation.ResourceInvocation; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.spi.PortletInvocationContext; +import org.jboss.portal.portlet.test.StringCodec; +import static org.jboss.portal.portlet.test.URLParameterConstants.*; +import org.jboss.portal.web.Body; +import org.jboss.portal.web.IllegalRequestException; +import org.jboss.portal.web.WebRequest; + +import javax.servlet.ServletContext; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public abstract class AbstractPortletControllerContext implements PortletC= ontrollerContext +{ + + /** . */ + public static final MarkupInfo MARKUP_INFO =3D new MarkupInfo(MediaType= .HTML, "UTF8"); + + /** . */ + public static final int NAV_SCOPE =3D 0; + + /** . */ + public static final int SESSION_SCOPE =3D 1; + + /** . */ + private final HttpServletRequest req; + + /** . */ + private final HttpServletResponse resp; + + /** . */ + private final ServletContext servletContext; + + /** . */ + private final ControllerRequest request; + + /** . */ + private final StateControllerContextImpl stateControllerContext; + + public AbstractPortletControllerContext( + HttpServletRequest req, + HttpServletResponse resp, + ServletContext servletContext) + throws IllegalRequestException, IOException, ClassNotFoundException + { + StateControllerContextImpl tmp =3D new StateControllerContextImpl(th= is); + + // The nav state provided with the request + PageNavigationalState pageState =3D null; + + // The request decoded if not null + ControllerRequest request =3D null; + + // Process + String pathInfo =3D req.getPathInfo(); + if (pathInfo !=3D null && pathInfo.startsWith("/") && pathInfo.lengt= h() > 1) + { + // Get the target portlet + String targetId =3D StringCodec.decode(pathInfo.substring(1)); + + // Helper + WebRequest ri =3D new WebRequest(req); + + // Unmarshall portal navigational state if it is provided + String context =3D req.getParameter(PAGE_STATE); + if (context !=3D null) + { + byte[] bytes =3D Tools.fromHexString(context); + pageState =3D tmp.unserialize(bytes); + } + + // + Mode mode =3D null; + if (req.getParameter(MODE) !=3D null) + { + mode =3D Mode.create(req.getParameter(MODE)); + } + + // + WindowState windowState =3D null; + if (req.getParameter(WINDOW_STATE) !=3D null) + { + windowState =3D WindowState.create(req.getParameter(WINDOW_STA= TE)); + } + + // + String navigationalStateString =3D req.getParameter(NAVIGATIONAL_= STATE); + StateString navigationalState =3D null; + if (navigationalStateString !=3D null) + { + navigationalState =3D ParametersStateString.create(navigationa= lStateString); + } + + // + WindowNavigationalState windowNavigationalState =3D new WindowNav= igationalState(navigationalState, mode, windowState); + + // + String type =3D req.getParameter(LIFECYCLE_TYPE); + if (RESOURCE_LIFECYCLE.equals(type)) + { + StateString resourceState =3D ParametersStateString.create(req= .getParameter(RESOURCE_STATE)); + String resourceId =3D req.getParameter(RESOURCE_ID); + + // + ParameterMap formParameters =3D null; + if (ri.getBody() instanceof Body.Form) + { + formParameters =3D ((Body.Form)ri.getBody()).getParameters(= ); + } + + // + CacheLevel resourceCacheLevel =3D CacheLevel.valueOf(req.getPa= rameter(RESOURCE_CACHEABILITY)); + + // + switch (resourceCacheLevel) + { + case FULL: + request =3D new FullScopedCacheablePortletResourceReques= t( + this, + targetId, + resourceId, + resourceState, + formParameters); + break; + case PORTLET: + request =3D new PortletScopedPortletResourceRequest( + this, + targetId, + resourceId, + resourceState, + formParameters, + windowNavigationalState); + break; + case PAGE: + request =3D new PageScopedFullPortletResourceRequest( + this, + targetId, + resourceId, + resourceState, + formParameters, + pageState, + windowNavigationalState); + break; + } + } + else + { + if (ACTION_LIFECYCLE.equals(type)) + { + ParameterMap formParameters =3D null; + if (ri.getBody() instanceof Body.Form) + { + formParameters =3D ((Body.Form)ri.getBody()).getParamete= rs(); + } + + // + StateString interactionState =3D ParametersStateString.crea= te(req.getParameter(INTERACTION_STATE)); + + // + request =3D new PortletActionRequest( + this, + targetId, + interactionState, + formParameters, + windowNavigationalState, + pageState); + } + else + { + Map publicNavigationalStateChanges =3D (M= ap)IOTools.unserialize(Tools.fromHexString(req.getParamet= er(PUBLIC_NAVIGATIONAL_STATE_CHANGES))); + + // + request =3D new PortletRenderRequest( + this, + targetId, + windowNavigationalState, + publicNavigationalStateChanges, + pageState); + } + } + } + + // + this.request =3D request; + this.req =3D req; + this.resp =3D resp; + this.servletContext =3D servletContext; + this.stateControllerContext =3D tmp; + } + + public ControllerRequest getRequest() + { + return request; + } + + public ServletContext getServletContext() + { + return servletContext; + } + + public HttpServletRequest getClientRequest() + { + return req; + } + + public HttpServletResponse getClientResponse() + { + return resp; + } + + public PortletInfo getPortletInfo(String windowId) throws PortletInvoke= rException + { + return getPortlet(windowId).getInfo(); + } + + protected abstract Portlet getPortlet(String windowId) throws PortletIn= vokerException; + + protected abstract PortletInvocationResponse invoke(PortletInvocation i= nvocation) throws PortletInvokerException; + + public abstract EventControllerContext getEventControllerContext(); + + public StateControllerContext getStateControllerContext() + { + return stateControllerContext; + } + + public PortletInvocationResponse invoke(String windowId, ActionInvocati= on actionInvocation) throws PortletInvokerException + { + + Portlet portlet =3D getPortlet(windowId); + + TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), true); + + actionInvocation.setClientContext(new AbstractClientContext(req)); + actionInvocation.setServerContext(new AbstractServerContext(req, res= p)); + actionInvocation.setInstanceContext(instanceContext); + actionInvocation.setUserContext(new AbstractUserContext(req)); + actionInvocation.setWindowContext(new AbstractWindowContext(portlet.= getContext().getId())); + actionInvocation.setPortalContext(new TestPortalContext()); + actionInvocation.setSecurityContext(new AbstractSecurityContext(req)= ); + actionInvocation.setRequestContext(new AbstractRequestContext(req)); + actionInvocation.setTarget(instanceContext.getTarget()); + + return invoke(actionInvocation); + } + + public PortletInvocationResponse invoke(String windowId, List r= equestCookies, EventInvocation eventInvocation) throws PortletInvokerExcept= ion + { + Portlet portlet =3D getPortlet(windowId); + + TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), true); + + eventInvocation.setClientContext(new AbstractClientContext(req, requ= estCookies)); + eventInvocation.setServerContext(new AbstractServerContext(req, resp= )); + eventInvocation.setInstanceContext(instanceContext); + eventInvocation.setUserContext(new AbstractUserContext(req)); + eventInvocation.setWindowContext(new AbstractWindowContext(windowId)= ); + eventInvocation.setPortalContext(new TestPortalContext()); + eventInvocation.setSecurityContext(new AbstractSecurityContext(req)); + eventInvocation.setTarget(instanceContext.getTarget()); + + return invoke(eventInvocation); + } + + public PortletInvocationResponse invoke(String windowId, ResourceInvoca= tion resourceInvocation) throws PortletInvokerException + { + Portlet portlet =3D getPortlet(windowId); + + TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), true); + + resourceInvocation.setClientContext(new AbstractClientContext(req)); + resourceInvocation.setServerContext(new AbstractServerContext(req, r= esp)); + resourceInvocation.setInstanceContext(instanceContext); + resourceInvocation.setUserContext(new AbstractUserContext(req)); + resourceInvocation.setWindowContext(new AbstractWindowContext(portle= t.getContext().getId())); + resourceInvocation.setPortalContext(new TestPortalContext()); + resourceInvocation.setSecurityContext(new AbstractSecurityContext(re= q)); + resourceInvocation.setRequestContext(new AbstractRequestContext(req)= ); + resourceInvocation.setTarget(instanceContext.getTarget()); + + return invoke(resourceInvocation); + } + + public PortletInvocationContext createPortletInvocationContext(String w= indowId, PageNavigationalState pageState) + { + return new TestPortletInvocationContext(stateControllerContext, req,= resp, windowId, pageState, MARKUP_INFO); + } +} \ No newline at end of file Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContextImpl.java 2008-02-06 21:56:20 UTC (rev 9= 810) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContextImpl.java 2008-02-06 22:12:01 UTC (rev 9= 811) @@ -83,312 +83,43 @@ * @author Julien Viet * @version $Revision: 1.1 $ */ -public class PortletControllerContextImpl implements PortletControllerCont= ext +public class PortletControllerContextImpl extends AbstractPortletControlle= rContext { = /** . */ - public static final MarkupInfo MARKUP_INFO =3D new MarkupInfo(MediaType= .HTML, "UTF8"); - - /** . */ - public static final int NAV_SCOPE =3D 0; - - /** . */ - public static final int SESSION_SCOPE =3D 1; - - /** . */ - private final HttpServletRequest req; - - /** . */ - private final HttpServletResponse resp; - - /** . */ - private final ServletContext servletContext; - - /** . */ - private final ControllerRequest request; - - /** . */ private final PortletInvoker invoker; - + = /** . */ private final EventControllerContext eventControllerContext; = - /** . */ - private final StateControllerContextImpl stateControllerContext; - - public PortletControllerContextImpl( - HttpServletRequest req, - HttpServletResponse resp, - ServletContext servletContext) + public PortletControllerContextImpl(HttpServletRequest req, HttpServlet= Response resp, ServletContext servletContext) throws IllegalRequestException, IOException, ClassNotFoundException { - PortletInvoker invoker =3D (PortletInvoker)servletContext.getAttribu= te("ConsumerPortletInvoker"); + super(req, resp, servletContext); = // - StateControllerContextImpl tmp =3D new StateControllerContextImpl(th= is); - - // The nav state provided with the request - PageNavigationalState pageState =3D null; - - // The request decoded if not null - ControllerRequest request =3D null; - - // Process - String pathInfo =3D req.getPathInfo(); - if (pathInfo !=3D null && pathInfo.startsWith("/") && pathInfo.lengt= h() > 1) - { - // Get the target portlet - String targetId =3D StringCodec.decode(pathInfo.substring(1)); - - // Helper - WebRequest ri =3D new WebRequest(req); - - // Unmarshall portal navigational state if it is provided - String context =3D req.getParameter(PAGE_STATE); - if (context !=3D null) - { - byte[] bytes =3D Tools.fromHexString(context); - pageState =3D tmp.unserialize(bytes); - } - - // - Mode mode =3D null; - if (req.getParameter(MODE) !=3D null) - { - mode =3D Mode.create(req.getParameter(MODE)); - } - - // - WindowState windowState =3D null; - if (req.getParameter(WINDOW_STATE) !=3D null) - { - windowState =3D WindowState.create(req.getParameter(WINDOW_STA= TE)); - } - - // - String navigationalStateString =3D req.getParameter(NAVIGATIONAL_= STATE); - StateString navigationalState =3D null; - if (navigationalStateString !=3D null) - { - navigationalState =3D ParametersStateString.create(navigationa= lStateString); - } - - // - WindowNavigationalState windowNavigationalState =3D new WindowNav= igationalState(navigationalState, mode, windowState); - - // - String type =3D req.getParameter(LIFECYCLE_TYPE); - if (RESOURCE_LIFECYCLE.equals(type)) - { - StateString resourceState =3D ParametersStateString.create(req= .getParameter(RESOURCE_STATE)); - String resourceId =3D req.getParameter(RESOURCE_ID); - - // - ParameterMap formParameters =3D null; - if (ri.getBody() instanceof Body.Form) - { - formParameters =3D ((Body.Form)ri.getBody()).getParameters(= ); - } - - // - CacheLevel resourceCacheLevel =3D CacheLevel.valueOf(req.getPa= rameter(RESOURCE_CACHEABILITY)); - - // - switch (resourceCacheLevel) - { - case FULL: - request =3D new FullScopedCacheablePortletResourceReques= t( - this, - targetId, - resourceId, - resourceState, - formParameters); - break; - case PORTLET: - request =3D new PortletScopedPortletResourceRequest( - this, - targetId, - resourceId, - resourceState, - formParameters, - windowNavigationalState); - break; - case PAGE: - request =3D new PageScopedFullPortletResourceRequest( - this, - targetId, - resourceId, - resourceState, - formParameters, - pageState, - windowNavigationalState); - break; - } - } - else - { - if (ACTION_LIFECYCLE.equals(type)) - { - ParameterMap formParameters =3D null; - if (ri.getBody() instanceof Body.Form) - { - formParameters =3D ((Body.Form)ri.getBody()).getParamete= rs(); - } - - // - StateString interactionState =3D ParametersStateString.crea= te(req.getParameter(INTERACTION_STATE)); - - // - request =3D new PortletActionRequest( - this, - targetId, - interactionState, - formParameters, - windowNavigationalState, - pageState); - } - else - { - Map publicNavigationalStateChanges =3D (M= ap)IOTools.unserialize(Tools.fromHexString(req.getParamet= er(PUBLIC_NAVIGATIONAL_STATE_CHANGES))); - - // - request =3D new PortletRenderRequest( - this, - targetId, - windowNavigationalState, - publicNavigationalStateChanges, - pageState); - } - } - } - - // - this.request =3D request; - this.req =3D req; - this.resp =3D resp; - this.servletContext =3D servletContext; - this.invoker =3D invoker; + this.invoker =3D (PortletInvoker)servletContext.getAttribute("Consum= erPortletInvoker"); this.eventControllerContext =3D new EventControllerContextImpl(invok= er); - this.stateControllerContext =3D tmp; } = - public ControllerRequest getRequest() + protected Portlet getPortlet(String windowId) throws PortletInvokerExce= ption { - return request; - } - - public ServletContext getServletContext() - { - return servletContext; - } - - public HttpServletRequest getClientRequest() - { - return req; - } - - public HttpServletResponse getClientResponse() - { - return resp; - } - - public PortletInfo getPortletInfo(String windowId) throws PortletInvoke= rException - { - return _getPortlet(windowId).getInfo(); - } - - private Portlet _getPortlet(String windowId) throws PortletInvokerExcep= tion - { return invoker.getPortlet(PortletContext.createPortletContext(window= Id)); } = - public PortletInvocationResponse invoke(PortletInvocation invocation) t= hrows PortletInvokerException + protected PortletInvocationResponse invoke(PortletInvocation invocation= ) throws PortletInvokerException { return invoker.invoke(invocation); } = - public Collection getPortlets() throws PortletInvokerException - { - return invoker.getPortlets(); - } - public EventControllerContext getEventControllerContext() { return eventControllerContext; } = - public StateControllerContext getStateControllerContext() + public Collection getPortlets() throws PortletInvokerException { - return stateControllerContext; + return invoker.getPortlets(); } = - public String renderURL(String windowId, PageNavigationalState pageStat= e, ContainerURL containerURL, Boolean wantSecure, Boolean wantAuthenticated= , boolean relative) - { - PortletURLRenderer renderer =3D new PortletURLRenderer(stateControll= erContext, pageState, windowId, req, resp); - - // - return renderer.renderURL(containerURL, wantSecure, wantAuthenticate= d, relative); - } - - public PortletInvocationResponse invoke(String windowId, ActionInvocati= on actionInvocation) throws PortletInvokerException - { - - Portlet portlet =3D _getPortlet(windowId); - - TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), true); - - actionInvocation.setClientContext(new AbstractClientContext(req)); - actionInvocation.setServerContext(new AbstractServerContext(req, res= p)); - actionInvocation.setInstanceContext(instanceContext); - actionInvocation.setUserContext(new AbstractUserContext(req)); - actionInvocation.setWindowContext(new AbstractWindowContext(portlet.= getContext().getId())); - actionInvocation.setPortalContext(new TestPortalContext()); - actionInvocation.setSecurityContext(new AbstractSecurityContext(req)= ); - actionInvocation.setRequestContext(new AbstractRequestContext(req)); - actionInvocation.setTarget(instanceContext.getTarget()); - - return invoke(actionInvocation); - } - - public PortletInvocationResponse invoke(String windowId, List r= equestCookies, EventInvocation eventInvocation) throws PortletInvokerExcept= ion - { - Portlet portlet =3D _getPortlet(windowId); - - TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), true); - - eventInvocation.setClientContext(new AbstractClientContext(req, requ= estCookies)); - eventInvocation.setServerContext(new AbstractServerContext(req, resp= )); - eventInvocation.setInstanceContext(instanceContext); - eventInvocation.setUserContext(new AbstractUserContext(req)); - eventInvocation.setWindowContext(new AbstractWindowContext(windowId)= ); - eventInvocation.setPortalContext(new TestPortalContext()); - eventInvocation.setSecurityContext(new AbstractSecurityContext(req)); - eventInvocation.setTarget(instanceContext.getTarget()); - - return invoke(eventInvocation); - } - - public PortletInvocationResponse invoke(String windowId, ResourceInvoca= tion resourceInvocation) throws PortletInvokerException - { - Portlet portlet =3D _getPortlet(windowId); - - TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), true); - - resourceInvocation.setClientContext(new AbstractClientContext(req)); - resourceInvocation.setServerContext(new AbstractServerContext(req, r= esp)); - resourceInvocation.setInstanceContext(instanceContext); - resourceInvocation.setUserContext(new AbstractUserContext(req)); - resourceInvocation.setWindowContext(new AbstractWindowContext(portle= t.getContext().getId())); - resourceInvocation.setPortalContext(new TestPortalContext()); - resourceInvocation.setSecurityContext(new AbstractSecurityContext(re= q)); - resourceInvocation.setRequestContext(new AbstractRequestContext(req)= ); - resourceInvocation.setTarget(instanceContext.getTarget()); - - return invoke(resourceInvocation); - } - - public PortletInvocationContext createPortletInvocationContext(String w= indowId, PageNavigationalState pageState) - { - return new TestPortletInvocationContext(stateControllerContext, req,= resp, windowId, pageState, MARKUP_INFO); - } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerServlet.java 2008-02-06 21:56:20 UTC (rev 9810) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerServlet.java 2008-02-06 22:12:01 UTC (rev 9811) @@ -28,6 +28,16 @@ import org.jboss.portal.portlet.test.jsp.response.CharsChunk; import org.jboss.portal.portlet.test.jsp.response.PortletChunk; import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; +import org.jboss.portal.portlet.PortletInvoker; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.response.FragmentResponse; +import org.jboss.portal.portlet.controller.PortletController; +import org.jboss.portal.portlet.controller.response.ControllerResponse; +import org.jboss.portal.portlet.controller.response.PageUpdateResponse; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.info.PortletInfo; = import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; @@ -36,6 +46,7 @@ import javax.servlet.RequestDispatcher; import java.io.IOException; import java.io.PrintWriter; +import java.util.Map; = /** * @author Julien Viet @@ -44,9 +55,23 @@ public class ControllerServlet extends HttpServlet { = - protected void service(HttpServletRequest req, HttpServletResponse resp= ) throws ServletException, IOException { + try + { + _service(req, resp); + } + catch (ClassNotFoundException e) + { + throw new ServletException(e); + } + } + + protected void _service(HttpServletRequest req, HttpServletResponse res= p) throws ServletException, IOException, ClassNotFoundException + { + PortletInvoker invoker =3D (PortletInvoker)getServletContext().getAt= tribute("ConsumerPortletInvoker"); + + // RequestDispatcher dispatcher =3D req.getRequestDispatcher("/index.js= p"); = // @@ -59,9 +84,75 @@ ResponseBuffer buffer =3D bufferingResponse.getBuffer(); buffer.close(); = + // Collect portlets to create the page + int counter =3D 0; + Page page =3D new Page(); + for (Chunk chunk : buffer.getChunks()) + { + if (chunk instanceof PortletChunk) + { + PortletChunk portletChunk =3D (PortletChunk)chunk; + String windowId =3D "" + counter++; + + // + try + { + for (Portlet portlet : invoker.getPortlets()) + { + PortletInfo portletInfo =3D portlet.getInfo(); + String portletName =3D portletInfo.getName(); + String applicationName =3D portletInfo.getApplicationNam= e(); + + // + if (applicationName.equals(portletChunk.getApplicationNa= me()) && portletName.equals(portletChunk.getPortletName())) + { + page.addWindow(new Window(windowId, portlet)); + } + } + } + catch (PortletInvokerException e) + { + throw new ServletException(e); + } + } + } + // + PagePortletControllerContext context =3D new PagePortletControllerCo= ntext(req, resp, getServletContext(), page, invoker); + + // + PageNavigationalState pageState =3D null; + if (context.getRequest() !=3D null) + { + ControllerResponse controllerResponse; + try + { + controllerResponse =3D new PortletController().process(context= .getRequest()); + } + catch (PortletInvokerException e) + { + throw new ServletException(e); + } + + // + if (controllerResponse instanceof PageUpdateResponse) + { + PageUpdateResponse pageUpdate =3D (PageUpdateResponse)controll= erResponse; + pageState =3D pageUpdate.getPageState(); + } + } + else + { + pageState =3D context.getStateControllerContext().createPageState= (); + } + + // + Map responses =3D page.render(con= text, pageState); + + // resp.setContentType("text/html"); PrintWriter writer =3D resp.getWriter(); + int count =3D 0; for (Chunk chunk : buffer.getChunks()) { if (chunk instanceof BytesChunk) @@ -77,7 +168,39 @@ else if (chunk instanceof PortletChunk) { PortletChunk portletChunk =3D (PortletChunk)chunk; - writer.write("Portlet[" + portletChunk.getPortletName() + "," = + portletChunk.getApplicationName() + "]"); + String windowId =3D "" + count++; + + PortletInvocationResponse response =3D responses.get(windowId); + if (response !=3D null) + { + if (response instanceof FragmentResponse) + { + FragmentResponse fragment =3D (FragmentResponse)response; + if (fragment.getType() !=3D FragmentResponse.TYPE_EMPTY) + { + String frag; + if (fragment.getType() =3D=3D FragmentResponse.TYPE_B= YTES) + { + frag =3D fragment.getBytes().toString(); + } + else + { + frag =3D fragment.getChars().toString(); + } + + // + writer.write(frag); + } + } + else + { + writer.write(response.getClass().getSimpleName() + "[" += portletChunk.getPortletName() + "," + portletChunk.getApplicationName() + = "]"); + } + } + else + { + writer.write("Empty[" + portletChunk.getPortletName() + ","= + portletChunk.getApplicationName() + "]"); + } } } = Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/Page.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/Page.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/Page.java 2008-02-06 22:12:01 UTC (rev 9811) @@ -0,0 +1,76 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp; + +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; + +import java.util.Map; +import java.util.HashMap; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class Page +{ + + /** . */ + private Map windows; + + public Page() + { + this.windows =3D new HashMap(); + } + + public void addWindow(Window window) + { + windows.put(window.getId(), window); + } + + public Window getWindow(String windowId) + { + return windows.get(windowId); + } + + public Map render(PortletControllerC= ontext context, PageNavigationalState pageState) + { + Map responses =3D new HashMap(); + + // + for (Window window : windows.values()) + { + PortletInvocationResponse response =3D window.render(context, pag= eState); + + // + if (response !=3D null) + { + responses.put(window.getId(), response); + } + } + + // + return responses; + } +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/PagePortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-06 22:12:01 UTC (rev 9811) @@ -0,0 +1,87 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp; + +import org.jboss.portal.portlet.test.controller.AbstractPortletControllerC= ontext; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.PortletInvoker; +import org.jboss.portal.portlet.controller.event.EventControllerContext; +import org.jboss.portal.portlet.controller.impl.event.EventControllerConte= xtImpl; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.web.IllegalRequestException; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.ServletContext; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PagePortletControllerContext extends AbstractPortletControlle= rContext +{ + + /** . */ + private final Page page; + + /** . */ + private final PortletInvoker invoker; + + /** . */ + private final EventControllerContext eventControllerContext; + + public PagePortletControllerContext( + HttpServletRequest req, + HttpServletResponse resp, + ServletContext servletContext, + Page page, + PortletInvoker invoker) + throws IllegalRequestException, IOException, ClassNotFoundException + { + super(req, resp, servletContext); + + // + this.page =3D page; + this.invoker =3D invoker; + this.eventControllerContext =3D new EventControllerContextImpl(invok= er); + } + + protected Portlet getPortlet(String windowId) throws PortletInvokerExce= ption + { + Window window =3D page.getWindow(windowId); + return window.getPortlet(); + } + + protected PortletInvocationResponse invoke(PortletInvocation invocation= ) throws PortletInvokerException + { + return invoker.invoke(invocation); + } + + public EventControllerContext getEventControllerContext() + { + return eventControllerContext; + } +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/Window.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/Window.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/Window.java 2008-02-06 22:12:01 UTC (rev 9811) @@ -0,0 +1,137 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp; + +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.test.controller.TestInstanceContext; +import org.jboss.portal.portlet.test.controller.TestPortalContext; +import org.jboss.portal.portlet.impl.spi.AbstractClientContext; +import org.jboss.portal.portlet.impl.spi.AbstractServerContext; +import org.jboss.portal.portlet.impl.spi.AbstractUserContext; +import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; +import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; +import org.jboss.portal.portlet.spi.PortletInvocationContext; +import org.jboss.portal.portlet.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.RenderInvocation; +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; +import org.jboss.portal.common.util.ParameterMap; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class Window +{ + + /** . */ + private final String id; + + /** . */ + private final Portlet portlet; + + public Window(String id, Portlet portlet) + { + this.id =3D id; + this.portlet =3D portlet; + } + + public String getId() + { + return id; + } + + public Portlet getPortlet() + { + return portlet; + } + + public PortletInvocationResponse render( + PortletControllerContext context, + PageNavigationalState pageState) + { + WindowNavigationalState windowNS =3D pageState.getWindowNavigational= State(id); + + // + Mode mode =3D Mode.VIEW; + WindowState windowState =3D WindowState.NORMAL; + StateString portletNS =3D null; + + // + if (windowNS !=3D null) + { + if (windowNS.getMode() !=3D null) + { + mode =3D windowNS.getMode(); + } + if (windowNS.getWindowState() !=3D null) + { + windowState =3D windowNS.getWindowState(); + } + if (windowNS.getPortletNavigationalState() !=3D null) + { + portletNS =3D windowNS.getPortletNavigationalState(); + } + } + + // + ParameterMap publicNS =3D pageState.getPublicNavigationalState(id); + + // + PortletInvocationContext renderContext =3D context.createPortletInvo= cationContext(id, pageState); + RenderInvocation render =3D new RenderInvocation(renderContext); + render.setClientContext(new AbstractClientContext(context.getClientR= equest())); + render.setServerContext(new AbstractServerContext(context.getClientR= equest(), context.getClientResponse())); + render.setInstanceContext(new TestInstanceContext(context.getClientR= equest(), portlet.getContext(), false)); + render.setUserContext(new AbstractUserContext(context.getClientReque= st())); + render.setWindowContext(new AbstractWindowContext(id)); + render.setPortalContext(new TestPortalContext()); + render.setSecurityContext(new AbstractSecurityContext(context.getCli= entRequest())); + render.setTarget(portlet.getContext()); + render.setMode(mode); + render.setWindowState(windowState); + render.setNavigationalState(portletNS); + render.setPublicNavigationalState(publicNS); + + // + try + { + return ((PagePortletControllerContext)context).invoke(render); + + } + catch (PortletInvokerException e) + { + e.printStackTrace(); + + // todo + + // + return null; + } + } +} Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/i= ndex.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-06 21:56:20 UTC (rev 9810) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-06 22:12:01 UTC (rev 9811) @@ -5,11 +5,15 @@ - BEFORE + ONE + TWO + - AFTER + THREE --===============2520161241992060133==-- From portal-commits at lists.jboss.org Wed Feb 6 17:15:07 2008 Content-Type: multipart/mixed; boundary="===============8770407093765576655==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9812 - modules/portlet/trunk/test/src/test/resources/simple-portal-war. Date: Wed, 06 Feb 2008 17:15:06 -0500 Message-ID: --===============8770407093765576655== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-06 17:15:06 -0500 (Wed, 06 Feb 2008) New Revision: 9812 Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.jsp Log: portlet taglib not used here Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/i= ndex.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-06 22:12:01 UTC (rev 9811) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-06 22:15:06 UTC (rev 9812) @@ -1,6 +1,5 @@ <%@ page language=3D"java" %> <%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> -<%@ taglib uri=3D"http://java.sun.com/portlet" prefix=3D"portlet" %> <%@ page isELIgnored=3D"false" %> --===============8770407093765576655==-- From portal-commits at lists.jboss.org Wed Feb 6 17:48:17 2008 Content-Type: multipart/mixed; boundary="===============1943223928087920979==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9813 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet: controller/state and 1 other directories. Date: Wed, 06 Feb 2008 17:48:16 -0500 Message-ID: --===============1943223928087920979== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-06 17:48:16 -0500 (Wed, 06 Feb 2008) New Revision: 9813 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/state/PageNavigationalStateImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/state/PageNavigationalState.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerServlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/Page.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PagePortletControllerContext.java Log: stuff the page id in the public NS Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/impl/state/PageNavigationalStateImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/PageNavigationalStateImpl.java 2008-02-06 22:15:06 UTC (re= v 9812) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/PageNavigationalStateImpl.java 2008-02-06 22:48:16 UTC (re= v 9813) @@ -104,6 +104,11 @@ return publicNavigationalState; } = + public String[] getPublicNavigationalState(QName name) + { + return page.get(name).clone(); + } + public void setWindowNavigationalState(String windowId, WindowNavigatio= nalState windowState) throws UnsupportedOperationException { throw new UnsupportedOperationException(); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/state/PageNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/PageNavigationalState.java 2008-02-06 22:15:06 UTC (rev 9812) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/PageNavigationalState.java 2008-02-06 22:48:16 UTC (rev 9813) @@ -24,6 +24,7 @@ = import org.jboss.portal.common.util.ParameterMap; = +import javax.xml.namespace.QName; import java.util.Map; = /** @@ -74,4 +75,10 @@ * @throws UnsupportedOperationException if the page state is read only */ void setPublicNavigationalState(String windowId, Map = update) throws UnsupportedOperationException; + + String[] getPublicNavigationalState(QName name); + + void setPublicNavigationalState(QName name, String[] value); + + void removePublicNavigationalState(QName name); } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerServlet.java 2008-02-06 22:15:06 UTC (rev 9812) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerServlet.java 2008-02-06 22:48:16 UTC (rev 9813) @@ -22,14 +22,11 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp; = -import org.jboss.portal.portlet.test.jsp.response.ResponseBuffer; import org.jboss.portal.portlet.test.jsp.response.Chunk; import org.jboss.portal.portlet.test.jsp.response.BytesChunk; import org.jboss.portal.portlet.test.jsp.response.CharsChunk; import org.jboss.portal.portlet.test.jsp.response.PortletChunk; -import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; import org.jboss.portal.portlet.PortletInvoker; -import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; @@ -37,13 +34,11 @@ import org.jboss.portal.portlet.controller.response.ControllerResponse; import org.jboss.portal.portlet.controller.response.PageUpdateResponse; import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.info.PortletInfo; = import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.ServletException; -import javax.servlet.RequestDispatcher; import java.io.IOException; import java.io.PrintWriter; import java.util.Map; @@ -72,55 +67,9 @@ PortletInvoker invoker =3D (PortletInvoker)getServletContext().getAt= tribute("ConsumerPortletInvoker"); = // - RequestDispatcher dispatcher =3D req.getRequestDispatcher("/index.js= p"); + PagePortletControllerContext context =3D new PagePortletControllerCo= ntext(req, resp, getServletContext(), invoker); = // - BufferingResponse bufferingResponse =3D new BufferingResponse(resp); - - // - dispatcher.include(req, bufferingResponse); - - // - ResponseBuffer buffer =3D bufferingResponse.getBuffer(); - buffer.close(); - - // Collect portlets to create the page - int counter =3D 0; - Page page =3D new Page(); - for (Chunk chunk : buffer.getChunks()) - { - if (chunk instanceof PortletChunk) - { - PortletChunk portletChunk =3D (PortletChunk)chunk; - String windowId =3D "" + counter++; - - // - try - { - for (Portlet portlet : invoker.getPortlets()) - { - PortletInfo portletInfo =3D portlet.getInfo(); - String portletName =3D portletInfo.getName(); - String applicationName =3D portletInfo.getApplicationNam= e(); - - // - if (applicationName.equals(portletChunk.getApplicationNa= me()) && portletName.equals(portletChunk.getPortletName())) - { - page.addWindow(new Window(windowId, portlet)); - } - } - } - catch (PortletInvokerException e) - { - throw new ServletException(e); - } - } - } - - // - PagePortletControllerContext context =3D new PagePortletControllerCo= ntext(req, resp, getServletContext(), page, invoker); - - // PageNavigationalState pageState =3D null; if (context.getRequest() !=3D null) { @@ -140,20 +89,23 @@ PageUpdateResponse pageUpdate =3D (PageUpdateResponse)controll= erResponse; pageState =3D pageUpdate.getPageState(); } + else + { + // todo + } } - else - { - pageState =3D context.getStateControllerContext().createPageState= (); - } = // + Page page =3D context.getPage(); + + // Map responses =3D page.render(con= text, pageState); = // resp.setContentType("text/html"); PrintWriter writer =3D resp.getWriter(); int count =3D 0; - for (Chunk chunk : buffer.getChunks()) + for (Chunk chunk : page.getChunks()) { if (chunk instanceof BytesChunk) { @@ -203,8 +155,6 @@ } } } - - // writer.close(); } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/Page.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/Page.java 2008-02-06 22:15:06 UTC (rev 9812) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/Page.java 2008-02-06 22:48:16 UTC (rev 9813) @@ -25,9 +25,17 @@ import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.controller.PortletControllerContext; import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.test.jsp.response.Chunk; +import org.jboss.portal.portlet.test.jsp.response.PortletChunk; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.info.PortletInfo; = +import javax.servlet.ServletException; +import javax.xml.namespace.QName; import java.util.Map; import java.util.HashMap; +import java.util.List; = /** * @author Julien Viet @@ -37,16 +45,27 @@ { = /** . */ + public static final QName PAGE_ID_NAME =3D new QName("urn:jboss-portlet= -container", "pageid"); + + /** . */ private Map windows; = - public Page() + /** . */ + private List chunks; + + /** . */ + private final String pageId; + + public Page(List chunks, Map windows, String pag= eId) { - this.windows =3D new HashMap(); + this.chunks =3D chunks; + this.windows =3D windows; + this.pageId =3D pageId; } = - public void addWindow(Window window) + public List getChunks() { - windows.put(window.getId(), window); + return chunks; } = public Window getWindow(String windowId) @@ -56,6 +75,13 @@ = public Map render(PortletControllerC= ontext context, PageNavigationalState pageState) { + if (pageState =3D=3D null) + { + pageState =3D context.getStateControllerContext().createPageState= (); + pageState.setPublicNavigationalState(PAGE_ID_NAME, new String[]{p= ageId}); + } + + // Map responses =3D new HashMap(); = // Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PagePortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-06 22:15:06 UTC (rev 9812) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-06 22:48:16 UTC (rev 9813) @@ -23,11 +23,19 @@ package org.jboss.portal.portlet.test.jsp; = import org.jboss.portal.portlet.test.controller.AbstractPortletControllerC= ontext; +import org.jboss.portal.portlet.test.jsp.response.Chunk; +import org.jboss.portal.portlet.test.jsp.response.PortletChunk; +import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; +import org.jboss.portal.portlet.test.jsp.response.ResponseBuffer; import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.PortletInvoker; +import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.controller.event.EventControllerContext; import org.jboss.portal.portlet.controller.impl.event.EventControllerConte= xtImpl; +import org.jboss.portal.portlet.controller.request.PortletRequest; +import org.jboss.portal.portlet.controller.request.PageScopedFullPortletRe= sourceRequest; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.web.IllegalRequestException; @@ -35,7 +43,11 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.RequestDispatcher; import java.io.IOException; +import java.util.Map; +import java.util.HashMap; = /** * @author Julien Viet @@ -43,7 +55,7 @@ */ public class PagePortletControllerContext extends AbstractPortletControlle= rContext { - + = /** . */ private final Page page; = @@ -57,18 +69,97 @@ HttpServletRequest req, HttpServletResponse resp, ServletContext servletContext, - Page page, PortletInvoker invoker) - throws IllegalRequestException, IOException, ClassNotFoundException + throws IllegalRequestException, IOException, ClassNotFoundException,= ServletException { super(req, resp, servletContext); = + // - this.page =3D page; + PageNavigationalState pageState =3D null; + if (getRequest() instanceof PortletRequest) + { + PortletRequest request =3D (PortletRequest)getRequest(); + pageState =3D request.getPageState(); + } + else if (getRequest() instanceof PageScopedFullPortletResourceReques= t) + { + PageScopedFullPortletResourceRequest request =3D (PageScopedFullP= ortletResourceRequest)getRequest(); + pageState =3D request.getPageState(); + } + + // + String pageId =3D null; + if (pageState !=3D null) + { + String[] values =3D pageState.getPublicNavigationalState(Page.PAG= E_ID_NAME); + if (values !=3D null && values.length > 0) + { + pageId =3D values[0]; + } + } + if (pageId =3D=3D null) + { + pageId =3D "/index.jsp"; + } + + // + RequestDispatcher dispatcher =3D req.getRequestDispatcher(pageId); + + // + BufferingResponse bufferingResponse =3D new BufferingResponse(resp); + + // + dispatcher.include(req, bufferingResponse); + + // + ResponseBuffer buffer =3D bufferingResponse.getBuffer(); + buffer.close(); + + // Collect portlets to create the page + int counter =3D 0; + Map windows =3D new HashMap(); + for (Chunk chunk : buffer.getChunks()) + { + if (chunk instanceof PortletChunk) + { + PortletChunk portletChunk =3D (PortletChunk)chunk; + String windowId =3D "" + counter++; + + // + try + { + for (Portlet portlet : invoker.getPortlets()) + { + PortletInfo portletInfo =3D portlet.getInfo(); + String portletName =3D portletInfo.getName(); + String applicationName =3D portletInfo.getApplicationNam= e(); + + // + if (applicationName.equals(portletChunk.getApplicationNa= me()) && portletName.equals(portletChunk.getPortletName())) + { + windows.put(windowId, new Window(windowId, portlet)); + } + } + } + catch (PortletInvokerException e) + { + throw new ServletException(e); + } + } + } + + // + this.page =3D new Page(buffer.getChunks(), windows, pageId); this.invoker =3D invoker; this.eventControllerContext =3D new EventControllerContextImpl(invok= er); } = + public Page getPage() + { + return page; + } + protected Portlet getPortlet(String windowId) throws PortletInvokerExce= ption { Window window =3D page.getWindow(windowId); --===============1943223928087920979==-- From portal-commits at lists.jboss.org Wed Feb 6 17:49:03 2008 Content-Type: multipart/mixed; boundary="===============7487822192087870322==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9814 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib. Date: Wed, 06 Feb 2008 17:49:03 -0500 Message-ID: --===============7487822192087870322== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-06 17:49:03 -0500 (Wed, 06 Feb 2008) New Revision: 9814 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PageTag.java Log: removed sysout Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PageTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageTag.java 2008-02-06 22:48:16 UTC (rev 9813) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageTag.java 2008-02-06 22:49:03 UTC (rev 9814) @@ -34,16 +34,11 @@ = public int doStartTag() throws JspException { - System.out.println("START"); - - return EVAL_BODY_INCLUDE; } = public int doEndTag() throws JspException { - System.out.println("END"); - return EVAL_PAGE; } } --===============7487822192087870322==-- From portal-commits at lists.jboss.org Wed Feb 6 17:58:00 2008 Content-Type: multipart/mixed; boundary="===============0059035973886820168==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9815 - in modules/portlet/trunk/test/src: test/resources/simple-portal-war and 1 other directory. Date: Wed, 06 Feb 2008 17:58:00 -0500 Message-ID: --===============0059035973886820168== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-06 17:58:00 -0500 (Wed, 06 Feb 2008) New Revision: 9815 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerServlet.java modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.jsp Log: implement resource serving in portal jsp Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerServlet.java 2008-02-06 22:49:03 UTC (rev 9814) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerServlet.java 2008-02-06 22:58:00 UTC (rev 9815) @@ -33,14 +33,18 @@ import org.jboss.portal.portlet.controller.PortletController; import org.jboss.portal.portlet.controller.response.ControllerResponse; import org.jboss.portal.portlet.controller.response.PageUpdateResponse; +import org.jboss.portal.portlet.controller.response.ResourceResponse; import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.common.io.IOTools; = import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.ServletException; +import javax.servlet.ServletOutputStream; import java.io.IOException; import java.io.PrintWriter; +import java.io.Writer; import java.util.Map; = /** @@ -89,6 +93,63 @@ PageUpdateResponse pageUpdate =3D (PageUpdateResponse)controll= erResponse; pageState =3D pageUpdate.getPageState(); } + else if (controllerResponse instanceof ResourceResponse) + { + ResourceResponse resourceResponse =3D (ResourceResponse)contro= llerResponse; + PortletInvocationResponse pir =3D resourceResponse.response; + + // + if (pir instanceof FragmentResponse) + { + FragmentResponse fragment =3D (FragmentResponse)pir; + = + // + if (fragment.getType() =3D=3D FragmentResponse.TYPE_EMPTY) + { + resp.setStatus(HttpServletResponse.SC_NO_CONTENT); + } + else + { + String contentType =3D fragment.getContentType(); + if (contentType !=3D null) + { + resp.setContentType(contentType); + } + + // + if (fragment.getType() =3D=3D FragmentResponse.TYPE_BYTE= S) + { + ServletOutputStream out =3D null; + try + { + out =3D resp.getOutputStream(); + out.write(fragment.getBytes().toByteArray()); + } + finally + { + IOTools.safeClose(out); + } + } + else + { + Writer writer =3D null; + try + { + writer =3D resp.getWriter(); + writer.write(fragment.getChars().toString()); + } + finally + { + writer.close(); + } + } + } + } + else + { + // todo + } + } else { // todo Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/i= ndex.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-06 22:49:03 UTC (rev 9814) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-06 22:58:00 UTC (rev 9815) @@ -13,6 +13,10 @@ name=3D"GoogleMap" applicationName=3D"google-map-portlet"/> THREE + + FOUR --===============0059035973886820168==-- From portal-commits at lists.jboss.org Wed Feb 6 18:47:22 2008 Content-Type: multipart/mixed; boundary="===============3202538653446116753==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9816 - in modules/portlet/trunk/test/src: main/java/org/jboss/portal/portlet/test/controller and 2 other directories. Date: Wed, 06 Feb 2008 18:47:22 -0500 Message-ID: --===============3202538653446116753== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-06 18:47:22 -0500 (Wed, 06 Feb 2008) New Revision: 9816 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/U= RLParameterConstants.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/AbstractPortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletURLRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/Page.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PagePortletControllerContext.java modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= web.xml Log: make the controller as a filter as it is more powerful that way Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/URLParameterConstants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= URLParameterConstants.java 2008-02-06 22:58:00 UTC (rev 9815) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= URLParameterConstants.java 2008-02-06 23:47:22 UTC (rev 9816) @@ -39,6 +39,9 @@ */ public static final String LIFECYCLE_TYPE =3D "type"; = + /** The window id. */ + public static final String WINDOW_ID =3D "windowid"; + /** The portlet mode. */ public static final String MODE =3D "mode"; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/AbstractPortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-06 22:58:00 UTC (r= ev 9815) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-06 23:47:22 UTC (r= ev 9816) @@ -30,7 +30,6 @@ import org.jboss.portal.common.util.MediaType; import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.common.util.Tools; -import org.jboss.portal.portlet.ContainerURL; import org.jboss.portal.portlet.ParametersStateString; import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletInvokerException; @@ -61,7 +60,6 @@ import org.jboss.portal.portlet.invocation.ResourceInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.spi.PortletInvocationContext; -import org.jboss.portal.portlet.test.StringCodec; import static org.jboss.portal.portlet.test.URLParameterConstants.*; import org.jboss.portal.web.Body; import org.jboss.portal.web.IllegalRequestException; @@ -120,13 +118,12 @@ // The request decoded if not null ControllerRequest request =3D null; = + // Get the window id + String windowId =3D req.getParameter(WINDOW_ID); + // Process - String pathInfo =3D req.getPathInfo(); - if (pathInfo !=3D null && pathInfo.startsWith("/") && pathInfo.lengt= h() > 1) + if (windowId !=3D null) { - // Get the target portlet - String targetId =3D StringCodec.decode(pathInfo.substring(1)); - // Helper WebRequest ri =3D new WebRequest(req); = @@ -186,7 +183,7 @@ case FULL: request =3D new FullScopedCacheablePortletResourceReques= t( this, - targetId, + windowId, resourceId, resourceState, formParameters); @@ -194,7 +191,7 @@ case PORTLET: request =3D new PortletScopedPortletResourceRequest( this, - targetId, + windowId, resourceId, resourceState, formParameters, @@ -203,7 +200,7 @@ case PAGE: request =3D new PageScopedFullPortletResourceRequest( this, - targetId, + windowId, resourceId, resourceState, formParameters, @@ -228,7 +225,7 @@ // request =3D new PortletActionRequest( this, - targetId, + windowId, interactionState, formParameters, windowNavigationalState, @@ -241,7 +238,7 @@ // request =3D new PortletRenderRequest( this, - targetId, + windowId, windowNavigationalState, publicNavigationalStateChanges, pageState); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletURLRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-06 22:58:00 UTC (rev 9815) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-06 23:47:22 UTC (rev 9816) @@ -91,13 +91,20 @@ buffer.append(Integer.toString(clientReq.getServerPort())); buffer.append(clientReq.getContextPath()); buffer.append(clientReq.getServletPath()); - buffer.append('/'); - buffer.append(StringCodec.encode(windowId)); = // + if (clientReq.getPathInfo() !=3D null) + { + buffer.append(clientReq.getPathInfo()); + } + + // Map parameters =3D new HashMap(); = // + parameters.put(WINDOW_ID, windowId); + + // String type; if (containerURL instanceof ActionURL) { Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/jsp/ControllerFilter.java (from rev 9815, modules/portlet/trunk/test/sr= c/main/java/org/jboss/portal/portlet/test/jsp/ControllerServlet.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-06 23:47:22 UTC (rev 9816) @@ -0,0 +1,274 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp; + +import org.jboss.portal.portlet.test.jsp.response.Chunk; +import org.jboss.portal.portlet.test.jsp.response.BytesChunk; +import org.jboss.portal.portlet.test.jsp.response.CharsChunk; +import org.jboss.portal.portlet.test.jsp.response.PortletChunk; +import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; +import org.jboss.portal.portlet.test.jsp.response.ResponseBuffer; +import org.jboss.portal.portlet.PortletInvoker; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.response.FragmentResponse; +import org.jboss.portal.portlet.controller.PortletController; +import org.jboss.portal.portlet.controller.response.ControllerResponse; +import org.jboss.portal.portlet.controller.response.PageUpdateResponse; +import org.jboss.portal.portlet.controller.response.ResourceResponse; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.common.io.IOTools; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.ServletException; +import javax.servlet.ServletOutputStream; +import javax.servlet.Filter; +import javax.servlet.FilterConfig; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.FilterChain; +import javax.servlet.ServletContext; +import java.io.IOException; +import java.io.Writer; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.util.Map; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ControllerFilter implements Filter +{ + + /** . */ + private FilterConfig config; + + private ServletContext getServletContext() + { + return config.getServletContext(); + } + + public void init(FilterConfig config) throws ServletException + { + this.config =3D config; + } + + public void doFilter(ServletRequest req, ServletResponse resp, FilterCh= ain chain) throws IOException, ServletException + { + doFilter((HttpServletRequest)req, (HttpServletResponse)resp, chain); + } + + public void doFilter(HttpServletRequest req, HttpServletResponse resp, = FilterChain chain) throws IOException, ServletException + { + BufferingResponse bufferingResponse =3D new BufferingResponse(resp); + + // + chain.doFilter(req, bufferingResponse); + + // + ResponseBuffer buffer =3D bufferingResponse.getBuffer(); + buffer.close(); + + // + try + { + service(req, resp, buffer); + } + catch (ClassNotFoundException e) + { + throw new ServletException(e); + } + } + + public void destroy() + { + this.config =3D null; + } + + protected void service(HttpServletRequest req, HttpServletResponse resp= , ResponseBuffer buffer) throws ServletException, IOException, ClassNotFoun= dException + { + PortletInvoker invoker =3D (PortletInvoker)getServletContext().getAt= tribute("ConsumerPortletInvoker"); + + // + PagePortletControllerContext context =3D new PagePortletControllerCo= ntext( + req, + resp, + getServletContext(), + invoker, + buffer); + + // + PageNavigationalState pageState =3D null; + if (context.getRequest() !=3D null) + { + ControllerResponse controllerResponse; + try + { + controllerResponse =3D new PortletController().process(context= .getRequest()); + } + catch (PortletInvokerException e) + { + throw new ServletException(e); + } + + // + if (controllerResponse instanceof PageUpdateResponse) + { + PageUpdateResponse pageUpdate =3D (PageUpdateResponse)controll= erResponse; + pageState =3D pageUpdate.getPageState(); + } + else if (controllerResponse instanceof ResourceResponse) + { + ResourceResponse resourceResponse =3D (ResourceResponse)contro= llerResponse; + PortletInvocationResponse pir =3D resourceResponse.response; + + // + if (pir instanceof FragmentResponse) + { + FragmentResponse fragment =3D (FragmentResponse)pir; + = + // + if (fragment.getType() =3D=3D FragmentResponse.TYPE_EMPTY) + { + resp.setStatus(HttpServletResponse.SC_NO_CONTENT); + } + else + { + String contentType =3D fragment.getContentType(); + if (contentType !=3D null) + { + resp.setContentType(contentType); + } + + // + if (fragment.getType() =3D=3D FragmentResponse.TYPE_BYTE= S) + { + ServletOutputStream out =3D null; + try + { + out =3D resp.getOutputStream(); + out.write(fragment.getBytes().toByteArray()); + } + finally + { + IOTools.safeClose(out); + } + } + else + { + Writer writer =3D null; + try + { + writer =3D resp.getWriter(); + writer.write(fragment.getChars().toString()); + } + finally + { + writer.close(); + } + } + } + } + else + { + // todo + } + } + else + { + // todo + } + } + + // + Page page =3D context.getPage(); + + // + Map responses =3D page.render(con= text, pageState); + + // + OutputStream out =3D resp.getOutputStream(); + OutputStreamWriter writer =3D new OutputStreamWriter(out); + + // + int count =3D 0; + for (Chunk chunk : page.getChunks()) + { + if (chunk instanceof BytesChunk) + { + BytesChunk bytesChunk =3D (BytesChunk)chunk; + out.write(bytesChunk.getBytes()); + out.flush(); + } + else if (chunk instanceof CharsChunk) + { + CharsChunk bytesChunk =3D (CharsChunk)chunk; + writer.write(bytesChunk.getChars()); + writer.flush(); + } + else if (chunk instanceof PortletChunk) + { + PortletChunk portletChunk =3D (PortletChunk)chunk; + String windowId =3D "" + count++; + + PortletInvocationResponse response =3D responses.get(windowId); + if (response !=3D null) + { + if (response instanceof FragmentResponse) + { + FragmentResponse fragment =3D (FragmentResponse)response; + if (fragment.getType() !=3D FragmentResponse.TYPE_EMPTY) + { + String frag; + if (fragment.getType() =3D=3D FragmentResponse.TYPE_B= YTES) + { + frag =3D fragment.getBytes().toString(); + } + else + { + frag =3D fragment.getChars().toString(); + } + + // + writer.write(frag); + writer.flush(); + } + } + else + { + writer.write(response.getClass().getSimpleName() + "[" += portletChunk.getPortletName() + "," + portletChunk.getApplicationName() + = "]"); + writer.flush(); + } + } + else + { + writer.write("Empty[" + portletChunk.getPortletName() + ","= + portletChunk.getApplicationName() + "]"); + writer.flush(); + } + } + } + out.close(); + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/Page.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/Page.java 2008-02-06 22:58:00 UTC (rev 9815) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/Page.java 2008-02-06 23:47:22 UTC (rev 9816) @@ -26,13 +26,7 @@ import org.jboss.portal.portlet.controller.PortletControllerContext; import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.test.jsp.response.Chunk; -import org.jboss.portal.portlet.test.jsp.response.PortletChunk; -import org.jboss.portal.portlet.Portlet; -import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.info.PortletInfo; = -import javax.servlet.ServletException; -import javax.xml.namespace.QName; import java.util.Map; import java.util.HashMap; import java.util.List; @@ -45,22 +39,15 @@ { = /** . */ - public static final QName PAGE_ID_NAME =3D new QName("urn:jboss-portlet= -container", "pageid"); - - /** . */ private Map windows; = /** . */ private List chunks; = - /** . */ - private final String pageId; - - public Page(List chunks, Map windows, String pag= eId) + public Page(List chunks, Map windows) { this.chunks =3D chunks; this.windows =3D windows; - this.pageId =3D pageId; } = public List getChunks() @@ -78,7 +65,6 @@ if (pageState =3D=3D null) { pageState =3D context.getStateControllerContext().createPageState= (); - pageState.setPublicNavigationalState(PAGE_ID_NAME, new String[]{p= ageId}); } = // Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PagePortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-06 22:58:00 UTC (rev 9815) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-06 23:47:22 UTC (rev 9816) @@ -33,9 +33,6 @@ import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.controller.event.EventControllerContext; import org.jboss.portal.portlet.controller.impl.event.EventControllerConte= xtImpl; -import org.jboss.portal.portlet.controller.request.PortletRequest; -import org.jboss.portal.portlet.controller.request.PageScopedFullPortletRe= sourceRequest; -import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.web.IllegalRequestException; @@ -44,7 +41,6 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.ServletContext; import javax.servlet.ServletException; -import javax.servlet.RequestDispatcher; import java.io.IOException; import java.util.Map; import java.util.HashMap; @@ -69,53 +65,12 @@ HttpServletRequest req, HttpServletResponse resp, ServletContext servletContext, - PortletInvoker invoker) + PortletInvoker invoker, + ResponseBuffer buffer) throws IllegalRequestException, IOException, ClassNotFoundException,= ServletException { super(req, resp, servletContext); = - - // - PageNavigationalState pageState =3D null; - if (getRequest() instanceof PortletRequest) - { - PortletRequest request =3D (PortletRequest)getRequest(); - pageState =3D request.getPageState(); - } - else if (getRequest() instanceof PageScopedFullPortletResourceReques= t) - { - PageScopedFullPortletResourceRequest request =3D (PageScopedFullP= ortletResourceRequest)getRequest(); - pageState =3D request.getPageState(); - } - - // - String pageId =3D null; - if (pageState !=3D null) - { - String[] values =3D pageState.getPublicNavigationalState(Page.PAG= E_ID_NAME); - if (values !=3D null && values.length > 0) - { - pageId =3D values[0]; - } - } - if (pageId =3D=3D null) - { - pageId =3D "/index.jsp"; - } - - // - RequestDispatcher dispatcher =3D req.getRequestDispatcher(pageId); - - // - BufferingResponse bufferingResponse =3D new BufferingResponse(resp); - - // - dispatcher.include(req, bufferingResponse); - - // - ResponseBuffer buffer =3D bufferingResponse.getBuffer(); - buffer.close(); - // Collect portlets to create the page int counter =3D 0; Map windows =3D new HashMap(); @@ -150,7 +105,7 @@ } = // - this.page =3D new Page(buffer.getChunks(), windows, pageId); + this.page =3D new Page(buffer.getChunks(), windows); this.invoker =3D invoker; this.eventControllerContext =3D new EventControllerContextImpl(invok= er); } Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /web.xml 2008-02-06 22:58:00 UTC (rev 9815) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /web.xml 2008-02-06 23:47:22 UTC (rev 9816) @@ -26,6 +26,14 @@ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> + + ControllerFilter + org.jboss.portal.portlet.test.jsp.ControllerFilter + + + ControllerFilter + /* + org.jboss.portal.common.mc.bootstrap.WebBootstrap @@ -38,16 +46,8 @@ PortalServlet org.jboss.portal.simple.SimplePortalServlet - - ControllerServlet - org.jboss.portal.portlet.test.jsp.ControllerServlet - PortalServlet - / + /simple - - ControllerServlet - /jsp/* - --===============3202538653446116753==-- From portal-commits at lists.jboss.org Wed Feb 6 18:48:20 2008 Content-Type: multipart/mixed; boundary="===============4554360991728347194==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9817 - modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF. Date: Wed, 06 Feb 2008 18:48:20 -0500 Message-ID: --===============4554360991728347194== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-06 18:48:20 -0500 (Wed, 06 Feb 2008) New Revision: 9817 Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= web.xml Log: fitler only jsps Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /web.xml 2008-02-06 23:47:22 UTC (rev 9816) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /web.xml 2008-02-06 23:48:20 UTC (rev 9817) @@ -32,7 +32,7 @@ ControllerFilter - /* + /*.jsp org.jboss.portal.common.mc.bootstrap.WebBootstrap --===============4554360991728347194==-- From portal-commits at lists.jboss.org Wed Feb 6 18:49:49 2008 Content-Type: multipart/mixed; boundary="===============6821031568687281188==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9818 - modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF. Date: Wed, 06 Feb 2008 18:49:49 -0500 Message-ID: --===============6821031568687281188== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-06 18:49:49 -0500 (Wed, 06 Feb 2008) New Revision: 9818 Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= web.xml Log: crap I suck at this time of the day Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /web.xml 2008-02-06 23:48:20 UTC (rev 9817) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /web.xml 2008-02-06 23:49:49 UTC (rev 9818) @@ -32,7 +32,7 @@ ControllerFilter - /*.jsp + *.jsp org.jboss.portal.common.mc.bootstrap.WebBootstrap --===============6821031568687281188==-- From portal-commits at lists.jboss.org Wed Feb 6 19:07:32 2008 Content-Type: multipart/mixed; boundary="===============8378729095755235264==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9819 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp. Date: Wed, 06 Feb 2008 19:07:31 -0500 Message-ID: --===============8378729095755235264== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-06 19:07:31 -0500 (Wed, 06 Feb 2008) New Revision: 9819 Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerServlet.java Log: removed what idea should have removed Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/ControllerServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerServlet.java 2008-02-06 23:49:49 UTC (rev 9818) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerServlet.java 2008-02-07 00:07:31 UTC (rev 9819) @@ -1,221 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp; - -import org.jboss.portal.portlet.test.jsp.response.Chunk; -import org.jboss.portal.portlet.test.jsp.response.BytesChunk; -import org.jboss.portal.portlet.test.jsp.response.CharsChunk; -import org.jboss.portal.portlet.test.jsp.response.PortletChunk; -import org.jboss.portal.portlet.PortletInvoker; -import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.invocation.response.FragmentResponse; -import org.jboss.portal.portlet.controller.PortletController; -import org.jboss.portal.portlet.controller.response.ControllerResponse; -import org.jboss.portal.portlet.controller.response.PageUpdateResponse; -import org.jboss.portal.portlet.controller.response.ResourceResponse; -import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.common.io.IOTools; - -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import java.io.IOException; -import java.io.PrintWriter; -import java.io.Writer; -import java.util.Map; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class ControllerServlet extends HttpServlet -{ - - protected void service(HttpServletRequest req, HttpServletResponse resp= ) throws ServletException, IOException - { - try - { - _service(req, resp); - } - catch (ClassNotFoundException e) - { - throw new ServletException(e); - } - } - - protected void _service(HttpServletRequest req, HttpServletResponse res= p) throws ServletException, IOException, ClassNotFoundException - { - PortletInvoker invoker =3D (PortletInvoker)getServletContext().getAt= tribute("ConsumerPortletInvoker"); - - // - PagePortletControllerContext context =3D new PagePortletControllerCo= ntext(req, resp, getServletContext(), invoker); - - // - PageNavigationalState pageState =3D null; - if (context.getRequest() !=3D null) - { - ControllerResponse controllerResponse; - try - { - controllerResponse =3D new PortletController().process(context= .getRequest()); - } - catch (PortletInvokerException e) - { - throw new ServletException(e); - } - - // - if (controllerResponse instanceof PageUpdateResponse) - { - PageUpdateResponse pageUpdate =3D (PageUpdateResponse)controll= erResponse; - pageState =3D pageUpdate.getPageState(); - } - else if (controllerResponse instanceof ResourceResponse) - { - ResourceResponse resourceResponse =3D (ResourceResponse)contro= llerResponse; - PortletInvocationResponse pir =3D resourceResponse.response; - - // - if (pir instanceof FragmentResponse) - { - FragmentResponse fragment =3D (FragmentResponse)pir; - = - // - if (fragment.getType() =3D=3D FragmentResponse.TYPE_EMPTY) - { - resp.setStatus(HttpServletResponse.SC_NO_CONTENT); - } - else - { - String contentType =3D fragment.getContentType(); - if (contentType !=3D null) - { - resp.setContentType(contentType); - } - - // - if (fragment.getType() =3D=3D FragmentResponse.TYPE_BYTE= S) - { - ServletOutputStream out =3D null; - try - { - out =3D resp.getOutputStream(); - out.write(fragment.getBytes().toByteArray()); - } - finally - { - IOTools.safeClose(out); - } - } - else - { - Writer writer =3D null; - try - { - writer =3D resp.getWriter(); - writer.write(fragment.getChars().toString()); - } - finally - { - writer.close(); - } - } - } - } - else - { - // todo - } - } - else - { - // todo - } - } - - // - Page page =3D context.getPage(); - - // - Map responses =3D page.render(con= text, pageState); - - // - resp.setContentType("text/html"); - PrintWriter writer =3D resp.getWriter(); - int count =3D 0; - for (Chunk chunk : page.getChunks()) - { - if (chunk instanceof BytesChunk) - { - BytesChunk bytesChunk =3D (BytesChunk)chunk; - writer.write(new String(bytesChunk.getBytes())); - } - else if (chunk instanceof CharsChunk) - { - CharsChunk bytesChunk =3D (CharsChunk)chunk; - writer.write(bytesChunk.getChars()); - } - else if (chunk instanceof PortletChunk) - { - PortletChunk portletChunk =3D (PortletChunk)chunk; - String windowId =3D "" + count++; - - PortletInvocationResponse response =3D responses.get(windowId); - if (response !=3D null) - { - if (response instanceof FragmentResponse) - { - FragmentResponse fragment =3D (FragmentResponse)response; - if (fragment.getType() !=3D FragmentResponse.TYPE_EMPTY) - { - String frag; - if (fragment.getType() =3D=3D FragmentResponse.TYPE_B= YTES) - { - frag =3D fragment.getBytes().toString(); - } - else - { - frag =3D fragment.getChars().toString(); - } - - // - writer.write(frag); - } - } - else - { - writer.write(response.getClass().getSimpleName() + "[" += portletChunk.getPortletName() + "," + portletChunk.getApplicationName() + = "]"); - } - } - else - { - writer.write("Empty[" + portletChunk.getPortletName() + ","= + portletChunk.getApplicationName() + "]"); - } - } - } - writer.close(); - } -} --===============8378729095755235264==-- From portal-commits at lists.jboss.org Wed Feb 6 20:08:47 2008 Content-Type: multipart/mixed; boundary="===============7239968275378333018==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9820 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Wed, 06 Feb 2008 20:08:47 -0500 Message-ID: --===============7239968275378333018== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-06 20:08:46 -0500 (Wed, 06 Feb 2008) New Revision: 9820 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configur= ation.xml docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/migratio= n.xml Log: revising 4.1. Manual Upgrade and 4.1.1. Themes minor corrections to 3.6. Disabling Dynamic Proxy Un-wrapping Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/c= onfiguration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configu= ration.xml 2008-02-07 00:07:31 UTC (rev 9819) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configu= ration.xml 2008-02-07 01:08:46 UTC (rev 9820) @@ -262,10 +262,10 @@ Disabling Dynamic Proxy Un-wrapping - JBoss Portal uses the JBoss Microkernel for the service infras= tructure. The JBoss Microkernel provides injection of services into other s= ervices, otherwise known as wiring. Due to the Microkernel being JMX based,= tt is only possible to inject dynamic proxies that talk to the MBeanServer= . The overhead at runtime is minimal since the Microkernel implementation i= s highly optimized; however, when it is used with Java 5, a noticeable bott= leneck appears due to the fact that the implementation of the JMX API class= es, javax.management.*, provided by the Java Platform,= performs synchronization. This does not occur under JDK 1.4 since those cl= asses are implemented by JBoss MX. + JBoss Portal uses the JBoss Microkernel for the service infras= tructure. The JBoss Microkernel provides injection of services into other s= ervices, otherwise known as wiring. Due to the Microkernel being JMX based,= it is only possible to inject dynamic proxies that talk to the MBeanServer= . The overhead at runtime is minimal since the Microkernel implementation i= s highly optimized; however, when it is used with Java 5, a noticeable bott= leneck occurs due to the fact that the implementation of the JMX API classe= s, javax.management.*, provided by the Java Platform, = perform synchronization. This does not occur under JDK 1.4, since those cla= sses are implemented by JBoss MX. - JBoss Portal services use a special kind of Model MBean called JBossServiceModelMBean, which allows the un-wrapping of inject= ed dynamic proxies, and replaces them with real plain old java object (POJO= ) services. This allows the removal of the bottleneck with Java 5, and also= provides a performance boost on JDK 1.4. By default this feature is enable= d, but it is possible to disable. To do this on Linux systems, change into = the $JBOSS_HOME/bin/ directory and run the following c= ommand: + JBoss Portal services use a special kind of Model MBean called JBossServiceModelMBean, which allows the un-wrapping of inject= ed dynamic proxies, and replaces them with plain old java object (POJO) ser= vices. This removes the bottleneck when using Java 5, and also provides a p= erformance boost on JDK 1.4. By default this feature is enabled, but it is = possible to disable. To do this on Linux systems, change into the $JBOSS_HOME/bin/ directory and run the following command: Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/m= igration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/migrati= on.xml 2008-02-07 00:07:31 UTC (rev 9819) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/migrati= on.xml 2008-02-07 01:08:46 UTC (rev 9820) @@ -11,52 +11,63 @@ boleslaw dot dawidowicz at redhat dot com - Upgrading 2.4 - 2.6 + Upgrading JBoss Portal 2.4 to 2.6 + - Before performing any instructions or operations mentioned below rem= ember to backup your database content and - the whole application server directory! + + Before performing any instructions or operations in this chapter, back u= p your database content and + the entire JBoss EAP or JBoss AS directory! + + - Manual upgrade + Manual Upgrade - Although database schema remains the same in JBoss Portal 2.6 the= re are several differences that prevent from simple deployment - of newest portal version using JBoss Portal 2.4 database. In this= chapter we will list major ones and give - instructions on how to manually update proper data. + Although the database schema remains the same in JBoss Portal 2.6= , there are several differences that prevent simply deploying the latest ve= rsion of JBoss Portal, when using a database created for JBoss Portal 2.4. = This chapter describes updating a JBoss Portal 2.4 MySQL database for use w= ith JBoss Portal 2.6. - Upgrading procedure can be quite straightforward: - + The upgrade procedure can be straightforward: + + + - Remove $JBOSS_HOME/server/default/d= eploy/jboss-portal.sar file. + + If you are using the JBoss Portal binary, remove the $JBOSS_H= OME/server/default/deploy/jboss-portal.sar/ directory. If JBoss = Portal was built from source, remove the $JBOSS_HOME/server/defau= lt/deploy/jboss-portal.sar file. + - Update data in portal database like described in following = sections of this chapter + + Update the data in the JBoss Portal database, as described in . + - Deploy JBoss Portal 2.6 + + Deploy JBoss Portal 2.6. + - + - Theme + Themes + + Themes in JBoss Portal 2.6 have changed since the Portal pages now cont= ain additional areas, such as the Login, Admin<= /guiicon>, and Dashboard links, on the top right-hand co= rner: + + + - Themes in 2.6 version changed as now they - contain additional areas - the best example is upper right cor= ner where links like "Login", "Admin", "My Dashboard" - are visable. If you use default theme like "renaissance" that = is present in 2.6, you shouldn't need to do anything. To update your custom= themes please - refer to those bundled with portal as an example. - - If you stay with old theme files you may find JBP 2.6 unusa= ble to the point that you may not even be able to log in + If you use a default theme that exists in JBoss Portal 2.6, such as ren= aissance, no configuration should be necessary. Using old themes from JBoss= Portal 2.4 may make JBoss Portal 2.6 unusable, for example, not being able= to log in. To update custom themes, please refer to those bundled with JBo= ss Portal as an example. + - - Database + + Updating the Database All things described in this section can be done using Admi= nPortlet. Treat this directions more as guideline if you need to automate migration for big portal deployment. --===============7239968275378333018==-- From portal-commits at lists.jboss.org Wed Feb 6 20:28:49 2008 Content-Type: multipart/mixed; boundary="===============5184982454702107037==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9821 - in modules/portlet/trunk/test/src: main/java/org/jboss/portal/portlet/test/jsp/response and 4 other directories. Date: Wed, 06 Feb 2008 20:28:49 -0500 Message-ID: --===============5184982454702107037== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-06 20:28:49 -0500 (Wed, 06 Feb 2008) New Revision: 9821 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/portlet/ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/portlet/PortletChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/portlet/PortletMarkupChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/portlet/PortletTitleChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/portlet/PortletURLChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/MarkupTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/TitleTag.java Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/PortletChunk.java Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PagePortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTag.java modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= portal.tld modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.jsp Log: improve taglib with support of markup/title Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-07 01:08:46 UTC (rev 9820) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-07 01:28:49 UTC (rev 9821) @@ -25,7 +25,9 @@ import org.jboss.portal.portlet.test.jsp.response.Chunk; import org.jboss.portal.portlet.test.jsp.response.BytesChunk; import org.jboss.portal.portlet.test.jsp.response.CharsChunk; -import org.jboss.portal.portlet.test.jsp.response.PortletChunk; +import org.jboss.portal.portlet.test.jsp.response.portlet.PortletChunk; +import org.jboss.portal.portlet.test.jsp.response.portlet.PortletMarkupChu= nk; +import org.jboss.portal.portlet.test.jsp.response.portlet.PortletTitleChun= k; import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; import org.jboss.portal.portlet.test.jsp.response.ResponseBuffer; import org.jboss.portal.portlet.PortletInvoker; @@ -214,6 +216,8 @@ = // int count =3D 0; + PortletChunk portletChunk =3D null; + PortletInvocationResponse portletResponse =3D null; for (Chunk chunk : page.getChunks()) { if (chunk instanceof BytesChunk) @@ -230,15 +234,29 @@ } else if (chunk instanceof PortletChunk) { - PortletChunk portletChunk =3D (PortletChunk)chunk; + portletChunk =3D (PortletChunk)chunk; String windowId =3D "" + count++; - - PortletInvocationResponse response =3D responses.get(windowId); - if (response !=3D null) + portletResponse =3D responses.get(windowId); + } + else if (chunk instanceof PortletTitleChunk) + { + if (portletResponse !=3D null) { - if (response instanceof FragmentResponse) + if (portletResponse instanceof FragmentResponse) { - FragmentResponse fragment =3D (FragmentResponse)response; + FragmentResponse fragment =3D (FragmentResponse)portletR= esponse; + writer.write(fragment.getTitle()); + writer.flush(); + } + } + } + else if (chunk instanceof PortletMarkupChunk) + { + if (portletResponse !=3D null) + { + if (portletResponse instanceof FragmentResponse) + { + FragmentResponse fragment =3D (FragmentResponse)portletR= esponse; if (fragment.getType() !=3D FragmentResponse.TYPE_EMPTY) { String frag; @@ -258,7 +276,7 @@ } else { - writer.write(response.getClass().getSimpleName() + "[" += portletChunk.getPortletName() + "," + portletChunk.getApplicationName() + = "]"); + writer.write(portletResponse.getClass().getSimpleName() = + "[" + portletChunk.getPortletName() + "," + portletChunk.getApplicationNa= me() + "]"); writer.flush(); } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PagePortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-07 01:08:46 UTC (rev 9820) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-07 01:28:49 UTC (rev 9821) @@ -24,8 +24,7 @@ = import org.jboss.portal.portlet.test.controller.AbstractPortletControllerC= ontext; import org.jboss.portal.portlet.test.jsp.response.Chunk; -import org.jboss.portal.portlet.test.jsp.response.PortletChunk; -import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; +import org.jboss.portal.portlet.test.jsp.response.portlet.PortletChunk; import org.jboss.portal.portlet.test.jsp.response.ResponseBuffer; import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletInvokerException; Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/response/PortletChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/PortletChunk.java 2008-02-07 01:08:46 UTC (rev 9820) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/PortletChunk.java 2008-02-07 01:28:49 UTC (rev 9821) @@ -1,53 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp.response; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class PortletChunk extends Chunk -{ - - /** . */ - private final String portletName; - - /** . */ - private final String applicationName; - - public PortletChunk(String portletName, String applicationName) - { - this.portletName =3D portletName; - this.applicationName =3D applicationName; - } - - public String getPortletName() - { - return portletName; - } - - public String getApplicationName() - { - return applicationName; - } -} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/response/portlet/PortletChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/PortletChunk.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/PortletChunk.java 2008-02-07 01:28:49 UTC (rev 9821) @@ -0,0 +1,86 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.response.portlet; + +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; +import org.jboss.portal.portlet.test.jsp.response.Chunk; + +import java.util.Set; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletChunk extends Chunk +{ + + /** . */ + private final String portletName; + + /** . */ + private final String applicationName; + + /** . */ + private final Mode initialMode; + + /** . */ + private final Set supportedModes; + + /** . */ + private final Set supportedWindowStates; + + public PortletChunk(String portletName, String applicationName, Mode in= itialMode, Set supportedModes, Set supportedWindowStates) + { + this.portletName =3D portletName; + this.applicationName =3D applicationName; + this.initialMode =3D initialMode; + this.supportedModes =3D supportedModes; + this.supportedWindowStates =3D supportedWindowStates; + } + + public String getPortletName() + { + return portletName; + } + + public String getApplicationName() + { + return applicationName; + } + + public Mode getInitialMode() + { + return initialMode; + } + + public Set getSupportedModes() + { + return supportedModes; + } + + public Set getSupportedWindowStates() + { + return supportedWindowStates; + } +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/response/portlet/PortletMarkupChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/PortletMarkupChunk.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/PortletMarkupChunk.java 2008-02-07 01:28:49 UTC (rev 9= 821) @@ -0,0 +1,33 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.response.portlet; + +import org.jboss.portal.portlet.test.jsp.response.Chunk; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletMarkupChunk extends Chunk +{ +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/response/portlet/PortletTitleChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/PortletTitleChunk.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/PortletTitleChunk.java 2008-02-07 01:28:49 UTC (rev 98= 21) @@ -0,0 +1,33 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.response.portlet; + +import org.jboss.portal.portlet.test.jsp.response.Chunk; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletTitleChunk extends Chunk +{ +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/response/portlet/PortletURLChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/PortletURLChunk.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/PortletURLChunk.java 2008-02-07 01:28:49 UTC (rev 9821) @@ -0,0 +1,33 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.response.portlet; + +import org.jboss.portal.portlet.test.jsp.response.Chunk; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletURLChunk extends Chunk +{ +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/taglib/MarkupTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/MarkupTag.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/MarkupTag.java 2008-02-07 01:28:49 UTC (rev 9821) @@ -0,0 +1,47 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.taglib; + +import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; +import org.jboss.portal.portlet.test.jsp.response.portlet.PortletTitleChun= k; +import org.jboss.portal.portlet.test.jsp.response.portlet.PortletMarkupChu= nk; + +import javax.servlet.jsp.tagext.SimpleTagSupport; +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.PageContext; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class MarkupTag extends SimpleTagSupport +{ + public void doTag() throws JspException, IOException + { + PageContext pageCtx =3D (PageContext)getJspContext(); + pageCtx.getOut().flush(); + BufferingResponse response =3D (BufferingResponse)pageCtx.getRespons= e(); + response.addChunk(new PortletMarkupChunk()); + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-07 01:08:46 UTC (rev 9820) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-07 01:28:49 UTC (rev 9821) @@ -23,26 +23,48 @@ package org.jboss.portal.portlet.test.jsp.taglib; = import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; -import org.jboss.portal.portlet.test.jsp.response.PortletChunk; +import org.jboss.portal.portlet.test.jsp.response.portlet.PortletChunk; +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; +import org.jboss.portal.common.util.Tools; = import javax.servlet.jsp.tagext.SimpleTagSupport; +import javax.servlet.jsp.tagext.BodyTagSupport; import javax.servlet.jsp.JspException; import javax.servlet.jsp.PageContext; import java.io.IOException; +import java.util.LinkedHashSet; +import java.util.Set; +import java.util.Collections; = /** * @author Julien Viet * @version $Revision: 630 $ */ -public class PortletTag extends SimpleTagSupport +public class PortletTag extends BodyTagSupport { = /** . */ + private static final Set DEFAULT_MODES =3D Collections.unmodifiab= leSet(Tools.toSet(Mode.VIEW, Mode.EDIT, Mode.HELP)); + + /** . */ + private static final Set DEFAULT_WINDOW_STATES =3D Collect= ions.unmodifiableSet(Tools.toSet(WindowState.NORMAL, WindowState.MAXIMIZED,= WindowState.MINIMIZED)); + + /** . */ private String name; = /** . */ private String applicationName; = + /** . */ + private String supportedWindowStateValues; + + /** . */ + private String supportedModeValues; + + /** . */ + private String initialModeValue; + public String getName() { return name; @@ -63,11 +85,99 @@ this.applicationName =3D applicationName; } = - public void doTag() throws JspException, IOException + public String getSupportedWindowStates() { - PageContext pageCtx =3D (PageContext)getJspContext(); - pageCtx.getOut().flush(); - BufferingResponse response =3D (BufferingResponse)pageCtx.getRespons= e(); - response.addChunk(new PortletChunk(name, applicationName)); + return supportedWindowStateValues; } + + public void setSupportedWindowStates(String supportedWindowStates) + { + this.supportedWindowStateValues =3D supportedWindowStates; + } + + public String getSupportedModes() + { + return supportedModeValues; + } + + public void setSupportedModes(String supportedModes) + { + this.supportedModeValues =3D supportedModes; + } + + public String getInitialMode() + { + return initialModeValue; + } + + public void setInitialMode(String initialMode) + { + this.initialModeValue =3D initialMode; + } + + public int doStartTag() throws JspException + { + Set supportedModes =3D new LinkedHashSet(); + if (supportedModeValues !=3D null) + { + for (String supportedModeValue : supportedModeValues.split(",")) + { + Mode mode =3D Mode.create(supportedModeValue.trim()); + supportedModes.add(mode); + } + } + else + { + supportedModes =3D DEFAULT_MODES; + } + + // + Set supportedWindowStates =3D new LinkedHashSet(); + if (supportedWindowStateValues !=3D null) + { + for (String supportedWindowStateValue : supportedWindowStateValue= s.split(",")) + { + WindowState windowState =3D WindowState.create(supportedWindow= StateValue.trim()); + supportedWindowStates.add(windowState); + } + } + else + { + supportedWindowStates =3D DEFAULT_WINDOW_STATES; + } + + // + Mode initialMode =3D Mode.VIEW; + if (initialModeValue !=3D null) + { + initialMode =3D Mode.create(initialModeValue.trim()); + } + + // + try + { + pageContext.getOut().flush(); + } + catch (IOException e) + { + throw new JspException(e); + } + + // + BufferingResponse response =3D (BufferingResponse)pageContext.getRes= ponse(); + response.addChunk(new PortletChunk( + name, + applicationName, + initialMode, + supportedModes, + supportedWindowStates)); + + // + return EVAL_BODY_INCLUDE; + } + + public int doEndTag() throws JspException + { + return EVAL_PAGE; + } } Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/taglib/TitleTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/TitleTag.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/TitleTag.java 2008-02-07 01:28:49 UTC (rev 9821) @@ -0,0 +1,46 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.taglib; + +import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; +import org.jboss.portal.portlet.test.jsp.response.portlet.PortletTitleChun= k; + +import javax.servlet.jsp.tagext.SimpleTagSupport; +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.PageContext; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class TitleTag extends SimpleTagSupport +{ + public void doTag() throws JspException, IOException + { + PageContext pageCtx =3D (PageContext)getJspContext(); + pageCtx.getOut().flush(); + BufferingResponse response =3D (BufferingResponse)pageCtx.getRespons= e(); + response.addChunk(new PortletTitleChunk()); + } +} Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/portal.tld =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.tld 2008-02-07 01:08:46 UTC (rev 9820) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.tld 2008-02-07 01:28:49 UTC (rev 9821) @@ -17,7 +17,7 @@ portlet org.jboss.portal.portlet.test.jsp.taglib.PortletTag - empty + JSP name true @@ -28,6 +28,30 @@ true java.lang.String + + initialMode + java.lang.String + + + supportedModes + java.lang.String + + + supportedWindowStates + java.lang.String + = + + markup + org.jboss.portal.portlet.test.jsp.taglib.MarkupTag + empty + + + + title + org.jboss.portal.portlet.test.jsp.taglib.TitleTag + empty + + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/i= ndex.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-07 01:08:46 UTC (rev 9820) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-07 01:28:49 UTC (rev 9821) @@ -4,19 +4,37 @@ - ONE +****************************************************
    - TWO + applicationName=3D"google-weather-portlet"> +-----------------------------------
    +
    +-----------------------------------
    + +-----------------------------------
    +
    +****************************************************
    - THREE + applicationName=3D"google-map-portlet"> +-----------------------------------
    +
    +-----------------------------------
    + +-----------------------------------
    +
    +****************************************************
    - FOUR + applicationName=3D"remotecontrol-portlet"> +-----------------------------------
    +
    +-----------------------------------
    + +-----------------------------------
    +
    +****************************************************
    --===============5184982454702107037==-- From portal-commits at lists.jboss.org Wed Feb 6 21:04:14 2008 Content-Type: multipart/mixed; boundary="===============5051961681456671938==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9822 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Wed, 06 Feb 2008 21:04:13 -0500 Message-ID: --===============5051961681456671938== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-06 21:04:13 -0500 (Wed, 06 Feb 2008) New Revision: 9822 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/migratio= n.xml Log: revising 4.1.2. Updating the Database Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/m= igration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/migrati= on.xml 2008-02-07 01:28:49 UTC (rev 9821) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/migrati= on.xml 2008-02-07 02:04:13 UTC (rev 9822) @@ -68,23 +68,22 @@
    Updating the Database - All things described in this section can be done using Admi= nPortlet. Treat this directions more as guideline - if you need to automate migration for big portal deployment. - Database schema wasn't changed between 2.4 and 2.6 releases, b= ut still content that is kept in it - changed slightly in few areas. You can easily update the data = manually by using tools proper for your - RDBMS. If you use MySQL you can use MySQL Query Browser that can - be downloaded from MySQL website. + All procedures described in the following sections can performed using = the AdminPortlet. Treat the directions as guidelines if you need to automat= e the migration of a large JBoss Portal deployment. + + + Database schema has not changed between the JBoss Portal 2.4 and 2.6 re= leases, but certain content that is kept in the databases has changed. Data= can be updated manually by using the correct tools for your RDBMS. For exa= mple, if you are using a MySQL database, you can use the MySQL Query Browser. - - Instructions below refer to standard JBoss Portal 2.4 deployme= nt. If you named core portlets, portlet instances - or portlet windows differently you will need to make proper mo= difications in those steps. - + + The following instructions refer to a standard JBoss Portal 2.4 deploym= ent. If you named core portlets, portlet instances, or portlet windows diff= erently, you will need to make the appropriate modifications. The following= is an example of using the MySQL Query Browser: + + + Portlet names Names of few core bundled portlets changed. To update th= em you need to: --===============5051961681456671938==-- From portal-commits at lists.jboss.org Wed Feb 6 22:54:29 2008 Content-Type: multipart/mixed; boundary="===============3271019994040681384==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9823 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Wed, 06 Feb 2008 22:54:29 -0500 Message-ID: --===============3271019994040681384== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-06 22:54:28 -0500 (Wed, 06 Feb 2008) New Revision: 9823 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/migratio= n.xml Log: revising 4.1.2.1. Portlet Names, removing note admonitions, changing itemized list to orderedlist Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/m= igration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/migrati= on.xml 2008-02-07 02:04:13 UTC (rev 9822) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/migrati= on.xml 2008-02-07 03:54:28 UTC (rev 9823) @@ -85,47 +85,51 @@
    - Portlet names - Names of few core bundled portlets changed. To update th= em you need to: + Portlet Names - In JBP_INSTANCES table: - - Change "local.portal.CMSPorlet" in PORTLET_REF column to - "local./portal-cms.CMSPortlet" - - Change "local.portal.CMSAdminPorlet<= /emphasis>" in PORTLET_REF column to - "local./portal-cms.CMSAdminPortlet" - - Change "local.portal.ManagementPorle= t" in PORTLET_REF column to - "local./portal-admin.AdminPortlet" - - - - Instead of editing database you can destroy those instan= ces in AdminPortlet and recreate them. + Names of certain core bundled portlets have changed. Destroy the fol= lowing instances and use the AdminPortlet to recreate them, or, edit the JBP_INSTANCES table as follows: + + + + + + Change local.portal.CMSPorlet in the PORTLET_REF column to local./portal-cms.CMSPortlet= . + + + + + Change local.portal.CMSAdminPorlet in the PORTLET_REF column to local./portal-cms.CMSAdm= inPortlet. + + + + + Change local.portal.ManagementPorlet in the = PORTLET_REF column to local./portal-admin.Ad= minPortlet. + + + + - NavigationPortlet from JBP 2.4 is not = present anymore. Its functionality is now realized by - PageCustomizerInterceptor so all refer= ences to NavigationPortlet should - be removed from all portal pages. You can do it either by c= leaning up database content or by using - AdminPortlet in Portal interface. In d= atabase you should remove: - - - Rows containing "local.portal.NavigationPor= tlet" in - "PORTLET_REF" column in - "JBP_INSTANCES" table. - - - Rows containing "NavigationPortletInstance<= /emphasis>" in - "INSTANCE_REF" column in - "JBP_WINDOW" table. - - - Rows containing "NavigationPortletWindow" in - "NAME" column in - "JBP_OBJECT" table. - - - - Instead of editing database you can just remove Navigati= onPortletInstance using AdminPortlet. + The NavigationPortlet from JBoss Portal 2.4 has= been removed, and its functionality is now replaced by PageCusto= mizerInterceptor. All references to the NavigationPort= let should be removed from all portal pages. Remove Na= vigationPortletInstance using the AdminPortlet, or edit the data= base as follows: + + + + + + In the JBP_INSTANCES table, rows containing= local.portal.NavigationPortlet in the PORTL= ET_REF column. + + + + + In the JBP_WINDOW table, rows containing NavigationPortletInstance in the INSTANCE_REF<= /emphasis> column. + + + + + In the JBP_OBJECT table, rows containing NavigationPortletWindow in the NAME= column. + + + + CMS --===============3271019994040681384==-- From portal-commits at lists.jboss.org Thu Feb 7 00:21:26 2008 Content-Type: multipart/mixed; boundary="===============2192975626102257150==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9824 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples. Date: Thu, 07 Feb 2008 00:21:26 -0500 Message-ID: --===============2192975626102257150== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-07 00:21:26 -0500 (Thu, 07 Feb 2008) New Revision: 9824 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples= /RemoteControlResourcePortlet.java Log: - Make remote control work. I don't like javascript! :p Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/= samples/RemoteControlResourcePortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/RemoteControlResourcePortlet.java 2008-02-07 03:54:28 UTC (rev 9823) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/RemoteControlResourcePortlet.java 2008-02-07 05:21:26 UTC (rev 9824) @@ -29,12 +29,12 @@ { renderResponse.setContentType("text/html"); PrintWriter printWriter =3D renderResponse.getWriter(); - printWriter.print("

    function openRem= ote(url){window.name=3D'jbp_parent';" + + "window.open(url, 'jbp_remote', 'width=3D400,height=3D200,scrolla= ble=3Dyes')}"); + printWriter.print("

    Open remote control!

    "); + printWriter.print(resource); + printWriter.print("')\">Open remote control!

    "); } = @Override @@ -42,21 +42,27 @@ { resourceResponse.setContentType("text/html"); PrintWriter writer =3D resourceResponse.getWriter(); + writer.print(""); PortletURL url =3D resourceResponse.createRenderURL(); url.setWindowState(WindowState.MINIMIZED); - writer.print(""); writer.print("

    'zipcode' public render parameter value: " += resourceRequest.getParameter(ZIPCODE) + "
    "); writer.print("

    Set value of 'zipcode' public render paramet= er to:"); url.setParameter(ZIPCODE, "80201"); - writer.print("

  • Denver"); + writer.print("
  • Denver"); url.setParameter(ZIPCODE, "94102"); - writer.print("
  • San Francisco"); + writer.print("
  • San Francisco"); url.setParameter(ZIPCODE, "20001"); - writer.print("
  • Washington, DC"); + writer.print("
  • Washington, DC"); writer.print("

    "); } + + private String createParentURL(PortletURL url) + { + return "openLinkInParent('" + url + "')"; + } } --===============2192975626102257150==-- From portal-commits at lists.jboss.org Thu Feb 7 00:22:15 2008 Content-Type: multipart/mixed; boundary="===============3956689067812955543==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9825 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Thu, 07 Feb 2008 00:22:15 -0500 Message-ID: --===============3956689067812955543== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-07 00:22:15 -0500 (Thu, 07 Feb 2008) New Revision: 9825 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/migratio= n.xml Log: revising 4.1.2.2. CMS Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/m= igration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/migrati= on.xml 2008-02-07 05:21:26 UTC (rev 9824) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/migrati= on.xml 2008-02-07 05:22:15 UTC (rev 9825) @@ -134,15 +134,10 @@ CMS - This is probably the less trival part to do directly in dat= abase. In JBP 2.6 version the way that CMS - content is being displayed changed significantly. Please re= fer to - Content Integration and CMS Portlet - chapters for more information. Basically currently there is= no need to have more than one instance of - CMSPortlet and the portlet window disp= lays CMS content not by referring to that portlet instance - but by having proper content-type defi= ned. In "default-object.xml - you will find following configuration: - - and . Currently th= ere is no need to have more than one instance of the CMSPortlet. The portlet window displays CMS content, not by referring to tha= t portlet instance, but by having the proper content-type defined. The following configuration is in the jboss-portal.s= ar/conf/data/default-object.xml file: + + + CMSWindow @@ -151,53 +146,54 @@ center 0 - - ]]> - - +]]> + + - Open JBP_OBJECT_NODE tab= le in your database schema. By looking at - PATH column you will eas= ily find any occurances of CMS in your portal - deployment + The following example uses the MySQL Query Browser. Open the JBP_OBJECT_NODE table in your database schema. = Look at the PATH column to identify any = occurrences of CMS in your JBoss Portal deployment. Identify any row referr= ing to CMSPortletWindow, and remember the number in PARENT_KEY column. The PARENT_KEY number is needed in the following steps: + + - For any row you will identify as referring to CMS= PortletWindow in your system remember - the number in PK column.= It will be needed in next steps + Go to the JBP_WINDOW table and fi= nd a row with the same + PARENT_KEY value from the JBP_OBJECT_NODE table. In such a row, replace <= emphasis>CMSPortletInstance with a path to your CMS resource. Fo= r example, by default, JBoss Portal displays /default/index.html<= /filename>. - Go to JBP_WINDOW tab= le and find row with the same - PK value like the one fr= om - JBP_OBJECT_NODE table. I= n such row replace - "CMSPortletInstance" with a path to yo= ur CMS resource. For example by default - portal is displaying "/default/index.html". - - Go to JBP_PORTAL_OBJECT_PROPS table and add a row containing: + Go to the JBP_PORTAL_OBJECT_PRO= PS table and add a row containing: - The number you remembered in "OBJECT_KEY" column. - - - "portal.windowContentType" in "<= emphasis>NAME" column. - - - "cms" in "jbp_VALUE" column. - - - + + The PARENT_KEY number remembered = from the OBJECT_KEY column. + + + + + portal.windowContentType in the NAME<= /emphasis> column. + + + + + cms in the jbp_VALUE colum= n. + + + + - Remember that you can also change portlet window content= type and configure path to CMS resource - using AdminPortlet + + Portlet Content Type and Path to the CMS Resource + + You can change the portlet window content type and configure the path = to the CMS resource + using the AdminPortlet. + + - - - - + = - Deploying your first portlet + Deploying your First Portlet Introduction - This section will introduce the reader to deploying his = first portlet in JBoss Portal. It requires you - download the HelloWorldPortlet from PortletSwap.com, using = this - link. - + + This section details deploying your first portlet in JBoss Portal. B= efore proceeding, download the HelloWorldPorlet from JBoss PortletSwap. + Package Structure --===============4860120218687580383==-- From portal-commits at lists.jboss.org Thu Feb 7 06:10:07 2008 Content-Type: multipart/mixed; boundary="===============8584549153455503592==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9831 - in modules/portlet/trunk/test/src: main/java/org/jboss/portal/portlet/test/jsp and 5 other directories. Date: Thu, 07 Feb 2008 06:10:06 -0500 Message-ID: --===============8584549153455503592== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-07 06:10:06 -0500 (Thu, 07 Feb 2008) New Revision: 9831 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/portlet/EndPortletChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/portlet/StartPortletTitleChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/AbstractURLTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/BodyChunkTagSupport.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/ParamTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletURLTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/SimpleChunkTagSupport.java Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletURLRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/Page.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/BufferingResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/ResponseBuffer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/portlet/PortletURLChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/MarkupTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/TitleTag.java modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= portal.tld modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.jsp Log: add support for portleturl tag Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletURLRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-07 08:31:51 UTC (rev 9830) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-07 11:10:06 UTC (rev 9831) @@ -125,11 +125,14 @@ parameters.put(LIFECYCLE_TYPE, type); = // - String pageState; + String pageState =3D null; try { - byte[] bytes =3D stateContext.serialize(pageNS); - pageState =3D Tools.toHexString(bytes); + if (pageNS !=3D null) + { + byte[] bytes =3D stateContext.serialize(pageNS); + pageState =3D Tools.toHexString(bytes); + } } catch (IOException e) { @@ -153,7 +156,10 @@ } = // - parameters.put(PAGE_STATE, pageState); + if (pageState !=3D null) + { + parameters.put(PAGE_STATE, pageState); + } = // if (containerURL instanceof ActionURL) @@ -190,7 +196,10 @@ = // StateString navigationalState =3D renderURL.getNavigationalSta= te(); - parameters.put(NAVIGATIONAL_STATE, navigationalState.getString= Value()); + if (navigationalState !=3D null) + { + parameters.put(NAVIGATIONAL_STATE, navigationalState.getStr= ingValue()); + } } } else Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-07 08:31:51 UTC (rev 9830) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-07 11:10:06 UTC (rev 9831) @@ -27,19 +27,28 @@ import org.jboss.portal.portlet.test.jsp.response.CharsChunk; import org.jboss.portal.portlet.test.jsp.response.portlet.PortletChunk; import org.jboss.portal.portlet.test.jsp.response.portlet.PortletMarkupChu= nk; -import org.jboss.portal.portlet.test.jsp.response.portlet.PortletTitleChun= k; +import org.jboss.portal.portlet.test.jsp.response.portlet.StartPortletTitl= eChunk; +import org.jboss.portal.portlet.test.jsp.response.portlet.PortletURLChunk; +import org.jboss.portal.portlet.test.jsp.response.portlet.EndPortletChunk; import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; import org.jboss.portal.portlet.test.jsp.response.ResponseBuffer; +import org.jboss.portal.portlet.test.controller.PortletURLRenderer; import org.jboss.portal.portlet.PortletInvoker; import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.RenderURL; +import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.controller.PortletController; +import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; import org.jboss.portal.portlet.controller.response.ControllerResponse; import org.jboss.portal.portlet.controller.response.PageUpdateResponse; import org.jboss.portal.portlet.controller.response.ResourceResponse; import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; import org.jboss.portal.common.io.IOTools; +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; = import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -206,6 +215,10 @@ = // Page page =3D context.getPage(); + if (pageState =3D=3D null) + { + pageState =3D context.getStateControllerContext().createPageState= (); + } = // Map responses =3D page.render(con= text, pageState); @@ -216,6 +229,7 @@ = // int count =3D 0; + String windowId =3D null; PortletChunk portletChunk =3D null; PortletInvocationResponse portletResponse =3D null; for (Chunk chunk : page.getChunks()) @@ -235,10 +249,10 @@ else if (chunk instanceof PortletChunk) { portletChunk =3D (PortletChunk)chunk; - String windowId =3D "" + count++; + windowId =3D "" + count++; portletResponse =3D responses.get(windowId); } - else if (chunk instanceof PortletTitleChunk) + else if (chunk instanceof StartPortletTitleChunk) { if (portletResponse !=3D null) { @@ -250,28 +264,76 @@ } } } - else if (chunk instanceof PortletMarkupChunk) + else if (chunk instanceof PortletURLChunk) { + final PortletURLChunk portletURL =3D (PortletURLChunk)chunk; if (portletResponse !=3D null) { if (portletResponse instanceof FragmentResponse) { - FragmentResponse fragment =3D (FragmentResponse)portletR= esponse; - if (fragment.getType() !=3D FragmentResponse.TYPE_EMPTY) + PortletURLRenderer renderer =3D new PortletURLRenderer( + (StateControllerContextImpl)context.getStateControlle= rContext(), + pageState, + windowId, + context.getClientRequest(), + context.getClientResponse()); + + RenderURL url =3D new RenderURL() { - String frag; - if (fragment.getType() =3D=3D FragmentResponse.TYPE_B= YTES) + public StateString getNavigationalState() { - frag =3D fragment.getBytes().toString(); + return null; } - else + + public Map getPublicNavigationalSta= teChanges() { - frag =3D fragment.getChars().toString(); + return portletURL.getParams(); } = - // - writer.write(frag); - writer.flush(); + public Mode getMode() + { + return portletURL.getMode(); + } + + public WindowState getWindowState() + { + return portletURL.getWindowState(); + } + }; + + // + String renderedURL =3D renderer.renderURL(url, null, nul= l, true); + writer.write(renderedURL); + writer.flush(); + } + } + } + else if (chunk instanceof PortletMarkupChunk) + { + if (portletResponse !=3D null) + { + if (portletResponse instanceof FragmentResponse) + { + FragmentResponse fragment =3D (FragmentResponse)portletR= esponse; + WindowNavigationalState windowNS =3D pageState.getWindow= NavigationalState(windowId); + if (windowNS =3D=3D null || windowNS.getWindowState().eq= uals(WindowState.NORMAL)) + { + if (fragment.getType() !=3D FragmentResponse.TYPE_EMP= TY) + { + String frag; + if (fragment.getType() =3D=3D FragmentResponse.TYP= E_BYTES) + { + frag =3D fragment.getBytes().toString(); + } + else + { + frag =3D fragment.getChars().toString(); + } + + // + writer.write(frag); + writer.flush(); + } } } else @@ -286,6 +348,12 @@ writer.flush(); } } + else if (chunk instanceof EndPortletChunk) + { + windowId =3D null; + portletChunk =3D null; + portletResponse =3D null; + } } out.close(); } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/Page.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/Page.java 2008-02-07 08:31:51 UTC (rev 9830) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/Page.java 2008-02-07 11:10:06 UTC (rev 9831) @@ -62,12 +62,6 @@ = public Map render(PortletControllerC= ontext context, PageNavigationalState pageState) { - if (pageState =3D=3D null) - { - pageState =3D context.getStateControllerContext().createPageState= (); - } - - // Map responses =3D new HashMap(); = // Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/response/BufferingResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/BufferingResponse.java 2008-02-07 08:31:51 UTC (rev 9830) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/BufferingResponse.java 2008-02-07 11:10:06 UTC (rev 9831) @@ -65,9 +65,4 @@ { buffer.close(); } - - public void addChunk(Chunk chunk) - { - buffer.addChunk(chunk); - } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/response/ResponseBuffer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/ResponseBuffer.java 2008-02-07 08:31:51 UTC (rev 9830) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/ResponseBuffer.java 2008-02-07 11:10:06 UTC (rev 9831) @@ -49,11 +49,36 @@ /** . */ private PrintWriter writer; = + /** . */ + private boolean muted; + + public boolean isMuted() + { + return muted; + } + + public void setMuted(boolean muted) + { + this.muted =3D muted; + } + public List getChunks() { return chunks; } = + public void flush() + { + if (chunkWriter !=3D null) + { + chunkWriter.writeChunk(); + } + else if (chunkOutputStream !=3D null) + { + chunkOutputStream.writeChunk(); + } + } + public void close() { try @@ -131,10 +156,15 @@ StringBuffer sb =3D getBuffer(); if (sb.length() > 0) { - char[] chars =3D new char[sb.length()]; - sb.getChars(0, sb.length(), chars, 0); - CharsChunk chunk =3D new CharsChunk(chars); - chunks.add(chunk); + if (!muted) + { + char[] chars =3D new char[sb.length()]; + sb.getChars(0, sb.length(), chars, 0); + CharsChunk chunk =3D new CharsChunk(chars); + chunks.add(chunk); + } + + // sb.setLength(0); } } @@ -161,12 +191,17 @@ = public void writeChunk() { - if (bytebuffer.size() > 0) + if (bytebuffer.size() > 0 && !muted) { - byte[] bytes =3D bytebuffer.toByteArray(); + if (!muted) + { + byte[] bytes =3D bytebuffer.toByteArray(); + BytesChunk chunk =3D new BytesChunk(bytes); + chunks.add(chunk); + } + + // bytebuffer.reset(); - BytesChunk chunk =3D new BytesChunk(bytes); - chunks.add(chunk); } } = Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/response/portlet/EndPortletChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/EndPortletChunk.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/EndPortletChunk.java 2008-02-07 11:10:06 UTC (rev 9831) @@ -0,0 +1,33 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.response.portlet; + +import org.jboss.portal.portlet.test.jsp.response.Chunk; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class EndPortletChunk extends Chunk +{ +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/response/portlet/PortletURLChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/PortletURLChunk.java 2008-02-07 08:31:51 UTC (rev 9830) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/PortletURLChunk.java 2008-02-07 11:10:06 UTC (rev 9831) @@ -23,11 +23,46 @@ package org.jboss.portal.portlet.test.jsp.response.portlet; = import org.jboss.portal.portlet.test.jsp.response.Chunk; +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; = +import java.util.Map; + /** * @author Julien Viet * @version $Revision: 630 $ */ public class PortletURLChunk extends Chunk { + + /** . */ + private final Mode mode; + + /** . */ + private final WindowState windowState; + + /** . */ + private final Map params; + + public PortletURLChunk(Mode mode, WindowState windowState, Map params) + { + this.mode =3D mode; + this.windowState =3D windowState; + this.params =3D params; + } + + public Mode getMode() + { + return mode; + } + + public WindowState getWindowState() + { + return windowState; + } + + public Map getParams() + { + return params; + } } Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/jsp/response/portlet/StartPortletTitleChunk.java (from rev 9821, module= s/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/respon= se/portlet/PortletTitleChunk.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/StartPortletTitleChunk.java (r= ev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/StartPortletTitleChunk.java 2008-02-07 11:10:06 UTC (r= ev 9831) @@ -0,0 +1,33 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.response.portlet; + +import org.jboss.portal.portlet.test.jsp.response.Chunk; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class StartPortletTitleChunk extends Chunk +{ +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/taglib/AbstractURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/AbstractURLTag.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/AbstractURLTag.java 2008-02-07 11:10:06 UTC (rev 9831) @@ -0,0 +1,53 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.taglib; + +import javax.servlet.jsp.JspException; +import java.util.Map; +import java.util.HashMap; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class AbstractURLTag extends BodyChunkTagSupport +{ + + /** . */ + private Map params =3D new HashMap(= ); + + public void setParam(String name, String value) + { + params.put(name, new String[]{value}); + } + + public Map getParams() + { + return new HashMap(params); + } + + public void doInitBody() throws JspException + { + params.clear(); + } +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/taglib/BodyChunkTagSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/BodyChunkTagSupport.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/BodyChunkTagSupport.java 2008-02-07 11:10:06 UTC (rev 9831) @@ -0,0 +1,75 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.taglib; + +import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; +import org.jboss.portal.portlet.test.jsp.response.Chunk; +import org.jboss.portal.portlet.test.jsp.response.ResponseBuffer; + +import javax.servlet.jsp.tagext.BodyTagSupport; +import javax.servlet.jsp.JspException; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class BodyChunkTagSupport extends BodyTagSupport +{ + + protected final ResponseBuffer getBuffer() + { + BufferingResponse response =3D (BufferingResponse)pageContext.getRes= ponse(); + return response.getBuffer(); + } + + protected void mute(boolean on) throws JspException + { + try + { + pageContext.getOut().flush(); + BufferingResponse response =3D (BufferingResponse)pageContext.get= Response(); + ResponseBuffer buffer =3D response.getBuffer(); + buffer.flush(); + buffer.setMuted(on); + } + catch (IOException e) + { + throw new JspException(e); + } + } + + protected final void addChunk(Chunk chunk) throws JspException + { + try + { + pageContext.getOut().flush(); + BufferingResponse response =3D (BufferingResponse)pageContext.get= Response(); + response.getBuffer().addChunk(chunk); + } + catch (IOException e) + { + throw new JspException(e); + } + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/MarkupTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/MarkupTag.java 2008-02-07 08:31:51 UTC (rev 9830) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/MarkupTag.java 2008-02-07 11:10:06 UTC (rev 9831) @@ -22,26 +22,17 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp.taglib; = -import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; -import org.jboss.portal.portlet.test.jsp.response.portlet.PortletTitleChun= k; +import org.jboss.portal.portlet.test.jsp.response.Chunk; import org.jboss.portal.portlet.test.jsp.response.portlet.PortletMarkupChu= nk; = -import javax.servlet.jsp.tagext.SimpleTagSupport; -import javax.servlet.jsp.JspException; -import javax.servlet.jsp.PageContext; -import java.io.IOException; - /** * @author Julien Viet * @version $Revision: 630 $ */ -public class MarkupTag extends SimpleTagSupport +public class MarkupTag extends SimpleChunkTagSupport { - public void doTag() throws JspException, IOException + protected Chunk doChunkTag() { - PageContext pageCtx =3D (PageContext)getJspContext(); - pageCtx.getOut().flush(); - BufferingResponse response =3D (BufferingResponse)pageCtx.getRespons= e(); - response.addChunk(new PortletMarkupChunk()); + return new PortletMarkupChunk(); } } Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/taglib/ParamTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/ParamTag.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/ParamTag.java 2008-02-07 11:10:06 UTC (rev 9831) @@ -0,0 +1,67 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.taglib; + +import javax.servlet.jsp.tagext.SimpleTagSupport; +import javax.servlet.jsp.JspException; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ParamTag extends SimpleTagSupport +{ + + /** . */ + private String name; + + /** . */ + private String value; + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name =3D name; + } + + public String getValue() + { + return value; + } + + public void setValue(String value) + { + this.value =3D value; + } + + public void doTag() throws JspException, IOException + { + AbstractURLTag urlTag =3D (AbstractURLTag)SimpleTagSupport.findAnces= torWithClass(this, AbstractURLTag.class); + urlTag.setParam(name, value); + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-07 08:31:51 UTC (rev 9830) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-07 11:10:06 UTC (rev 9831) @@ -22,16 +22,13 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp.taglib; = -import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; import org.jboss.portal.portlet.test.jsp.response.portlet.PortletChunk; +import org.jboss.portal.portlet.test.jsp.response.portlet.EndPortletChunk; import org.jboss.portal.Mode; import org.jboss.portal.WindowState; import org.jboss.portal.common.util.Tools; = -import javax.servlet.jsp.tagext.SimpleTagSupport; -import javax.servlet.jsp.tagext.BodyTagSupport; import javax.servlet.jsp.JspException; -import javax.servlet.jsp.PageContext; import java.io.IOException; import java.util.LinkedHashSet; import java.util.Set; @@ -41,7 +38,7 @@ * @author Julien Viet * @version $Revision: 630 $ */ -public class PortletTag extends BodyTagSupport +public class PortletTag extends BodyChunkTagSupport { = /** . */ @@ -164,8 +161,7 @@ } = // - BufferingResponse response =3D (BufferingResponse)pageContext.getRes= ponse(); - response.addChunk(new PortletChunk( + addChunk(new PortletChunk( name, applicationName, initialMode, @@ -178,6 +174,9 @@ = public int doEndTag() throws JspException { + addChunk(new EndPortletChunk()); + + // return EVAL_PAGE; } } Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/taglib/PortletURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-07 11:10:06 UTC (rev 9831) @@ -0,0 +1,96 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.taglib; + +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; +import org.jboss.portal.portlet.test.jsp.response.portlet.PortletURLChunk; + +import javax.servlet.jsp.JspException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletURLTag extends AbstractURLTag +{ + + /** . */ + private String modeValue; + + /** . */ + private String windowStateValue; + + public String getMode() + { + return modeValue; + } + + public void setMode(String mode) + { + this.modeValue =3D mode; + } + + public String getWindowState() + { + return windowStateValue; + } + + public void setWindowState(String windowState) + { + this.windowStateValue =3D windowState; + } + + public int doStartTag() throws JspException + { + mute(true); + + // + return EVAL_BODY_BUFFERED; + } + + public int doEndTag() throws JspException + { + Mode mode =3D null; + if (modeValue !=3D null) + { + mode =3D Mode.create(modeValue.trim()); + } + + // + WindowState windowState =3D null; + if (windowStateValue !=3D null) + { + windowState =3D WindowState.create(windowStateValue.trim()); + } + + // + addChunk(new PortletURLChunk(mode, windowState, getParams())); + + // + mute(false); + + // + return EVAL_PAGE; + } +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/taglib/SimpleChunkTagSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/SimpleChunkTagSupport.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/SimpleChunkTagSupport.java 2008-02-07 11:10:06 UTC (rev 9831) @@ -0,0 +1,56 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.taglib; + +import org.jboss.portal.portlet.test.jsp.response.Chunk; +import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; + +import javax.servlet.jsp.tagext.SimpleTagSupport; +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.PageContext; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public abstract class SimpleChunkTagSupport extends SimpleTagSupport +{ + + public final void doTag() throws JspException, IOException + { + Chunk chunk =3D doChunkTag(); + + // + if (chunk !=3D null) + { + PageContext pageCtx =3D (PageContext)getJspContext(); + pageCtx.getOut().flush(); + BufferingResponse response =3D (BufferingResponse)pageCtx.getResp= onse(); + response.getBuffer().addChunk(chunk); + } + } + + protected abstract Chunk doChunkTag(); + +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/TitleTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/TitleTag.java 2008-02-07 08:31:51 UTC (rev 9830) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/TitleTag.java 2008-02-07 11:10:06 UTC (rev 9831) @@ -22,25 +22,17 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp.taglib; = -import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; -import org.jboss.portal.portlet.test.jsp.response.portlet.PortletTitleChun= k; +import org.jboss.portal.portlet.test.jsp.response.Chunk; +import org.jboss.portal.portlet.test.jsp.response.portlet.StartPortletTitl= eChunk; = -import javax.servlet.jsp.tagext.SimpleTagSupport; -import javax.servlet.jsp.JspException; -import javax.servlet.jsp.PageContext; -import java.io.IOException; - /** * @author Julien Viet * @version $Revision: 630 $ */ -public class TitleTag extends SimpleTagSupport +public class TitleTag extends SimpleChunkTagSupport { - public void doTag() throws JspException, IOException + protected Chunk doChunkTag() { - PageContext pageCtx =3D (PageContext)getJspContext(); - pageCtx.getOut().flush(); - BufferingResponse response =3D (BufferingResponse)pageCtx.getRespons= e(); - response.addChunk(new PortletTitleChunk()); + return new StartPortletTitleChunk(); } } Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/portal.tld =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.tld 2008-02-07 08:31:51 UTC (rev 9830) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.tld 2008-02-07 11:10:06 UTC (rev 9831) @@ -54,4 +54,32 @@ empty = + + portleturl + org.jboss.portal.portlet.test.jsp.taglib.PortletURLTag + JSP + + mode + java.lang.String + + + windowState + java.lang.String + + + + + param + org.jboss.portal.portlet.test.jsp.taglib.ParamTag + empty + + name + java.lang.String + + + value + java.lang.String + + + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/i= ndex.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-07 08:31:51 UTC (rev 9830) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-07 11:10:06 UTC (rev 9831) @@ -10,6 +10,8 @@ applicationName=3D"google-weather-portlet"> -----------------------------------

    +">Minimized +">Derwood
    -----------------------------------
    -----------------------------------
    --===============8584549153455503592==-- From portal-commits at lists.jboss.org Thu Feb 7 06:12:39 2008 Content-Type: multipart/mixed; boundary="===============0585842471972528220==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9832 - in modules/portlet/trunk/test/src: test/resources/simple-portal-war and 1 other directories. Date: Thu, 07 Feb 2008 06:12:39 -0500 Message-ID: --===============0585842471972528220== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-07 06:12:39 -0500 (Thu, 07 Feb 2008) New Revision: 9832 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletMarkupTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTitleTag.java Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= portal.tld modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.jsp Log: rename jsp tag markup and title to portletmarkup and portlettitle Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/jsp/taglib/PortletMarkupTag.java (from rev 9831, modules/portlet/trunk/= test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/MarkupTag.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletMarkupTag.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletMarkupTag.java 2008-02-07 11:12:39 UTC (rev 9832) @@ -0,0 +1,38 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.taglib; + +import org.jboss.portal.portlet.test.jsp.response.Chunk; +import org.jboss.portal.portlet.test.jsp.response.portlet.PortletMarkupChu= nk; + +/** + * @author
    Julien Viet + * @version $Revision: 630 $ + */ +public class PortletMarkupTag extends SimpleChunkTagSupport +{ + protected Chunk doChunkTag() + { + return new PortletMarkupChunk(); + } +} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/jsp/taglib/PortletTitleTag.java (from rev 9831, modules/portlet/trunk/t= est/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/TitleTag.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTitleTag.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTitleTag.java 2008-02-07 11:12:39 UTC (rev 9832) @@ -0,0 +1,38 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.taglib; + +import org.jboss.portal.portlet.test.jsp.response.Chunk; +import org.jboss.portal.portlet.test.jsp.response.portlet.StartPortletTitl= eChunk; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletTitleTag extends SimpleChunkTagSupport +{ + protected Chunk doChunkTag() + { + return new StartPortletTitleChunk(); + } +} Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/portal.tld =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.tld 2008-02-07 11:10:06 UTC (rev 9831) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.tld 2008-02-07 11:12:39 UTC (rev 9832) @@ -43,14 +43,14 @@ = - markup - org.jboss.portal.portlet.test.jsp.taglib.MarkupTag + portletmarkup + org.jboss.portal.portlet.test.jsp.taglib.PortletMarkupTag= empty = - title - org.jboss.portal.portlet.test.jsp.taglib.TitleTag + portlettitle + org.jboss.portal.portlet.test.jsp.taglib.PortletTitleTag<= /tag-class> empty = Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/i= ndex.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-07 11:10:06 UTC (rev 9831) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-07 11:12:39 UTC (rev 9832) @@ -9,11 +9,11 @@ name=3D"GoogleWeather" applicationName=3D"google-weather-portlet"> -----------------------------------
    -
    +
    ">Minimized ">Derwood
    -----------------------------------
    - + -----------------------------------
    ****************************************************
    @@ -21,9 +21,9 @@ name=3D"GoogleMap" applicationName=3D"google-map-portlet"> -----------------------------------
    -
    +
    -----------------------------------
    - + -----------------------------------
    ****************************************************
    @@ -31,9 +31,9 @@ name=3D"RemoteControl" applicationName=3D"remotecontrol-portlet"> -----------------------------------
    -
    +
    -----------------------------------
    - + -----------------------------------
    ****************************************************
    --===============0585842471972528220==-- From portal-commits at lists.jboss.org Thu Feb 7 07:04:09 2008 Content-Type: multipart/mixed; boundary="===============4315441290443788654==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9833 - in modules/portlet/trunk/test/src: main/java/org/jboss/portal/portlet/test/jsp/response and 3 other directories. Date: Thu, 07 Feb 2008 07:04:09 -0500 Message-ID: --===============4315441290443788654== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-07 07:04:09 -0500 (Thu, 07 Feb 2008) New Revision: 9833 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/EndPageChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/StartPageChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/portlet/StartPortletChunk.java Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/portlet/PortletTitleChunk.java Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/Page.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PagePortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PageTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTag.java modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.jsp Log: add support for maximized window in page Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-07 11:12:39 UTC (rev 9832) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-07 12:04:09 UTC (rev 9833) @@ -25,13 +25,15 @@ import org.jboss.portal.portlet.test.jsp.response.Chunk; import org.jboss.portal.portlet.test.jsp.response.BytesChunk; import org.jboss.portal.portlet.test.jsp.response.CharsChunk; -import org.jboss.portal.portlet.test.jsp.response.portlet.PortletChunk; +import org.jboss.portal.portlet.test.jsp.response.portlet.StartPortletChun= k; import org.jboss.portal.portlet.test.jsp.response.portlet.PortletMarkupChu= nk; import org.jboss.portal.portlet.test.jsp.response.portlet.StartPortletTitl= eChunk; import org.jboss.portal.portlet.test.jsp.response.portlet.PortletURLChunk; import org.jboss.portal.portlet.test.jsp.response.portlet.EndPortletChunk; import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; import org.jboss.portal.portlet.test.jsp.response.ResponseBuffer; +import org.jboss.portal.portlet.test.jsp.response.StartPageChunk; +import org.jboss.portal.portlet.test.jsp.response.EndPageChunk; import org.jboss.portal.portlet.test.controller.PortletURLRenderer; import org.jboss.portal.portlet.PortletInvoker; import org.jboss.portal.portlet.PortletInvokerException; @@ -65,6 +67,10 @@ import java.io.OutputStream; import java.io.OutputStreamWriter; import java.util.Map; +import java.util.Iterator; +import java.util.List; +import java.util.LinkedList; +import java.util.Collections; = /** * @author
    Julien Viet @@ -220,6 +226,68 @@ pageState =3D context.getStateControllerContext().createPageState= (); } = + // Look if we need to handle maxmized rendering + for (Window window : page.getWindows()) + { + WindowNavigationalState windowState =3D pageState.getWindowNaviga= tionalState(window.getId()); + if (windowState !=3D null && WindowState.MAXIMIZED.equals(windowS= tate.getWindowState())) + { + List chunks =3D new LinkedList(); + int mode =3D 0; + int count =3D 0; + for (Iterator i =3D page.getChunks().iterator();i.hasNe= xt();) + { + Chunk chunk =3D i.next(); + + switch (mode) + { + case 0: + if (chunk instanceof StartPageChunk) + { + mode =3D 1; + chunks.add(chunk); + } + break; + case 1: + if (chunk instanceof StartPortletChunk) + { + StartPortletChunk startPortletChunk =3D (StartPort= letChunk)chunk; + String windowId =3D "" + count; + if (window.getId().equals(windowId)) + { + mode =3D 2; + chunks.add(startPortletChunk); + } + } + else if (chunk instanceof EndPageChunk) + { + mode =3D 0; + chunks.add(chunk); + } + break; + case 2: + if (chunk instanceof EndPortletChunk) + { + mode =3D 1; + } + + // + chunks.add(chunk); + break; + } + + // + if (chunk instanceof EndPortletChunk) + { + count++; + } + } + + // New page + page =3D new Page(chunks, Collections.singletonMap(window.getI= d(), window)); + } + } + // Map responses =3D page.render(con= text, pageState); = @@ -230,7 +298,7 @@ // int count =3D 0; String windowId =3D null; - PortletChunk portletChunk =3D null; + StartPortletChunk startPortletChunk =3D null; PortletInvocationResponse portletResponse =3D null; for (Chunk chunk : page.getChunks()) { @@ -246,9 +314,9 @@ writer.write(bytesChunk.getChars()); writer.flush(); } - else if (chunk instanceof PortletChunk) + else if (chunk instanceof StartPortletChunk) { - portletChunk =3D (PortletChunk)chunk; + startPortletChunk =3D (StartPortletChunk)chunk; windowId =3D "" + count++; portletResponse =3D responses.get(windowId); } @@ -316,7 +384,7 @@ { FragmentResponse fragment =3D (FragmentResponse)portletR= esponse; WindowNavigationalState windowNS =3D pageState.getWindow= NavigationalState(windowId); - if (windowNS =3D=3D null || windowNS.getWindowState().eq= uals(WindowState.NORMAL)) + if (windowNS =3D=3D null || !windowNS.getWindowState().e= quals(WindowState.MINIMIZED)) { if (fragment.getType() !=3D FragmentResponse.TYPE_EMP= TY) { @@ -338,20 +406,20 @@ } else { - writer.write(portletResponse.getClass().getSimpleName() = + "[" + portletChunk.getPortletName() + "," + portletChunk.getApplicationNa= me() + "]"); + writer.write(portletResponse.getClass().getSimpleName() = + "[" + startPortletChunk.getPortletName() + "," + startPortletChunk.getApp= licationName() + "]"); writer.flush(); } } else { - writer.write("Empty[" + portletChunk.getPortletName() + ","= + portletChunk.getApplicationName() + "]"); + writer.write("Empty[" + startPortletChunk.getPortletName() = + "," + startPortletChunk.getApplicationName() + "]"); writer.flush(); } } else if (chunk instanceof EndPortletChunk) { windowId =3D null; - portletChunk =3D null; + startPortletChunk =3D null; portletResponse =3D null; } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/Page.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/Page.java 2008-02-07 11:12:39 UTC (rev 9832) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/Page.java 2008-02-07 12:04:09 UTC (rev 9833) @@ -30,6 +30,7 @@ import java.util.Map; import java.util.HashMap; import java.util.List; +import java.util.Collection; = /** * @author Julien Viet @@ -60,6 +61,11 @@ return windows.get(windowId); } = + public Collection getWindows() + { + return windows.values(); + } + public Map render(PortletControllerC= ontext context, PageNavigationalState pageState) { Map responses =3D new HashMap(); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PagePortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-07 11:12:39 UTC (rev 9832) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-07 12:04:09 UTC (rev 9833) @@ -24,7 +24,7 @@ = import org.jboss.portal.portlet.test.controller.AbstractPortletControllerC= ontext; import org.jboss.portal.portlet.test.jsp.response.Chunk; -import org.jboss.portal.portlet.test.jsp.response.portlet.PortletChunk; +import org.jboss.portal.portlet.test.jsp.response.portlet.StartPortletChun= k; import org.jboss.portal.portlet.test.jsp.response.ResponseBuffer; import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletInvokerException; @@ -43,6 +43,7 @@ import java.io.IOException; import java.util.Map; import java.util.HashMap; +import java.util.LinkedHashMap; = /** * @author Julien Viet @@ -72,12 +73,12 @@ = // Collect portlets to create the page int counter =3D 0; - Map windows =3D new HashMap(); + Map windows =3D new LinkedHashMap(); for (Chunk chunk : buffer.getChunks()) { - if (chunk instanceof PortletChunk) + if (chunk instanceof StartPortletChunk) { - PortletChunk portletChunk =3D (PortletChunk)chunk; + StartPortletChunk startPortletChunk =3D (StartPortletChunk)chu= nk; String windowId =3D "" + counter++; = // @@ -90,7 +91,7 @@ String applicationName =3D portletInfo.getApplicationNam= e(); = // - if (applicationName.equals(portletChunk.getApplicationNa= me()) && portletName.equals(portletChunk.getPortletName())) + if (applicationName.equals(startPortletChunk.getApplicat= ionName()) && portletName.equals(startPortletChunk.getPortletName())) { windows.put(windowId, new Window(windowId, portlet)); } @@ -104,6 +105,9 @@ } = // + = + + // this.page =3D new Page(buffer.getChunks(), windows); this.invoker =3D invoker; this.eventControllerContext =3D new EventControllerContextImpl(invok= er); Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/response/EndPageChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/EndPageChunk.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/EndPageChunk.java 2008-02-07 12:04:09 UTC (rev 9833) @@ -0,0 +1,33 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.response; + +import org.jboss.portal.portlet.test.jsp.response.Chunk; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class EndPageChunk extends Chunk +{ +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/response/StartPageChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/StartPageChunk.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/StartPageChunk.java 2008-02-07 12:04:09 UTC (rev 9833) @@ -0,0 +1,33 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.response; + +import org.jboss.portal.portlet.test.jsp.response.Chunk; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class StartPageChunk extends Chunk +{ +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/response/portlet/PortletTitleChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/PortletTitleChunk.java 2008-02-07 11:12:39 UTC (rev 98= 32) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/PortletTitleChunk.java 2008-02-07 12:04:09 UTC (rev 98= 33) @@ -1,33 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp.response.portlet; - -import org.jboss.portal.portlet.test.jsp.response.Chunk; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class PortletTitleChunk extends Chunk -{ -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/jsp/response/portlet/StartPortletChunk.java (from rev 9821, modules/por= tlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response/po= rtlet/PortletChunk.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/StartPortletChunk.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/StartPortletChunk.java 2008-02-07 12:04:09 UTC (rev 98= 33) @@ -0,0 +1,86 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.response.portlet; + +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; +import org.jboss.portal.portlet.test.jsp.response.Chunk; + +import java.util.Set; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class StartPortletChunk extends Chunk +{ + + /** . */ + private final String portletName; + + /** . */ + private final String applicationName; + + /** . */ + private final Mode initialMode; + + /** . */ + private final Set supportedModes; + + /** . */ + private final Set supportedWindowStates; + + public StartPortletChunk(String portletName, String applicationName, Mo= de initialMode, Set supportedModes, Set supportedWindowS= tates) + { + this.portletName =3D portletName; + this.applicationName =3D applicationName; + this.initialMode =3D initialMode; + this.supportedModes =3D supportedModes; + this.supportedWindowStates =3D supportedWindowStates; + } + + public String getPortletName() + { + return portletName; + } + + public String getApplicationName() + { + return applicationName; + } + + public Mode getInitialMode() + { + return initialMode; + } + + public Set getSupportedModes() + { + return supportedModes; + } + + public Set getSupportedWindowStates() + { + return supportedWindowStates; + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PageTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageTag.java 2008-02-07 11:12:39 UTC (rev 9832) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageTag.java 2008-02-07 12:04:09 UTC (rev 9833) @@ -22,23 +22,31 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp.taglib; = -import javax.servlet.jsp.tagext.BodyTagSupport; +import org.jboss.portal.portlet.test.jsp.response.StartPageChunk; +import org.jboss.portal.portlet.test.jsp.response.EndPageChunk; + import javax.servlet.jsp.JspException; = /** * @author Julien Viet * @version $Revision: 630 $ */ -public class PageTag extends BodyTagSupport +public class PageTag extends BodyChunkTagSupport { = public int doStartTag() throws JspException { + addChunk(new StartPageChunk()); + + // return EVAL_BODY_INCLUDE; } = public int doEndTag() throws JspException { + addChunk(new EndPageChunk()); + + // return EVAL_PAGE; } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-07 11:12:39 UTC (rev 9832) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-07 12:04:09 UTC (rev 9833) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp.taglib; = -import org.jboss.portal.portlet.test.jsp.response.portlet.PortletChunk; +import org.jboss.portal.portlet.test.jsp.response.portlet.StartPortletChun= k; import org.jboss.portal.portlet.test.jsp.response.portlet.EndPortletChunk; import org.jboss.portal.Mode; import org.jboss.portal.WindowState; @@ -161,7 +161,7 @@ } = // - addChunk(new PortletChunk( + addChunk(new StartPortletChunk( name, applicationName, initialMode, Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/i= ndex.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-07 11:12:39 UTC (rev 9832) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-07 12:04:09 UTC (rev 9833) @@ -10,6 +10,8 @@ applicationName=3D"google-weather-portlet"> -----------------------------------

    +">Maximized +">Normal
    ">Minimized ">Derwood
    -----------------------------------
    --===============4315441290443788654==-- From portal-commits at lists.jboss.org Thu Feb 7 07:22:13 2008 Content-Type: multipart/mixed; boundary="===============1291083359689664316==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9834 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp. Date: Thu, 07 Feb 2008 07:22:13 -0500 Message-ID: --===============1291083359689664316== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-07 07:22:13 -0500 (Thu, 07 Feb 2008) New Revision: 9834 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/Page.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PagePortletControllerContext.java Log: fix bug in maximize Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-07 12:04:09 UTC (rev 9833) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-07 12:22:13 UTC (rev 9834) @@ -235,6 +235,7 @@ List chunks =3D new LinkedList(); int mode =3D 0; int count =3D 0; + Map windows =3D Collections.emptyMa= p(); for (Iterator i =3D page.getChunks().iterator();i.hasNe= xt();) { Chunk chunk =3D i.next(); @@ -257,6 +258,7 @@ { mode =3D 2; chunks.add(startPortletChunk); + windows =3D Collections.singletonMap(startPortl= etChunk, window); } } else if (chunk instanceof EndPageChunk) @@ -284,7 +286,7 @@ } = // New page - page =3D new Page(chunks, Collections.singletonMap(window.getI= d(), window)); + page =3D new Page(chunks, windows); } } = @@ -296,7 +298,6 @@ OutputStreamWriter writer =3D new OutputStreamWriter(out); = // - int count =3D 0; String windowId =3D null; StartPortletChunk startPortletChunk =3D null; PortletInvocationResponse portletResponse =3D null; @@ -317,7 +318,8 @@ else if (chunk instanceof StartPortletChunk) { startPortletChunk =3D (StartPortletChunk)chunk; - windowId =3D "" + count++; + Window window =3D page.getWindow(startPortletChunk); + windowId =3D window.getId(); portletResponse =3D responses.get(windowId); } else if (chunk instanceof StartPortletTitleChunk) Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/Page.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/Page.java 2008-02-07 12:04:09 UTC (rev 9833) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/Page.java 2008-02-07 12:22:13 UTC (rev 9834) @@ -26,11 +26,12 @@ import org.jboss.portal.portlet.controller.PortletControllerContext; import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.test.jsp.response.Chunk; +import org.jboss.portal.portlet.test.jsp.response.portlet.StartPortletChun= k; = import java.util.Map; import java.util.HashMap; +import java.util.Collection; import java.util.List; -import java.util.Collection; = /** * @author
    Julien Viet @@ -40,25 +41,37 @@ { = /** . */ - private Map windows; + private List chunks; = /** . */ - private List chunks; + private Map windows; = - public Page(List chunks, Map windows) + public Page(List chunks, Map windows) { this.chunks =3D chunks; this.windows =3D windows; } = - public List getChunks() + public Collection getChunks() { return chunks; } = + public Window getWindow(Chunk chunk) + { + return windows.get(chunk); + } + public Window getWindow(String windowId) { - return windows.get(windowId); + for (Window window : windows.values()) + { + if (window.getId().equals(windowId)) + { + return window; + } + } + return null; } = public Collection getWindows() Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PagePortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-07 12:04:09 UTC (rev 9833) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-07 12:22:13 UTC (rev 9834) @@ -73,7 +73,7 @@ = // Collect portlets to create the page int counter =3D 0; - Map windows =3D new LinkedHashMap(); + Map windows =3D new LinkedHashMap(); for (Chunk chunk : buffer.getChunks()) { if (chunk instanceof StartPortletChunk) @@ -93,7 +93,7 @@ // if (applicationName.equals(startPortletChunk.getApplicat= ionName()) && portletName.equals(startPortletChunk.getPortletName())) { - windows.put(windowId, new Window(windowId, portlet)); + windows.put(startPortletChunk, new Window(windowId, p= ortlet)); } } } @@ -105,8 +105,8 @@ } = // - = = + // this.page =3D new Page(buffer.getChunks(), windows); this.invoker =3D invoker; --===============1291083359689664316==-- From portal-commits at lists.jboss.org Thu Feb 7 11:47:40 2008 Content-Type: multipart/mixed; boundary="===============0073125092653401667==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9835 - in modules/portlet/trunk: portlet/src/test/java/org/jboss/portal/test/portlet and 10 other directories. Date: Thu, 07 Feb 2008 11:47:40 -0500 Message-ID: --===============0073125092653401667== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-07 11:47:40 -0500 (Thu, 07 Feb 2008) New Revision: 9835 Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/StateStringTestCase.java modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/contro= ller/ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/contro= ller/StateControllerContextTestCase.java Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/portlet/PortletChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/MarkupTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/TitleTag.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/Opa= queStateString.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/Par= ametersStateString.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/Sta= teString.java modules/portlet/trunk/portlet/src/test/resources/local-jboss-unit.xml modules/portlet/trunk/test/pom.xml modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/state/PageNavigationalStateImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/state/StateControllerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/state/PageNavigationalState.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/AbstractPortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletURLRenderer.java modules/portlet/trunk/test/src/test/resources/test/local-jboss-unit.xml Log: - rewrote PageNavigationalState marshalling to be optimized in size - added test cases for PageNavigationalState marshalling Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/OpaqueStateString.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/Op= aqueStateString.java 2008-02-07 12:22:13 UTC (rev 9834) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/Op= aqueStateString.java 2008-02-07 16:47:40 UTC (rev 9835) @@ -22,6 +22,9 @@ *************************************************************************= *****/ package org.jboss.portal.portlet; = +import java.io.DataOutputStream; +import java.io.IOException; + /** * An opaque implementation of the navigational state. * @@ -31,6 +34,7 @@ public class OpaqueStateString extends StateString { = + /** . */ private String value; = public OpaqueStateString(String value) @@ -47,6 +51,12 @@ return value; } = + public void writeTo(DataOutputStream out) throws IOException + { + out.writeByte(2); + out.writeUTF(value); + } + public int hashCode() { return value.hashCode(); Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/ParametersStateString.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/Pa= rametersStateString.java 2008-02-07 12:22:13 UTC (rev 9834) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/Pa= rametersStateString.java 2008-02-07 16:47:40 UTC (rev 9835) @@ -31,6 +31,9 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; +import java.io.DataOutputStream; +import java.io.InputStream; +import java.io.DataInputStream; import java.util.HashMap; import java.util.Map; = @@ -63,6 +66,36 @@ } = /** + * Factory method that will create the most appropriate form from the b= yte representation. + * + * @param in the inputstream to read from + * @return a new state string + * @throws IOException any IOException + */ + public static StateString create(DataInputStream in) throws IOException + { + if (in =3D=3D null) + { + throw new IllegalArgumentException(); + } + + // + byte b =3D in.readByte(); + switch (b) + { + case 0: + return new ParametersStateString(); + case 1: + return new ParametersStateString(in); + case 2: + return new OpaqueStateString(in.readUTF()); + } + + // + throw new IllegalArgumentException("Wrong format unrecognized header= " + b); + } + + /** * Factory method that will create the most appropriate form from the s= tring representation. * * @param opaqueValue the opaque value @@ -116,16 +149,34 @@ /** The underlying map that does not have a copy read/write access mode= . */ private ParameterMap parameters; = - private ParametersStateString(String opaqueValue) + private ParametersStateString(DataInputStream in) throws IOException { - if (opaqueValue =3D=3D null) + int size =3D in.readInt(); + Map tmp =3D new HashMap(size); + while (size-- > 0) { - throw new IllegalArgumentException("No navigational state provide= d"); + String name =3D in.readUTF(); + int length =3D in.readInt(); + String[] values =3D new String[length]; + for (int i =3D 0;i < length;i++) + { + values[i] =3D in.readUTF(); + } + tmp.put(name, values); } + + // + parameters =3D ParameterMap.wrap(tmp); + } + + private ParametersStateString(String opaqueValue) + { if (!opaqueValue.startsWith(JBPNS_PREFIX)) { throw new IllegalArgumentException("Bad format"); } + + // opaqueValue =3D opaqueValue.substring(JBPNS_PREFIX.length()); if (opaqueValue.length() > 0) { @@ -166,7 +217,7 @@ } catch (Exception e) { - throw new RuntimeException(e); + throw new Error(e); } } else @@ -329,6 +380,31 @@ } } = + public void writeTo(DataOutputStream out) throws IOException + { + if (parameters.isEmpty()) + { + out.writeByte(0); + } + else + { + out.writeByte(1); + out.writeInt(parameters.size()); + for (Map.Entry entry : parameters.entrySet()) + { + String name =3D (String)entry.getKey(); + out.writeUTF(name); + String[] values =3D (String[])entry.getValue(); + int length =3D values.length; + out.writeInt(length); + for (String value : values) + { + out.writeUTF(value); + } + } + } + } + public String toString() { return "StateString[" + parameters + "]"; Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/StateString.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/St= ateString.java 2008-02-07 12:22:13 UTC (rev 9834) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/St= ateString.java 2008-02-07 16:47:40 UTC (rev 9835) @@ -23,6 +23,10 @@ package org.jboss.portal.portlet; = import java.io.Serializable; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.ByteArrayOutputStream; +import java.util.zip.GZIPOutputStream; = /** * Encapsulate state as a string. @@ -39,13 +43,6 @@ */ public abstract String getStringValue(); = - public static StateString createFrom(String opaqueValue) - { - if (opaqueValue =3D=3D null) - { - return null; - } - return new OpaqueStateString(opaqueValue); - } + public abstract void writeTo(DataOutputStream out) throws IOException; = } Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/StateStringTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/StateStringTestCase.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/StateStringTestCase.java 2008-02-07 16:47:40 UTC (rev 9835) @@ -0,0 +1,74 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.test.portlet; + +import org.jboss.unit.api.pojo.annotations.Test; +import org.jboss.portal.portlet.ParametersStateString; +import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.OpaqueStateString; +import org.jboss.portal.common.util.MapBuilder; +import static org.jboss.unit.api.Assert.*; + +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.ByteArrayInputStream; +import java.io.DataInputStream; +import java.util.zip.GZIPOutputStream; +import java.util.Map; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)Test +public class StateStringTestCase +{ + + @Test + public void testMarshalling() throws IOException + { + check(new OpaqueStateString("blah")); + check(ParametersStateString.create()); + check(MapBuilder.hashMap("foo", new String[]{"bar"}).get()); + check(MapBuilder.hashMap("foo", new String[]{"foo_1"}).put("bar", ne= w String[]{"bar_1", "bar_2"}).get()); + } + + private void check(Map parameters) throws IOException + { + check(ParametersStateString.create(parameters)); + } + + private void check(StateString parameters) throws IOException + { + ByteArrayOutputStream baos =3D new ByteArrayOutputStream(); + DataOutputStream out =3D new DataOutputStream(baos); + parameters.writeTo(out); + out.close(); + byte[] bytes =3D baos.toByteArray(); + ByteArrayInputStream bais =3D new ByteArrayInputStream(bytes); + DataInputStream in =3D new DataInputStream(bais); + StateString copy =3D ParametersStateString.create(in); + assertEquals(parameters, copy); + } +} Modified: modules/portlet/trunk/portlet/src/test/resources/local-jboss-unit= .xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/resources/local-jboss-unit.xml 2= 008-02-07 12:22:13 UTC (rev 9834) +++ modules/portlet/trunk/portlet/src/test/resources/local-jboss-unit.xml 2= 008-02-07 16:47:40 UTC (rev 9835) @@ -34,5 +34,8 @@ + + + Modified: modules/portlet/trunk/test/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/pom.xml 2008-02-07 12:22:13 UTC (rev 9834) +++ modules/portlet/trunk/test/pom.xml 2008-02-07 16:47:40 UTC (rev 9835) @@ -206,6 +206,11 @@ + + + + + test/local-jboss-unit.xml Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/impl/state/PageNavigationalStateImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/PageNavigationalStateImpl.java 2008-02-07 12:22:13 UTC (re= v 9834) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/PageNavigationalStateImpl.java 2008-02-07 16:47:40 UTC (re= v 9835) @@ -33,6 +33,7 @@ import java.io.Serializable; import java.util.HashMap; import java.util.Map; +import java.util.Set; = /** * @author Julien Viet @@ -42,7 +43,7 @@ { = /** We don't save it. */ - protected transient StateControllerContextImpl context; + protected final StateControllerContextImpl context; = /** . */ protected final Map windows; @@ -64,6 +65,11 @@ this.page =3D new HashMap(original.page); } = + public Set getWindowIds() + { + return windows.keySet(); + } + public WindowNavigationalState getWindowNavigationalState(String window= Id) { return windows.get(windowId); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/impl/state/StateControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/StateControllerContextImpl.java 2008-02-07 12:22:13 UTC (r= ev 9834) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/StateControllerContextImpl.java 2008-02-07 16:47:40 UTC (r= ev 9835) @@ -25,14 +25,22 @@ import org.jboss.portal.portlet.controller.PortletControllerContext; import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.StateControllerContext; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; +import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.ParametersStateString; +import org.jboss.portal.WindowState; +import org.jboss.portal.Mode; +import org.jboss.portal.common.io.UndeclaredIOException; = import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; +import java.io.DataOutputStream; +import java.io.DataInputStream; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; +import java.util.Map; +import java.util.HashMap; = /** * @author Julien Viet @@ -42,10 +50,44 @@ { = /** . */ + private static final Map windowStateToCode =3D ne= w HashMap(); + + /** . */ + private static final Map modeToCode =3D new HashMap(); + + /** . */ + private static final Map codeToWindowState =3D ne= w HashMap(); + + /** . */ + private static final Map codeToMode =3D new HashMap(); + + static + { + windowStateToCode.put(WindowState.NORMAL, 1); + windowStateToCode.put(WindowState.MINIMIZED, 2); + windowStateToCode.put(WindowState.MAXIMIZED, 3); + codeToWindowState.put(1, WindowState.NORMAL); + codeToWindowState.put(2, WindowState.MINIMIZED); + codeToWindowState.put(3, WindowState.MAXIMIZED); + modeToCode.put(Mode.VIEW, 1); + modeToCode.put(Mode.EDIT, 2); + modeToCode.put(Mode.HELP, 3); + codeToMode.put(1, Mode.VIEW); + codeToMode.put(2, Mode.EDIT); + codeToMode.put(3, Mode.HELP); + } + + /** . */ protected final PortletControllerContext portletControllerContext; = public StateControllerContextImpl(PortletControllerContext portletContr= ollerContext) { + if (portletControllerContext =3D=3D null) + { + throw new IllegalArgumentException("No portlet controller context= available"); + } + + // this.portletControllerContext =3D portletControllerContext; } = @@ -59,23 +101,127 @@ return new MutablePageNavigationalState(this); } = - public byte[] serialize(PageNavigationalState object) throws IOException + public byte[] serialize(PageNavigationalState object) = { - ByteArrayOutputStream baos =3D new ByteArrayOutputStream(); - GZIPOutputStream zos =3D new GZIPOutputStream(baos); - ObjectOutputStream oos =3D new ObjectOutputStream(zos); - oos.writeObject(object); - oos.close(); - return baos.toByteArray(); + try + { + PageNavigationalStateImpl pageState =3D (PageNavigationalStateImp= l)object; + ByteArrayOutputStream baos =3D new ByteArrayOutputStream(); + GZIPOutputStream zos =3D new GZIPOutputStream(baos); + DataOutputStream out =3D new DataOutputStream(zos); + out.writeInt(pageState.windows.size()); + for (Map.Entry entry : pageState= .windows.entrySet()) + { + out.writeUTF(entry.getKey()); + WindowNavigationalState windowNS =3D entry.getValue(); + byte header =3D 0; + int decision =3D 0; + if (windowNS.getPortletNavigationalState() !=3D null) + { + header |=3D 1; + decision |=3D 1; + } + if (windowNS.getWindowState() !=3D null) + { + Integer value =3D windowStateToCode.get(windowNS.getWindowS= tate()); + if (value !=3D null) + { + header |=3D value << 1; + } + else + { + header |=3D 4 << 1; + decision |=3D 2; + } + } + if (windowNS.getMode() !=3D null) + { + Integer value =3D modeToCode.get(windowNS.getMode()); + if (value !=3D null) + { + header |=3D value << 4; + } + else + { + header |=3D 4 << 4; + decision |=3D 4; + } + } + out.writeByte(header); + if ((decision & 1) !=3D 0) + { + windowNS.getPortletNavigationalState().writeTo(out); + } + if ((decision & 2) !=3D 0) + { + out.writeUTF(windowNS.getWindowState().toString()); + } + if ((decision & 4) !=3D 0) + { + out.writeUTF(windowNS.getMode().toString()); + } + } + out.close(); + return baos.toByteArray(); + } + catch (IOException e) + { + throw new UndeclaredIOException(e); + } } = - public PageNavigationalState unserialize(byte[] bytes) throws IOExcepti= on, ClassNotFoundException + public PageNavigationalState unserialize(byte[] bytes) { - ByteArrayInputStream bais =3D new ByteArrayInputStream(bytes); - GZIPInputStream zis =3D new GZIPInputStream(bais); - ObjectInputStream ois =3D new ObjectInputStream(zis); - PageNavigationalStateImpl state =3D (PageNavigationalStateImpl)ois.r= eadObject(); - state.context =3D this; - return state; + try + { + ByteArrayInputStream bais =3D new ByteArrayInputStream(bytes); + GZIPInputStream zis =3D new GZIPInputStream(bais); + DataInputStream in =3D new DataInputStream(zis); + PageNavigationalStateImpl pageState =3D new MutablePageNavigation= alState(this); + int size =3D in.readInt(); + while (size-- > 0) + { + String windowId =3D in.readUTF(); + byte header =3D in.readByte(); + StateString portletNS =3D null; + if ((header & 1) !=3D 0) + { + portletNS =3D ParametersStateString.create(in); + } + WindowState windowState =3D null; + int windowStateHeader =3D (header & (7 << 1)) >> 1; + switch (windowStateHeader) + { + case 0: + break; + case 4: + windowState =3D WindowState.create(in.readUTF()); + break; + default: + windowState =3D codeToWindowState.get(windowStateHeader); + } + Mode mode =3D null; + int modeStateHeader =3D (header & (7 << (1 + 3))) >> (1 + 3); + switch (modeStateHeader) + { + case 0: + break; + case 4: + mode =3D Mode.create(in.readUTF()); + break; + default: + mode =3D codeToMode.get(modeStateHeader); + } + WindowNavigationalState windowNS =3D new WindowNavigationalSta= te(portletNS, mode, windowState); + pageState.setWindowNavigationalState(windowId, windowNS); + } + + // + return pageState; + } + catch (IOException e) + { + throw new UndeclaredIOException(e); + } } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/state/PageNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/PageNavigationalState.java 2008-02-07 12:22:13 UTC (rev 9834) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/PageNavigationalState.java 2008-02-07 16:47:40 UTC (rev 9835) @@ -26,6 +26,7 @@ = import javax.xml.namespace.QName; import java.util.Map; +import java.util.Set; = /** * Defines the page navigational state that the controller needs. @@ -36,6 +37,8 @@ public interface PageNavigationalState { = + Set getWindowIds(); + /** * Returns the navigational state of a window or null if it does not ex= ist. * Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/AbstractPortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-07 12:22:13 UTC (r= ev 9834) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-07 16:47:40 UTC (r= ev 9835) @@ -30,6 +30,7 @@ import org.jboss.portal.common.util.MediaType; import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.common.util.Tools; +import org.jboss.portal.common.util.Base64; import org.jboss.portal.portlet.ParametersStateString; import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletInvokerException; @@ -131,7 +132,7 @@ String context =3D req.getParameter(PAGE_STATE); if (context !=3D null) { - byte[] bytes =3D Tools.fromHexString(context); + byte[] bytes =3D Base64.decode(context, true); pageState =3D tmp.unserialize(bytes); } = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletURLRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-07 12:22:13 UTC (rev 9834) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-07 16:47:40 UTC (rev 9835) @@ -27,6 +27,7 @@ import org.jboss.portal.common.text.CharBuffer; import org.jboss.portal.common.text.FastURLEncoder; import org.jboss.portal.common.util.Tools; +import org.jboss.portal.common.util.Base64; import org.jboss.portal.portlet.ActionURL; import org.jboss.portal.portlet.ContainerURL; import org.jboss.portal.portlet.PortletURL; @@ -126,18 +127,11 @@ = // String pageState =3D null; - try + if (pageNS !=3D null) { - if (pageNS !=3D null) - { - byte[] bytes =3D stateContext.serialize(pageNS); - pageState =3D Tools.toHexString(bytes); - } + byte[] bytes =3D stateContext.serialize(pageNS); + pageState =3D Base64.encodeBytes(bytes, true); } - catch (IOException e) - { - throw new Error(e); // - } = // if (containerURL instanceof PortletURL) Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/response/portlet/PortletChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/PortletChunk.java 2008-02-07 12:22:13 UTC (rev 9834) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/PortletChunk.java 2008-02-07 16:47:40 UTC (rev 9835) @@ -1,86 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp.response.portlet; - -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; -import org.jboss.portal.portlet.test.jsp.response.Chunk; - -import java.util.Set; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class PortletChunk extends Chunk -{ - - /** . */ - private final String portletName; - - /** . */ - private final String applicationName; - - /** . */ - private final Mode initialMode; - - /** . */ - private final Set supportedModes; - - /** . */ - private final Set supportedWindowStates; - - public PortletChunk(String portletName, String applicationName, Mode in= itialMode, Set supportedModes, Set supportedWindowStates) - { - this.portletName =3D portletName; - this.applicationName =3D applicationName; - this.initialMode =3D initialMode; - this.supportedModes =3D supportedModes; - this.supportedWindowStates =3D supportedWindowStates; - } - - public String getPortletName() - { - return portletName; - } - - public String getApplicationName() - { - return applicationName; - } - - public Mode getInitialMode() - { - return initialMode; - } - - public Set getSupportedModes() - { - return supportedModes; - } - - public Set getSupportedWindowStates() - { - return supportedWindowStates; - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/taglib/MarkupTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/MarkupTag.java 2008-02-07 12:22:13 UTC (rev 9834) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/MarkupTag.java 2008-02-07 16:47:40 UTC (rev 9835) @@ -1,38 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp.taglib; - -import org.jboss.portal.portlet.test.jsp.response.Chunk; -import org.jboss.portal.portlet.test.jsp.response.portlet.PortletMarkupChu= nk; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class MarkupTag extends SimpleChunkTagSupport -{ - protected Chunk doChunkTag() - { - return new PortletMarkupChunk(); - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/taglib/TitleTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/TitleTag.java 2008-02-07 12:22:13 UTC (rev 9834) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/TitleTag.java 2008-02-07 16:47:40 UTC (rev 9835) @@ -1,38 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp.taglib; - -import org.jboss.portal.portlet.test.jsp.response.Chunk; -import org.jboss.portal.portlet.test.jsp.response.portlet.StartPortletTitl= eChunk; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class TitleTag extends SimpleChunkTagSupport -{ - protected Chunk doChunkTag() - { - return new StartPortletTitleChunk(); - } -} Added: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/co= ntroller/StateControllerContextTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/contr= oller/StateControllerContextTestCase.java (rev 0) +++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/contr= oller/StateControllerContextTestCase.java 2008-02-07 16:47:40 UTC (rev 9835) @@ -0,0 +1,165 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.controller; + +import org.jboss.unit.api.pojo.annotations.Test; +import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.StateControllerContext; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; +import org.jboss.portal.portlet.controller.event.EventControllerContext; +import org.jboss.portal.portlet.info.PortletInfo; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.ParametersStateString; +import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.ActionInvocation; +import org.jboss.portal.portlet.invocation.EventInvocation; +import org.jboss.portal.portlet.invocation.ResourceInvocation; +import org.jboss.portal.portlet.spi.PortletInvocationContext; +import org.jboss.portal.common.NotYetImplemented; +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; +import static org.jboss.unit.api.Assert.*; + +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.Cookie; +import java.util.List; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)Test +public class StateControllerContextTestCase +{ + + /** . */ + private StateControllerContextImpl cc =3D new StateControllerContextImp= l(dummyContext); + + @Test + public void testMarshalling1() + { + PageNavigationalState pageNS =3D cc.createPageState(); + assertMarshallable(pageNS); + } + + @Test + public void testMarshalling2() + { + ParametersStateString params =3D ParametersStateString.create(); + params.setValue("foo", "bar"); + test(null, null, null); + test(null, Mode.VIEW, null); + test(null, null, WindowState.NORMAL); + test(null, Mode.VIEW, WindowState.NORMAL); + test(null, Mode.create("foo"), null); + test(null, null, WindowState.create("bar")); + test(null, Mode.create("foo"), WindowState.create("bar")); + test(params, null, null); + test(params, Mode.VIEW, null); + test(params, null, WindowState.NORMAL); + test(params, Mode.VIEW, WindowState.NORMAL); + test(params, Mode.create("foo"), null); + test(params, null, WindowState.create("bar")); + test(params, Mode.create("foo"), WindowState.create("bar")); + } + + private void test(StateString portletNavigationalState, Mode mode, Wind= owState windowState) + { + PageNavigationalState pageNS =3D cc.createPageState(); + pageNS.setWindowNavigationalState("foo", new WindowNavigationalState= (portletNavigationalState, mode, windowState)); + assertMarshallable(pageNS); + } + + private void assertMarshallable(PageNavigationalState pageNS) + { + byte[] bytes =3D cc.serialize(pageNS); + PageNavigationalState expectedPageNS =3D cc.unserialize(bytes); + assertEquals(expectedPageNS.getWindowIds(), pageNS.getWindowIds()); + for (String windowId : expectedPageNS.getWindowIds()) + { + WindowNavigationalState windowNS =3D expectedPageNS.getWindowNavi= gationalState(windowId); + WindowNavigationalState expectedWindowNS =3D pageNS.getWindowNavi= gationalState(windowId); + assertEquals(windowNS.getPortletNavigationalState(), expectedWind= owNS.getPortletNavigationalState()); + assertEquals(windowNS.getMode(), expectedWindowNS.getMode()); + assertEquals(windowNS.getWindowState(), expectedWindowNS.getWindo= wState()); + } + } + + private static final PortletControllerContext dummyContext =3D new Port= letControllerContext() + { + public ServletContext getServletContext() + { + throw new NotYetImplemented(); + } + + public HttpServletRequest getClientRequest() + { + throw new NotYetImplemented(); + } + + public HttpServletResponse getClientResponse() + { + throw new NotYetImplemented(); + } + + public PortletInfo getPortletInfo(String windowId) throws PortletInv= okerException + { + throw new NotYetImplemented(); + } + + public PortletInvocationContext createPortletInvocationContext(Strin= g windowId, PageNavigationalState pageState) + { + throw new NotYetImplemented(); + } + + public PortletInvocationResponse invoke(String windowId, ActionInvoc= ation actionInvocation) throws PortletInvokerException + { + throw new NotYetImplemented(); + } + + public PortletInvocationResponse invoke(String windowId, List requestCookies, EventInvocation eventInvocation) throws PortletInvokerExc= eption + { + throw new NotYetImplemented(); + } + + public PortletInvocationResponse invoke(String windowId, ResourceInv= ocation resourceInvocation) throws PortletInvokerException + { + throw new NotYetImplemented(); + } + + public EventControllerContext getEventControllerContext() + { + throw new NotYetImplemented(); + } + + public StateControllerContext getStateControllerContext() + { + throw new NotYetImplemented(); + } + }; + +} Modified: modules/portlet/trunk/test/src/test/resources/test/local-jboss-un= it.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/test/local-jboss-unit.xml= 2008-02-07 12:22:13 UTC (rev 9834) +++ modules/portlet/trunk/test/src/test/resources/test/local-jboss-unit.xml= 2008-02-07 16:47:40 UTC (rev 9835) @@ -83,5 +83,9 @@ factory + + + + --===============0073125092653401667==-- From portal-commits at lists.jboss.org Thu Feb 7 12:37:57 2008 Content-Type: multipart/mixed; boundary="===============8055955971280400607==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9836 - in modules/common/trunk/common/src: test/java/org/jboss/portal/test/common/io and 1 other directory. Date: Thu, 07 Feb 2008 12:37:56 -0500 Message-ID: --===============8055955971280400607== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-07 12:37:56 -0500 (Thu, 07 Feb 2008) New Revision: 9836 Added: modules/common/trunk/common/src/main/java/org/jboss/portal/common/io/Ser= ialization.java modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/i= o/SerializationTestCase.java Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common/io/IOT= ools.java Log: added concept of Serialization for known types (such as the recurrent Map) with a compact format Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common= /io/IOTools.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/src/main/java/org/jboss/portal/common/io/IO= Tools.java 2008-02-07 16:47:40 UTC (rev 9835) +++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/io/IO= Tools.java 2008-02-07 17:37:56 UTC (rev 9836) @@ -40,6 +40,8 @@ import java.io.ObjectInputStream; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; +import java.io.DataOutputStream; +import java.util.Map; = /** * IO tools. @@ -384,6 +386,49 @@ return (Serializable)ois.readObject(); } = + public static byte[] serialize(Serialization serialization, T t) + { + if (serialization =3D=3D null) + { + throw new IllegalArgumentException(); + } + if (t =3D=3D null) + { + throw new IllegalArgumentException("No null object to serialize"); + } + try + { + ByteArrayOutputStream baos =3D new ByteArrayOutputStream(); + serialization.serialize(t, baos); + return baos.toByteArray(); + } + catch (IOException e) + { + throw new UndeclaredIOException(e); + } + } + + public static T unserialize(Serialization serialization, byte[] = bytes) + { + if (serialization =3D=3D null) + { + throw new IllegalArgumentException(); + } + if (bytes =3D=3D null) + { + throw new IllegalArgumentException("No null bytes to unserialize"= ); + } + try + { + ByteArrayInputStream bais =3D new ByteArrayInputStream(bytes); + return serialization.unserialize(bais); + } + catch (IOException e) + { + throw new UndeclaredIOException(e); + } + } + /** * Check that the provided input stream is buffered. If the argument is= already an instance of BufferedInputStream * no operation will be performed, otherwise a instance of Buffer= edInputStream will be created and returned. Added: modules/common/trunk/common/src/main/java/org/jboss/portal/common/io= /Serialization.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/src/main/java/org/jboss/portal/common/io/Se= rialization.java (rev 0) +++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/io/Se= rialization.java 2008-02-07 17:37:56 UTC (rev 9836) @@ -0,0 +1,121 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.common.io; + +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.DataInputStream; +import java.io.OutputStream; +import java.io.InputStream; +import java.util.Map; +import java.util.HashMap; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public interface Serialization +{ + + Serialization> PARAMETER_MAP =3D new Serializatio= n>() + { + public void serialize(Map map, OutputStream out) t= hrows IOException, IllegalArgumentException + { + if (map =3D=3D null) + { + throw new IllegalArgumentException("No null map allowed"); + } + + // + DataOutputStream data =3D out instanceof DataOutputStream ? (Data= OutputStream)out : new DataOutputStream(out); + + // + data.writeInt(map.size()); + + // + for (Map.Entry entry : map.entrySet()) + { + String name =3D (String)entry.getKey(); + data.writeUTF(name); + + // + String[] values =3D (String[])entry.getValue(); + if (values =3D=3D null) + { + throw new IllegalArgumentException("No null values are allo= wed in the map"); + } + + // + int length =3D values.length; + data.writeInt(length); + + // + for (String value : values) + { + if (value =3D=3D null) + { + throw new IllegalArgumentException("No null value in the= String[] are allowed in the map"); + } + data.writeUTF(value); + } + } + + // + data.flush(); + } + + public Map unserialize(InputStream in) throws IOEx= ception + { + if (in =3D=3D null) + { + throw new IllegalArgumentException("No null input stream"); + } + + // + DataInputStream data =3D in instanceof DataInputStream ? (DataInp= utStream)in : new DataInputStream(in); + + // + int size =3D data.readInt(); + Map tmp =3D new HashMap(size); + while (size-- > 0) + { + String name =3D data.readUTF(); + int length =3D data.readInt(); + String[] values =3D new String[length]; + for (int i =3D 0;i < length;i++) + { + values[i] =3D data.readUTF(); + } + tmp.put(name, values); + } + + // + return tmp; + } + }; + + public abstract void serialize(T t, OutputStream out) throws IOExceptio= n, IllegalArgumentException; + + public abstract T unserialize(InputStream in) throws IOException, Illeg= alArgumentException; + +} Added: modules/common/trunk/common/src/test/java/org/jboss/portal/test/comm= on/io/SerializationTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/= io/SerializationTestCase.java (rev 0) +++ modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/= io/SerializationTestCase.java 2008-02-07 17:37:56 UTC (rev 9836) @@ -0,0 +1,62 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.test.common.io; + +import org.jboss.portal.common.io.Serialization; +import org.jboss.portal.common.io.IOTools; +import org.jboss.portal.common.junit.ExtendedAssert; +import org.jboss.portal.common.util.MapBuilder; + +import java.util.Map; +import java.util.HashMap; + +import junit.framework.TestCase; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class SerializationTestCase extends TestCase +{ + + public void testParameterMapSerialization() + { + check(new HashMap()); + check(MapBuilder.hashMap("foo", new String[]{"foo_value"}).get()); + check(MapBuilder.hashMap("foo", new String[]{"foo_value1","foo_value= 2"}).get()); + check(MapBuilder.hashMap("foo", new String[]{"foo_value1","foo_value= 2"}).put("bar", new String[]{"bar_value"}).get()); + } + + private void check(Map map) + { + byte[] bytes =3D IOTools.serialize(Serialization.PARAMETER_MAP, map); + Map copy =3D IOTools.unserialize(Serialization.PAR= AMETER_MAP, bytes); + assertEquals(map.keySet(), copy.keySet()); + for (Map.Entry entry : map.entrySet()) + { + String[] values =3D map.get(entry.getKey()); + String[] valuesCopy =3D copy.get(entry.getKey()); + ExtendedAssert.assertEquals(values, valuesCopy); + } + } +} --===============8055955971280400607==-- From portal-commits at lists.jboss.org Thu Feb 7 13:03:30 2008 Content-Type: multipart/mixed; boundary="===============7105941869150384636==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9837 - in modules/portlet/trunk: test/src/main/java/org/jboss/portal/portlet/controller/impl/state and 1 other directories. Date: Thu, 07 Feb 2008 13:01:50 -0500 Message-ID: --===============7105941869150384636== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-07 13:01:50 -0500 (Thu, 07 Feb 2008) New Revision: 9837 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/Par= ametersStateString.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/state/StateControllerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/AbstractPortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletURLRenderer.java Log: - reuse Map serialization in order to reduce now the publi= c nav state size in the URL Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/ParametersStateString.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/Pa= rametersStateString.java 2008-02-07 17:37:56 UTC (rev 9836) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/Pa= rametersStateString.java 2008-02-07 18:01:50 UTC (rev 9837) @@ -24,6 +24,7 @@ = import org.jboss.portal.common.util.Base64; import org.jboss.portal.common.util.ParameterMap; +import org.jboss.portal.common.io.Serialization; = import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -151,19 +152,7 @@ = private ParametersStateString(DataInputStream in) throws IOException { - int size =3D in.readInt(); - Map tmp =3D new HashMap(size); - while (size-- > 0) - { - String name =3D in.readUTF(); - int length =3D in.readInt(); - String[] values =3D new String[length]; - for (int i =3D 0;i < length;i++) - { - values[i] =3D in.readUTF(); - } - tmp.put(name, values); - } + Map tmp =3D Serialization.PARAMETER_MAP.unserializ= e(in); = // parameters =3D ParameterMap.wrap(tmp); @@ -389,19 +378,7 @@ else { out.writeByte(1); - out.writeInt(parameters.size()); - for (Map.Entry entry : parameters.entrySet()) - { - String name =3D (String)entry.getKey(); - out.writeUTF(name); - String[] values =3D (String[])entry.getValue(); - int length =3D values.length; - out.writeInt(length); - for (String value : values) - { - out.writeUTF(value); - } - } + Serialization.PARAMETER_MAP.serialize(parameters, out); } } = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/impl/state/StateControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/StateControllerContextImpl.java 2008-02-07 17:37:56 UTC (r= ev 9836) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/StateControllerContextImpl.java 2008-02-07 18:01:50 UTC (r= ev 9837) @@ -32,6 +32,7 @@ import org.jboss.portal.Mode; import org.jboss.portal.common.io.UndeclaredIOException; = +import javax.xml.namespace.QName; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -109,6 +110,8 @@ ByteArrayOutputStream baos =3D new ByteArrayOutputStream(); GZIPOutputStream zos =3D new GZIPOutputStream(baos); DataOutputStream out =3D new DataOutputStream(zos); + + // out.writeInt(pageState.windows.size()); for (Map.Entry entry : pageState= .windows.entrySet()) { @@ -161,6 +164,25 @@ out.writeUTF(windowNS.getMode().toString()); } } + + // + Map publicNS =3D pageState.page; + out.writeInt(publicNS.size()); + for (Map.Entry entry : publicNS.entrySet()) + { + QName name =3D entry.getKey(); + out.writeUTF(name.getNamespaceURI()); + out.writeUTF(name.getLocalPart()); + String[] values =3D entry.getValue(); + int length =3D values.length; + out.writeInt(length); + for (String value : values) + { + out.writeUTF(value); + } + } + + // out.close(); return baos.toByteArray(); } @@ -178,6 +200,8 @@ GZIPInputStream zis =3D new GZIPInputStream(bais); DataInputStream in =3D new DataInputStream(zis); PageNavigationalStateImpl pageState =3D new MutablePageNavigation= alState(this); + + // int size =3D in.readInt(); while (size-- > 0) { @@ -213,10 +237,26 @@ mode =3D codeToMode.get(modeStateHeader); } WindowNavigationalState windowNS =3D new WindowNavigationalSta= te(portletNS, mode, windowState); - pageState.setWindowNavigationalState(windowId, windowNS); + pageState.windows.put(windowId, windowNS); } = // + size =3D in.readInt(); + while (size-- > 0) + { + String namespaceURI =3D in.readUTF(); + String localName =3D in.readUTF(); + QName name =3D new QName(namespaceURI, localName); + int length =3D in.readInt(); + String[] values =3D new String[length]; + for (int i =3D 0;i < length;i++) + { + values[i] =3D in.readUTF(); + } + pageState.page.put(name, values); + } + + // return pageState; } catch (IOException e) Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/AbstractPortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-07 17:37:56 UTC (r= ev 9836) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-07 18:01:50 UTC (r= ev 9837) @@ -26,10 +26,10 @@ import org.jboss.portal.Mode; import org.jboss.portal.WindowState; import org.jboss.portal.common.io.IOTools; +import org.jboss.portal.common.io.Serialization; import org.jboss.portal.common.util.MarkupInfo; import org.jboss.portal.common.util.MediaType; import org.jboss.portal.common.util.ParameterMap; -import org.jboss.portal.common.util.Tools; import org.jboss.portal.common.util.Base64; import org.jboss.portal.portlet.ParametersStateString; import org.jboss.portal.portlet.Portlet; @@ -234,7 +234,8 @@ } else { - Map publicNavigationalStateChanges =3D (M= ap)IOTools.unserialize(Tools.fromHexString(req.getParamet= er(PUBLIC_NAVIGATIONAL_STATE_CHANGES))); + byte[] bytes =3D Base64.decode(req.getParameter(PUBLIC_NAVI= GATIONAL_STATE_CHANGES), true); + Map publicNavigationalStateChanges =3D IO= Tools.unserialize(Serialization.PARAMETER_MAP, bytes); = // request =3D new PortletRenderRequest( @@ -352,4 +353,5 @@ { return new TestPortletInvocationContext(stateControllerContext, req,= resp, windowId, pageState, MARKUP_INFO); } + } \ No newline at end of file Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletURLRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-07 17:37:56 UTC (rev 9836) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-07 18:01:50 UTC (rev 9837) @@ -24,6 +24,7 @@ package org.jboss.portal.portlet.test.controller; = import org.jboss.portal.common.io.IOTools; +import org.jboss.portal.common.io.Serialization; import org.jboss.portal.common.text.CharBuffer; import org.jboss.portal.common.text.FastURLEncoder; import org.jboss.portal.common.util.Tools; @@ -175,18 +176,10 @@ RenderURL renderURL =3D (RenderURL)containerURL; = // - try - { - Map changes =3D renderURL.getPublicNaviga= tionalStateChanges(); - HashMap serialiableChanges =3D new HashMa= p(changes); - byte[] bytes =3D IOTools.serialize(serialiableChanges); - String ns =3D Tools.toHexString(bytes); - parameters.put(PUBLIC_NAVIGATIONAL_STATE_CHANGES, ns); - } - catch (IOException e) - { - throw new Error(e); - } + Map changes =3D renderURL.getPublicNavigatio= nalStateChanges(); + byte[] bytes =3D IOTools.serialize(Serialization.PARAMETER_MAP= , changes); + String ns =3D Base64.encodeBytes(bytes, true); + parameters.put(PUBLIC_NAVIGATIONAL_STATE_CHANGES, ns); = // StateString navigationalState =3D renderURL.getNavigationalSta= te(); --===============7105941869150384636==-- From portal-commits at lists.jboss.org Thu Feb 7 13:31:22 2008 Content-Type: multipart/mixed; boundary="===============3918475556103001113==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9838 - in modules/portlet/trunk/test/src: main/java/org/jboss/portal/portlet/controller/impl/state and 6 other directories. Date: Thu, 07 Feb 2008 13:31:22 -0500 Message-ID: --===============3918475556103001113== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-07 13:31:21 -0500 (Thu, 07 Feb 2008) New Revision: 9838 Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/state/MutablePageNavigationalState.java Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/PortletRequestHandler.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/state/PageNavigationalStateImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/state/StateControllerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/state/PageNavigationalState.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/state/StateControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortalServlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/AbstractPortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimpleP= ortalServlet.java modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/contro= ller/StateControllerContextTestCase.java Log: simplify a bit, make PageNavigationalState use a boolean instead of having = a *Mutable* subclass Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/PortletRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletRequestHandler.java 2008-02-07 18:01:50 UTC (rev 9837) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/PortletRequestHandler.java 2008-02-07 18:31:21 UTC (rev 9838) @@ -88,11 +88,11 @@ PageNavigationalState pageState =3D portletRequest.getPageState(); if (pageState =3D=3D null) { - pageState =3D stateContext.createPageState(); + pageState =3D stateContext.createPageState(true); } else { - pageState =3D stateContext.clonePageState(pageState); + pageState =3D stateContext.clonePageState(pageState, true); } = // Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= controller/impl/state/MutablePageNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/MutablePageNavigationalState.java 2008-02-07 18:01:50 UTC = (rev 9837) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/MutablePageNavigationalState.java 2008-02-07 18:31:21 UTC = (rev 9838) @@ -1,102 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.controller.impl.state; - -import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.controller.state.WindowNavigationalState; -import org.jboss.portal.portlet.info.NavigationInfo; -import org.jboss.portal.portlet.info.ParameterInfo; -import org.jboss.portal.portlet.info.PortletInfo; - -import javax.xml.namespace.QName; -import java.util.Map; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -class MutablePageNavigationalState extends PageNavigationalStateImpl -{ - - MutablePageNavigationalState(StateControllerContextImpl context) - { - super(context); - } - - public MutablePageNavigationalState(PageNavigationalStateImpl original) - { - super(original); - } - - public void setWindowNavigationalState(String windowId, WindowNavigatio= nalState windowState) - { - windows.put(windowId, windowState); - } - - public void setPublicNavigationalState(String windowId, Map update) - { - try - { - PortletInfo info =3D context.portletControllerContext.getPortletI= nfo(windowId); - - NavigationInfo navigationInfo =3D info.getNavigation(); - for (Map.Entry entry : update.entrySet()) - { - String id =3D entry.getKey(); - - // - ParameterInfo parameterInfo =3D navigationInfo.getPublicParame= ter(id); - - // - if (parameterInfo !=3D null) - { - QName name =3D parameterInfo.getName(); - String[] value =3D entry.getValue(); - if (value.length > 0) - { - setPublicNavigationalState(name, value); - } - else - { - removePublicNavigationalState(name); - } - } - } - } - catch (PortletInvokerException e) - { - e.printStackTrace(); - } - } - - public void setPublicNavigationalState(QName name, String[] value) - { - // We clone the value in order to keep the state not mutated by a si= de effect - page.put(name, value.clone()); - } - - public void removePublicNavigationalState(QName name) - { - page.remove(name); - } -} \ No newline at end of file Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/impl/state/PageNavigationalStateImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/PageNavigationalStateImpl.java 2008-02-07 18:01:50 UTC (re= v 9837) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/PageNavigationalStateImpl.java 2008-02-07 18:31:21 UTC (re= v 9838) @@ -28,6 +28,7 @@ import org.jboss.portal.portlet.controller.state.WindowNavigationalState; import org.jboss.portal.portlet.info.ParameterInfo; import org.jboss.portal.portlet.info.PortletInfo; +import org.jboss.portal.portlet.info.NavigationInfo; = import javax.xml.namespace.QName; import java.io.Serializable; @@ -51,18 +52,23 @@ /** . */ protected final Map page; = - public PageNavigationalStateImpl(StateControllerContextImpl context) + /** . */ + private final boolean modifiable; + + PageNavigationalStateImpl(StateControllerContextImpl context, boolean m= odifiable) { this.context =3D context; this.windows =3D new HashMap(); this.page =3D new HashMap(); + this.modifiable =3D modifiable; } = - public PageNavigationalStateImpl(PageNavigationalStateImpl original) + public PageNavigationalStateImpl(PageNavigationalStateImpl original, bo= olean modifiable) { this.context =3D original.context; this.windows =3D new HashMap(origin= al.windows); this.page =3D new HashMap(original.page); + this.modifiable =3D modifiable; } = public Set getWindowIds() @@ -115,24 +121,78 @@ return page.get(name).clone(); } = - public void setWindowNavigationalState(String windowId, WindowNavigatio= nalState windowState) throws UnsupportedOperationException + public void setWindowNavigationalState(String windowId, WindowNavigatio= nalState windowState) { - throw new UnsupportedOperationException(); + if (!modifiable) + { + throw new IllegalStateException("The page navigational state is n= ot modifiable"); + } + + // + windows.put(windowId, windowState); } = public void setPublicNavigationalState(String windowId, Map update) { - throw new UnsupportedOperationException(); + if (!modifiable) + { + throw new IllegalStateException("The page navigational state is n= ot modifiable"); + } + + // + try + { + PortletInfo info =3D context.portletControllerContext.getPortletI= nfo(windowId); + + NavigationInfo navigationInfo =3D info.getNavigation(); + for (Map.Entry entry : update.entrySet()) + { + String id =3D entry.getKey(); + + // + ParameterInfo parameterInfo =3D navigationInfo.getPublicParame= ter(id); + + // + if (parameterInfo !=3D null) + { + QName name =3D parameterInfo.getName(); + String[] value =3D entry.getValue(); + if (value.length > 0) + { + setPublicNavigationalState(name, value); + } + else + { + removePublicNavigationalState(name); + } + } + } + } + catch (PortletInvokerException e) + { + e.printStackTrace(); + } } = - public void setPublicNavigationalState(QName name, String[] value) thro= ws UnsupportedOperationException + public void setPublicNavigationalState(QName name, String[] value) { - throw new UnsupportedOperationException(); + if (!modifiable) + { + throw new IllegalStateException("The page navigational state is n= ot modifiable"); + } + + // We clone the value in order to keep the state not mutated by a si= de effect + page.put(name, value.clone()); } = - public void removePublicNavigationalState(QName name) throws Unsupporte= dOperationException + public void removePublicNavigationalState(QName name) { - throw new UnsupportedOperationException(); + if (!modifiable) + { + throw new IllegalStateException("The page navigational state is n= ot modifiable"); + } + + // + page.remove(name); } - } \ No newline at end of file Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/impl/state/StateControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/StateControllerContextImpl.java 2008-02-07 18:01:50 UTC (r= ev 9837) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/StateControllerContextImpl.java 2008-02-07 18:31:21 UTC (r= ev 9838) @@ -92,14 +92,14 @@ this.portletControllerContext =3D portletControllerContext; } = - public PageNavigationalState clonePageState(PageNavigationalState pageS= tate) + public PageNavigationalState clonePageState(PageNavigationalState pageS= tate, boolean modifiable) { - return new MutablePageNavigationalState((PageNavigationalStateImpl)p= ageState); + return new PageNavigationalStateImpl((PageNavigationalStateImpl)page= State, modifiable); } = - public PageNavigationalState createPageState() + public PageNavigationalState createPageState(boolean modifiable) { - return new MutablePageNavigationalState(this); + return new PageNavigationalStateImpl(this, modifiable); } = public byte[] serialize(PageNavigationalState object) = @@ -192,14 +192,14 @@ } } = - public PageNavigationalState unserialize(byte[] bytes) + public PageNavigationalState unserialize(byte[] bytes, boolean modifiab= le) { try { ByteArrayInputStream bais =3D new ByteArrayInputStream(bytes); GZIPInputStream zis =3D new GZIPInputStream(bais); DataInputStream in =3D new DataInputStream(zis); - PageNavigationalStateImpl pageState =3D new MutablePageNavigation= alState(this); + PageNavigationalStateImpl pageState =3D new PageNavigationalState= Impl(this, modifiable); = // int size =3D in.readInt(); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/state/PageNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/PageNavigationalState.java 2008-02-07 18:01:50 UTC (rev 9837) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/PageNavigationalState.java 2008-02-07 18:31:21 UTC (rev 9838) @@ -29,7 +29,9 @@ import java.util.Set; = /** - * Defines the page navigational state that the controller needs. + * Defines the page navigational state view that the controller needs to o= perate on. Its name begins with page + * however it does not mandate that the represented context to be a page.= I.E it could represent a set + * of physical pages or something else. * * @author Julien Viet * @version $Revision: 1.1 $ @@ -37,6 +39,11 @@ public interface PageNavigationalState { = + /** + * Returns the window ids referenced. + * + * @return a set of window id + */ Set getWindowIds(); = /** @@ -44,17 +51,19 @@ * * @param windowId the window * @return the window navigational state + * @throws IllegalArgumentException if an argument is not valid */ - WindowNavigationalState getWindowNavigationalState(String windowId); + WindowNavigationalState getWindowNavigationalState(String windowId) thr= ows IllegalArgumentException; = /** * Update the navigational state of a window. * * @param windowId the window id * @param windowState the window state - * @throws UnsupportedOperationException if the page state is read only + * @throws IllegalArgumentException if an argument is not valid + * @throws IllegalStateException if the page state is read only */ - void setWindowNavigationalState(String windowId, WindowNavigationalStat= e windowState) throws UnsupportedOperationException; + void setWindowNavigationalState(String windowId, WindowNavigationalStat= e windowState) throws IllegalArgumentException, IllegalStateException; = /** * Obtain the public navigational state of a window. The interpretation= of what should be retrieved is left up to the @@ -63,8 +72,9 @@ * * @param windowId the window id * @return the public navigational state + * @throws IllegalArgumentException if an argument is not valid */ - ParameterMap getPublicNavigationalState(String windowId); + ParameterMap getPublicNavigationalState(String windowId) throws Illegal= ArgumentException; = /** * Update the public navigational state of a window. The interpretation= of what should be updated is left up to the @@ -75,13 +85,36 @@ * * @param windowId the window id * @param update the updates - * @throws UnsupportedOperationException if the page state is read only + * @throws IllegalArgumentException if an argument is not valid + * @throws IllegalStateException if the page state is read only */ - void setPublicNavigationalState(String windowId, Map = update) throws UnsupportedOperationException; + void setPublicNavigationalState(String windowId, Map = update) throws IllegalArgumentException, IllegalStateException; = - String[] getPublicNavigationalState(QName name); + /** + * Returns a public navigational state entry or null if it is not found. + * + * @param name the name + * @return the entry value + * @throws IllegalArgumentException if an argument is not valid + */ + String[] getPublicNavigationalState(QName name) throws IllegalArgumentE= xception; = - void setPublicNavigationalState(QName name, String[] value); + /** + * Sets a public navigational state entry. + * + * @param name the name + * @param value the new value + * @throws IllegalArgumentException if an argument is not valid + * @throws IllegalStateException if the page state is read only + */ + void setPublicNavigationalState(QName name, String[] value) throws Ille= galArgumentException, IllegalStateException; = - void removePublicNavigationalState(QName name); + /** + * Removes a public navigational state entry. + * + * @param name the name + * @throws IllegalArgumentException if an argument is not valid + * @throws IllegalStateException if the page state is read only + */ + void removePublicNavigationalState(QName name) throws IllegalArgumentEx= ception, IllegalStateException; } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/state/StateControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/StateControllerContext.java 2008-02-07 18:01:50 UTC (rev 9837) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/StateControllerContext.java 2008-02-07 18:31:21 UTC (rev 9838) @@ -35,15 +35,17 @@ * Clone an existing page state object. * * @param pageState the page state to clone + * @param modifiable set the modifiable status * @return the page state clone */ - PageNavigationalState clonePageState(PageNavigationalState pageState); + PageNavigationalState clonePageState(PageNavigationalState pageState, b= oolean modifiable); = /** * Create a new page state object. * + * @param modifiable set the modifiable status * @return the new page state */ - PageNavigationalState createPageState(); + PageNavigationalState createPageState(boolean modifiable); = } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortalServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortalServlet.java 2008-02-07 18:01:50 UTC (rev 9837) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortalServlet.java 2008-02-07 18:31:21 UTC (rev 9838) @@ -87,7 +87,7 @@ } else { - PageRenderer renderer =3D new PageRenderer(new ResponseProperties= (), context.getStateControllerContext().createPageState()); + PageRenderer renderer =3D new PageRenderer(new ResponseProperties= (), context.getStateControllerContext().createPageState(false)); = // renderer.render(context); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/AbstractPortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-07 18:01:50 UTC (r= ev 9837) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-07 18:31:21 UTC (r= ev 9838) @@ -133,7 +133,7 @@ if (context !=3D null) { byte[] bytes =3D Base64.decode(context, true); - pageState =3D tmp.unserialize(bytes); + pageState =3D tmp.unserialize(bytes, false); } = // Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-07 18:01:50 UTC (rev 9837) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-07 18:31:21 UTC (rev 9838) @@ -223,7 +223,7 @@ Page page =3D context.getPage(); if (pageState =3D=3D null) { - pageState =3D context.getStateControllerContext().createPageState= (); + pageState =3D context.getStateControllerContext().createPageState= (false); } = // Look if we need to handle maxmized rendering Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/= SimplePortalServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/Simple= PortalServlet.java 2008-02-07 18:01:50 UTC (rev 9837) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/Simple= PortalServlet.java 2008-02-07 18:31:21 UTC (rev 9838) @@ -87,7 +87,7 @@ } else { - PageRenderer renderer =3D new PageRenderer(new ResponseProperties= (), context.getStateControllerContext().createPageState()); + PageRenderer renderer =3D new PageRenderer(new ResponseProperties= (), context.getStateControllerContext().createPageState(false)); = // renderer.render(context); Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet= /controller/StateControllerContextTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/contr= oller/StateControllerContextTestCase.java 2008-02-07 18:01:50 UTC (rev 9837) +++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/contr= oller/StateControllerContextTestCase.java 2008-02-07 18:31:21 UTC (rev 9838) @@ -62,7 +62,7 @@ @Test public void testMarshalling1() { - PageNavigationalState pageNS =3D cc.createPageState(); + PageNavigationalState pageNS =3D cc.createPageState(true); assertMarshallable(pageNS); } = @@ -89,7 +89,7 @@ = private void test(StateString portletNavigationalState, Mode mode, Wind= owState windowState) { - PageNavigationalState pageNS =3D cc.createPageState(); + PageNavigationalState pageNS =3D cc.createPageState(true); pageNS.setWindowNavigationalState("foo", new WindowNavigationalState= (portletNavigationalState, mode, windowState)); assertMarshallable(pageNS); } @@ -97,7 +97,7 @@ private void assertMarshallable(PageNavigationalState pageNS) { byte[] bytes =3D cc.serialize(pageNS); - PageNavigationalState expectedPageNS =3D cc.unserialize(bytes); + PageNavigationalState expectedPageNS =3D cc.unserialize(bytes, true); assertEquals(expectedPageNS.getWindowIds(), pageNS.getWindowIds()); for (String windowId : expectedPageNS.getWindowIds()) { --===============3918475556103001113==-- From portal-commits at lists.jboss.org Thu Feb 7 14:11:18 2008 Content-Type: multipart/mixed; boundary="===============7214852964521292844==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9839 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test: controller and 1 other directories. Date: Thu, 07 Feb 2008 14:11:18 -0500 Message-ID: --===============7214852964521292844== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-07 14:11:18 -0500 (Thu, 07 Feb 2008) New Revision: 9839 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/U= RLParameterConstants.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/AbstractPortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletURLRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestPortletInvocationContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java Log: - allow other type of invocations in PortletURLRenderer (for page refresh) - make the jsp portal use redirect after action Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/URLParameterConstants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= URLParameterConstants.java 2008-02-07 18:31:21 UTC (rev 9838) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= URLParameterConstants.java 2008-02-07 19:11:18 UTC (rev 9839) @@ -34,10 +34,21 @@ } = /** + * The type of request. The goal is to allow other types of invocation = to be used by the controller context. + * The controller context itself only works on the portlet type. + */ + public static final String TYPE =3D "type"; + + /** + * The portlet type. + */ + public static final String PORTLET_TYPE =3D "portlet"; + + /** * The life cycle type of the invocation. The values accepted are ACTION_LIFECYCLE
    , * RENDER_LIFECYCLE and RESOURCE_LIFECYCLE. */ - public static final String LIFECYCLE_TYPE =3D "type"; + public static final String LIFECYCLE_PHASE =3D "lifecycle"; = /** The window id. */ public static final String WINDOW_ID =3D "windowid"; @@ -70,12 +81,12 @@ public static final String RESOURCE_CACHEABILITY =3D "resourcecacheabil= ity"; = /** Denotes an action lifecycle operation. */ - public static final String ACTION_LIFECYCLE =3D "action"; + public static final String ACTION_PHASE =3D "action"; = /** Denotes a render lifecycle operation. */ - public static final String RENDER_LIFECYCLE =3D "render"; + public static final String RENDER_PHASE =3D "render"; = /** Denotes a resource lifecycle operation. */ - public static final String RESOURCE_LIFECYCLE =3D "resource"; + public static final String RESOURCE_PHASE =3D "resource"; = } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/AbstractPortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-07 18:31:21 UTC (r= ev 9838) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-07 19:11:18 UTC (r= ev 9839) @@ -105,6 +105,9 @@ /** . */ private final StateControllerContextImpl stateControllerContext; = + /** . */ + private final PageNavigationalState pageState; + public AbstractPortletControllerContext( HttpServletRequest req, HttpServletResponse resp, @@ -114,28 +117,29 @@ StateControllerContextImpl tmp =3D new StateControllerContextImpl(th= is); = // The nav state provided with the request + // Unmarshall portal navigational state if it is provided PageNavigationalState pageState =3D null; + String context =3D req.getParameter(PAGE_STATE); + if (context !=3D null) + { + byte[] bytes =3D Base64.decode(context, true); + pageState =3D tmp.unserialize(bytes, false); + } = + // The type of invocation + String type =3D req.getParameter(TYPE); + + // Process only portlet type // The request decoded if not null ControllerRequest request =3D null; + if (PORTLET_TYPE.equals(type)) + { + // Get the window id + String windowId =3D req.getParameter(WINDOW_ID); = - // Get the window id - String windowId =3D req.getParameter(WINDOW_ID); - - // Process - if (windowId !=3D null) - { // Helper WebRequest ri =3D new WebRequest(req); = - // Unmarshall portal navigational state if it is provided - String context =3D req.getParameter(PAGE_STATE); - if (context !=3D null) - { - byte[] bytes =3D Base64.decode(context, true); - pageState =3D tmp.unserialize(bytes, false); - } - // Mode mode =3D null; if (req.getParameter(MODE) !=3D null) @@ -162,8 +166,8 @@ WindowNavigationalState windowNavigationalState =3D new WindowNav= igationalState(navigationalState, mode, windowState); = // - String type =3D req.getParameter(LIFECYCLE_TYPE); - if (RESOURCE_LIFECYCLE.equals(type)) + String phase =3D req.getParameter(LIFECYCLE_PHASE); + if (RESOURCE_PHASE.equals(phase)) { StateString resourceState =3D ParametersStateString.create(req= .getParameter(RESOURCE_STATE)); String resourceId =3D req.getParameter(RESOURCE_ID); @@ -212,7 +216,7 @@ } else { - if (ACTION_LIFECYCLE.equals(type)) + if (ACTION_PHASE.equals(phase)) { ParameterMap formParameters =3D null; if (ri.getBody() instanceof Body.Form) @@ -254,8 +258,14 @@ this.resp =3D resp; this.servletContext =3D servletContext; this.stateControllerContext =3D tmp; + this.pageState =3D pageState; } = + public PageNavigationalState getPageState() + { + return pageState; + } + public ControllerRequest getRequest() { return request; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletURLRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-07 18:31:21 UTC (rev 9838) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-07 19:11:18 UTC (rev 9839) @@ -27,7 +27,6 @@ import org.jboss.portal.common.io.Serialization; import org.jboss.portal.common.text.CharBuffer; import org.jboss.portal.common.text.FastURLEncoder; -import org.jboss.portal.common.util.Tools; import org.jboss.portal.common.util.Base64; import org.jboss.portal.portlet.ActionURL; import org.jboss.portal.portlet.ContainerURL; @@ -38,14 +37,13 @@ import org.jboss.portal.portlet.cache.CacheLevel; import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.test.StringCodec; import static org.jboss.portal.portlet.test.URLParameterConstants.*; = import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.io.IOException; import java.util.HashMap; import java.util.Map; +import java.util.Collections; = /** * @author Julien Viet @@ -58,9 +56,6 @@ final StateControllerContextImpl stateContext; = /** . */ - final String windowId; - - /** . */ final HttpServletRequest clientReq; = /** . */ @@ -72,18 +67,16 @@ public PortletURLRenderer( StateControllerContextImpl stateContext, PageNavigationalState pageNS, - String windowId, HttpServletRequest clientReq, HttpServletResponse clientResp) { this.stateContext =3D stateContext; this.pageNS =3D pageNS; - this.windowId =3D windowId; this.clientReq =3D clientReq; this.clientResp =3D clientResp; } = - public String renderURL(ContainerURL containerURL, Boolean wantSecure, = Boolean wantAuthenticated, boolean relative) + private String renderURL(Map parameters, Boolean wantSe= cure, Boolean wantAuthenticated, boolean relative) { CharBuffer buffer =3D new CharBuffer(); buffer.append(clientReq.getScheme()); @@ -101,30 +94,68 @@ } = // + boolean first =3D true; + for (Map.Entry entry : parameters.entrySet()) + { + String name =3D entry.getKey(); + String value =3D entry.getValue(); + buffer.append(first ? '?' : '&'); + buffer.append(name, FastURLEncoder.getUTF8Instance()); + buffer.append('=3D'); + buffer.append(value, FastURLEncoder.getUTF8Instance()); + first =3D false; + } + + // + String url =3D buffer.asString(); + return clientResp.encodeURL(url); + } + + public String renderURL(Boolean wantSecure, Boolean wantAuthenticated, = boolean relative) + { + String pageState =3D null; + if (pageNS !=3D null) + { + byte[] bytes =3D stateContext.serialize(pageNS); + pageState =3D Base64.encodeBytes(bytes, true); + } + + // + Map parameters =3D Collections.singletonMap(PAGE_STA= TE, pageState); + + // + return renderURL(parameters, wantSecure, wantAuthenticated, relative= ); + } + + public String renderURL(String windowId, ContainerURL containerURL, Boo= lean wantSecure, Boolean wantAuthenticated, boolean relative) + { Map parameters =3D new HashMap(); = // + parameters.put(TYPE, PORTLET_TYPE); + + // parameters.put(WINDOW_ID, windowId); = // String type; if (containerURL instanceof ActionURL) { - type =3D ACTION_LIFECYCLE; + type =3D ACTION_PHASE; } else if (containerURL instanceof RenderURL) { - type =3D RENDER_LIFECYCLE; + type =3D RENDER_PHASE; } else if (containerURL instanceof ResourceURL) { - type =3D RESOURCE_LIFECYCLE; + type =3D RESOURCE_PHASE; } else { throw new Error(); } - parameters.put(LIFECYCLE_TYPE, type); + parameters.put(LIFECYCLE_PHASE, type); = // String pageState =3D null; @@ -236,20 +267,6 @@ } = // - boolean first =3D true; - for (Map.Entry entry : parameters.entrySet()) - { - String name =3D entry.getKey(); - String value =3D entry.getValue(); - buffer.append(first ? '?' : '&'); - buffer.append(name, FastURLEncoder.getUTF8Instance()); - buffer.append('=3D'); - buffer.append(value, FastURLEncoder.getUTF8Instance()); - first =3D false; - } - - // - String url =3D buffer.asString(); - return clientResp.encodeURL(url); + return renderURL(parameters, wantSecure, wantAuthenticated, relative= ); } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/TestPortletInvocationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvocationContext.java 2008-02-07 18:31:21 UTC (rev 9= 838) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvocationContext.java 2008-02-07 19:11:18 UTC (rev 9= 839) @@ -76,7 +76,7 @@ this.clientResponse =3D clientResponse; this.windowId =3D windowId; this.pageState =3D pageState; - this.urlRenderer =3D new PortletURLRenderer(stateContext, pageState,= windowId, clientRequest, clientResponse); + this.urlRenderer =3D new PortletURLRenderer(stateContext, pageState,= clientRequest, clientResponse); = // addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttribut= eResolver(clientRequest)); @@ -98,6 +98,6 @@ = public String renderURL(ContainerURL containerURL, Boolean wantSecure, = Boolean wantAuthenticated, boolean relative) { - return urlRenderer.renderURL(containerURL, wantSecure, wantAuthentic= ated, relative); + return urlRenderer.renderURL(windowId, containerURL, wantSecure, wan= tAuthenticated, relative); } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-07 18:31:21 UTC (rev 9838) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-07 19:11:18 UTC (rev 9839) @@ -42,6 +42,7 @@ import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.controller.PortletController; +import org.jboss.portal.portlet.controller.request.PortletActionRequest; import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; import org.jboss.portal.portlet.controller.response.ControllerResponse; import org.jboss.portal.portlet.controller.response.PageUpdateResponse; @@ -154,7 +155,30 @@ if (controllerResponse instanceof PageUpdateResponse) { PageUpdateResponse pageUpdate =3D (PageUpdateResponse)controll= erResponse; - pageState =3D pageUpdate.getPageState(); + + // We perform a send redirect on actions + if (context.getRequest() instanceof PortletActionRequest) + { + // + PortletURLRenderer renderer =3D new PortletURLRenderer( + (StateControllerContextImpl)context.getStateControllerCo= ntext(), + pageState, + context.getClientRequest(), + context.getClientResponse()); + + // + String url =3D renderer.renderURL(null, null, true); + + // + resp.sendRedirect(url); + + // + return; + } + else + { + pageState =3D pageUpdate.getPageState(); + } } else if (controllerResponse instanceof ResourceResponse) { @@ -218,6 +242,10 @@ // todo } } + else + { + pageState =3D context.getPageState(); + } = // Page page =3D context.getPage(); @@ -344,7 +372,6 @@ PortletURLRenderer renderer =3D new PortletURLRenderer( (StateControllerContextImpl)context.getStateControlle= rContext(), pageState, - windowId, context.getClientRequest(), context.getClientResponse()); = @@ -372,7 +399,7 @@ }; = // - String renderedURL =3D renderer.renderURL(url, null, nul= l, true); + String renderedURL =3D renderer.renderURL(windowId, url,= null, null, true); writer.write(renderedURL); writer.flush(); } --===============7214852964521292844==-- From portal-commits at lists.jboss.org Thu Feb 7 16:33:34 2008 Content-Type: multipart/mixed; boundary="===============1792271220144349861==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9840 - modules/portlet/trunk/test/src/test/resources/simple-portal-war. Date: Thu, 07 Feb 2008 16:33:34 -0500 Message-ID: --===============1792271220144349861== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-07 16:33:34 -0500 (Thu, 07 Feb 2008) New Revision: 9840 Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.jsp Log: - Prepare markup for styling. Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/i= ndex.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-07 19:11:18 UTC (rev 9839) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-07 21:33:34 UTC (rev 9840) @@ -4,41 +4,58 @@ -****************************************************
    - ------------------------------------
    -
    -">Maximized -">Normal
    -
    ">Minimized -">Derwood
    ------------------------------------
    - ------------------------------------
    + +
    + +
    + +
    +
    -****************************************************
    - ------------------------------------
    -
    ------------------------------------
    - ------------------------------------
    + + + +
    +
    +
    + +
    +
    + +
    +
    -****************************************************
    - ------------------------------------
    -
    ------------------------------------
    - ------------------------------------
    + +
    + +
    +
    +
    + +
    +
    + +
    +
    -****************************************************
    --===============1792271220144349861==-- From portal-commits at lists.jboss.org Thu Feb 7 17:34:26 2008 Content-Type: multipart/mixed; boundary="===============1660996087643396573==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9841 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test: jsp and 3 other directories. Date: Thu, 07 Feb 2008 17:34:26 -0500 Message-ID: --===============1660996087643396573== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-07 17:34:26 -0500 (Thu, 07 Feb 2008) New Revision: 9841 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/AbstractPortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletURLRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PagePortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/BufferingResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/portlet/StartPortletChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTag.java Log: more streaming Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/AbstractPortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-07 21:33:34 UTC (r= ev 9840) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-07 22:34:26 UTC (r= ev 9841) @@ -112,7 +112,7 @@ HttpServletRequest req, HttpServletResponse resp, ServletContext servletContext) - throws IllegalRequestException, IOException, ClassNotFoundException + throws IllegalRequestException, IOException { StateControllerContextImpl tmp =3D new StateControllerContextImpl(th= is); = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletURLRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-07 21:33:34 UTC (rev 9840) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-07 22:34:26 UTC (rev 9841) @@ -121,7 +121,15 @@ } = // - Map parameters =3D Collections.singletonMap(PAGE_STA= TE, pageState); + Map parameters; + if (pageState !=3D null) + { + parameters =3D Collections.singletonMap(PAGE_STATE, pageState); + } + else + { + parameters =3D Collections.emptyMap(); + } = // return renderURL(parameters, wantSecure, wantAuthenticated, relative= ); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-07 21:33:34 UTC (rev 9840) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-07 22:34:26 UTC (rev 9841) @@ -32,8 +32,6 @@ import org.jboss.portal.portlet.test.jsp.response.portlet.EndPortletChunk; import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; import org.jboss.portal.portlet.test.jsp.response.ResponseBuffer; -import org.jboss.portal.portlet.test.jsp.response.StartPageChunk; -import org.jboss.portal.portlet.test.jsp.response.EndPageChunk; import org.jboss.portal.portlet.test.controller.PortletURLRenderer; import org.jboss.portal.portlet.PortletInvoker; import org.jboss.portal.portlet.PortletInvokerException; @@ -68,10 +66,6 @@ import java.io.OutputStream; import java.io.OutputStreamWriter; import java.util.Map; -import java.util.Iterator; -import java.util.List; -import java.util.LinkedList; -import java.util.Collections; = /** * @author Julien Viet @@ -100,44 +94,23 @@ = public void doFilter(HttpServletRequest req, HttpServletResponse resp, = FilterChain chain) throws IOException, ServletException { - BufferingResponse bufferingResponse =3D new BufferingResponse(resp); + PortletInvoker invoker =3D (PortletInvoker)getServletContext().getAt= tribute("ConsumerPortletInvoker"); = // - chain.doFilter(req, bufferingResponse); - - // - ResponseBuffer buffer =3D bufferingResponse.getBuffer(); - buffer.close(); - - // + PagePortletControllerContext context; try { - service(req, resp, buffer); + context =3D new PagePortletControllerContext( + req, + resp, + getServletContext(), + invoker); } - catch (ClassNotFoundException e) + catch (PortletInvokerException e) { throw new ServletException(e); } - } = - public void destroy() - { - this.config =3D null; - } - - protected void service(HttpServletRequest req, HttpServletResponse resp= , ResponseBuffer buffer) throws ServletException, IOException, ClassNotFoun= dException - { - PortletInvoker invoker =3D (PortletInvoker)getServletContext().getAt= tribute("ConsumerPortletInvoker"); - - // - PagePortletControllerContext context =3D new PagePortletControllerCo= ntext( - req, - resp, - getServletContext(), - invoker, - buffer); - - // PageNavigationalState pageState =3D null; if (context.getRequest() !=3D null) { @@ -162,7 +135,7 @@ // PortletURLRenderer renderer =3D new PortletURLRenderer( (StateControllerContextImpl)context.getStateControllerCo= ntext(), - pageState, + pageUpdate.getPageState(), context.getClientRequest(), context.getClientResponse()); = @@ -189,7 +162,7 @@ if (pir instanceof FragmentResponse) { FragmentResponse fragment =3D (FragmentResponse)pir; - = + // if (fragment.getType() =3D=3D FragmentResponse.TYPE_EMPTY) { @@ -236,6 +209,9 @@ { // todo } + + // + return; } else { @@ -248,13 +224,41 @@ } = // - Page page =3D context.getPage(); - if (pageState =3D=3D null) + BufferingResponse bufferingResponse =3D new BufferingResponse(resp, = context, pageState); + + // + chain.doFilter(req, bufferingResponse); + + // + ResponseBuffer buffer =3D bufferingResponse.getBuffer(); + buffer.close(); + + // + try { - pageState =3D context.getStateControllerContext().createPageState= (false); + render(req, bufferingResponse); } + catch (ClassNotFoundException e) + { + throw new ServletException(e); + } + } = + public void destroy() + { + this.config =3D null; + } + + protected void render(HttpServletRequest req, BufferingResponse resp) t= hrows ServletException, IOException, ClassNotFoundException + { + + // + PagePortletControllerContext context =3D resp.getPortletControllerCo= ntext(); + + // + // Look if we need to handle maxmized rendering +/* for (Window window : page.getWindows()) { WindowNavigationalState windowState =3D pageState.getWindowNaviga= tionalState(window.getId()); @@ -317,19 +321,18 @@ page =3D new Page(chunks, windows); } } +*/ = // - Map responses =3D page.render(con= text, pageState); +// Map responses =3D page.render(c= ontext, pageState); = // - OutputStream out =3D resp.getOutputStream(); + OutputStream out =3D resp.getResponse().getOutputStream(); OutputStreamWriter writer =3D new OutputStreamWriter(out); = // - String windowId =3D null; StartPortletChunk startPortletChunk =3D null; - PortletInvocationResponse portletResponse =3D null; - for (Chunk chunk : page.getChunks()) + for (Chunk chunk : resp.getBuffer().getChunks()) { if (chunk instanceof BytesChunk) { @@ -346,12 +349,10 @@ else if (chunk instanceof StartPortletChunk) { startPortletChunk =3D (StartPortletChunk)chunk; - Window window =3D page.getWindow(startPortletChunk); - windowId =3D window.getId(); - portletResponse =3D responses.get(windowId); } else if (chunk instanceof StartPortletTitleChunk) { + PortletInvocationResponse portletResponse =3D startPortletChun= k.getResponse(); if (portletResponse !=3D null) { if (portletResponse instanceof FragmentResponse) @@ -365,13 +366,14 @@ else if (chunk instanceof PortletURLChunk) { final PortletURLChunk portletURL =3D (PortletURLChunk)chunk; + PortletInvocationResponse portletResponse =3D startPortletChun= k.getResponse(); if (portletResponse !=3D null) { if (portletResponse instanceof FragmentResponse) { PortletURLRenderer renderer =3D new PortletURLRenderer( (StateControllerContextImpl)context.getStateControlle= rContext(), - pageState, + resp.getPageState(), context.getClientRequest(), context.getClientResponse()); = @@ -399,7 +401,7 @@ }; = // - String renderedURL =3D renderer.renderURL(windowId, url,= null, null, true); + String renderedURL =3D renderer.renderURL(startPortletCh= unk.getWindowId(), url, null, null, true); writer.write(renderedURL); writer.flush(); } @@ -407,12 +409,17 @@ } else if (chunk instanceof PortletMarkupChunk) { + PortletInvocationResponse portletResponse =3D startPortletChun= k.getResponse(); if (portletResponse !=3D null) { if (portletResponse instanceof FragmentResponse) { FragmentResponse fragment =3D (FragmentResponse)portletR= esponse; - WindowNavigationalState windowNS =3D pageState.getWindow= NavigationalState(windowId); + WindowNavigationalState windowNS =3D null; + if (resp.getPageState() !=3D null) + { + windowNS =3D resp.getPageState().getWindowNavigationa= lState(startPortletChunk.getWindowId()); + } if (windowNS =3D=3D null || !windowNS.getWindowState().e= quals(WindowState.MINIMIZED)) { if (fragment.getType() !=3D FragmentResponse.TYPE_EMP= TY) @@ -447,9 +454,7 @@ } else if (chunk instanceof EndPortletChunk) { - windowId =3D null; startPortletChunk =3D null; - portletResponse =3D null; } } out.close(); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PagePortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-07 21:33:34 UTC (rev 9840) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-07 22:34:26 UTC (rev 9841) @@ -23,12 +23,10 @@ package org.jboss.portal.portlet.test.jsp; = import org.jboss.portal.portlet.test.controller.AbstractPortletControllerC= ontext; -import org.jboss.portal.portlet.test.jsp.response.Chunk; -import org.jboss.portal.portlet.test.jsp.response.portlet.StartPortletChun= k; -import org.jboss.portal.portlet.test.jsp.response.ResponseBuffer; import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.PortletInvoker; +import org.jboss.portal.portlet.PortletContext; import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.controller.event.EventControllerContext; import org.jboss.portal.portlet.controller.impl.event.EventControllerConte= xtImpl; @@ -43,7 +41,6 @@ import java.io.IOException; import java.util.Map; import java.util.HashMap; -import java.util.LinkedHashMap; = /** * @author Julien Viet @@ -51,9 +48,6 @@ */ public class PagePortletControllerContext extends AbstractPortletControlle= rContext { - = - /** . */ - private final Page page; = /** . */ private final PortletInvoker invoker; @@ -61,70 +55,49 @@ /** . */ private final EventControllerContext eventControllerContext; = + /** . */ + private final Map portlets; + public PagePortletControllerContext( HttpServletRequest req, HttpServletResponse resp, ServletContext servletContext, - PortletInvoker invoker, - ResponseBuffer buffer) - throws IllegalRequestException, IOException, ClassNotFoundException,= ServletException + PortletInvoker invoker) + throws IllegalRequestException, IOException, ServletException, Portl= etInvokerException { super(req, resp, servletContext); = - // Collect portlets to create the page - int counter =3D 0; - Map windows =3D new LinkedHashMap(); - for (Chunk chunk : buffer.getChunks()) + // + Map portlets =3D new HashMap(); + for (Portlet portlet : invoker.getPortlets()) { - if (chunk instanceof StartPortletChunk) - { - StartPortletChunk startPortletChunk =3D (StartPortletChunk)chu= nk; - String windowId =3D "" + counter++; - - // - try - { - for (Portlet portlet : invoker.getPortlets()) - { - PortletInfo portletInfo =3D portlet.getInfo(); - String portletName =3D portletInfo.getName(); - String applicationName =3D portletInfo.getApplicationNam= e(); - - // - if (applicationName.equals(startPortletChunk.getApplicat= ionName()) && portletName.equals(startPortletChunk.getPortletName())) - { - windows.put(startPortletChunk, new Window(windowId, p= ortlet)); - } - } - } - catch (PortletInvokerException e) - { - throw new ServletException(e); - } - } + PortletInfo portletInfo =3D portlet.getInfo(); + String portletName =3D portletInfo.getName(); + String applicationName =3D portletInfo.getApplicationName(); + Key key =3D new Key(applicationName, portletName); + portlets.put(key, portlet); } = // - - - // - this.page =3D new Page(buffer.getChunks(), windows); + this.portlets =3D portlets; this.invoker =3D invoker; this.eventControllerContext =3D new EventControllerContextImpl(invok= er); } = - public Page getPage() + public Portlet findPortlet(String applicationName, String portletName) { - return page; + return portlets.get(new Key(applicationName, portletName)); } = protected Portlet getPortlet(String windowId) throws PortletInvokerExce= ption { - Window window =3D page.getWindow(windowId); - return window.getPortlet(); + int index =3D windowId.lastIndexOf('.'); + String portletId =3D windowId.substring(0, index); + PortletContext portletContext =3D PortletContext.createPortletContex= t(portletId); + return invoker.getPortlet(portletContext); } = - protected PortletInvocationResponse invoke(PortletInvocation invocation= ) throws PortletInvokerException + public PortletInvocationResponse invoke(PortletInvocation invocation) t= hrows PortletInvokerException { return invoker.invoke(invocation); } @@ -133,4 +106,40 @@ { return eventControllerContext; } + + private static class Key + { + + /** . */ + private final String applicationName; + + /** . */ + private final String portletName; + + private Key(String applicationName, String portletName) + { + this.applicationName =3D applicationName; + this.portletName =3D portletName; + } + + public boolean equals(Object obj) + { + if (obj =3D=3D this) + { + return true; + } + if (obj instanceof Key) + { + Key that =3D (Key)obj; + return applicationName.equals(that.applicationName) && portlet= Name.equals(that.portletName); + } + return false; + } + + public int hashCode() + { + return applicationName.hashCode() + portletName.hashCode(); + } + } + } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/response/BufferingResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/BufferingResponse.java 2008-02-07 21:33:34 UTC (rev 9840) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/BufferingResponse.java 2008-02-07 22:34:26 UTC (rev 9841) @@ -24,6 +24,8 @@ = import org.jboss.portal.portlet.test.jsp.response.ResponseBuffer; import org.jboss.portal.portlet.test.jsp.response.Chunk; +import org.jboss.portal.portlet.test.jsp.PagePortletControllerContext; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; = import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponseWrapper; @@ -41,11 +43,37 @@ /** . */ private final ResponseBuffer buffer =3D new ResponseBuffer(); = - public BufferingResponse(HttpServletResponse response) + /** . */ + private final PagePortletControllerContext portletControllerContext; + + /** . */ + private final PageNavigationalState pageState; + + /** . */ + private int count =3D 0; + + public BufferingResponse( + HttpServletResponse response, + PagePortletControllerContext portletControllerContext, + PageNavigationalState pageState) { super(response); + + // + this.portletControllerContext =3D portletControllerContext; + this.pageState =3D pageState; } = + public PageNavigationalState getPageState() + { + return pageState; + } + + public PagePortletControllerContext getPortletControllerContext() + { + return portletControllerContext; + } + public ResponseBuffer getBuffer() { return buffer; @@ -65,4 +93,9 @@ { buffer.close(); } + + public String nextId() + { + return "" + count++; + } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/response/portlet/StartPortletChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/StartPortletChunk.java 2008-02-07 21:33:34 UTC (rev 98= 40) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/StartPortletChunk.java 2008-02-07 22:34:26 UTC (rev 98= 41) @@ -25,6 +25,7 @@ import org.jboss.portal.Mode; import org.jboss.portal.WindowState; import org.jboss.portal.portlet.test.jsp.response.Chunk; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; = import java.util.Set; = @@ -42,6 +43,12 @@ private final String applicationName; = /** . */ + private final String windowId; + + /** . */ + private final PortletInvocationResponse response; + + /** . */ private final Mode initialMode; = /** . */ @@ -50,10 +57,19 @@ /** . */ private final Set supportedWindowStates; = - public StartPortletChunk(String portletName, String applicationName, Mo= de initialMode, Set supportedModes, Set supportedWindowS= tates) + public StartPortletChunk( + String portletName, + String applicationName, + String windowId, + PortletInvocationResponse response, + Mode initialMode, + Set supportedModes, + Set supportedWindowStates) { this.portletName =3D portletName; this.applicationName =3D applicationName; + this.windowId =3D windowId; + this.response =3D response; this.initialMode =3D initialMode; this.supportedModes =3D supportedModes; this.supportedWindowStates =3D supportedWindowStates; @@ -69,6 +85,16 @@ return applicationName; } = + public String getWindowId() + { + return windowId; + } + + public PortletInvocationResponse getResponse() + { + return response; + } + public Mode getInitialMode() { return initialMode; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-07 21:33:34 UTC (rev 9840) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-07 22:34:26 UTC (rev 9841) @@ -24,9 +24,27 @@ = import org.jboss.portal.portlet.test.jsp.response.portlet.StartPortletChun= k; import org.jboss.portal.portlet.test.jsp.response.portlet.EndPortletChunk; +import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; +import org.jboss.portal.portlet.test.jsp.PagePortletControllerContext; +import org.jboss.portal.portlet.test.controller.TestInstanceContext; +import org.jboss.portal.portlet.test.controller.TestPortalContext; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.RenderInvocation; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; +import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.impl.spi.AbstractClientContext; +import org.jboss.portal.portlet.impl.spi.AbstractServerContext; +import org.jboss.portal.portlet.impl.spi.AbstractUserContext; +import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; +import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; +import org.jboss.portal.portlet.spi.PortletInvocationContext; import org.jboss.portal.Mode; import org.jboss.portal.WindowState; import org.jboss.portal.common.util.Tools; +import org.jboss.portal.common.util.ParameterMap; = import javax.servlet.jsp.JspException; import java.io.IOException; @@ -114,6 +132,38 @@ = public int doStartTag() throws JspException { + + // + BufferingResponse response =3D (BufferingResponse)pageContext.getRes= ponse(); + StartPortletChunk chunk =3D render(response); + + // + try + { + pageContext.getOut().flush(); + } + catch (IOException e) + { + throw new JspException(e); + } + + // + addChunk(chunk); + + // + return EVAL_BODY_INCLUDE; + } + + public int doEndTag() throws JspException + { + addChunk(new EndPortletChunk()); + + // + return EVAL_PAGE; + } + + public StartPortletChunk render(BufferingResponse response) + { Set supportedModes =3D new LinkedHashSet(); if (supportedModeValues !=3D null) { @@ -151,32 +201,91 @@ } = // + PagePortletControllerContext context =3D response.getPortletControll= erContext(); + + // + Portlet portlet =3D context.findPortlet(applicationName, name); + + // + String windowId =3D portlet.getContext().getId() + "." + response.ne= xtId(); + PageNavigationalState pageNS =3D response.getPageState(); + + // + WindowNavigationalState windowNS =3D null; + if (pageNS !=3D null) + { + windowNS =3D pageNS.getWindowNavigationalState(windowId); + } + + // + ParameterMap publicNS =3D null; + if (pageNS !=3D null) + { + publicNS =3D pageNS.getPublicNavigationalState(windowId); + } + + // + Mode mode =3D Mode.VIEW; + WindowState windowState =3D WindowState.NORMAL; + StateString portletNS =3D null; + + // + if (windowNS !=3D null) + { + if (windowNS.getMode() !=3D null) + { + mode =3D windowNS.getMode(); + } + if (windowNS.getWindowState() !=3D null) + { + windowState =3D windowNS.getWindowState(); + } + if (windowNS.getPortletNavigationalState() !=3D null) + { + portletNS =3D windowNS.getPortletNavigationalState(); + } + } + + + // + PortletInvocationContext renderContext =3D context.createPortletInvo= cationContext(windowId, pageNS); + RenderInvocation render =3D new RenderInvocation(renderContext); + render.setClientContext(new AbstractClientContext(context.getClientR= equest())); + render.setServerContext(new AbstractServerContext(context.getClientR= equest(), context.getClientResponse())); + render.setInstanceContext(new TestInstanceContext(context.getClientR= equest(), portlet.getContext(), false)); + render.setUserContext(new AbstractUserContext(context.getClientReque= st())); + render.setWindowContext(new AbstractWindowContext(windowId)); + render.setPortalContext(new TestPortalContext()); + render.setSecurityContext(new AbstractSecurityContext(context.getCli= entRequest())); + render.setTarget(portlet.getContext()); + render.setMode(mode); + render.setWindowState(windowState); + render.setNavigationalState(portletNS); + render.setPublicNavigationalState(publicNS); + + // + PortletInvocationResponse portletResponse =3D null; try { - pageContext.getOut().flush(); + portletResponse =3D context.invoke(render); + + } - catch (IOException e) + catch (PortletInvokerException e) { - throw new JspException(e); + e.printStackTrace(); + + // todo } = // - addChunk(new StartPortletChunk( + return new StartPortletChunk( name, applicationName, + windowId, + portletResponse, initialMode, supportedModes, - supportedWindowStates)); - - // - return EVAL_BODY_INCLUDE; + supportedWindowStates); } - - public int doEndTag() throws JspException - { - addChunk(new EndPortletChunk()); - - // - return EVAL_PAGE; - } } --===============1660996087643396573==-- From portal-commits at lists.jboss.org Thu Feb 7 18:34:47 2008 Content-Type: multipart/mixed; boundary="===============8067131162679662602==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9842 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp: response and 2 other directories. Date: Thu, 07 Feb 2008 18:34:47 -0500 Message-ID: --===============8067131162679662602== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-07 18:34:46 -0500 (Thu, 07 Feb 2008) New Revision: 9842 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortalSimpleTagSupport.java Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/Page.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/Window.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/BytesChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/CharsChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/Chunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/EndPageChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/ResponseBuffer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/StartPageChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/portlet/EndPortletChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/portlet/PortletMarkupChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/portlet/PortletURLChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/portlet/StartPortletTitleChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/BodyChunkTagSupport.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/SimpleChunkTagSupport.java Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/BufferingResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/portlet/StartPortletChunk.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/AbstractURLTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PageTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletMarkupTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTitleTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletURLTag.java Log: remove the chunk junk Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-07 22:34:26 UTC (rev 9841) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-07 23:34:46 UTC (rev 9842) @@ -22,21 +22,10 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp; = -import org.jboss.portal.portlet.test.jsp.response.Chunk; -import org.jboss.portal.portlet.test.jsp.response.BytesChunk; -import org.jboss.portal.portlet.test.jsp.response.CharsChunk; -import org.jboss.portal.portlet.test.jsp.response.portlet.StartPortletChun= k; -import org.jboss.portal.portlet.test.jsp.response.portlet.PortletMarkupChu= nk; -import org.jboss.portal.portlet.test.jsp.response.portlet.StartPortletTitl= eChunk; -import org.jboss.portal.portlet.test.jsp.response.portlet.PortletURLChunk; -import org.jboss.portal.portlet.test.jsp.response.portlet.EndPortletChunk; import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; -import org.jboss.portal.portlet.test.jsp.response.ResponseBuffer; import org.jboss.portal.portlet.test.controller.PortletURLRenderer; import org.jboss.portal.portlet.PortletInvoker; import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.RenderURL; -import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.controller.PortletController; @@ -46,10 +35,7 @@ import org.jboss.portal.portlet.controller.response.PageUpdateResponse; import org.jboss.portal.portlet.controller.response.ResourceResponse; import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.controller.state.WindowNavigationalState; import org.jboss.portal.common.io.IOTools; -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; = import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -63,9 +49,6 @@ import javax.servlet.ServletContext; import java.io.IOException; import java.io.Writer; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.util.Map; = /** * @author Julien Viet @@ -228,20 +211,6 @@ = // chain.doFilter(req, bufferingResponse); - - // - ResponseBuffer buffer =3D bufferingResponse.getBuffer(); - buffer.close(); - - // - try - { - render(req, bufferingResponse); - } - catch (ClassNotFoundException e) - { - throw new ServletException(e); - } } = public void destroy() @@ -253,7 +222,7 @@ { = // - PagePortletControllerContext context =3D resp.getPortletControllerCo= ntext(); +// PagePortletControllerContext context =3D resp.getPortletController= Context(); = // = @@ -322,141 +291,5 @@ } } */ - - // -// Map responses =3D page.render(c= ontext, pageState); - - // - OutputStream out =3D resp.getResponse().getOutputStream(); - OutputStreamWriter writer =3D new OutputStreamWriter(out); - - // - StartPortletChunk startPortletChunk =3D null; - for (Chunk chunk : resp.getBuffer().getChunks()) - { - if (chunk instanceof BytesChunk) - { - BytesChunk bytesChunk =3D (BytesChunk)chunk; - out.write(bytesChunk.getBytes()); - out.flush(); - } - else if (chunk instanceof CharsChunk) - { - CharsChunk bytesChunk =3D (CharsChunk)chunk; - writer.write(bytesChunk.getChars()); - writer.flush(); - } - else if (chunk instanceof StartPortletChunk) - { - startPortletChunk =3D (StartPortletChunk)chunk; - } - else if (chunk instanceof StartPortletTitleChunk) - { - PortletInvocationResponse portletResponse =3D startPortletChun= k.getResponse(); - if (portletResponse !=3D null) - { - if (portletResponse instanceof FragmentResponse) - { - FragmentResponse fragment =3D (FragmentResponse)portletR= esponse; - writer.write(fragment.getTitle()); - writer.flush(); - } - } - } - else if (chunk instanceof PortletURLChunk) - { - final PortletURLChunk portletURL =3D (PortletURLChunk)chunk; - PortletInvocationResponse portletResponse =3D startPortletChun= k.getResponse(); - if (portletResponse !=3D null) - { - if (portletResponse instanceof FragmentResponse) - { - PortletURLRenderer renderer =3D new PortletURLRenderer( - (StateControllerContextImpl)context.getStateControlle= rContext(), - resp.getPageState(), - context.getClientRequest(), - context.getClientResponse()); - - RenderURL url =3D new RenderURL() - { - public StateString getNavigationalState() - { - return null; - } - - public Map getPublicNavigationalSta= teChanges() - { - return portletURL.getParams(); - } - - public Mode getMode() - { - return portletURL.getMode(); - } - - public WindowState getWindowState() - { - return portletURL.getWindowState(); - } - }; - - // - String renderedURL =3D renderer.renderURL(startPortletCh= unk.getWindowId(), url, null, null, true); - writer.write(renderedURL); - writer.flush(); - } - } - } - else if (chunk instanceof PortletMarkupChunk) - { - PortletInvocationResponse portletResponse =3D startPortletChun= k.getResponse(); - if (portletResponse !=3D null) - { - if (portletResponse instanceof FragmentResponse) - { - FragmentResponse fragment =3D (FragmentResponse)portletR= esponse; - WindowNavigationalState windowNS =3D null; - if (resp.getPageState() !=3D null) - { - windowNS =3D resp.getPageState().getWindowNavigationa= lState(startPortletChunk.getWindowId()); - } - if (windowNS =3D=3D null || !windowNS.getWindowState().e= quals(WindowState.MINIMIZED)) - { - if (fragment.getType() !=3D FragmentResponse.TYPE_EMP= TY) - { - String frag; - if (fragment.getType() =3D=3D FragmentResponse.TYP= E_BYTES) - { - frag =3D fragment.getBytes().toString(); - } - else - { - frag =3D fragment.getChars().toString(); - } - - // - writer.write(frag); - writer.flush(); - } - } - } - else - { - writer.write(portletResponse.getClass().getSimpleName() = + "[" + startPortletChunk.getPortletName() + "," + startPortletChunk.getApp= licationName() + "]"); - writer.flush(); - } - } - else - { - writer.write("Empty[" + startPortletChunk.getPortletName() = + "," + startPortletChunk.getApplicationName() + "]"); - writer.flush(); - } - } - else if (chunk instanceof EndPortletChunk) - { - startPortletChunk =3D null; - } - } - out.close(); } } Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/Page.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/Page.java 2008-02-07 22:34:26 UTC (rev 9841) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/Page.java 2008-02-07 23:34:46 UTC (rev 9842) @@ -1,101 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp; - -import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.controller.PortletControllerContext; -import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.test.jsp.response.Chunk; -import org.jboss.portal.portlet.test.jsp.response.portlet.StartPortletChun= k; - -import java.util.Map; -import java.util.HashMap; -import java.util.Collection; -import java.util.List; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class Page -{ - - /** . */ - private List chunks; - - /** . */ - private Map windows; - - public Page(List chunks, Map windows) - { - this.chunks =3D chunks; - this.windows =3D windows; - } - - public Collection getChunks() - { - return chunks; - } - - public Window getWindow(Chunk chunk) - { - return windows.get(chunk); - } - - public Window getWindow(String windowId) - { - for (Window window : windows.values()) - { - if (window.getId().equals(windowId)) - { - return window; - } - } - return null; - } - - public Collection getWindows() - { - return windows.values(); - } - - public Map render(PortletControllerC= ontext context, PageNavigationalState pageState) - { - Map responses =3D new HashMap(); - - // - for (Window window : windows.values()) - { - PortletInvocationResponse response =3D window.render(context, pag= eState); - - // - if (response !=3D null) - { - responses.put(window.getId(), response); - } - } - - // - return responses; - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/Window.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/Window.java 2008-02-07 22:34:26 UTC (rev 9841) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/Window.java 2008-02-07 23:34:46 UTC (rev 9842) @@ -1,137 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp; - -import org.jboss.portal.portlet.Portlet; -import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.test.controller.TestInstanceContext; -import org.jboss.portal.portlet.test.controller.TestPortalContext; -import org.jboss.portal.portlet.impl.spi.AbstractClientContext; -import org.jboss.portal.portlet.impl.spi.AbstractServerContext; -import org.jboss.portal.portlet.impl.spi.AbstractUserContext; -import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; -import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; -import org.jboss.portal.portlet.spi.PortletInvocationContext; -import org.jboss.portal.portlet.controller.PortletControllerContext; -import org.jboss.portal.portlet.controller.state.WindowNavigationalState; -import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.invocation.RenderInvocation; -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; -import org.jboss.portal.common.util.ParameterMap; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class Window -{ - - /** . */ - private final String id; - - /** . */ - private final Portlet portlet; - - public Window(String id, Portlet portlet) - { - this.id =3D id; - this.portlet =3D portlet; - } - - public String getId() - { - return id; - } - - public Portlet getPortlet() - { - return portlet; - } - - public PortletInvocationResponse render( - PortletControllerContext context, - PageNavigationalState pageState) - { - WindowNavigationalState windowNS =3D pageState.getWindowNavigational= State(id); - - // - Mode mode =3D Mode.VIEW; - WindowState windowState =3D WindowState.NORMAL; - StateString portletNS =3D null; - - // - if (windowNS !=3D null) - { - if (windowNS.getMode() !=3D null) - { - mode =3D windowNS.getMode(); - } - if (windowNS.getWindowState() !=3D null) - { - windowState =3D windowNS.getWindowState(); - } - if (windowNS.getPortletNavigationalState() !=3D null) - { - portletNS =3D windowNS.getPortletNavigationalState(); - } - } - - // - ParameterMap publicNS =3D pageState.getPublicNavigationalState(id); - - // - PortletInvocationContext renderContext =3D context.createPortletInvo= cationContext(id, pageState); - RenderInvocation render =3D new RenderInvocation(renderContext); - render.setClientContext(new AbstractClientContext(context.getClientR= equest())); - render.setServerContext(new AbstractServerContext(context.getClientR= equest(), context.getClientResponse())); - render.setInstanceContext(new TestInstanceContext(context.getClientR= equest(), portlet.getContext(), false)); - render.setUserContext(new AbstractUserContext(context.getClientReque= st())); - render.setWindowContext(new AbstractWindowContext(id)); - render.setPortalContext(new TestPortalContext()); - render.setSecurityContext(new AbstractSecurityContext(context.getCli= entRequest())); - render.setTarget(portlet.getContext()); - render.setMode(mode); - render.setWindowState(windowState); - render.setNavigationalState(portletNS); - render.setPublicNavigationalState(publicNS); - - // - try - { - return ((PagePortletControllerContext)context).invoke(render); - - } - catch (PortletInvokerException e) - { - e.printStackTrace(); - - // todo - - // - return null; - } - } -} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/response/BufferingResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/BufferingResponse.java 2008-02-07 22:34:26 UTC (rev 9841) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/BufferingResponse.java 2008-02-07 23:34:46 UTC (rev 9842) @@ -22,16 +22,13 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp.response; = -import org.jboss.portal.portlet.test.jsp.response.ResponseBuffer; -import org.jboss.portal.portlet.test.jsp.response.Chunk; import org.jboss.portal.portlet.test.jsp.PagePortletControllerContext; import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; +import org.jboss.portal.WindowState; = import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponseWrapper; -import javax.servlet.ServletOutputStream; -import java.io.IOException; -import java.io.PrintWriter; = /** * @author Julien Viet @@ -41,7 +38,7 @@ { = /** . */ - private final ResponseBuffer buffer =3D new ResponseBuffer(); +// private final ResponseBuffer buffer =3D new ResponseBuffer(); = /** . */ private final PagePortletControllerContext portletControllerContext; @@ -64,36 +61,83 @@ this.pageState =3D pageState; } = + /** + * The page state for the rendering. + * + * @return the page state + */ public PageNavigationalState getPageState() { return pageState; } = - public PagePortletControllerContext getPortletControllerContext() + public String getMaximizedWindowId() { - return portletControllerContext; - } + if (pageState !=3D null) + { + for (String windowId : pageState.getWindowIds()) + { + WindowNavigationalState windowNS =3D pageState.getWindowNaviga= tionalState(windowId); + if (WindowState.MAXIMIZED.equals(windowNS.getWindowState())) + { + return windowId; + } + } + } = - public ResponseBuffer getBuffer() - { - return buffer; + // + return null; } = - public ServletOutputStream getOutputStream() throws IOException + public boolean isRenderable(String windowId) { - return buffer.getOutputStream(); - } + if (windowId =3D=3D null) + { + throw new IllegalArgumentException(); + } = - public PrintWriter getWriter() throws IOException - { - return buffer.getWriter(); + // + if (pageState =3D=3D null) + { + return false; + } + + // + String maximizedWindowId =3D getMaximizedWindowId(); + if (maximizedWindowId !=3D null) + { + return maximizedWindowId.equals(windowId); + } + + // + return true; } = - public void close() + public PagePortletControllerContext getPortletControllerContext() { - buffer.close(); + return portletControllerContext; } = +// public ResponseBuffer getBuffer() +// { +// return buffer; +// } +// +// public ServletOutputStream getOutputStream() throws IOException +// { +// return buffer.getOutputStream(); +// } +// +// public PrintWriter getWriter() throws IOException +// { +// return buffer.getWriter(); +// } +// +// public void close() +// { +// buffer.close(); +// } + public String nextId() { return "" + count++; Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/response/BytesChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/BytesChunk.java 2008-02-07 22:34:26 UTC (rev 9841) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/BytesChunk.java 2008-02-07 23:34:46 UTC (rev 9842) @@ -1,44 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp.response; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class BytesChunk extends Chunk -{ - - /** . */ - private final byte[] bytes; - - public BytesChunk(byte[] bytes) - { - this.bytes =3D bytes; - } - - public byte[] getBytes() - { - return bytes; - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/response/CharsChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/CharsChunk.java 2008-02-07 22:34:26 UTC (rev 9841) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/CharsChunk.java 2008-02-07 23:34:46 UTC (rev 9842) @@ -1,44 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp.response; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class CharsChunk extends Chunk -{ - - /** . */ - private final char[] chars; - - public CharsChunk(char[] chars) - { - this.chars =3D chars; - } - - public char[] getChars() - { - return chars; - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/response/Chunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/Chunk.java 2008-02-07 22:34:26 UTC (rev 9841) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/Chunk.java 2008-02-07 23:34:46 UTC (rev 9842) @@ -1,34 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp.response; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class Chunk -{ - - = - -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/response/EndPageChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/EndPageChunk.java 2008-02-07 22:34:26 UTC (rev 9841) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/EndPageChunk.java 2008-02-07 23:34:46 UTC (rev 9842) @@ -1,33 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp.response; - -import org.jboss.portal.portlet.test.jsp.response.Chunk; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class EndPageChunk extends Chunk -{ -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/response/ResponseBuffer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/ResponseBuffer.java 2008-02-07 22:34:26 UTC (rev 9841) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/ResponseBuffer.java 2008-02-07 23:34:46 UTC (rev 9842) @@ -1,216 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp.response; - -import javax.servlet.ServletOutputStream; -import java.io.IOException; -import java.io.ByteArrayOutputStream; -import java.io.StringWriter; -import java.io.PrintWriter; -import java.util.LinkedList; -import java.util.List; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class ResponseBuffer -{ - - /** . */ - private final List chunks =3D new LinkedList(); - - /** . */ - private ChunkOutputStream chunkOutputStream; - - /** . */ - private ChunkWriter chunkWriter; - - /** . */ - private PrintWriter writer; - - /** . */ - private boolean muted; - - public boolean isMuted() - { - return muted; - } - - public void setMuted(boolean muted) - { - this.muted =3D muted; - } - - public List getChunks() - { - return chunks; - } - - public void flush() - { - if (chunkWriter !=3D null) - { - chunkWriter.writeChunk(); - } - else if (chunkOutputStream !=3D null) - { - chunkOutputStream.writeChunk(); - } - } - - public void close() - { - try - { - if (chunkWriter !=3D null) - { - chunkWriter.close(); - } - else if (chunkOutputStream !=3D null) - { - chunkOutputStream.close(); - } - } - catch (IOException e) - { - e.printStackTrace(); - } - } - - public ServletOutputStream getOutputStream() - { - if (chunkOutputStream =3D=3D null) - { - if (writer !=3D null) - { - throw new IllegalStateException(); - } - - // - chunkOutputStream =3D new ChunkOutputStream(); - } - - // - return chunkOutputStream; - } - - public PrintWriter getWriter() - { - if (chunkWriter =3D=3D null) - { - if (chunkOutputStream !=3D null) - { - throw new IllegalStateException(); - } - - // - chunkWriter =3D new ChunkWriter(); - writer =3D new PrintWriter(chunkWriter); - } - - // - return writer; - } - - public void addChunk(Chunk chunk) - { - if (chunkWriter !=3D null) - { - chunkWriter.writeChunk(); - } - else if (chunkOutputStream !=3D null) - { - chunkOutputStream.writeChunk(); - } - - // - chunks.add(chunk); - } - - private class ChunkWriter extends StringWriter - { - - public void writeChunk() - { - StringBuffer sb =3D getBuffer(); - if (sb.length() > 0) - { - if (!muted) - { - char[] chars =3D new char[sb.length()]; - sb.getChars(0, sb.length(), chars, 0); - CharsChunk chunk =3D new CharsChunk(chars); - chunks.add(chunk); - } - - // - sb.setLength(0); - } - } - - public void close() throws IOException - { - super.close(); - - // - writeChunk(); - } - } - - private class ChunkOutputStream extends ServletOutputStream - { - - /** . */ - private final ByteArrayOutputStream bytebuffer =3D new ByteArrayOutp= utStream(); - - public void write(int b) throws IOException - { - bytebuffer.write(b); - } - - public void writeChunk() - { - if (bytebuffer.size() > 0 && !muted) - { - if (!muted) - { - byte[] bytes =3D bytebuffer.toByteArray(); - BytesChunk chunk =3D new BytesChunk(bytes); - chunks.add(chunk); - } - - // - bytebuffer.reset(); - } - } - - public void close() throws IOException - { - super.close(); - - // - writeChunk(); - } - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/response/StartPageChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/StartPageChunk.java 2008-02-07 22:34:26 UTC (rev 9841) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/StartPageChunk.java 2008-02-07 23:34:46 UTC (rev 9842) @@ -1,33 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp.response; - -import org.jboss.portal.portlet.test.jsp.response.Chunk; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class StartPageChunk extends Chunk -{ -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/response/portlet/EndPortletChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/EndPortletChunk.java 2008-02-07 22:34:26 UTC (rev 9841) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/EndPortletChunk.java 2008-02-07 23:34:46 UTC (rev 9842) @@ -1,33 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp.response.portlet; - -import org.jboss.portal.portlet.test.jsp.response.Chunk; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class EndPortletChunk extends Chunk -{ -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/response/portlet/PortletMarkupChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/PortletMarkupChunk.java 2008-02-07 22:34:26 UTC (rev 9= 841) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/PortletMarkupChunk.java 2008-02-07 23:34:46 UTC (rev 9= 842) @@ -1,33 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp.response.portlet; - -import org.jboss.portal.portlet.test.jsp.response.Chunk; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class PortletMarkupChunk extends Chunk -{ -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/response/portlet/PortletURLChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/PortletURLChunk.java 2008-02-07 22:34:26 UTC (rev 9841) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/PortletURLChunk.java 2008-02-07 23:34:46 UTC (rev 9842) @@ -1,68 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp.response.portlet; - -import org.jboss.portal.portlet.test.jsp.response.Chunk; -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; - -import java.util.Map; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class PortletURLChunk extends Chunk -{ - - /** . */ - private final Mode mode; - - /** . */ - private final WindowState windowState; - - /** . */ - private final Map params; - - public PortletURLChunk(Mode mode, WindowState windowState, Map params) - { - this.mode =3D mode; - this.windowState =3D windowState; - this.params =3D params; - } - - public Mode getMode() - { - return mode; - } - - public WindowState getWindowState() - { - return windowState; - } - - public Map getParams() - { - return params; - } -} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/response/portlet/StartPortletChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/StartPortletChunk.java 2008-02-07 22:34:26 UTC (rev 98= 41) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/StartPortletChunk.java 2008-02-07 23:34:46 UTC (rev 98= 42) @@ -24,7 +24,6 @@ = import org.jboss.portal.Mode; import org.jboss.portal.WindowState; -import org.jboss.portal.portlet.test.jsp.response.Chunk; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; = import java.util.Set; @@ -33,7 +32,7 @@ * @author Julien Viet * @version $Revision: 630 $ */ -public class StartPortletChunk extends Chunk +public class StartPortletChunk { = /** . */ Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/response/portlet/StartPortletTitleChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/StartPortletTitleChunk.java 2008-02-07 22:34:26 UTC (r= ev 9841) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/StartPortletTitleChunk.java 2008-02-07 23:34:46 UTC (r= ev 9842) @@ -1,33 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp.response.portlet; - -import org.jboss.portal.portlet.test.jsp.response.Chunk; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class StartPortletTitleChunk extends Chunk -{ -} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/AbstractURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/AbstractURLTag.java 2008-02-07 22:34:26 UTC (rev 9841) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/AbstractURLTag.java 2008-02-07 23:34:46 UTC (rev 9842) @@ -23,6 +23,7 @@ package org.jboss.portal.portlet.test.jsp.taglib; = import javax.servlet.jsp.JspException; +import javax.servlet.jsp.tagext.BodyTagSupport; import java.util.Map; import java.util.HashMap; = @@ -30,22 +31,17 @@ * @author Julien Viet * @version $Revision: 630 $ */ -public class AbstractURLTag extends BodyChunkTagSupport +public class AbstractURLTag extends BodyTagSupport { = /** . */ - private Map params =3D new HashMap(= ); + protected Map params =3D new HashMap(); = public void setParam(String name, String value) { params.put(name, new String[]{value}); } = - public Map getParams() - { - return new HashMap(params); - } - public void doInitBody() throws JspException { params.clear(); Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/taglib/BodyChunkTagSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/BodyChunkTagSupport.java 2008-02-07 22:34:26 UTC (rev 9841) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/BodyChunkTagSupport.java 2008-02-07 23:34:46 UTC (rev 9842) @@ -1,75 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp.taglib; - -import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; -import org.jboss.portal.portlet.test.jsp.response.Chunk; -import org.jboss.portal.portlet.test.jsp.response.ResponseBuffer; - -import javax.servlet.jsp.tagext.BodyTagSupport; -import javax.servlet.jsp.JspException; -import java.io.IOException; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class BodyChunkTagSupport extends BodyTagSupport -{ - - protected final ResponseBuffer getBuffer() - { - BufferingResponse response =3D (BufferingResponse)pageContext.getRes= ponse(); - return response.getBuffer(); - } - - protected void mute(boolean on) throws JspException - { - try - { - pageContext.getOut().flush(); - BufferingResponse response =3D (BufferingResponse)pageContext.get= Response(); - ResponseBuffer buffer =3D response.getBuffer(); - buffer.flush(); - buffer.setMuted(on); - } - catch (IOException e) - { - throw new JspException(e); - } - } - - protected final void addChunk(Chunk chunk) throws JspException - { - try - { - pageContext.getOut().flush(); - BufferingResponse response =3D (BufferingResponse)pageContext.get= Response(); - response.getBuffer().addChunk(chunk); - } - catch (IOException e) - { - throw new JspException(e); - } - } -} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PageTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageTag.java 2008-02-07 22:34:26 UTC (rev 9841) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageTag.java 2008-02-07 23:34:46 UTC (rev 9842) @@ -22,30 +22,24 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp.taglib; = -import org.jboss.portal.portlet.test.jsp.response.StartPageChunk; -import org.jboss.portal.portlet.test.jsp.response.EndPageChunk; - import javax.servlet.jsp.JspException; +import javax.servlet.jsp.tagext.BodyTagSupport; = /** * @author Julien Viet * @version $Revision: 630 $ */ -public class PageTag extends BodyChunkTagSupport +public class PageTag extends BodyTagSupport { = public int doStartTag() throws JspException { - addChunk(new StartPageChunk()); - // return EVAL_BODY_INCLUDE; } = public int doEndTag() throws JspException { - addChunk(new EndPageChunk()); - // return EVAL_PAGE; } Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/taglib/PortalSimpleTagSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalSimpleTagSupport.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalSimpleTagSupport.java 2008-02-07 23:34:46 UTC (rev 9842) @@ -0,0 +1,41 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.taglib; + +import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; + +import javax.servlet.jsp.tagext.SimpleTagSupport; +import javax.servlet.jsp.PageContext; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortalSimpleTagSupport extends SimpleTagSupport +{ + protected final BufferingResponse getPortalResponse() + { + PageContext pageContext =3D (PageContext)getJspContext(); + return (BufferingResponse)pageContext.getResponse(); + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletMarkupTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletMarkupTag.java 2008-02-07 22:34:26 UTC (rev 9841) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletMarkupTag.java 2008-02-07 23:34:46 UTC (rev 9842) @@ -22,17 +22,72 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp.taglib; = -import org.jboss.portal.portlet.test.jsp.response.Chunk; -import org.jboss.portal.portlet.test.jsp.response.portlet.PortletMarkupChu= nk; +import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.response.FragmentResponse; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; +import org.jboss.portal.WindowState; = +import javax.servlet.jsp.tagext.SimpleTagSupport; +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.JspWriter; +import java.io.IOException; + /** * @author Julien Viet * @version $Revision: 630 $ */ -public class PortletMarkupTag extends SimpleChunkTagSupport +public class PortletMarkupTag extends PortalSimpleTagSupport { - protected Chunk doChunkTag() + public void doTag() throws JspException, IOException { - return new PortletMarkupChunk(); + + BufferingResponse resp =3D getPortalResponse(); + + PortletTag portletTag =3D (PortletTag)SimpleTagSupport.findAncestorW= ithClass(this, PortletTag.class); + + PortletInvocationResponse portletResp =3D portletTag.chunk.getRespon= se(); + + JspWriter out =3D getJspContext().getOut(); + + if (portletResp !=3D null) + { + if (portletResp instanceof FragmentResponse) + { + FragmentResponse fragment =3D (FragmentResponse)portletResp; + WindowNavigationalState windowNS =3D null; + if (resp.getPageState() !=3D null) + { + windowNS =3D resp.getPageState().getWindowNavigationalState= (portletTag.chunk.getWindowId()); + } + if (windowNS =3D=3D null || !windowNS.getWindowState().equals(= WindowState.MINIMIZED)) + { + if (fragment.getType() !=3D FragmentResponse.TYPE_EMPTY) + { + String frag; + if (fragment.getType() =3D=3D FragmentResponse.TYPE_BYTE= S) + { + frag =3D fragment.getBytes().toString(); + } + else + { + frag =3D fragment.getChars().toString(); + } + + out.write(frag); + } + } + } + else + { + out.write(portletResp.getClass().getSimpleName() + "[" + portl= etTag.chunk.getPortletName() + "," + portletTag.chunk.getApplicationName() = + "]"); + out.flush(); + } + } + else + { + out.write("Empty[" + portletTag.chunk.getPortletName() + "," + po= rtletTag.chunk.getApplicationName() + "]"); + out.flush(); + } } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-07 22:34:26 UTC (rev 9841) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-07 23:34:46 UTC (rev 9842) @@ -23,7 +23,6 @@ package org.jboss.portal.portlet.test.jsp.taglib; = import org.jboss.portal.portlet.test.jsp.response.portlet.StartPortletChun= k; -import org.jboss.portal.portlet.test.jsp.response.portlet.EndPortletChunk; import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; import org.jboss.portal.portlet.test.jsp.PagePortletControllerContext; import org.jboss.portal.portlet.test.controller.TestInstanceContext; @@ -47,7 +46,7 @@ import org.jboss.portal.common.util.ParameterMap; = import javax.servlet.jsp.JspException; -import java.io.IOException; +import javax.servlet.jsp.tagext.BodyTagSupport; import java.util.LinkedHashSet; import java.util.Set; import java.util.Collections; @@ -56,7 +55,7 @@ * @author Julien Viet * @version $Revision: 630 $ */ -public class PortletTag extends BodyChunkTagSupport +public class PortletTag extends BodyTagSupport { = /** . */ @@ -130,35 +129,21 @@ this.initialModeValue =3D initialMode; } = + StartPortletChunk chunk; + public int doStartTag() throws JspException { - - // BufferingResponse response =3D (BufferingResponse)pageContext.getRes= ponse(); - StartPortletChunk chunk =3D render(response); - + = // - try - { - pageContext.getOut().flush(); - } - catch (IOException e) - { - throw new JspException(e); - } + chunk =3D render(response); = // - addChunk(chunk); - - // return EVAL_BODY_INCLUDE; } = public int doEndTag() throws JspException { - addChunk(new EndPortletChunk()); - - // return EVAL_PAGE; } = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTitleTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTitleTag.java 2008-02-07 22:34:26 UTC (rev 9841) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTitleTag.java 2008-02-07 23:34:46 UTC (rev 9842) @@ -22,17 +22,34 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp.taglib; = -import org.jboss.portal.portlet.test.jsp.response.Chunk; -import org.jboss.portal.portlet.test.jsp.response.portlet.StartPortletTitl= eChunk; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.response.FragmentResponse; = +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.JspWriter; +import javax.servlet.jsp.tagext.SimpleTagSupport; +import java.io.IOException; + /** * @author Julien Viet * @version $Revision: 630 $ */ -public class PortletTitleTag extends SimpleChunkTagSupport +public class PortletTitleTag extends PortalSimpleTagSupport { - protected Chunk doChunkTag() + + public void doTag() throws JspException, IOException { - return new StartPortletTitleChunk(); + + PortletTag portletTag =3D (PortletTag)SimpleTagSupport.findAncestorW= ithClass(this, PortletTag.class); + + PortletInvocationResponse portletResp =3D portletTag.chunk.getRespon= se(); + + JspWriter out =3D getJspContext().getOut(); + + if (portletResp instanceof FragmentResponse) + { + FragmentResponse fragment =3D (FragmentResponse)portletResp; + out.write(fragment.getTitle()); + } } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-07 22:34:26 UTC (rev 9841) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-07 23:34:46 UTC (rev 9842) @@ -24,9 +24,19 @@ = import org.jboss.portal.Mode; import org.jboss.portal.WindowState; -import org.jboss.portal.portlet.test.jsp.response.portlet.PortletURLChunk; +import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; +import org.jboss.portal.portlet.test.jsp.PagePortletControllerContext; +import org.jboss.portal.portlet.test.controller.PortletURLRenderer; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; +import org.jboss.portal.portlet.RenderURL; +import org.jboss.portal.portlet.StateString; = import javax.servlet.jsp.JspException; +import javax.servlet.jsp.JspWriter; +import javax.servlet.jsp.tagext.SimpleTagSupport; +import java.util.Map; +import java.io.IOException; = /** * @author Julien Viet @@ -63,20 +73,24 @@ = public int doStartTag() throws JspException { - mute(true); - - // return EVAL_BODY_BUFFERED; } = public int doEndTag() throws JspException { + BufferingResponse response =3D (BufferingResponse)pageContext.getRes= ponse(); + PagePortletControllerContext context =3D response.getPortletControll= erContext(); + PortletTag portletTag =3D (PortletTag)SimpleTagSupport.findAncestorW= ithClass(this, PortletTag.class); + Mode mode =3D null; if (modeValue !=3D null) { mode =3D Mode.create(modeValue.trim()); } = + PortletInvocationResponse portletResp =3D portletTag.chunk.getRespon= se(); + + // WindowState windowState =3D null; if (windowStateValue !=3D null) @@ -84,13 +98,53 @@ windowState =3D WindowState.create(windowStateValue.trim()); } = - // - addChunk(new PortletURLChunk(mode, windowState, getParams())); + PortletURLRenderer renderer =3D new PortletURLRenderer( + (StateControllerContextImpl)context.getStateControllerContext(), + response.getPageState(), + context.getClientRequest(), + context.getClientResponse()); = - // - mute(false); + final WindowState ws =3D windowState; + final Mode md =3D mode; = + RenderURL url =3D new RenderURL() + { + + + public StateString getNavigationalState() + { + return null; + } + + public Map getPublicNavigationalStateChanges() + { + return params; + } + + public Mode getMode() + { + return md; + } + + public WindowState getWindowState() + { + return ws; + } + }; + + try + { + JspWriter out =3D pageContext.getOut(); + String renderedURL =3D renderer.renderURL(portletTag.chunk.getWin= dowId(), url, null, null, true); + out.write(renderedURL); + } + catch (IOException e) + { + throw new JspException(e); + } + // return EVAL_PAGE; } + } Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/taglib/SimpleChunkTagSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/SimpleChunkTagSupport.java 2008-02-07 22:34:26 UTC (rev 9841) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/SimpleChunkTagSupport.java 2008-02-07 23:34:46 UTC (rev 9842) @@ -1,56 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp.taglib; - -import org.jboss.portal.portlet.test.jsp.response.Chunk; -import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; - -import javax.servlet.jsp.tagext.SimpleTagSupport; -import javax.servlet.jsp.JspException; -import javax.servlet.jsp.PageContext; -import java.io.IOException; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public abstract class SimpleChunkTagSupport extends SimpleTagSupport -{ - - public final void doTag() throws JspException, IOException - { - Chunk chunk =3D doChunkTag(); - - // - if (chunk !=3D null) - { - PageContext pageCtx =3D (PageContext)getJspContext(); - pageCtx.getOut().flush(); - BufferingResponse response =3D (BufferingResponse)pageCtx.getResp= onse(); - response.getBuffer().addChunk(chunk); - } - } - - protected abstract Chunk doChunkTag(); - -} --===============8067131162679662602==-- From portal-commits at lists.jboss.org Thu Feb 7 18:42:17 2008 Content-Type: multipart/mixed; boundary="===============6852198828506213117==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9843 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp: taglib and 1 other directory. Date: Thu, 07 Feb 2008 18:42:17 -0500 Message-ID: --===============6852198828506213117== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-07 18:42:16 -0500 (Thu, 07 Feb 2008) New Revision: 9843 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletResult.java Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortalSimpleTagSupport.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletMarkupTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTitleTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletURLTag.java Log: rename old classes to new classes (concepts) Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-07 23:34:46 UTC (rev 9842) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-07 23:42:16 UTC (rev 9843) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp; = -import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; +import org.jboss.portal.portlet.test.jsp.PortalResponse; import org.jboss.portal.portlet.test.controller.PortletURLRenderer; import org.jboss.portal.portlet.PortletInvoker; import org.jboss.portal.portlet.PortletInvokerException; @@ -207,10 +207,10 @@ } = // - BufferingResponse bufferingResponse =3D new BufferingResponse(resp, = context, pageState); + PortalResponse portalResponse =3D new PortalResponse(resp, context, = pageState); = // - chain.doFilter(req, bufferingResponse); + chain.doFilter(req, portalResponse); } = public void destroy() @@ -218,7 +218,7 @@ this.config =3D null; } = - protected void render(HttpServletRequest req, BufferingResponse resp) t= hrows ServletException, IOException, ClassNotFoundException + protected void render(HttpServletRequest req, PortalResponse resp) thro= ws ServletException, IOException, ClassNotFoundException { = // Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/jsp/PortalResponse.java (from rev 9842, modules/portlet/trunk/test/src/= main/java/org/jboss/portal/portlet/test/jsp/response/BufferingResponse.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalResponse.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalResponse.java 2008-02-07 23:42:16 UTC (rev 9843) @@ -0,0 +1,145 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp; + +import org.jboss.portal.portlet.test.jsp.PagePortletControllerContext; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; +import org.jboss.portal.WindowState; + +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpServletResponseWrapper; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortalResponse extends HttpServletResponseWrapper +{ + + /** . */ +// private final ResponseBuffer buffer =3D new ResponseBuffer(); + + /** . */ + private final PagePortletControllerContext portletControllerContext; + + /** . */ + private final PageNavigationalState pageState; + + /** . */ + private int count =3D 0; + + public PortalResponse( + HttpServletResponse response, + PagePortletControllerContext portletControllerContext, + PageNavigationalState pageState) + { + super(response); + + // + this.portletControllerContext =3D portletControllerContext; + this.pageState =3D pageState; + } + + /** + * The page state for the rendering. + * + * @return the page state + */ + public PageNavigationalState getPageState() + { + return pageState; + } + + public String getMaximizedWindowId() + { + if (pageState !=3D null) + { + for (String windowId : pageState.getWindowIds()) + { + WindowNavigationalState windowNS =3D pageState.getWindowNaviga= tionalState(windowId); + if (WindowState.MAXIMIZED.equals(windowNS.getWindowState())) + { + return windowId; + } + } + } + + // + return null; + } + + public boolean isRenderable(String windowId) + { + if (windowId =3D=3D null) + { + throw new IllegalArgumentException(); + } + + // + if (pageState =3D=3D null) + { + return false; + } + + // + String maximizedWindowId =3D getMaximizedWindowId(); + if (maximizedWindowId !=3D null) + { + return maximizedWindowId.equals(windowId); + } + + // + return true; + } + + public PagePortletControllerContext getPortletControllerContext() + { + return portletControllerContext; + } + +// public ResponseBuffer getBuffer() +// { +// return buffer; +// } +// +// public ServletOutputStream getOutputStream() throws IOException +// { +// return buffer.getOutputStream(); +// } +// +// public PrintWriter getWriter() throws IOException +// { +// return buffer.getWriter(); +// } +// +// public void close() +// { +// buffer.close(); +// } + + public String nextId() + { + return "" + count++; + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortalSimpleTagSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalSimpleTagSupport.java 2008-02-07 23:34:46 UTC (rev 9842) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalSimpleTagSupport.java 2008-02-07 23:42:16 UTC (rev 9843) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp.taglib; = -import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; +import org.jboss.portal.portlet.test.jsp.PortalResponse; = import javax.servlet.jsp.tagext.SimpleTagSupport; import javax.servlet.jsp.PageContext; @@ -33,9 +33,9 @@ */ public class PortalSimpleTagSupport extends SimpleTagSupport { - protected final BufferingResponse getPortalResponse() + protected final PortalResponse getPortalResponse() { PageContext pageContext =3D (PageContext)getJspContext(); - return (BufferingResponse)pageContext.getResponse(); + return (PortalResponse)pageContext.getResponse(); } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletMarkupTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletMarkupTag.java 2008-02-07 23:34:46 UTC (rev 9842) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletMarkupTag.java 2008-02-07 23:42:16 UTC (rev 9843) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp.taglib; = -import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; +import org.jboss.portal.portlet.test.jsp.PortalResponse; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; @@ -42,11 +42,11 @@ public void doTag() throws JspException, IOException { = - BufferingResponse resp =3D getPortalResponse(); + PortalResponse resp =3D getPortalResponse(); = PortletTag portletTag =3D (PortletTag)SimpleTagSupport.findAncestorW= ithClass(this, PortletTag.class); = - PortletInvocationResponse portletResp =3D portletTag.chunk.getRespon= se(); + PortletInvocationResponse portletResp =3D portletTag.result.getRespo= nse(); = JspWriter out =3D getJspContext().getOut(); = @@ -58,7 +58,7 @@ WindowNavigationalState windowNS =3D null; if (resp.getPageState() !=3D null) { - windowNS =3D resp.getPageState().getWindowNavigationalState= (portletTag.chunk.getWindowId()); + windowNS =3D resp.getPageState().getWindowNavigationalState= (portletTag.result.getWindowId()); } if (windowNS =3D=3D null || !windowNS.getWindowState().equals(= WindowState.MINIMIZED)) { @@ -80,13 +80,13 @@ } else { - out.write(portletResp.getClass().getSimpleName() + "[" + portl= etTag.chunk.getPortletName() + "," + portletTag.chunk.getApplicationName() = + "]"); + out.write(portletResp.getClass().getSimpleName() + "[" + portl= etTag.result.getPortletName() + "," + portletTag.result.getApplicationName(= ) + "]"); out.flush(); } } else { - out.write("Empty[" + portletTag.chunk.getPortletName() + "," + po= rtletTag.chunk.getApplicationName() + "]"); + out.write("Empty[" + portletTag.result.getPortletName() + "," + p= ortletTag.result.getApplicationName() + "]"); out.flush(); } } Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/jsp/taglib/PortletResult.java (from rev 9842, modules/portlet/trunk/tes= t/src/main/java/org/jboss/portal/portlet/test/jsp/response/portlet/StartPor= tletChunk.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletResult.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletResult.java 2008-02-07 23:42:16 UTC (rev 9843) @@ -0,0 +1,114 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.taglib; + +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; + +import java.util.Set; + +/** + * Combines the invocation of a portlet and the info on the portlet JSP ta= g. It does + * not need to be exposed out of this package. + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +class PortletResult +{ + + /** . */ + private final String portletName; + + /** . */ + private final String applicationName; + + /** . */ + private final String windowId; + + /** . */ + private final PortletInvocationResponse response; + + /** . */ + private final Mode initialMode; + + /** . */ + private final Set supportedModes; + + /** . */ + private final Set supportedWindowStates; + + public PortletResult( + String portletName, + String applicationName, + String windowId, + PortletInvocationResponse response, + Mode initialMode, + Set supportedModes, + Set supportedWindowStates) + { + this.portletName =3D portletName; + this.applicationName =3D applicationName; + this.windowId =3D windowId; + this.response =3D response; + this.initialMode =3D initialMode; + this.supportedModes =3D supportedModes; + this.supportedWindowStates =3D supportedWindowStates; + } + + public String getPortletName() + { + return portletName; + } + + public String getApplicationName() + { + return applicationName; + } + + public String getWindowId() + { + return windowId; + } + + public PortletInvocationResponse getResponse() + { + return response; + } + + public Mode getInitialMode() + { + return initialMode; + } + + public Set getSupportedModes() + { + return supportedModes; + } + + public Set getSupportedWindowStates() + { + return supportedWindowStates; + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-07 23:34:46 UTC (rev 9842) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-07 23:42:16 UTC (rev 9843) @@ -22,8 +22,8 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp.taglib; = -import org.jboss.portal.portlet.test.jsp.response.portlet.StartPortletChun= k; -import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; +import org.jboss.portal.portlet.test.jsp.taglib.PortletResult; +import org.jboss.portal.portlet.test.jsp.PortalResponse; import org.jboss.portal.portlet.test.jsp.PagePortletControllerContext; import org.jboss.portal.portlet.test.controller.TestInstanceContext; import org.jboss.portal.portlet.test.controller.TestPortalContext; @@ -129,14 +129,14 @@ this.initialModeValue =3D initialMode; } = - StartPortletChunk chunk; + PortletResult result; = public int doStartTag() throws JspException { - BufferingResponse response =3D (BufferingResponse)pageContext.getRes= ponse(); + PortalResponse response =3D (PortalResponse)pageContext.getResponse(= ); = // - chunk =3D render(response); + result =3D render(response); = // return EVAL_BODY_INCLUDE; @@ -147,7 +147,7 @@ return EVAL_PAGE; } = - public StartPortletChunk render(BufferingResponse response) + public PortletResult render(PortalResponse response) { Set supportedModes =3D new LinkedHashSet(); if (supportedModeValues !=3D null) @@ -264,7 +264,7 @@ } = // - return new StartPortletChunk( + return new PortletResult( name, applicationName, windowId, Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTitleTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTitleTag.java 2008-02-07 23:34:46 UTC (rev 9842) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTitleTag.java 2008-02-07 23:42:16 UTC (rev 9843) @@ -42,7 +42,7 @@ = PortletTag portletTag =3D (PortletTag)SimpleTagSupport.findAncestorW= ithClass(this, PortletTag.class); = - PortletInvocationResponse portletResp =3D portletTag.chunk.getRespon= se(); + PortletInvocationResponse portletResp =3D portletTag.result.getRespo= nse(); = JspWriter out =3D getJspContext().getOut(); = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-07 23:34:46 UTC (rev 9842) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-07 23:42:16 UTC (rev 9843) @@ -24,7 +24,7 @@ = import org.jboss.portal.Mode; import org.jboss.portal.WindowState; -import org.jboss.portal.portlet.test.jsp.response.BufferingResponse; +import org.jboss.portal.portlet.test.jsp.PortalResponse; import org.jboss.portal.portlet.test.jsp.PagePortletControllerContext; import org.jboss.portal.portlet.test.controller.PortletURLRenderer; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; @@ -78,7 +78,7 @@ = public int doEndTag() throws JspException { - BufferingResponse response =3D (BufferingResponse)pageContext.getRes= ponse(); + PortalResponse response =3D (PortalResponse)pageContext.getResponse(= ); PagePortletControllerContext context =3D response.getPortletControll= erContext(); PortletTag portletTag =3D (PortletTag)SimpleTagSupport.findAncestorW= ithClass(this, PortletTag.class); = @@ -88,9 +88,6 @@ mode =3D Mode.create(modeValue.trim()); } = - PortletInvocationResponse portletResp =3D portletTag.chunk.getRespon= se(); - - // WindowState windowState =3D null; if (windowStateValue !=3D null) @@ -135,7 +132,7 @@ try { JspWriter out =3D pageContext.getOut(); - String renderedURL =3D renderer.renderURL(portletTag.chunk.getWin= dowId(), url, null, null, true); + String renderedURL =3D renderer.renderURL(portletTag.result.getWi= ndowId(), url, null, null, true); out.write(renderedURL); } catch (IOException e) --===============6852198828506213117==-- From portal-commits at lists.jboss.org Thu Feb 7 18:42:33 2008 Content-Type: multipart/mixed; boundary="===============7664424009820635508==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9844 - in modules/portlet/trunk/test/src/test/resources/simple-portal-war: WEB-INF and 5 other directories. Date: Thu, 07 Feb 2008 18:42:33 -0500 Message-ID: --===============7664424009820635508== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-07 18:42:33 -0500 (Thu, 07 Feb 2008) New Revision: 9844 Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= tags/ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= tags/portal/ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= tags/portal/portlet.tag modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/ modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mast= er.css modules/portlet/trunk/test/src/test/resources/simple-portal-war/images/ modules/portlet/trunk/test/src/test/resources/simple-portal-war/images/a= ctive-button-bg.gif modules/portlet/trunk/test/src/test/resources/simple-portal-war/images/i= con-maximize.gif modules/portlet/trunk/test/src/test/resources/simple-portal-war/images/i= con-minimize.gif modules/portlet/trunk/test/src/test/resources/simple-portal-war/images/i= con-normal.gif modules/portlet/trunk/test/src/test/resources/simple-portal-war/images/i= nactive-button-bg.gif modules/portlet/trunk/test/src/test/resources/simple-portal-war/images/l= ogo-header.gif modules/portlet/trunk/test/src/test/resources/simple-portal-war/images/n= av-bg.gif modules/portlet/trunk/test/src/test/resources/simple-portal-war/images/p= c20.gif modules/portlet/trunk/test/src/test/resources/simple-portal-war/images/p= ortal-bg.gif modules/portlet/trunk/test/src/test/resources/simple-portal-war/images/p= ortlet-title-rt-bg.gif modules/portlet/trunk/test/src/test/resources/simple-portal-war/images/p= ortlet-titlebg.gif modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= default.jsp Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.jsp Log: Initial layout Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-= INF/tags/portal/portlet.tag =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /tags/portal/portlet.tag (rev 0) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /tags/portal/portlet.tag 2008-02-07 23:42:33 UTC (rev 9844) @@ -0,0 +1,29 @@ +<%@ tag body-content=3D"scriptless" %> +<%@ attribute name=3D"name" required=3D"true" %> +<%@ attribute name=3D"applicationName" required=3D"true" %> +<%@ attribute name=3D"content" fragment=3D"true" required=3D"false" %> = +<%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> + + +
    +
    +
    +
    +
    =
    +
    + "> + ">3D""/ + "> + ">= Edit +
    +
    +
    + + + + +
    +
    +
    \ No newline at end of file Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/= master.css =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css (rev 0) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-07 23:42:33 UTC (rev 9844) @@ -0,0 +1,235 @@ +body { + font: normal 12px Lucida Sans, Trebuchet, tahoma, sans-serif; +} + +.align-center { + text-align: center; +} + +.align-left { + text-align: left; +} + +.align-center-margin { + margin: 0 auto 0 auto; +} + +.float-left { + float: left; +} + +.float-right { + float: right; +} + +.align-left { + text-align: left; +} + +.align-right { + text-align: right; +} + +.half-width { + width: 49%; +} + +.quarter-width { + width: 24.9%; +} + +.three-quarter-width { + width: 74.9%; +} + +.full-width { + width: 100%; +} + +.third-width { + width: 32.9%; +} + +.two-third-width { + width: 65.5%; +} + +.tenpx-top-bottom { + margin: 10px 0 10px 0; +} + +.relative { + position: relative +} + +.absolute { + position: absolute +} + +p.white-padded { + color: #fff; + padding: 5px; +} + +.clear { + clear: both; +} + +img { + margin: 0; + padding: 0; + border: 0; +} + +body, +div, +form, +ul, +li { + margin: 0; + padding: 0; +} + +ul { + +} + +/*--------------------------------Decoration*/ + +h2 { + font-size: 1.9em; + color: #fff; + margin: 0; + padding: 0; +} + +h3 { + font-size: 1.0em; + color: #fff; + margin: 0; + padding: 0; +} + +a { + color: #e1d77e; +} + +p { + margin: 0; + padding: 0; +} + + +/*-------------------------------Container Decoration*/ + +div#container>div.header { + height: 40px; + background-color: #000; +} + +div#container div.header div.logo { + background-image: url( /simple/images/logo-header.gif ); + background-repeat: no-repeat; + background-position: top left; + height:40px; +} + +div#container div.header div.pc20 { + text-align: right; +} + +div#container div.header div.pc20 img { + margin: 5px 10px 0 0; +} + +div#container div.nav { + background-image: url( /simple/images/nav-bg.gif ); + background-repeat: repeat-x; + background-position: top left; + border-top: 1px solid #878787; + border-bottom: 1px solid #383838; + height:23px; +} + +div#container div.nav ul { + height:23px; + margin: 0 0 0 10px; +} + +div#container div.nav ul li { + display: inline; + float: left; + text-align: center; + height: 21px; + border: 1px solid #929292; +} + +div#container div.nav ul li a, +div#container div.nav ul li a:hover { + display: block; + padding: 4px 12px 4px 12px; + background-repeat: repeat-x; + background-position: top left; + text-decoration:none; + font: bold 11px Lucida Sans, Trebuchet, tahoma, sans-serif; +} + +div#container div.nav ul li a{ + color: #353535; + background-image: url( /simple/images/inactive-button-bg.gif ); +} + +div#container div.nav ul li a:hover, +div#container div.nav ul li a.selected{ + color: #000; + background-image: url( /simple/images/active-button-bg.gif ); +} + +div#container div#content { + background-image: url( /simple/images/portal-bg.gif ); + background-repeat: repeat-x; + background-position: top left; + min-height: 600px; + padding: 10px; +} + +/*-------------------------------Portlet Decoration*/ + +div#container div#content div.portlet{ + /*width: 800px;*/ + border: 1px solid #969696; + background-color: #e2e2e2; + padding: 2px; + float:left; +} + +div#container div#content div.portlet-frame{ + background-color: #fff; + border: 1px solid #fff; + /*height: 500px;*/ +} + +div#container div#content div.portlet div.header { + background-image: url( /simple/images/portlet-titlebg.gif ); + background-repeat: repeat-x; + background-position: top left; + height:20px; +} + +div#container div#content div.portlet div.header div.header-layer { + background-image: url( /simple/images/portlet-title-rt-bg.gif ); + background-repeat: no-repeat; + background-position: top right; + height:20px; +} + +div#container div#content div.portlet div.header div.header-layer div.titl= e{ + font: bold 12px Lucida Sans, Trebuchet, tahoma, sans-serif; + color: #fff; + padding: 2px; +} + +div#container div#content div.portlet div.header div.header-layer div.cont= rols{ + text-align: right; + padding: 3px 3px 0 0; +} \ No newline at end of file Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/imag= es/active-button-bg.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/test/src/test/resources/simple-p= ortal-war/images/active-button-bg.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/imag= es/icon-maximize.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/test/src/test/resources/simple-p= ortal-war/images/icon-maximize.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/imag= es/icon-minimize.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/test/src/test/resources/simple-p= ortal-war/images/icon-minimize.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/imag= es/icon-normal.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/test/src/test/resources/simple-p= ortal-war/images/icon-normal.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/imag= es/inactive-button-bg.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/test/src/test/resources/simple-p= ortal-war/images/inactive-button-bg.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/imag= es/logo-header.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/test/src/test/resources/simple-p= ortal-war/images/logo-header.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/imag= es/nav-bg.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/test/src/test/resources/simple-p= ortal-war/images/nav-bg.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/imag= es/pc20.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/test/src/test/resources/simple-p= ortal-war/images/pc20.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/imag= es/portal-bg.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/test/src/test/resources/simple-p= ortal-war/images/portal-bg.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/imag= es/portlet-title-rt-bg.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/test/src/test/resources/simple-p= ortal-war/images/portlet-title-rt-bg.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/imag= es/portlet-titlebg.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/test/src/test/resources/simple-p= ortal-war/images/portlet-titlebg.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/i= ndex.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-07 23:42:16 UTC (rev 9843) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-07 23:42:33 UTC (rev 9844) @@ -3,59 +3,6 @@ <%@ page isELIgnored=3D"false" %> - - -
    -
    -
    - -
    -
    - -
    -
    -
    - - - -
    -
    -
    - -
    -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    -
    - -
    -
    -
    -
    + Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/layo= uts/default.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /default.jsp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /default.jsp 2008-02-07 23:42:33 UTC (rev 9844) @@ -0,0 +1,52 @@ +<%@ page contentType=3D"text/html" %> +<%@ page language=3D"java" %> +<%@ taglib prefix=3D"jbp" tagdir=3D"/WEB-INF/tags/portal" %> +<%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> +<%@ page isELIgnored=3D"false" %> + + + + +Portlet Container 2.0 + + + + +
    +
    +
    +
    + 3D""/ +
    +
    +
    +
    + +
    +
    +
    + + + ">Derwood + + + + +
    +
    +
    + + + \ No newline at end of file --===============7664424009820635508==-- From portal-commits at lists.jboss.org Thu Feb 7 19:00:02 2008 Content-Type: multipart/mixed; boundary="===============7197296201172504538==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9845 - modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts. Date: Thu, 07 Feb 2008 19:00:01 -0500 Message-ID: --===============7197296201172504538== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-07 19:00:01 -0500 (Thu, 07 Feb 2008) New Revision: 9845 Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= default.jsp Log: make work commented a tag that was making break (npe) Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/l= ayouts/default.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /default.jsp 2008-02-07 23:42:33 UTC (rev 9844) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /default.jsp 2008-02-08 00:00:01 UTC (rev 9845) @@ -39,7 +39,9 @@
    +<%-- ">Derwood +--%> --===============7197296201172504538==-- From portal-commits at lists.jboss.org Thu Feb 7 19:01:30 2008 Content-Type: multipart/mixed; boundary="===============3218557548049359682==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9846 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response: portlet and 1 other directory. Date: Thu, 07 Feb 2008 19:01:29 -0500 Message-ID: --===============3218557548049359682== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-07 19:01:29 -0500 (Thu, 07 Feb 2008) New Revision: 9846 Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/BufferingResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/portlet/StartPortletChunk.java Log: remove class that should have been removed Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/response/BufferingResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/BufferingResponse.java 2008-02-08 00:00:01 UTC (rev 9845) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/BufferingResponse.java 2008-02-08 00:01:29 UTC (rev 9846) @@ -1,145 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp.response; - -import org.jboss.portal.portlet.test.jsp.PagePortletControllerContext; -import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.controller.state.WindowNavigationalState; -import org.jboss.portal.WindowState; - -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpServletResponseWrapper; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class BufferingResponse extends HttpServletResponseWrapper -{ - - /** . */ -// private final ResponseBuffer buffer =3D new ResponseBuffer(); - - /** . */ - private final PagePortletControllerContext portletControllerContext; - - /** . */ - private final PageNavigationalState pageState; - - /** . */ - private int count =3D 0; - - public BufferingResponse( - HttpServletResponse response, - PagePortletControllerContext portletControllerContext, - PageNavigationalState pageState) - { - super(response); - - // - this.portletControllerContext =3D portletControllerContext; - this.pageState =3D pageState; - } - - /** - * The page state for the rendering. - * - * @return the page state - */ - public PageNavigationalState getPageState() - { - return pageState; - } - - public String getMaximizedWindowId() - { - if (pageState !=3D null) - { - for (String windowId : pageState.getWindowIds()) - { - WindowNavigationalState windowNS =3D pageState.getWindowNaviga= tionalState(windowId); - if (WindowState.MAXIMIZED.equals(windowNS.getWindowState())) - { - return windowId; - } - } - } - - // - return null; - } - - public boolean isRenderable(String windowId) - { - if (windowId =3D=3D null) - { - throw new IllegalArgumentException(); - } - - // - if (pageState =3D=3D null) - { - return false; - } - - // - String maximizedWindowId =3D getMaximizedWindowId(); - if (maximizedWindowId !=3D null) - { - return maximizedWindowId.equals(windowId); - } - - // - return true; - } - - public PagePortletControllerContext getPortletControllerContext() - { - return portletControllerContext; - } - -// public ResponseBuffer getBuffer() -// { -// return buffer; -// } -// -// public ServletOutputStream getOutputStream() throws IOException -// { -// return buffer.getOutputStream(); -// } -// -// public PrintWriter getWriter() throws IOException -// { -// return buffer.getWriter(); -// } -// -// public void close() -// { -// buffer.close(); -// } - - public String nextId() - { - return "" + count++; - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/response/portlet/StartPortletChunk.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/StartPortletChunk.java 2008-02-08 00:00:01 UTC (rev 98= 45) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/response/portlet/StartPortletChunk.java 2008-02-08 00:01:29 UTC (rev 98= 46) @@ -1,111 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp.response.portlet; - -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; -import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; - -import java.util.Set; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class StartPortletChunk -{ - - /** . */ - private final String portletName; - - /** . */ - private final String applicationName; - - /** . */ - private final String windowId; - - /** . */ - private final PortletInvocationResponse response; - - /** . */ - private final Mode initialMode; - - /** . */ - private final Set supportedModes; - - /** . */ - private final Set supportedWindowStates; - - public StartPortletChunk( - String portletName, - String applicationName, - String windowId, - PortletInvocationResponse response, - Mode initialMode, - Set supportedModes, - Set supportedWindowStates) - { - this.portletName =3D portletName; - this.applicationName =3D applicationName; - this.windowId =3D windowId; - this.response =3D response; - this.initialMode =3D initialMode; - this.supportedModes =3D supportedModes; - this.supportedWindowStates =3D supportedWindowStates; - } - - public String getPortletName() - { - return portletName; - } - - public String getApplicationName() - { - return applicationName; - } - - public String getWindowId() - { - return windowId; - } - - public PortletInvocationResponse getResponse() - { - return response; - } - - public Mode getInitialMode() - { - return initialMode; - } - - public Set getSupportedModes() - { - return supportedModes; - } - - public Set getSupportedWindowStates() - { - return supportedWindowStates; - } -} --===============3218557548049359682==-- From portal-commits at lists.jboss.org Thu Feb 7 20:38:25 2008 Content-Type: multipart/mixed; boundary="===============7785195852171756654==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9847 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp: taglib and 1 other directory. Date: Thu, 07 Feb 2008 20:34:25 -0500 Message-ID: --===============7785195852171756654== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-07 20:34:25 -0500 (Thu, 07 Feb 2008) New Revision: 9847 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/AbstractURLTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PageTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletURLTag.java Log: support for maximized with new design Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PortalResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalResponse.java 2008-02-08 00:01:29 UTC (rev 9846) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalResponse.java 2008-02-08 01:34:25 UTC (rev 9847) @@ -29,6 +29,9 @@ = import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponseWrapper; +import javax.servlet.ServletOutputStream; +import java.io.IOException; +import java.io.PrintWriter; = /** * @author Julien Viet @@ -49,6 +52,9 @@ /** . */ private int count =3D 0; = + /** . */ + private final MutableOut out; + public PortalResponse( HttpServletResponse response, PagePortletControllerContext portletControllerContext, @@ -59,6 +65,7 @@ // this.portletControllerContext =3D portletControllerContext; this.pageState =3D pageState; + this.out =3D new MutableOut(this); } = /** @@ -138,8 +145,28 @@ // buffer.close(); // } = + public void setMuted(boolean muted) + { + out.setMuted(muted); + } + + public boolean isMuted() + { + return out.isMuted(); + } + public String nextId() { return "" + count++; } + +// public ServletOutputStream getOutputStream() throws IOException +// { +// return out.getOutputStream(); +// } +// +// public PrintWriter getWriter() throws IOException +// { +// return out.getWriter(); +// } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/AbstractURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/AbstractURLTag.java 2008-02-08 00:01:29 UTC (rev 9846) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/AbstractURLTag.java 2008-02-08 01:34:25 UTC (rev 9847) @@ -23,7 +23,6 @@ package org.jboss.portal.portlet.test.jsp.taglib; = import javax.servlet.jsp.JspException; -import javax.servlet.jsp.tagext.BodyTagSupport; import java.util.Map; import java.util.HashMap; = @@ -31,7 +30,7 @@ * @author Julien Viet * @version $Revision: 630 $ */ -public class AbstractURLTag extends BodyTagSupport +public class AbstractURLTag extends PortalBodyTagSupport { = /** . */ Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PageTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageTag.java 2008-02-08 00:01:29 UTC (rev 9846) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageTag.java 2008-02-08 01:34:25 UTC (rev 9847) @@ -22,25 +22,54 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp.taglib; = +import org.jboss.portal.portlet.test.jsp.PortalResponse; + import javax.servlet.jsp.JspException; -import javax.servlet.jsp.tagext.BodyTagSupport; +import java.io.IOException; = /** * @author Julien Viet * @version $Revision: 630 $ */ -public class PageTag extends BodyTagSupport +public class PageTag extends PortalBodyTagSupport { = + String maximizedId; + + String content; + public int doStartTag() throws JspException { + PortalResponse response =3D getPortalResponse(); + // - return EVAL_BODY_INCLUDE; + maximizedId =3D response.getMaximizedWindowId(); + + // + if (maximizedId !=3D null) + { + return EVAL_BODY_BUFFERED; + } + else + { + return EVAL_BODY_INCLUDE; + } } = public int doEndTag() throws JspException { - // + if (maximizedId !=3D null) + { + try + { + pageContext.getOut().write(content); + } + catch (IOException e) + { + throw new JspException(e); + } + } + return EVAL_PAGE; } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-08 00:01:29 UTC (rev 9846) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-08 01:34:25 UTC (rev 9847) @@ -46,19 +46,28 @@ import org.jboss.portal.common.util.ParameterMap; = import javax.servlet.jsp.JspException; -import javax.servlet.jsp.tagext.BodyTagSupport; import java.util.LinkedHashSet; import java.util.Set; import java.util.Collections; +import java.io.IOException; = /** * @author Julien Viet * @version $Revision: 630 $ */ -public class PortletTag extends BodyTagSupport +public class PortletTag extends PortalBodyTagSupport { = /** . */ + private static final int SKIPPED =3D 0; + + /** . */ + private static final int BUFFERED =3D 1; + + /** . */ + private static final int RENDERED =3D 2; + + /** . */ private static final Set DEFAULT_MODES =3D Collections.unmodifiab= leSet(Tools.toSet(Mode.VIEW, Mode.EDIT, Mode.HELP)); = /** . */ @@ -79,6 +88,12 @@ /** . */ private String initialModeValue; = + /** . */ + private int status; + + /** . */ + PortletResult result; + public String getName() { return name; @@ -129,26 +144,84 @@ this.initialModeValue =3D initialMode; } = - PortletResult result; - public int doStartTag() throws JspException { - PortalResponse response =3D (PortalResponse)pageContext.getResponse(= ); - = + PortalResponse response =3D getPortalResponse(); + PagePortletControllerContext context =3D response.getPortletControll= erContext(); + PageTag pageTag =3D (PageTag)findAncestorWithClass(this, PageTag.cla= ss); + // - result =3D render(response); + Portlet portlet =3D context.findPortlet(applicationName, name); = + // Compute window id + String windowId =3D portlet.getContext().getId() + "." + response.ne= xtId(); + // - return EVAL_BODY_INCLUDE; + + // + if (pageTag.maximizedId !=3D null) + { + if (windowId.equals(pageTag.maximizedId)) + { + result =3D render(response, portlet, windowId); + status =3D BUFFERED; + } + else + { + status =3D SKIPPED; + } + } + else + { + result =3D render(response, portlet, windowId); + status =3D RENDERED; + } + + // + switch (status) + { + case SKIPPED: + return SKIP_BODY; + case RENDERED: + return EVAL_BODY_INCLUDE; + case BUFFERED: + return EVAL_BODY_BUFFERED; + default: + throw new AssertionError(); + } } = public int doEndTag() throws JspException { + result =3D null; + + // + switch (status) + { + case SKIPPED: + break; + case RENDERED: + break; + case BUFFERED: + PageTag pageTag =3D (PageTag)findAncestorWithClass(this, PageT= ag.class); + pageTag.content =3D bodyContent.getString(); + break; + default: + throw new AssertionError(); + } + + // return EVAL_PAGE; } = - public PortletResult render(PortalResponse response) + public PortletResult render( + PortalResponse response, + Portlet portlet, + String windowId) { + PagePortletControllerContext context =3D response.getPortletControll= erContext(); + + // Set supportedModes =3D new LinkedHashSet(); if (supportedModeValues !=3D null) { @@ -186,13 +259,6 @@ } = // - PagePortletControllerContext context =3D response.getPortletControll= erContext(); - - // - Portlet portlet =3D context.findPortlet(applicationName, name); - - // - String windowId =3D portlet.getContext().getId() + "." + response.ne= xtId(); PageNavigationalState pageNS =3D response.getPageState(); = // Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-08 00:01:29 UTC (rev 9846) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-08 01:34:25 UTC (rev 9847) @@ -27,7 +27,6 @@ import org.jboss.portal.portlet.test.jsp.PortalResponse; import org.jboss.portal.portlet.test.jsp.PagePortletControllerContext; import org.jboss.portal.portlet.test.controller.PortletURLRenderer; -import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; import org.jboss.portal.portlet.RenderURL; import org.jboss.portal.portlet.StateString; @@ -78,7 +77,7 @@ = public int doEndTag() throws JspException { - PortalResponse response =3D (PortalResponse)pageContext.getResponse(= ); + PortalResponse response =3D getPortalResponse(); PagePortletControllerContext context =3D response.getPortletControll= erContext(); PortletTag portletTag =3D (PortletTag)SimpleTagSupport.findAncestorW= ithClass(this, PortletTag.class); = --===============7785195852171756654==-- From portal-commits at lists.jboss.org Thu Feb 7 20:39:21 2008 Content-Type: multipart/mixed; boundary="===============8908948462044201958==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9848 - modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/tags/portal. Date: Thu, 07 Feb 2008 20:35:21 -0500 Message-ID: --===============8908948462044201958== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-07 20:35:21 -0500 (Thu, 07 Feb 2008) New Revision: 9848 Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= tags/portal/portlet.tag Log: dynamic portlet Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/tags/portal/portlet.tag =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /tags/portal/portlet.tag 2008-02-08 01:34:25 UTC (rev 9847) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /tags/portal/portlet.tag 2008-02-08 01:35:21 UTC (rev 9848) @@ -5,8 +5,8 @@ <%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> = + name=3D"${name}" + applicationName=3D"${applicationName}">
    --===============8908948462044201958==-- From portal-commits at lists.jboss.org Thu Feb 7 20:55:33 2008 Content-Type: multipart/mixed; boundary="===============0887506646578955334==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9849 - in branches/JBoss_Portal_Branch_2_6: wsrp/src/main/org/jboss/portal/test/wsrp/consumer and 1 other directories. Date: Thu, 07 Feb 2008 20:51:33 -0500 Message-ID: --===============0887506646578955334== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-07 20:51:33 -0500 (Thu, 07 Feb 2008) New Revision: 9849 Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsr= p/admin/ui/ConsumerBean.java branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsr= p/consumer/ConsumerRegistryTestCase.java branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/con= sumer/ConsumerRegistryService.java Log: - JBPORTAL-1877: ConsumerRegistryService was not properly updated when the = producer info id was updated. Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/por= tal/wsrp/admin/ui/ConsumerBean.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/ws= rp/admin/ui/ConsumerBean.java 2008-02-08 01:35:21 UTC (rev 9848) +++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/ws= rp/admin/ui/ConsumerBean.java 2008-02-08 01:51:33 UTC (rev 9849) @@ -113,13 +113,20 @@ else { consumer =3D registry.getConsumer(id); - EndpointConfigurationInfo endpoint =3D getProducerInfo().getEndpo= intConfigurationInfo(); - serviceDescription =3D endpoint.getServiceDescriptionURL(); - markup =3D endpoint.getMarkupURL(); - portletManagement =3D endpoint.getPortletManagementURL(); - registration =3D endpoint.getRegistrationURL(); - wsdl =3D endpoint.getWsdlDefinitionURL(); - useWSDL =3D endpoint.usesWSDL(); + if (consumer !=3D null) + { + EndpointConfigurationInfo endpoint =3D getProducerInfo().getEn= dpointConfigurationInfo(); + serviceDescription =3D endpoint.getServiceDescriptionURL(); + markup =3D endpoint.getMarkupURL(); + portletManagement =3D endpoint.getPortletManagementURL(); + registration =3D endpoint.getRegistrationURL(); + wsdl =3D endpoint.getWsdlDefinitionURL(); + useWSDL =3D endpoint.usesWSDL(); + } + else + { + beanContext.createErrorMessage("Couldn't find consumer '" + id= + "'!"); + } } } = Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/t= est/wsrp/consumer/ConsumerRegistryTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/ws= rp/consumer/ConsumerRegistryTestCase.java 2008-02-08 01:35:21 UTC (rev 9848) +++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/ws= rp/consumer/ConsumerRegistryTestCase.java 2008-02-08 01:51:33 UTC (rev 9849) @@ -113,8 +113,22 @@ TransactionAssert.commitTransaction(); } = - public void testPersist() + public void testUpdateProducerInfo() { -// registry.persistConsumer(); + // create a foo consumer + TransactionAssert.beginTransaction(); + String id =3D "foo"; + WSRPConsumer consumer =3D registry.createConsumer(id, null); + ProducerInfo info =3D consumer.getProducerInfo(); + TransactionAssert.commitTransaction(); + + TransactionAssert.beginTransaction(); + // change the id on the consumer's producer info and save it + info.setId("bar"); + registry.updateProducerInfo(info); + + assertNull(registry.getConsumer(id)); + assertEquals(consumer, registry.getConsumer("bar")); + TransactionAssert.commitTransaction(); } } Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/w= srp/consumer/ConsumerRegistryService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/co= nsumer/ConsumerRegistryService.java 2008-02-08 01:35:21 UTC (rev 9848) +++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/co= nsumer/ConsumerRegistryService.java 2008-02-08 01:51:33 UTC (rev 9849) @@ -233,7 +233,28 @@ Session session =3D sessionFactory.getCurrentSession(); try { - session.update(producerInfo); + + // Retrieve the previous id of the given ProducerInfo to update l= ocal consumers map if needed + String oldId =3D null; + ProducerInfo old =3D (ProducerInfo)session.get(ProducerInfo.class= , producerInfo.getKey()); + if (old !=3D null) + { + oldId =3D old.getId(); + if (producerInfo.getId().equals(oldId)) + { + oldId =3D null; // reset oldId as the ProducerInfo's id has= n't been modified + } + } + + // merge old producer info with new data + session.merge(producerInfo); + + // if we updated and oldId is not null, we need to update the loc= al consumers map + if (oldId !=3D null) + { + WSRPConsumer consumer =3D consumers.remove(oldId); + consumers.put(producerInfo.getId(), consumer); + } } catch (HibernateException e) { --===============0887506646578955334==-- From portal-commits at lists.jboss.org Thu Feb 7 20:55:40 2008 Content-Type: multipart/mixed; boundary="===============1766017993006326014==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9850 - in tags/JBoss_Portal_2_6_4: wsrp/src/main/org/jboss/portal/test/wsrp/consumer and 1 other directories. Date: Thu, 07 Feb 2008 20:51:40 -0500 Message-ID: --===============1766017993006326014== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-07 20:51:39 -0500 (Thu, 07 Feb 2008) New Revision: 9850 Modified: tags/JBoss_Portal_2_6_4/core-wsrp/src/main/org/jboss/portal/wsrp/admin/u= i/ConsumerBean.java tags/JBoss_Portal_2_6_4/wsrp/src/main/org/jboss/portal/test/wsrp/consume= r/ConsumerRegistryTestCase.java tags/JBoss_Portal_2_6_4/wsrp/src/main/org/jboss/portal/wsrp/consumer/Con= sumerRegistryService.java Log: - JBPORTAL-1877: ConsumerRegistryService was not properly updated when the = producer info id was updated. Modified: tags/JBoss_Portal_2_6_4/core-wsrp/src/main/org/jboss/portal/wsrp/= admin/ui/ConsumerBean.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- tags/JBoss_Portal_2_6_4/core-wsrp/src/main/org/jboss/portal/wsrp/admin/= ui/ConsumerBean.java 2008-02-08 01:51:33 UTC (rev 9849) +++ tags/JBoss_Portal_2_6_4/core-wsrp/src/main/org/jboss/portal/wsrp/admin/= ui/ConsumerBean.java 2008-02-08 01:51:39 UTC (rev 9850) @@ -113,13 +113,20 @@ else { consumer =3D registry.getConsumer(id); - EndpointConfigurationInfo endpoint =3D getProducerInfo().getEndpo= intConfigurationInfo(); - serviceDescription =3D endpoint.getServiceDescriptionURL(); - markup =3D endpoint.getMarkupURL(); - portletManagement =3D endpoint.getPortletManagementURL(); - registration =3D endpoint.getRegistrationURL(); - wsdl =3D endpoint.getWsdlDefinitionURL(); - useWSDL =3D endpoint.usesWSDL(); + if (consumer !=3D null) + { + EndpointConfigurationInfo endpoint =3D getProducerInfo().getEn= dpointConfigurationInfo(); + serviceDescription =3D endpoint.getServiceDescriptionURL(); + markup =3D endpoint.getMarkupURL(); + portletManagement =3D endpoint.getPortletManagementURL(); + registration =3D endpoint.getRegistrationURL(); + wsdl =3D endpoint.getWsdlDefinitionURL(); + useWSDL =3D endpoint.usesWSDL(); + } + else + { + beanContext.createErrorMessage("Couldn't find consumer '" + id= + "'!"); + } } } = @@ -469,4 +476,4 @@ registrationLocallyModified =3D isOldAndNewEqual(event.getOldValu= e(), event.getNewValue()); } } -} \ No newline at end of file +} Modified: tags/JBoss_Portal_2_6_4/wsrp/src/main/org/jboss/portal/test/wsrp/= consumer/ConsumerRegistryTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- tags/JBoss_Portal_2_6_4/wsrp/src/main/org/jboss/portal/test/wsrp/consum= er/ConsumerRegistryTestCase.java 2008-02-08 01:51:33 UTC (rev 9849) +++ tags/JBoss_Portal_2_6_4/wsrp/src/main/org/jboss/portal/test/wsrp/consum= er/ConsumerRegistryTestCase.java 2008-02-08 01:51:39 UTC (rev 9850) @@ -113,8 +113,22 @@ TransactionAssert.commitTransaction(); } = - public void testPersist() + public void testUpdateProducerInfo() { -// registry.persistConsumer(); + // create a foo consumer + TransactionAssert.beginTransaction(); + String id =3D "foo"; + WSRPConsumer consumer =3D registry.createConsumer(id, null); + ProducerInfo info =3D consumer.getProducerInfo(); + TransactionAssert.commitTransaction(); + + TransactionAssert.beginTransaction(); + // change the id on the consumer's producer info and save it + info.setId("bar"); + registry.updateProducerInfo(info); + + assertNull(registry.getConsumer(id)); + assertEquals(consumer, registry.getConsumer("bar")); + TransactionAssert.commitTransaction(); } } Modified: tags/JBoss_Portal_2_6_4/wsrp/src/main/org/jboss/portal/wsrp/consu= mer/ConsumerRegistryService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- tags/JBoss_Portal_2_6_4/wsrp/src/main/org/jboss/portal/wsrp/consumer/Co= nsumerRegistryService.java 2008-02-08 01:51:33 UTC (rev 9849) +++ tags/JBoss_Portal_2_6_4/wsrp/src/main/org/jboss/portal/wsrp/consumer/Co= nsumerRegistryService.java 2008-02-08 01:51:39 UTC (rev 9850) @@ -233,7 +233,28 @@ Session session =3D sessionFactory.getCurrentSession(); try { - session.update(producerInfo); + + // Retrieve the previous id of the given ProducerInfo to update l= ocal consumers map if needed + String oldId =3D null; + ProducerInfo old =3D (ProducerInfo)session.get(ProducerInfo.class= , producerInfo.getKey()); + if (old !=3D null) + { + oldId =3D old.getId(); + if (producerInfo.getId().equals(oldId)) + { + oldId =3D null; // reset oldId as the ProducerInfo's id has= n't been modified + } + } + + // merge old producer info with new data + session.merge(producerInfo); + + // if we updated and oldId is not null, we need to update the loc= al consumers map + if (oldId !=3D null) + { + WSRPConsumer consumer =3D consumers.remove(oldId); + consumers.put(producerInfo.getId(), consumer); + } } catch (HibernateException e) { --===============1766017993006326014==-- From portal-commits at lists.jboss.org Thu Feb 7 21:31:53 2008 Content-Type: multipart/mixed; boundary="===============0097791822883450035==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9851 - modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF. Date: Thu, 07 Feb 2008 21:31:53 -0500 Message-ID: --===============0097791822883450035== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-07 21:31:52 -0500 (Thu, 07 Feb 2008) New Revision: 9851 Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= portal.tld modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= web.xml Log: make EL work Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/portal.tld =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.tld 2008-02-08 01:51:39 UTC (rev 9850) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.tld 2008-02-08 02:31:52 UTC (rev 9851) @@ -21,23 +21,28 @@ name true + true java.lang.String applicationName true + true java.lang.String initialMode + true java.lang.String supportedModes + true java.lang.String supportedWindowStates + true java.lang.String @@ -60,10 +65,12 @@ JSP mode + true java.lang.String windowState + true java.lang.String @@ -74,10 +81,12 @@ empty name + true java.lang.String value + true java.lang.String Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /web.xml 2008-02-08 01:51:39 UTC (rev 9850) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /web.xml 2008-02-08 02:31:52 UTC (rev 9851) @@ -22,10 +22,10 @@ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. = ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~--> = - - + ControllerFilter org.jboss.portal.portlet.test.jsp.ControllerFilter --===============0097791822883450035==-- From portal-commits at lists.jboss.org Thu Feb 7 21:36:14 2008 Content-Type: multipart/mixed; boundary="===============2960913114639833241==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9852 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp: taglib and 1 other directory. Date: Thu, 07 Feb 2008 21:36:13 -0500 Message-ID: --===============2960913114639833241== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-07 21:36:13 -0500 (Thu, 07 Feb 2008) New Revision: 9852 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortalBodyTagSupport.java Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalResponse.java Log: forgot to check in a class Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PortalResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalResponse.java 2008-02-08 02:31:52 UTC (rev 9851) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalResponse.java 2008-02-08 02:36:13 UTC (rev 9852) @@ -52,9 +52,6 @@ /** . */ private int count =3D 0; = - /** . */ - private final MutableOut out; - public PortalResponse( HttpServletResponse response, PagePortletControllerContext portletControllerContext, @@ -65,7 +62,6 @@ // this.portletControllerContext =3D portletControllerContext; this.pageState =3D pageState; - this.out =3D new MutableOut(this); } = /** @@ -145,16 +141,6 @@ // buffer.close(); // } = - public void setMuted(boolean muted) - { - out.setMuted(muted); - } - - public boolean isMuted() - { - return out.isMuted(); - } - public String nextId() { return "" + count++; Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/taglib/PortalBodyTagSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalBodyTagSupport.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalBodyTagSupport.java 2008-02-08 02:36:13 UTC (rev 9852) @@ -0,0 +1,39 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.taglib; + +import org.jboss.portal.portlet.test.jsp.PortalResponse; + +import javax.servlet.jsp.tagext.BodyTagSupport; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortalBodyTagSupport extends BodyTagSupport +{ + protected final PortalResponse getPortalResponse() + { + return (PortalResponse)pageContext.getResponse(); + } +} --===============2960913114639833241==-- From portal-commits at lists.jboss.org Thu Feb 7 21:40:25 2008 Content-Type: multipart/mixed; boundary="===============6625633805180404495==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9853 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller. Date: Thu, 07 Feb 2008 21:40:24 -0500 Message-ID: --===============6625633805180404495== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-07 21:40:24 -0500 (Thu, 07 Feb 2008) New Revision: 9853 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletURLRenderer.java Log: fix bug with page state in PAGE resource serving Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletURLRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-08 02:36:13 UTC (rev 9852) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-08 02:40:24 UTC (rev 9853) @@ -267,7 +267,7 @@ parameters.put(WINDOW_STATE, resourceURL.getWindowState().t= oString()); } = - if (cacheability =3D=3D CacheLevel.PAGE) + if (cacheability =3D=3D CacheLevel.PAGE && pageState !=3D null) { parameters.put(PAGE_STATE, pageState); } --===============6625633805180404495==-- From portal-commits at lists.jboss.org Thu Feb 7 22:24:10 2008 Content-Type: multipart/mixed; boundary="===============2527997229451006291==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9854 - in modules/portlet/trunk/test/src/test/resources/simple-portal-war: css and 1 other directories. Date: Thu, 07 Feb 2008 22:24:10 -0500 Message-ID: --===============2527997229451006291== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-07 22:24:09 -0500 (Thu, 07 Feb 2008) New Revision: 9854 Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= tags/portal/portlet.tag modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mast= er.css modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= default.jsp Log: layout changes Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/tags/portal/portlet.tag =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /tags/portal/portlet.tag 2008-02-08 02:40:24 UTC (rev 9853) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /tags/portal/portlet.tag 2008-02-08 03:24:09 UTC (rev 9854) @@ -1,6 +1,6 @@ <%@ tag body-content=3D"scriptless" %> -<%@ attribute name=3D"name" required=3D"true" %> -<%@ attribute name=3D"applicationName" required=3D"true" %> +<%@ attribute name=3D"name" rtexprvalue=3D"true" required=3D"true" %> +<%@ attribute name=3D"applicationName" rtexprvalue=3D"true" required=3D"tr= ue" %> <%@ attribute name=3D"content" fragment=3D"true" required=3D"false" %> = <%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> = @@ -11,12 +11,20 @@
    -
    =
    -
    +

    +
    + "> + + ">3D""/ + + "> + + ">= Edit +
    @@ -26,4 +34,4 @@ =
    - \ No newline at end of file + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/c= ss/master.css =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-08 02:40:24 UTC (rev 9853) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-08 03:24:09 UTC (rev 9854) @@ -201,6 +201,7 @@ background-color: #e2e2e2; padding: 2px; float:left; + margin:10px; } = div#container div#content div.portlet-frame{ @@ -223,7 +224,7 @@ height:20px; } = -div#container div#content div.portlet div.header div.header-layer div.titl= e{ +div#container div#content div.portlet div.header div.header-layer div.titl= e h2{ font: bold 12px Lucida Sans, Trebuchet, tahoma, sans-serif; color: #fff; padding: 2px; @@ -231,5 +232,10 @@ = div#container div#content div.portlet div.header div.header-layer div.cont= rols{ text-align: right; - padding: 3px 3px 0 0; + padding: 3px 0 0 0; +} + +div#container div#content div.portlet div.header div.header-layer div.cont= rols span.mode-button{ + text-align: right; + padding: 0 5px 0 0; } \ No newline at end of file Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/l= ayouts/default.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /default.jsp 2008-02-08 02:40:24 UTC (rev 9853) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /default.jsp 2008-02-08 03:24:09 UTC (rev 9854) @@ -38,13 +38,14 @@
    - -<%-- - ">Derwood ---%> - - - +
    + +
    +
    + + +
    +

    --===============2527997229451006291==-- From portal-commits at lists.jboss.org Thu Feb 7 22:32:17 2008 Content-Type: multipart/mixed; boundary="===============3983498195555895175==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9855 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Thu, 07 Feb 2008 22:32:17 -0500 Message-ID: --===============3983498195555895175== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-07 22:32:17 -0500 (Thu, 07 Feb 2008) New Revision: 9855 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: trying to commit changes for 5.2.1.2. Package Structure and 5.2.1.3. Portlet Class after running tutorials.xml through unix2dos line break fixing... Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-08 03:24:09 UTC (rev 9854) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-08 03:32:17 UTC (rev 9855) @@ -100,7 +100,7 @@ Tutorials The tutorials contained in this chapter are targetted toward port= let developers. Although they are a good - starting and reference point, it is heavily recommend that portle= t developers read and understand the + starting and reference point, it is highly recommend that portlet= developers read and understand the JSR-168 Portlet= Specification. Use the JBoss Portal User Forums= for user-to-user help. -]]> - - These files are found in jboss-portal.sar/[module]= /conf/hibernate/[directory]/hibernate.cfg.xml - where [module] is a module name and [directory] is a directory that - may or may not be present. - +]]> + + + Note: this example is for a PostgreSQL database. If you use another data= base, you will need to modify org.hibernate.dialect.Postgre= SQLDialect to reflect the correct database. For a list of = supported dialects, refer to the dialects list on the Hibernate website. + - DB Dialect settings for the CMS component - Modify jboss-portal.sar/portal-cms.sar/conf/hibern= ate/cms/hibernate.cfg.xml by - uncommenting the following line in these files and using the a= ppropriate dialect (see - here - for a list of supported dialects in Hibernate 3): - DB Dialect Settings for the CMS Component + + To modify the DB dialect setting for the JBoss Portal CMS component: + + + + + + Open the jboss-portal.sar/portal-cms.sar/conf/hibernate/cm= s/hibernate.cfg.xml file. + + + + + Un-comment the following line, so that it looks like the following: + + + -]]> - +]]> + + + + + + Note: this example is for a PostgreSQL database. If you use another data= base, you will need to modify org.hibernate.dialect.Postgre= SQLDialect to reflect the correct database. For a list of = supported dialects, refer to the dialects list on the Hibernate website. + - Setting up the email service - To be able to use the email service (for example to verify use= r emails when someone subscribes or for CMS - workflow notifications) it has to be configured correctly. To config= ure it, go to - jboss-portal.sar/portal-core.sar/META-INF/jboss-service.xml= . - In this file, the mail module is configured like this: - - - jboss:service=3DMail - portal:service=3DModule,type=3DIdentityServiceController - -1 - localhost - - - false - 100000 - 10000 - java:portal/MailModule -]]> - Here you can specify a different SMTP server than localhost, then= precise the SMTP username and SMTP password to - use to send emails. - For example, to use GMail's SMTP server: - - - jboss:service=3DMail - portal:service=3DModule,type=3DIdentityServiceController - -1 - smtp.gmail.com - username(a)gmail.com - myPassword - false - 100000 - 10000 - java:portal/MailModule -]]> + Setting up the Email Service + + If you have a standard setup and a mail server installed, the email= service should work without any extra configuration. Most Linux distributi= ons have a mail server installed by default. The email service, for example= , can be used to verify a user's email address when a user subscribes, or f= or CMS workflow notifications. - If you have a 'standard' setup and a mail server install= ed - (That's the case on most Linux distribution out of the box), it will= work out of the box. - + + The email service is configured using the $JBOSS_HOME/ser= ver/default/deploy/jboss-portal.sar/META-INF/jboss-service.xml f= ile. The following is an example of the section which is used to configure = the email service: + + + + +jboss:service=3DMail +portal:service=3DModule,type=3DIdentityServiceController +-1 +localhost + + +false +100000 +10000 +java:portal/MailModule +]]> + + + + A different SMTP server (other than localhost) can be configured, along = with a SMTP username and an SMTP password. The following is an example conf= iguration that uses the Gmail SMTP server: + + + + +jboss:service=3DMail +portal:service=3DModule,type=3DIdentityServiceController +-1 +smtp.gmail.com +username(a)gmail.com +myPassword +false +100000 +10000 +java:portal/MailModule +]]> + + + + Using this example, replace username(a)gmail.com and myPassword with your correct= Gmail username and password. + + - Setting up proxy settings + Configuring proxy settings There are a couple of scenarios where you will need your proxy= to be correctly defined at the JVM level so that you can access documents from Internet. It could be to= get the thirdparty libraries if you decided to build JBoss Portal from the sources, to access RSS feeds = or weather information in the samples @@ -219,19 +261,24 @@ is enough. - Disabling dynamic proxy unwrapping - JBoss Portal use the JBoss Microkernel for the service infr= astructure. The JBoss Microkernel provides - injection of services into other services, also known as wiring. = Unfortunately it is only possible to inject - dynamic proxies that talks to the MBeanServer due to the fact the= Microkernel is JMX based. The overhead - at runtime is minimal since the Microkernel implementation is hig= hly optimized, however when it is used - with Java 5 a noticeable bottleneck appears due to the fact that = the implementation - of the JMX API classes javax.management.* pr= ovided by the Java Platform performs synchronization. This does - not happen under JDK 1.4 since those classes are implemented by J= Boss MX. - JBoss Portal services use a special kind of Model MBean cal= led JBossServiceModelMBean which allows to - unwrap the injected dynamic proxies and replace them by the real = POJO services. This allows to remove the - bottleneck with Java 5 and provide an extra boost of performances= on JDK 1.4. By default that feature - is enabled but it is possible to disabled it using command line a= rguments. - run.sh -Dportal.kernel.no_proxies=3Dfalse]]> + Disabling Dynamic Proxy Un-wrapping + JBoss Portal uses the JBoss Microkernel for the service infras= tructure. The JBoss Microkernel provides injection of services into other s= ervices, otherwise known as wiring. Due to the Microkernel being JMX based,= it is only possible to inject dynamic proxies that talk to the MBeanServer= . The overhead at runtime is minimal since the Microkernel implementation i= s highly optimized; however, when it is used with Java 5, a noticeable bott= leneck occurs due to the fact that the implementation of the JMX API classe= s, javax.management.*, provided by the Java Platform, = perform synchronization. This does not occur under JDK 1.4, since those cla= sses are implemented by JBoss MX. + + + JBoss Portal services use a special kind of Model MBean called JBossServiceModelMBean, which allows the un-wrapping of inject= ed dynamic proxies, and replaces them with plain old java object (POJO) ser= vices. This removes the bottleneck when using Java 5, and also provides a p= erformance boost on JDK 1.4. By default this feature is enabled, but it is = possible to disable. To do this on Linux systems, change into the $JBOSS_HOME/bin/ directory and run the following command: + + + +./run.sh -Dportal.kernel.no_proxies=3Dfalse + + + + On Microsoft Windows systems, run the following command: + + + +run.bat -Dportal.kernel.no_proxies=3Dfalse + + Modified: docs/tags/JBoss_Portal_2_6_4/referenceGuide/en/modules/installati= on.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/tags/JBoss_Portal_2_6_4/referenceGuide/en/modules/installation.xml= 2008-02-08 10:45:01 UTC (rev 9868) +++ docs/tags/JBoss_Portal_2_6_4/referenceGuide/en/modules/installation.xml= 2008-02-08 10:56:20 UTC (rev 9869) @@ -25,7 +25,7 @@ - Start the server: change into = the JBOSS_PORTAL_INSTALLATION_DIRECTORY/bin/ directory= . On Microsoft Windows, execute run.bat. On Linux, run t= he ./run.sh command. + Start the server: change into = the JBOSS_PORTAL_INSTALLATION_DIRECTORY/bin/ directory= . On Microsoft Windows, execute run.bat. On Linux, run t= he ./run.sh command. To specify a configuration to use, = for example, the default configuration, append the -c default option to the run.bat or ./run.sh commands. @@ -125,7 +125,7 @@ - Copy the Datasource descriptor that matches your database into th= e $JBOSS_HOME/server/configuration/dep= loy/ directory, where configuration i= s either all, default or minimal. For example, if you are using the all con= figuration, copy the Datasource descriptor into the $JBOSS_HOME/s= erver/all/deploy/ directory. + Copy the Datasource descriptor that matches your database into th= e $JBOSS_HOME/server/configuration/dep= loy/ directory, where configuration i= s either all, default, minimal or production. The production configuration = only exists on JBoss EAP, and not JBoss AS. For example, if you are using t= he all configuration, copy the Datasource descriptor into the $JB= OSS_HOME/server/all/deploy/ directory. After the Datasource descriptor has been copied into the deploy directory, make sure the username, password, connection= -url, and driver-class are correct for your chosen database. Datasource des= criptor files can be deployed to test before being used in production. The = following is an example Datasource descriptor for the PostgreSQL database: @@ -161,7 +161,7 @@ - Start the server: change into the <= filename>$JBOSS_HOME/bin/ directory. On Microsoft Windows, execu= te run.bat. On Linux, run the ./run.sh command. + Start the server: change into the <= filename>$JBOSS_HOME/bin/ directory. On Microsoft Windows, execu= te run.bat. On Linux, run the ./run.sh command. To specify a configuration to use, for example, the default conf= iguration, append the -c default option to the run.bat or ./run.sh commands. @@ -348,7 +348,7 @@ Replace proxy-hostname with the proxy server= 's hostname, and proxy-port with the correct pro= xy server port number. - To build and deploy JBoss Portal from the sources, change into the= JBOSS_PORTAL_HOME_DIRECTORY/build/ directory. Then, = Microsoft Windows users need to run the build.bat deploy= command, and Linux users need to run the ./build.sh deploy command. + To build and deploy JBoss Portal from the sources, change into the = JBOSS_PORTAL_SOURCE_DIRECTORY/build/ directory, where= JBOSS_PORTAL_SOURCE_DIRECTORY is the directory where = the JBoss Portal source code was downloaded to. Then, Microsoft Windows use= rs need to run the build.bat deploy command, and Linux u= sers need to run the ./build.sh deploy command. At the end of the build process, the jboss-portal.sar file is copied into the $JBOSS_HOME/server/default/deploy/ directory: @@ -375,7 +375,7 @@ - Change into the JBOSS_PORTAL_HOME_DIRECTORY/build/ directory, and run the following command: + Change into the JBOSS_PORTAL_SOURCE_DIRECTORY/build/ directory, and run the following command: @@ -385,7 +385,7 @@ - Change into the JBOSS_PORTAL_HOME_DIRECTORY/core/ directory, and run the following command: + Change into the JBOSS_PORTAL_SOURCE_DIRECTORY/core/ directory, and run the following command: @@ -441,7 +441,7 @@ - Copy the Datasource descriptor that matches your database into the $JBOSS_HOME/server/configuration/deploy/<= /filename> directory, where configuration is eit= her all, default, minimal, or production. For example, if you are using the= production configuration, copy the Datasource descriptor into the $JBOSS_HOME/server/production/deploy/ directory. + Copy the Datasource descriptor that matches your database into the $JBOSS_HOME/server/configuration/deploy/<= /filename> directory, where configuration is eit= her all, default, minimal, or production. For example, if you are using the= production configuration, copy the Datasource descriptor into the $JBOSS_HOME/server/production/deploy/ directory. The productio= n configuration only exists on JBoss EAP installations, and not JBoss AS. After the Datasource descriptor has been copied into the dep= loy directory, make sure the username, password, connection-url,= and driver-class are correct for your chosen database. Datasource descript= or files can be deployed to test before being used in production. The follo= wing is an example Datasource descriptor for the PostgreSQL database: @@ -477,7 +477,7 @@ - Start the server: change int= o the $JBOSS_HOME/bin/ directory. On Microsoft Windows= , execute run.bat. On Linux, run the ./run.sh command. + Start the server: change int= o the $JBOSS_HOME/bin/ directory. On Microsoft Windows= , execute run.bat. On Linux, run the ./run.sh command. To specify a configuration to use, for example, the defau= lt configuration, append the -c default option to the <= command>run.bat or ./run.sh commands. Modified: docs/tags/JBoss_Portal_2_6_4/referenceGuide/en/modules/migration.= xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/tags/JBoss_Portal_2_6_4/referenceGuide/en/modules/migration.xml 20= 08-02-08 10:45:01 UTC (rev 9868) +++ docs/tags/JBoss_Portal_2_6_4/referenceGuide/en/modules/migration.xml 20= 08-02-08 10:56:20 UTC (rev 9869) @@ -11,124 +11,134 @@ boleslaw dot dawidowicz at redhat dot com - Upgrading 2.4 - 2.6 + Upgrading JBoss Portal 2.4 to 2.6 + - Before performing any instructions or operations mentioned below rem= ember to backup your database content and - the whole application server directory! + + Before performing any instructions or operations in this chapter, back u= p your database content and + the entire JBoss EAP or JBoss AS directory! + + - Manual upgrade + Manual Upgrade - Although database schema remains the same in JBoss Portal 2.6 the= re are several differences that prevent from simple deployment - of newest portal version using JBoss Portal 2.4 database. In this= chapter we will list major ones and give - instructions on how to manually update proper data. + Although the database schema remains the same in JBoss Portal 2.6= , there are several differences that prevent simply deploying the latest ve= rsion of JBoss Portal, when using a database created for JBoss Portal 2.4. = This chapter describes updating a JBoss Portal 2.4 MySQL database for use w= ith JBoss Portal 2.6. - Upgrading procedure can be quite straightforward: - + The upgrade procedure can be straightforward: + + + - Remove $JBOSS_HOME/server/default/d= eploy/jboss-portal.sar file. + + If you are using the JBoss Portal binary, remove the $JBOSS_H= OME/server/default/deploy/jboss-portal.sar/ directory. If JBoss = Portal was built from source, remove the $JBOSS_HOME/server/defau= lt/deploy/jboss-portal.sar file. + - Update data in portal database like described in following = sections of this chapter + + Update the data in the JBoss Portal database, as described in . + - Deploy JBoss Portal 2.6 + + Deploy JBoss Portal 2.6. + - + - Theme + Themes + + Themes in JBoss Portal 2.6 have changed since the Portal pages now cont= ain additional areas, such as the Login, Admin<= /guiicon>, and Dashboard links, on the top right-hand co= rner: + + + - Themes in 2.6 version changed as now they - contain additional areas - the best example is upper right cor= ner where links like "Login", "Admin", "My Dashboard" - are visable. If you use default theme like "renaissance" that = is present in 2.6, you shouldn't need to do anything. To update your custom= themes please - refer to those bundled with portal as an example. - - If you stay with old theme files you may find JBP 2.6 unusa= ble to the point that you may not even be able to log in + If you use a default theme that exists in JBoss Portal 2.6, such as ren= aissance, no configuration should be necessary. Using old themes from JBoss= Portal 2.4 may make JBoss Portal 2.6 unusable, for example, not being able= to log in. To update custom themes, please refer to those bundled with JBo= ss Portal as an example. + - - Database - All things described in this section can be done using Admi= nPortlet. Treat this directions more as guideline - if you need to automate migration for big portal deployment. + + Updating the Database - Database schema wasn't changed between 2.4 and 2.6 releases, b= ut still content that is kept in it - changed slightly in few areas. You can easily update the data = manually by using tools proper for your - RDBMS. If you use MySQL you can use MySQL Query Browser that can - be downloaded from MySQL website. + All procedures described in the following sections can performed using = the AdminPortlet. Treat the directions as guidelines if you need to automat= e the migration of a large JBoss Portal deployment. + + + Database schema has not changed between the JBoss Portal 2.4 and 2.6 re= leases, but certain content that is kept in the databases has changed. Data= can be updated manually by using the correct tools for your RDBMS. For exa= mple, if you are using a MySQL database, you can use the MySQL Query Browser. - - Instructions below refer to standard JBoss Portal 2.4 deployme= nt. If you named core portlets, portlet instances - or portlet windows differently you will need to make proper mo= difications in those steps. - + + The following instructions refer to a standard JBoss Portal 2.4 deploym= ent. If you named core portlets, portlet instances, or portlet windows diff= erently, you will need to make the appropriate modifications. The following= is an example of using the MySQL Query Browser: + + - - Portlet names - Names of few core bundled portlets changed. To update th= em you need to: + + + + Portlet Names - In JBP_INSTANCES table: - - Change "local.portal.CMSPorlet" in PORTLET_REF column to - "local./portal-cms.CMSPortlet" - - Change "local.portal.CMSAdminPorlet<= /emphasis>" in PORTLET_REF column to - "local./portal-cms.CMSAdminPortlet" - - Change "local.portal.ManagementPorle= t" in PORTLET_REF column to - "local./portal-admin.AdminPortlet" - - - - Instead of editing database you can destroy those instan= ces in AdminPortlet and recreate them. + Names of certain core bundled portlets have changed. Destroy the fol= lowing instances and use the AdminPortlet to recreate them, or, edit the JBP_INSTANCES table as follows: + + + + + + Change local.portal.CMSPorlet in the PORTLET_REF column to local./portal-cms.CMSPortlet= . + + + + + Change local.portal.CMSAdminPorlet in the PORTLET_REF column to local./portal-cms.CMSAdm= inPortlet. + + + + + Change local.portal.ManagementPorlet in the = PORTLET_REF column to local./portal-admin.Ad= minPortlet. + + + + - NavigationPortlet from JBP 2.4 is not = present anymore. Its functionality is now realized by - PageCustomizerInterceptor so all refer= ences to NavigationPortlet should - be removed from all portal pages. You can do it either by c= leaning up database content or by using - AdminPortlet in Portal interface. In d= atabase you should remove: - - - Rows containing "local.portal.NavigationPor= tlet" in - "PORTLET_REF" column in - "JBP_INSTANCES" table. - - - Rows containing "NavigationPortletInstance<= /emphasis>" in - "INSTANCE_REF" column in - "JBP_WINDOW" table. - - - Rows containing "NavigationPortletWindow" in - "NAME" column in - "JBP_OBJECT" table. - - - - Instead of editing database you can just remove Navigati= onPortletInstance using AdminPortlet. - - + The NavigationPortlet from JBoss Portal 2.4 has= been removed, and its functionality is now replaced by PageCusto= mizerInterceptor. All references to the NavigationPort= let should be removed from all portal pages. Remove Na= vigationPortletInstance using the AdminPortlet, or edit the data= base as follows: + + + + + + In the JBP_INSTANCES table, rows containing= local.portal.NavigationPortlet in the PORTL= ET_REF column. + + + + + In the JBP_WINDOW table, rows containing NavigationPortletInstance in the INSTANCE_REF<= /emphasis> column. + + + + + In the JBP_OBJECT table, rows containing NavigationPortletWindow in the NAME= column. + + + + + + CMS - This is probably the less trival part to do directly in dat= abase. In JBP 2.6 version the way that CMS - content is being displayed changed significantly. Please re= fer to - Content Integration and CMS Portlet - chapters for more information. Basically currently there is= no need to have more than one instance of - CMSPortlet and the portlet window disp= lays CMS content not by referring to that portlet instance - but by having proper content-type defi= ned. In "default-object.xml - you will find following configuration: - - and . Currently th= ere is no need to have more than one instance of the CMSPortlet. The portlet window displays CMS content, not by referring to tha= t portlet instance, but by having the proper content-type defined. The following configuration is in the jboss-portal.s= ar/conf/data/default-object.xml file: + + + CMSWindow @@ -137,53 +147,53 @@ center 0 - - ]]> - +]]> + + + + The following example uses the MySQL Query Browser. Open the JBP_OBJECT_NODE table in your database schema. = Look at the PATH column to identify any = occurrences of CMS in your JBoss Portal deployment. Identify any row referr= ing to CMSPortletWindow, and remember the number in PK column. The PK<= /emphasis> number is needed in the following steps: - Open JBP_OBJECT_NODE tab= le in your database schema. By looking at - PATH column you will eas= ily find any occurances of CMS in your portal - deployment - + - For any row you will identify as referring to CMS= PortletWindow in your system remember - the number in PK column.= It will be needed in next steps + Go to the JBP_WINDOW table and fi= nd a row with the same + PK value from the JBP_OBJECT_NODE table. In such a row, replace CMSPortletInstance with a path to your CMS resource. For examp= le, by default, JBoss Portal displays /default/index.html. - Go to JBP_WINDOW tab= le and find row with the same - PK value like the one fr= om - JBP_OBJECT_NODE table. I= n such row replace - "CMSPortletInstance" with a path to yo= ur CMS resource. For example by default - portal is displaying "/default/index.html". - - Go to JBP_PORTAL_OBJECT_PROPS table and add a row containing: + Go to the JBP_PORTAL_OBJECT_PRO= PS table and add a row containing: - The number you remembered in "OBJECT_KEY" column. - - - "portal.windowContentType" in "<= emphasis>NAME" column. - - - "cms" in "jbp_VALUE" column. - - - + + The PK number remembered from the= OBJECT_KEY column. + + + + + portal.windowContentType in the NAME<= /emphasis> column. + + + + + cms in the jbp_VALUE colum= n. + + + + - Remember that you can also change portlet window content= type and configure path to CMS resource - using AdminPortlet + + Portlet Content Type and Path to the CMS Resource + + You can change the portlet window content type and configure the path = to the CMS resource + using the AdminPortlet. + + - - - - - - + + = - Deploying your first portlet + Deploying your First Portlet Introduction - This section will introduce the reader to deploying his = first portlet in JBoss Portal. It requires you - download the HelloWorldPortlet from PortletSwap.com, using = this - link. - + + This section details deploying your first portlet in JBoss Portal. B= efore proceeding, download the HelloWorldPorlet from JBoss PortletSwap. + Package Structure - Portlets are packaged in WAR files, just like other JEE app= lications. A typical portlet WAR file can also - include servlets, resource bundles, images, HTML, JSPs, and= other static or dynamic files you would - commonly include. + Like other Java EE applications, portlets are packaged in W= AR files. A typical portlet WAR file can include servlets, resource bundles= , images, HTML, JSPs, and other static or dynamic files. The following is a= n example of the directory structure of the HelloWorldPortlet portlet: @@ -141,15 +159,16 @@ - Portlet Class + Portlet Classes - Included in the - - download bundle you should have one java source = file: - HelloWorldPortlet\src\main\org\jboss\portlet\hello= \HelloWorldPortlet.java, and it - should contain the following: - HelloWorldPortlet/src/main/org/jboss/= portlet/hello/HelloWorldPortlet.java java source file, which com= es bundled with the HelloWorldPortlet: + + + - - Now let's dissect our simplest of portlets: - - - - public class HelloWorldPortlet ext= ends GenericPortlet - All Portlets MUST implement the javax.por= tlet.Portlet interface. The Portlet - API also provides a convenience implementation of = this interface in the form of the - javax.portlet.GenericPortlet cl= ass which, among other things, implements + protected void doView(RenderRequest rRequest, RenderResponse rResponse) = + throws PortletException, IOException, UnavailableException + + { + rResponse.setContentType("text/html"); + PrintWriter writer =3D rResponse.getWriter(); + writer.write("Hello World!"); + writer.close(); + } + +} ]]> + + + + + +public class HelloWorldPortlet extends GenericPortlet + + + All portlets must implement the javax.por= tlet.Portlet interface. The portlet + API provides a convenient implementation of this i= nterface, in the form of the + javax.portlet.GenericPortlet cl= ass, which among other things, implements the Portlet render method to di= spatch to abstract mode-specific methods to - make it easier to support the standard portlet mod= es. It also provides - a default implementation for processActio= n, init and - destory methods. It is recommen= ded to extend GenericPortlet + make it easier to support the standard portlet mod= es. As well, it provides + a default implementation for the processA= ction, init and + destroy methods. It is recommen= ded to extend GenericPortlet for most cases. - - - - - protected void doView(RenderReques= t rRequest, RenderResponse rResponse) throws - PortletException, IOException, UnavailableExcep= tion - As we extend from GenericPortlet and we are only interested in supported the - VIEW mode, we only need to impl= ement the doView method, - and GenericPortlet's r= ender implementation will call our - implementation when the VIEW mo= de is requested. - - - - - rResponse.setContentType("text/htm= l"); - Just like in the servlet-world, you must declare w= hat content-type the portlet will be - responding in. You need to do this before starting= to write content or the portlet will throw - an exception. - - - - - - Here we output the text - Hello World! - in our portlet window. - - Portlets are responsible for generating markup = fragments, as they are included on a page and - surrounded by other portlets. In particular, th= is means that a portlet outputting HTML MUST - not output any markup that cannot be found in a= body element. - - - - - + + + + +protected void doView(RenderRequest rRequest, RenderResponse rResponse) = +throws PortletException, IOException, UnavailableException + + + As we extend from GenericPortlet, and are only int= erested in supporting the VIEW mode, only the d= oView method needs to be implemented, and the GenericPor= tlet render implemention calls our implementat= ion when the VIEW mode is requested. + + + + +rResponse.setContentType("text/html"); + + + As in the servlet-world, you must declare what content-type the portl= et will be + responding in. Do this before starting to write content, or the portl= et will throw an exception. + + + + +PrintWriter writer =3D rResponse.getWriter(); = +writer.write("Hello World!"); = +writer.close(); + + + This produces the Hello World! text in our portlet= window. + + + + + + + + + Portlets are responsible for generating markup fragments, as they are i= ncluded on a page and are + surrounded by other portlets. In particular, this means that a portlet = outputting HTML must + not output any markup that cannot be found in a <body> element. + + + Application Descriptors - JBoss Portal requires certain descriptors be included in yo= ur portlet WAR, for different reasons. Some of - these descriptors are defined by the Portlet Specification,= some are specific to JBoss Portal. + JBoss Portal requires certain descriptors to be included in= a portlet WAR file. Some of + these descriptors are defined by the JSR-168 Portlet Specification= , and others are specific to JBoss Portal. The following is an example of t= he directory structure of the HelloWorldPortlet portlet: + + - Now let's explain what each of these does: - - - portlet.xml - + + + The following is an example of the HelloWorldPortlet/WEB-IN= F/portlet.xml file. Note: in order to create the WEB-I= NF and META-INF directories, extract the helloworldportlet.war file: + + + HelloWorld Portlet -]]> - This file must adhere to its definition in the Por= tlet Specification. You may define more than - one portlet application in this file. - - - - He= lloWorldPortlet]]> - Define your portlet name. It does not hav= e to be the Class name. - - - - - o= rg.jboss.portlet.hello.HelloWorldPortlet]]> - The Fully Qualified Name (FQN) of your po= rtlet class must be declared here. - - - - - - text/html - VIEW -]]> - The supports element a= llows you to declare all the markup types your - portlet supports in the render method. This is accomplish via the - mime-type element, whi= ch is required for every - portlet. Of course, the declared MIME typ= es must match the capability of the portlet. - - It also allows you to pair - which modes and window states are support= ed for each markup type. In out case, as all - portlets must support the VIEW portlet mo= de, we didn't have to declare it. We did need - to declare that our portlet supports the = text/html markup type. - Hence, we are letting the portal know tha= t it will be outputting text/html and - only support a VIEW mode. - - - - - - HelloWorld Portlet - -]]> - The portlet's title will be displayed as = the header in the portlet window, when - rendered, unless it is overridden program= matically. - - - - - - - portlet-instances.xml - +]]> + + + + This file must adhere to its definition in the JSR-168 Portlet Specifica= tion. You may define more than one portlet application in this file. + + + + HelloWorldPortlet]]> + + + Define the portlet name. It does not have to be the Class name. + + + +org.jboss.portlet.hello.HelloWorldPortlet]]= > + + + The Fully Qualified Name (FQN) of your portlet class must be declared he= re. + + + + + text/html + VIEW +]]> + + + The <supports> element allows you to declare al= l the markup types your + portlet supports in the render method. This is accomp= lished via the + <mime-type> element, which is required for ever= y portlet. The declared MIME types must match the capability of the portlet. + + + As well, it allows you to pair which modes and window states are support= ed for each markup type. All portlets must support the VIEW portlet mode, s= o this does not have to be decared. Define which markup type your porlet su= pports, which in this examepl is text/html. This section= tells the portal that it will only output text and HTML, and that it only = supports the VIEW mode. + + + + + HelloWorld Portlet +]]> + + + When rendered, the portlet's title will be displayed as the header in th= e portlet window, unless it is overridden programmatically. In this example= , the title would be HelloWorld Portlet. + + + + + + + The following is an example of the HelloWorldPortlet/WEB-INF/po= rtlet-instances.xml file: + + + @@ -314,17 +353,21 @@ HelloWorldPortlet -]]> - This is a JBoss Portal specific descriptor that al= lows you to create instances of portlets. The - portlet-ref value must match th= e portlet-name value - given in the packaged portlet.xml. The instance-id - value can be named anything, but it must match instance-ref values given - in *-object.xml files as we sha= ll below. - - - - helloworld-object.xml - +]]> + + + + This is a JBoss Portal specific descriptor that allows you to create inst= ances of portlets. The + <portlet-ref> value must match the <= portlet-name> value + given in the HelloWorldPortlet/WEB-INF/portlet.xml f= ile. The <instance-id> + value can be named anything, but it must match the instance-ref<= /literal> values given + in *-object.xml files as we shall below. + + + The following is an example helloworld-object.xml fi= le: + + + @@ -339,14 +382,18 @@ 1 -]]> +]]> + + + +*-object.xml files are JBoss Portal specific descriptor= s and allow users to +define the structure of their portal instances as well as create/configure= their windows and +pages. In our example, we create a portlet window, specify that it will di= splay the markup +generated by the HelloWorldPortletInstance portlet inst= ance, assign it to the +default.default page, and specify where it should appea= r on that page. + + = - *-object.xml files are JBoss Po= rtal specific descriptors and allow users to - define the structure of their portal instances as = well as create/configure their windows and - pages. In our example, we create a portlet window,= specify that it will display the markup - generated by the HelloWorldPortletInstanc= e portlet instance, assign it to the - default.default page, and speci= fy where it should appear on that page. - @@ -389,9 +436,7 @@ - - - + To illustrate the relationship between the descriptors, we = have provided this simple diagram @@ -426,6 +471,8 @@ ]]> + + = This declaration is equivalent to the previous example. We = specify that the content being displayed by the HelloWorldPortletWindow is a portlet content. The content URI @@ -433,7 +480,7 @@ It is possible to declare windows with a cms content type and use directly the path to the file in the CMS to make the window show the content of = the associated file. That behavior is pluggable and it is possible to plug virtually any kind of = content. - + = Building your portlet --===============1411257210204365064==-- From portal-commits at lists.jboss.org Fri Feb 8 06:52:53 2008 Content-Type: multipart/mixed; boundary="===============4029735380142401431==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9870 - in branches/JBoss_Portal_Branch_2_6/core-cms/src: resources/portal-cms-war/WEB-INF/jsp/cms/admin and 1 other directory. Date: Fri, 08 Feb 2008 06:52:53 -0500 Message-ID: --===============4029735380142401431== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-08 06:52:53 -0500 (Fri, 08 Feb 2008) New Revision: 9870 Modified: branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core= /cms/ui/admin/CMSAdminPortlet.java branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/W= EB-INF/jsp/cms/admin/main.jsp branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/W= EB-INF/jsp/cms/admin/viewfile.jsp Log: JBPORTAL-1878: CMS admin GUI flow improvement Modified: branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/port= al/core/cms/ui/admin/CMSAdminPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/cor= e/cms/ui/admin/CMSAdminPortlet.java 2008-02-08 10:56:20 UTC (rev 9869) +++ branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/cor= e/cms/ui/admin/CMSAdminPortlet.java 2008-02-08 11:52:53 UTC (rev 9870) @@ -1215,14 +1215,15 @@ { aRes.setRenderParameter("confirm", "An error occurred while= setting the permissions.(" + e.toString() + ")"); success =3D false; + aRes.setRenderParameter("op", CMSAdminConstants.OP_CONFIRMS= ECURE); } = if (success) { aRes.setRenderParameter("confirm", "Security settings updat= ed successfully."); + aRes.setRenderParameter("op", aReq.getParameter("returnOp")= ); } = - aRes.setRenderParameter("op", CMSAdminConstants.OP_CONFIRMSECU= RE); aRes.setRenderParameter("path", aReq.getParameter("path")); aRes.setRenderParameter("returnOp", aReq.getParameter("returnO= p")); } Modified: branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cm= s-war/WEB-INF/jsp/cms/admin/main.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/= WEB-INF/jsp/cms/admin/main.jsp 2008-02-08 10:56:20 UTC (rev 9869) +++ branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/= WEB-INF/jsp/cms/admin/main.jsp 2008-02-08 11:52:53 UTC (rev 9870) @@ -14,6 +14,7 @@ = <% + String sConfirm =3D renderRequest.getParameter("confirm"); String sCurrPath =3D (String)request.getAttribute("currpath"); List folders =3D (List)request.getAttribute("folders"); List files =3D (List)request.getAttribute("files"); @@ -73,6 +74,17 @@
    +<% + if (sConfirm !=3D null && !"".equals(sConfirm)) + { +%> +
    <%=3D sConfirm %>
    +
    +<% + } +%> + +
    --===============4029735380142401431==-- From portal-commits at lists.jboss.org Fri Feb 8 06:57:12 2008 Content-Type: multipart/mixed; boundary="===============7220149348659750389==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9871 - in tags/JBoss_Portal_2_6_4/core-cms/src: resources/portal-cms-war/WEB-INF/jsp/cms/admin and 1 other directory. Date: Fri, 08 Feb 2008 06:57:12 -0500 Message-ID: --===============7220149348659750389== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-08 06:57:11 -0500 (Fri, 08 Feb 2008) New Revision: 9871 Modified: tags/JBoss_Portal_2_6_4/core-cms/src/main/org/jboss/portal/core/cms/ui/a= dmin/CMSAdminPortlet.java tags/JBoss_Portal_2_6_4/core-cms/src/resources/portal-cms-war/WEB-INF/js= p/cms/admin/main.jsp tags/JBoss_Portal_2_6_4/core-cms/src/resources/portal-cms-war/WEB-INF/js= p/cms/admin/viewfile.jsp Log: JBPORTAL-1878: CMS admin GUI flow improvement Modified: tags/JBoss_Portal_2_6_4/core-cms/src/main/org/jboss/portal/core/c= ms/ui/admin/CMSAdminPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- tags/JBoss_Portal_2_6_4/core-cms/src/main/org/jboss/portal/core/cms/ui/= admin/CMSAdminPortlet.java 2008-02-08 11:52:53 UTC (rev 9870) +++ tags/JBoss_Portal_2_6_4/core-cms/src/main/org/jboss/portal/core/cms/ui/= admin/CMSAdminPortlet.java 2008-02-08 11:57:11 UTC (rev 9871) @@ -1215,14 +1215,15 @@ { aRes.setRenderParameter("confirm", "An error occurred while= setting the permissions.(" + e.toString() + ")"); success =3D false; + aRes.setRenderParameter("op", CMSAdminConstants.OP_CONFIRMS= ECURE); } = if (success) { aRes.setRenderParameter("confirm", "Security settings updat= ed successfully."); + aRes.setRenderParameter("op", aReq.getParameter("returnOp")= ); } = - aRes.setRenderParameter("op", CMSAdminConstants.OP_CONFIRMSECU= RE); aRes.setRenderParameter("path", aReq.getParameter("path")); aRes.setRenderParameter("returnOp", aReq.getParameter("returnO= p")); } Modified: tags/JBoss_Portal_2_6_4/core-cms/src/resources/portal-cms-war/WEB= -INF/jsp/cms/admin/main.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- tags/JBoss_Portal_2_6_4/core-cms/src/resources/portal-cms-war/WEB-INF/j= sp/cms/admin/main.jsp 2008-02-08 11:52:53 UTC (rev 9870) +++ tags/JBoss_Portal_2_6_4/core-cms/src/resources/portal-cms-war/WEB-INF/j= sp/cms/admin/main.jsp 2008-02-08 11:57:11 UTC (rev 9871) @@ -14,6 +14,7 @@ = <% + String sConfirm =3D renderRequest.getParameter("confirm"); String sCurrPath =3D (String)request.getAttribute("currpath"); List folders =3D (List)request.getAttribute("folders"); List files =3D (List)request.getAttribute("files"); @@ -73,6 +74,17 @@
    +<% + if (sConfirm !=3D null && !"".equals(sConfirm)) + { +%> +
    <%=3D sConfirm %>
    +
    +<% + } +%> + +
    --===============7220149348659750389==-- From portal-commits at lists.jboss.org Fri Feb 8 13:30:25 2008 Content-Type: multipart/mixed; boundary="===============5474040999801574158==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9872 - in modules/portlet/trunk/test/src: test/resources/simple-portal-war/WEB-INF and 3 other directories. Date: Fri, 08 Feb 2008 13:30:25 -0500 Message-ID: --===============5474040999801574158== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-08 13:30:24 -0500 (Fri, 08 Feb 2008) New Revision: 9872 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/Constants.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/JspWriterResponse.java modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= jsp/ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= jsp/error.jsp Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PageTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/ParamTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortalBodyTagSupport.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortalSimpleTagSupport.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletMarkupTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTitleTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletURLTag.java modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= portal.tld modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= tags/portal/portlet.tag modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= default.jsp Log: start to handle errors (for now portlet not found) Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/taglib/Constants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/Constants.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/Constants.java 2008-02-08 18:30:24 UTC (rev 9872) @@ -0,0 +1,53 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.taglib; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public final class Constants +{ + + private Constants() + { + } + + /** . */ + public static final String ERROR_STATUS =3D "org.jboss.portal.portlet.p= ortal.error.status"; + + /** . */ + public static final String ERROR_EXCEPTION =3D "org.jboss.portal.portle= t.portal.error.exception"; + + /** . */ + public static final String ERROR_PORTLET_NAME =3D "org.jboss.portal.por= tlet.portal.error.portlet_name"; + + /** . */ + public static final String ERROR_APPLICATION_NAME =3D "org.jboss.portal= .portlet.portal.error.application_name"; + + /** . */ + public static final String ERROR_WINDOW_ID =3D "org.jboss.portal.portle= t.portal.error.window_id"; + + /** . */ + public static final String NOT_FOUND =3D "not_found"; +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/taglib/JspWriterResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/JspWriterResponse.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/JspWriterResponse.java 2008-02-08 18:30:24 UTC (rev 9872) @@ -0,0 +1,75 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.taglib; + +import org.jboss.portal.portlet.test.jsp.PortalResponse; + +import javax.servlet.http.HttpServletResponseWrapper; +import javax.servlet.jsp.JspWriter; +import javax.servlet.ServletOutputStream; +import java.io.PrintWriter; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class JspWriterResponse extends HttpServletResponseWrapper +{ + + /** . */ + private final JspWriter delegate; + + /** . */ + private final PrintWriter writer; + + public JspWriterResponse(PortalResponse portalResponse, JspWriter deleg= ate) + { + super(portalResponse); + + // + this.delegate =3D delegate; + this.writer =3D new PrintWriter(delegate); + } + + public PrintWriter getWriter() throws IOException + { + return writer; + } + + public ServletOutputStream getOutputStream() throws IOException + { + throw new IllegalArgumentException(); + } + + public void resetBuffer() + { + try + { + delegate.clearBuffer(); + } + catch (IOException ignore) + { + } + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PageTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageTag.java 2008-02-08 11:57:11 UTC (rev 9871) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageTag.java 2008-02-08 18:30:24 UTC (rev 9872) @@ -34,30 +34,58 @@ public class PageTag extends PortalBodyTagSupport { = + enum Status + { + INACTIVE, ACTIVE, SUSPENDED + } + String maximizedId; = String content; = + Status status =3D Status.INACTIVE; + public int doStartTag() throws JspException { - PortalResponse response =3D getPortalResponse(); + if (status =3D=3D Status.INACTIVE) + { + PortalResponse response =3D getPortalResponse(); = - // - maximizedId =3D response.getMaximizedWindowId(); + // + status =3D Status.ACTIVE; = - // - if (maximizedId !=3D null) - { - return EVAL_BODY_BUFFERED; + // + maximizedId =3D response.getMaximizedWindowId(); + + // + if (maximizedId !=3D null) + { + return EVAL_BODY_BUFFERED; + } + else + { + return EVAL_BODY_INCLUDE; + } } else { - return EVAL_BODY_INCLUDE; + return SKIP_BODY; } } = public int doEndTag() throws JspException { + switch (status) + { + case SUSPENDED: + break; + case INACTIVE: + break; + case ACTIVE: + status =3D Status.INACTIVE; + } + + // if (maximizedId !=3D null) { try @@ -70,6 +98,7 @@ } } = + // return EVAL_PAGE; } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/ParamTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/ParamTag.java 2008-02-08 11:57:11 UTC (rev 9871) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/ParamTag.java 2008-02-08 18:30:24 UTC (rev 9872) @@ -30,7 +30,7 @@ * @author Julien Viet * @version $Revision: 630 $ */ -public class ParamTag extends SimpleTagSupport +public class ParamTag extends PortalSimpleTagSupport { = /** . */ @@ -59,7 +59,7 @@ this.value =3D value; } = - public void doTag() throws JspException, IOException + public void internalDoTag() throws JspException, IOException { AbstractURLTag urlTag =3D (AbstractURLTag)SimpleTagSupport.findAnces= torWithClass(this, AbstractURLTag.class); urlTag.setParam(name, value); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortalBodyTagSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalBodyTagSupport.java 2008-02-08 11:57:11 UTC (rev 9871) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalBodyTagSupport.java 2008-02-08 18:30:24 UTC (rev 9872) @@ -25,6 +25,7 @@ import org.jboss.portal.portlet.test.jsp.PortalResponse; = import javax.servlet.jsp.tagext.BodyTagSupport; +import javax.servlet.jsp.JspException; = /** * @author Julien Viet @@ -36,4 +37,44 @@ { return (PortalResponse)pageContext.getResponse(); } + + public int doStartTag() throws JspException + { + PageTag pageTag =3D (PageTag)findAncestorWithClass(this, PageTag.cla= ss); + + // + if (pageTag =3D=3D null || pageTag.status !=3D PageTag.Status.ACTIVE) + { + return SKIP_BODY; + } + else + { + return internalDoStartTag(); + } + } + + public int doEndTag() throws JspException + { + PageTag pageTag =3D (PageTag)findAncestorWithClass(this, PageTag.cla= ss); + + // + if (pageTag !=3D null && pageTag.status =3D=3D PageTag.Status.ACTIVE) + { + return internalDoEndTag(); + } + else + { + return EVAL_PAGE; + } + } + + public int internalDoStartTag() throws JspException + { + return super.doStartTag(); + } + + public int internalDoEndTag() throws JspException + { + return super.doEndTag(); + } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortalSimpleTagSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalSimpleTagSupport.java 2008-02-08 11:57:11 UTC (rev 9871) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalSimpleTagSupport.java 2008-02-08 18:30:24 UTC (rev 9872) @@ -26,6 +26,8 @@ = import javax.servlet.jsp.tagext.SimpleTagSupport; import javax.servlet.jsp.PageContext; +import javax.servlet.jsp.JspException; +import java.io.IOException; = /** * @author Julien Viet @@ -38,4 +40,20 @@ PageContext pageContext =3D (PageContext)getJspContext(); return (PortalResponse)pageContext.getResponse(); } + + public void doTag() throws JspException, IOException + { + PageTag pageTag =3D (PageTag)findAncestorWithClass(this, PageTag.cla= ss); + + // + if (pageTag !=3D null && pageTag.status =3D=3D PageTag.Status.ACTIVE) + { + internalDoTag(); + } + } + + public void internalDoTag() throws JspException, IOException + { + super.doTag(); + } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletMarkupTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletMarkupTag.java 2008-02-08 11:57:11 UTC (rev 9871) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletMarkupTag.java 2008-02-08 18:30:24 UTC (rev 9872) @@ -39,9 +39,8 @@ */ public class PortletMarkupTag extends PortalSimpleTagSupport { - public void doTag() throws JspException, IOException + public void internalDoTag() throws JspException, IOException { - PortalResponse resp =3D getPortalResponse(); = PortletTag portletTag =3D (PortletTag)SimpleTagSupport.findAncestorW= ithClass(this, PortletTag.class); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-08 11:57:11 UTC (rev 9871) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-08 18:30:24 UTC (rev 9872) @@ -46,6 +46,10 @@ import org.jboss.portal.common.util.ParameterMap; = import javax.servlet.jsp.JspException; +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.http.HttpServletRequest; import java.util.LinkedHashSet; import java.util.Set; import java.util.Collections; @@ -74,125 +78,241 @@ private static final Set DEFAULT_WINDOW_STATES =3D Collect= ions.unmodifiableSet(Tools.toSet(WindowState.NORMAL, WindowState.MAXIMIZED,= WindowState.MINIMIZED)); = /** . */ - private String name; + private String nameAttr; = /** . */ - private String applicationName; + private String applicationNameAttr; = /** . */ - private String supportedWindowStateValues; + private String supportedWindowStatesAttr; = /** . */ - private String supportedModeValues; + private String supportedModesAttr; = /** . */ - private String initialModeValue; + private String initialModeAttr; = /** . */ + private String errorPageAttr; + + /** . */ private int status; = /** . */ + private Set supportedWindowStates; + + /** . */ + private Set supportedModes; + + /** . */ + private Mode initialMode; + + /** . */ PortletResult result; = public String getName() { - return name; + return nameAttr; } = public void setName(String name) { - this.name =3D name; + this.nameAttr =3D name; } = public String getApplicationName() { - return applicationName; + return applicationNameAttr; } = public void setApplicationName(String applicationName) { - this.applicationName =3D applicationName; + this.applicationNameAttr =3D applicationName; } = public String getSupportedWindowStates() { - return supportedWindowStateValues; + return supportedWindowStatesAttr; } = public void setSupportedWindowStates(String supportedWindowStates) { - this.supportedWindowStateValues =3D supportedWindowStates; + this.supportedWindowStatesAttr =3D supportedWindowStates; } = public String getSupportedModes() { - return supportedModeValues; + return supportedModesAttr; } = public void setSupportedModes(String supportedModes) { - this.supportedModeValues =3D supportedModes; + this.supportedModesAttr =3D supportedModes; } = public String getInitialMode() { - return initialModeValue; + return initialModeAttr; } = public void setInitialMode(String initialMode) { - this.initialModeValue =3D initialMode; + this.initialModeAttr =3D initialMode; } = - public int doStartTag() throws JspException + public String getErrorPage() { - PortalResponse response =3D getPortalResponse(); - PagePortletControllerContext context =3D response.getPortletControll= erContext(); - PageTag pageTag =3D (PageTag)findAncestorWithClass(this, PageTag.cla= ss); + return errorPageAttr; + } = - // - Portlet portlet =3D context.findPortlet(applicationName, name); + public void setErrorPage(String errorPage) + { + this.errorPageAttr =3D errorPage; + } = - // Compute window id - String windowId =3D portlet.getContext().getId() + "." + response.ne= xtId(); - + private void updateInternalState() + { // + Set supportedModes =3D new LinkedHashSet(); + if (supportedModesAttr !=3D null) + { + for (String supportedModeValue : supportedModesAttr.split(",")) + { + Mode mode =3D Mode.create(supportedModeValue.trim()); + supportedModes.add(mode); + } + } + else + { + supportedModes =3D DEFAULT_MODES; + } = // - if (pageTag.maximizedId !=3D null) + Set supportedWindowStates =3D new LinkedHashSet(); + if (supportedWindowStatesAttr !=3D null) { - if (windowId.equals(pageTag.maximizedId)) + for (String supportedWindowStateValue : supportedWindowStatesAttr= .split(",")) { - result =3D render(response, portlet, windowId); - status =3D BUFFERED; + WindowState windowState =3D WindowState.create(supportedWindow= StateValue.trim()); + supportedWindowStates.add(windowState); } - else - { - status =3D SKIPPED; - } } else { - result =3D render(response, portlet, windowId); - status =3D RENDERED; + supportedWindowStates =3D DEFAULT_WINDOW_STATES; } = // - switch (status) + Mode initialMode =3D Mode.VIEW; + if (initialModeAttr !=3D null) { - case SKIPPED: - return SKIP_BODY; - case RENDERED: - return EVAL_BODY_INCLUDE; - case BUFFERED: - return EVAL_BODY_BUFFERED; - default: - throw new AssertionError(); + initialMode =3D Mode.create(initialModeAttr.trim()); } + + // + this.initialMode =3D initialMode; + this.supportedModes =3D supportedModes; + this.supportedWindowStates =3D supportedWindowStates; } = - public int doEndTag() throws JspException +// private void handleError + + public int internalDoStartTag() throws JspException { + updateInternalState(); + + // + PortalResponse response =3D getPortalResponse(); + PagePortletControllerContext context =3D response.getPortletControll= erContext(); + PageTag pageTag =3D (PageTag)findAncestorWithClass(this, PageTag.cla= ss); + + // + Portlet portlet =3D context.findPortlet(applicationNameAttr, nameAtt= r); + + // + if (portlet =3D=3D null) + { + if (errorPageAttr !=3D null) + { + RequestDispatcher rd =3D pageContext.getServletContext().getRe= questDispatcher(errorPageAttr); + if (rd !=3D null) + { + ServletRequest request=3D pageContext.getRequest(); + + // + try + { + pageTag.status =3D PageTag.Status.SUSPENDED; + request.setAttribute(Constants.ERROR_STATUS, Constants.N= OT_FOUND); + request.setAttribute(Constants.ERROR_APPLICATION_NAME, a= pplicationNameAttr); + request.setAttribute(Constants.ERROR_PORTLET_NAME, nameA= ttr); + + // + rd.include(pageContext.getRequest(), new JspWriterRespon= se(response, pageContext.getOut())); + } + catch (ServletException e) + { + // Shall we do smth else ? + e.printStackTrace(); + } + catch (IOException e) + { + // Shall we do smth else ? + e.printStackTrace(); + } + finally + { + pageTag.status =3D PageTag.Status.ACTIVE; + request.removeAttribute(Constants.ERROR_STATUS); + request.removeAttribute(Constants.ERROR_APPLICATION_NAME= ); + request.removeAttribute(Constants.ERROR_PORTLET_NAME); + } + } + } + + // We cannot show an absent portlet, no meta data + return SKIP_BODY; + } + else + { + String windowId =3D portlet.getContext().getId() + "." + response= .nextId(); + + // + if (pageTag.maximizedId !=3D null) + { + if (windowId.equals(pageTag.maximizedId)) + { + result =3D render(response, portlet, windowId); + status =3D BUFFERED; + } + else + { + status =3D SKIPPED; + } + } + else + { + result =3D render(response, portlet, windowId); + status =3D RENDERED; + } + + // + switch (status) + { + case SKIPPED: + return SKIP_BODY; + case RENDERED: + return EVAL_BODY_INCLUDE; + case BUFFERED: + return EVAL_BODY_BUFFERED; + default: + throw new AssertionError(); + } + } + } + + public int internalDoEndTag() throws JspException + { result =3D null; = // @@ -222,43 +342,6 @@ PagePortletControllerContext context =3D response.getPortletControll= erContext(); = // - Set supportedModes =3D new LinkedHashSet(); - if (supportedModeValues !=3D null) - { - for (String supportedModeValue : supportedModeValues.split(",")) - { - Mode mode =3D Mode.create(supportedModeValue.trim()); - supportedModes.add(mode); - } - } - else - { - supportedModes =3D DEFAULT_MODES; - } - - // - Set supportedWindowStates =3D new LinkedHashSet(); - if (supportedWindowStateValues !=3D null) - { - for (String supportedWindowStateValue : supportedWindowStateValue= s.split(",")) - { - WindowState windowState =3D WindowState.create(supportedWindow= StateValue.trim()); - supportedWindowStates.add(windowState); - } - } - else - { - supportedWindowStates =3D DEFAULT_WINDOW_STATES; - } - - // - Mode initialMode =3D Mode.VIEW; - if (initialModeValue !=3D null) - { - initialMode =3D Mode.create(initialModeValue.trim()); - } - - // PageNavigationalState pageNS =3D response.getPageState(); = // @@ -297,7 +380,6 @@ } } = - // PortletInvocationContext renderContext =3D context.createPortletInvo= cationContext(windowId, pageNS); RenderInvocation render =3D new RenderInvocation(renderContext); @@ -331,8 +413,8 @@ = // return new PortletResult( - name, - applicationName, + nameAttr, + applicationNameAttr, windowId, portletResponse, initialMode, Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTitleTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTitleTag.java 2008-02-08 11:57:11 UTC (rev 9871) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTitleTag.java 2008-02-08 18:30:24 UTC (rev 9872) @@ -37,7 +37,7 @@ public class PortletTitleTag extends PortalSimpleTagSupport { = - public void doTag() throws JspException, IOException + public void internalDoTag() throws JspException, IOException { = PortletTag portletTag =3D (PortletTag)SimpleTagSupport.findAncestorW= ithClass(this, PortletTag.class); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-08 11:57:11 UTC (rev 9871) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-08 18:30:24 UTC (rev 9872) @@ -70,12 +70,12 @@ this.windowStateValue =3D windowState; } = - public int doStartTag() throws JspException + public int internalDoStartTag() throws JspException { return EVAL_BODY_BUFFERED; } = - public int doEndTag() throws JspException + public int internalDoEndTag() throws JspException { PortalResponse response =3D getPortalResponse(); PagePortletControllerContext context =3D response.getPortletControll= erContext(); Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-= INF/jsp/error.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jsp/error.jsp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jsp/error.jsp 2008-02-08 18:30:24 UTC (rev 9872) @@ -0,0 +1,7 @@ +<%@ page language=3D"java" %> +Portlet was not rendered
    +<%=3D request.getAttribute("org.jboss.portal.portlet.portal.error.status")= %>
    +<%=3D request.getAttribute("org.jboss.portal.portlet.portal.error.portlet_= name")%>
    +<%=3D request.getAttribute("org.jboss.portal.portlet.portal.error.applicat= ion_name")%>
    +<%=3D request.getAttribute("org.jboss.portal.portlet.portal.error.exceptio= n")%>
    +<%=3D request.getAttribute("org.jboss.portal.portlet.portal.error.window_i= d")%>
    Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/portal.tld =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.tld 2008-02-08 11:57:11 UTC (rev 9871) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.tld 2008-02-08 18:30:24 UTC (rev 9872) @@ -45,6 +45,11 @@ true java.lang.String + + errorPage + true + java.lang.String + = Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/tags/portal/portlet.tag =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /tags/portal/portlet.tag 2008-02-08 11:57:11 UTC (rev 9871) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /tags/portal/portlet.tag 2008-02-08 18:30:24 UTC (rev 9872) @@ -6,7 +6,8 @@ = + applicationName=3D"${applicationName}" + errorPage=3D"/WEB-INF/jsp/error.jsp">
    @@ -23,7 +24,7 @@ "> - ">= Edit + ">Edit
    Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/l= ayouts/default.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /default.jsp 2008-02-08 11:57:11 UTC (rev 9871) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /default.jsp 2008-02-08 18:30:24 UTC (rev 9872) @@ -29,6 +29,7 @@ + --===============5474040999801574158==-- From portal-commits at lists.jboss.org Fri Feb 8 15:30:53 2008 Content-Type: multipart/mixed; boundary="===============1894069041830098626==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9873 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples. Date: Fri, 08 Feb 2008 15:30:51 -0500 Message-ID: --===============1894069041830098626== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-08 15:30:51 -0500 (Fri, 08 Feb 2008) New Revision: 9873 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= /GoogleWeatherClippingPortlet.java Log: - Removed change location link (handled by edit mode). - Improved processing of HTML. Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/= samples/GoogleClippingPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/GoogleClippingPortlet.java 2008-02-08 18:30:24 UTC (rev 9872) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/GoogleClippingPortlet.java 2008-02-08 20:30:51 UTC (rev 9873) @@ -29,7 +29,6 @@ import javax.portlet.PortletException; import javax.portlet.PortletMode; import javax.portlet.PortletPreferences; -import javax.portlet.PortletURL; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import java.io.BufferedInputStream; @@ -85,10 +84,6 @@ renderResponse.setContentType("text/html"); PrintWriter printWriter =3D renderResponse.getWriter(); printWriter.print(html); - - PortletURL edit =3D renderResponse.createRenderURL(); - edit.setPortletMode(PortletMode.EDIT); - printWriter.print("

    Change location

    "); } } = @@ -141,19 +136,17 @@ = protected String postProcessHTML(String html) { - String tmp =3D new String(html); - // links should open in new windows - tmp =3D tmp.replaceAll(A, A_TARGET_BLANK); + html =3D html.replaceAll(A, A_TARGET_BLANK); = // src attributes should be absolute - tmp =3D tmp.replaceAll("src=3D/", "src=3Dhttp://google.com/"); - tmp =3D tmp.replaceAll("src=3D\"/", "src=3D\"http://google.com/"); + html =3D html.replaceAll("src=3D/", "src=3Dhttp://google.com/"); + html =3D html.replaceAll("src=3D\"/", "src=3D\"http://google.com/"); = // forms should open in new windows and have an absolute action URL - tmp =3D tmp.replaceAll("action=3D\"/", "target=3D'_blank' action=3D\= "http://google.com/"); + html =3D html.replaceAll("action=3D\"/", "target=3D'_blank' action= =3D\"http://google.com/"); = - return tmp; + return html; } = protected String getQueryString(String zip) Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/= samples/GoogleWeatherClippingPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/GoogleWeatherClippingPortlet.java 2008-02-08 18:30:24 UTC (rev 9872) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/GoogleWeatherClippingPortlet.java 2008-02-08 20:30:51 UTC (rev 9873) @@ -42,16 +42,14 @@ int begIndex; int endIndex; = - String tmp =3D new String(html); - // remove add to iGoogle link begIndex =3D html.indexOf(A); if (begIndex !=3D -1) { endIndex =3D html.indexOf(A_END, begIndex); - tmp =3D tmp.substring(0, begIndex) + html.substring(endIndex + A_= END.length()); + html =3D html.substring(0, begIndex) + html.substring(endIndex + = A_END.length()); } = - return super.postProcessHTML(tmp); + return super.postProcessHTML(html); } } --===============1894069041830098626==-- From portal-commits at lists.jboss.org Fri Feb 8 16:53:07 2008 Content-Type: multipart/mixed; boundary="===============6408539377951877236==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9874 - in modules/portlet/trunk/test/src: main/java/org/jboss/portal/portlet/portal and 11 other directories. Date: Fri, 08 Feb 2008 16:53:07 -0500 Message-ID: --===============6408539377951877236== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-08 16:53:06 -0500 (Fri, 08 Feb 2008) New Revision: 9874 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/basic/ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/basic/ErrorPortlet.java modules/portlet/trunk/test/src/test/resources/portal/ modules/portlet/trunk/test/src/test/resources/portal/samples/ modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/ modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/W= EB-INF/ modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/W= EB-INF/portlet.xml modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/W= EB-INF/web.xml Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/Constants.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTag.java modules/portlet/trunk/test/src/test/build.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= jsp/error.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= default.jsp Log: handle error return code in the jsp error Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/po= rtal/samples/basic/ErrorPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/ErrorPortlet.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/ErrorPortlet.java 2008-02-08 21:53:06 UTC (rev 9874) @@ -0,0 +1,41 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.samples.basic; + +import javax.portlet.GenericPortlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ErrorPortlet extends GenericPortlet +{ + protected void doView(RenderRequest renderRequest, RenderResponse rende= rResponse) throws PortletException, IOException + { + throw new PortletException("Some exception"); + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/Constants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/Constants.java 2008-02-08 20:30:51 UTC (rev 9873) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/Constants.java 2008-02-08 21:53:06 UTC (rev 9874) @@ -37,9 +37,12 @@ public static final String ERROR_STATUS =3D "org.jboss.portal.portlet.p= ortal.error.status"; = /** . */ - public static final String ERROR_EXCEPTION =3D "org.jboss.portal.portle= t.portal.error.exception"; + public static final String ERROR_CAUSE =3D "org.jboss.portal.portlet.po= rtal.error.cause"; = /** . */ + public static final String ERROR_MESSAGE =3D "org.jboss.portal.portlet.= portal.error.message"; + + /** . */ public static final String ERROR_PORTLET_NAME =3D "org.jboss.portal.por= tlet.portal.error.portlet_name"; = /** . */ @@ -50,4 +53,13 @@ = /** . */ public static final String NOT_FOUND =3D "not_found"; + + /** . */ + public static final String PORTLET_ERROR =3D "portlet_error"; + + /** . */ + public static final String INTERNAL_ERROR =3D "internal_error"; + + /** . */ + public static final String UNAVAILABLE =3D "unavailable"; } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-08 20:30:51 UTC (rev 9873) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-08 21:53:06 UTC (rev 9874) @@ -22,12 +22,14 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp.taglib; = -import org.jboss.portal.portlet.test.jsp.taglib.PortletResult; import org.jboss.portal.portlet.test.jsp.PortalResponse; import org.jboss.portal.portlet.test.jsp.PagePortletControllerContext; import org.jboss.portal.portlet.test.controller.TestInstanceContext; import org.jboss.portal.portlet.test.controller.TestPortalContext; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.response.FragmentResponse; +import org.jboss.portal.portlet.invocation.response.ErrorResponse; +import org.jboss.portal.portlet.invocation.response.UnavailableResponse; import org.jboss.portal.portlet.invocation.RenderInvocation; import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; @@ -49,7 +51,6 @@ import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.ServletRequest; -import javax.servlet.http.HttpServletRequest; import java.util.LinkedHashSet; import java.util.Set; import java.util.Collections; @@ -95,17 +96,12 @@ /** . */ private String errorPageAttr; = - /** . */ private int status; - - /** . */ private Set supportedWindowStates; - - /** . */ private Set supportedModes; - - /** . */ private Mode initialMode; + private PageTag pageTag; + private PortalResponse response; = /** . */ PortletResult result; @@ -213,18 +209,16 @@ this.initialMode =3D initialMode; this.supportedModes =3D supportedModes; this.supportedWindowStates =3D supportedWindowStates; + this.pageTag =3D (PageTag)findAncestorWithClass(this, PageTag.class); + this.response =3D getPortalResponse(); } = -// private void handleError - public int internalDoStartTag() throws JspException { updateInternalState(); = // - PortalResponse response =3D getPortalResponse(); PagePortletControllerContext context =3D response.getPortletControll= erContext(); - PageTag pageTag =3D (PageTag)findAncestorWithClass(this, PageTag.cla= ss); = // Portlet portlet =3D context.findPortlet(applicationNameAttr, nameAtt= r); @@ -232,44 +226,8 @@ // if (portlet =3D=3D null) { - if (errorPageAttr !=3D null) - { - RequestDispatcher rd =3D pageContext.getServletContext().getRe= questDispatcher(errorPageAttr); - if (rd !=3D null) - { - ServletRequest request=3D pageContext.getRequest(); + handleError(null, Constants.NOT_FOUND, null, null); = - // - try - { - pageTag.status =3D PageTag.Status.SUSPENDED; - request.setAttribute(Constants.ERROR_STATUS, Constants.N= OT_FOUND); - request.setAttribute(Constants.ERROR_APPLICATION_NAME, a= pplicationNameAttr); - request.setAttribute(Constants.ERROR_PORTLET_NAME, nameA= ttr); - - // - rd.include(pageContext.getRequest(), new JspWriterRespon= se(response, pageContext.getOut())); - } - catch (ServletException e) - { - // Shall we do smth else ? - e.printStackTrace(); - } - catch (IOException e) - { - // Shall we do smth else ? - e.printStackTrace(); - } - finally - { - pageTag.status =3D PageTag.Status.ACTIVE; - request.removeAttribute(Constants.ERROR_STATUS); - request.removeAttribute(Constants.ERROR_APPLICATION_NAME= ); - request.removeAttribute(Constants.ERROR_PORTLET_NAME); - } - } - } - // We cannot show an absent portlet, no meta data return SKIP_BODY; } @@ -282,39 +240,37 @@ { if (windowId.equals(pageTag.maximizedId)) { - result =3D render(response, portlet, windowId); status =3D BUFFERED; + + // + return render(portlet, windowId, EVAL_BODY_BUFFERED); } else { status =3D SKIPPED; + return SKIP_BODY; } } else { - result =3D render(response, portlet, windowId); status =3D RENDERED; - } = - // - switch (status) - { - case SKIPPED: - return SKIP_BODY; - case RENDERED: - return EVAL_BODY_INCLUDE; - case BUFFERED: - return EVAL_BODY_BUFFERED; - default: - throw new AssertionError(); + // + return render(portlet, windowId, EVAL_BODY_INCLUDE); } } } = public int internalDoEndTag() throws JspException { + if (bodyContent !=3D null) + { + pageTag.content =3D bodyContent.getString(); + } + result =3D null; = +/* // switch (status) { @@ -324,20 +280,17 @@ break; case BUFFERED: PageTag pageTag =3D (PageTag)findAncestorWithClass(this, PageT= ag.class); - pageTag.content =3D bodyContent.getString(); break; default: throw new AssertionError(); } = +*/ // return EVAL_PAGE; } = - public PortletResult render( - PortalResponse response, - Portlet portlet, - String windowId) + public int render(Portlet portlet, String windowId, int rt) { PagePortletControllerContext context =3D response.getPortletControll= erContext(); = @@ -397,28 +350,104 @@ render.setPublicNavigationalState(publicNS); = // - PortletInvocationResponse portletResponse =3D null; try { - portletResponse =3D context.invoke(render); + PortletInvocationResponse portletResponse =3D context.invoke(rend= er); = + // + if (portletResponse instanceof FragmentResponse) + { + result =3D new PortletResult( + nameAttr, + applicationNameAttr, + windowId, + portletResponse, + initialMode, + supportedModes, + supportedWindowStates); = + // + return rt; + } + else if (portletResponse instanceof ErrorResponse) + { + ErrorResponse error =3D (ErrorResponse)portletResponse; + + // + handleError(windowId, Constants.PORTLET_ERROR, error.getCause(= ), error.getMessage()); + + // + return SKIP_BODY; + } + else if (portletResponse instanceof UnavailableResponse) + { + handleError(windowId, Constants.UNAVAILABLE, null, null); + + // + return SKIP_BODY; + } + else + { + handleError(windowId, Constants.INTERNAL_ERROR, null, null); + + // + return SKIP_BODY; + } } catch (PortletInvokerException e) { - e.printStackTrace(); + handleError(windowId, Constants.INTERNAL_ERROR, e, e.getMessage()= ); = - // todo + // + return SKIP_BODY; } + } = - // - return new PortletResult( - nameAttr, - applicationNameAttr, - windowId, - portletResponse, - initialMode, - supportedModes, - supportedWindowStates); + private void handleError(String windowId, String errorStatus, Throwable= cause, String message) + { + if (errorPageAttr !=3D null) + { + RequestDispatcher rd =3D pageContext.getServletContext().getReque= stDispatcher(errorPageAttr); + if (rd !=3D null) + { + ServletRequest request=3D pageContext.getRequest(); + + // + try + { + pageTag.status =3D PageTag.Status.SUSPENDED; + request.setAttribute(Constants.ERROR_STATUS, errorStatus); + request.setAttribute(Constants.ERROR_CAUSE, cause); + request.setAttribute(Constants.ERROR_MESSAGE, message); + request.setAttribute(Constants.ERROR_WINDOW_ID, windowId); + request.setAttribute(Constants.ERROR_APPLICATION_NAME, appl= icationNameAttr); + request.setAttribute(Constants.ERROR_PORTLET_NAME, nameAttr= ); + + // + rd.include(pageContext.getRequest(), new JspWriterResponse(= response, pageContext.getOut())); + } + catch (ServletException e) + { + // Shall we do smth else ? + e.printStackTrace(); + } + catch (IOException e) + { + // Shall we do smth else ? + e.printStackTrace(); + } + finally + { + pageTag.status =3D PageTag.Status.ACTIVE; + request.removeAttribute(Constants.ERROR_STATUS); + request.removeAttribute(Constants.ERROR_CAUSE); + request.removeAttribute(Constants.ERROR_MESSAGE); + request.removeAttribute(Constants.ERROR_WINDOW_ID); + request.removeAttribute(Constants.ERROR_APPLICATION_NAME); + request.removeAttribute(Constants.ERROR_PORTLET_NAME); + } + } + } } + } Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-08 20:30:51 UTC (= rev 9873) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-08 21:53:06 UTC (= rev 9874) @@ -762,12 +762,23 @@ = - + + + + + + + + + + + + + = \ No newline at end of file Added: modules/portlet/trunk/test/src/test/resources/portal/samples/basic-w= ar/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/= WEB-INF/portlet.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/= WEB-INF/portlet.xml 2008-02-08 21:53:06 UTC (rev 9874) @@ -0,0 +1,41 @@ + + + + + + + ErrorPortlet + org.jboss.portal.portlet.portal.samples.basic.ErrorPo= rtlet + + text/html + + + + + + + Added: modules/portlet/trunk/test/src/test/resources/portal/samples/basic-w= ar/WEB-INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/= WEB-INF/web.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/= WEB-INF/web.xml 2008-02-08 21:53:06 UTC (rev 9874) @@ -0,0 +1,29 @@ + + + + + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/jsp/error.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jsp/error.jsp 2008-02-08 20:30:51 UTC (rev 9873) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jsp/error.jsp 2008-02-08 21:53:06 UTC (rev 9874) @@ -1,7 +1,19 @@ <%@ page language=3D"java" %> -Portlet was not rendered
    + +
    +
    +
    +
    +

    Error

    +
    +
    +
    +
    <%=3D request.getAttribute("org.jboss.portal.portlet.portal.error.status")= %>
    <%=3D request.getAttribute("org.jboss.portal.portlet.portal.error.portlet_= name")%>
    <%=3D request.getAttribute("org.jboss.portal.portlet.portal.error.applicat= ion_name")%>
    -<%=3D request.getAttribute("org.jboss.portal.portlet.portal.error.exceptio= n")%>
    +<%=3D request.getAttribute("org.jboss.portal.portlet.portal.error.cause")%= >
    +<%=3D request.getAttribute("org.jboss.portal.portlet.portal.error.message"= )%>
    <%=3D request.getAttribute("org.jboss.portal.portlet.portal.error.window_i= d")%>
    +
    +
    Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/l= ayouts/default.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /default.jsp 2008-02-08 20:30:51 UTC (rev 9873) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /default.jsp 2008-02-08 21:53:06 UTC (rev 9874) @@ -30,6 +30,7 @@ + --===============6408539377951877236==-- From portal-commits at lists.jboss.org Fri Feb 8 16:59:09 2008 Content-Type: multipart/mixed; boundary="===============5708294049934566268==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9875 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib. Date: Fri, 08 Feb 2008 16:59:09 -0500 Message-ID: --===============5708294049934566268== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-08 16:59:09 -0500 (Fri, 08 Feb 2008) New Revision: 9875 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/Constants.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/JspWriterResponse.java Log: don't need to be exposed outside of the package Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/Constants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/Constants.java 2008-02-08 21:53:06 UTC (rev 9874) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/Constants.java 2008-02-08 21:59:09 UTC (rev 9875) @@ -26,7 +26,7 @@ * @author Julien Viet * @version $Revision: 630 $ */ -public final class Constants +final class Constants { = private Constants() Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/JspWriterResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/JspWriterResponse.java 2008-02-08 21:53:06 UTC (rev 9874) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/JspWriterResponse.java 2008-02-08 21:59:09 UTC (rev 9875) @@ -34,7 +34,7 @@ * @author Julien Viet * @version $Revision: 630 $ */ -public class JspWriterResponse extends HttpServletResponseWrapper +class JspWriterResponse extends HttpServletResponseWrapper { = /** . */ --===============5708294049934566268==-- From portal-commits at lists.jboss.org Fri Feb 8 17:18:30 2008 Content-Type: multipart/mixed; boundary="===============4252667916816066485==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9876 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib. Date: Fri, 08 Feb 2008 17:18:30 -0500 Message-ID: --===============4252667916816066485== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-08 17:18:30 -0500 (Fri, 08 Feb 2008) New Revision: 9876 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTag.java Log: just make sure we clean state on tag Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-08 21:59:09 UTC (rev 9875) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-08 22:18:30 UTC (rev 9876) @@ -166,7 +166,7 @@ this.errorPageAttr =3D errorPage; } = - private void updateInternalState() + private void initState() { // Set supportedModes =3D new LinkedHashSet(); @@ -213,9 +213,18 @@ this.response =3D getPortalResponse(); } = + private void destroyState() + { + this.initialMode =3D null; + this.supportedModes =3D null; + this.supportedWindowStates =3D null; + this.pageTag =3D null; + this.response =3D null; + } + public int internalDoStartTag() throws JspException { - updateInternalState(); + initState(); = // PagePortletControllerContext context =3D response.getPortletControll= erContext(); @@ -268,24 +277,9 @@ pageTag.content =3D bodyContent.getString(); } = - result =3D null; - -/* // - switch (status) - { - case SKIPPED: - break; - case RENDERED: - break; - case BUFFERED: - PageTag pageTag =3D (PageTag)findAncestorWithClass(this, PageT= ag.class); - break; - default: - throw new AssertionError(); - } + destroyState(); = -*/ // return EVAL_PAGE; } --===============4252667916816066485==-- From portal-commits at lists.jboss.org Fri Feb 8 18:32:02 2008 Content-Type: multipart/mixed; boundary="===============2265758652467481418==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9877 - in modules/portlet/trunk/test/src: main/java/org/jboss/portal/portlet/test/jsp/taglib and 2 other directories. Date: Fri, 08 Feb 2008 18:32:02 -0500 Message-ID: --===============2265758652467481418== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-08 18:32:02 -0500 (Fri, 08 Feb 2008) New Revision: 9877 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PageParamTag.java Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PageTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTag.java modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= portal.tld modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= default.jsp Log: add page param that allow to set public render param on page before renderi= ng has occured Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PortalResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalResponse.java 2008-02-08 22:18:30 UTC (rev 9876) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalResponse.java 2008-02-08 23:32:02 UTC (rev 9877) @@ -22,16 +22,28 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp; = -import org.jboss.portal.portlet.test.jsp.PagePortletControllerContext; +import org.jboss.portal.portlet.test.controller.TestInstanceContext; +import org.jboss.portal.portlet.test.controller.TestPortalContext; import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.RenderInvocation; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.impl.spi.AbstractClientContext; +import org.jboss.portal.portlet.impl.spi.AbstractServerContext; +import org.jboss.portal.portlet.impl.spi.AbstractUserContext; +import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; +import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; +import org.jboss.portal.portlet.spi.PortletInvocationContext; import org.jboss.portal.WindowState; +import org.jboss.portal.Mode; +import org.jboss.portal.common.util.ParameterMap; = import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponseWrapper; -import javax.servlet.ServletOutputStream; -import java.io.IOException; -import java.io.PrintWriter; +import javax.xml.namespace.QName; = /** * @author Julien Viet @@ -41,17 +53,17 @@ { = /** . */ -// private final ResponseBuffer buffer =3D new ResponseBuffer(); - - /** . */ private final PagePortletControllerContext portletControllerContext; = /** . */ - private final PageNavigationalState pageState; + private PageNavigationalState pageState; = /** . */ private int count =3D 0; = + /** Wether or not the page state can be modified. */ + private boolean pageStateModifiable; + public PortalResponse( HttpServletResponse response, PagePortletControllerContext portletControllerContext, @@ -62,6 +74,7 @@ // this.portletControllerContext =3D portletControllerContext; this.pageState =3D pageState; + this.pageStateModifiable =3D true; } = /** @@ -74,46 +87,108 @@ return pageState; } = - public String getMaximizedWindowId() + public PortletInvocationResponse render(Portlet portlet, String windowI= d) throws PortletInvokerException { + WindowNavigationalState windowNS =3D null; if (pageState !=3D null) { - for (String windowId : pageState.getWindowIds()) + windowNS =3D pageState.getWindowNavigationalState(windowId); + } + + // + ParameterMap publicNS =3D null; + if (pageState !=3D null) + { + publicNS =3D pageState.getPublicNavigationalState(windowId); + } + + // + Mode mode =3D Mode.VIEW; + WindowState windowState =3D WindowState.NORMAL; + StateString portletNS =3D null; + + // + if (windowNS !=3D null) + { + if (windowNS.getMode() !=3D null) { - WindowNavigationalState windowNS =3D pageState.getWindowNaviga= tionalState(windowId); - if (WindowState.MAXIMIZED.equals(windowNS.getWindowState())) - { - return windowId; - } + mode =3D windowNS.getMode(); } + if (windowNS.getWindowState() !=3D null) + { + windowState =3D windowNS.getWindowState(); + } + if (windowNS.getPortletNavigationalState() !=3D null) + { + portletNS =3D windowNS.getPortletNavigationalState(); + } } = // - return null; + PortletInvocationContext renderContext =3D portletControllerContext.= createPortletInvocationContext(windowId, pageState); + RenderInvocation render =3D new RenderInvocation(renderContext); + render.setClientContext(new AbstractClientContext(portletControllerC= ontext.getClientRequest())); + render.setServerContext(new AbstractServerContext(portletControllerC= ontext.getClientRequest(), portletControllerContext.getClientResponse())); + render.setInstanceContext(new TestInstanceContext(portletControllerC= ontext.getClientRequest(), portlet.getContext(), false)); + render.setUserContext(new AbstractUserContext(portletControllerConte= xt.getClientRequest())); + render.setWindowContext(new AbstractWindowContext(windowId)); + render.setPortalContext(new TestPortalContext()); + render.setSecurityContext(new AbstractSecurityContext(portletControl= lerContext.getClientRequest())); + render.setTarget(portlet.getContext()); + render.setMode(mode); + render.setWindowState(windowState); + render.setNavigationalState(portletNS); + render.setPublicNavigationalState(publicNS); + + // + pageStateModifiable =3D false; + + // + return portletControllerContext.invoke(render); } = - public boolean isRenderable(String windowId) + public boolean isPageStateModifiable() { - if (windowId =3D=3D null) + return pageStateModifiable; + } + + public String getPageParameter(QName name) + { + return pageState !=3D null ? pageState.getPublicNavigationalState(na= me)[0] : null; + } + + public void setPageParameter(QName name, String value) + { + if (pageStateModifiable) { - throw new IllegalArgumentException(); + if (pageState =3D=3D null) + { + pageState =3D portletControllerContext.getStateControllerConte= xt().createPageState(true); + } + pageState.setPublicNavigationalState(name, new String[]{value}); } - - // - if (pageState =3D=3D null) + else { - return false; + throw new IllegalStateException("Page state cannot be modified"); } + } = - // - String maximizedWindowId =3D getMaximizedWindowId(); - if (maximizedWindowId !=3D null) + public String getMaximizedWindowId() + { + if (pageState !=3D null) { - return maximizedWindowId.equals(windowId); + for (String windowId : pageState.getWindowIds()) + { + WindowNavigationalState windowNS =3D pageState.getWindowNaviga= tionalState(windowId); + if (WindowState.MAXIMIZED.equals(windowNS.getWindowState())) + { + return windowId; + } + } } = // - return true; + return null; } = public PagePortletControllerContext getPortletControllerContext() @@ -121,38 +196,8 @@ return portletControllerContext; } = -// public ResponseBuffer getBuffer() -// { -// return buffer; -// } -// -// public ServletOutputStream getOutputStream() throws IOException -// { -// return buffer.getOutputStream(); -// } -// -// public PrintWriter getWriter() throws IOException -// { -// return buffer.getWriter(); -// } -// -// public void close() -// { -// buffer.close(); -// } - public String nextId() { return "" + count++; } - -// public ServletOutputStream getOutputStream() throws IOException -// { -// return out.getOutputStream(); -// } -// -// public PrintWriter getWriter() throws IOException -// { -// return out.getWriter(); -// } } Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/taglib/PageParamTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageParamTag.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageParamTag.java 2008-02-08 23:32:02 UTC (rev 9877) @@ -0,0 +1,106 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.taglib; + +import org.jboss.portal.portlet.test.jsp.PortalResponse; + +import javax.servlet.jsp.JspException; +import javax.xml.namespace.QName; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PageParamTag extends PortalSimpleTagSupport +{ + + /** . */ + private String namespaceURI; + + /** . */ + private String localName; + + /** . */ + private String value; + + /** . */ + private String frozen; + + public String getNamespaceURI() + { + return namespaceURI; + } + + public void setNamespaceURI(String namespaceURI) + { + this.namespaceURI =3D namespaceURI; + } + + public String getLocalName() + { + return localName; + } + + public void setLocalName(String localName) + { + this.localName =3D localName; + } + + public String getValue() + { + return value; + } + + public void setValue(String value) + { + this.value =3D value; + } + + public String getFrozen() + { + return frozen; + } + + public void setFrozen(String frozen) + { + this.frozen =3D frozen; + } + + public void internalDoTag() throws JspException, IOException + { + PortalResponse response =3D getPortalResponse(); + + // + if (response.isPageStateModifiable()) + { + QName name =3D new QName(namespaceURI, localName); + + // + if (!"true".equals(frozen) || response.getPageParameter(name) =3D= =3D null) + { + response.setPageParameter(name, value); + } + } + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PageTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageTag.java 2008-02-08 22:18:30 UTC (rev 9876) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageTag.java 2008-02-08 23:32:02 UTC (rev 9877) @@ -25,7 +25,9 @@ import org.jboss.portal.portlet.test.jsp.PortalResponse; = import javax.servlet.jsp.JspException; +import javax.xml.namespace.QName; import java.io.IOException; +import java.util.Map; = /** * @author Julien Viet @@ -39,10 +41,16 @@ INACTIVE, ACTIVE, SUSPENDED } = + /** . */ + Map params; + + /** . */ String maximizedId; = + /** . */ String content; = + /** . */ Status status =3D Status.INACTIVE; = public int doStartTag() throws JspException Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-08 22:18:30 UTC (rev 9876) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-08 23:32:02 UTC (rev 9877) @@ -24,28 +24,15 @@ = import org.jboss.portal.portlet.test.jsp.PortalResponse; import org.jboss.portal.portlet.test.jsp.PagePortletControllerContext; -import org.jboss.portal.portlet.test.controller.TestInstanceContext; -import org.jboss.portal.portlet.test.controller.TestPortalContext; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.ErrorResponse; import org.jboss.portal.portlet.invocation.response.UnavailableResponse; -import org.jboss.portal.portlet.invocation.RenderInvocation; -import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.controller.state.WindowNavigationalState; -import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.Portlet; -import org.jboss.portal.portlet.impl.spi.AbstractClientContext; -import org.jboss.portal.portlet.impl.spi.AbstractServerContext; -import org.jboss.portal.portlet.impl.spi.AbstractUserContext; -import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; -import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; -import org.jboss.portal.portlet.spi.PortletInvocationContext; import org.jboss.portal.Mode; import org.jboss.portal.WindowState; import org.jboss.portal.common.util.Tools; -import org.jboss.portal.common.util.ParameterMap; = import javax.servlet.jsp.JspException; import javax.servlet.RequestDispatcher; @@ -64,15 +51,6 @@ { = /** . */ - private static final int SKIPPED =3D 0; - - /** . */ - private static final int BUFFERED =3D 1; - - /** . */ - private static final int RENDERED =3D 2; - - /** . */ private static final Set DEFAULT_MODES =3D Collections.unmodifiab= leSet(Tools.toSet(Mode.VIEW, Mode.EDIT, Mode.HELP)); = /** . */ @@ -96,7 +74,6 @@ /** . */ private String errorPageAttr; = - private int status; private Set supportedWindowStates; private Set supportedModes; private Mode initialMode; @@ -249,22 +226,15 @@ { if (windowId.equals(pageTag.maximizedId)) { - status =3D BUFFERED; - - // return render(portlet, windowId, EVAL_BODY_BUFFERED); } else { - status =3D SKIPPED; return SKIP_BODY; } } else { - status =3D RENDERED; - - // return render(portlet, windowId, EVAL_BODY_INCLUDE); } } @@ -286,67 +256,9 @@ = public int render(Portlet portlet, String windowId, int rt) { - PagePortletControllerContext context =3D response.getPortletControll= erContext(); - - // - PageNavigationalState pageNS =3D response.getPageState(); - - // - WindowNavigationalState windowNS =3D null; - if (pageNS !=3D null) - { - windowNS =3D pageNS.getWindowNavigationalState(windowId); - } - - // - ParameterMap publicNS =3D null; - if (pageNS !=3D null) - { - publicNS =3D pageNS.getPublicNavigationalState(windowId); - } - - // - Mode mode =3D Mode.VIEW; - WindowState windowState =3D WindowState.NORMAL; - StateString portletNS =3D null; - - // - if (windowNS !=3D null) - { - if (windowNS.getMode() !=3D null) - { - mode =3D windowNS.getMode(); - } - if (windowNS.getWindowState() !=3D null) - { - windowState =3D windowNS.getWindowState(); - } - if (windowNS.getPortletNavigationalState() !=3D null) - { - portletNS =3D windowNS.getPortletNavigationalState(); - } - } - - // - PortletInvocationContext renderContext =3D context.createPortletInvo= cationContext(windowId, pageNS); - RenderInvocation render =3D new RenderInvocation(renderContext); - render.setClientContext(new AbstractClientContext(context.getClientR= equest())); - render.setServerContext(new AbstractServerContext(context.getClientR= equest(), context.getClientResponse())); - render.setInstanceContext(new TestInstanceContext(context.getClientR= equest(), portlet.getContext(), false)); - render.setUserContext(new AbstractUserContext(context.getClientReque= st())); - render.setWindowContext(new AbstractWindowContext(windowId)); - render.setPortalContext(new TestPortalContext()); - render.setSecurityContext(new AbstractSecurityContext(context.getCli= entRequest())); - render.setTarget(portlet.getContext()); - render.setMode(mode); - render.setWindowState(windowState); - render.setNavigationalState(portletNS); - render.setPublicNavigationalState(publicNS); - - // try { - PortletInvocationResponse portletResponse =3D context.invoke(rend= er); + PortletInvocationResponse portletResponse =3D response.render(por= tlet, windowId); = // if (portletResponse instanceof FragmentResponse) Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/portal.tld =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.tld 2008-02-08 22:18:30 UTC (rev 9876) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.tld 2008-02-08 23:32:02 UTC (rev 9877) @@ -86,14 +86,45 @@ empty name + true true java.lang.String value + true true java.lang.String = + + pageparam + org.jboss.portal.portlet.test.jsp.taglib.PageParamTag + empty + + namespaceURI + true + true + java.lang.String + + + localName + true + true + java.lang.String + + + value + true + true + java.lang.String + + + frozen + true + java.lang.String + + + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/l= ayouts/default.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /default.jsp 2008-02-08 22:18:30 UTC (rev 9876) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /default.jsp 2008-02-08 23:32:02 UTC (rev 9877) @@ -26,6 +26,9 @@ =
    + + + --===============2265758652467481418==-- From portal-commits at lists.jboss.org Fri Feb 8 18:45:47 2008 Content-Type: multipart/mixed; boundary="===============1526683501781291556==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9878 - in modules/portlet/trunk/test/src: test/resources/simple-portal-war/WEB-INF/jsp and 1 other directories. Date: Fri, 08 Feb 2008 18:45:46 -0500 Message-ID: --===============1526683501781291556== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-08 18:45:46 -0500 (Fri, 08 Feb 2008) New Revision: 9878 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples= /RemoteControlResourcePortlet.java modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= jsp/error.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= tags/portal/portlet.tag Log: - Minor improvements. Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/= samples/RemoteControlResourcePortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/RemoteControlResourcePortlet.java 2008-02-08 23:32:02 UTC (rev 9877) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/RemoteControlResourcePortlet.java 2008-02-08 23:45:46 UTC (rev 9878) @@ -45,20 +45,20 @@ writer.print(""); PortletURL url =3D resourceResponse.createRenderURL(); url.setWindowState(WindowState.MINIMIZED); - writer.print(""); writer.print("

    'zipcode' public render parameter value: " += resourceRequest.getParameter(ZIPCODE) + "
    "); - writer.print("

    Set value of 'zipcode' public render paramet= er to:"); + writer.print("Set value of 'zipcode' public render parameter = to:

    "); url.setParameter(ZIPCODE, "80201"); - writer.print("
  • Denver"); + writer.print("

    "); + writer.print(""); } = private String createParentURL(PortletURL url) Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/jsp/error.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jsp/error.jsp 2008-02-08 23:32:02 UTC (rev 9877) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jsp/error.jsp 2008-02-08 23:45:46 UTC (rev 9878) @@ -2,18 +2,20 @@ =
    -
    -
    -

    Error

    -
    +
    +
    +
    +

    <%=3D request.getAttribute("org.jboss.portal.portlet.po= rtal.error.portlet_name")%> +

    +
    +

    Portlet was not rendered

    + Error status: <%=3D request.getAttribute("org.jboss.portal.po= rtlet.portal.error.status")%>
    + Portlet name: <%=3D request.getAttribute("org.jboss.portal.po= rtlet.portal.error.portlet_name")%>
    + Portlet application + name: <%=3D request.getAttribute("org.jboss.portal.portlet.po= rtal.error.application_name")%>
    + Exception: <%=3D request.getAttribute("org.jboss.portal.portl= et.portal.error.exception")%>
    + Window id: <%=3D request.getAttribute("org.jboss.portal.portl= et.portal.error.window_id")%>
    -<%=3D request.getAttribute("org.jboss.portal.portlet.portal.error.status")= %>
    -<%=3D request.getAttribute("org.jboss.portal.portlet.portal.error.portlet_= name")%>
    -<%=3D request.getAttribute("org.jboss.portal.portlet.portal.error.applicat= ion_name")%>
    -<%=3D request.getAttribute("org.jboss.portal.portlet.portal.error.cause")%= >
    -<%=3D request.getAttribute("org.jboss.portal.portlet.portal.error.message"= )%>
    -<%=3D request.getAttribute("org.jboss.portal.portlet.portal.error.window_i= d")%>
    -
    Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/tags/portal/portlet.tag =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /tags/portal/portlet.tag 2008-02-08 23:32:02 UTC (rev 9877) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /tags/portal/portlet.tag 2008-02-08 23:45:46 UTC (rev 9878) @@ -1,38 +1,36 @@ <%@ tag body-content=3D"scriptless" %> <%@ attribute name=3D"name" rtexprvalue=3D"true" required=3D"true" %> <%@ attribute name=3D"applicationName" rtexprvalue=3D"true" required=3D"tr= ue" %> -<%@ attribute name=3D"content" fragment=3D"true" required=3D"false" %> = +<%@ attribute name=3D"content" fragment=3D"true" required=3D"false" %> <%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> = - -
    -
    -
    -
    -

    -
    - - "> - - - ">3D""/= - - - "> - - - ">Edit - + +
    +
    +
    +
    +

    +
    + + ">3D""/ + + + ">3D""/ + + + ">3D""/ + + + ">Edit + +
    +
    + +
    - - - - -
    -
    --===============1526683501781291556==-- From portal-commits at lists.jboss.org Fri Feb 8 19:11:22 2008 Content-Type: multipart/mixed; boundary="===============4833134717961173181==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9879 - in modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts: nav and 1 other directory. Date: Fri, 08 Feb 2008 19:11:22 -0500 Message-ID: --===============4833134717961173181== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-08 19:11:22 -0500 (Fri, 08 Feb 2008) New Revision: 9879 Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= default.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= nav/main.jsp Log: - Minor fixes. Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/l= ayouts/default.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /default.jsp 2008-02-08 23:45:46 UTC (rev 9878) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /default.jsp 2008-02-09 00:11:22 UTC (rev 9879) @@ -5,41 +5,37 @@ <%@ page isELIgnored=3D"false" %> +PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" +"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -Portlet Container 2.0 - + Portlet Container 2.0 + =
    -
    - 3D""/ -
    +
    3D"Portlet

    <%@ include file=3D"nav/main.jsp" %> - = +
    - - - - - - - - - - - - - + + + + + + + + + + +

    Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/l= ayouts/nav/main.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /nav/main.jsp 2008-02-08 23:45:46 UTC (rev 9878) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /nav/main.jsp 2008-02-09 00:11:22 UTC (rev 9879) @@ -5,20 +5,20 @@ <%@ page isELIgnored=3D"false" %> +PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" +"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> = -
    - -
    -
    +
    + +
    +
    --===============4833134717961173181==-- From portal-commits at lists.jboss.org Fri Feb 8 21:34:48 2008 Content-Type: multipart/mixed; boundary="===============0389458796471606909==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9880 - in modules/portlet/trunk/test/src/test/resources/simple-portal-war: css and 2 other directories. Date: Fri, 08 Feb 2008 21:34:46 -0500 Message-ID: --===============0389458796471606909== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-08 21:34:45 -0500 (Fri, 08 Feb 2008) New Revision: 9880 Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= demo.jsp Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= tags/portal/layout1.tag modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mast= er.css modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= default.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= nav/main.jsp Log: home page changes and cleanup, new page layout Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/tags/portal/layout1.tag =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /tags/portal/layout1.tag 2008-02-09 00:11:22 UTC (rev 9879) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /tags/portal/layout1.tag 2008-02-09 02:34:45 UTC (rev 9880) @@ -4,15 +4,14 @@ = <%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> = +
    + +
    +
    + +
    = -
    - -
    -
    - -
    = = = = - Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/c= ss/master.css =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-09 00:11:22 UTC (rev 9879) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-09 02:34:45 UTC (rev 9880) @@ -103,6 +103,13 @@ padding: 0; } = +h2.title { + font-size: 1.9em; + color: #fff; + margin: 0; + padding: 0; +} + h3 { font-size: 1.0em; color: #fff; Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/l= ayouts/default.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /default.jsp 2008-02-09 00:11:22 UTC (rev 9879) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /default.jsp 2008-02-09 02:34:45 UTC (rev 9880) @@ -5,12 +5,12 @@ <%@ page isELIgnored=3D"false" %> + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - Portlet Container 2.0 - +Portlet Container 2.0 + = @@ -24,18 +24,79 @@ =
    - - - - - - - - - - - - +
    +
    + +
    +

    Demo Page Title

    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    +
    +

    Copied: modules/portlet/trunk/test/src/test/resources/simple-portal-war/lay= outs/demo.jsp (from rev 9874, modules/portlet/trunk/test/src/test/resources= /simple-portal-war/layouts/default.jsp) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /demo.jsp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /demo.jsp 2008-02-09 02:34:45 UTC (rev 9880) @@ -0,0 +1,47 @@ +<%@ page contentType=3D"text/html" %> +<%@ page language=3D"java" %> +<%@ taglib prefix=3D"jbp" tagdir=3D"/WEB-INF/tags/portal" %> +<%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> +<%@ page isELIgnored=3D"false" %> + + + + +Portlet Container 2.0 + + + + +
    +
    +
    +
    + +
    +
    +
    + <%@ include file=3D"nav/main.jsp" %> + = +
    + + + + + + + + + + + + + + +
    +
    +
    + + + \ No newline at end of file Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/l= ayouts/nav/main.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /nav/main.jsp 2008-02-09 00:11:22 UTC (rev 9879) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /nav/main.jsp 2008-02-09 02:34:45 UTC (rev 9880) @@ -5,20 +5,17 @@ <%@ page isELIgnored=3D"false" %> + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> = -
    - -
    -
    +
    + +
    +
    --===============0389458796471606909==-- From portal-commits at lists.jboss.org Fri Feb 8 22:13:22 2008 Content-Type: multipart/mixed; boundary="===============0561074776783888766==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9881 - in modules/portlet/trunk/test/src/test/resources/simple-portal-war: demo and 2 other directories. Date: Fri, 08 Feb 2008 22:13:22 -0500 Message-ID: --===============0561074776783888766== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-08 22:13:21 -0500 (Fri, 08 Feb 2008) New Revision: 9881 Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/hom= e.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= footer.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= header.jsp Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= nav/main.jsp Log: nav changes and cleanup Copied: modules/portlet/trunk/test/src/test/resources/simple-portal-war/dem= o/demo.jsp (from rev 9880, modules/portlet/trunk/test/src/test/resources/si= mple-portal-war/layouts/demo.jsp) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo.jsp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo.jsp 2008-02-09 03:13:21 UTC (rev 9881) @@ -0,0 +1,25 @@ +<%@ page contentType=3D"text/html" %> +<%@ page language=3D"java" %> +<%@ taglib prefix=3D"jbp" tagdir=3D"/WEB-INF/tags/portal" %> +<%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> +<%@ page isELIgnored=3D"false" %> + + <%@ include file=3D"/layouts/header.jsp" %> + = +
    + + + + + + + + + + + + + + + + <%@ include file=3D"/layouts/footer.jsp" %> \ No newline at end of file Copied: modules/portlet/trunk/test/src/test/resources/simple-portal-war/dem= o/home.jsp (from rev 9880, modules/portlet/trunk/test/src/test/resources/si= mple-portal-war/layouts/default.jsp) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/ho= me.jsp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/ho= me.jsp 2008-02-09 03:13:21 UTC (rev 9881) @@ -0,0 +1,86 @@ +<%@ page contentType=3D"text/html" %> +<%@ page language=3D"java" %> +<%@ taglib prefix=3D"jbp" tagdir=3D"/WEB-INF/tags/portal" %> +<%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> +<%@ page isELIgnored=3D"false" %> + + <%@ include file=3D"/layouts/header.jsp" %> + +
    + +
    +
    + +
    +

    Demo Page Title

    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    +
    + +
    + + <%@ include file=3D"/layouts/footer.jsp" %> \ No newline at end of file Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/i= ndex.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-09 02:34:45 UTC (rev 9880) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-09 03:13:21 UTC (rev 9881) @@ -3,6 +3,8 @@ <%@ page isELIgnored=3D"false" %> - + + + Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/layo= uts/footer.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /footer.jsp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /footer.jsp 2008-02-09 03:13:21 UTC (rev 9881) @@ -0,0 +1,6 @@ +
    +
    +
    + + + \ No newline at end of file Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/layo= uts/header.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /header.jsp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /header.jsp 2008-02-09 03:13:21 UTC (rev 9881) @@ -0,0 +1,18 @@ + + + + +Portlet Container 2.0 + + + + +
    +
    +
    +
    3D"Portlet
    +
    +
    + <%@ include file=3D"nav/main.jsp" %> \ No newline at end of file Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/l= ayouts/nav/main.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /nav/main.jsp 2008-02-09 02:34:45 UTC (rev 9880) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /nav/main.jsp 2008-02-09 03:13:21 UTC (rev 9881) @@ -3,6 +3,7 @@ <%@ taglib prefix=3D"jbp" tagdir=3D"/WEB-INF/tags/portal" %> <%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> <%@ page isELIgnored=3D"false" %> +<%@ taglib prefix=3D"fn" uri=3D"http://java.sun.com/jsp/jstl/functions" %>
    --===============0561074776783888766==-- From portal-commits at lists.jboss.org Fri Feb 8 22:22:01 2008 Content-Type: multipart/mixed; boundary="===============9202173049097477338==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9882 - in modules/portlet/trunk/test/src/test/resources/simple-portal-war: layouts and 1 other directory. Date: Fri, 08 Feb 2008 22:22:01 -0500 Message-ID: --===============9202173049097477338== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-08 22:22:01 -0500 (Fri, 08 Feb 2008) New Revision: 9882 Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/hom= e.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= header.jsp Log: cleanup Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/demo.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo.jsp 2008-02-09 03:13:21 UTC (rev 9881) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo.jsp 2008-02-09 03:22:01 UTC (rev 9882) @@ -6,7 +6,6 @@ = <%@ include file=3D"/layouts/header.jsp" %> = -
    Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/home.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/ho= me.jsp 2008-02-09 03:13:21 UTC (rev 9881) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/ho= me.jsp 2008-02-09 03:22:01 UTC (rev 9882) @@ -6,7 +6,6 @@ = <%@ include file=3D"/layouts/header.jsp" %> = -
    Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/l= ayouts/header.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /header.jsp 2008-02-09 03:13:21 UTC (rev 9881) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /header.jsp 2008-02-09 03:22:01 UTC (rev 9882) @@ -15,4 +15,5 @@
    3D"Portlet

    - <%@ include file=3D"nav/main.jsp" %> \ No newline at end of file + <%@ include file=3D"nav/main.jsp" %> +
    \ No newline at end of file --===============9202173049097477338==-- From portal-commits at lists.jboss.org Fri Feb 8 23:57:27 2008 Content-Type: multipart/mixed; boundary="===============1333866106275691248==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9883 - in modules/portlet/trunk: test/src/main/java/org/jboss/portal/portlet/test/jsp and 9 other directories. Date: Fri, 08 Feb 2008 23:57:27 -0500 Message-ID: --===============1333866106275691248== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-08 23:57:27 -0500 (Fri, 08 Feb 2008) New Revision: 9883 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples= /event/ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples= /event/CartEvent.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples= /event/CartPortlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples= /event/Catalog.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples= /event/CatalogItem.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples= /event/CatalogPortlet.java modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/ modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/WEB= -INF/ modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/WEB= -INF/portlet.xml modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/WEB= -INF/web.xml Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/StateAwareResponseImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PagePortletControllerContext.java modules/portlet/trunk/test/src/test/build.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= default.jsp Log: - Added event demo portlets: a catalog and a cart. Does not currently work = as there seems to be problem with the event processing. - Modified PagePortletControllerContext.getPortlet as the given parameter i= s not always a windowId (in particular, it's a portlet id when processing e= vents). The current fix is probably a hack and indicative of a more serious issue= (as evidenced with further problems down the stream). - Fixed incorrect forward in index.jsp. Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/StateAwareResponseImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/StateAwareResponseImpl.java 2008-02-09 03:22:01 UTC (rev 9882) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/StateAwareResponseImpl.java 2008-02-09 04:57:27 UTC (rev 9883) @@ -283,11 +283,11 @@ // Check jaxb annotation if (requiresJAXBAnnotation(valueType)) { - for (Annotation a : value.getClass().getAnnotations()) + for (Annotation a : valueType.getAnnotations()) { System.out.println("a =3D " + a); } - boolean b =3D value.getClass().isAnnotationPresent(XmlRootElem= ent.class); + boolean b =3D valueType.isAnnotationPresent(XmlRootElement.cla= ss); if (!b) { throw new IllegalArgumentException("The provided event valu= e type " + value.getClass().getName() + Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PagePortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-09 03:22:01 UTC (rev 9882) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-09 04:57:27 UTC (rev 9883) @@ -22,25 +22,25 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp; = -import org.jboss.portal.portlet.test.controller.AbstractPortletControllerC= ontext; import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletContext; +import org.jboss.portal.portlet.PortletInvoker; import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.PortletInvoker; -import org.jboss.portal.portlet.PortletContext; -import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.controller.event.EventControllerContext; import org.jboss.portal.portlet.controller.impl.event.EventControllerConte= xtImpl; +import org.jboss.portal.portlet.info.PortletInfo; +import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.portlet.test.controller.AbstractPortletControllerC= ontext; import org.jboss.portal.web.IllegalRequestException; = +import javax.servlet.ServletContext; +import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; import java.io.IOException; +import java.util.HashMap; import java.util.Map; -import java.util.HashMap; = /** * @author Julien Viet @@ -93,6 +93,14 @@ { int index =3D windowId.lastIndexOf('.'); String portletId =3D windowId.substring(0, index); + + // in the case of an event propagation, the given 'windowId' is actu= ally the portlet id already so need to check + // for that case (portletId should still have a '.', if not it means= that the windowId was really a portlet id) + if (portletId.indexOf('.') =3D=3D -1) + { + portletId =3D windowId; + } + PortletContext portletContext =3D PortletContext.createPortletContex= t(portletId); return invoker.getPortlet(portletContext); } Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sam= ples/event/CartEvent.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/event/CartEvent.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/event/CartEvent.java 2008-02-09 04:57:27 UTC (rev 9883) @@ -0,0 +1,50 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.simple.samples.event; + +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.namespace.QName; +import java.io.Serializable; + +/** + * @author Chris Laprun + * @version $Revision$ + */ +(a)XmlRootElement +public class CartEvent implements Serializable +{ + private String id; + + public static final QName QNAME =3D new QName("urn:jboss:portal:samples= :event", "CartEvent"); + + public CartEvent(String id) + { + this.id =3D id; + } + + public String getId() + { + return id; + } +} Property changes on: modules/portlet/trunk/test/src/main/java/org/jboss/por= tal/simple/samples/event/CartEvent.java ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sam= ples/event/CartPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/event/CartPortlet.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/event/CartPortlet.java 2008-02-09 04:57:27 UTC (rev 9883) @@ -0,0 +1,82 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.simple.samples.event; + +import javax.portlet.Event; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.GenericPortlet; +import javax.portlet.PortletException; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import java.io.IOException; +import java.io.Writer; +import java.util.ArrayList; +import java.util.List; + +/** + * @author Chris Laprun + * @version $Revision$ + */ +public class CartPortlet extends GenericPortlet +{ + List items =3D new ArrayList(7); + + @Override + protected void doView(RenderRequest renderRequest, RenderResponse rende= rResponse) throws PortletException, IOException + { + renderResponse.setContentType("text/html"); + Writer writer =3D renderResponse.getWriter(); + + + if (!items.isEmpty()) + { + writer.append(""); + int total =3D 0; + for (CatalogItem item : items) + { + int price =3D item.getPrice(); + total +=3D price; + writer.append(""); + } + writer.append("
    DescriptionPrice
    ").append(item.getDescription()).append= ("$").append("" + price) + .append("
    ").append("$= " + total).append("
    "); + } + else + { + writer.append("Cart is empty."); + } + } + + @Override + public void processEvent(EventRequest eventRequest, EventResponse event= Response) throws PortletException, IOException + { + Event event =3D eventRequest.getEvent(); + if (event.getName().equals("CartEvent")) + { + CartEvent cartEvent =3D (CartEvent)event.getValue(); + items.add(Catalog.get(cartEvent.getId())); + } + } +} Property changes on: modules/portlet/trunk/test/src/main/java/org/jboss/por= tal/simple/samples/event/CartPortlet.java ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sam= ples/event/Catalog.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/event/Catalog.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/event/Catalog.java 2008-02-09 04:57:27 UTC (rev 9883) @@ -0,0 +1,63 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.simple.samples.event; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +/** + * @author Chris Laprun + * @version $Revision$ + */ +public class Catalog +{ + private static Map items; + + static + { + items =3D new HashMap(7); + items.put("1", new CatalogItem("1", 800, "Bike")); + items.put("2", new CatalogItem("2", 450, "Snowboard")); + items.put("3", new CatalogItem("3", 225, "Tent")); + items.put("4", new CatalogItem("4", 75, "Backpack")); + items.put("5", new CatalogItem("5", 119, "Skateboard")); + items.put("6", new CatalogItem("6", 333, "Surfboard")); + items.put("7", new CatalogItem("7", 90, "Sneakers")); + } + + private Catalog() + { + } + + public static CatalogItem get(String id) + { + return items.get(id); + } + + public static Collection getAll() + { + return items.values(); + } +} Property changes on: modules/portlet/trunk/test/src/main/java/org/jboss/por= tal/simple/samples/event/Catalog.java ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sam= ples/event/CatalogItem.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/event/CatalogItem.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/event/CatalogItem.java 2008-02-09 04:57:27 UTC (rev 9883) @@ -0,0 +1,57 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.simple.samples.event; + +/** + * @author Chris Laprun + * @version $Revision$ + */ +public class CatalogItem +{ + private String id; + private int price; + private String description; + + public CatalogItem(String id, int price, String description) + { + this.id =3D id; + this.price =3D price; + this.description =3D description; + } + + public String getId() + { + return id; + } + + public int getPrice() + { + return price; + } + + public String getDescription() + { + return description; + } +} Property changes on: modules/portlet/trunk/test/src/main/java/org/jboss/por= tal/simple/samples/event/CatalogItem.java ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sam= ples/event/CatalogPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/event/CatalogPortlet.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/event/CatalogPortlet.java 2008-02-09 04:57:27 UTC (rev 9883) @@ -0,0 +1,71 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.simple.samples.event; + +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.GenericPortlet; +import javax.portlet.PortletException; +import javax.portlet.PortletURL; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import java.io.IOException; +import java.io.Writer; +import java.util.Collection; + +/** + * @author Chris Laprun + * @version $Revision$ + */ +public class CatalogPortlet extends GenericPortlet +{ + @Override + protected void doView(RenderRequest renderRequest, RenderResponse rende= rResponse) throws PortletException, IOException + { + renderResponse.setContentType("text/html"); + Writer writer =3D renderResponse.getWriter(); + + writer.append("<= th>Actions"); + + PortletURL addURL =3D renderResponse.createActionURL(); + addURL.setParameter("op", "add"); + + Collection items =3D Catalog.getAll(); + for (CatalogItem item : items) + { + addURL.setParameter("id", item.getId()); + writer.append(""); + } + + writer.append("
    DescriptionPrice
    ").append(item.getDescription()).append("<= /td>$").append("" + item.getPrice()) + .append("Add to cart
    "); + } + + @Override + public void processAction(ActionRequest actionRequest, ActionResponse a= ctionResponse) throws PortletException, IOException + { + String value =3D actionRequest.getParameter("id"); + actionResponse.setEvent(CartEvent.QNAME, new CartEvent(value)); + } +} Property changes on: modules/portlet/trunk/test/src/main/java/org/jboss/por= tal/simple/samples/event/CatalogPortlet.java ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-09 03:22:01 UTC (= rev 9882) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-09 04:57:27 UTC (= rev 9883) @@ -698,7 +698,6 @@ = - = @@ -711,13 +710,13 @@ - = + = @@ -762,12 +761,21 @@ = - + = + + + + + + + + Copied: modules/portlet/trunk/test/src/test/resources/cart-event-portlet-wa= r/WEB-INF/portlet.xml (from rev 9878, modules/portlet/trunk/test/src/test/r= esources/google-map-portlet-war/WEB-INF/portlet.xml) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/WE= B-INF/portlet.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/WE= B-INF/portlet.xml 2008-02-09 04:57:27 UTC (rev 9883) @@ -0,0 +1,70 @@ + + + + + + Catalog Portlet + Catalog + Catalog Portlet + org.jboss.portal.simple.samples.event.CatalogPortlet<= /portlet-class> + + text/html + VIEW + + + Catalog Portlet + sample,event,catalog + + + jbp:CartEvent= + + + + + Cart Portlet + Cart + Cart Portlet + org.jboss.portal.simple.samples.event.CartPortlet + + text/html + VIEW + + + Cart Portlet + sample,event,cart + + + jbp:CartEvent= + + + + + jbp:CartEvent + org.jboss.portal.simple.samples.event.CartEvent + + + Copied: modules/portlet/trunk/test/src/test/resources/cart-event-portlet-wa= r/WEB-INF/web.xml (from rev 9878, modules/portlet/trunk/test/src/test/resou= rces/google-map-portlet-war/WEB-INF/web.xml) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/WE= B-INF/web.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/WE= B-INF/web.xml 2008-02-09 04:57:27 UTC (rev 9883) @@ -0,0 +1,27 @@ + + + + + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/demo.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo.jsp 2008-02-09 03:22:01 UTC (rev 9882) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo.jsp 2008-02-09 04:57:27 UTC (rev 9883) @@ -4,21 +4,23 @@ <%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> <%@ page isELIgnored=3D"false" %> = - <%@ include file=3D"/layouts/header.jsp" %> - = - - - +<%@ include file=3D"/layouts/header.jsp" %> + + + + + + - - + + = - <%@ include file=3D"/layouts/footer.jsp" %> \ No newline at end of file +<%@ include file=3D"/layouts/footer.jsp" %> \ No newline at end of file Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/i= ndex.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-09 03:22:01 UTC (rev 9882) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-09 04:57:27 UTC (rev 9883) @@ -3,8 +3,8 @@ <%@ page isELIgnored=3D"false" %> - - + + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/l= ayouts/default.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /default.jsp 2008-02-09 03:22:01 UTC (rev 9882) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /default.jsp 2008-02-09 04:57:27 UTC (rev 9883) @@ -5,97 +5,98 @@ <%@ page isELIgnored=3D"false" %> +PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" +"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -Portlet Container 2.0 - + Portlet Container 2.0 + =
    -
    3D"Portlet
    +
    3D"Portlet

    <%@ include file=3D"nav/main.jsp" %> =
    -
    -
    - +
    +
    +
    -

    Demo Page Title

    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    -
    +

    Demo Page Title

    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed = do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exe= rcitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderi= t in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p= roident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed = do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exe= rcitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderi= t in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p= roident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed = do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exe= rcitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderi= t in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p= roident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed = do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exe= rcitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderi= t in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p= roident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed = do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exe= rcitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderi= t in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p= roident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed = do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exe= rcitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderi= t in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p= roident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed = do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exe= rcitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderi= t in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p= roident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed = do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exe= rcitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderi= t in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p= roident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed = do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exe= rcitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderi= t in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p= roident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed = do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exe= rcitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderi= t in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p= roident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed = do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exe= rcitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderi= t in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p= roident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
    +
    =
    --===============1333866106275691248==-- From portal-commits at lists.jboss.org Sat Feb 9 06:05:41 2008 Content-Type: multipart/mixed; boundary="===============1154568933613607944==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9884 - modules/common/trunk/common/src/main/java/org/jboss/portal/common/io. Date: Sat, 09 Feb 2008 06:05:31 -0500 Message-ID: --===============1154568933613607944== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-09 06:05:31 -0500 (Sat, 09 Feb 2008) New Revision: 9884 Added: modules/common/trunk/common/src/main/java/org/jboss/portal/common/io/Ser= ializationFilter.java Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common/io/IOT= ools.java Log: make serialization stuff more reusable Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common= /io/IOTools.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/src/main/java/org/jboss/portal/common/io/IO= Tools.java 2008-02-09 04:57:27 UTC (rev 9883) +++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/io/IO= Tools.java 2008-02-09 11:05:31 UTC (rev 9884) @@ -388,6 +388,11 @@ = public static byte[] serialize(Serialization serialization, T t) { + return serialize(serialization, SerializationFilter.TRIVIAL, t); + } + + public static byte[] serialize(Serialization serialization, Seri= alizationFilter filter, T t) + { if (serialization =3D=3D null) { throw new IllegalArgumentException(); @@ -399,7 +404,7 @@ try { ByteArrayOutputStream baos =3D new ByteArrayOutputStream(); - serialization.serialize(t, baos); + filter.serialize(serialization, t, baos); return baos.toByteArray(); } catch (IOException e) @@ -410,6 +415,11 @@ = public static T unserialize(Serialization serialization, byte[] = bytes) { + return unserialize(serialization, SerializationFilter.TRIVIAL, bytes= ); + } + + public static T unserialize(Serialization serialization, Seriali= zationFilter filter, byte[] bytes) + { if (serialization =3D=3D null) { throw new IllegalArgumentException(); @@ -421,7 +431,7 @@ try { ByteArrayInputStream bais =3D new ByteArrayInputStream(bytes); - return serialization.unserialize(bais); + return filter.unserialize(serialization, bais); } catch (IOException e) { Added: modules/common/trunk/common/src/main/java/org/jboss/portal/common/io= /SerializationFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/src/main/java/org/jboss/portal/common/io/Se= rializationFilter.java (rev 0) +++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/io/Se= rializationFilter.java 2008-02-09 11:05:31 UTC (rev 9884) @@ -0,0 +1,75 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.common.io; + +import java.io.OutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.zip.GZIPOutputStream; +import java.util.zip.GZIPInputStream; + +/** + * Filters a stream for serialize/unserialize operations. + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +public interface SerializationFilter +{ + + SerializationFilter TRIVIAL =3D new SerializationFilter() + { + public void serialize(Serialization serialization, T t, Outpu= tStream out) throws IllegalArgumentException, IOException + { + serialization.serialize(t, out); + } + + public T unserialize(Serialization serialization, InputStream= in) throws IllegalArgumentException, IOException + { + return serialization.unserialize(in); + } + }; + + /** + * Use GZIP streams. = + */ + SerializationFilter COMPRESSOR =3D new SerializationFilter() + { + public void serialize(Serialization serialization, T t, Outpu= tStream out) throws IllegalArgumentException, IOException + { + GZIPOutputStream zos =3D new GZIPOutputStream(out); + serialization.serialize(t, zos); + } + + public T unserialize(Serialization serialization, InputStream= in) throws IllegalArgumentException, IOException + { + GZIPInputStream zis =3D new GZIPInputStream(in); + return serialization.unserialize(zis); + } + }; + + void serialize(Serialization serialization, T t, OutputStream ou= t) throws IllegalArgumentException, IOException; + + T unserialize(Serialization serialization, InputStream in) throw= s IllegalArgumentException, IOException; + +} --===============1154568933613607944==-- From portal-commits at lists.jboss.org Sat Feb 9 06:37:51 2008 Content-Type: multipart/mixed; boundary="===============0045200948856198920==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9885 - in modules/portlet/trunk: portlet-controller and 11 other directories. Date: Sat, 09 Feb 2008 06:37:48 -0500 Message-ID: --===============0045200948856198920== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-09 06:37:47 -0500 (Sat, 09 Feb 2008) New Revision: 9885 Added: modules/portlet/trunk/portlet-controller/ modules/portlet/trunk/portlet-controller/pom.xml modules/portlet/trunk/portlet-controller/src/ modules/portlet/trunk/portlet-controller/src/main/ modules/portlet/trunk/portlet-controller/src/main/java/ modules/portlet/trunk/portlet-controller/src/main/java/org/ modules/portlet/trunk/portlet-controller/src/main/java/org/jboss/ modules/portlet/trunk/portlet-controller/src/main/java/org/jboss/portal/ modules/portlet/trunk/portlet-controller/src/main/java/org/jboss/portal/= portlet/ modules/portlet/trunk/portlet-controller/src/test/ modules/portlet/trunk/portlet-controller/src/test/java/ modules/portlet/trunk/portlet-controller/src/test/java/org/ modules/portlet/trunk/portlet-controller/src/test/java/org/jboss/ modules/portlet/trunk/portlet-controller/src/test/java/org/jboss/portal/ modules/portlet/trunk/portlet-controller/src/test/java/org/jboss/portal/= portlet/ modules/portlet/trunk/portlet-controller/src/test/resources/ Log: initial import of empty structure Added: modules/portlet/trunk/portlet-controller/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet-controller/pom.xml = (rev 0) +++ modules/portlet/trunk/portlet-controller/pom.xml 2008-02-09 11:37:47 UT= C (rev 9885) @@ -0,0 +1,195 @@ + + + org.jboss.portal.portlet + module-parent + 2.0-SNAPSHOT + ../build/pom.xml + + 4.0.0 + portlet-controller + jar + Portlet controller + + + + + org.jboss.portal.portlet + portlet-portlet + ${project.version} + test-jar + + + + + + + + + + --===============0045200948856198920==-- From portal-commits at lists.jboss.org Sat Feb 9 07:00:40 2008 Content-Type: multipart/mixed; boundary="===============4054904207372275275==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9886 - in modules/test/trunk: build and 14 other directories. Date: Sat, 09 Feb 2008 07:00:40 -0500 Message-ID: --===============4054904207372275275== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-09 07:00:40 -0500 (Sat, 09 Feb 2008) New Revision: 9886 Modified: modules/test/trunk/build/pom.xml modules/test/trunk/mc/pom.xml modules/test/trunk/pom.xml modules/test/trunk/remote/pom.xml modules/test/trunk/test/agent/pom.xml modules/test/trunk/test/core/pom.xml modules/test/trunk/test/generic/pom.xml modules/test/trunk/test/jboss/pom.xml modules/test/trunk/test/opends/pom.xml modules/test/trunk/tooling/ant/pom.xml modules/test/trunk/tooling/core/pom.xml modules/test/trunk/tooling/examples/maven2/pom.xml modules/test/trunk/tooling/maven2/pom.xml modules/test/trunk/tooling/maven2/src/main/java/org/jboss/unit/tooling/m= aven2/UnitMojo.java modules/test/trunk/tooling/pom.xml modules/test/trunk/unit/pom.xml Log: - rename to artifacts - version update to 1.2.0-Beta1 Modified: modules/test/trunk/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/build/pom.xml 2008-02-09 11:37:47 UTC (rev 9885) +++ modules/test/trunk/build/pom.xml 2008-02-09 12:00:40 UTC (rev 9886) @@ -17,8 +17,8 @@ 4.0.0 org.jboss.unit - jboss-portal-modules-test - 1.2.0-SNAPSHOT + module-parent + 1.2.0-Beta1 pom JBoss Portal Test Module http://www.jboss.com/products/jbossmc Modified: modules/test/trunk/mc/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/mc/pom.xml 2008-02-09 11:37:47 UTC (rev 9885) +++ modules/test/trunk/mc/pom.xml 2008-02-09 12:00:40 UTC (rev 9886) @@ -2,8 +2,8 @@ xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://ma= ven.apache.org/maven-v4_0_0.xsd"> org.jboss.unit - jboss-portal-modules-test - 1.2.0-SNAPSHOT + module-parent + 1.2.0-Beta1 ../build/pom.xml 4.0.0 Modified: modules/test/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/pom.xml 2008-02-09 11:37:47 UTC (rev 9885) +++ modules/test/trunk/pom.xml 2008-02-09 12:00:40 UTC (rev 9886) @@ -2,10 +2,10 @@ xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://ma= ven.apache.org/maven-v4_0_0.xsd"> 4.0.0 org.jboss.unit - jboss-portal-modules-test-aggregator + module-aggregator pom JBoss Portal Modules Test - 1.2.0-SNAPSHOT + 1.2.0-Beta1 http://labs.jboss.com/jbossportal = Modified: modules/test/trunk/remote/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/remote/pom.xml 2008-02-09 11:37:47 UTC (rev 9885) +++ modules/test/trunk/remote/pom.xml 2008-02-09 12:00:40 UTC (rev 9886) @@ -2,8 +2,8 @@ xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://ma= ven.apache.org/maven-v4_0_0.xsd"> org.jboss.unit - jboss-portal-modules-test - 1.2.0-SNAPSHOT + module-parent + 1.2.0-Beta1 ../build/pom.xml 4.0.0 Modified: modules/test/trunk/test/agent/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/agent/pom.xml 2008-02-09 11:37:47 UTC (rev 9885) +++ modules/test/trunk/test/agent/pom.xml 2008-02-09 12:00:40 UTC (rev 9886) @@ -2,8 +2,8 @@ xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://ma= ven.apache.org/maven-v4_0_0.xsd"> org.jboss.unit - jboss-portal-modules-test - 1.2.0-SNAPSHOT + module-parent + 1.2.0-Beta1 ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/test/core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/core/pom.xml 2008-02-09 11:37:47 UTC (rev 9885) +++ modules/test/trunk/test/core/pom.xml 2008-02-09 12:00:40 UTC (rev 9886) @@ -2,8 +2,8 @@ xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://ma= ven.apache.org/maven-v4_0_0.xsd"> org.jboss.unit - jboss-portal-modules-test - 1.2.0-SNAPSHOT + module-parent + 1.2.0-Beta1 ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/test/generic/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/generic/pom.xml 2008-02-09 11:37:47 UTC (rev 98= 85) +++ modules/test/trunk/test/generic/pom.xml 2008-02-09 12:00:40 UTC (rev 98= 86) @@ -2,8 +2,8 @@ xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://ma= ven.apache.org/maven-v4_0_0.xsd"> org.jboss.unit - jboss-portal-modules-test - 1.2.0-SNAPSHOT + module-parent + 1.2.0-Beta1 ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/test/jboss/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/jboss/pom.xml 2008-02-09 11:37:47 UTC (rev 9885) +++ modules/test/trunk/test/jboss/pom.xml 2008-02-09 12:00:40 UTC (rev 9886) @@ -2,8 +2,8 @@ xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://ma= ven.apache.org/maven-v4_0_0.xsd"> org.jboss.unit - jboss-portal-modules-test - 1.2.0-SNAPSHOT + module-parent + 1.2.0-Beta1 ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/test/opends/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/opends/pom.xml 2008-02-09 11:37:47 UTC (rev 988= 5) +++ modules/test/trunk/test/opends/pom.xml 2008-02-09 12:00:40 UTC (rev 988= 6) @@ -2,8 +2,8 @@ xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://ma= ven.apache.org/maven-v4_0_0.xsd"> org.jboss.unit - jboss-portal-modules-test - 1.2.0-SNAPSHOT + module-parent + 1.2.0-Beta1 ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/tooling/ant/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/tooling/ant/pom.xml 2008-02-09 11:37:47 UTC (rev 988= 5) +++ modules/test/trunk/tooling/ant/pom.xml 2008-02-09 12:00:40 UTC (rev 988= 6) @@ -2,8 +2,8 @@ xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://ma= ven.apache.org/maven-v4_0_0.xsd"> org.jboss.unit - jboss-portal-modules-test - 1.2.0-SNAPSHOT + module-parent + 1.2.0-Beta1 ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/tooling/core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/tooling/core/pom.xml 2008-02-09 11:37:47 UTC (rev 98= 85) +++ modules/test/trunk/tooling/core/pom.xml 2008-02-09 12:00:40 UTC (rev 98= 86) @@ -2,8 +2,8 @@ xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://ma= ven.apache.org/maven-v4_0_0.xsd"> org.jboss.unit - jboss-portal-modules-test - 1.2.0-SNAPSHOT + module-parent + 1.2.0-Beta1 ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/tooling/examples/maven2/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/tooling/examples/maven2/pom.xml 2008-02-09 11:37:47 = UTC (rev 9885) +++ modules/test/trunk/tooling/examples/maven2/pom.xml 2008-02-09 12:00:40 = UTC (rev 9886) @@ -11,7 +11,7 @@ org.jboss.unit jboss-unit - 1.2.0-SNAPSHOT + 1.2.0-Beta1 = @@ -39,7 +39,7 @@ org.jboss.unit jboss-unit-tooling-maven2 - 1.2.0-SNAPSHOT + 1.2.0-Beta1 test Modified: modules/test/trunk/tooling/maven2/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/tooling/maven2/pom.xml 2008-02-09 11:37:47 UTC (rev = 9885) +++ modules/test/trunk/tooling/maven2/pom.xml 2008-02-09 12:00:40 UTC (rev = 9886) @@ -2,8 +2,8 @@ xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://ma= ven.apache.org/maven-v4_0_0.xsd"> org.jboss.unit - jboss-portal-modules-test - 1.2.0-SNAPSHOT + module-parent + 1.2.0-Beta1 ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/tooling/maven2/src/main/java/org/jboss/unit/to= oling/maven2/UnitMojo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/tooling/maven2/src/main/java/org/jboss/unit/tooling/= maven2/UnitMojo.java 2008-02-09 11:37:47 UTC (rev 9885) +++ modules/test/trunk/tooling/maven2/src/main/java/org/jboss/unit/tooling/= maven2/UnitMojo.java 2008-02-09 12:00:40 UTC (rev 9886) @@ -61,9 +61,9 @@ /** * @parameter */ - private String jpdaSuspend; + private String jpdaSuspend =3D "true"; = - /** s + /** * @parameter */ private boolean useJUL =3D true; Modified: modules/test/trunk/tooling/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/tooling/pom.xml 2008-02-09 11:37:47 UTC (rev 9885) +++ modules/test/trunk/tooling/pom.xml 2008-02-09 12:00:40 UTC (rev 9886) @@ -2,8 +2,8 @@ org.jboss.unit - jboss-portal-modules-test - 1.2.0-SNAPSHOT + module-parent + 1.2.0-Beta1 ../build/pom.xml 4.0.0 @@ -11,7 +11,7 @@ jboss-unit-tooling-aggregator pom JBoss Unit Tooling (aggregator) - 1.2.0-SNAPSHOT + 1.2.0-Beta1 core ant Modified: modules/test/trunk/unit/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/unit/pom.xml 2008-02-09 11:37:47 UTC (rev 9885) +++ modules/test/trunk/unit/pom.xml 2008-02-09 12:00:40 UTC (rev 9886) @@ -2,8 +2,8 @@ xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://ma= ven.apache.org/maven-v4_0_0.xsd"> org.jboss.unit - jboss-portal-modules-test - 1.2.0-SNAPSHOT + module-parent + 1.2.0-Beta1 ../build/pom.xml 4.0.0 --===============4054904207372275275==-- From portal-commits at lists.jboss.org Sat Feb 9 07:08:12 2008 Content-Type: multipart/mixed; boundary="===============6336228509084995121==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9887 - modules/common/trunk/common/src/main/java/org/jboss/portal/common/io. Date: Sat, 09 Feb 2008 07:08:12 -0500 Message-ID: --===============6336228509084995121== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-09 07:08:11 -0500 (Sat, 09 Feb 2008) New Revision: 9887 Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common/io/Ser= ializationFilter.java Log: use gzip output stream finish instead of flush Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common= /io/SerializationFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/src/main/java/org/jboss/portal/common/io/Se= rializationFilter.java 2008-02-09 12:00:40 UTC (rev 9886) +++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/io/Se= rializationFilter.java 2008-02-09 12:08:11 UTC (rev 9887) @@ -59,6 +59,7 @@ { GZIPOutputStream zos =3D new GZIPOutputStream(out); serialization.serialize(t, zos); + zos.finish(); } = public T unserialize(Serialization serialization, InputStream= in) throws IllegalArgumentException, IOException --===============6336228509084995121==-- From portal-commits at lists.jboss.org Sat Feb 9 07:14:29 2008 Content-Type: multipart/mixed; boundary="===============3427184136352882990==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9888 - in modules/portlet/trunk/test/src: main/java/org/jboss/portal/portlet/controller/state and 2 other directories. Date: Sat, 09 Feb 2008 07:14:28 -0500 Message-ID: --===============3427184136352882990== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-09 07:14:27 -0500 (Sat, 09 Feb 2008) New Revision: 9888 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/state/PageNavigationalStateSerialization.java Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/state/PageNavigationalStateImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/impl/state/StateControllerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/state/PageNavigationalState.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/state/WindowNavigationalState.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/AbstractPortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletURLRenderer.java modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/contro= ller/StateControllerContextTestCase.java Log: extract page navigational state serialization for better reusability Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/impl/state/PageNavigationalStateImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/PageNavigationalStateImpl.java 2008-02-09 12:08:11 UTC (re= v 9887) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/PageNavigationalStateImpl.java 2008-02-09 12:14:27 UTC (re= v 9888) @@ -43,7 +43,7 @@ class PageNavigationalStateImpl implements PageNavigationalState, Serializ= able { = - /** We don't save it. */ + /** . */ protected final StateControllerContextImpl context; = /** . */ @@ -116,6 +116,11 @@ return publicNavigationalState; } = + public Set getPublicNames() + { + return page.keySet(); + } + public String[] getPublicNavigationalState(QName name) { return page.get(name).clone(); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/impl/state/StateControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/StateControllerContextImpl.java 2008-02-09 12:08:11 UTC (r= ev 9887) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/impl/state/StateControllerContextImpl.java 2008-02-09 12:14:27 UTC (r= ev 9888) @@ -25,24 +25,7 @@ import org.jboss.portal.portlet.controller.PortletControllerContext; import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.StateControllerContext; -import org.jboss.portal.portlet.controller.state.WindowNavigationalState; -import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.ParametersStateString; -import org.jboss.portal.WindowState; -import org.jboss.portal.Mode; -import org.jboss.portal.common.io.UndeclaredIOException; = -import javax.xml.namespace.QName; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.DataOutputStream; -import java.io.DataInputStream; -import java.util.zip.GZIPInputStream; -import java.util.zip.GZIPOutputStream; -import java.util.Map; -import java.util.HashMap; - /** * @author Julien Viet * @version $Revision: 630 $ @@ -50,35 +33,8 @@ public class StateControllerContextImpl implements StateControllerContext { = - /** . */ - private static final Map windowStateToCode =3D ne= w HashMap(); = /** . */ - private static final Map modeToCode =3D new HashMap(); - - /** . */ - private static final Map codeToWindowState =3D ne= w HashMap(); - - /** . */ - private static final Map codeToMode =3D new HashMap(); - - static - { - windowStateToCode.put(WindowState.NORMAL, 1); - windowStateToCode.put(WindowState.MINIMIZED, 2); - windowStateToCode.put(WindowState.MAXIMIZED, 3); - codeToWindowState.put(1, WindowState.NORMAL); - codeToWindowState.put(2, WindowState.MINIMIZED); - codeToWindowState.put(3, WindowState.MAXIMIZED); - modeToCode.put(Mode.VIEW, 1); - modeToCode.put(Mode.EDIT, 2); - modeToCode.put(Mode.HELP, 3); - codeToMode.put(1, Mode.VIEW); - codeToMode.put(2, Mode.EDIT); - codeToMode.put(3, Mode.HELP); - } - - /** . */ protected final PortletControllerContext portletControllerContext; = public StateControllerContextImpl(PortletControllerContext portletContr= ollerContext) @@ -101,167 +57,4 @@ { return new PageNavigationalStateImpl(this, modifiable); } - - public byte[] serialize(PageNavigationalState object) = - { - try - { - PageNavigationalStateImpl pageState =3D (PageNavigationalStateImp= l)object; - ByteArrayOutputStream baos =3D new ByteArrayOutputStream(); - GZIPOutputStream zos =3D new GZIPOutputStream(baos); - DataOutputStream out =3D new DataOutputStream(zos); - - // - out.writeInt(pageState.windows.size()); - for (Map.Entry entry : pageState= .windows.entrySet()) - { - out.writeUTF(entry.getKey()); - WindowNavigationalState windowNS =3D entry.getValue(); - byte header =3D 0; - int decision =3D 0; - if (windowNS.getPortletNavigationalState() !=3D null) - { - header |=3D 1; - decision |=3D 1; - } - if (windowNS.getWindowState() !=3D null) - { - Integer value =3D windowStateToCode.get(windowNS.getWindowS= tate()); - if (value !=3D null) - { - header |=3D value << 1; - } - else - { - header |=3D 4 << 1; - decision |=3D 2; - } - } - if (windowNS.getMode() !=3D null) - { - Integer value =3D modeToCode.get(windowNS.getMode()); - if (value !=3D null) - { - header |=3D value << 4; - } - else - { - header |=3D 4 << 4; - decision |=3D 4; - } - } - out.writeByte(header); - if ((decision & 1) !=3D 0) - { - windowNS.getPortletNavigationalState().writeTo(out); - } - if ((decision & 2) !=3D 0) - { - out.writeUTF(windowNS.getWindowState().toString()); - } - if ((decision & 4) !=3D 0) - { - out.writeUTF(windowNS.getMode().toString()); - } - } - - // - Map publicNS =3D pageState.page; - out.writeInt(publicNS.size()); - for (Map.Entry entry : publicNS.entrySet()) - { - QName name =3D entry.getKey(); - out.writeUTF(name.getNamespaceURI()); - out.writeUTF(name.getLocalPart()); - String[] values =3D entry.getValue(); - int length =3D values.length; - out.writeInt(length); - for (String value : values) - { - out.writeUTF(value); - } - } - - // - out.close(); - return baos.toByteArray(); - } - catch (IOException e) - { - throw new UndeclaredIOException(e); - } - } - - public PageNavigationalState unserialize(byte[] bytes, boolean modifiab= le) - { - try - { - ByteArrayInputStream bais =3D new ByteArrayInputStream(bytes); - GZIPInputStream zis =3D new GZIPInputStream(bais); - DataInputStream in =3D new DataInputStream(zis); - PageNavigationalStateImpl pageState =3D new PageNavigationalState= Impl(this, modifiable); - - // - int size =3D in.readInt(); - while (size-- > 0) - { - String windowId =3D in.readUTF(); - byte header =3D in.readByte(); - StateString portletNS =3D null; - if ((header & 1) !=3D 0) - { - portletNS =3D ParametersStateString.create(in); - } - WindowState windowState =3D null; - int windowStateHeader =3D (header & (7 << 1)) >> 1; - switch (windowStateHeader) - { - case 0: - break; - case 4: - windowState =3D WindowState.create(in.readUTF()); - break; - default: - windowState =3D codeToWindowState.get(windowStateHeader); - } - Mode mode =3D null; - int modeStateHeader =3D (header & (7 << (1 + 3))) >> (1 + 3); - switch (modeStateHeader) - { - case 0: - break; - case 4: - mode =3D Mode.create(in.readUTF()); - break; - default: - mode =3D codeToMode.get(modeStateHeader); - } - WindowNavigationalState windowNS =3D new WindowNavigationalSta= te(portletNS, mode, windowState); - pageState.windows.put(windowId, windowNS); - } - - // - size =3D in.readInt(); - while (size-- > 0) - { - String namespaceURI =3D in.readUTF(); - String localName =3D in.readUTF(); - QName name =3D new QName(namespaceURI, localName); - int length =3D in.readInt(); - String[] values =3D new String[length]; - for (int i =3D 0;i < length;i++) - { - values[i] =3D in.readUTF(); - } - pageState.page.put(name, values); - } - - // - return pageState; - } - catch (IOException e) - { - throw new UndeclaredIOException(e); - } - } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/state/PageNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/PageNavigationalState.java 2008-02-09 12:08:11 UTC (rev 9887) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/PageNavigationalState.java 2008-02-09 12:14:27 UTC (rev 9888) @@ -77,6 +77,13 @@ ParameterMap getPublicNavigationalState(String windowId) throws Illegal= ArgumentException; = /** + * Returns the set of public names. + * + * @return the public names + */ + Set getPublicNames(); + + /** * Update the public navigational state of a window. The interpretation= of what should be updated is left up to the * implementor. An example of implementation would use the mapping betw= een qname and name provided by the referenced * portlet info. Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/co= ntroller/state/PageNavigationalStateSerialization.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/PageNavigationalStateSerialization.java = (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/PageNavigationalStateSerialization.java 2008-02-09 12:14:27 UTC= (rev 9888) @@ -0,0 +1,234 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.controller.state; + +import org.jboss.portal.common.io.Serialization; +import org.jboss.portal.WindowState; +import org.jboss.portal.Mode; +import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.ParametersStateString; + +import javax.xml.namespace.QName; +import java.io.OutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.DataOutputStream; +import java.io.DataInputStream; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; + +/** + * Implement serialization of a page navigational state in a compact manne= r. + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PageNavigationalStateSerialization implements Serialization +{ + + /** . */ + private static final Map windowStateToCode =3D ne= w HashMap(); + + /** . */ + private static final Map modeToCode =3D new HashMap(); + + /** . */ + private static final Map codeToWindowState =3D ne= w HashMap(); + + /** . */ + private static final Map codeToMode =3D new HashMap(); + + static + { + windowStateToCode.put(WindowState.NORMAL, 1); + windowStateToCode.put(WindowState.MINIMIZED, 2); + windowStateToCode.put(WindowState.MAXIMIZED, 3); + codeToWindowState.put(1, WindowState.NORMAL); + codeToWindowState.put(2, WindowState.MINIMIZED); + codeToWindowState.put(3, WindowState.MAXIMIZED); + modeToCode.put(Mode.VIEW, 1); + modeToCode.put(Mode.EDIT, 2); + modeToCode.put(Mode.HELP, 3); + codeToMode.put(1, Mode.VIEW); + codeToMode.put(2, Mode.EDIT); + codeToMode.put(3, Mode.HELP); + } + + /** . */ + private final StateControllerContext context; + + public PageNavigationalStateSerialization(StateControllerContext contex= t) + { + if (context =3D=3D null) + { + throw new IllegalArgumentException(); + } + this.context =3D context; + } + + public void serialize(PageNavigationalState pageState, OutputStream out= ) throws IOException, IllegalArgumentException + { + DataOutputStream data =3D out instanceof DataOutputStream ? (DataOut= putStream)out : new DataOutputStream(out); + + // + data.writeInt(pageState.getWindowIds().size()); + for (String windowId : pageState.getWindowIds()) + { + data.writeUTF(windowId); + WindowNavigationalState windowNS =3D pageState.getWindowNavigatio= nalState(windowId); + byte header =3D 0; + int decision =3D 0; + if (windowNS.getPortletNavigationalState() !=3D null) + { + header |=3D 1; + decision |=3D 1; + } + if (windowNS.getWindowState() !=3D null) + { + Integer value =3D windowStateToCode.get(windowNS.getWindowStat= e()); + if (value !=3D null) + { + header |=3D value << 1; + } + else + { + header |=3D 4 << 1; + decision |=3D 2; + } + } + if (windowNS.getMode() !=3D null) + { + Integer value =3D modeToCode.get(windowNS.getMode()); + if (value !=3D null) + { + header |=3D value << 4; + } + else + { + header |=3D 4 << 4; + decision |=3D 4; + } + } + data.writeByte(header); + if ((decision & 1) !=3D 0) + { + windowNS.getPortletNavigationalState().writeTo(data); + } + if ((decision & 2) !=3D 0) + { + data.writeUTF(windowNS.getWindowState().toString()); + } + if ((decision & 4) !=3D 0) + { + data.writeUTF(windowNS.getMode().toString()); + } + } + + // + Set publicNames =3D pageState.getPublicNames(); + data.writeInt(publicNames.size()); + for (QName name : pageState.getPublicNames()) + { + data.writeUTF(name.getNamespaceURI()); + data.writeUTF(name.getLocalPart()); + String[] values =3D pageState.getPublicNavigationalState(name); + int length =3D values.length; + data.writeInt(length); + for (String value : values) + { + data.writeUTF(value); + } + } + + // Need to flush before returning otherwise bytes may stay in the bu= ffer when we allocated + // a data stream + data.flush(); + } + + public PageNavigationalState unserialize(InputStream in) throws IOExcep= tion, IllegalArgumentException + { + DataInputStream data =3D in instanceof DataInputStream ? (DataInputS= tream)in : new DataInputStream(in); + + // + PageNavigationalState pageNS =3D context.createPageState(true); + + // + int size =3D data.readInt(); + while (size-- > 0) + { + String windowId =3D data.readUTF(); + byte header =3D data.readByte(); + StateString portletNS =3D null; + if ((header & 1) !=3D 0) + { + portletNS =3D ParametersStateString.create(data); + } + WindowState windowState =3D null; + int windowStateHeader =3D (header & (7 << 1)) >> 1; + switch (windowStateHeader) + { + case 0: + break; + case 4: + windowState =3D WindowState.create(data.readUTF()); + break; + default: + windowState =3D codeToWindowState.get(windowStateHeader); + } + Mode mode =3D null; + int modeStateHeader =3D (header & (7 << (1 + 3))) >> (1 + 3); + switch (modeStateHeader) + { + case 0: + break; + case 4: + mode =3D Mode.create(data.readUTF()); + break; + default: + mode =3D codeToMode.get(modeStateHeader); + } + WindowNavigationalState windowNS =3D new WindowNavigationalState(= portletNS, mode, windowState); + pageNS.setWindowNavigationalState(windowId, windowNS); + } + + // + size =3D data.readInt(); + while (size-- > 0) + { + String namespaceURI =3D data.readUTF(); + String localName =3D data.readUTF(); + QName name =3D new QName(namespaceURI, localName); + int length =3D data.readInt(); + String[] values =3D new String[length]; + for (int i =3D 0;i < length;i++) + { + values[i] =3D data.readUTF(); + } + pageNS.setPublicNavigationalState(name, values); + } + + // + return pageNS; + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /controller/state/WindowNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/WindowNavigationalState.java 2008-02-09 12:08:11 UTC (rev 9887) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contr= oller/state/WindowNavigationalState.java 2008-02-09 12:14:27 UTC (rev 9888) @@ -30,6 +30,7 @@ = /** * The navigational state of a window that contains the portlet navigation= al state, the mode and window state. + * This class is immutable. * * @author Julien Viet * @version $Revision: 1.1 $ Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/AbstractPortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-09 12:08:11 UTC (r= ev 9887) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-09 12:14:27 UTC (r= ev 9888) @@ -27,6 +27,7 @@ import org.jboss.portal.WindowState; import org.jboss.portal.common.io.IOTools; import org.jboss.portal.common.io.Serialization; +import org.jboss.portal.common.io.SerializationFilter; import org.jboss.portal.common.util.MarkupInfo; import org.jboss.portal.common.util.MediaType; import org.jboss.portal.common.util.ParameterMap; @@ -48,6 +49,7 @@ import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.StateControllerContext; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; +import org.jboss.portal.portlet.controller.state.PageNavigationalStateSeri= alization; import org.jboss.portal.portlet.impl.spi.AbstractClientContext; import org.jboss.portal.portlet.impl.spi.AbstractRequestContext; import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; @@ -116,6 +118,9 @@ { StateControllerContextImpl tmp =3D new StateControllerContextImpl(th= is); = + // + PageNavigationalStateSerialization serialization =3D new PageNavigat= ionalStateSerialization(tmp); + // The nav state provided with the request // Unmarshall portal navigational state if it is provided PageNavigationalState pageState =3D null; @@ -123,7 +128,7 @@ if (context !=3D null) { byte[] bytes =3D Base64.decode(context, true); - pageState =3D tmp.unserialize(bytes, false); + pageState =3D IOTools.unserialize(serialization, SerializationFil= ter.COMPRESSOR, bytes); } = // The type of invocation @@ -239,7 +244,7 @@ else { byte[] bytes =3D Base64.decode(req.getParameter(PUBLIC_NAVI= GATIONAL_STATE_CHANGES), true); - Map publicNavigationalStateChanges =3D IO= Tools.unserialize(Serialization.PARAMETER_MAP, bytes); + Map publicNavigationalStateChanges =3D IO= Tools.unserialize(Serialization.PARAMETER_MAP, SerializationFilter.COMPRESS= OR, bytes); = // request =3D new PortletRenderRequest( Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletURLRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-09 12:08:11 UTC (rev 9887) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-09 12:14:27 UTC (rev 9888) @@ -25,6 +25,7 @@ = import org.jboss.portal.common.io.IOTools; import org.jboss.portal.common.io.Serialization; +import org.jboss.portal.common.io.SerializationFilter; import org.jboss.portal.common.text.CharBuffer; import org.jboss.portal.common.text.FastURLEncoder; import org.jboss.portal.common.util.Base64; @@ -37,6 +38,7 @@ import org.jboss.portal.portlet.cache.CacheLevel; import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.PageNavigationalStateSeri= alization; import static org.jboss.portal.portlet.test.URLParameterConstants.*; = import javax.servlet.http.HttpServletRequest; @@ -56,6 +58,9 @@ final StateControllerContextImpl stateContext; = /** . */ + final PageNavigationalStateSerialization serialization; + + /** . */ final HttpServletRequest clientReq; = /** . */ @@ -74,6 +79,7 @@ this.pageNS =3D pageNS; this.clientReq =3D clientReq; this.clientResp =3D clientResp; + this.serialization =3D new PageNavigationalStateSerialization(stateC= ontext); } = private String renderURL(Map parameters, Boolean wantSe= cure, Boolean wantAuthenticated, boolean relative) @@ -116,7 +122,7 @@ String pageState =3D null; if (pageNS !=3D null) { - byte[] bytes =3D stateContext.serialize(pageNS); + byte[] bytes =3D IOTools.serialize(serialization, SerializationFi= lter.COMPRESSOR, pageNS); pageState =3D Base64.encodeBytes(bytes, true); } = @@ -169,7 +175,7 @@ String pageState =3D null; if (pageNS !=3D null) { - byte[] bytes =3D stateContext.serialize(pageNS); + byte[] bytes =3D IOTools.serialize(serialization, SerializationFi= lter.COMPRESSOR, pageNS); pageState =3D Base64.encodeBytes(bytes, true); } = @@ -216,7 +222,7 @@ = // Map changes =3D renderURL.getPublicNavigatio= nalStateChanges(); - byte[] bytes =3D IOTools.serialize(Serialization.PARAMETER_MAP= , changes); + byte[] bytes =3D IOTools.serialize(Serialization.PARAMETER_MAP= , SerializationFilter.COMPRESSOR, changes); String ns =3D Base64.encodeBytes(bytes, true); parameters.put(PUBLIC_NAVIGATIONAL_STATE_CHANGES, ns); = Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet= /controller/StateControllerContextTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/contr= oller/StateControllerContextTestCase.java 2008-02-09 12:08:11 UTC (rev 9887) +++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/contr= oller/StateControllerContextTestCase.java 2008-02-09 12:14:27 UTC (rev 9888) @@ -27,6 +27,7 @@ import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.StateControllerContext; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; +import org.jboss.portal.portlet.controller.state.PageNavigationalStateSeri= alization; import org.jboss.portal.portlet.controller.event.EventControllerContext; import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.PortletInvokerException; @@ -38,6 +39,8 @@ import org.jboss.portal.portlet.invocation.ResourceInvocation; import org.jboss.portal.portlet.spi.PortletInvocationContext; import org.jboss.portal.common.NotYetImplemented; +import org.jboss.portal.common.io.IOTools; +import org.jboss.portal.common.io.SerializationFilter; import org.jboss.portal.Mode; import org.jboss.portal.WindowState; import static org.jboss.unit.api.Assert.*; @@ -96,8 +99,8 @@ = private void assertMarshallable(PageNavigationalState pageNS) { - byte[] bytes =3D cc.serialize(pageNS); - PageNavigationalState expectedPageNS =3D cc.unserialize(bytes, true); + byte[] bytes =3D IOTools.serialize(new PageNavigationalStateSerializ= ation(cc), /*SerializationFilter.COMPRESSOR, */pageNS); + PageNavigationalState expectedPageNS =3D IOTools.unserialize(new Pag= eNavigationalStateSerialization(cc), /*SerializationFilter.COMPRESSOR, */by= tes); assertEquals(expectedPageNS.getWindowIds(), pageNS.getWindowIds()); for (String windowId : expectedPageNS.getWindowIds()) { --===============3427184136352882990==-- From portal-commits at lists.jboss.org Sat Feb 9 07:42:29 2008 Content-Type: multipart/mixed; boundary="===============2903818137347116360==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9889 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp. Date: Sat, 09 Feb 2008 07:42:28 -0500 Message-ID: --===============2903818137347116360== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-09 07:42:28 -0500 (Sat, 09 Feb 2008) New Revision: 9889 Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/response/ Log: delete empty dir --===============2903818137347116360==-- From portal-commits at lists.jboss.org Sat Feb 9 08:17:09 2008 Content-Type: multipart/mixed; boundary="===============4872176649274644035==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9890 - in modules/portlet/trunk: bridge and 12 other directories. Date: Sat, 09 Feb 2008 08:17:09 -0500 Message-ID: --===============4872176649274644035== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-09 08:17:09 -0500 (Sat, 09 Feb 2008) New Revision: 9890 Added: modules/portlet/trunk/portlet-controller/src/main/java/org/jboss/portal/= portlet/controller/ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/report= s/ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/report= s/TestCaseAPF.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/report= s/TestCaseAnnotationProcessor.java Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/contro= ller/ Modified: modules/portlet/trunk/bridge/pom.xml modules/portlet/trunk/build/pom.xml modules/portlet/trunk/federation/pom.xml modules/portlet/trunk/jsr168api/pom.xml modules/portlet/trunk/management/pom.xml modules/portlet/trunk/pom.xml modules/portlet/trunk/portlet-controller/pom.xml modules/portlet/trunk/portlet/pom.xml modules/portlet/trunk/test/pom.xml modules/portlet/trunk/test/src/test/build.xml Log: extracted portlet-controller module and version update to 2.0-SNAPSHOT Modified: modules/portlet/trunk/bridge/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/bridge/pom.xml 2008-02-09 12:42:28 UTC (rev 9889) +++ modules/portlet/trunk/bridge/pom.xml 2008-02-09 13:17:09 UTC (rev 9890) @@ -3,7 +3,7 @@ org.jboss.portal.portlet module-parent - 1.2.0-SNAPSHOT + 2.0-SNAPSHOT ../build/pom.xml 4.0.0 Modified: modules/portlet/trunk/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/build/pom.xml 2008-02-09 12:42:28 UTC (rev 9889) +++ modules/portlet/trunk/build/pom.xml 2008-02-09 13:17:09 UTC (rev 9890) @@ -18,7 +18,7 @@ 4.0.0 org.jboss.portal.portlet module-parent - 1.2.0-SNAPSHOT + 2.0-SNAPSHOT pom JBoss Portal Portlet Module http://www.jboss.com/products/jbossmc @@ -40,7 +40,7 @@ 2.2.1.GA 1.2.0-SNAPSHOT 1.2.0-SNAPSHOT - 1.2.0-SNAPSHOT + 1.2.0-Beta1 1.2.14 1.1.1 3.0.1 Modified: modules/portlet/trunk/federation/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/federation/pom.xml 2008-02-09 12:42:28 UTC (rev 9= 889) +++ modules/portlet/trunk/federation/pom.xml 2008-02-09 13:17:09 UTC (rev 9= 890) @@ -3,7 +3,7 @@ org.jboss.portal.portlet module-parent - 1.2.0-SNAPSHOT + 2.0-SNAPSHOT ../build/pom.xml 4.0.0 Modified: modules/portlet/trunk/jsr168api/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/jsr168api/pom.xml 2008-02-09 12:42:28 UTC (rev 98= 89) +++ modules/portlet/trunk/jsr168api/pom.xml 2008-02-09 13:17:09 UTC (rev 98= 90) @@ -3,7 +3,7 @@ org.jboss.portal.portlet module-parent - 1.2.0-SNAPSHOT + 2.0-SNAPSHOT ../build/pom.xml 4.0.0 Modified: modules/portlet/trunk/management/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/management/pom.xml 2008-02-09 12:42:28 UTC (rev 9= 889) +++ modules/portlet/trunk/management/pom.xml 2008-02-09 13:17:09 UTC (rev 9= 890) @@ -3,7 +3,7 @@ org.jboss.portal.portlet module-parent - 1.2.0-SNAPSHOT + 2.0-SNAPSHOT ../build/pom.xml 4.0.0 Modified: modules/portlet/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/pom.xml 2008-02-09 12:42:28 UTC (rev 9889) +++ modules/portlet/trunk/pom.xml 2008-02-09 13:17:09 UTC (rev 9890) @@ -5,7 +5,7 @@ module-aggregator pom JBoss Portal Portlet Module Aggregator - 1.2.0-SNAPSHOT + 2.0-SNAPSHOT http://labs.jboss.com/jbossportal = @@ -29,6 +29,7 @@ build jsr168api portlet + portlet-controller bridge federation management Modified: modules/portlet/trunk/portlet/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/pom.xml 2008-02-09 12:42:28 UTC (rev 9889) +++ modules/portlet/trunk/portlet/pom.xml 2008-02-09 13:17:09 UTC (rev 9890) @@ -3,7 +3,7 @@ org.jboss.portal.portlet module-parent - 1.2.0-SNAPSHOT + 2.0-SNAPSHOT ../build/pom.xml 4.0.0 @@ -40,6 +40,14 @@ jaxb-api = + + sun.jdk + tools + 1.5.0 + system + ${JAVA_HOME}/lib/tools.jar + + org.jboss.unit @@ -100,6 +108,27 @@ + + + org.apache.myfaces.tobago + maven-apt-plugin + + + test + + + + 1.5 + true + true + org.jboss.portal.unit.reports.TestCaseAPF + + + testExecute + + + + = Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/re= ports/TestCaseAPF.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/repor= ts/TestCaseAPF.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/repor= ts/TestCaseAPF.java 2008-02-09 13:17:09 UTC (rev 9890) @@ -0,0 +1,65 @@ +/* +* 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.unit.reports; + +import com.sun.mirror.apt.AnnotationProcessorFactory; +import com.sun.mirror.apt.AnnotationProcessor; +import com.sun.mirror.apt.AnnotationProcessorEnvironment; +import com.sun.mirror.apt.AnnotationProcessors; +import com.sun.mirror.declaration.AnnotationTypeDeclaration; + +import java.util.Collection; +import java.util.Set; +import java.util.Collections; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +public class TestCaseAPF implements AnnotationProcessorFactory +{ + public Collection supportedOptions() + { + return Collections.emptyList(); + } + + public Collection supportedAnnotationTypes() + { + return Collections.singletonList("org.jboss.portal.unit.annotations.= TestCase"); + } + + public AnnotationProcessor getProcessorFor(Set annotationTypeDeclarations, AnnotationProcessorEnvironment annotationPro= cessorEnvironment) + { + System.out.println("### HERE"); + AnnotationProcessor result; + if(annotationTypeDeclarations.isEmpty()) { + result =3D AnnotationProcessors.NO_OP; + } + else { + // Next Step - implement this class: + result =3D new TestCaseAnnotationProcessor(annotationProcessorEnv= ironment); + } + return result; + + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/re= ports/TestCaseAnnotationProcessor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/repor= ts/TestCaseAnnotationProcessor.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/repor= ts/TestCaseAnnotationProcessor.java 2008-02-09 13:17:09 UTC (rev 9890) @@ -0,0 +1,114 @@ +/* +* 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.unit.reports; + +import com.sun.mirror.apt.AnnotationProcessor; +import com.sun.mirror.apt.AnnotationProcessorEnvironment; +import com.sun.mirror.declaration.AnnotationTypeDeclaration; +import com.sun.mirror.declaration.Declaration; +import com.sun.mirror.declaration.AnnotationMirror; +import com.sun.mirror.declaration.AnnotationTypeElementDeclaration; +import com.sun.mirror.declaration.AnnotationValue; +import com.sun.mirror.util.SourcePosition; + +import java.util.Collection; +import java.util.Map; +import java.io.File; +import java.io.OutputStream; +import java.io.FileOutputStream; +import java.io.PrintStream; +import java.io.FileNotFoundException; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +public class TestCaseAnnotationProcessor implements AnnotationProcessor +{ + + private AnnotationProcessorEnvironment environment; + + private AnnotationTypeDeclaration testCaseDeclaration; + + public TestCaseAnnotationProcessor(AnnotationProcessorEnvironment env) { + + environment =3D env; + testCaseDeclaration =3D (AnnotationTypeDeclaration) environment + .getTypeDeclaration("org.jboss.portal.unit.annotations.TestCase"); + } + + public void process() + { + Collection declarations =3D environment + .getDeclarationsAnnotatedWith(testCaseDeclaration); + for (Declaration declaration : declarations) { + processAnnotations(declaration); + } + } + + private void processAnnotations(Declaration declaration) { + // Get all of the annotation usage for this declaration. + // the annotation mirror is a reflection of what is in the source. + + File f =3D new File("./apt-output.txt"); + + PrintStream ps =3D null; + + try + { + ps =3D new PrintStream(f); + } + catch (FileNotFoundException e) + { + e.printStackTrace(); //To change body of catch statement use Fil= e | Settings | File Templates. + } + + + Collection annotations =3D declaration + .getAnnotationMirrors(); + // iterate over the mirrors. + for (AnnotationMirror mirror : annotations) { + // if the mirror in this iteration is for our note declaration... + if(mirror.getAnnotationType().getDeclaration().equals( + testCaseDeclaration)) { + + // print out the goodies. + SourcePosition position =3D mirror.getPosition(); + Map values =3D mirr= or + .getElementValues(); + + ps.println("Declaration: " + declaration.toString()); + ps.println("Position: " + position); + ps.println("Values:"); + for (Map.Entry entr= y : values + .entrySet()) { + AnnotationTypeElementDeclaration elemDecl =3D entry.getKey(); + AnnotationValue value =3D entry.getValue(); + ps.println(" " + elemDecl + "=3D" + value); + } + } + } + ps.close(); + + } +} Modified: modules/portlet/trunk/portlet-controller/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet-controller/pom.xml 2008-02-09 12:42:28 UT= C (rev 9889) +++ modules/portlet/trunk/portlet-controller/pom.xml 2008-02-09 13:17:09 UT= C (rev 9890) @@ -17,7 +17,7 @@ org.jboss.portal.portlet portlet-portlet ${project.version} - test-jar + jar = Copied: modules/portlet/trunk/portlet-controller/src/main/java/org/jboss/po= rtal/portlet/controller (from rev 9884, modules/portlet/trunk/test/src/main= /java/org/jboss/portal/portlet/controller) Modified: modules/portlet/trunk/test/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/pom.xml 2008-02-09 12:42:28 UTC (rev 9889) +++ modules/portlet/trunk/test/pom.xml 2008-02-09 13:17:09 UTC (rev 9890) @@ -3,7 +3,7 @@ org.jboss.portal.portlet module-parent - 1.2.0-SNAPSHOT + 2.0-SNAPSHOT ../build/pom.xml 4.0.0 @@ -19,8 +19,14 @@ ${project.version} test-jar + + org.jboss.portal.portlet + portlet-controller + ${project.version} + = - + + org.jboss.portal.portlet portlet-portlet @@ -355,6 +361,8 @@ value=3D"${maven.dependency.javax.portle= t.portlet-api.jar.path}"/> + + + + @@ -394,10 +397,14 @@ = + + = + + @@ -430,6 +437,8 @@ = + + @@ -697,8 +706,11 @@ = + = + + --===============4872176649274644035==-- From portal-commits at lists.jboss.org Sat Feb 9 08:33:22 2008 Content-Type: multipart/mixed; boundary="===============5128151684445560589==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9891 - modules/portlet/trunk/portlet-controller/src/main/java/org/jboss/portal/portlet. Date: Sat, 09 Feb 2008 08:33:22 -0500 Message-ID: --===============5128151684445560589== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-09 08:33:22 -0500 (Sat, 09 Feb 2008) New Revision: 9891 Removed: modules/portlet/trunk/portlet-controller/src/main/java/org/jboss/portal/= portlet/controller/ Log: first step: hope it won't make it worse.. --===============5128151684445560589==-- From portal-commits at lists.jboss.org Sat Feb 9 08:41:37 2008 Content-Type: multipart/mixed; boundary="===============0111428706996990469==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9892 - in modules/portlet/trunk/test/src/test/resources/simple-portal-war: layouts and 1 other directory. Date: Sat, 09 Feb 2008 08:41:36 -0500 Message-ID: --===============0111428706996990469== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-09 08:41:36 -0500 (Sat, 09 Feb 2008) New Revision: 9892 Removed: modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= default.jsp Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/hom= e.jsp Log: delete file Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/home.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/ho= me.jsp 2008-02-09 13:33:22 UTC (rev 9891) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/ho= me.jsp 2008-02-09 13:41:36 UTC (rev 9892) @@ -8,7 +8,7 @@ =
    -
    +

    Demo Page Title

    Deleted: modules/portlet/trunk/test/src/test/resources/simple-portal-war/la= youts/default.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /default.jsp 2008-02-09 13:33:22 UTC (rev 9891) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /default.jsp 2008-02-09 13:41:36 UTC (rev 9892) @@ -1,107 +0,0 @@ -<%@ page contentType=3D"text/html" %> -<%@ page language=3D"java" %> -<%@ taglib prefix=3D"jbp" tagdir=3D"/WEB-INF/tags/portal" %> -<%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> -<%@ page isELIgnored=3D"false" %> - - - - - Portlet Container 2.0 - - - - -
    -
    -
    -
    3D"Portlet
    -
    -
    - <%@ include file=3D"nav/main.jsp" %> - -
    - -
    -
    - -
    -

    Demo Page Title

    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed = do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exe= rcitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehenderi= t in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p= roident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed = do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exe= rcitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehenderi= t in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p= roident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed = do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exe= rcitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehenderi= t in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p= roident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed = do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exe= rcitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehenderi= t in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p= roident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed = do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exe= rcitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehenderi= t in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p= roident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed = do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exe= rcitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehenderi= t in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p= roident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed = do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exe= rcitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehenderi= t in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p= roident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed = do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exe= rcitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehenderi= t in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p= roident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed = do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exe= rcitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehenderi= t in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p= roident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed = do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exe= rcitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehenderi= t in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p= roident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed = do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exe= rcitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehenderi= t in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p= roident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    -
    - -
    -
    -
    -
    - - - \ No newline at end of file --===============0111428706996990469==-- From portal-commits at lists.jboss.org Sat Feb 9 08:46:21 2008 Content-Type: multipart/mixed; boundary="===============7358312671860255371==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9893 - modules/portlet/trunk/portlet-controller/src/main/java/org/jboss/portal/portlet. Date: Sat, 09 Feb 2008 08:46:21 -0500 Message-ID: --===============7358312671860255371== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-09 08:46:21 -0500 (Sat, 09 Feb 2008) New Revision: 9893 Added: modules/portlet/trunk/portlet-controller/src/main/java/org/jboss/portal/= portlet/controller/ Log: part two: fix what I broke. sorry Copied: modules/portlet/trunk/portlet-controller/src/main/java/org/jboss/po= rtal/portlet/controller (from rev 9889, modules/portlet/trunk/test/src/main= /java/org/jboss/portal/portlet/controller) --===============7358312671860255371==-- From portal-commits at lists.jboss.org Sat Feb 9 08:53:38 2008 Content-Type: multipart/mixed; boundary="===============6791990377727409350==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9894 - modules/portlet/trunk/portlet. Date: Sat, 09 Feb 2008 08:53:38 -0500 Message-ID: --===============6791990377727409350== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-09 08:53:38 -0500 (Sat, 09 Feb 2008) New Revision: 9894 Modified: modules/portlet/trunk/portlet/pom.xml Log: comment out Modified: modules/portlet/trunk/portlet/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/pom.xml 2008-02-09 13:46:21 UTC (rev 9893) +++ modules/portlet/trunk/portlet/pom.xml 2008-02-09 13:53:38 UTC (rev 9894) @@ -40,13 +40,13 @@ jaxb-api = - - sun.jdk - tools - 1.5.0 - system - ${JAVA_HOME}/lib/tools.jar - + + + + + + + = @@ -109,26 +109,26 @@ = - - org.apache.myfaces.tobago - maven-apt-plugin - - - test - + + + + + + + - 1.5 - true - true - org.jboss.portal.unit.reports.TestCaseAPF - - - testExecute - - - - + + + + + + + + + + + = --===============6791990377727409350==-- From portal-commits at lists.jboss.org Sat Feb 9 09:00:35 2008 Content-Type: multipart/mixed; boundary="===============5405909838301021121==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9895 - modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit. Date: Sat, 09 Feb 2008 09:00:34 -0500 Message-ID: --===============5405909838301021121== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-09 09:00:34 -0500 (Sat, 09 Feb 2008) New Revision: 9895 Removed: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/report= s/ Log: cleanup --===============5405909838301021121==-- From portal-commits at lists.jboss.org Sat Feb 9 09:09:09 2008 Content-Type: multipart/mixed; boundary="===============3039853801613862598==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9896 - in modules/portlet/trunk: controller and 2 other directories. Date: Sat, 09 Feb 2008 09:09:09 -0500 Message-ID: --===============3039853801613862598== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-09 09:09:09 -0500 (Sat, 09 Feb 2008) New Revision: 9896 Added: modules/portlet/trunk/controller/ Removed: modules/portlet/trunk/portlet-controller/ Modified: modules/portlet/trunk/controller/pom.xml modules/portlet/trunk/pom.xml modules/portlet/trunk/test/pom.xml modules/portlet/trunk/test/src/test/build.xml Log: renamed portlet-controller module to controller Copied: modules/portlet/trunk/controller (from rev 9895, modules/portlet/tr= unk/portlet-controller) Modified: modules/portlet/trunk/controller/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet-controller/pom.xml 2008-02-09 14:00:34 UT= C (rev 9895) +++ modules/portlet/trunk/controller/pom.xml 2008-02-09 14:09:09 UTC (rev 9= 896) @@ -7,7 +7,7 @@ ../build/pom.xml 4.0.0 - portlet-controller + controller jar Portlet controller = Modified: modules/portlet/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/pom.xml 2008-02-09 14:00:34 UTC (rev 9895) +++ modules/portlet/trunk/pom.xml 2008-02-09 14:09:09 UTC (rev 9896) @@ -29,7 +29,7 @@ build jsr168api portlet - portlet-controller + controller bridge federation management Modified: modules/portlet/trunk/test/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/pom.xml 2008-02-09 14:00:34 UTC (rev 9895) +++ modules/portlet/trunk/test/pom.xml 2008-02-09 14:09:09 UTC (rev 9896) @@ -21,7 +21,7 @@ org.jboss.portal.portlet - portlet-controller + controller ${project.version} = @@ -361,8 +361,8 @@ value=3D"${maven.dependency.javax.portle= t.portlet-api.jar.path}"/> - + = - \ No newline at end of file + Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-09 14:00:34 UTC (= rev 9895) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-09 14:09:09 UTC (= rev 9896) @@ -127,8 +127,8 @@ - - + + @@ -397,7 +397,7 @@ = - + = @@ -437,7 +437,7 @@ = - + = @@ -709,7 +709,7 @@ = = - + = @@ -801,4 +801,4 @@ = = - \ No newline at end of file + --===============3039853801613862598==-- From portal-commits at lists.jboss.org Sat Feb 9 09:20:51 2008 Content-Type: multipart/mixed; boundary="===============5480080990265871232==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9897 - in modules/portlet/trunk/test/src/test/resources/simple-portal-war: css and 3 other directories. Date: Sat, 09 Feb 2008 09:20:51 -0500 Message-ID: --===============5480080990265871232== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-09 09:20:51 -0500 (Sat, 09 Feb 2008) New Revision: 9897 Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o1.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o2.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o3.jsp Removed: modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= demo.jsp Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mast= er.css modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= nav/main.jsp Log: layout changes and new pages Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/c= ss/master.css =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-09 14:09:09 UTC (rev 9896) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-09 14:20:51 UTC (rev 9897) @@ -204,12 +204,12 @@ /*-------------------------------Portlet Decoration*/ = div#container div#content div.portlet{ - /*width: 800px;*/ border: 1px solid #969696; background-color: #e2e2e2; padding: 2px; float:left; margin:10px; + width: 95%; } = div#container div#content div.portlet-frame{ Copied: modules/portlet/trunk/test/src/test/resources/simple-portal-war/dem= o/demo1.jsp (from rev 9894, modules/portlet/trunk/test/src/test/resources/s= imple-portal-war/demo/demo.jsp) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo1.jsp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo1.jsp 2008-02-09 14:20:51 UTC (rev 9897) @@ -0,0 +1,21 @@ +<%@ page contentType=3D"text/html" %> +<%@ page language=3D"java" %> +<%@ taglib prefix=3D"jbp" tagdir=3D"/WEB-INF/tags/portal" %> +<%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> +<%@ page isELIgnored=3D"false" %> + +<%@ include file=3D"/layouts/header.jsp" %> + + + + + + + + + + + + + +<%@ include file=3D"/layouts/footer.jsp" %> \ No newline at end of file Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo= /demo2.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo2.jsp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo2.jsp 2008-02-09 14:20:51 UTC (rev 9897) @@ -0,0 +1,21 @@ +<%@ page contentType=3D"text/html" %> +<%@ page language=3D"java" %> +<%@ taglib prefix=3D"jbp" tagdir=3D"/WEB-INF/tags/portal" %> +<%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> +<%@ page isELIgnored=3D"false" %> + +<%@ include file=3D"/layouts/header.jsp" %> + + + + + + + + + + + + + +<%@ include file=3D"/layouts/footer.jsp" %> \ No newline at end of file Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo= /demo3.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo3.jsp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo3.jsp 2008-02-09 14:20:51 UTC (rev 9897) @@ -0,0 +1,21 @@ +<%@ page contentType=3D"text/html" %> +<%@ page language=3D"java" %> +<%@ taglib prefix=3D"jbp" tagdir=3D"/WEB-INF/tags/portal" %> +<%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> +<%@ page isELIgnored=3D"false" %> + +<%@ include file=3D"/layouts/header.jsp" %> + + + + + + + + + + + + + +<%@ include file=3D"/layouts/footer.jsp" %> \ No newline at end of file Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/i= ndex.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-09 14:09:09 UTC (rev 9896) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-09 14:20:51 UTC (rev 9897) @@ -3,8 +3,6 @@ <%@ page isELIgnored=3D"false" %> - - - + Deleted: modules/portlet/trunk/test/src/test/resources/simple-portal-war/la= youts/demo.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /demo.jsp 2008-02-09 14:09:09 UTC (rev 9896) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /demo.jsp 2008-02-09 14:20:51 UTC (rev 9897) @@ -1,47 +0,0 @@ -<%@ page contentType=3D"text/html" %> -<%@ page language=3D"java" %> -<%@ taglib prefix=3D"jbp" tagdir=3D"/WEB-INF/tags/portal" %> -<%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> -<%@ page isELIgnored=3D"false" %> - - - - -Portlet Container 2.0 - - - - -
    -
    -
    -
    - -
    -
    -
    - <%@ include file=3D"nav/main.jsp" %> - = -
    - - - - - - - - - - - - - - -
    -
    -
    - - - \ No newline at end of file Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/l= ayouts/nav/main.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /nav/main.jsp 2008-02-09 14:09:09 UTC (rev 9896) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /nav/main.jsp 2008-02-09 14:20:51 UTC (rev 9897) @@ -18,6 +18,15 @@
  • Demo Portlets
  • +
  • + Demo1 +
  • +
  • + Demo2 +
  • +
  • + Demo3 +

  • --===============5480080990265871232==-- From portal-commits at lists.jboss.org Sat Feb 9 09:21:49 2008 Content-Type: multipart/mixed; boundary="===============6753477833782235661==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9898 - in modules/portlet/trunk: test and 1 other directories. Date: Sat, 09 Feb 2008 09:21:49 -0500 Message-ID: --===============6753477833782235661== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-09 09:21:49 -0500 (Sat, 09 Feb 2008) New Revision: 9898 Modified: modules/portlet/trunk/controller/pom.xml modules/portlet/trunk/test/pom.xml modules/portlet/trunk/test/src/test/build.xml Log: revert the rename of artifact id of portlet-controller Modified: modules/portlet/trunk/controller/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/pom.xml 2008-02-09 14:20:51 UTC (rev 9= 897) +++ modules/portlet/trunk/controller/pom.xml 2008-02-09 14:21:49 UTC (rev 9= 898) @@ -7,7 +7,7 @@ ../build/pom.xml 4.0.0 - controller + portlet-controller jar Portlet controller = Modified: modules/portlet/trunk/test/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/pom.xml 2008-02-09 14:20:51 UTC (rev 9897) +++ modules/portlet/trunk/test/pom.xml 2008-02-09 14:21:49 UTC (rev 9898) @@ -21,7 +21,7 @@ org.jboss.portal.portlet - controller + portlet-controller ${project.version} = @@ -361,8 +361,8 @@ value=3D"${maven.dependency.javax.portle= t.portlet-api.jar.path}"/> - + = - + \ No newline at end of file Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-09 14:20:51 UTC (= rev 9897) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-09 14:21:49 UTC (= rev 9898) @@ -127,8 +127,8 @@ - - + + @@ -397,7 +397,7 @@ = - + = @@ -437,7 +437,7 @@ = - + = @@ -709,7 +709,7 @@ = = - + = @@ -801,4 +801,4 @@ = = - + \ No newline at end of file --===============6753477833782235661==-- From portal-commits at lists.jboss.org Sat Feb 9 09:31:51 2008 Content-Type: multipart/mixed; boundary="===============4956475284897354921==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9899 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp: taglib and 1 other directory. Date: Sat, 09 Feb 2008 09:31:50 -0500 Message-ID: --===============4956475284897354921== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-09 09:31:49 -0500 (Sat, 09 Feb 2008) New Revision: 9899 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalRenderResponse.java Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/JspWriterResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PageParamTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PageTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortalBodyTagSupport.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortalSimpleTagSupport.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletMarkupTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletURLTag.java Log: rename PortalResponse to PortalRenderResponse Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-09 14:21:49 UTC (rev 9898) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-09 14:31:49 UTC (rev 9899) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp; = -import org.jboss.portal.portlet.test.jsp.PortalResponse; +import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; import org.jboss.portal.portlet.test.controller.PortletURLRenderer; import org.jboss.portal.portlet.PortletInvoker; import org.jboss.portal.portlet.PortletInvokerException; @@ -207,10 +207,10 @@ } = // - PortalResponse portalResponse =3D new PortalResponse(resp, context, = pageState); + PortalRenderResponse renderResponse =3D new PortalRenderResponse(res= p, context, pageState); = // - chain.doFilter(req, portalResponse); + chain.doFilter(req, renderResponse); } = public void destroy() @@ -218,7 +218,7 @@ this.config =3D null; } = - protected void render(HttpServletRequest req, PortalResponse resp) thro= ws ServletException, IOException, ClassNotFoundException + protected void render(HttpServletRequest req, PortalRenderResponse resp= ) throws ServletException, IOException, ClassNotFoundException { = // Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/jsp/PortalRenderResponse.java (from rev 9898, modules/portlet/trunk/tes= t/src/main/java/org/jboss/portal/portlet/test/jsp/PortalResponse.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalRenderResponse.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalRenderResponse.java 2008-02-09 14:31:49 UTC (rev 9899) @@ -0,0 +1,203 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp; + +import org.jboss.portal.portlet.test.controller.TestInstanceContext; +import org.jboss.portal.portlet.test.controller.TestPortalContext; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.RenderInvocation; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.impl.spi.AbstractClientContext; +import org.jboss.portal.portlet.impl.spi.AbstractServerContext; +import org.jboss.portal.portlet.impl.spi.AbstractUserContext; +import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; +import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; +import org.jboss.portal.portlet.spi.PortletInvocationContext; +import org.jboss.portal.WindowState; +import org.jboss.portal.Mode; +import org.jboss.portal.common.util.ParameterMap; + +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpServletResponseWrapper; +import javax.xml.namespace.QName; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortalRenderResponse extends HttpServletResponseWrapper +{ + + /** . */ + private final PagePortletControllerContext portletControllerContext; + + /** . */ + private PageNavigationalState pageState; + + /** . */ + private int count =3D 0; + + /** Wether or not the page state can be modified. */ + private boolean pageStateModifiable; + + public PortalRenderResponse( + HttpServletResponse response, + PagePortletControllerContext portletControllerContext, + PageNavigationalState pageState) + { + super(response); + + // + this.portletControllerContext =3D portletControllerContext; + this.pageState =3D pageState; + this.pageStateModifiable =3D true; + } + + /** + * The page state for the rendering. + * + * @return the page state + */ + public PageNavigationalState getPageState() + { + return pageState; + } + + public PortletInvocationResponse render(Portlet portlet, String windowI= d) throws PortletInvokerException + { + WindowNavigationalState windowNS =3D null; + if (pageState !=3D null) + { + windowNS =3D pageState.getWindowNavigationalState(windowId); + } + + // + ParameterMap publicNS =3D null; + if (pageState !=3D null) + { + publicNS =3D pageState.getPublicNavigationalState(windowId); + } + + // + Mode mode =3D Mode.VIEW; + WindowState windowState =3D WindowState.NORMAL; + StateString portletNS =3D null; + + // + if (windowNS !=3D null) + { + if (windowNS.getMode() !=3D null) + { + mode =3D windowNS.getMode(); + } + if (windowNS.getWindowState() !=3D null) + { + windowState =3D windowNS.getWindowState(); + } + if (windowNS.getPortletNavigationalState() !=3D null) + { + portletNS =3D windowNS.getPortletNavigationalState(); + } + } + + // + PortletInvocationContext renderContext =3D portletControllerContext.= createPortletInvocationContext(windowId, pageState); + RenderInvocation render =3D new RenderInvocation(renderContext); + render.setClientContext(new AbstractClientContext(portletControllerC= ontext.getClientRequest())); + render.setServerContext(new AbstractServerContext(portletControllerC= ontext.getClientRequest(), portletControllerContext.getClientResponse())); + render.setInstanceContext(new TestInstanceContext(portletControllerC= ontext.getClientRequest(), portlet.getContext(), false)); + render.setUserContext(new AbstractUserContext(portletControllerConte= xt.getClientRequest())); + render.setWindowContext(new AbstractWindowContext(windowId)); + render.setPortalContext(new TestPortalContext()); + render.setSecurityContext(new AbstractSecurityContext(portletControl= lerContext.getClientRequest())); + render.setTarget(portlet.getContext()); + render.setMode(mode); + render.setWindowState(windowState); + render.setNavigationalState(portletNS); + render.setPublicNavigationalState(publicNS); + + // + pageStateModifiable =3D false; + + // + return portletControllerContext.invoke(render); + } + + public boolean isPageStateModifiable() + { + return pageStateModifiable; + } + + public String getPageParameter(QName name) + { + return pageState !=3D null ? pageState.getPublicNavigationalState(na= me)[0] : null; + } + + public void setPageParameter(QName name, String value) + { + if (pageStateModifiable) + { + if (pageState =3D=3D null) + { + pageState =3D portletControllerContext.getStateControllerConte= xt().createPageState(true); + } + pageState.setPublicNavigationalState(name, new String[]{value}); + } + else + { + throw new IllegalStateException("Page state cannot be modified"); + } + } + + public String getMaximizedWindowId() + { + if (pageState !=3D null) + { + for (String windowId : pageState.getWindowIds()) + { + WindowNavigationalState windowNS =3D pageState.getWindowNaviga= tionalState(windowId); + if (WindowState.MAXIMIZED.equals(windowNS.getWindowState())) + { + return windowId; + } + } + } + + // + return null; + } + + public PagePortletControllerContext getPortletControllerContext() + { + return portletControllerContext; + } + + public String nextId() + { + return "" + count++; + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/JspWriterResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/JspWriterResponse.java 2008-02-09 14:21:49 UTC (rev 9898) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/JspWriterResponse.java 2008-02-09 14:31:49 UTC (rev 9899) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp.taglib; = -import org.jboss.portal.portlet.test.jsp.PortalResponse; +import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; = import javax.servlet.http.HttpServletResponseWrapper; import javax.servlet.jsp.JspWriter; @@ -43,9 +43,9 @@ /** . */ private final PrintWriter writer; = - public JspWriterResponse(PortalResponse portalResponse, JspWriter deleg= ate) + public JspWriterResponse(PortalRenderResponse renderResponse, JspWriter= delegate) { - super(portalResponse); + super(renderResponse); = // this.delegate =3D delegate; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PageParamTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageParamTag.java 2008-02-09 14:21:49 UTC (rev 9898) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageParamTag.java 2008-02-09 14:31:49 UTC (rev 9899) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp.taglib; = -import org.jboss.portal.portlet.test.jsp.PortalResponse; +import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; = import javax.servlet.jsp.JspException; import javax.xml.namespace.QName; @@ -89,17 +89,17 @@ = public void internalDoTag() throws JspException, IOException { - PortalResponse response =3D getPortalResponse(); + PortalRenderResponse renderResponse =3D getPortalResponse(); = // - if (response.isPageStateModifiable()) + if (renderResponse.isPageStateModifiable()) { QName name =3D new QName(namespaceURI, localName); = // - if (!"true".equals(frozen) || response.getPageParameter(name) =3D= =3D null) + if (!"true".equals(frozen) || renderResponse.getPageParameter(nam= e) =3D=3D null) { - response.setPageParameter(name, value); + renderResponse.setPageParameter(name, value); } } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PageTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageTag.java 2008-02-09 14:21:49 UTC (rev 9898) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageTag.java 2008-02-09 14:31:49 UTC (rev 9899) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp.taglib; = -import org.jboss.portal.portlet.test.jsp.PortalResponse; +import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; = import javax.servlet.jsp.JspException; import javax.xml.namespace.QName; @@ -57,13 +57,13 @@ { if (status =3D=3D Status.INACTIVE) { - PortalResponse response =3D getPortalResponse(); + PortalRenderResponse renderResponse =3D getPortalResponse(); = // status =3D Status.ACTIVE; = // - maximizedId =3D response.getMaximizedWindowId(); + maximizedId =3D renderResponse.getMaximizedWindowId(); = // if (maximizedId !=3D null) Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortalBodyTagSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalBodyTagSupport.java 2008-02-09 14:21:49 UTC (rev 9898) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalBodyTagSupport.java 2008-02-09 14:31:49 UTC (rev 9899) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp.taglib; = -import org.jboss.portal.portlet.test.jsp.PortalResponse; +import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; = import javax.servlet.jsp.tagext.BodyTagSupport; import javax.servlet.jsp.JspException; @@ -33,9 +33,9 @@ */ public class PortalBodyTagSupport extends BodyTagSupport { - protected final PortalResponse getPortalResponse() + protected final PortalRenderResponse getPortalResponse() { - return (PortalResponse)pageContext.getResponse(); + return (PortalRenderResponse)pageContext.getResponse(); } = public int doStartTag() throws JspException Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortalSimpleTagSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalSimpleTagSupport.java 2008-02-09 14:21:49 UTC (rev 9898) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalSimpleTagSupport.java 2008-02-09 14:31:49 UTC (rev 9899) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp.taglib; = -import org.jboss.portal.portlet.test.jsp.PortalResponse; +import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; = import javax.servlet.jsp.tagext.SimpleTagSupport; import javax.servlet.jsp.PageContext; @@ -35,10 +35,10 @@ */ public class PortalSimpleTagSupport extends SimpleTagSupport { - protected final PortalResponse getPortalResponse() + protected final PortalRenderResponse getPortalResponse() { PageContext pageContext =3D (PageContext)getJspContext(); - return (PortalResponse)pageContext.getResponse(); + return (PortalRenderResponse)pageContext.getResponse(); } = public void doTag() throws JspException, IOException Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletMarkupTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletMarkupTag.java 2008-02-09 14:21:49 UTC (rev 9898) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletMarkupTag.java 2008-02-09 14:31:49 UTC (rev 9899) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp.taglib; = -import org.jboss.portal.portlet.test.jsp.PortalResponse; +import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; @@ -41,7 +41,7 @@ { public void internalDoTag() throws JspException, IOException { - PortalResponse resp =3D getPortalResponse(); + PortalRenderResponse resp =3D getPortalResponse(); = PortletTag portletTag =3D (PortletTag)SimpleTagSupport.findAncestorW= ithClass(this, PortletTag.class); = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-09 14:21:49 UTC (rev 9898) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-09 14:31:49 UTC (rev 9899) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp.taglib; = -import org.jboss.portal.portlet.test.jsp.PortalResponse; +import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; import org.jboss.portal.portlet.test.jsp.PagePortletControllerContext; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; @@ -78,7 +78,7 @@ private Set supportedModes; private Mode initialMode; private PageTag pageTag; - private PortalResponse response; + private PortalRenderResponse renderResponse; = /** . */ PortletResult result; @@ -187,7 +187,7 @@ this.supportedModes =3D supportedModes; this.supportedWindowStates =3D supportedWindowStates; this.pageTag =3D (PageTag)findAncestorWithClass(this, PageTag.class); - this.response =3D getPortalResponse(); + this.renderResponse =3D getPortalResponse(); } = private void destroyState() @@ -196,7 +196,7 @@ this.supportedModes =3D null; this.supportedWindowStates =3D null; this.pageTag =3D null; - this.response =3D null; + this.renderResponse =3D null; } = public int internalDoStartTag() throws JspException @@ -204,7 +204,7 @@ initState(); = // - PagePortletControllerContext context =3D response.getPortletControll= erContext(); + PagePortletControllerContext context =3D renderResponse.getPortletCo= ntrollerContext(); = // Portlet portlet =3D context.findPortlet(applicationNameAttr, nameAtt= r); @@ -219,7 +219,7 @@ } else { - String windowId =3D portlet.getContext().getId() + "." + response= .nextId(); + String windowId =3D portlet.getContext().getId() + "." + renderRe= sponse.nextId(); = // if (pageTag.maximizedId !=3D null) @@ -258,7 +258,7 @@ { try { - PortletInvocationResponse portletResponse =3D response.render(por= tlet, windowId); + PortletInvocationResponse portletResponse =3D renderResponse.rend= er(portlet, windowId); = // if (portletResponse instanceof FragmentResponse) @@ -330,7 +330,7 @@ request.setAttribute(Constants.ERROR_PORTLET_NAME, nameAttr= ); = // - rd.include(pageContext.getRequest(), new JspWriterResponse(= response, pageContext.getOut())); + rd.include(pageContext.getRequest(), new JspWriterResponse(= renderResponse, pageContext.getOut())); } catch (ServletException e) { Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-09 14:21:49 UTC (rev 9898) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-09 14:31:49 UTC (rev 9899) @@ -24,7 +24,7 @@ = import org.jboss.portal.Mode; import org.jboss.portal.WindowState; -import org.jboss.portal.portlet.test.jsp.PortalResponse; +import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; import org.jboss.portal.portlet.test.jsp.PagePortletControllerContext; import org.jboss.portal.portlet.test.controller.PortletURLRenderer; import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; @@ -77,8 +77,8 @@ = public int internalDoEndTag() throws JspException { - PortalResponse response =3D getPortalResponse(); - PagePortletControllerContext context =3D response.getPortletControll= erContext(); + PortalRenderResponse renderResponse =3D getPortalResponse(); + PagePortletControllerContext context =3D renderResponse.getPortletCo= ntrollerContext(); PortletTag portletTag =3D (PortletTag)SimpleTagSupport.findAncestorW= ithClass(this, PortletTag.class); = Mode mode =3D null; @@ -96,7 +96,7 @@ = PortletURLRenderer renderer =3D new PortletURLRenderer( (StateControllerContextImpl)context.getStateControllerContext(), - response.getPageState(), + renderResponse.getPageState(), context.getClientRequest(), context.getClientResponse()); = --===============4956475284897354921==-- From portal-commits at lists.jboss.org Sat Feb 9 09:44:32 2008 Content-Type: multipart/mixed; boundary="===============5685819388234788477==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9900 - modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo. Date: Sat, 09 Feb 2008 09:44:32 -0500 Message-ID: --===============5685819388234788477== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-09 09:44:32 -0500 (Sat, 09 Feb 2008) New Revision: 9900 Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o1.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o2.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o3.jsp Log: page updates Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/demo1.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo1.jsp 2008-02-09 14:31:49 UTC (rev 9899) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo1.jsp 2008-02-09 14:44:32 UTC (rev 9900) @@ -10,10 +10,10 @@ - + - + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/demo2.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo2.jsp 2008-02-09 14:31:49 UTC (rev 9899) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo2.jsp 2008-02-09 14:44:32 UTC (rev 9900) @@ -10,10 +10,13 @@ + = = + + = Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/demo3.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo3.jsp 2008-02-09 14:31:49 UTC (rev 9899) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo3.jsp 2008-02-09 14:44:32 UTC (rev 9900) @@ -11,9 +11,12 @@ = + + + - + --===============5685819388234788477==-- From portal-commits at lists.jboss.org Sat Feb 9 11:11:20 2008 Content-Type: multipart/mixed; boundary="===============5692183945830195710==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9902 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp. Date: Sat, 09 Feb 2008 11:11:20 -0500 Message-ID: --===============5692183945830195710== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-09 11:11:20 -0500 (Sat, 09 Feb 2008) New Revision: 9902 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalResponse.java Log: PageEventControllerContext that use the page structure to route events (tha= nks Chris, I totally missed the use case) Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/PortalResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalResponse.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalResponse.java 2008-02-09 16:11:20 UTC (rev 9902) @@ -0,0 +1,122 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp; + +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletInvoker; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.info.PortletInfo; + +import javax.servlet.http.HttpServletResponseWrapper; +import javax.servlet.http.HttpServletResponse; +import java.util.Map; +import java.util.HashMap; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortalResponse extends HttpServletResponseWrapper +{ + + /** . */ + private final PortletInvoker invoker; + + /** . */ + private final Map portlets; + + /** . */ + private int count =3D 0; + + public PortalResponse( + HttpServletResponse response, + PortletInvoker invoker) throws PortletInvokerException + { + super(response); + + // + Map portlets =3D new HashMap(); + for (Portlet portlet : invoker.getPortlets()) + { + PortletInfo portletInfo =3D portlet.getInfo(); + String portletName =3D portletInfo.getName(); + String applicationName =3D portletInfo.getApplicationName(); + Key key =3D new Key(applicationName, portletName); + portlets.put(key, portlet); + } + + // + this.portlets =3D portlets; + this.invoker =3D invoker; + } + + public PortletInvoker getInvoker() + { + return invoker; + } + + public Portlet findPortlet(String applicationName, String portletName) + { + return portlets.get(new Key(applicationName, portletName)); + } + + public String nextId() + { + return "" + count++; + } + + private static class Key + { + + /** . */ + private final String applicationName; + + /** . */ + private final String portletName; + + private Key(String applicationName, String portletName) + { + this.applicationName =3D applicationName; + this.portletName =3D portletName; + } + + public boolean equals(Object obj) + { + if (obj =3D=3D this) + { + return true; + } + if (obj instanceof Key) + { + Key that =3D (Key)obj; + return applicationName.equals(that.applicationName) && portlet= Name.equals(that.portletName); + } + return false; + } + + public int hashCode() + { + return applicationName.hashCode() + portletName.hashCode(); + } + } +} --===============5692183945830195710==-- From portal-commits at lists.jboss.org Sat Feb 9 11:12:05 2008 Content-Type: multipart/mixed; boundary="===============6295787258521636631==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9901 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp: taglib and 1 other directory. Date: Sat, 09 Feb 2008 11:11:01 -0500 Message-ID: --===============6295787258521636631== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-09 11:11:00 -0500 (Sat, 09 Feb 2008) New Revision: 9901 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PageEventControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalActionResponse.java Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalResponse.java Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PagePortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalRenderResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PageParamTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PageTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/ParamTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortalBodyTagSupport.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortalSimpleTagSupport.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletMarkupTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTitleTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletURLTag.java Log: PageEventControllerContext that use the page structure to route events (tha= nks Chris, I totally missed the use case) Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-09 14:44:32 UTC (rev 9900) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-09 16:11:00 UTC (rev 9901) @@ -22,7 +22,6 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp; = -import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; import org.jboss.portal.portlet.test.controller.PortletURLRenderer; import org.jboss.portal.portlet.PortletInvoker; import org.jboss.portal.portlet.PortletInvokerException; @@ -72,13 +71,25 @@ = public void doFilter(ServletRequest req, ServletResponse resp, FilterCh= ain chain) throws IOException, ServletException { - doFilter((HttpServletRequest)req, (HttpServletResponse)resp, chain); + try + { + doFilter((HttpServletRequest)req, (HttpServletResponse)resp, chai= n); + } + catch (PortletInvokerException e) + { + throw new ServletException(e); + } } = - public void doFilter(HttpServletRequest req, HttpServletResponse resp, = FilterChain chain) throws IOException, ServletException + public void doFilter(HttpServletRequest req, HttpServletResponse resp, = FilterChain chain) throws IOException, ServletException, PortletInvokerExce= ption { PortletInvoker invoker =3D (PortletInvoker)getServletContext().getAt= tribute("ConsumerPortletInvoker"); = + + PortalActionResponse actionResponse =3D new PortalActionResponse(res= p, invoker); + + chain.doFilter(req, actionResponse); + // PagePortletControllerContext context; try @@ -87,7 +98,7 @@ req, resp, getServletContext(), - invoker); + actionResponse); } catch (PortletInvokerException e) { @@ -97,6 +108,9 @@ PageNavigationalState pageState =3D null; if (context.getRequest() !=3D null) { + + + ControllerResponse controllerResponse; try { @@ -207,7 +221,7 @@ } = // - PortalRenderResponse renderResponse =3D new PortalRenderResponse(res= p, context, pageState); + PortalRenderResponse renderResponse =3D new PortalRenderResponse(res= p, invoker, context, pageState); = // chain.doFilter(req, renderResponse); Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/PageEventControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PageEventControllerContext.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PageEventControllerContext.java 2008-02-09 16:11:00 UTC (rev 9901) @@ -0,0 +1,71 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp; + +import org.jboss.portal.portlet.controller.event.EventControllerContext; +import org.jboss.portal.portlet.controller.event.Event; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.info.PortletInfo; + +import java.util.List; +import java.util.ArrayList; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PageEventControllerContext implements EventControllerContext +{ + + /** . */ + private final PortalActionResponse actionResponse; + + public PageEventControllerContext(PortalActionResponse actionResponse) + { + this.actionResponse =3D actionResponse; + } + + public List getConsumedEvents(Event producedEvent) + { + ArrayList consumedEvents =3D new ArrayList(); + + // + for (String windowId : actionResponse.getWindowIds()) + { + Portlet portlet =3D actionResponse.getPortlet(windowId); + + // + PortletInfo portletInfo =3D portlet.getInfo(); + + // + if (portletInfo.getEventing().getConsumedEvents().containsKey(pro= ducedEvent.getName())) + { + Event consumedEvent =3D new Event(producedEvent.getName(), pro= ducedEvent.getPayload(), windowId); + consumedEvents.add(consumedEvent); + } + } + + // + return consumedEvents; + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PagePortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-09 14:44:32 UTC (rev 9900) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-09 16:11:00 UTC (rev 9901) @@ -24,11 +24,8 @@ = import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletContext; -import org.jboss.portal.portlet.PortletInvoker; import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.controller.event.EventControllerContext; -import org.jboss.portal.portlet.controller.impl.event.EventControllerConte= xtImpl; -import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.test.controller.AbstractPortletControllerC= ontext; @@ -39,8 +36,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -import java.util.HashMap; -import java.util.Map; = /** * @author Julien Viet @@ -50,45 +45,25 @@ { = /** . */ - private final PortletInvoker invoker; - - /** . */ private final EventControllerContext eventControllerContext; = /** . */ - private final Map portlets; + private final PortalResponse actionResponse; = public PagePortletControllerContext( HttpServletRequest req, HttpServletResponse resp, ServletContext servletContext, - PortletInvoker invoker) + PortalActionResponse actionResponse) throws IllegalRequestException, IOException, ServletException, Portl= etInvokerException { super(req, resp, servletContext); = // - Map portlets =3D new HashMap(); - for (Portlet portlet : invoker.getPortlets()) - { - PortletInfo portletInfo =3D portlet.getInfo(); - String portletName =3D portletInfo.getName(); - String applicationName =3D portletInfo.getApplicationName(); - Key key =3D new Key(applicationName, portletName); - portlets.put(key, portlet); - } - - // - this.portlets =3D portlets; - this.invoker =3D invoker; - this.eventControllerContext =3D new EventControllerContextImpl(invok= er); + this.actionResponse =3D actionResponse; + this.eventControllerContext =3D new PageEventControllerContext(actio= nResponse); } = - public Portlet findPortlet(String applicationName, String portletName) - { - return portlets.get(new Key(applicationName, portletName)); - } - protected Portlet getPortlet(String windowId) throws PortletInvokerExce= ption { int index =3D windowId.lastIndexOf('.'); @@ -96,58 +71,24 @@ = // in the case of an event propagation, the given 'windowId' is actu= ally the portlet id already so need to check // for that case (portletId should still have a '.', if not it means= that the windowId was really a portlet id) - if (portletId.indexOf('.') =3D=3D -1) - { - portletId =3D windowId; - } +// if (portletId.indexOf('.') =3D=3D -1) +// { +// portletId =3D windowId; +// } = PortletContext portletContext =3D PortletContext.createPortletContex= t(portletId); - return invoker.getPortlet(portletContext); + + // + return actionResponse.getInvoker().getPortlet(portletContext); } = public PortletInvocationResponse invoke(PortletInvocation invocation) t= hrows PortletInvokerException { - return invoker.invoke(invocation); + return actionResponse.getInvoker().invoke(invocation); } = public EventControllerContext getEventControllerContext() { return eventControllerContext; } - - private static class Key - { - - /** . */ - private final String applicationName; - - /** . */ - private final String portletName; - - private Key(String applicationName, String portletName) - { - this.applicationName =3D applicationName; - this.portletName =3D portletName; - } - - public boolean equals(Object obj) - { - if (obj =3D=3D this) - { - return true; - } - if (obj instanceof Key) - { - Key that =3D (Key)obj; - return applicationName.equals(that.applicationName) && portlet= Name.equals(that.portletName); - } - return false; - } - - public int hashCode() - { - return applicationName.hashCode() + portletName.hashCode(); - } - } - } Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/PortalActionResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalActionResponse.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalActionResponse.java 2008-02-09 16:11:00 UTC (rev 9901) @@ -0,0 +1,242 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp; + +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletInvoker; +import org.jboss.portal.portlet.PortletInvokerException; + +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.Cookie; +import javax.servlet.ServletOutputStream; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.Writer; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortalActionResponse extends PortalResponse +{ + + /** . */ + private String contentType; + + /** . */ + private Locale locale; + + /** . */ + private String characterEncoding; + + /** . */ + private int bufferSize; + + /** . */ + private ServletOutputStream outputStream; + + /** . */ + private PrintWriter writer; + + /** . */ + private Map windows; + + public PortalActionResponse(HttpServletResponse response, PortletInvoke= r invoker) throws PortletInvokerException + { + super(response, invoker); + + // + this.windows =3D new HashMap(); + } + + public void addWindow(String windowId, Portlet portlet) + { + windows.put(windowId, portlet); + } + + public Set getWindowIds() + { + return windows.keySet(); + } + + public Portlet getPortlet(String windowId) + { + return windows.get(windowId); + } + + public ServletOutputStream getOutputStream() throws IOException + { + if (writer !=3D null) + { + throw new IllegalStateException(); + } + if (outputStream =3D=3D null) + { + outputStream =3D new ServletOutputStream() + { + public void write(int b) throws IOException + { + } + }; + } + return outputStream; + } + + public PrintWriter getWriter() throws IOException + { + if (outputStream !=3D null) + { + throw new IllegalStateException(); + } + if (writer =3D=3D null) + { + Writer tmp =3D new Writer() + { + public void write(char cbuf[], int off, int len) throws IOExce= ption + { + } + public void flush() throws IOException + { + } + public void close() throws IOException + { + } + }; + writer =3D new PrintWriter(tmp); + } + return writer; + } + + public void flushBuffer() throws IOException + { + } + + public boolean isCommitted() + { + return false; + } + + public void reset() + { + } + + public void resetBuffer() + { + } + + public void sendError(int i, String s) throws IOException + { + } + + public void sendError(int i) throws IOException + { + } + + public void sendRedirect(String s) throws IOException + { + } + + public void addCookie(Cookie cookie) + { + } + + public void setDateHeader(String s, long l) + { + } + + public void addDateHeader(String s, long l) + { + } + + public void setHeader(String s, String s1) + { + } + + public void addHeader(String s, String s1) + { + } + + public void setContentType(String contentType) + { + this.contentType =3D contentType; + } + + public void setContentLength(int i) + { + } + + public void setCharacterEncoding(String characterEncoding) + { + this.characterEncoding =3D characterEncoding; + } + + public void setIntHeader(String s, int i) + { + } + + public void addIntHeader(String s, int i) + { + } + + public void setStatus(int i) + { + } + + public void setStatus(int i, String s) + { + } + + public void setLocale(Locale locale) + { + this.locale =3D locale; + } + + public String getContentType() + { + return contentType; + } + + public Locale getLocale() + { + return locale; + } + + public String getCharacterEncoding() + { + return characterEncoding; + } + + public void setBufferSize(int bufferSize) + { + this.bufferSize =3D bufferSize; + } + + public int getBufferSize() + { + return bufferSize; + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PortalRenderResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalRenderResponse.java 2008-02-09 14:44:32 UTC (rev 9900) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalRenderResponse.java 2008-02-09 16:11:00 UTC (rev 9901) @@ -31,6 +31,7 @@ import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.PortletInvoker; import org.jboss.portal.portlet.impl.spi.AbstractClientContext; import org.jboss.portal.portlet.impl.spi.AbstractServerContext; import org.jboss.portal.portlet.impl.spi.AbstractUserContext; @@ -42,39 +43,36 @@ import org.jboss.portal.common.util.ParameterMap; = import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpServletResponseWrapper; import javax.xml.namespace.QName; = /** * @author Julien Viet * @version $Revision: 630 $ */ -public class PortalRenderResponse extends HttpServletResponseWrapper +public class PortalRenderResponse extends PortalResponse { = /** . */ - private final PagePortletControllerContext portletControllerContext; - - /** . */ private PageNavigationalState pageState; = - /** . */ - private int count =3D 0; - /** Wether or not the page state can be modified. */ private boolean pageStateModifiable; = + /** . */ + private PagePortletControllerContext portletControllerContext; + public PortalRenderResponse( HttpServletResponse response, + PortletInvoker invoker, PagePortletControllerContext portletControllerContext, - PageNavigationalState pageState) + PageNavigationalState pageState) throws PortletInvokerException { - super(response); + super(response, invoker); = // - this.portletControllerContext =3D portletControllerContext; this.pageState =3D pageState; this.pageStateModifiable =3D true; + this.portletControllerContext =3D portletControllerContext; } = /** @@ -87,6 +85,11 @@ return pageState; } = + public PagePortletControllerContext getPortletControllerContext() + { + return portletControllerContext; + } + public PortletInvocationResponse render(Portlet portlet, String windowI= d) throws PortletInvokerException { WindowNavigationalState windowNS =3D null; @@ -190,14 +193,4 @@ // return null; } - - public PagePortletControllerContext getPortletControllerContext() - { - return portletControllerContext; - } - - public String nextId() - { - return "" + count++; - } } Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/PortalResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalResponse.java 2008-02-09 14:44:32 UTC (rev 9900) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalResponse.java 2008-02-09 16:11:00 UTC (rev 9901) @@ -1,203 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp; - -import org.jboss.portal.portlet.test.controller.TestInstanceContext; -import org.jboss.portal.portlet.test.controller.TestPortalContext; -import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.controller.state.WindowNavigationalState; -import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.invocation.RenderInvocation; -import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.Portlet; -import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.impl.spi.AbstractClientContext; -import org.jboss.portal.portlet.impl.spi.AbstractServerContext; -import org.jboss.portal.portlet.impl.spi.AbstractUserContext; -import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; -import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; -import org.jboss.portal.portlet.spi.PortletInvocationContext; -import org.jboss.portal.WindowState; -import org.jboss.portal.Mode; -import org.jboss.portal.common.util.ParameterMap; - -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpServletResponseWrapper; -import javax.xml.namespace.QName; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class PortalResponse extends HttpServletResponseWrapper -{ - - /** . */ - private final PagePortletControllerContext portletControllerContext; - - /** . */ - private PageNavigationalState pageState; - - /** . */ - private int count =3D 0; - - /** Wether or not the page state can be modified. */ - private boolean pageStateModifiable; - - public PortalResponse( - HttpServletResponse response, - PagePortletControllerContext portletControllerContext, - PageNavigationalState pageState) - { - super(response); - - // - this.portletControllerContext =3D portletControllerContext; - this.pageState =3D pageState; - this.pageStateModifiable =3D true; - } - - /** - * The page state for the rendering. - * - * @return the page state - */ - public PageNavigationalState getPageState() - { - return pageState; - } - - public PortletInvocationResponse render(Portlet portlet, String windowI= d) throws PortletInvokerException - { - WindowNavigationalState windowNS =3D null; - if (pageState !=3D null) - { - windowNS =3D pageState.getWindowNavigationalState(windowId); - } - - // - ParameterMap publicNS =3D null; - if (pageState !=3D null) - { - publicNS =3D pageState.getPublicNavigationalState(windowId); - } - - // - Mode mode =3D Mode.VIEW; - WindowState windowState =3D WindowState.NORMAL; - StateString portletNS =3D null; - - // - if (windowNS !=3D null) - { - if (windowNS.getMode() !=3D null) - { - mode =3D windowNS.getMode(); - } - if (windowNS.getWindowState() !=3D null) - { - windowState =3D windowNS.getWindowState(); - } - if (windowNS.getPortletNavigationalState() !=3D null) - { - portletNS =3D windowNS.getPortletNavigationalState(); - } - } - - // - PortletInvocationContext renderContext =3D portletControllerContext.= createPortletInvocationContext(windowId, pageState); - RenderInvocation render =3D new RenderInvocation(renderContext); - render.setClientContext(new AbstractClientContext(portletControllerC= ontext.getClientRequest())); - render.setServerContext(new AbstractServerContext(portletControllerC= ontext.getClientRequest(), portletControllerContext.getClientResponse())); - render.setInstanceContext(new TestInstanceContext(portletControllerC= ontext.getClientRequest(), portlet.getContext(), false)); - render.setUserContext(new AbstractUserContext(portletControllerConte= xt.getClientRequest())); - render.setWindowContext(new AbstractWindowContext(windowId)); - render.setPortalContext(new TestPortalContext()); - render.setSecurityContext(new AbstractSecurityContext(portletControl= lerContext.getClientRequest())); - render.setTarget(portlet.getContext()); - render.setMode(mode); - render.setWindowState(windowState); - render.setNavigationalState(portletNS); - render.setPublicNavigationalState(publicNS); - - // - pageStateModifiable =3D false; - - // - return portletControllerContext.invoke(render); - } - - public boolean isPageStateModifiable() - { - return pageStateModifiable; - } - - public String getPageParameter(QName name) - { - return pageState !=3D null ? pageState.getPublicNavigationalState(na= me)[0] : null; - } - - public void setPageParameter(QName name, String value) - { - if (pageStateModifiable) - { - if (pageState =3D=3D null) - { - pageState =3D portletControllerContext.getStateControllerConte= xt().createPageState(true); - } - pageState.setPublicNavigationalState(name, new String[]{value}); - } - else - { - throw new IllegalStateException("Page state cannot be modified"); - } - } - - public String getMaximizedWindowId() - { - if (pageState !=3D null) - { - for (String windowId : pageState.getWindowIds()) - { - WindowNavigationalState windowNS =3D pageState.getWindowNaviga= tionalState(windowId); - if (WindowState.MAXIMIZED.equals(windowNS.getWindowState())) - { - return windowId; - } - } - } - - // - return null; - } - - public PagePortletControllerContext getPortletControllerContext() - { - return portletControllerContext; - } - - public String nextId() - { - return "" + count++; - } -} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PageParamTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageParamTag.java 2008-02-09 14:44:32 UTC (rev 9900) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageParamTag.java 2008-02-09 16:11:00 UTC (rev 9901) @@ -87,11 +87,8 @@ this.frozen =3D frozen; } = - public void internalDoTag() throws JspException, IOException + public void doRenderTag(PortalRenderResponse renderResponse) throws Jsp= Exception, IOException { - PortalRenderResponse renderResponse =3D getPortalResponse(); - - // if (renderResponse.isPageStateModifiable()) { QName name =3D new QName(namespaceURI, localName); @@ -103,4 +100,8 @@ } } } + + public void doActionTag() throws JspException, IOException + { + } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PageTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageTag.java 2008-02-09 14:44:32 UTC (rev 9900) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageTag.java 2008-02-09 16:11:00 UTC (rev 9901) @@ -23,6 +23,7 @@ package org.jboss.portal.portlet.test.jsp.taglib; = import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; +import org.jboss.portal.portlet.test.jsp.PortalResponse; = import javax.servlet.jsp.JspException; import javax.xml.namespace.QName; @@ -38,7 +39,7 @@ = enum Status { - INACTIVE, ACTIVE, SUSPENDED + ACTIVE, SUSPENDED } = /** . */ @@ -51,49 +52,25 @@ String content; = /** . */ - Status status =3D Status.INACTIVE; + Status status =3D Status.ACTIVE; = - public int doStartTag() throws JspException + public int doStartRenderTag(PortalRenderResponse renderResponse) throws= JspException { - if (status =3D=3D Status.INACTIVE) - { - PortalRenderResponse renderResponse =3D getPortalResponse(); + maximizedId =3D renderResponse.getMaximizedWindowId(); = - // - status =3D Status.ACTIVE; - - // - maximizedId =3D renderResponse.getMaximizedWindowId(); - - // - if (maximizedId !=3D null) - { - return EVAL_BODY_BUFFERED; - } - else - { - return EVAL_BODY_INCLUDE; - } + // + if (maximizedId !=3D null) + { + return EVAL_BODY_BUFFERED; } else { - return SKIP_BODY; + return EVAL_BODY_INCLUDE; } } = - public int doEndTag() throws JspException + public int doEndRenderTag(PortalRenderResponse renderResponse) throws J= spException { - switch (status) - { - case SUSPENDED: - break; - case INACTIVE: - break; - case ACTIVE: - status =3D Status.INACTIVE; - } - - // if (maximizedId !=3D null) { try @@ -109,4 +86,14 @@ // return EVAL_PAGE; } + + public int doStartTag(PortalResponse portalResponse) throws JspException + { + return EVAL_BODY_INCLUDE; + } + + public int doEndTag(PortalResponse portalResponse) throws JspException + { + return EVAL_PAGE; + } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/ParamTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/ParamTag.java 2008-02-09 14:44:32 UTC (rev 9900) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/ParamTag.java 2008-02-09 16:11:00 UTC (rev 9901) @@ -22,6 +22,8 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp.taglib; = +import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; + import javax.servlet.jsp.tagext.SimpleTagSupport; import javax.servlet.jsp.JspException; import java.io.IOException; @@ -59,7 +61,7 @@ this.value =3D value; } = - public void internalDoTag() throws JspException, IOException + public void doRenderTag(PortalRenderResponse renderResponse) throws Jsp= Exception, IOException { AbstractURLTag urlTag =3D (AbstractURLTag)SimpleTagSupport.findAnces= torWithClass(this, AbstractURLTag.class); urlTag.setParam(name, value); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortalBodyTagSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalBodyTagSupport.java 2008-02-09 14:44:32 UTC (rev 9900) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalBodyTagSupport.java 2008-02-09 16:11:00 UTC (rev 9901) @@ -23,6 +23,9 @@ package org.jboss.portal.portlet.test.jsp.taglib; = import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; +import org.jboss.portal.portlet.test.jsp.PortalActionResponse; +import org.jboss.portal.portlet.test.jsp.PortalResponse; +import org.jboss.portal.common.NotYetImplemented; = import javax.servlet.jsp.tagext.BodyTagSupport; import javax.servlet.jsp.JspException; @@ -33,34 +36,74 @@ */ public class PortalBodyTagSupport extends BodyTagSupport { - protected final PortalRenderResponse getPortalResponse() + + private PortalResponse getPortalResponse() { - return (PortalRenderResponse)pageContext.getResponse(); + return (PortalResponse)pageContext.getResponse(); } = - public int doStartTag() throws JspException + public final int doStartTag() throws JspException { + return doStartTag(getPortalResponse()); + } + + public final int doEndTag() throws JspException + { + return doEndTag(getPortalResponse()); + } + + public int doStartTag(PortalResponse portalResponse) throws JspException + { PageTag pageTag =3D (PageTag)findAncestorWithClass(this, PageTag.cla= ss); = // + if (pageTag =3D=3D null && this instanceof PageTag) + { + pageTag =3D (PageTag)this; + + // + pageTag.status =3D PageTag.Status.ACTIVE; + } + + // if (pageTag =3D=3D null || pageTag.status !=3D PageTag.Status.ACTIVE) { return SKIP_BODY; } else { - return internalDoStartTag(); + if (portalResponse instanceof PortalActionResponse) + { + return doStartActionTag((PortalActionResponse)portalResponse); + } + else + { + return doStartRenderTag((PortalRenderResponse)portalResponse); + } } } = - public int doEndTag() throws JspException + public int doEndTag(PortalResponse portalResponse) throws JspException { PageTag pageTag =3D (PageTag)findAncestorWithClass(this, PageTag.cla= ss); = // + if (pageTag =3D=3D null && this instanceof PageTag) + { + pageTag =3D (PageTag)this; + } + + // if (pageTag !=3D null && pageTag.status =3D=3D PageTag.Status.ACTIVE) { - return internalDoEndTag(); + if (portalResponse instanceof PortalActionResponse) + { + return doEndActionTag((PortalActionResponse)portalResponse); + } + else + { + return doEndRenderTag((PortalRenderResponse)portalResponse); + } } else { @@ -68,12 +111,22 @@ } } = - public int internalDoStartTag() throws JspException + public int doStartActionTag(PortalActionResponse actionResponse) throws= JspException { + throw new NotYetImplemented(); + } + + public int doEndActionTag(PortalActionResponse actionResponse) throws J= spException + { + throw new NotYetImplemented(); + } + + public int doStartRenderTag(PortalRenderResponse renderResponse) throws= JspException + { return super.doStartTag(); } = - public int internalDoEndTag() throws JspException + public int doEndRenderTag(PortalRenderResponse renderResponse) throws J= spException { return super.doEndTag(); } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortalSimpleTagSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalSimpleTagSupport.java 2008-02-09 14:44:32 UTC (rev 9900) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalSimpleTagSupport.java 2008-02-09 16:11:00 UTC (rev 9901) @@ -23,6 +23,9 @@ package org.jboss.portal.portlet.test.jsp.taglib; = import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; +import org.jboss.portal.portlet.test.jsp.PortalResponse; +import org.jboss.portal.portlet.test.jsp.PortalActionResponse; +import org.jboss.portal.common.NotYetImplemented; = import javax.servlet.jsp.tagext.SimpleTagSupport; import javax.servlet.jsp.PageContext; @@ -35,25 +38,37 @@ */ public class PortalSimpleTagSupport extends SimpleTagSupport { - protected final PortalRenderResponse getPortalResponse() + private PortalResponse getPortalResponse() { PageContext pageContext =3D (PageContext)getJspContext(); - return (PortalRenderResponse)pageContext.getResponse(); + return (PortalResponse)pageContext.getResponse(); } = - public void doTag() throws JspException, IOException + public final void doTag() throws JspException, IOException { PageTag pageTag =3D (PageTag)findAncestorWithClass(this, PageTag.cla= ss); = // if (pageTag !=3D null && pageTag.status =3D=3D PageTag.Status.ACTIVE) { - internalDoTag(); + if (getPortalResponse() instanceof PortalActionResponse) + { + doActionTag(); + } + else + { + doRenderTag((PortalRenderResponse)getPortalResponse()); + } } } = - public void internalDoTag() throws JspException, IOException + public void doActionTag() throws JspException, IOException { + throw new NotYetImplemented(); + } + + public void doRenderTag(PortalRenderResponse renderResponse) throws Jsp= Exception, IOException + { super.doTag(); } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletMarkupTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletMarkupTag.java 2008-02-09 14:44:32 UTC (rev 9900) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletMarkupTag.java 2008-02-09 16:11:00 UTC (rev 9901) @@ -39,10 +39,8 @@ */ public class PortletMarkupTag extends PortalSimpleTagSupport { - public void internalDoTag() throws JspException, IOException + public void doRenderTag(PortalRenderResponse renderResponse) throws Jsp= Exception, IOException { - PortalRenderResponse resp =3D getPortalResponse(); - PortletTag portletTag =3D (PortletTag)SimpleTagSupport.findAncestorW= ithClass(this, PortletTag.class); = PortletInvocationResponse portletResp =3D portletTag.result.getRespo= nse(); @@ -55,9 +53,9 @@ { FragmentResponse fragment =3D (FragmentResponse)portletResp; WindowNavigationalState windowNS =3D null; - if (resp.getPageState() !=3D null) + if (renderResponse.getPageState() !=3D null) { - windowNS =3D resp.getPageState().getWindowNavigationalState= (portletTag.result.getWindowId()); + windowNS =3D renderResponse.getPageState().getWindowNavigat= ionalState(portletTag.result.getWindowId()); } if (windowNS =3D=3D null || !windowNS.getWindowState().equals(= WindowState.MINIMIZED)) { Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-09 14:44:32 UTC (rev 9900) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-09 16:11:00 UTC (rev 9901) @@ -23,7 +23,8 @@ package org.jboss.portal.portlet.test.jsp.taglib; = import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; -import org.jboss.portal.portlet.test.jsp.PagePortletControllerContext; +import org.jboss.portal.portlet.test.jsp.PortalActionResponse; +import org.jboss.portal.portlet.test.jsp.PortalResponse; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.ErrorResponse; @@ -78,7 +79,8 @@ private Set supportedModes; private Mode initialMode; private PageTag pageTag; - private PortalRenderResponse renderResponse; + private Portlet portlet; + private String windowId; = /** . */ PortletResult result; @@ -143,7 +145,7 @@ this.errorPageAttr =3D errorPage; } = - private void initState() + private void initState(PortalResponse portalResponse) { // Set supportedModes =3D new LinkedHashSet(); @@ -183,11 +185,22 @@ } = // + Portlet portlet =3D portalResponse.findPortlet(applicationNameAttr, = nameAttr); + + // + String windowId =3D null; + if (portlet !=3D null) + { + windowId =3D portlet.getContext().getId() + "." + portalResponse.= nextId(); + } + + // this.initialMode =3D initialMode; this.supportedModes =3D supportedModes; this.supportedWindowStates =3D supportedWindowStates; this.pageTag =3D (PageTag)findAncestorWithClass(this, PageTag.class); - this.renderResponse =3D getPortalResponse(); + this.portlet =3D portlet; + this.windowId =3D windowId; } = private void destroyState() @@ -196,37 +209,51 @@ this.supportedModes =3D null; this.supportedWindowStates =3D null; this.pageTag =3D null; - this.renderResponse =3D null; + this.portlet =3D null; + this.windowId =3D null; } = - public int internalDoStartTag() throws JspException + public int doStartActionTag(PortalActionResponse actionResponse) throws= JspException { - initState(); + initState(actionResponse); = // - PagePortletControllerContext context =3D renderResponse.getPortletCo= ntrollerContext(); + if (portlet !=3D null) + { + actionResponse.addWindow(windowId, portlet); + } = // - Portlet portlet =3D context.findPortlet(applicationNameAttr, nameAtt= r); + return SKIP_BODY; + } = + public int doEndActionTag(PortalActionResponse actionResponse) throws J= spException + { + destroyState(); + // + return EVAL_PAGE; + } + + public int doStartRenderTag(PortalRenderResponse renderResponse) throws= JspException + { + initState(renderResponse); + + // if (portlet =3D=3D null) { - handleError(null, Constants.NOT_FOUND, null, null); + handleError(renderResponse, Constants.NOT_FOUND, null, null); = // We cannot show an absent portlet, no meta data return SKIP_BODY; } else { - String windowId =3D portlet.getContext().getId() + "." + renderRe= sponse.nextId(); - - // if (pageTag.maximizedId !=3D null) { if (windowId.equals(pageTag.maximizedId)) { - return render(portlet, windowId, EVAL_BODY_BUFFERED); + return render(renderResponse, EVAL_BODY_BUFFERED); } else { @@ -235,12 +262,12 @@ } else { - return render(portlet, windowId, EVAL_BODY_INCLUDE); + return render(renderResponse, EVAL_BODY_INCLUDE); } } } = - public int internalDoEndTag() throws JspException + public int doEndRenderTag(PortalRenderResponse renderResponse) throws J= spException { if (bodyContent !=3D null) { @@ -254,7 +281,7 @@ return EVAL_PAGE; } = - public int render(Portlet portlet, String windowId, int rt) + public int render(PortalRenderResponse renderResponse, int rt) { try { @@ -280,21 +307,21 @@ ErrorResponse error =3D (ErrorResponse)portletResponse; = // - handleError(windowId, Constants.PORTLET_ERROR, error.getCause(= ), error.getMessage()); + handleError(renderResponse, Constants.PORTLET_ERROR, error.get= Cause(), error.getMessage()); = // return SKIP_BODY; } else if (portletResponse instanceof UnavailableResponse) { - handleError(windowId, Constants.UNAVAILABLE, null, null); + handleError(renderResponse, Constants.UNAVAILABLE, null, null); = // return SKIP_BODY; } else { - handleError(windowId, Constants.INTERNAL_ERROR, null, null); + handleError(renderResponse, Constants.INTERNAL_ERROR, null, nu= ll); = // return SKIP_BODY; @@ -302,14 +329,14 @@ } catch (PortletInvokerException e) { - handleError(windowId, Constants.INTERNAL_ERROR, e, e.getMessage()= ); + handleError(renderResponse, Constants.INTERNAL_ERROR, e, e.getMes= sage()); = // return SKIP_BODY; } } = - private void handleError(String windowId, String errorStatus, Throwable= cause, String message) + private void handleError(PortalRenderResponse renderResponse, String er= rorStatus, Throwable cause, String message) { if (errorPageAttr !=3D null) { Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTitleTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTitleTag.java 2008-02-09 14:44:32 UTC (rev 9900) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTitleTag.java 2008-02-09 16:11:00 UTC (rev 9901) @@ -24,6 +24,7 @@ = import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; +import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; = import javax.servlet.jsp.JspException; import javax.servlet.jsp.JspWriter; @@ -37,7 +38,7 @@ public class PortletTitleTag extends PortalSimpleTagSupport { = - public void internalDoTag() throws JspException, IOException + public void doRenderTag(PortalRenderResponse renderResponse) throws Jsp= Exception, IOException { = PortletTag portletTag =3D (PortletTag)SimpleTagSupport.findAncestorW= ithClass(this, PortletTag.class); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-09 14:44:32 UTC (rev 9900) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-09 16:11:00 UTC (rev 9901) @@ -70,14 +70,13 @@ this.windowStateValue =3D windowState; } = - public int internalDoStartTag() throws JspException + public int doStartRenderTag(PortalRenderResponse renderResponse) throws= JspException { return EVAL_BODY_BUFFERED; } = - public int internalDoEndTag() throws JspException + public int doEndRenderTag(PortalRenderResponse renderResponse) throws J= spException { - PortalRenderResponse renderResponse =3D getPortalResponse(); PagePortletControllerContext context =3D renderResponse.getPortletCo= ntrollerContext(); PortletTag portletTag =3D (PortletTag)SimpleTagSupport.findAncestorW= ithClass(this, PortletTag.class); = --===============6295787258521636631==-- From portal-commits at lists.jboss.org Sat Feb 9 11:18:37 2008 Content-Type: multipart/mixed; boundary="===============0606336371721316154==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9903 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp: taglib and 1 other directory. Date: Sat, 09 Feb 2008 11:18:37 -0500 Message-ID: --===============0606336371721316154== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-09 11:18:37 -0500 (Sat, 09 Feb 2008) New Revision: 9903 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PagePortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTag.java Log: no need to use the window id that contains the portlet context id marshalle= d in since we always have a map of window id -> Portlet Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-09 16:11:20 UTC (rev 9902) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-09 16:18:37 UTC (rev 9903) @@ -85,32 +85,18 @@ { PortletInvoker invoker =3D (PortletInvoker)getServletContext().getAt= tribute("ConsumerPortletInvoker"); = - + // PortalActionResponse actionResponse =3D new PortalActionResponse(res= p, invoker); = + // Discover existing portlets on the page chain.doFilter(req, actionResponse); = - // - PagePortletControllerContext context; - try - { - context =3D new PagePortletControllerContext( - req, - resp, - getServletContext(), - actionResponse); - } - catch (PortletInvokerException e) - { - throw new ServletException(e); - } + // Now we can create a populated context + PagePortletControllerContext context =3D new PagePortletControllerCo= ntext(req, resp, getServletContext(), actionResponse); = PageNavigationalState pageState =3D null; if (context.getRequest() !=3D null) { - - - ControllerResponse controllerResponse; try { Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PagePortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-09 16:11:20 UTC (rev 9902) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-09 16:18:37 UTC (rev 9903) @@ -23,7 +23,6 @@ package org.jboss.portal.portlet.test.jsp; = import org.jboss.portal.portlet.Portlet; -import org.jboss.portal.portlet.PortletContext; import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.controller.event.EventControllerContext; import org.jboss.portal.portlet.invocation.PortletInvocation; @@ -48,7 +47,7 @@ private final EventControllerContext eventControllerContext; = /** . */ - private final PortalResponse actionResponse; + private final PortalActionResponse actionResponse; = public PagePortletControllerContext( HttpServletRequest req, @@ -66,20 +65,7 @@ = protected Portlet getPortlet(String windowId) throws PortletInvokerExce= ption { - int index =3D windowId.lastIndexOf('.'); - String portletId =3D windowId.substring(0, index); - - // in the case of an event propagation, the given 'windowId' is actu= ally the portlet id already so need to check - // for that case (portletId should still have a '.', if not it means= that the windowId was really a portlet id) -// if (portletId.indexOf('.') =3D=3D -1) -// { -// portletId =3D windowId; -// } - - PortletContext portletContext =3D PortletContext.createPortletContex= t(portletId); - - // - return actionResponse.getInvoker().getPortlet(portletContext); + return actionResponse.getPortlet(windowId); } = public PortletInvocationResponse invoke(PortletInvocation invocation) t= hrows PortletInvokerException Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-09 16:11:20 UTC (rev 9902) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-09 16:18:37 UTC (rev 9903) @@ -188,11 +188,7 @@ Portlet portlet =3D portalResponse.findPortlet(applicationNameAttr, = nameAttr); = // - String windowId =3D null; - if (portlet !=3D null) - { - windowId =3D portlet.getContext().getId() + "." + portalResponse.= nextId(); - } + String windowId =3D portalResponse.nextId(); = // this.initialMode =3D initialMode; --===============0606336371721316154==-- From portal-commits at lists.jboss.org Sat Feb 9 11:22:50 2008 Content-Type: multipart/mixed; boundary="===============7351108453469408379==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9904 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp. Date: Sat, 09 Feb 2008 11:22:50 -0500 Message-ID: --===============7351108453469408379== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-09 11:22:50 -0500 (Sat, 09 Feb 2008) New Revision: 9904 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PageEventControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalResponse.java Log: some basic javadoc Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-09 16:18:37 UTC (rev 9903) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-09 16:22:50 UTC (rev 9904) @@ -88,12 +88,13 @@ // PortalActionResponse actionResponse =3D new PortalActionResponse(res= p, invoker); = - // Discover existing portlets on the page + // Discover existing portlets on the page (introspection phase) chain.doFilter(req, actionResponse); = // Now we can create a populated context PagePortletControllerContext context =3D new PagePortletControllerCo= ntext(req, resp, getServletContext(), actionResponse); = + // PageNavigationalState pageState =3D null; if (context.getRequest() !=3D null) { @@ -217,79 +218,4 @@ { this.config =3D null; } - - protected void render(HttpServletRequest req, PortalRenderResponse resp= ) throws ServletException, IOException, ClassNotFoundException - { - - // -// PagePortletControllerContext context =3D resp.getPortletController= Context(); - - // - - // Look if we need to handle maxmized rendering -/* - for (Window window : page.getWindows()) - { - WindowNavigationalState windowState =3D pageState.getWindowNaviga= tionalState(window.getId()); - if (windowState !=3D null && WindowState.MAXIMIZED.equals(windowS= tate.getWindowState())) - { - List chunks =3D new LinkedList(); - int mode =3D 0; - int count =3D 0; - Map windows =3D Collections.emptyMa= p(); - for (Iterator i =3D page.getChunks().iterator();i.hasNe= xt();) - { - Chunk chunk =3D i.next(); - - switch (mode) - { - case 0: - if (chunk instanceof StartPageChunk) - { - mode =3D 1; - chunks.add(chunk); - } - break; - case 1: - if (chunk instanceof StartPortletChunk) - { - StartPortletChunk startPortletChunk =3D (StartPort= letChunk)chunk; - String windowId =3D "" + count; - if (window.getId().equals(windowId)) - { - mode =3D 2; - chunks.add(startPortletChunk); - windows =3D Collections.singletonMap(startPortl= etChunk, window); - } - } - else if (chunk instanceof EndPageChunk) - { - mode =3D 0; - chunks.add(chunk); - } - break; - case 2: - if (chunk instanceof EndPortletChunk) - { - mode =3D 1; - } - - // - chunks.add(chunk); - break; - } - - // - if (chunk instanceof EndPortletChunk) - { - count++; - } - } - - // New page - page =3D new Page(chunks, windows); - } - } -*/ - } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PageEventControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PageEventControllerContext.java 2008-02-09 16:18:37 UTC (rev 9903) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PageEventControllerContext.java 2008-02-09 16:22:50 UTC (rev 9904) @@ -31,6 +31,9 @@ import java.util.ArrayList; = /** + * Route events according to the portlets discovered on the page. For now = it is pretty trivial. + * We could leverage JSP tags to 'wire' portlets on the same page for inst= ance. + * * @author Julien Viet * @version $Revision: 630 $ */ Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PortalResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalResponse.java 2008-02-09 16:18:37 UTC (rev 9903) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalResponse.java 2008-02-09 16:22:50 UTC (rev 9904) @@ -33,6 +33,8 @@ import java.util.HashMap; = /** + * Expose stuff common to action and render response. + * * @author Julien Viet * @version $Revision: 630 $ */ @@ -80,6 +82,10 @@ return portlets.get(new Key(applicationName, portletName)); } = + /** + * todo : add on JSP portlet tag a notion of 'id', because this id gene= ration relies on the portlet + * rendering order on the page which could not be the same between 2 re= quests. + */ public String nextId() { return "" + count++; --===============7351108453469408379==-- From portal-commits at lists.jboss.org Sat Feb 9 11:39:08 2008 Content-Type: multipart/mixed; boundary="===============5568442042429425730==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9905 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib. Date: Sat, 09 Feb 2008 11:39:07 -0500 Message-ID: --===============5568442042429425730== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-09 11:39:07 -0500 (Sat, 09 Feb 2008) New Revision: 9905 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PageParamTag.java Log: fix issue with shared render param update overwritten by JSP page param Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PageParamTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageParamTag.java 2008-02-09 16:22:50 UTC (rev 9904) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageParamTag.java 2008-02-09 16:39:07 UTC (rev 9905) @@ -94,8 +94,12 @@ QName name =3D new QName(namespaceURI, localName); = // - if (!"true".equals(frozen) || renderResponse.getPageParameter(nam= e) =3D=3D null) + if ("true".equals(frozen)) { + // + } + else if (renderResponse.getPageParameter(name) =3D=3D null) + { renderResponse.setPageParameter(name, value); } } --===============5568442042429425730==-- From portal-commits at lists.jboss.org Sat Feb 9 11:58:20 2008 Content-Type: multipart/mixed; boundary="===============6601856647574129984==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9906 - in modules/portlet/trunk/test/src: test/resources/portal/samples/basic-war/WEB-INF and 2 other directories. Date: Sat, 09 Feb 2008 11:58:20 -0500 Message-ID: --===============6601856647574129984== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-09 11:58:19 -0500 (Sat, 09 Feb 2008) New Revision: 9906 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/basic/ExceptionPortlet.java Modified: modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/W= EB-INF/portlet.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= jsp/error.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o2.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o3.jsp Log: minor updates Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/p= ortal/samples/basic/ExceptionPortlet.java (from rev 9905, modules/portlet/t= runk/test/src/main/java/org/jboss/portal/portlet/portal/samples/basic/Error= Portlet.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/ExceptionPortlet.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/ExceptionPortlet.java 2008-02-09 16:58:19 UTC (rev 9906) @@ -0,0 +1,113 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.samples.basic; + +import javax.portlet.GenericPortlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.PortletURL; +import javax.portlet.PortletRequest; +import javax.portlet.ActionRequest; +import javax.portlet.PortletSecurityException; +import javax.portlet.ActionResponse; +import java.io.IOException; +import java.io.PrintWriter; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ExceptionPortlet extends GenericPortlet +{ + + public void processAction(ActionRequest req, ActionResponse resp) throw= s PortletException, PortletSecurityException, IOException + { + throwException(req); + } + + protected void doView(RenderRequest req, RenderResponse resp) throws Po= rtletException, PortletSecurityException, IOException + { + throwException(req); + + // + resp.setContentType("text/html"); + PrintWriter writer =3D resp.getWriter(); + PortletURL renderURL =3D resp.createRenderURL(); + PortletURL actionURL =3D resp.createActionURL(); + + // + writer.write("

    "); + writer.write("

    Throw :
    "= ); + writer.write("
    "); + renderURL.setParameter("op", "portletexception"); + writer.write(""); + renderURL.setParameter("op", "portletsecurityexception"); + writer.write(""); + renderURL.setParameter("op", "ioexception"); + writer.write(""); + renderURL.setParameter("op", "runtimeexception"); + writer.write(""); + actionURL.setParameter("op", "error"); + writer.write("
    render Error<= /div>"); + actionURL.setParameter("op", "portletexception"); + writer.write(""); + actionURL.setParameter("op", "portletsecurityexception"); + writer.write(""); + actionURL.setParameter("op", "ioexception"); + writer.write(""); + actionURL.setParameter("op", "runtimeexception"); + writer.write(""); + actionURL.setParameter("op", "error"); + writer.write("
    action Error<= /div>"); + writer.write("
    "); + writer.write("

    "); + } + + private void throwException(PortletRequest req) throws PortletException= , IOException + { + String op =3D req.getParameter("op"); + + // Throw any required exception + if ("portletexception".equals(op)) + { + throw new PortletException(); + } + if ("portletsecurityexception".equals(op)) + { + throw new PortletSecurityException(""); + } + if ("ioexception".equals(op)) + { + throw new IOException(); + } + if ("runtimeexception".equals(op)) + { + throw new RuntimeException(); + } + if ("error".equals(op)) + { + throw new Error(); + } + } +} Modified: modules/portlet/trunk/test/src/test/resources/portal/samples/basi= c-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/= WEB-INF/portlet.xml 2008-02-09 16:39:07 UTC (rev 9905) +++ modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/= WEB-INF/portlet.xml 2008-02-09 16:58:19 UTC (rev 9906) @@ -28,8 +28,8 @@ version=3D"1.0"> = - ErrorPortlet - org.jboss.portal.portlet.portal.samples.basic.ErrorPo= rtlet + ExceptionPortlet + org.jboss.portal.portlet.portal.samples.basic.Excepti= onPortlet text/html Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/jsp/error.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jsp/error.jsp 2008-02-09 16:39:07 UTC (rev 9905) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jsp/error.jsp 2008-02-09 16:58:19 UTC (rev 9906) @@ -15,7 +15,7 @@ Portlet name: <%=3D request.getAttribute("org.jboss.portal.po= rtlet.portal.error.portlet_name")%>
    Portlet application name: <%=3D request.getAttribute("org.jboss.portal.portlet.po= rtal.error.application_name")%>
    - Exception: <%=3D request.getAttribute("org.jboss.portal.portl= et.portal.error.exception")%>
    + Exception: <%=3D request.getAttribute("org.jboss.portal.portl= et.portal.error.cause")%>
    Window id: <%=3D request.getAttribute("org.jboss.portal.portl= et.portal.error.window_id")%>
    Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/demo.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo.jsp 2008-02-09 16:39:07 UTC (rev 9905) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo.jsp 2008-02-09 16:58:19 UTC (rev 9906) @@ -12,7 +12,7 @@ - + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/demo2.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo2.jsp 2008-02-09 16:39:07 UTC (rev 9905) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo2.jsp 2008-02-09 16:58:19 UTC (rev 9906) @@ -15,6 +15,7 @@ = + = Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/demo3.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo3.jsp 2008-02-09 16:39:07 UTC (rev 9905) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo3.jsp 2008-02-09 16:58:19 UTC (rev 9906) @@ -16,7 +16,7 @@ = - + --===============6601856647574129984==-- From portal-commits at lists.jboss.org Sat Feb 9 12:00:33 2008 Content-Type: multipart/mixed; boundary="===============4195852224132351367==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9907 - modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/WEB-INF. Date: Sat, 09 Feb 2008 12:00:33 -0500 Message-ID: --===============4195852224132351367== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-09 12:00:33 -0500 (Sat, 09 Feb 2008) New Revision: 9907 Modified: modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/W= EB-INF/portlet.xml Log: set title on exception portlet Modified: modules/portlet/trunk/test/src/test/resources/portal/samples/basi= c-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/= WEB-INF/portlet.xml 2008-02-09 16:58:19 UTC (rev 9906) +++ modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/= WEB-INF/portlet.xml 2008-02-09 17:00:33 UTC (rev 9907) @@ -34,7 +34,7 @@ text/html - + ExceptionPortlet
    = --===============4195852224132351367==-- From portal-commits at lists.jboss.org Sat Feb 9 12:12:18 2008 Content-Type: multipart/mixed; boundary="===============2039740122160154965==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9908 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet: test/jsp and 1 other directory. Date: Sat, 09 Feb 2008 12:12:18 -0500 Message-ID: --===============2039740122160154965== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-09 12:12:18 -0500 (Sat, 09 Feb 2008) New Revision: 9908 Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/basic/ErrorPortlet.java Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java Log: handle error in actions Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= portal/samples/basic/ErrorPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/ErrorPortlet.java 2008-02-09 17:00:33 UTC (rev 9907) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/ErrorPortlet.java 2008-02-09 17:12:18 UTC (rev 9908) @@ -1,41 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.portal.samples.basic; - -import javax.portlet.GenericPortlet; -import javax.portlet.RenderRequest; -import javax.portlet.RenderResponse; -import javax.portlet.PortletException; -import java.io.IOException; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class ErrorPortlet extends GenericPortlet -{ - protected void doView(RenderRequest renderRequest, RenderResponse rende= rResponse) throws PortletException, IOException - { - throw new PortletException("Some exception"); - } -} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-09 17:00:33 UTC (rev 9907) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-09 17:12:18 UTC (rev 9908) @@ -27,12 +27,14 @@ import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; +import org.jboss.portal.portlet.invocation.response.ErrorResponse; import org.jboss.portal.portlet.controller.PortletController; import org.jboss.portal.portlet.controller.request.PortletActionRequest; import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; import org.jboss.portal.portlet.controller.response.ControllerResponse; import org.jboss.portal.portlet.controller.response.PageUpdateResponse; import org.jboss.portal.portlet.controller.response.ResourceResponse; +import org.jboss.portal.portlet.controller.response.PortletResponse; import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.common.io.IOTools; = @@ -197,6 +199,31 @@ // return; } + else if (controllerResponse instanceof PortletResponse) + { + PortletResponse portletResponse =3D (PortletResponse)controlle= rResponse; + PortletInvocationResponse pir =3D portletResponse.response; + + // + if (pir instanceof ErrorResponse) + { + ErrorResponse errorResponse =3D (ErrorResponse)pir; + + // + if (errorResponse.getCause() !=3D null) + { + throw new ServletException(errorResponse.getMessage(), e= rrorResponse.getCause()); + } + else + { + throw new ServletException(errorResponse.getMessage()); + } + } + else + { + // todo + } + } else { // todo --===============2039740122160154965==-- From portal-commits at lists.jboss.org Sat Feb 9 12:34:08 2008 Content-Type: multipart/mixed; boundary="===============2251092466930164456==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9909 - in modules/portlet/trunk: test/src/test/resources/google-map-portlet-war/WEB-INF and 1 other directories. Date: Sat, 09 Feb 2008 12:34:08 -0500 Message-ID: --===============2251092466930164456== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-09 12:34:08 -0500 (Sat, 09 Feb 2008) New Revision: 9909 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/asp= ects/portlet/ConsumerCacheInterceptor.java modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WEB= -INF/portlet.xml modules/portlet/trunk/test/src/test/resources/google-weather-portlet-war= /WEB-INF/portlet.xml Log: - use caching in google portlets - implements public nav state caching in consumer cache interceptor Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/aspects/portlet/ConsumerCacheInterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/as= pects/portlet/ConsumerCacheInterceptor.java 2008-02-09 17:12:18 UTC (rev 99= 08) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/as= pects/portlet/ConsumerCacheInterceptor.java 2008-02-09 17:34:08 UTC (rev 99= 09) @@ -35,6 +35,7 @@ import org.jboss.portal.portlet.cache.CacheControl; import org.jboss.portal.common.invocation.InvocationException; import org.jboss.portal.common.invocation.AttributeResolver; +import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.WindowState; import org.jboss.portal.Mode; = @@ -64,7 +65,8 @@ RenderInvocation renderInvocation =3D (RenderInvocation)invocatio= n; = // - StateString navState =3D renderInvocation.getNavigationalState(); + StateString navigationalState =3D renderInvocation.getNavigationa= lState(); + ParameterMap publicNavigationalState =3D renderInvocation.getPubl= icNavigationalState(); WindowState windowState =3D renderInvocation.getWindowState(); Mode mode =3D renderInvocation.getMode(); = @@ -76,33 +78,58 @@ { // Check time validity for fragment boolean useEntry =3D false; - StateString entryNavState =3D cachedEntry.navigationalState; + StateString entryNavigationalState =3D cachedEntry.navigationa= lState; + ParameterMap entryPublicNavigationalState =3D cachedEntry.publ= icNavigationalState; = // Then check nav state equality - if (navState =3D=3D null) + if (navigationalState =3D=3D null) { - if (entryNavState =3D=3D null) + if (entryNavigationalState =3D=3D null) { useEntry =3D true; } - else if (entryNavState instanceof ParametersStateString) + else if (entryNavigationalState instanceof ParametersStateS= tring) { // We consider a parameters state string empty equivalen= t to a null value - useEntry =3D ((ParametersStateString)entryNavState).getS= ize() =3D=3D 0; + useEntry =3D ((ParametersStateString)entryNavigationalSt= ate).getSize() =3D=3D 0; } } - else if (entryNavState =3D=3D null) + else if (entryNavigationalState =3D=3D null) { - if (navState instanceof ParametersStateString) + if (navigationalState instanceof ParametersStateString) { - useEntry =3D ((ParametersStateString)navState).getSize()= =3D=3D 0; + useEntry =3D ((ParametersStateString)navigationalState).= getSize() =3D=3D 0; } } else { - useEntry =3D navState.equals(entryNavState); + useEntry =3D navigationalState.equals(entryNavigationalStat= e); } = + // Check public nav state equality + if (useEntry) + { + if (publicNavigationalState =3D=3D null) + { + if (entryPublicNavigationalState =3D=3D null) + { + // + } + else + { + useEntry =3D entryPublicNavigationalState.size() =3D= =3D 0; + } + } + else if (entryPublicNavigationalState =3D=3D null) + { + useEntry =3D publicNavigationalState.size() =3D=3D 0; + } + else + { + useEntry =3D publicNavigationalState.equals(entryPublicN= avigationalState); + } + } + // Then check window state equality useEntry &=3D windowState.equals(cachedEntry.windowState); = @@ -173,7 +200,8 @@ if (expirationTimeMillis > 0) { CacheEntry cacheEntry =3D new CacheEntry( - navState, + navigationalState, + publicNavigationalState, windowState, mode, fragment, @@ -216,6 +244,9 @@ /** . */ private final Mode mode; = + /** . */ + private final ParameterMap publicNavigationalState; + /** The timed content. */ private final ContentRef contentRef; = @@ -227,6 +258,7 @@ = public CacheEntry( StateString navigationalState, + ParameterMap publicNavigationalState, WindowState windowState, Mode mode, FragmentResponse content, @@ -240,6 +272,7 @@ this.navigationalState =3D navigationalState; this.windowState =3D windowState; this.mode =3D mode; + this.publicNavigationalState =3D publicNavigationalState; this.contentRef =3D new StrongContentRef(content); this.expirationTimeMillis =3D expirationTimeMillis; this.validationToken =3D validationToken; Modified: modules/portlet/trunk/test/src/test/resources/google-map-portlet-= war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WE= B-INF/portlet.xml 2008-02-09 17:12:18 UTC (rev 9908) +++ modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WE= B-INF/portlet.xml 2008-02-09 17:34:08 UTC (rev 9909) @@ -30,6 +30,7 @@ GoogleMap Google Map Portlet org.jboss.portal.simple.samples.GoogleClippingPortlet= + 120 text/html VIEW Modified: modules/portlet/trunk/test/src/test/resources/google-weather-port= let-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/google-weather-portlet-wa= r/WEB-INF/portlet.xml 2008-02-09 17:12:18 UTC (rev 9908) +++ modules/portlet/trunk/test/src/test/resources/google-weather-portlet-wa= r/WEB-INF/portlet.xml 2008-02-09 17:34:08 UTC (rev 9909) @@ -30,6 +30,7 @@ GoogleWeather Google Weather Portlet org.jboss.portal.simple.samples.GoogleWeatherClipping= Portlet + 120 text/html VIEW --===============2251092466930164456==-- From portal-commits at lists.jboss.org Sat Feb 9 15:41:38 2008 Content-Type: multipart/mixed; boundary="===============3433396793628768603==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9910 - modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api. Date: Sat, 09 Feb 2008 15:41:37 -0500 Message-ID: --===============3433396793628768603== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-09 15:41:37 -0500 (Sat, 09 Feb 2008) New Revision: 9910 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/StateAwareResponseImpl.java Log: - Removed output to sysout. Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/StateAwareResponseImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/StateAwareResponseImpl.java 2008-02-09 17:34:08 UTC (rev 9909) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/StateAwareResponseImpl.java 2008-02-09 20:41:37 UTC (rev 9910) @@ -45,7 +45,6 @@ import javax.xml.bind.annotation.XmlRootElement; import javax.xml.namespace.QName; import java.io.Serializable; -import java.lang.annotation.Annotation; import java.math.BigDecimal; import java.math.BigInteger; import java.net.URI; @@ -283,10 +282,6 @@ // Check jaxb annotation if (requiresJAXBAnnotation(valueType)) { - for (Annotation a : valueType.getAnnotations()) - { - System.out.println("a =3D " + a); - } boolean b =3D valueType.isAnnotationPresent(XmlRootElement.cla= ss); if (!b) { --===============3433396793628768603==-- From portal-commits at lists.jboss.org Sat Feb 9 15:42:01 2008 Content-Type: multipart/mixed; boundary="===============7389164892190813142==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9911 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event. Date: Sat, 09 Feb 2008 15:42:01 -0500 Message-ID: --===============7389164892190813142== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-09 15:42:01 -0500 (Sat, 09 Feb 2008) New Revision: 9911 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples= /event/CartPortlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples= /event/CatalogPortlet.java Log: - Minor cosmetic changes. Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/= samples/event/CartPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/event/CartPortlet.java 2008-02-09 20:41:37 UTC (rev 9910) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/event/CartPortlet.java 2008-02-09 20:42:01 UTC (rev 9911) @@ -52,7 +52,7 @@ = if (!items.isEmpty()) { - writer.append(""); + writer.append("
    DescriptionPrice
    Description<= tbody>"); int total =3D 0; for (CatalogItem item : items) { @@ -61,7 +61,8 @@ writer.append(""); } - writer.append("
    Price
    ").append(item.getDescription()).append= ("$").append("" + price) .append("
    ").append("$= " + total).append("
    "); + writer.append("Total:") + .append("$" + total).append(""); } else { Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/= samples/event/CatalogPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/event/CatalogPortlet.java 2008-02-09 20:41:37 UTC (rev 9910) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/event/CatalogPortlet.java 2008-02-09 20:42:01 UTC (rev 9911) @@ -46,7 +46,7 @@ renderResponse.setContentType("text/html"); Writer writer =3D renderResponse.getWriter(); = - writer.append("<= th>Actions"); + writer.append("
    DescriptionPrice
    "); = PortletURL addURL =3D renderResponse.createActionURL(); addURL.setParameter("op", "add"); --===============7389164892190813142==-- From portal-commits at lists.jboss.org Sat Feb 9 20:17:57 2008 Content-Type: multipart/mixed; boundary="===============5249803438541760500==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9912 - in modules/portlet/trunk/test/src: main/java/org/jboss/portal/portlet/portal/samples/event and 13 other directories. Date: Sat, 09 Feb 2008 20:17:56 -0500 Message-ID: --===============5249803438541760500== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-09 20:17:56 -0500 (Sat, 09 Feb 2008) New Revision: 9912 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/GoogleClippingPortlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/GoogleWeatherClippingPortlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/RemoteControlResourcePortlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/event/ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/event/CartEvent.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/event/CartPortlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/event/Catalog.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/event/CatalogItem.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/event/CatalogPortlet.java modules/portlet/trunk/test/src/test/resources/portal/samples/cart-event-= portlet-war/ modules/portlet/trunk/test/src/test/resources/portal/samples/cart-event-= portlet-war/WEB-INF/ modules/portlet/trunk/test/src/test/resources/portal/samples/google-map-= portlet-war/ modules/portlet/trunk/test/src/test/resources/portal/samples/google-map-= portlet-war/WEB-INF/ modules/portlet/trunk/test/src/test/resources/portal/samples/google-weat= her-portlet-war/ modules/portlet/trunk/test/src/test/resources/portal/samples/google-weat= her-portlet-war/WEB-INF/ modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontr= ol-portlet-war/ modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontr= ol-portlet-war/WEB-INF/ Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/event/CartEvent.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/event/CartPortlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/event/Catalog.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/event/CatalogItem.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/event/CatalogPortlet.java 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= /GoogleWeatherClippingPortlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples= /RemoteControlResourcePortlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples= /event/ modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/ modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/ modules/portlet/trunk/test/src/test/resources/google-weather-portlet-war/ modules/portlet/trunk/test/src/test/resources/portal/samples/cart-event-= portlet-war/WEB-INF/ modules/portlet/trunk/test/src/test/resources/portal/samples/google-map-= portlet-war/WEB-INF/ modules/portlet/trunk/test/src/test/resources/portal/samples/google-weat= her-portlet-war/WEB-INF/ modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontr= ol-portlet-war/WEB-INF/ modules/portlet/trunk/test/src/test/resources/remotecontrol-portlet-war/ Modified: modules/portlet/trunk/test/src/test/build.xml modules/portlet/trunk/test/src/test/resources/portal/samples/cart-event-= portlet-war/WEB-INF/portlet.xml modules/portlet/trunk/test/src/test/resources/portal/samples/google-map-= portlet-war/WEB-INF/portlet.xml modules/portlet/trunk/test/src/test/resources/portal/samples/google-weat= her-portlet-war/WEB-INF/portlet.xml modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontr= ol-portlet-war/WEB-INF/portlet.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o1.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o2.jsp Log: - moved stuff for more consistency but had to merge with changes so it may = be f. up, will clean up just after Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/p= ortal/samples/GoogleClippingPortlet.java (from rev 9905, modules/portlet/tr= unk/test/src/main/java/org/jboss/portal/simple/samples/GoogleClippingPortle= t.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/GoogleClippingPortlet.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/GoogleClippingPortlet.java 2008-02-10 01:17:56 UTC (rev 9912) @@ -0,0 +1,178 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.portal.samples; + +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.GenericPortlet; +import javax.portlet.PortletException; +import javax.portlet.PortletMode; +import javax.portlet.PortletPreferences; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import java.io.BufferedInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintWriter; +import java.net.URL; +import java.net.URLConnection; + +/** + * A simple portlet using Google's search services to extract interesting = information (weather, map, ...) from first + * result. + * + * @author Chris Laprun + * @version $Revision$ + */ +public class GoogleClippingPortlet extends GenericPortlet +{ + protected static final String A =3D ""; + String end =3D "
    DescriptionPriceActions
    "; + int begIndex =3D html.indexOf(beg); + if (begIndex !=3D -1) + { + // extract table containing specific first result + int endIndex =3D html.indexOf(end, begIndex); + html =3D html.substring(begIndex + beg.length(), endIndex + end.l= ength()); + + html =3D postProcessHTML(html); + + renderResponse.setContentType("text/html"); + PrintWriter printWriter =3D renderResponse.getWriter(); + printWriter.print(html); + } + } + + protected String getZipCode(RenderRequest renderRequest) + { + String zip =3D renderRequest.getParameter(ZIP); + if (zip =3D=3D null) + { + zip =3D renderRequest.getPreferences().getValue(ZIP, SAN_FRAN); + } + return zip; + } + + @Override + protected void doEdit(RenderRequest renderRequest, RenderResponse rende= rResponse) throws PortletException, IOException + { + renderResponse.setContentType("text/html"); + renderResponse.getWriter().print( + "
    \n" + + "
    \n" + + " Change Location:\n" + + "\n" + + "
    Zip Code:
    \n" + + " \n" + + "
    \n" + + " \n" + + "
    \n" + + "
    "); + } + + @Override + public void processAction(ActionRequest actionRequest, ActionResponse a= ctionResponse) throws PortletException, IOException + { + String zip =3D actionRequest.getParameter(ZIP); + + if (null !=3D zip) + { + PortletPreferences prefs =3D actionRequest.getPreferences(); + prefs.setValue(ZIP, zip); + prefs.store(); + } + + // set zip as render parameter + actionResponse.setRenderParameter(ZIP, zip); + + // request view + actionResponse.setPortletMode(PortletMode.VIEW); + } + + protected String postProcessHTML(String html) + { + // links should open in new windows + html =3D html.replaceAll(A, A_TARGET_BLANK); + + // src attributes should be absolute + html =3D html.replaceAll("src=3D/", "src=3Dhttp://google.com/"); + html =3D html.replaceAll("src=3D\"/", "src=3D\"http://google.com/"); + + // forms should open in new windows and have an absolute action URL + html =3D html.replaceAll("action=3D\"/", "target=3D'_blank' action= =3D\"http://google.com/"); + + return html; + } + + protected String getQueryString(String zip) + { + return GOOGLE + zip; + } + + private byte[] getBytes(InputStream in, int bufferSize) throws IOExcept= ion, IllegalArgumentException + { + ByteArrayOutputStream out =3D new ByteArrayOutputStream(); + + byte[] buffer =3D new byte[bufferSize]; + while (true) + { + int i =3D in.read(buffer); + if (i =3D=3D 0) + { + continue; + } + if (i =3D=3D -1) + { + break; + } + out.write(buffer, 0, i); + } + return out.toByteArray(); + } + +} Property changes on: modules/portlet/trunk/test/src/main/java/org/jboss/por= tal/portlet/portal/samples/GoogleClippingPortlet.java ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/p= ortal/samples/GoogleWeatherClippingPortlet.java (from rev 9905, modules/por= tlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/GoogleWeather= ClippingPortlet.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/GoogleWeatherClippingPortlet.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/GoogleWeatherClippingPortlet.java 2008-02-10 01:17:56 UTC (rev 99= 12) @@ -0,0 +1,55 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.portal.samples; + +/** + * @author Chris Laprun + * @version $Revision$ + */ +public class GoogleWeatherClippingPortlet extends GoogleClippingPortlet +{ + private final static String WEATHER_URL =3D "http://www.google.com/sear= ch?q=3Dweather+"; + private static final String A_END =3D ""; + + protected String getQueryString(String zip) + { + return WEATHER_URL + zip; + } + + protected String postProcessHTML(String html) + { + int begIndex; + int endIndex; + + // remove add to iGoogle link + begIndex =3D html.indexOf(A); + if (begIndex !=3D -1) + { + endIndex =3D html.indexOf(A_END, begIndex); + html =3D html.substring(0, begIndex) + html.substring(endIndex + = A_END.length()); + } + + return super.postProcessHTML(html); + } +} Property changes on: modules/portlet/trunk/test/src/main/java/org/jboss/por= tal/portlet/portal/samples/GoogleWeatherClippingPortlet.java ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/p= ortal/samples/RemoteControlResourcePortlet.java (from rev 9905, modules/por= tlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/RemoteControl= ResourcePortlet.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/RemoteControlResourcePortlet.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/RemoteControlResourcePortlet.java 2008-02-10 01:17:56 UTC (rev 99= 12) @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2008, Your Corporation. All Rights Reserved. + */ + +package org.jboss.portal.portlet.portal.samples; + +import javax.portlet.GenericPortlet; +import javax.portlet.PortletException; +import javax.portlet.PortletURL; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import javax.portlet.ResourceURL; +import javax.portlet.WindowState; +import java.io.IOException; +import java.io.PrintWriter; + +/** + * @author Chris Laprun + * @version $Revision$ + */ +public class RemoteControlResourcePortlet extends GenericPortlet +{ + private static final String ZIPCODE =3D "zipcode"; + + @Override + protected void doView(RenderRequest renderRequest, RenderResponse rende= rResponse) throws PortletException, IOException + { + renderResponse.setContentType("text/html"); + PrintWriter printWriter =3D renderResponse.getWriter(); + printWriter.print(""); + printWriter.print("

    Open remote control!

    "); + } + + @Override + public void serveResource(ResourceRequest resourceRequest, ResourceResp= onse resourceResponse) throws PortletException, IOException + { + resourceResponse.setContentType("text/html"); + PrintWriter writer =3D resourceResponse.getWriter(); + writer.print(""); + PortletURL url =3D resourceResponse.createRenderURL(); + url.setWindowState(WindowState.MINIMIZED); + writer.print(""); + writer.print("

    'zipcode' public render parameter value: " += resourceRequest.getParameter(ZIPCODE) + "
    "); + writer.print("Set value of 'zipcode' public render parameter = to:

    "); + url.setParameter(ZIPCODE, "80201"); + writer.print("
    • Denver"); + url.setParameter(ZIPCODE, "94102"); + writer.print("
    • San Francisco"); + url.setParameter(ZIPCODE, "20001"); + writer.print("
    • Washington, DC"); + writer.print("
    "); + } + + private String createParentURL(PortletURL url) + { + return "openLinkInParent('" + url + "')"; + } +} Property changes on: modules/portlet/trunk/test/src/main/java/org/jboss/por= tal/portlet/portal/samples/RemoteControlResourcePortlet.java ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/p= ortal/samples/event (from rev 9905, modules/portlet/trunk/test/src/main/jav= a/org/jboss/portal/simple/samples/event) Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= portal/samples/event/CartEvent.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/event/CartEvent.java 2008-02-09 16:39:07 UTC (rev 9905) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/event/CartEvent.java 2008-02-10 01:17:56 UTC (rev 9912) @@ -1,50 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ - -package org.jboss.portal.simple.samples.event; - -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.namespace.QName; -import java.io.Serializable; - -/** - * @author Chris Laprun - * @version $Revision$ - */ -(a)XmlRootElement -public class CartEvent implements Serializable -{ - private String id; - - public static final QName QNAME =3D new QName("urn:jboss:portal:samples= :event", "CartEvent"); - - public CartEvent(String id) - { - this.id =3D id; - } - - public String getId() - { - return id; - } -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/p= ortal/samples/event/CartEvent.java (from rev 9911, modules/portlet/trunk/te= st/src/main/java/org/jboss/portal/simple/samples/event/CartEvent.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/event/CartEvent.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/event/CartEvent.java 2008-02-10 01:17:56 UTC (rev 9912) @@ -0,0 +1,50 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.portal.samples.event; + +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.namespace.QName; +import java.io.Serializable; + +/** + * @author Chris Laprun + * @version $Revision$ + */ +(a)XmlRootElement +public class CartEvent implements Serializable +{ + private String id; + + public static final QName QNAME =3D new QName("urn:jboss:portal:samples= :event", "CartEvent"); + + public CartEvent(String id) + { + this.id =3D id; + } + + public String getId() + { + return id; + } +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= portal/samples/event/CartPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/event/CartPortlet.java 2008-02-09 16:39:07 UTC (rev 9905) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/event/CartPortlet.java 2008-02-10 01:17:56 UTC (rev 9912) @@ -1,82 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ - -package org.jboss.portal.simple.samples.event; - -import javax.portlet.Event; -import javax.portlet.EventRequest; -import javax.portlet.EventResponse; -import javax.portlet.GenericPortlet; -import javax.portlet.PortletException; -import javax.portlet.RenderRequest; -import javax.portlet.RenderResponse; -import java.io.IOException; -import java.io.Writer; -import java.util.ArrayList; -import java.util.List; - -/** - * @author Chris Laprun - * @version $Revision$ - */ -public class CartPortlet extends GenericPortlet -{ - List items =3D new ArrayList(7); - - @Override - protected void doView(RenderRequest renderRequest, RenderResponse rende= rResponse) throws PortletException, IOException - { - renderResponse.setContentType("text/html"); - Writer writer =3D renderResponse.getWriter(); - - - if (!items.isEmpty()) - { - writer.append(""); - int total =3D 0; - for (CatalogItem item : items) - { - int price =3D item.getPrice(); - total +=3D price; - writer.append(""); - } - writer.append("
    DescriptionPrice
    ").append(item.getDescription()).append= ("$").append("" + price) - .append("
    ").append("$= " + total).append("
    "); - } - else - { - writer.append("Cart is empty."); - } - } - - @Override - public void processEvent(EventRequest eventRequest, EventResponse event= Response) throws PortletException, IOException - { - Event event =3D eventRequest.getEvent(); - if (event.getName().equals("CartEvent")) - { - CartEvent cartEvent =3D (CartEvent)event.getValue(); - items.add(Catalog.get(cartEvent.getId())); - } - } -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/p= ortal/samples/event/CartPortlet.java (from rev 9911, modules/portlet/trunk/= test/src/main/java/org/jboss/portal/simple/samples/event/CartPortlet.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/event/CartPortlet.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/event/CartPortlet.java 2008-02-10 01:17:56 UTC (rev 9912) @@ -0,0 +1,83 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.portal.samples.event; + +import javax.portlet.Event; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.GenericPortlet; +import javax.portlet.PortletException; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import java.io.IOException; +import java.io.Writer; +import java.util.ArrayList; +import java.util.List; + +/** + * @author Chris Laprun + * @version $Revision$ + */ +public class CartPortlet extends GenericPortlet +{ + List items =3D new ArrayList(7); + + @Override + protected void doView(RenderRequest renderRequest, RenderResponse rende= rResponse) throws PortletException, IOException + { + renderResponse.setContentType("text/html"); + Writer writer =3D renderResponse.getWriter(); + + + if (!items.isEmpty()) + { + writer.append("Description<= tbody>"); + int total =3D 0; + for (CatalogItem item : items) + { + int price =3D item.getPrice(); + total +=3D price; + writer.append(""); + } + writer.append("
    Price
    ").append(item.getDescription()).append= ("$").append("" + price) + .append("
    Total:") + .append("$" + total).append("
    "); + } + else + { + writer.append("Cart is empty."); + } + } + + @Override + public void processEvent(EventRequest eventRequest, EventResponse event= Response) throws PortletException, IOException + { + Event event =3D eventRequest.getEvent(); + if (event.getName().equals("CartEvent")) + { + CartEvent cartEvent =3D (CartEvent)event.getValue(); + items.add(Catalog.get(cartEvent.getId())); + } + } +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= portal/samples/event/Catalog.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/event/Catalog.java 2008-02-09 16:39:07 UTC (rev 9905) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/event/Catalog.java 2008-02-10 01:17:56 UTC (rev 9912) @@ -1,63 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ - -package org.jboss.portal.simple.samples.event; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -/** - * @author Chris Laprun - * @version $Revision$ - */ -public class Catalog -{ - private static Map items; - - static - { - items =3D new HashMap(7); - items.put("1", new CatalogItem("1", 800, "Bike")); - items.put("2", new CatalogItem("2", 450, "Snowboard")); - items.put("3", new CatalogItem("3", 225, "Tent")); - items.put("4", new CatalogItem("4", 75, "Backpack")); - items.put("5", new CatalogItem("5", 119, "Skateboard")); - items.put("6", new CatalogItem("6", 333, "Surfboard")); - items.put("7", new CatalogItem("7", 90, "Sneakers")); - } - - private Catalog() - { - } - - public static CatalogItem get(String id) - { - return items.get(id); - } - - public static Collection getAll() - { - return items.values(); - } -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/p= ortal/samples/event/Catalog.java (from rev 9911, modules/portlet/trunk/test= /src/main/java/org/jboss/portal/simple/samples/event/Catalog.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/event/Catalog.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/event/Catalog.java 2008-02-10 01:17:56 UTC (rev 9912) @@ -0,0 +1,63 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.portal.samples.event; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +/** + * @author Chris Laprun + * @version $Revision$ + */ +public class Catalog +{ + private static Map items; + + static + { + items =3D new HashMap(7); + items.put("1", new CatalogItem("1", 800, "Bike")); + items.put("2", new CatalogItem("2", 450, "Snowboard")); + items.put("3", new CatalogItem("3", 225, "Tent")); + items.put("4", new CatalogItem("4", 75, "Backpack")); + items.put("5", new CatalogItem("5", 119, "Skateboard")); + items.put("6", new CatalogItem("6", 333, "Surfboard")); + items.put("7", new CatalogItem("7", 90, "Sneakers")); + } + + private Catalog() + { + } + + public static CatalogItem get(String id) + { + return items.get(id); + } + + public static Collection getAll() + { + return items.values(); + } +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= portal/samples/event/CatalogItem.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/event/CatalogItem.java 2008-02-09 16:39:07 UTC (rev 9905) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/event/CatalogItem.java 2008-02-10 01:17:56 UTC (rev 9912) @@ -1,57 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ - -package org.jboss.portal.simple.samples.event; - -/** - * @author Chris Laprun - * @version $Revision$ - */ -public class CatalogItem -{ - private String id; - private int price; - private String description; - - public CatalogItem(String id, int price, String description) - { - this.id =3D id; - this.price =3D price; - this.description =3D description; - } - - public String getId() - { - return id; - } - - public int getPrice() - { - return price; - } - - public String getDescription() - { - return description; - } -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/p= ortal/samples/event/CatalogItem.java (from rev 9911, modules/portlet/trunk/= test/src/main/java/org/jboss/portal/simple/samples/event/CatalogItem.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/event/CatalogItem.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/event/CatalogItem.java 2008-02-10 01:17:56 UTC (rev 9912) @@ -0,0 +1,57 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.portal.samples.event; + +/** + * @author Chris Laprun + * @version $Revision$ + */ +public class CatalogItem +{ + private String id; + private int price; + private String description; + + public CatalogItem(String id, int price, String description) + { + this.id =3D id; + this.price =3D price; + this.description =3D description; + } + + public String getId() + { + return id; + } + + public int getPrice() + { + return price; + } + + public String getDescription() + { + return description; + } +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= portal/samples/event/CatalogPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/event/CatalogPortlet.java 2008-02-09 16:39:07 UTC (rev 9905) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/event/CatalogPortlet.java 2008-02-10 01:17:56 UTC (rev 9912) @@ -1,71 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ - -package org.jboss.portal.simple.samples.event; - -import javax.portlet.ActionRequest; -import javax.portlet.ActionResponse; -import javax.portlet.GenericPortlet; -import javax.portlet.PortletException; -import javax.portlet.PortletURL; -import javax.portlet.RenderRequest; -import javax.portlet.RenderResponse; -import java.io.IOException; -import java.io.Writer; -import java.util.Collection; - -/** - * @author Chris Laprun - * @version $Revision$ - */ -public class CatalogPortlet extends GenericPortlet -{ - @Override - protected void doView(RenderRequest renderRequest, RenderResponse rende= rResponse) throws PortletException, IOException - { - renderResponse.setContentType("text/html"); - Writer writer =3D renderResponse.getWriter(); - - writer.append("<= th>Actions"); - - PortletURL addURL =3D renderResponse.createActionURL(); - addURL.setParameter("op", "add"); - - Collection items =3D Catalog.getAll(); - for (CatalogItem item : items) - { - addURL.setParameter("id", item.getId()); - writer.append(""); - } - - writer.append("
    DescriptionPrice
    ").append(item.getDescription()).append("<= /td>$").append("" + item.getPrice()) - .append("Add to cart
    "); - } - - @Override - public void processAction(ActionRequest actionRequest, ActionResponse a= ctionResponse) throws PortletException, IOException - { - String value =3D actionRequest.getParameter("id"); - actionResponse.setEvent(CartEvent.QNAME, new CartEvent(value)); - } -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/p= ortal/samples/event/CatalogPortlet.java (from rev 9911, modules/portlet/tru= nk/test/src/main/java/org/jboss/portal/simple/samples/event/CatalogPortlet.= java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/event/CatalogPortlet.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/event/CatalogPortlet.java 2008-02-10 01:17:56 UTC (rev 9912) @@ -0,0 +1,71 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.portal.samples.event; + +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.GenericPortlet; +import javax.portlet.PortletException; +import javax.portlet.PortletURL; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import java.io.IOException; +import java.io.Writer; +import java.util.Collection; + +/** + * @author Chris Laprun + * @version $Revision$ + */ +public class CatalogPortlet extends GenericPortlet +{ + @Override + protected void doView(RenderRequest renderRequest, RenderResponse rende= rResponse) throws PortletException, IOException + { + renderResponse.setContentType("text/html"); + Writer writer =3D renderResponse.getWriter(); + + writer.append(""); + + PortletURL addURL =3D renderResponse.createActionURL(); + addURL.setParameter("op", "add"); + + Collection items =3D Catalog.getAll(); + for (CatalogItem item : items) + { + addURL.setParameter("id", item.getId()); + writer.append(""); + } + + writer.append("
    DescriptionPriceActions
    ").append(item.getDescription()).append("<= /td>$").append("" + item.getPrice()) + .append("Add to cart
    "); + } + + @Override + public void processAction(ActionRequest actionRequest, ActionResponse a= ctionResponse) throws PortletException, IOException + { + String value =3D actionRequest.getParameter("id"); + actionResponse.setEvent(CartEvent.QNAME, new CartEvent(value)); + } +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/s= amples/GoogleClippingPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/GoogleClippingPortlet.java 2008-02-09 20:42:01 UTC (rev 9911) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/GoogleClippingPortlet.java 2008-02-10 01:17:56 UTC (rev 9912) @@ -1,178 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ - -package org.jboss.portal.simple.samples; - -import javax.portlet.ActionRequest; -import javax.portlet.ActionResponse; -import javax.portlet.GenericPortlet; -import javax.portlet.PortletException; -import javax.portlet.PortletMode; -import javax.portlet.PortletPreferences; -import javax.portlet.RenderRequest; -import javax.portlet.RenderResponse; -import java.io.BufferedInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.PrintWriter; -import java.net.URL; -import java.net.URLConnection; - -/** - * A simple portlet using Google's search services to extract interesting = information (weather, map, ...) from first - * result. - * - * @author Chris Laprun - * @version $Revision$ - */ -public class GoogleClippingPortlet extends GenericPortlet -{ - protected static final String A =3D ""; - String end =3D ""; - int begIndex =3D html.indexOf(beg); - if (begIndex !=3D -1) - { - // extract table containing specific first result - int endIndex =3D html.indexOf(end, begIndex); - html =3D html.substring(begIndex + beg.length(), endIndex + end.l= ength()); - - html =3D postProcessHTML(html); - - renderResponse.setContentType("text/html"); - PrintWriter printWriter =3D renderResponse.getWriter(); - printWriter.print(html); - } - } - - protected String getZipCode(RenderRequest renderRequest) - { - String zip =3D renderRequest.getParameter(ZIP); - if (zip =3D=3D null) - { - zip =3D renderRequest.getPreferences().getValue(ZIP, SAN_FRAN); - } - return zip; - } - - @Override - protected void doEdit(RenderRequest renderRequest, RenderResponse rende= rResponse) throws PortletException, IOException - { - renderResponse.setContentType("text/html"); - renderResponse.getWriter().print( - "
    \n" + - "
    \n" + - " Change Location:\n" + - "\n" + - "
    Zip Code:
    \n" + - " \n" + - "
    \n" + - " \n" + - "
    \n" + - "
    "); - } - - @Override - public void processAction(ActionRequest actionRequest, ActionResponse a= ctionResponse) throws PortletException, IOException - { - String zip =3D actionRequest.getParameter(ZIP); - - if (null !=3D zip) - { - PortletPreferences prefs =3D actionRequest.getPreferences(); - prefs.setValue(ZIP, zip); - prefs.store(); - } - - // set zip as render parameter - actionResponse.setRenderParameter(ZIP, zip); - - // request view - actionResponse.setPortletMode(PortletMode.VIEW); - } - - protected String postProcessHTML(String html) - { - // links should open in new windows - html =3D html.replaceAll(A, A_TARGET_BLANK); - - // src attributes should be absolute - html =3D html.replaceAll("src=3D/", "src=3Dhttp://google.com/"); - html =3D html.replaceAll("src=3D\"/", "src=3D\"http://google.com/"); - - // forms should open in new windows and have an absolute action URL - html =3D html.replaceAll("action=3D\"/", "target=3D'_blank' action= =3D\"http://google.com/"); - - return html; - } - - protected String getQueryString(String zip) - { - return GOOGLE + zip; - } - - private byte[] getBytes(InputStream in, int bufferSize) throws IOExcept= ion, IllegalArgumentException - { - ByteArrayOutputStream out =3D new ByteArrayOutputStream(); - - byte[] buffer =3D new byte[bufferSize]; - while (true) - { - int i =3D in.read(buffer); - if (i =3D=3D 0) - { - continue; - } - if (i =3D=3D -1) - { - break; - } - out.write(buffer, 0, i); - } - return out.toByteArray(); - } - -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/s= amples/GoogleWeatherClippingPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/GoogleWeatherClippingPortlet.java 2008-02-09 20:42:01 UTC (rev 9911) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/GoogleWeatherClippingPortlet.java 2008-02-10 01:17:56 UTC (rev 9912) @@ -1,55 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ - -package org.jboss.portal.simple.samples; - -/** - * @author Chris Laprun - * @version $Revision$ - */ -public class GoogleWeatherClippingPortlet extends GoogleClippingPortlet -{ - private final static String WEATHER_URL =3D "http://www.google.com/sear= ch?q=3Dweather+"; - private static final String A_END =3D ""; - - protected String getQueryString(String zip) - { - return WEATHER_URL + zip; - } - - protected String postProcessHTML(String html) - { - int begIndex; - int endIndex; - - // remove add to iGoogle link - begIndex =3D html.indexOf(A); - if (begIndex !=3D -1) - { - endIndex =3D html.indexOf(A_END, begIndex); - html =3D html.substring(0, begIndex) + html.substring(endIndex + = A_END.length()); - } - - return super.postProcessHTML(html); - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/s= amples/RemoteControlResourcePortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/RemoteControlResourcePortlet.java 2008-02-09 20:42:01 UTC (rev 9911) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/sample= s/RemoteControlResourcePortlet.java 2008-02-10 01:17:56 UTC (rev 9912) @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2008, Your Corporation. All Rights Reserved. - */ - -package org.jboss.portal.simple.samples; - -import javax.portlet.GenericPortlet; -import javax.portlet.PortletException; -import javax.portlet.PortletURL; -import javax.portlet.RenderRequest; -import javax.portlet.RenderResponse; -import javax.portlet.ResourceRequest; -import javax.portlet.ResourceResponse; -import javax.portlet.ResourceURL; -import javax.portlet.WindowState; -import java.io.IOException; -import java.io.PrintWriter; - -/** - * @author Chris Laprun - * @version $Revision$ - */ -public class RemoteControlResourcePortlet extends GenericPortlet -{ - private static final String ZIPCODE =3D "zipcode"; - - @Override - protected void doView(RenderRequest renderRequest, RenderResponse rende= rResponse) throws PortletException, IOException - { - renderResponse.setContentType("text/html"); - PrintWriter printWriter =3D renderResponse.getWriter(); - printWriter.print(""); - printWriter.print("

    Open remote control!

    "); - } - - @Override - public void serveResource(ResourceRequest resourceRequest, ResourceResp= onse resourceResponse) throws PortletException, IOException - { - resourceResponse.setContentType("text/html"); - PrintWriter writer =3D resourceResponse.getWriter(); - writer.print(""); - PortletURL url =3D resourceResponse.createRenderURL(); - url.setWindowState(WindowState.MINIMIZED); - writer.print(""); - writer.print("

    'zipcode' public render parameter value: " += resourceRequest.getParameter(ZIPCODE) + "
    "); - writer.print("Set value of 'zipcode' public render parameter = to:

    "); - url.setParameter(ZIPCODE, "80201"); - writer.print("
    • Denver"); - url.setParameter(ZIPCODE, "94102"); - writer.print("
    • San Francisco"); - url.setParameter(ZIPCODE, "20001"); - writer.print("
    • Washington, DC"); - writer.print("
    "); - } - - private String createParentURL(PortletURL url) - { - return "openLinkInParent('" + url + "')"; - } -} Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-09 20:42:01 UTC (= rev 9911) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-10 01:17:56 UTC (= rev 9912) @@ -755,46 +755,48 @@ = - - - + + + + + + + + - - + + = - - - + + + - - + + = - - + + + includes=3D"org/jboss/portal/portlet/portal/samples/Remo= teControlResourcePortlet.class"/> - - + + = - - - + + + - - + + = - - - Copied: modules/portlet/trunk/test/src/test/resources/portal/samples/cart-e= vent-portlet-war (from rev 9905, modules/portlet/trunk/test/src/test/resour= ces/cart-event-portlet-war) Copied: modules/portlet/trunk/test/src/test/resources/portal/samples/cart-e= vent-portlet-war/WEB-INF (from rev 9911, modules/portlet/trunk/test/src/tes= t/resources/cart-event-portlet-war/WEB-INF) Modified: modules/portlet/trunk/test/src/test/resources/portal/samples/cart= -event-portlet-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/WE= B-INF/portlet.xml 2008-02-09 20:42:01 UTC (rev 9911) +++ modules/portlet/trunk/test/src/test/resources/portal/samples/cart-event= -portlet-war/WEB-INF/portlet.xml 2008-02-10 01:17:56 UTC (rev 9912) @@ -30,7 +30,7 @@ Catalog Portlet Catalog Catalog Portlet - org.jboss.portal.simple.samples.event.CatalogPortlet<= /portlet-class> + org.jboss.portal.portlet.portal.samples.event.Catalog= Portlet text/html VIEW @@ -48,7 +48,7 @@ Cart Portlet Cart Cart Portlet - org.jboss.portal.simple.samples.event.CartPortlet + org.jboss.portal.portlet.portal.samples.event.CartPor= tlet text/html VIEW @@ -64,7 +64,7 @@ = jbp:CartEvent - org.jboss.portal.simple.samples.event.CartEvent + org.jboss.portal.portlet.portal.samples.event.CartEvent<= /value-type> = Copied: modules/portlet/trunk/test/src/test/resources/portal/samples/google= -map-portlet-war (from rev 9905, modules/portlet/trunk/test/src/test/resour= ces/google-map-portlet-war) Copied: modules/portlet/trunk/test/src/test/resources/portal/samples/google= -map-portlet-war/WEB-INF (from rev 9911, modules/portlet/trunk/test/src/tes= t/resources/google-map-portlet-war/WEB-INF) Modified: modules/portlet/trunk/test/src/test/resources/portal/samples/goog= le-map-portlet-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WE= B-INF/portlet.xml 2008-02-09 20:42:01 UTC (rev 9911) +++ modules/portlet/trunk/test/src/test/resources/portal/samples/google-map= -portlet-war/WEB-INF/portlet.xml 2008-02-10 01:17:56 UTC (rev 9912) @@ -29,7 +29,7 @@ Portlet displaying a location on Google Maps GoogleMap Google Map Portlet - org.jboss.portal.simple.samples.GoogleClippingPortlet= + org.jboss.portal.portlet.portal.samples.GoogleClippin= gPortlet 120 text/html Copied: modules/portlet/trunk/test/src/test/resources/portal/samples/google= -weather-portlet-war (from rev 9905, modules/portlet/trunk/test/src/test/re= sources/google-weather-portlet-war) Copied: modules/portlet/trunk/test/src/test/resources/portal/samples/google= -weather-portlet-war/WEB-INF (from rev 9911, modules/portlet/trunk/test/src= /test/resources/google-weather-portlet-war/WEB-INF) Modified: modules/portlet/trunk/test/src/test/resources/portal/samples/goog= le-weather-portlet-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/google-weather-portlet-wa= r/WEB-INF/portlet.xml 2008-02-09 20:42:01 UTC (rev 9911) +++ modules/portlet/trunk/test/src/test/resources/portal/samples/google-wea= ther-portlet-war/WEB-INF/portlet.xml 2008-02-10 01:17:56 UTC (rev 9912) @@ -29,7 +29,7 @@ Portlet displaying the weather forecast for the specifi= ed location GoogleWeather Google Weather Portlet - org.jboss.portal.simple.samples.GoogleWeatherClipping= Portlet + org.jboss.portal.portlet.portal.samples.GoogleWeather= ClippingPortlet 120 text/html Copied: modules/portlet/trunk/test/src/test/resources/portal/samples/remote= control-portlet-war (from rev 9905, modules/portlet/trunk/test/src/test/res= ources/remotecontrol-portlet-war) Copied: modules/portlet/trunk/test/src/test/resources/portal/samples/remote= control-portlet-war/WEB-INF (from rev 9911, modules/portlet/trunk/test/src/= test/resources/remotecontrol-portlet-war/WEB-INF) Modified: modules/portlet/trunk/test/src/test/resources/portal/samples/remo= tecontrol-portlet-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/remotecontrol-portlet-war= /WEB-INF/portlet.xml 2008-02-09 20:42:01 UTC (rev 9911) +++ modules/portlet/trunk/test/src/test/resources/portal/samples/remotecont= rol-portlet-war/WEB-INF/portlet.xml 2008-02-10 01:17:56 UTC (rev 9912) @@ -29,7 +29,7 @@ Portlet controlling display of other portlets RemoteControl Remote Control Resource Portlet - org.jboss.portal.simple.samples.RemoteControlResource= Portlet + org.jboss.portal.portlet.portal.samples.RemoteControl= ResourcePortlet text/html VIEW Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/demo.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo.jsp 2008-02-09 20:42:01 UTC (rev 9911) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo.jsp 2008-02-10 01:17:56 UTC (rev 9912) @@ -10,15 +10,15 @@ - + - + - - - + + + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/demo1.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo1.jsp 2008-02-09 20:42:01 UTC (rev 9911) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo1.jsp 2008-02-10 01:17:56 UTC (rev 9912) @@ -10,10 +10,10 @@ - + - + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/demo2.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo2.jsp 2008-02-09 20:42:01 UTC (rev 9911) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo2.jsp 2008-02-10 01:17:56 UTC (rev 9912) @@ -10,13 +10,13 @@ - + = = - - + + = --===============5249803438541760500==-- From portal-commits at lists.jboss.org Sat Feb 9 20:34:16 2008 Content-Type: multipart/mixed; boundary="===============5957546977310685925==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9913 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib. Date: Sat, 09 Feb 2008 20:34:14 -0500 Message-ID: --===============5957546977310685925== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-09 20:34:14 -0500 (Sat, 09 Feb 2008) New Revision: 9913 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PageTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortalBodyTagSupport.java Log: fixed maximized not work Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PageTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageTag.java 2008-02-10 01:17:56 UTC (rev 9912) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageTag.java 2008-02-10 01:34:14 UTC (rev 9913) @@ -24,6 +24,7 @@ = import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; import org.jboss.portal.portlet.test.jsp.PortalResponse; +import org.jboss.portal.portlet.test.jsp.PortalActionResponse; = import javax.servlet.jsp.JspException; import javax.xml.namespace.QName; @@ -87,12 +88,12 @@ return EVAL_PAGE; } = - public int doStartTag(PortalResponse portalResponse) throws JspException + public int doStartActionTag(PortalActionResponse portalResponse) throws= JspException { return EVAL_BODY_INCLUDE; } = - public int doEndTag(PortalResponse portalResponse) throws JspException + public int doEndActionTag(PortalActionResponse portalResponse) throws J= spException { return EVAL_PAGE; } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortalBodyTagSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalBodyTagSupport.java 2008-02-10 01:17:56 UTC (rev 9912) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalBodyTagSupport.java 2008-02-10 01:34:14 UTC (rev 9913) @@ -123,11 +123,11 @@ = public int doStartRenderTag(PortalRenderResponse renderResponse) throws= JspException { - return super.doStartTag(); + throw new NotYetImplemented(); } = public int doEndRenderTag(PortalRenderResponse renderResponse) throws J= spException { - return super.doEndTag(); + throw new NotYetImplemented(); } } --===============5957546977310685925==-- From portal-commits at lists.jboss.org Sat Feb 9 20:38:00 2008 Content-Type: multipart/mixed; boundary="===============2219220630205000836==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9914 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple. Date: Sat, 09 Feb 2008 20:38:00 -0500 Message-ID: --===============2219220630205000836== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-09 20:37:59 -0500 (Sat, 09 Feb 2008) New Revision: 9914 Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/ Log: remove empty dir --===============2219220630205000836==-- From portal-commits at lists.jboss.org Sat Feb 9 21:16:33 2008 Content-Type: multipart/mixed; boundary="===============0588548740953442939==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9915 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp: taglib and 1 other directory. Date: Sat, 09 Feb 2008 21:16:32 -0500 Message-ID: --===============0588548740953442939== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-09 21:16:32 -0500 (Sat, 09 Feb 2008) New Revision: 9915 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalPrepareResponse.java Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalActionResponse.java Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PageEventControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PagePortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PageParamTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PageTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/ParamTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortalBodyTagSupport.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortalSimpleTagSupport.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletMarkupTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTitleTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletURLTag.java Log: rename action -> prepare phase Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-10 01:37:59 UTC (rev 9914) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-10 02:16:32 UTC (rev 9915) @@ -88,13 +88,13 @@ PortletInvoker invoker =3D (PortletInvoker)getServletContext().getAt= tribute("ConsumerPortletInvoker"); = // - PortalActionResponse actionResponse =3D new PortalActionResponse(res= p, invoker); + PortalPrepareResponse prepareResponse =3D new PortalPrepareResponse(= resp, invoker); = // Discover existing portlets on the page (introspection phase) - chain.doFilter(req, actionResponse); + chain.doFilter(req, prepareResponse); = // Now we can create a populated context - PagePortletControllerContext context =3D new PagePortletControllerCo= ntext(req, resp, getServletContext(), actionResponse); + PagePortletControllerContext context =3D new PagePortletControllerCo= ntext(req, resp, getServletContext(), prepareResponse); = // PageNavigationalState pageState =3D null; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PageEventControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PageEventControllerContext.java 2008-02-10 01:37:59 UTC (rev 9914) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PageEventControllerContext.java 2008-02-10 02:16:32 UTC (rev 9915) @@ -41,11 +41,11 @@ { = /** . */ - private final PortalActionResponse actionResponse; + private final PortalPrepareResponse prepareResponse; = - public PageEventControllerContext(PortalActionResponse actionResponse) + public PageEventControllerContext(PortalPrepareResponse prepareResponse) { - this.actionResponse =3D actionResponse; + this.prepareResponse =3D prepareResponse; } = public List getConsumedEvents(Event producedEvent) @@ -53,9 +53,9 @@ ArrayList consumedEvents =3D new ArrayList(); = // - for (String windowId : actionResponse.getWindowIds()) + for (String windowId : prepareResponse.getWindowIds()) { - Portlet portlet =3D actionResponse.getPortlet(windowId); + Portlet portlet =3D prepareResponse.getPortlet(windowId); = // PortletInfo portletInfo =3D portlet.getInfo(); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PagePortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-10 01:37:59 UTC (rev 9914) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-10 02:16:32 UTC (rev 9915) @@ -47,30 +47,30 @@ private final EventControllerContext eventControllerContext; = /** . */ - private final PortalActionResponse actionResponse; + private final PortalPrepareResponse prepareResponse; = public PagePortletControllerContext( HttpServletRequest req, HttpServletResponse resp, ServletContext servletContext, - PortalActionResponse actionResponse) + PortalPrepareResponse prepareResponse) throws IllegalRequestException, IOException, ServletException, Portl= etInvokerException { super(req, resp, servletContext); = // - this.actionResponse =3D actionResponse; - this.eventControllerContext =3D new PageEventControllerContext(actio= nResponse); + this.prepareResponse =3D prepareResponse; + this.eventControllerContext =3D new PageEventControllerContext(prepa= reResponse); } = protected Portlet getPortlet(String windowId) throws PortletInvokerExce= ption { - return actionResponse.getPortlet(windowId); + return prepareResponse.getPortlet(windowId); } = public PortletInvocationResponse invoke(PortletInvocation invocation) t= hrows PortletInvokerException { - return actionResponse.getInvoker().invoke(invocation); + return prepareResponse.getInvoker().invoke(invocation); } = public EventControllerContext getEventControllerContext() Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/PortalActionResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalActionResponse.java 2008-02-10 01:37:59 UTC (rev 9914) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalActionResponse.java 2008-02-10 02:16:32 UTC (rev 9915) @@ -1,242 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp; - -import org.jboss.portal.portlet.Portlet; -import org.jboss.portal.portlet.PortletInvoker; -import org.jboss.portal.portlet.PortletInvokerException; - -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.Cookie; -import javax.servlet.ServletOutputStream; -import java.io.IOException; -import java.io.PrintWriter; -import java.io.Writer; -import java.util.Locale; -import java.util.Map; -import java.util.HashMap; -import java.util.Set; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class PortalActionResponse extends PortalResponse -{ - - /** . */ - private String contentType; - - /** . */ - private Locale locale; - - /** . */ - private String characterEncoding; - - /** . */ - private int bufferSize; - - /** . */ - private ServletOutputStream outputStream; - - /** . */ - private PrintWriter writer; - - /** . */ - private Map windows; - - public PortalActionResponse(HttpServletResponse response, PortletInvoke= r invoker) throws PortletInvokerException - { - super(response, invoker); - - // - this.windows =3D new HashMap(); - } - - public void addWindow(String windowId, Portlet portlet) - { - windows.put(windowId, portlet); - } - - public Set getWindowIds() - { - return windows.keySet(); - } - - public Portlet getPortlet(String windowId) - { - return windows.get(windowId); - } - - public ServletOutputStream getOutputStream() throws IOException - { - if (writer !=3D null) - { - throw new IllegalStateException(); - } - if (outputStream =3D=3D null) - { - outputStream =3D new ServletOutputStream() - { - public void write(int b) throws IOException - { - } - }; - } - return outputStream; - } - - public PrintWriter getWriter() throws IOException - { - if (outputStream !=3D null) - { - throw new IllegalStateException(); - } - if (writer =3D=3D null) - { - Writer tmp =3D new Writer() - { - public void write(char cbuf[], int off, int len) throws IOExce= ption - { - } - public void flush() throws IOException - { - } - public void close() throws IOException - { - } - }; - writer =3D new PrintWriter(tmp); - } - return writer; - } - - public void flushBuffer() throws IOException - { - } - - public boolean isCommitted() - { - return false; - } - - public void reset() - { - } - - public void resetBuffer() - { - } - - public void sendError(int i, String s) throws IOException - { - } - - public void sendError(int i) throws IOException - { - } - - public void sendRedirect(String s) throws IOException - { - } - - public void addCookie(Cookie cookie) - { - } - - public void setDateHeader(String s, long l) - { - } - - public void addDateHeader(String s, long l) - { - } - - public void setHeader(String s, String s1) - { - } - - public void addHeader(String s, String s1) - { - } - - public void setContentType(String contentType) - { - this.contentType =3D contentType; - } - - public void setContentLength(int i) - { - } - - public void setCharacterEncoding(String characterEncoding) - { - this.characterEncoding =3D characterEncoding; - } - - public void setIntHeader(String s, int i) - { - } - - public void addIntHeader(String s, int i) - { - } - - public void setStatus(int i) - { - } - - public void setStatus(int i, String s) - { - } - - public void setLocale(Locale locale) - { - this.locale =3D locale; - } - - public String getContentType() - { - return contentType; - } - - public Locale getLocale() - { - return locale; - } - - public String getCharacterEncoding() - { - return characterEncoding; - } - - public void setBufferSize(int bufferSize) - { - this.bufferSize =3D bufferSize; - } - - public int getBufferSize() - { - return bufferSize; - } -} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/jsp/PortalPrepareResponse.java (from rev 9913, modules/portlet/trunk/te= st/src/main/java/org/jboss/portal/portlet/test/jsp/PortalActionResponse.jav= a) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalPrepareResponse.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalPrepareResponse.java 2008-02-10 02:16:32 UTC (rev 9915) @@ -0,0 +1,242 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp; + +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletInvoker; +import org.jboss.portal.portlet.PortletInvokerException; + +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.Cookie; +import javax.servlet.ServletOutputStream; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.Writer; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortalPrepareResponse extends PortalResponse +{ + + /** . */ + private String contentType; + + /** . */ + private Locale locale; + + /** . */ + private String characterEncoding; + + /** . */ + private int bufferSize; + + /** . */ + private ServletOutputStream outputStream; + + /** . */ + private PrintWriter writer; + + /** . */ + private Map windows; + + public PortalPrepareResponse(HttpServletResponse response, PortletInvok= er invoker) throws PortletInvokerException + { + super(response, invoker); + + // + this.windows =3D new HashMap(); + } + + public void addWindow(String windowId, Portlet portlet) + { + windows.put(windowId, portlet); + } + + public Set getWindowIds() + { + return windows.keySet(); + } + + public Portlet getPortlet(String windowId) + { + return windows.get(windowId); + } + + public ServletOutputStream getOutputStream() throws IOException + { + if (writer !=3D null) + { + throw new IllegalStateException(); + } + if (outputStream =3D=3D null) + { + outputStream =3D new ServletOutputStream() + { + public void write(int b) throws IOException + { + } + }; + } + return outputStream; + } + + public PrintWriter getWriter() throws IOException + { + if (outputStream !=3D null) + { + throw new IllegalStateException(); + } + if (writer =3D=3D null) + { + Writer tmp =3D new Writer() + { + public void write(char cbuf[], int off, int len) throws IOExce= ption + { + } + public void flush() throws IOException + { + } + public void close() throws IOException + { + } + }; + writer =3D new PrintWriter(tmp); + } + return writer; + } + + public void flushBuffer() throws IOException + { + } + + public boolean isCommitted() + { + return false; + } + + public void reset() + { + } + + public void resetBuffer() + { + } + + public void sendError(int i, String s) throws IOException + { + } + + public void sendError(int i) throws IOException + { + } + + public void sendRedirect(String s) throws IOException + { + } + + public void addCookie(Cookie cookie) + { + } + + public void setDateHeader(String s, long l) + { + } + + public void addDateHeader(String s, long l) + { + } + + public void setHeader(String s, String s1) + { + } + + public void addHeader(String s, String s1) + { + } + + public void setContentType(String contentType) + { + this.contentType =3D contentType; + } + + public void setContentLength(int i) + { + } + + public void setCharacterEncoding(String characterEncoding) + { + this.characterEncoding =3D characterEncoding; + } + + public void setIntHeader(String s, int i) + { + } + + public void addIntHeader(String s, int i) + { + } + + public void setStatus(int i) + { + } + + public void setStatus(int i, String s) + { + } + + public void setLocale(Locale locale) + { + this.locale =3D locale; + } + + public String getContentType() + { + return contentType; + } + + public Locale getLocale() + { + return locale; + } + + public String getCharacterEncoding() + { + return characterEncoding; + } + + public void setBufferSize(int bufferSize) + { + this.bufferSize =3D bufferSize; + } + + public int getBufferSize() + { + return bufferSize; + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PageParamTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageParamTag.java 2008-02-10 01:37:59 UTC (rev 9914) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageParamTag.java 2008-02-10 02:16:32 UTC (rev 9915) @@ -23,6 +23,7 @@ package org.jboss.portal.portlet.test.jsp.taglib; = import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; +import org.jboss.portal.portlet.test.jsp.PortalPrepareResponse; = import javax.servlet.jsp.JspException; import javax.xml.namespace.QName; @@ -87,7 +88,7 @@ this.frozen =3D frozen; } = - public void doRenderTag(PortalRenderResponse renderResponse) throws Jsp= Exception, IOException + public void doTag(PortalRenderResponse renderResponse) throws JspExcept= ion, IOException { if (renderResponse.isPageStateModifiable()) { @@ -105,7 +106,7 @@ } } = - public void doActionTag() throws JspException, IOException + public void doTag(PortalPrepareResponse prepareResponse) throws JspExce= ption, IOException { } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PageTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageTag.java 2008-02-10 01:37:59 UTC (rev 9914) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageTag.java 2008-02-10 02:16:32 UTC (rev 9915) @@ -23,8 +23,7 @@ package org.jboss.portal.portlet.test.jsp.taglib; = import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; -import org.jboss.portal.portlet.test.jsp.PortalResponse; -import org.jboss.portal.portlet.test.jsp.PortalActionResponse; +import org.jboss.portal.portlet.test.jsp.PortalPrepareResponse; = import javax.servlet.jsp.JspException; import javax.xml.namespace.QName; @@ -55,7 +54,7 @@ /** . */ Status status =3D Status.ACTIVE; = - public int doStartRenderTag(PortalRenderResponse renderResponse) throws= JspException + public int doStartTag(PortalRenderResponse renderResponse) throws JspEx= ception { maximizedId =3D renderResponse.getMaximizedWindowId(); = @@ -70,7 +69,7 @@ } } = - public int doEndRenderTag(PortalRenderResponse renderResponse) throws J= spException + public int doEndTag(PortalRenderResponse renderResponse) throws JspExce= ption { if (maximizedId !=3D null) { @@ -88,12 +87,12 @@ return EVAL_PAGE; } = - public int doStartActionTag(PortalActionResponse portalResponse) throws= JspException + public int doStartTag(PortalPrepareResponse portalResponse) throws JspE= xception { return EVAL_BODY_INCLUDE; } = - public int doEndActionTag(PortalActionResponse portalResponse) throws J= spException + public int doEndTag(PortalPrepareResponse portalResponse) throws JspExc= eption { return EVAL_PAGE; } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/ParamTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/ParamTag.java 2008-02-10 01:37:59 UTC (rev 9914) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/ParamTag.java 2008-02-10 02:16:32 UTC (rev 9915) @@ -61,7 +61,7 @@ this.value =3D value; } = - public void doRenderTag(PortalRenderResponse renderResponse) throws Jsp= Exception, IOException + public void doTag(PortalRenderResponse renderResponse) throws JspExcept= ion, IOException { AbstractURLTag urlTag =3D (AbstractURLTag)SimpleTagSupport.findAnces= torWithClass(this, AbstractURLTag.class); urlTag.setParam(name, value); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortalBodyTagSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalBodyTagSupport.java 2008-02-10 01:37:59 UTC (rev 9914) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalBodyTagSupport.java 2008-02-10 02:16:32 UTC (rev 9915) @@ -23,7 +23,7 @@ package org.jboss.portal.portlet.test.jsp.taglib; = import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; -import org.jboss.portal.portlet.test.jsp.PortalActionResponse; +import org.jboss.portal.portlet.test.jsp.PortalPrepareResponse; import org.jboss.portal.portlet.test.jsp.PortalResponse; import org.jboss.portal.common.NotYetImplemented; = @@ -72,13 +72,13 @@ } else { - if (portalResponse instanceof PortalActionResponse) + if (portalResponse instanceof PortalPrepareResponse) { - return doStartActionTag((PortalActionResponse)portalResponse); + return doStartTag((PortalPrepareResponse)portalResponse); } else { - return doStartRenderTag((PortalRenderResponse)portalResponse); + return doStartTag((PortalRenderResponse)portalResponse); } } } @@ -96,13 +96,13 @@ // if (pageTag !=3D null && pageTag.status =3D=3D PageTag.Status.ACTIVE) { - if (portalResponse instanceof PortalActionResponse) + if (portalResponse instanceof PortalPrepareResponse) { - return doEndActionTag((PortalActionResponse)portalResponse); + return doEndTag((PortalPrepareResponse)portalResponse); } else { - return doEndRenderTag((PortalRenderResponse)portalResponse); + return doEndTag((PortalRenderResponse)portalResponse); } } else @@ -111,22 +111,22 @@ } } = - public int doStartActionTag(PortalActionResponse actionResponse) throws= JspException + public int doStartTag(PortalPrepareResponse prepareResponse) throws Jsp= Exception { throw new NotYetImplemented(); } = - public int doEndActionTag(PortalActionResponse actionResponse) throws J= spException + public int doEndTag(PortalPrepareResponse prepareResponse) throws JspEx= ception { throw new NotYetImplemented(); } = - public int doStartRenderTag(PortalRenderResponse renderResponse) throws= JspException + public int doStartTag(PortalRenderResponse renderResponse) throws JspEx= ception { throw new NotYetImplemented(); } = - public int doEndRenderTag(PortalRenderResponse renderResponse) throws J= spException + public int doEndTag(PortalRenderResponse renderResponse) throws JspExce= ption { throw new NotYetImplemented(); } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortalSimpleTagSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalSimpleTagSupport.java 2008-02-10 01:37:59 UTC (rev 9914) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalSimpleTagSupport.java 2008-02-10 02:16:32 UTC (rev 9915) @@ -24,7 +24,7 @@ = import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; import org.jboss.portal.portlet.test.jsp.PortalResponse; -import org.jboss.portal.portlet.test.jsp.PortalActionResponse; +import org.jboss.portal.portlet.test.jsp.PortalPrepareResponse; import org.jboss.portal.common.NotYetImplemented; = import javax.servlet.jsp.tagext.SimpleTagSupport; @@ -51,24 +51,27 @@ // if (pageTag !=3D null && pageTag.status =3D=3D PageTag.Status.ACTIVE) { - if (getPortalResponse() instanceof PortalActionResponse) + PortalResponse portalResponse =3D getPortalResponse(); + + // + if (portalResponse instanceof PortalPrepareResponse) { - doActionTag(); + doTag((PortalPrepareResponse)portalResponse); } else { - doRenderTag((PortalRenderResponse)getPortalResponse()); + doTag((PortalRenderResponse)portalResponse); } } } = - public void doActionTag() throws JspException, IOException + public void doTag(PortalPrepareResponse prepareResponse) throws JspExce= ption, IOException { throw new NotYetImplemented(); } = - public void doRenderTag(PortalRenderResponse renderResponse) throws Jsp= Exception, IOException + public void doTag(PortalRenderResponse renderResponse) throws JspExcept= ion, IOException { - super.doTag(); + throw new NotYetImplemented(); } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletMarkupTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletMarkupTag.java 2008-02-10 01:37:59 UTC (rev 9914) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletMarkupTag.java 2008-02-10 02:16:32 UTC (rev 9915) @@ -39,7 +39,7 @@ */ public class PortletMarkupTag extends PortalSimpleTagSupport { - public void doRenderTag(PortalRenderResponse renderResponse) throws Jsp= Exception, IOException + public void doTag(PortalRenderResponse renderResponse) throws JspExcept= ion, IOException { PortletTag portletTag =3D (PortletTag)SimpleTagSupport.findAncestorW= ithClass(this, PortletTag.class); = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-10 01:37:59 UTC (rev 9914) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-10 02:16:32 UTC (rev 9915) @@ -23,7 +23,7 @@ package org.jboss.portal.portlet.test.jsp.taglib; = import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; -import org.jboss.portal.portlet.test.jsp.PortalActionResponse; +import org.jboss.portal.portlet.test.jsp.PortalPrepareResponse; import org.jboss.portal.portlet.test.jsp.PortalResponse; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; @@ -209,21 +209,21 @@ this.windowId =3D null; } = - public int doStartActionTag(PortalActionResponse actionResponse) throws= JspException + public int doStartTag(PortalPrepareResponse prepareResponse) throws Jsp= Exception { - initState(actionResponse); + initState(prepareResponse); = // if (portlet !=3D null) { - actionResponse.addWindow(windowId, portlet); + prepareResponse.addWindow(windowId, portlet); } = // return SKIP_BODY; } = - public int doEndActionTag(PortalActionResponse actionResponse) throws J= spException + public int doEndTag(PortalPrepareResponse prepareResponse) throws JspEx= ception { destroyState(); = @@ -231,7 +231,7 @@ return EVAL_PAGE; } = - public int doStartRenderTag(PortalRenderResponse renderResponse) throws= JspException + public int doStartTag(PortalRenderResponse renderResponse) throws JspEx= ception { initState(renderResponse); = @@ -263,7 +263,7 @@ } } = - public int doEndRenderTag(PortalRenderResponse renderResponse) throws J= spException + public int doEndTag(PortalRenderResponse renderResponse) throws JspExce= ption { if (bodyContent !=3D null) { Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTitleTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTitleTag.java 2008-02-10 01:37:59 UTC (rev 9914) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTitleTag.java 2008-02-10 02:16:32 UTC (rev 9915) @@ -38,7 +38,7 @@ public class PortletTitleTag extends PortalSimpleTagSupport { = - public void doRenderTag(PortalRenderResponse renderResponse) throws Jsp= Exception, IOException + public void doTag(PortalRenderResponse renderResponse) throws JspExcept= ion, IOException { = PortletTag portletTag =3D (PortletTag)SimpleTagSupport.findAncestorW= ithClass(this, PortletTag.class); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-10 01:37:59 UTC (rev 9914) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-10 02:16:32 UTC (rev 9915) @@ -70,12 +70,12 @@ this.windowStateValue =3D windowState; } = - public int doStartRenderTag(PortalRenderResponse renderResponse) throws= JspException + public int doStartTag(PortalRenderResponse renderResponse) throws JspEx= ception { return EVAL_BODY_BUFFERED; } = - public int doEndRenderTag(PortalRenderResponse renderResponse) throws J= spException + public int doEndTag(PortalRenderResponse renderResponse) throws JspExce= ption { PagePortletControllerContext context =3D renderResponse.getPortletCo= ntrollerContext(); PortletTag portletTag =3D (PortletTag)SimpleTagSupport.findAncestorW= ithClass(this, PortletTag.class); --===============0588548740953442939==-- From portal-commits at lists.jboss.org Sat Feb 9 22:39:44 2008 Content-Type: multipart/mixed; boundary="===============3274569447271347716==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9916 - in modules/portlet/trunk/test/src/test/resources/simple-portal-war: css and 1 other directory. Date: Sat, 09 Feb 2008 22:38:04 -0500 Message-ID: --===============3274569447271347716== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-09 22:38:03 -0500 (Sat, 09 Feb 2008) New Revision: 9916 Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= jsp/error.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mast= er.css Log: error formatting and other css Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/jsp/error.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jsp/error.jsp 2008-02-10 02:16:32 UTC (rev 9915) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jsp/error.jsp 2008-02-10 03:38:03 UTC (rev 9916) @@ -1,21 +1,34 @@ -<%@ page language=3D"java" %> - +<%@ page language=3D"java" %>
    -

    <%=3D request.getAttribute("org.jboss.portal.portlet.po= rtal.error.portlet_name")%> +

    + ${requestScope['org.jboss.portal.portlet.portal.error.po= rtlet_name']} ${requestScope['org.jboss.portal.portlet.portal.error.status= '] =3D=3D 'not_found' ? ' not found' : ''}

    -

    Portlet was not rendered

    - Error status: <%=3D request.getAttribute("org.jboss.portal.po= rtlet.portal.error.status")%>
    - Portlet name: <%=3D request.getAttribute("org.jboss.portal.po= rtlet.portal.error.portlet_name")%>
    - Portlet application - name: <%=3D request.getAttribute("org.jboss.portal.portlet.po= rtal.error.application_name")%>
    - Exception: <%=3D request.getAttribute("org.jboss.portal.portl= et.portal.error.cause")%>
    - Window id: <%=3D request.getAttribute("org.jboss.portal.portl= et.portal.error.window_id")%>
    +

    Portlet was not rendered

    +
    +
      +
    • + Error status: ${requestScope['org.jboss.portal.po= rtlet.portal.error.status']} +
    • +
    • + Portlet name: ${requestScope['org.jboss.portal.po= rtlet.portal.error.portlet_name']} +
    • +
    • + Portlet application name: ${requestScope['org.jbo= ss.portal.portlet.portal.error.application_name']} +
    • +
    • + Exception: ${!empty requestScope['org.jboss.porta= l.portlet.portal.error.cause'] ? requestScope['org.jboss.portal.portlet.por= tal.error.cause'] : 'Error cause unavailable'} +
    • +
    • + Window id: ${requestScope['org.jboss.portal.portl= et.portal.error.window_id']} +
    • +
    +
    =
    Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/c= ss/master.css =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-10 02:16:32 UTC (rev 9915) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-10 03:38:03 UTC (rev 9916) @@ -118,7 +118,7 @@ } = a { - color: #e1d77e; + color: #666666; } = p { @@ -179,7 +179,7 @@ background-repeat: repeat-x; background-position: top left; text-decoration:none; - font: bold 11px Lucida Sans, Trebuchet, tahoma, sans-serif; + font: bold 11px; } = div#container div.nav ul li a{ @@ -215,7 +215,6 @@ div#container div#content div.portlet-frame{ background-color: #fff; border: 1px solid #fff; - /*height: 500px;*/ } = div#container div#content div.portlet div.header { @@ -246,4 +245,40 @@ div#container div#content div.portlet div.header div.header-layer div.cont= rols span.mode-button{ text-align: right; padding: 0 5px 0 0; -} \ No newline at end of file +} + +div#container div#content div.portlet div.header div.header-layer div.cont= rols span.mode-button a { + color: #e1d77e; + font: normal 11px; + text-decoration:none; +} + +/*----------------------------------Error portlet*/ + +div.error-container { + padding: 5px; + background-color: #fff; +} + +h3.error-header { + background-color: #cc1100; + color: #fff; + padding: 3px; +} + +div.error-container ul { + list-style: none; + list-style-position: inside; +} + +div.error-container ul li { + padding: 3px 0 3px 0; + border-bottom: 1px solid #777777; +} + +div.error-container ul li span { + font-weight: bold; + color: #cc1100 +} + + --===============3274569447271347716==-- From portal-commits at lists.jboss.org Sat Feb 9 23:31:21 2008 Content-Type: multipart/mixed; boundary="===============0985329618478659102==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9917 - in modules/portlet/trunk/test/src: test/resources/simple-portal-war/WEB-INF/jsp and 1 other directories. Date: Sat, 09 Feb 2008 23:31:21 -0500 Message-ID: --===============0985329618478659102== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-09 23:31:21 -0500 (Sat, 09 Feb 2008) New Revision: 9917 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/RemoteControlResourcePortlet.java modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= jsp/error.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mast= er.css Log: remote control cleanup Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /portal/samples/RemoteControlResourcePortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/RemoteControlResourcePortlet.java 2008-02-10 03:38:03 UTC (rev 99= 16) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/RemoteControlResourcePortlet.java 2008-02-10 04:31:21 UTC (rev 99= 17) @@ -42,23 +42,27 @@ { resourceResponse.setContentType("text/html"); PrintWriter writer =3D resourceResponse.getWriter(); - writer.print(""); + writer.print("" + + ""); PortletURL url =3D resourceResponse.createRenderURL(); url.setWindowState(WindowState.MINIMIZED); - writer.print(""); + writer.print("
    • 'zipcode' public render parameter = value: " + resourceRequest.getParameter(ZIPCODE) + "
      "); + writer.print("Set value of 'zipcode' public render parameter = to:
    • "); url.setParameter(ZIPCODE, "80201"); - writer.print(""); + writer.print("
    "); } = private String createParentURL(PortletURL url) Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/jsp/error.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jsp/error.jsp 2008-02-10 03:38:03 UTC (rev 9916) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jsp/error.jsp 2008-02-10 04:31:21 UTC (rev 9917) @@ -1,4 +1,5 @@ <%@ page language=3D"java" %> +
    Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/c= ss/master.css =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-10 03:38:03 UTC (rev 9916) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-10 04:31:21 UTC (rev 9917) @@ -281,4 +281,24 @@ color: #cc1100 } = +/*-------------------------------------Remote Window*/ = +div.remote-container { + padding: 8px 0 0 0; +} + +div.remote-container ul { + list-style: none; + list-style-position: inside; + width: 90%; + margin: 0 auto 0 auto; +} + +div.remote-container ul li { + padding: 3px 0 3px 0; + border-bottom: 1px solid #777777; +} + +div.remote-container ul li a { + color: #332299 = +} --===============0985329618478659102==-- From portal-commits at lists.jboss.org Sun Feb 10 08:47:07 2008 Content-Type: multipart/mixed; boundary="===============1288735348785809688==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9918 - in modules/portlet/trunk: test/src/main/java/org/jboss/portal/portlet/test/jsp and 1 other directories. Date: Sun, 10 Feb 2008 08:47:05 -0500 Message-ID: --===============1288735348785809688== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-10 08:47:05 -0500 (Sun, 10 Feb 2008) New Revision: 9918 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PageParameterDef.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortletResult.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/WindowDef.java Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/impl/state/PageNavigationalStateImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PageEventControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PagePortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalPrepareResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalRenderResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PageParamTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletMarkupTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletURLTag.java Log: make portlet rendering ahead of JSP rendering (between prepare and render p= hases of portal) Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/impl/state/PageNavigationalStateImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/state/PageNavigationalStateImpl.java 2008-02-10 04:31:21 U= TC (rev 9917) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/state/PageNavigationalStateImpl.java 2008-02-10 13:47:05 U= TC (rev 9918) @@ -123,7 +123,8 @@ = public String[] getPublicNavigationalState(QName name) { - return page.get(name).clone(); + String[] values =3D page.get(name); + return values !=3D null ? values.clone() : null; } = public void setWindowNavigationalState(String windowId, WindowNavigatio= nalState windowState) Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-10 04:31:21 UTC (rev 9917) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-10 13:47:05 UTC (rev 9918) @@ -88,13 +88,13 @@ PortletInvoker invoker =3D (PortletInvoker)getServletContext().getAt= tribute("ConsumerPortletInvoker"); = // - PortalPrepareResponse prepareResponse =3D new PortalPrepareResponse(= resp, invoker); + PortalPrepareResponse prepareResponse =3D new PortalPrepareResponse(= resp); = // Discover existing portlets on the page (introspection phase) chain.doFilter(req, prepareResponse); = // Now we can create a populated context - PagePortletControllerContext context =3D new PagePortletControllerCo= ntext(req, resp, getServletContext(), prepareResponse); + PagePortletControllerContext context =3D new PagePortletControllerCo= ntext(req, resp, invoker, getServletContext(), prepareResponse); = // PageNavigationalState pageState =3D null; @@ -235,7 +235,7 @@ } = // - PortalRenderResponse renderResponse =3D new PortalRenderResponse(res= p, invoker, context, pageState); + PortalRenderResponse renderResponse =3D new PortalRenderResponse(res= p, context, pageState, prepareResponse); = // chain.doFilter(req, renderResponse); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PageEventControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PageEventControllerContext.java 2008-02-10 04:31:21 UTC (rev 9917) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PageEventControllerContext.java 2008-02-10 13:47:05 UTC (rev 9918) @@ -25,6 +25,7 @@ import org.jboss.portal.portlet.controller.event.EventControllerContext; import org.jboss.portal.portlet.controller.event.Event; import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.info.PortletInfo; = import java.util.List; @@ -43,8 +44,14 @@ /** . */ private final PortalPrepareResponse prepareResponse; = - public PageEventControllerContext(PortalPrepareResponse prepareResponse) + /** . */ + private final PagePortletControllerContext context; + + public PageEventControllerContext( + PagePortletControllerContext context, + PortalPrepareResponse prepareResponse) { + this.context =3D context; this.prepareResponse =3D prepareResponse; } = @@ -55,16 +62,26 @@ // for (String windowId : prepareResponse.getWindowIds()) { - Portlet portlet =3D prepareResponse.getPortlet(windowId); + try + { + Portlet portlet =3D context.getPortlet(windowId); = - // - PortletInfo portletInfo =3D portlet.getInfo(); + // + if (portlet !=3D null) + { + PortletInfo portletInfo =3D portlet.getInfo(); = - // - if (portletInfo.getEventing().getConsumedEvents().containsKey(pro= ducedEvent.getName())) + // + if (portletInfo.getEventing().getConsumedEvents().containsK= ey(producedEvent.getName())) + { + Event consumedEvent =3D new Event(producedEvent.getName(= ), producedEvent.getPayload(), windowId); + consumedEvents.add(consumedEvent); + } + } + } + catch (PortletInvokerException e) { - Event consumedEvent =3D new Event(producedEvent.getName(), pro= ducedEvent.getPayload(), windowId); - consumedEvents.add(consumedEvent); + e.printStackTrace(); } } = Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/PageParameterDef.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PageParameterDef.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PageParameterDef.java 2008-02-10 13:47:05 UTC (rev 9918) @@ -0,0 +1,64 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp; + +import javax.xml.namespace.QName; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PageParameterDef +{ + + /** . */ + private QName name; + + /** . */ + private String value; + + /** . */ + private boolean frozen; + + public PageParameterDef(QName name, String value, boolean frozen) + { + this.name =3D name; + this.value =3D value; + this.frozen =3D frozen; + } + + public QName getName() + { + return name; + } + + public String getValue() + { + return value; + } + + public boolean isFrozen() + { + return frozen; + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PagePortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-10 04:31:21 UTC (rev 9917) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-10 13:47:05 UTC (rev 9918) @@ -24,6 +24,8 @@ = import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.PortletInvoker; +import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.controller.event.EventControllerContext; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; @@ -35,6 +37,8 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; +import java.util.HashMap; = /** * @author Julien Viet @@ -49,9 +53,16 @@ /** . */ private final PortalPrepareResponse prepareResponse; = + /** . */ + private final Map portlets; + + /** . */ + private final PortletInvoker invoker; + public PagePortletControllerContext( HttpServletRequest req, HttpServletResponse resp, + PortletInvoker invoker, ServletContext servletContext, PortalPrepareResponse prepareResponse) throws IllegalRequestException, IOException, ServletException, Portl= etInvokerException @@ -59,22 +70,78 @@ super(req, resp, servletContext); = // + Map portlets =3D new HashMap(); + for (Portlet portlet : invoker.getPortlets()) + { + PortletInfo portletInfo =3D portlet.getInfo(); + String portletName =3D portletInfo.getName(); + String applicationName =3D portletInfo.getApplicationName(); + Key key =3D new Key(applicationName, portletName); + portlets.put(key, portlet); + } + + // + this.invoker =3D invoker; + this.portlets =3D portlets; this.prepareResponse =3D prepareResponse; - this.eventControllerContext =3D new PageEventControllerContext(prepa= reResponse); + this.eventControllerContext =3D new PageEventControllerContext(this,= prepareResponse); } = + public Portlet findPortlet(String applicationName, String portletName) + { + return portlets.get(new Key(applicationName, portletName)); + } + protected Portlet getPortlet(String windowId) throws PortletInvokerExce= ption { - return prepareResponse.getPortlet(windowId); + WindowDef windowDef =3D prepareResponse.getWindowDef(windowId); + + // + return findPortlet(windowDef.getApplicationName(), windowDef.getPort= letName()); } = public PortletInvocationResponse invoke(PortletInvocation invocation) t= hrows PortletInvokerException { - return prepareResponse.getInvoker().invoke(invocation); + return invoker.invoke(invocation); } = public EventControllerContext getEventControllerContext() { return eventControllerContext; } + + private static class Key + { + + /** . */ + private final String applicationName; + + /** . */ + private final String portletName; + + private Key(String applicationName, String portletName) + { + this.applicationName =3D applicationName; + this.portletName =3D portletName; + } + + public boolean equals(Object obj) + { + if (obj =3D=3D this) + { + return true; + } + if (obj instanceof Key) + { + Key that =3D (Key)obj; + return applicationName.equals(that.applicationName) && portlet= Name.equals(that.portletName); + } + return false; + } + + public int hashCode() + { + return applicationName.hashCode() + portletName.hashCode(); + } + } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PortalPrepareResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalPrepareResponse.java 2008-02-10 04:31:21 UTC (rev 9917) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalPrepareResponse.java 2008-02-10 13:47:05 UTC (rev 9918) @@ -22,13 +22,12 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp; = -import org.jboss.portal.portlet.Portlet; -import org.jboss.portal.portlet.PortletInvoker; import org.jboss.portal.portlet.PortletInvokerException; = import javax.servlet.http.HttpServletResponse; import javax.servlet.http.Cookie; import javax.servlet.ServletOutputStream; +import javax.xml.namespace.QName; import java.io.IOException; import java.io.PrintWriter; import java.io.Writer; @@ -63,31 +62,50 @@ private PrintWriter writer; = /** . */ - private Map windows; + private Map windowDefs; = - public PortalPrepareResponse(HttpServletResponse response, PortletInvok= er invoker) throws PortletInvokerException + /** . */ + private Map paramDefs; + + public PortalPrepareResponse(HttpServletResponse response) throws Portl= etInvokerException { - super(response, invoker); + super(response); = // - this.windows =3D new HashMap(); + this.windowDefs =3D new HashMap(); + this.paramDefs =3D new HashMap(); } = - public void addWindow(String windowId, Portlet portlet) + public Set getWindowIds() { - windows.put(windowId, portlet); + return windowDefs.keySet(); } = - public Set getWindowIds() + public WindowDef getWindowDef(String windowId) { - return windows.keySet(); + return windowDefs.get(windowId); } = - public Portlet getPortlet(String windowId) + public void addWindowDef(String windowId, WindowDef portlet) { - return windows.get(windowId); + windowDefs.put(windowId, portlet); } = + public Set getPageParameterNames() + { + return paramDefs.keySet(); + } + + public PageParameterDef getPageParameterDef(QName name) + { + return paramDefs.get(name); + } + + public void setPageParameterDef(PageParameterDef parameterDef) + { + paramDefs.put(parameterDef.getName(), parameterDef); + } + public ServletOutputStream getOutputStream() throws IOException { if (writer !=3D null) Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PortalRenderResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalRenderResponse.java 2008-02-10 04:31:21 UTC (rev 9917) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalRenderResponse.java 2008-02-10 13:47:05 UTC (rev 9918) @@ -24,6 +24,7 @@ = import org.jboss.portal.portlet.test.controller.TestInstanceContext; import org.jboss.portal.portlet.test.controller.TestPortalContext; +import org.jboss.portal.portlet.test.jsp.PortletResult; import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; @@ -31,7 +32,6 @@ import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.PortletInvoker; import org.jboss.portal.portlet.impl.spi.AbstractClientContext; import org.jboss.portal.portlet.impl.spi.AbstractServerContext; import org.jboss.portal.portlet.impl.spi.AbstractUserContext; @@ -44,6 +44,9 @@ = import javax.servlet.http.HttpServletResponse; import javax.xml.namespace.QName; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; = /** * @author Julien Viet @@ -55,24 +58,46 @@ /** . */ private PageNavigationalState pageState; = - /** Wether or not the page state can be modified. */ - private boolean pageStateModifiable; - /** . */ private PagePortletControllerContext portletControllerContext; = + /** . */ + private Map windowResults; + public PortalRenderResponse( HttpServletResponse response, - PortletInvoker invoker, PagePortletControllerContext portletControllerContext, - PageNavigationalState pageState) throws PortletInvokerException + PageNavigationalState pageState, + PortalPrepareResponse prepareResponse) throws PortletInvokerException { - super(response, invoker); + super(response); = // + Set pageParameterNames =3D prepareResponse.getPageParameterNa= mes(); + if (pageParameterNames.size() > 0) + { + if (pageState =3D=3D null) + { + pageState =3D portletControllerContext.getStateControllerConte= xt().createPageState(true); + } + for (QName parameterName : pageParameterNames) + { + PageParameterDef parameterDef =3D prepareResponse.getPageParam= eterDef(parameterName); + boolean update =3D parameterDef.isFrozen() ? true : pageState.= getPublicNavigationalState(parameterName) =3D=3D null; + if (update) + { + pageState.setPublicNavigationalState(parameterName, new Str= ing[]{parameterDef.getValue()}); + } + } + } + + // + this.portletControllerContext =3D portletControllerContext; + this.windowResults =3D new HashMap(); this.pageState =3D pageState; - this.pageStateModifiable =3D true; - this.portletControllerContext =3D portletControllerContext; + + // + render(prepareResponse); } = /** @@ -85,12 +110,17 @@ return pageState; } = + public PortletResult getWindowResult(String windowId) + { + return windowResults.get(windowId); + } + public PagePortletControllerContext getPortletControllerContext() { return portletControllerContext; } = - public PortletInvocationResponse render(Portlet portlet, String windowI= d) throws PortletInvokerException + private PortletInvocationResponse render(Portlet portlet, String window= Id) throws PortletInvokerException { WindowNavigationalState windowNS =3D null; if (pageState !=3D null) @@ -144,36 +174,41 @@ render.setPublicNavigationalState(publicNS); = // - pageStateModifiable =3D false; - - // return portletControllerContext.invoke(render); } = - public boolean isPageStateModifiable() + private void render(PortalPrepareResponse prepareResponse) { - return pageStateModifiable; - } + for (String windowId : prepareResponse.getWindowIds()) + { + WindowDef windowDef =3D prepareResponse.getWindowDef(windowId); = - public String getPageParameter(QName name) - { - return pageState !=3D null ? pageState.getPublicNavigationalState(na= me)[0] : null; - } + // + try + { + Portlet portlet =3D portletControllerContext.getPortlet(window= Id); = - public void setPageParameter(QName name, String value) - { - if (pageStateModifiable) - { - if (pageState =3D=3D null) + // + if (portlet !=3D null) + { + PortletInvocationResponse portletResponse =3D render(portle= t, windowId); + + // + PortletResult result =3D new PortletResult(windowDef, portl= etResponse); + + // + windowResults.put(windowId, result); + } + else + { + // log + } + } + catch (PortletInvokerException e) { - pageState =3D portletControllerContext.getStateControllerConte= xt().createPageState(true); + e.printStackTrace(); } - pageState.setPublicNavigationalState(name, new String[]{value}); } - else - { - throw new IllegalStateException("Page state cannot be modified"); - } } = public String getMaximizedWindowId() Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PortalResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalResponse.java 2008-02-10 04:31:21 UTC (rev 9917) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalResponse.java 2008-02-10 13:47:05 UTC (rev 9918) @@ -22,15 +22,10 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp; = -import org.jboss.portal.portlet.Portlet; -import org.jboss.portal.portlet.PortletInvoker; import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.info.PortletInfo; = import javax.servlet.http.HttpServletResponseWrapper; import javax.servlet.http.HttpServletResponse; -import java.util.Map; -import java.util.HashMap; = /** * Expose stuff common to action and render response. @@ -42,46 +37,13 @@ { = /** . */ - private final PortletInvoker invoker; - - /** . */ - private final Map portlets; - - /** . */ private int count =3D 0; = - public PortalResponse( - HttpServletResponse response, - PortletInvoker invoker) throws PortletInvokerException + public PortalResponse(HttpServletResponse response) throws PortletInvok= erException { super(response); - - // - Map portlets =3D new HashMap(); - for (Portlet portlet : invoker.getPortlets()) - { - PortletInfo portletInfo =3D portlet.getInfo(); - String portletName =3D portletInfo.getName(); - String applicationName =3D portletInfo.getApplicationName(); - Key key =3D new Key(applicationName, portletName); - portlets.put(key, portlet); - } - - // - this.portlets =3D portlets; - this.invoker =3D invoker; } = - public PortletInvoker getInvoker() - { - return invoker; - } - - public Portlet findPortlet(String applicationName, String portletName) - { - return portlets.get(new Key(applicationName, portletName)); - } - /** * todo : add on JSP portlet tag a notion of 'id', because this id gene= ration relies on the portlet * rendering order on the page which could not be the same between 2 re= quests. @@ -90,39 +52,4 @@ { return "" + count++; } - - private static class Key - { - - /** . */ - private final String applicationName; - - /** . */ - private final String portletName; - - private Key(String applicationName, String portletName) - { - this.applicationName =3D applicationName; - this.portletName =3D portletName; - } - - public boolean equals(Object obj) - { - if (obj =3D=3D this) - { - return true; - } - if (obj instanceof Key) - { - Key that =3D (Key)obj; - return applicationName.equals(that.applicationName) && portlet= Name.equals(that.portletName); - } - return false; - } - - public int hashCode() - { - return applicationName.hashCode() + portletName.hashCode(); - } - } } Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/jsp/PortletResult.java (from rev 9913, modules/portlet/trunk/test/src/m= ain/java/org/jboss/portal/portlet/test/jsp/taglib/PortletResult.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortletResult.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortletResult.java 2008-02-10 13:47:05 UTC (rev 9918) @@ -0,0 +1,59 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp; + +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.test.jsp.WindowDef; + +/** + * Combines the invocation of a portlet and the info on the portlet JSP ta= g. It does + * not need to be exposed out of this package. + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletResult +{ + + /** . */ + private final WindowDef windowDef; + + /** . */ + private final PortletInvocationResponse response; + + public PortletResult(WindowDef windowDef, PortletInvocationResponse res= ponse) + { + this.windowDef =3D windowDef; + this.response =3D response; + } + + public WindowDef getWindowDef() + { + return windowDef; + } + + public PortletInvocationResponse getResponse() + { + return response; + } +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/WindowDef.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/WindowDef.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/WindowDef.java 2008-02-10 13:47:05 UTC (rev 9918) @@ -0,0 +1,103 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp; + +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; + +import java.util.Set; + +/** + * Combines the invocation of a portlet and the info on the portlet JSP ta= g. It does + * not need to be exposed out of this package. + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class WindowDef +{ + + /** . */ + private final String portletName; + + /** . */ + private final String applicationName; + + /** . */ + private final String windowId; + + /** . */ + private final Mode initialMode; + + /** . */ + private final Set supportedModes; + + /** . */ + private final Set supportedWindowStates; + + public WindowDef( + String portletName, + String applicationName, + String windowId, + Mode initialMode, + Set supportedModes, + Set supportedWindowStates) + { + this.portletName =3D portletName; + this.applicationName =3D applicationName; + this.windowId =3D windowId; + this.initialMode =3D initialMode; + this.supportedModes =3D supportedModes; + this.supportedWindowStates =3D supportedWindowStates; + } + + public String getPortletName() + { + return portletName; + } + + public String getApplicationName() + { + return applicationName; + } + + public String getWindowId() + { + return windowId; + } + + public Mode getInitialMode() + { + return initialMode; + } + + public Set getSupportedModes() + { + return supportedModes; + } + + public Set getSupportedWindowStates() + { + return supportedWindowStates; + } +} \ No newline at end of file Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PageParamTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageParamTag.java 2008-02-10 04:31:21 UTC (rev 9917) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PageParamTag.java 2008-02-10 13:47:05 UTC (rev 9918) @@ -24,6 +24,7 @@ = import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; import org.jboss.portal.portlet.test.jsp.PortalPrepareResponse; +import org.jboss.portal.portlet.test.jsp.PageParameterDef; = import javax.servlet.jsp.JspException; import javax.xml.namespace.QName; @@ -37,76 +38,66 @@ { = /** . */ - private String namespaceURI; + private String namespaceURIAttr; = /** . */ - private String localName; + private String localNameAttr; = /** . */ - private String value; + private String valueAttr; = /** . */ - private String frozen; + private String frozenAttr; = public String getNamespaceURI() { - return namespaceURI; + return namespaceURIAttr; } = public void setNamespaceURI(String namespaceURI) { - this.namespaceURI =3D namespaceURI; + this.namespaceURIAttr =3D namespaceURI; } = public String getLocalName() { - return localName; + return localNameAttr; } = public void setLocalName(String localName) { - this.localName =3D localName; + this.localNameAttr =3D localName; } = public String getValue() { - return value; + return valueAttr; } = public void setValue(String value) { - this.value =3D value; + this.valueAttr =3D value; } = public String getFrozen() { - return frozen; + return frozenAttr; } = public void setFrozen(String frozen) { - this.frozen =3D frozen; + this.frozenAttr =3D frozen; } = public void doTag(PortalRenderResponse renderResponse) throws JspExcept= ion, IOException { - if (renderResponse.isPageStateModifiable()) - { - QName name =3D new QName(namespaceURI, localName); - - // - if ("true".equals(frozen)) - { - // - } - else if (renderResponse.getPageParameter(name) =3D=3D null) - { - renderResponse.setPageParameter(name, value); - } - } } = public void doTag(PortalPrepareResponse prepareResponse) throws JspExce= ption, IOException { + QName name =3D new QName(namespaceURIAttr, localNameAttr); + boolean frozen =3D "true".equals(frozenAttr); + PageParameterDef parameterDef =3D new PageParameterDef(name, valueAt= tr, frozen); + prepareResponse.setPageParameterDef(parameterDef); } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletMarkupTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletMarkupTag.java 2008-02-10 04:31:21 UTC (rev 9917) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletMarkupTag.java 2008-02-10 13:47:05 UTC (rev 9918) @@ -55,7 +55,7 @@ WindowNavigationalState windowNS =3D null; if (renderResponse.getPageState() !=3D null) { - windowNS =3D renderResponse.getPageState().getWindowNavigat= ionalState(portletTag.result.getWindowId()); + windowNS =3D renderResponse.getPageState().getWindowNavigat= ionalState(portletTag.result.getWindowDef().getWindowId()); } if (windowNS =3D=3D null || !windowNS.getWindowState().equals(= WindowState.MINIMIZED)) { @@ -77,13 +77,13 @@ } else { - out.write(portletResp.getClass().getSimpleName() + "[" + portl= etTag.result.getPortletName() + "," + portletTag.result.getApplicationName(= ) + "]"); + out.write(portletResp.getClass().getSimpleName() + "[" + portl= etTag.result.getWindowDef().getPortletName() + "," + portletTag.result.getW= indowDef().getApplicationName() + "]"); out.flush(); } } else { - out.write("Empty[" + portletTag.result.getPortletName() + "," + p= ortletTag.result.getApplicationName() + "]"); + out.write("Empty[" + portletTag.result.getWindowDef().getPortletN= ame() + "," + portletTag.result.getWindowDef().getApplicationName() + "]"); out.flush(); } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-10 04:31:21 UTC (rev 9917) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-10 13:47:05 UTC (rev 9918) @@ -25,12 +25,12 @@ import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; import org.jboss.portal.portlet.test.jsp.PortalPrepareResponse; import org.jboss.portal.portlet.test.jsp.PortalResponse; +import org.jboss.portal.portlet.test.jsp.WindowDef; +import org.jboss.portal.portlet.test.jsp.PortletResult; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.ErrorResponse; import org.jboss.portal.portlet.invocation.response.UnavailableResponse; -import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.Portlet; import org.jboss.portal.Mode; import org.jboss.portal.WindowState; import org.jboss.portal.common.util.Tools; @@ -79,10 +79,8 @@ private Set supportedModes; private Mode initialMode; private PageTag pageTag; - private Portlet portlet; private String windowId; = - /** . */ PortletResult result; = public String getName() @@ -185,9 +183,6 @@ } = // - Portlet portlet =3D portalResponse.findPortlet(applicationNameAttr, = nameAttr); - - // String windowId =3D portalResponse.nextId(); = // @@ -195,7 +190,6 @@ this.supportedModes =3D supportedModes; this.supportedWindowStates =3D supportedWindowStates; this.pageTag =3D (PageTag)findAncestorWithClass(this, PageTag.class); - this.portlet =3D portlet; this.windowId =3D windowId; } = @@ -205,7 +199,6 @@ this.supportedModes =3D null; this.supportedWindowStates =3D null; this.pageTag =3D null; - this.portlet =3D null; this.windowId =3D null; } = @@ -214,12 +207,12 @@ initState(prepareResponse); = // - if (portlet !=3D null) - { - prepareResponse.addWindow(windowId, portlet); - } + WindowDef windowDef =3D new WindowDef(nameAttr, applicationNameAttr,= windowId, initialMode, supportedModes, supportedWindowStates); = // + prepareResponse.addWindowDef(windowId, windowDef); + + // return SKIP_BODY; } = @@ -236,7 +229,10 @@ initState(renderResponse); = // - if (portlet =3D=3D null) + PortletResult result =3D renderResponse.getWindowResult(windowId); + + // + if (result =3D=3D null || result.getResponse() =3D=3D null) { handleError(renderResponse, Constants.NOT_FOUND, null, null); = @@ -249,7 +245,7 @@ { if (windowId.equals(pageTag.maximizedId)) { - return render(renderResponse, EVAL_BODY_BUFFERED); + return render(renderResponse, result, EVAL_BODY_BUFFERED); } else { @@ -258,7 +254,7 @@ } else { - return render(renderResponse, EVAL_BODY_INCLUDE); + return render(renderResponse, result, EVAL_BODY_INCLUDE); } } } @@ -277,55 +273,37 @@ return EVAL_PAGE; } = - public int render(PortalRenderResponse renderResponse, int rt) + public int render(PortalRenderResponse renderResponse, PortletResult re= sult, int rt) { - try + PortletInvocationResponse portletResponse =3D result.getResponse(); + + // + if (portletResponse instanceof FragmentResponse) { - PortletInvocationResponse portletResponse =3D renderResponse.rend= er(portlet, windowId); + this.result =3D result; + // + return rt; + } + else if (portletResponse instanceof ErrorResponse) + { + ErrorResponse error =3D (ErrorResponse)portletResponse; = // - if (portletResponse instanceof FragmentResponse) - { - result =3D new PortletResult( - nameAttr, - applicationNameAttr, - windowId, - portletResponse, - initialMode, - supportedModes, - supportedWindowStates); + handleError(renderResponse, Constants.PORTLET_ERROR, error.getCau= se(), error.getMessage()); = - // - return rt; - } - else if (portletResponse instanceof ErrorResponse) - { - ErrorResponse error =3D (ErrorResponse)portletResponse; + // + return SKIP_BODY; + } + else if (portletResponse instanceof UnavailableResponse) + { + handleError(renderResponse, Constants.UNAVAILABLE, null, null); = - // - handleError(renderResponse, Constants.PORTLET_ERROR, error.get= Cause(), error.getMessage()); - - // - return SKIP_BODY; - } - else if (portletResponse instanceof UnavailableResponse) - { - handleError(renderResponse, Constants.UNAVAILABLE, null, null); - - // - return SKIP_BODY; - } - else - { - handleError(renderResponse, Constants.INTERNAL_ERROR, null, nu= ll); - - // - return SKIP_BODY; - } + // + return SKIP_BODY; } - catch (PortletInvokerException e) + else { - handleError(renderResponse, Constants.INTERNAL_ERROR, e, e.getMes= sage()); + handleError(renderResponse, Constants.INTERNAL_ERROR, null, null); = // return SKIP_BODY; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-10 04:31:21 UTC (rev 9917) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-10 13:47:05 UTC (rev 9918) @@ -130,7 +130,7 @@ try { JspWriter out =3D pageContext.getOut(); - String renderedURL =3D renderer.renderURL(portletTag.result.getWi= ndowId(), url, null, null, true); + String renderedURL =3D renderer.renderURL(portletTag.result.getWi= ndowDef().getWindowId(), url, null, null, true); out.write(renderedURL); } catch (IOException e) --===============1288735348785809688==-- From portal-commits at lists.jboss.org Sun Feb 10 08:49:29 2008 Content-Type: multipart/mixed; boundary="===============1244519276842085386==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9919 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp: taglib and 1 other directory. Date: Sun, 10 Feb 2008 08:49:29 -0500 Message-ID: --===============1244519276842085386== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-10 08:49:29 -0500 (Sun, 10 Feb 2008) New Revision: 9919 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/WindowResult.java Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletResult.java Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalRenderResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTag.java Log: rename Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PortalRenderResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalRenderResponse.java 2008-02-10 13:47:05 UTC (rev 9918) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalRenderResponse.java 2008-02-10 13:49:29 UTC (rev 9919) @@ -24,7 +24,7 @@ = import org.jboss.portal.portlet.test.controller.TestInstanceContext; import org.jboss.portal.portlet.test.controller.TestPortalContext; -import org.jboss.portal.portlet.test.jsp.PortletResult; +import org.jboss.portal.portlet.test.jsp.WindowResult; import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; @@ -62,7 +62,7 @@ private PagePortletControllerContext portletControllerContext; = /** . */ - private Map windowResults; + private Map windowResults; = public PortalRenderResponse( HttpServletResponse response, @@ -93,7 +93,7 @@ = // this.portletControllerContext =3D portletControllerContext; - this.windowResults =3D new HashMap(); + this.windowResults =3D new HashMap(); this.pageState =3D pageState; = // @@ -110,7 +110,7 @@ return pageState; } = - public PortletResult getWindowResult(String windowId) + public WindowResult getWindowResult(String windowId) { return windowResults.get(windowId); } @@ -194,7 +194,7 @@ PortletInvocationResponse portletResponse =3D render(portle= t, windowId); = // - PortletResult result =3D new PortletResult(windowDef, portl= etResponse); + WindowResult result =3D new WindowResult(windowDef, portlet= Response); = // windowResults.put(windowId, result); Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/jsp/WindowResult.java (from rev 9918, modules/portlet/trunk/test/src/ma= in/java/org/jboss/portal/portlet/test/jsp/PortletResult.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/WindowResult.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/WindowResult.java 2008-02-10 13:49:29 UTC (rev 9919) @@ -0,0 +1,59 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp; + +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.test.jsp.WindowDef; + +/** + * Combines the invocation of a portlet and the info on the portlet JSP ta= g. It does + * not need to be exposed out of this package. + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class WindowResult +{ + + /** . */ + private final WindowDef windowDef; + + /** . */ + private final PortletInvocationResponse response; + + public WindowResult(WindowDef windowDef, PortletInvocationResponse resp= onse) + { + this.windowDef =3D windowDef; + this.response =3D response; + } + + public WindowDef getWindowDef() + { + return windowDef; + } + + public PortletInvocationResponse getResponse() + { + return response; + } +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/taglib/PortletResult.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletResult.java 2008-02-10 13:47:05 UTC (rev 9918) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletResult.java 2008-02-10 13:49:29 UTC (rev 9919) @@ -1,114 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp.taglib; - -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; -import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; - -import java.util.Set; - -/** - * Combines the invocation of a portlet and the info on the portlet JSP ta= g. It does - * not need to be exposed out of this package. - * - * @author Julien Viet - * @version $Revision: 630 $ - */ -class PortletResult -{ - - /** . */ - private final String portletName; - - /** . */ - private final String applicationName; - - /** . */ - private final String windowId; - - /** . */ - private final PortletInvocationResponse response; - - /** . */ - private final Mode initialMode; - - /** . */ - private final Set supportedModes; - - /** . */ - private final Set supportedWindowStates; - - public PortletResult( - String portletName, - String applicationName, - String windowId, - PortletInvocationResponse response, - Mode initialMode, - Set supportedModes, - Set supportedWindowStates) - { - this.portletName =3D portletName; - this.applicationName =3D applicationName; - this.windowId =3D windowId; - this.response =3D response; - this.initialMode =3D initialMode; - this.supportedModes =3D supportedModes; - this.supportedWindowStates =3D supportedWindowStates; - } - - public String getPortletName() - { - return portletName; - } - - public String getApplicationName() - { - return applicationName; - } - - public String getWindowId() - { - return windowId; - } - - public PortletInvocationResponse getResponse() - { - return response; - } - - public Mode getInitialMode() - { - return initialMode; - } - - public Set getSupportedModes() - { - return supportedModes; - } - - public Set getSupportedWindowStates() - { - return supportedWindowStates; - } -} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-10 13:47:05 UTC (rev 9918) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-10 13:49:29 UTC (rev 9919) @@ -26,7 +26,7 @@ import org.jboss.portal.portlet.test.jsp.PortalPrepareResponse; import org.jboss.portal.portlet.test.jsp.PortalResponse; import org.jboss.portal.portlet.test.jsp.WindowDef; -import org.jboss.portal.portlet.test.jsp.PortletResult; +import org.jboss.portal.portlet.test.jsp.WindowResult; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.ErrorResponse; @@ -81,7 +81,7 @@ private PageTag pageTag; private String windowId; = - PortletResult result; + WindowResult result; = public String getName() { @@ -229,7 +229,7 @@ initState(renderResponse); = // - PortletResult result =3D renderResponse.getWindowResult(windowId); + WindowResult result =3D renderResponse.getWindowResult(windowId); = // if (result =3D=3D null || result.getResponse() =3D=3D null) @@ -273,7 +273,7 @@ return EVAL_PAGE; } = - public int render(PortalRenderResponse renderResponse, PortletResult re= sult, int rt) + public int render(PortalRenderResponse renderResponse, WindowResult res= ult, int rt) { PortletInvocationResponse portletResponse =3D result.getResponse(); = --===============1244519276842085386==-- From portal-commits at lists.jboss.org Sun Feb 10 09:56:55 2008 Content-Type: multipart/mixed; boundary="===============0454578247960016139==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9920 - in modules/portlet/trunk/test/src: main/java/org/jboss/portal/portlet/test/jsp and 5 other directories. Date: Sun, 10 Feb 2008 09:56:49 -0500 Message-ID: --===============0454578247960016139== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-10 09:56:47 -0500 (Sun, 10 Feb 2008) New Revision: 9920 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/basic/HeaderPortlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/HeadersTag.java Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalRenderResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortalSimpleTagSupport.java modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/W= EB-INF/portlet.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= portal.tld modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o3.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= header.jsp Log: start to add support for headers, need to work on resource with a content t= ype different from text/html Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/po= rtal/samples/basic/HeaderPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/HeaderPortlet.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/HeaderPortlet.java 2008-02-10 14:56:47 UTC (rev 9920) @@ -0,0 +1,63 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.samples.basic; + +import org.w3c.dom.Element; + +import javax.portlet.GenericPortlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import javax.portlet.ResourceURL; +import java.io.IOException; +import java.io.PrintWriter; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class HeaderPortlet extends GenericPortlet +{ + public void render(RenderRequest req, RenderResponse resp) throws Portl= etException, IOException + { + ResourceURL resourceURL =3D resp.createResourceURL(); + + // + Element elt =3D resp.createElement("script"); + elt.setAttribute("type", "text/javascript"); + elt.setAttribute("src", resourceURL.toString()); + elt.appendChild(elt.getOwnerDocument().createTextNode("")); + resp.addProperty("script", elt); + } + + public void serveResource(ResourceRequest req, ResourceResponse resp) t= hrows PortletException, IOException + { +// String namespace =3Dresp.getNamespace(); + resp.setContentType("text/javascript"); + PrintWriter writer =3D resp.getWriter(); + writer.print("alert('shouldwork');"); + writer.close(); + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PortalRenderResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalRenderResponse.java 2008-02-10 13:49:29 UTC (rev 9919) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalRenderResponse.java 2008-02-10 14:56:47 UTC (rev 9920) @@ -110,6 +110,11 @@ return pageState; } = + public Set getWindowIds() + { + return windowResults.keySet(); + } + public WindowResult getWindowResult(String windowId) { return windowResults.get(windowId); @@ -211,6 +216,15 @@ } } = + public boolean isMaximizedWindow(String windowId) + { + if (windowId =3D=3D null) + { + throw new IllegalArgumentException(); + } + return windowId.equals(getMaximizedWindowId()); + } + public String getMaximizedWindowId() { if (pageState !=3D null) Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/jsp/taglib/HeadersTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/HeadersTag.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/HeadersTag.java 2008-02-10 14:56:47 UTC (rev 9920) @@ -0,0 +1,105 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.jsp.taglib; + +import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; +import org.jboss.portal.portlet.test.jsp.WindowResult; +import org.jboss.portal.portlet.test.jsp.PortalPrepareResponse; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.response.FragmentResponse; +import org.jboss.portal.portlet.invocation.response.ResponseProperties; +import org.jboss.portal.common.util.MultiValuedPropertyMap; +import org.jboss.portal.common.xml.XMLTools; +import org.w3c.dom.Element; + +import javax.servlet.jsp.JspException; +import java.io.IOException; +import java.util.List; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class HeadersTag extends PortalSimpleTagSupport +{ + + public HeadersTag() + { + super(false); + } + + public void doTag(PortalPrepareResponse prepareResponse) throws JspExce= ption, IOException + { + } + + public void doTag(PortalRenderResponse renderResponse) throws JspExcept= ion, IOException + { + String maxmizedWindowId =3D renderResponse.getMaximizedWindowId(); + + // + for (String windowId : renderResponse.getWindowIds()) + { + if (maxmizedWindowId =3D=3D null || maxmizedWindowId.equals(windo= wId)) + { + WindowResult result =3D renderResponse.getWindowResult(windowI= d); + + // + if (result !=3D null) + { + PortletInvocationResponse response =3D result.getResponse(); + + // + if (response instanceof FragmentResponse) + { + FragmentResponse fragmentResponse =3D (FragmentResponse)= response; + + // + ResponseProperties properties =3D fragmentResponse.getPr= operties(); + + // + if (properties !=3D null) + { + MultiValuedPropertyMap markupHeaders =3D pro= perties.getMarkupHeaders(); + for (String key : markupHeaders.keySet()) + { + List headElement =3D markupHeaders.getVal= ues(key); + for (Element headerValue : headElement) + { + try + { + String serializedElement =3D XMLTools.toStri= ng(headerValue); + getJspContext().getOut().print(serializedEle= ment); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + } + } + } + } + } + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortalSimpleTagSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalSimpleTagSupport.java 2008-02-10 13:49:29 UTC (rev 9919) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalSimpleTagSupport.java 2008-02-10 14:56:47 UTC (rev 9920) @@ -38,19 +38,49 @@ */ public class PortalSimpleTagSupport extends SimpleTagSupport { + + private final boolean pageScoped; + + public PortalSimpleTagSupport() + { + this(true); + } + + public PortalSimpleTagSupport(boolean pageScoped) + { + this.pageScoped =3D pageScoped; + } + + public boolean isPageScoped() + { + return pageScoped; + } + private PortalResponse getPortalResponse() { PageContext pageContext =3D (PageContext)getJspContext(); return (PortalResponse)pageContext.getResponse(); } = - public final void doTag() throws JspException, IOException + protected final boolean isActive() { - PageTag pageTag =3D (PageTag)findAncestorWithClass(this, PageTag.cla= ss); + if (pageScoped) + { + PageTag pageTag =3D (PageTag)findAncestorWithClass(this, PageTag.= class); = - // - if (pageTag !=3D null && pageTag.status =3D=3D PageTag.Status.ACTIVE) + // + return pageTag !=3D null && pageTag.status =3D=3D PageTag.Status.= ACTIVE; + } + else { + return false; + } + } + + public final void doTag() throws JspException, IOException + { + if (isActive()) + { PortalResponse portalResponse =3D getPortalResponse(); = // Modified: modules/portlet/trunk/test/src/test/resources/portal/samples/basi= c-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/= WEB-INF/portlet.xml 2008-02-10 13:49:29 UTC (rev 9919) +++ modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/= WEB-INF/portlet.xml 2008-02-10 14:56:47 UTC (rev 9920) @@ -38,4 +38,16 @@ = + + HeaderPortlet + org.jboss.portal.portlet.portal.samples.basic.HeaderP= ortlet + + text/html + text/javascript + + + HeaderPortlet + + + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/portal.tld =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.tld 2008-02-10 13:49:29 UTC (rev 9919) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.tld 2008-02-10 14:56:47 UTC (rev 9920) @@ -127,4 +127,10 @@ = + + headers + org.jboss.portal.portlet.test.jsp.taglib.HeadersTag + empty + + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/demo3.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo3.jsp 2008-02-10 13:49:29 UTC (rev 9919) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo3.jsp 2008-02-10 14:56:47 UTC (rev 9920) @@ -17,6 +17,7 @@ + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/l= ayouts/header.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /header.jsp 2008-02-10 13:49:29 UTC (rev 9919) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /header.jsp 2008-02-10 14:56:47 UTC (rev 9920) @@ -1,3 +1,4 @@ +<%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> Portlet Container 2.0 + = --===============0454578247960016139==-- From portal-commits at lists.jboss.org Sun Feb 10 10:10:18 2008 Content-Type: multipart/mixed; boundary="===============7556551689944450955==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9921 - in modules/portlet/trunk/test/src: test/resources/portal/samples/basic-war/WEB-INF and 1 other directory. Date: Sun, 10 Feb 2008 10:10:15 -0500 Message-ID: --===============7556551689944450955== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-10 10:10:14 -0500 (Sun, 10 Feb 2008) New Revision: 9921 Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortletResult.java Modified: modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/W= EB-INF/portlet.xml Log: PortletResult should have been removed Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/jsp/PortletResult.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortletResult.java 2008-02-10 14:56:47 UTC (rev 9920) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortletResult.java 2008-02-10 15:10:14 UTC (rev 9921) @@ -1,59 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test.jsp; - -import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.test.jsp.WindowDef; - -/** - * Combines the invocation of a portlet and the info on the portlet JSP ta= g. It does - * not need to be exposed out of this package. - * - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class PortletResult -{ - - /** . */ - private final WindowDef windowDef; - - /** . */ - private final PortletInvocationResponse response; - - public PortletResult(WindowDef windowDef, PortletInvocationResponse res= ponse) - { - this.windowDef =3D windowDef; - this.response =3D response; - } - - public WindowDef getWindowDef() - { - return windowDef; - } - - public PortletInvocationResponse getResponse() - { - return response; - } -} Modified: modules/portlet/trunk/test/src/test/resources/portal/samples/basi= c-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/= WEB-INF/portlet.xml 2008-02-10 14:56:47 UTC (rev 9920) +++ modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/= WEB-INF/portlet.xml 2008-02-10 15:10:14 UTC (rev 9921) @@ -22,10 +22,10 @@ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. = ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~--> = - + xsi:schemaLocation=3D"http://java.sun.com/xml/ns/portlet/port= let-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" + version=3D"2.0"> = ExceptionPortlet @@ -43,8 +43,10 @@ org.jboss.portal.portlet.portal.samples.basic.HeaderP= ortlet text/html - text/javascript + + text/javascript + HeaderPortlet --===============7556551689944450955==-- From portal-commits at lists.jboss.org Sun Feb 10 12:54:36 2008 Content-Type: multipart/mixed; boundary="===============1306568004285210663==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9922 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/spi and 4 other directories. Date: Sun, 10 Feb 2008 12:51:38 -0500 Message-ID: --===============1306568004285210663== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-10 12:51:37 -0500 (Sun, 10 Feb 2008) New Revision: 9922 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/MimeResponseImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi= /PortletInvocationContext.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr168/api/portletcontext/ServerInfoTestCase.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/basic/HeaderPortlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/AbstractPortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortalSimpleTagSupport.java Log: - make javascript serveable from a resource - fix a bug in the portal side that was not sending the correct window id d= uring the different life cycle phase and so the getNamespace() value was no= t correct in render/resource Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/MimeResponseImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/MimeResponseImpl.java 2008-02-10 15:10:14 UTC (rev 9921) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/MimeResponseImpl.java 2008-02-10 17:51:37 UTC (rev 9922) @@ -28,9 +28,12 @@ import org.jboss.portal.portlet.invocation.response.RevalidateMarkupRespon= se; import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.info.CacheInfo; +import org.jboss.portal.portlet.info.CapabilitiesInfo; +import org.jboss.portal.portlet.info.ModeInfo; import org.jboss.portal.portlet.cache.CacheScope; import org.jboss.portal.common.util.MediaType; import org.jboss.portal.common.util.ContentInfo; +import org.jboss.portal.Mode; = import javax.portlet.MimeResponse; import javax.portlet.PortletURL; @@ -41,6 +44,7 @@ import java.io.IOException; import java.io.OutputStream; import java.util.Locale; +import java.util.Set; = /** * @author Julien Viet @@ -119,17 +123,36 @@ MediaType requestedMediaType =3D MediaType.parseMimeType(contentT= ype); = // Get the response media type - ContentInfo info =3D invocation.getContext().getMarkupInfo(); - MediaType responseMediaType =3D info.getContentType(); +// ContentInfo info =3D invocation.getContext().getMarkupInfo(); +// MediaType responseMediaType =3D info.getContentType(); = // Check if the requested media type is allowed as a subtype of t= he main response - if (!responseMediaType.isAllowedSubType(requestedMediaType)) +// if (!responseMediaType.isAllowedSubType(requestedMediaType)) +// { +// throw new IllegalArgumentException("Content type not accepte= d"); +// } + + // + Mode currentMode =3D preq.invocation.getMode(); + + PortletInfo info =3D preq.container.getInfo(); + CapabilitiesInfo capabilities =3D info.getCapabilities(); + Set compatibleModes =3D capabilities.getModes(contentTy= pe); + for (ModeInfo modeInfo : compatibleModes) { - throw new IllegalArgumentException("Content type not accepted"= ); + if (currentMode.equals(modeInfo.getMode())) + { + // Set the content type + fragment.setContentType(contentType); + + // + return; + } } = - // Set the content type - fragment.setContentType(contentType); + // + throw new IllegalArgumentException("Mime type " + contentType + "= not accepted as content type"); + } catch (MimeTypeParseException e) { Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/spi/PortletInvocationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sp= i/PortletInvocationContext.java 2008-02-10 15:10:14 UTC (rev 9921) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sp= i/PortletInvocationContext.java 2008-02-10 17:51:37 UTC (rev 9922) @@ -40,6 +40,8 @@ { = /** + * todo : move me to client content // see if it is still needed with C= C/PP + * * Return information about the underlying http wire this invocation is= performed. * * @return the stream info Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr168/api/portletcontext/ServerInfoTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/api/portletcontext/ServerInfoTestCase.java 2008-02-10 15:10:14 UT= C (rev 9921) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/api/portletcontext/ServerInfoTestCase.java 2008-02-10 17:51:37 UT= C (rev 9922) @@ -46,7 +46,7 @@ { = /** . */ - private static final String VERSION_REGEX =3D "JBossPortal/[0-9]+\\.[0-= 9]+"; + private static final String VERSION_REGEX =3D "JBossPortletContainer/[0= -9]+\\.[0-9]+"; = /** . */ private static final Pattern VERSION_PATTERN =3D Pattern.compile(VERSIO= N_REGEX, Pattern.CASE_INSENSITIVE); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /portal/samples/basic/HeaderPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/HeaderPortlet.java 2008-02-10 15:10:14 UTC (rev 9921) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/HeaderPortlet.java 2008-02-10 17:51:37 UTC (rev 9922) @@ -50,14 +50,19 @@ elt.setAttribute("src", resourceURL.toString()); elt.appendChild(elt.getOwnerDocument().createTextNode("")); resp.addProperty("script", elt); + + // + resp.setContentType("text/html"); + PrintWriter writer =3D resp.getWriter(); + writer.print("Click me to trigger script"); } = public void serveResource(ResourceRequest req, ResourceResponse resp) t= hrows PortletException, IOException { -// String namespace =3Dresp.getNamespace(); + String namespace =3Dresp.getNamespace(); resp.setContentType("text/javascript"); PrintWriter writer =3D resp.getWriter(); - writer.print("alert('shouldwork');"); + writer.print("function " + namespace + "_handle() { alert('Some ale= rt'); }"); writer.close(); } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/AbstractPortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-10 15:10:14 UTC (r= ev 9921) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-10 17:51:37 UTC (r= ev 9922) @@ -318,7 +318,7 @@ actionInvocation.setServerContext(new AbstractServerContext(req, res= p)); actionInvocation.setInstanceContext(instanceContext); actionInvocation.setUserContext(new AbstractUserContext(req)); - actionInvocation.setWindowContext(new AbstractWindowContext(portlet.= getContext().getId())); + actionInvocation.setWindowContext(new AbstractWindowContext(windowId= )); actionInvocation.setPortalContext(new TestPortalContext()); actionInvocation.setSecurityContext(new AbstractSecurityContext(req)= ); actionInvocation.setRequestContext(new AbstractRequestContext(req)); @@ -355,7 +355,7 @@ resourceInvocation.setServerContext(new AbstractServerContext(req, r= esp)); resourceInvocation.setInstanceContext(instanceContext); resourceInvocation.setUserContext(new AbstractUserContext(req)); - resourceInvocation.setWindowContext(new AbstractWindowContext(portle= t.getContext().getId())); + resourceInvocation.setWindowContext(new AbstractWindowContext(window= Id)); resourceInvocation.setPortalContext(new TestPortalContext()); resourceInvocation.setSecurityContext(new AbstractSecurityContext(re= q)); resourceInvocation.setRequestContext(new AbstractRequestContext(req)= ); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortalSimpleTagSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalSimpleTagSupport.java 2008-02-10 15:10:14 UTC (rev 9921) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortalSimpleTagSupport.java 2008-02-10 17:51:37 UTC (rev 9922) @@ -73,7 +73,7 @@ } else { - return false; + return true; } } = --===============1306568004285210663==-- From portal-commits at lists.jboss.org Sun Feb 10 15:44:22 2008 Content-Type: multipart/mixed; boundary="===============2419788438530767426==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9923 - modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo. Date: Sun, 10 Feb 2008 15:44:22 -0500 Message-ID: --===============2419788438530767426== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-10 15:44:21 -0500 (Sun, 10 Feb 2008) New Revision: 9923 Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/hom= e.jsp Log: home page did not have the right portlet ref Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/home.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/ho= me.jsp 2008-02-10 17:51:37 UTC (rev 9922) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/ho= me.jsp 2008-02-10 20:44:21 UTC (rev 9923) @@ -9,7 +9,7 @@
    - +

    Demo Page Title

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et --===============2419788438530767426==-- From portal-commits at lists.jboss.org Sun Feb 10 17:20:29 2008 Content-Type: multipart/mixed; boundary="===============3066782397418488712==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9924 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp. Date: Sun, 10 Feb 2008 17:20:27 -0500 Message-ID: --===============3066782397418488712== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-10 17:20:27 -0500 (Sun, 10 Feb 2008) New Revision: 9924 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalPrepareResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalRenderResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalResponse.java Log: create better window ids in portal demo (request URI + sequence number) Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-10 20:44:21 UTC (rev 9923) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-10 22:20:27 UTC (rev 9924) @@ -88,7 +88,7 @@ PortletInvoker invoker =3D (PortletInvoker)getServletContext().getAt= tribute("ConsumerPortletInvoker"); = // - PortalPrepareResponse prepareResponse =3D new PortalPrepareResponse(= resp); + PortalPrepareResponse prepareResponse =3D new PortalPrepareResponse(= req, resp); = // Discover existing portlets on the page (introspection phase) chain.doFilter(req, prepareResponse); @@ -235,7 +235,7 @@ } = // - PortalRenderResponse renderResponse =3D new PortalRenderResponse(res= p, context, pageState, prepareResponse); + PortalRenderResponse renderResponse =3D new PortalRenderResponse(req= , resp, context, pageState, prepareResponse); = // chain.doFilter(req, renderResponse); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PortalPrepareResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalPrepareResponse.java 2008-02-10 20:44:21 UTC (rev 9923) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalPrepareResponse.java 2008-02-10 22:20:27 UTC (rev 9924) @@ -26,6 +26,7 @@ = import javax.servlet.http.HttpServletResponse; import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; import javax.servlet.ServletOutputStream; import javax.xml.namespace.QName; import java.io.IOException; @@ -67,9 +68,9 @@ /** . */ private Map paramDefs; = - public PortalPrepareResponse(HttpServletResponse response) throws Portl= etInvokerException + public PortalPrepareResponse(HttpServletRequest request, HttpServletRes= ponse response) throws PortletInvokerException { - super(response); + super(request, response); = // this.windowDefs =3D new HashMap(); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PortalRenderResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalRenderResponse.java 2008-02-10 20:44:21 UTC (rev 9923) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalRenderResponse.java 2008-02-10 22:20:27 UTC (rev 9924) @@ -43,6 +43,7 @@ import org.jboss.portal.common.util.ParameterMap; = import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpServletRequest; import javax.xml.namespace.QName; import java.util.Map; import java.util.HashMap; @@ -65,12 +66,13 @@ private Map windowResults; = public PortalRenderResponse( + HttpServletRequest request, HttpServletResponse response, PagePortletControllerContext portletControllerContext, PageNavigationalState pageState, PortalPrepareResponse prepareResponse) throws PortletInvokerException { - super(response); + super(request, response); = // Set pageParameterNames =3D prepareResponse.getPageParameterNa= mes(); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PortalResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalResponse.java 2008-02-10 20:44:21 UTC (rev 9923) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalResponse.java 2008-02-10 22:20:27 UTC (rev 9924) @@ -26,6 +26,7 @@ = import javax.servlet.http.HttpServletResponseWrapper; import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpServletRequest; = /** * Expose stuff common to action and render response. @@ -39,9 +40,19 @@ /** . */ private int count =3D 0; = - public PortalResponse(HttpServletResponse response) throws PortletInvok= erException + /** . */ + private final String pageId; + + public PortalResponse(HttpServletRequest request, HttpServletResponse r= esponse) throws PortletInvokerException { super(response); + + // We don't keep a ref to the request since this will be used mainly= during in a dispatch to a JSP + // and the info returned by a request after a dispatch are not the s= ame than before (like the path info). + String pageId =3D request.getRequestURI(); + + // + this.pageId =3D pageId; } = /** @@ -50,6 +61,6 @@ */ public String nextId() { - return "" + count++; + return pageId + "/" + count++; } } --===============3066782397418488712==-- From portal-commits at lists.jboss.org Sun Feb 10 17:38:02 2008 Content-Type: multipart/mixed; boundary="===============8492981546570372873==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9925 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Sun, 10 Feb 2008 17:38:01 -0500 Message-ID: --===============8492981546570372873== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-10 17:38:01 -0500 (Sun, 10 Feb 2008) New Revision: 9925 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: 5.2.1.4. Application Descriptors changing itemizedlist to variabelist Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-10 22:20:27 UTC (rev 9924) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-10 22:38:01 UTC (rev 9925) @@ -393,49 +393,57 @@ default.default page, and specify where it should appea= r on that page. - - - - - defa= ult.default]]> - Tells the portal where this portlet shoul= d appear. In this case, - default.default specif= ies that this portlet should appear in the - portal instance named default and the page named - default. - - - - - overw= rite]]> - Instructs the portal to overwrite or keep= this object if it already exists. - Possible values are overwrite or keep. - overwrite will destroy= the existing object and create a new one - based on the content of the deployment. <= literal>keep will maintain the - existing object deployment or create a ne= w one if it does not yet exist. - - - - - Hel= loWorldPortletWindow]]> - Can be named anything. - - - - - He= lloWorldPortletInstance]]> - The value of instance-ref must match the value of one of the + + default.default]]> + + + + Tells the portal where this portlet should appear. In this case, default.default specifies that this portlet shoul= d appear in the portal instance named default and the pa= ge named + default. + + + +overwrite]]> + + + + Instructs the portal to overwrite or keep this object if it already exis= ts. Possible values are overwrite or keep. overwrite will destroy the existing object and cre= ate a new one based on the content of the deployment. keep will maintain the existing object deployment or create a new one if it d= oes not yet exist. + + + +HelloWorldPortletWindow]]> + + + + Can be named anything. + + + +HelloWorldPortletInstance]]> + + + + The value of instance-ref must match the value of one= of the instance-id found in <= literal>portlet-instances.xml. - - - - - center -1]]> - Specify the layout region and order this = window will be found on the portal page. - - - - + + + +center +1]]> + + + + Specify the layout region and order this window will be found on the por= tal page. + + + + + = To illustrate the relationship between the descriptors, we = have provided this simple diagram --===============8492981546570372873==-- From portal-commits at lists.jboss.org Sun Feb 10 17:38:05 2008 Content-Type: multipart/mixed; boundary="===============2520208405075492044==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9926 - modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontrol-portlet-war/WEB-INF. Date: Sun, 10 Feb 2008 17:38:04 -0500 Message-ID: --===============2520208405075492044== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-10 17:38:04 -0500 (Sun, 10 Feb 2008) New Revision: 9926 Modified: modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontr= ol-portlet-war/WEB-INF/portlet.xml Log: - Shortened title so that it doesn't mess the layout up :) Modified: modules/portlet/trunk/test/src/test/resources/portal/samples/remo= tecontrol-portlet-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portal/samples/remotecont= rol-portlet-war/WEB-INF/portlet.xml 2008-02-10 22:38:01 UTC (rev 9925) +++ modules/portlet/trunk/test/src/test/resources/portal/samples/remotecont= rol-portlet-war/WEB-INF/portlet.xml 2008-02-10 22:38:04 UTC (rev 9926) @@ -28,14 +28,14 @@ Portlet controlling display of other portlets RemoteControl - Remote Control Resource Portlet + Remote Control Portlet org.jboss.portal.portlet.portal.samples.RemoteControl= ResourcePortlet text/html VIEW - Remote Control Resource Portlet + Remote Control Portlet sample,resource,remotecontrol zipcode --===============2520208405075492044==-- From portal-commits at lists.jboss.org Sun Feb 10 18:16:05 2008 Content-Type: multipart/mixed; boundary="===============5768551095363921232==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9927 - in modules/portlet/trunk/test/src: test/resources/portal/samples/remotecontrol-portlet-war/WEB-INF and 1 other directory. Date: Sun, 10 Feb 2008 18:14:25 -0500 Message-ID: --===============5768551095363921232== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-10 18:14:25 -0500 (Sun, 10 Feb 2008) New Revision: 9927 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/RemoteControlResourcePortlet.java modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontr= ol-portlet-war/WEB-INF/portlet.xml Log: - Added interaction with preferences but doesn't work yet (preference value= is not written)... Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /portal/samples/RemoteControlResourcePortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/RemoteControlResourcePortlet.java 2008-02-10 22:38:04 UTC (rev 99= 26) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/RemoteControlResourcePortlet.java 2008-02-10 23:14:25 UTC (rev 99= 27) @@ -23,6 +23,8 @@ public class RemoteControlResourcePortlet extends GenericPortlet { private static final String ZIPCODE =3D "zipcode"; + private static int COLOR_INDEX =3D 0; + private static final String[] COLORS =3D {"000", "f00", "0f0", "00f", "= ff0", "0ff", "f0f", "fff"}; = @Override protected void doView(RenderRequest renderRequest, RenderResponse rende= rResponse) throws PortletException, IOException @@ -30,11 +32,14 @@ renderResponse.setContentType("text/html"); PrintWriter printWriter =3D renderResponse.getWriter(); printWriter.print(""); + "window.open(url, 'jbp_remote', 'width=3D400,height=3D300,scrolla= ble=3Dyes')}"); printWriter.print("

    Open remote control!

    "); + String color =3D renderRequest.getPreferences().getValue("color", "0= 00"); + printWriter.print("

    Preferred color:  

    "); } = @Override @@ -42,6 +47,7 @@ { resourceResponse.setContentType("text/html"); PrintWriter writer =3D resourceResponse.getWriter(); + resourceRequest.getPreferences().setValue("color", COLORS[COLOR_INDE= X++ % 8]); writer.print("" + ""); PortletURL url =3D resourceResponse.createRenderURL(); Modified: modules/portlet/trunk/test/src/test/resources/portal/samples/remo= tecontrol-portlet-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portal/samples/remotecont= rol-portlet-war/WEB-INF/portlet.xml 2008-02-10 22:38:04 UTC (rev 9926) +++ modules/portlet/trunk/test/src/test/resources/portal/samples/remotecont= rol-portlet-war/WEB-INF/portlet.xml 2008-02-10 23:14:25 UTC (rev 9927) @@ -38,6 +38,13 @@ Remote Control Portlet sample,resource,remotecontrol + + + color + ffe + false + + zipcode
    = --===============5768551095363921232==-- From portal-commits at lists.jboss.org Sun Feb 10 18:26:51 2008 Content-Type: multipart/mixed; boundary="===============1479437558858109190==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9928 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Sun, 10 Feb 2008 18:26:50 -0500 Message-ID: --===============1479437558858109190== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-10 18:26:50 -0500 (Sun, 10 Feb 2008) New Revision: 9928 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: 5.2.1.4. Application Descriptors adding an itemizedlist to describe what the example object.xml file does Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-10 23:14:25 UTC (rev 9927) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-10 23:26:50 UTC (rev 9928) @@ -321,7 +321,7 @@ <mime-type> element, which is required for ever= y portlet. The declared MIME types must match the capability of the portlet.
    - As well, it allows you to pair which modes and window states are support= ed for each markup type. All portlets must support the VIEW portlet mode, s= o this does not have to be decared. Define which markup type your porlet su= pports, which in this examepl is text/html. This section= tells the portal that it will only output text and HTML, and that it only = supports the VIEW mode. + As well, it allows you to pair which modes and window states are support= ed for each markup type. All portlets must support the VIEW portlet mode, s= o this does not have to be declared. Use <mime-type> to define which markup type your portlet supports, which in this example= , is text/html. This section tells the portal that it wi= ll only output text and HTML, and that it only supports the VIEW mode. @@ -357,16 +357,45 @@ - This is a JBoss Portal specific descriptor that allows you to create inst= ances of portlets. The + This is a JBoss Portal specific descriptor, that allows you to create ins= tances of portlets. The <portlet-ref> value must match the <= portlet-name> value given in the HelloWorldPortlet/WEB-INF/portlet.xml f= ile. The <instance-id> value can be named anything, but it must match the instance-ref<= /literal> values given - in *-object.xml files as we shall below. + in the *-object.xml files, which in this example, woul= d be HelloWorldPortlet/WEB-INF/helloworld-object.xml, = as shown below. - The following is an example helloworld-object.xml fi= le: + The *-object.xml files are JBoss Portal specific descr= iptors that allow users to + define the structure of their portal instances, as well as create and con= figure their windows and + pages. In this example: + + + + a portlet window is created. + + + + + it is specified that it will display the markup generated by the HelloWorldPortletInstance portlet instance. + + + + + the window is assinged to the default.default page. + + + + + specify where the window will appear on the page, by the <region> element. + + + + + + The following is an example HelloWorldPortlet/WEB-INF file: + + ]]> + -*-object.xml files are JBoss Portal specific descriptor= s and allow users to -define the structure of their portal instances as well as create/configure= their windows and -pages. In our example, we create a portlet window, specify that it will di= splay the markup -generated by the HelloWorldPortletInstance portlet inst= ance, assign it to the -default.default page, and specify where it should appea= r on that page. - - default.default]]> --===============1479437558858109190==-- From portal-commits at lists.jboss.org Sun Feb 10 18:55:18 2008 Content-Type: multipart/mixed; boundary="===============6196933519102914061==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9929 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Sun, 10 Feb 2008 18:55:18 -0500 Message-ID: --===============6196933519102914061== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-10 18:55:18 -0500 (Sun, 10 Feb 2008) New Revision: 9929 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: 5.2.1.4. Application Descriptors move paragraph, minor spelling corrections Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-10 23:26:50 UTC (rev 9928) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-10 23:55:18 UTC (rev 9929) @@ -338,7 +338,13 @@ - The following is an example of the HelloWorldPortlet/WEB-INF/po= rtlet-instances.xml file: + + The HelloWorldPortlet/WEB-INF/portlet-instances.xml= file is a JBoss Portal specific descriptor, that allows you to create inst= ances of portlets. The + <portlet-ref> value must match the <= ;portlet-name> value + given in the HelloWorldPortlet/WEB-INF/portlet.xml = file. The <instance-id> + value can be named anything, but it must match the <instance= -ref> values given + in the *-object.xml files, which in this example, wou= ld be HelloWorldPortlet/WEB-INF/helloworld-object.xml. +The following is an example of the HelloWorldPortlet/WEB-= INF/portlet-instances.xml file: - This is a JBoss Portal specific descriptor, that allows you to create ins= tances of portlets. The - <portlet-ref> value must match the <= portlet-name> value - given in the HelloWorldPortlet/WEB-INF/portlet.xml f= ile. The <instance-id> - value can be named anything, but it must match the instance-ref<= /literal> values given - in the *-object.xml files, which in this example, woul= d be HelloWorldPortlet/WEB-INF/helloworld-object.xml, = as shown below. - - The *-object.xml files are JBoss Portal specific descr= iptors that allow users to define the structure of their portal instances, as well as create and con= figure their windows and - pages. In this example: + pages. In the following example: @@ -377,23 +376,23 @@ - it is specified that it will display the markup generated by the HelloWorldPortletInstance portlet instance. + specifies that it will display the markup generated by the He= lloWorldPortletInstance portlet instance. - the window is assinged to the default.default page. + the window is assigned to the default.default page. - specify where the window will appear on the page, by the <region> element. + specifies where the window will appear on the page, by the <region> element. - The following is an example HelloWorldPortlet/WEB-INF file: + The following is an example HelloWorldPortlet/WEB-INF/helloworl= d-object.xml file: --===============6196933519102914061==-- From portal-commits at lists.jboss.org Sun Feb 10 21:47:58 2008 Content-Type: multipart/mixed; boundary="===============8885246203895835885==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9930 - in modules/portlet/trunk/test/src/test/resources/simple-portal-war: WEB-INF/jsp and 5 other directories. Date: Sun, 10 Feb 2008 21:47:56 -0500 Message-ID: --===============8885246203895835885== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-10 21:47:55 -0500 (Sun, 10 Feb 2008) New Revision: 9930 Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/shad= owbox-light.css modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/shad= owbox.css modules/portlet/trunk/test/src/test/resources/simple-portal-war/images/l= oading-light.gif modules/portlet/trunk/test/src/test/resources/simple-portal-war/images/l= oading.gif modules/portlet/trunk/test/src/test/resources/simple-portal-war/images/o= verlay-85.png modules/portlet/trunk/test/src/test/resources/simple-portal-war/js/ modules/portlet/trunk/test/src/test/resources/simple-portal-war/js/proto= type.js modules/portlet/trunk/test/src/test/resources/simple-portal-war/js/scrip= taculous/ modules/portlet/trunk/test/src/test/resources/simple-portal-war/js/scrip= taculous/builder.js modules/portlet/trunk/test/src/test/resources/simple-portal-war/js/scrip= taculous/controls.js modules/portlet/trunk/test/src/test/resources/simple-portal-war/js/scrip= taculous/dragdrop.js modules/portlet/trunk/test/src/test/resources/simple-portal-war/js/scrip= taculous/effects.js modules/portlet/trunk/test/src/test/resources/simple-portal-war/js/scrip= taculous/scriptaculous.js modules/portlet/trunk/test/src/test/resources/simple-portal-war/js/scrip= taculous/slider.js modules/portlet/trunk/test/src/test/resources/simple-portal-war/js/scrip= taculous/sound.js modules/portlet/trunk/test/src/test/resources/simple-portal-war/js/scrip= taculous/unittest.js modules/portlet/trunk/test/src/test/resources/simple-portal-war/js/shado= wbox-prototype.js modules/portlet/trunk/test/src/test/resources/simple-portal-war/js/shado= wbox.js Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= jsp/error.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mast= er.css modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= header.jsp Log: added prototype, scriptaculous, and error modal Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/jsp/error.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jsp/error.jsp 2008-02-10 23:55:18 UTC (rev 9929) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jsp/error.jsp 2008-02-11 02:47:55 UTC (rev 9930) @@ -1,3 +1,5 @@ +<%@ page import=3D"org.jboss.portal.common.util.Exceptions" %> +<%@ page import=3D"java.io.PrintWriter" %> <%@ page language=3D"java" %> =
    @@ -25,6 +27,14 @@
  • Exception: ${!empty requestScope['org.jboss.porta= l.portlet.portal.error.cause'] ? requestScope['org.jboss.portal.portlet.por= tal.error.cause'] : 'Error cause unavailable'} + <%if (request.getAttribute("org.jboss.portal.portlet.portal.er= ror.cause") !=3D null){%> + ${!empty requestScope['org.jboss.portal= .portlet.portal.error.cause'] ? 'View Stack Trace' : ''} +
    +
    + <%=3DExceptions.toHTML((Throwable)request.getAttribute("= org.jboss.portal.portlet.portal.error.cause"))%> +
    +
    + <%}%>
  • Window id: ${requestScope['org.jboss.portal.portl= et.portal.error.window_id']} Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/c= ss/master.css =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-10 23:55:18 UTC (rev 9929) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-11 02:47:55 UTC (rev 9930) @@ -94,6 +94,10 @@ = } = +.hidden { + display: none; +} + /*--------------------------------Decoration*/ = h2 { @@ -281,6 +285,10 @@ color: #cc1100 } = +div.exception code{ + color: #33ff00; +} + /*-------------------------------------Remote Window*/ = div.remote-container { Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/= shadowbox-light.css =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/sha= dowbox-light.css (rev 0) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/sha= dowbox-light.css 2008-02-11 02:47:55 UTC (rev 9930) @@ -0,0 +1,211 @@ +/** + * The CSS for Shadowbox. + * + * This file is part of Shadowbox. + * + * Shadowbox is free software: you can redistribute it and/or modify it un= der + * the terms of the GNU Lesser General Public License as published by the = Free + * Software Foundation, either version 3 of the License, or (at your optio= n) + * any later version. + * + * Shadowbox is distributed in the hope that it will be useful, but WITHOU= T ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNE= SS + * 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 Shadowbox. If not, see . + * + * @author Michael J. I. Jackson + * @copyright 2007 Michael J. I. Jackson + * @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU LGPL 3.0 + * @version SVN: $Id: shadowbox.js 150 2007-12-04 18:42:03Z michael $ + */ + +/*_________________________________________________________________ Overl= ay */ +#shadowbox_overlay { + visibility: hidden; + position: absolute; + display: block; + margin: 0; + padding: 0; + top: 0; + left: 0; + z-index: 998; +} + +/*_______________________________________________________________ Contain= er */ +#shadowbox_container { + position: fixed; + height: 0px; + width: 100%; + margin: 0; + padding: 0; + top: 0; + left: 0; + z-index: 999; + text-align: center; /* centers in quirks and IE */ +} + +/*_______________________________________________________________ Shadowb= ox */ +#shadowbox { + visibility: hidden; + margin: 0 auto; + position: relative; + font-family: 'Lucida Grande', Tahoma, sans-serif; + text-align: left; /* reset left alignment */ + color: #888; +} + +/*___________________________________________________________________ Tit= le */ +/* +HTML snapshot: +
    +
    Title Here
    +
    +*/ +#shadowbox_title { + height: 30px; + padding: 0; + overflow: hidden; +} +#shadowbox_title_inner { + height: 16px; + font-size: 16px; + line-height: 16px; + white-space: nowrap; + padding: 10px 0 4px 10px; + background-color: #fff; +} + +/*____________________________________________________________________ Bo= dy */ +/* +HTML snapsnot: +
    +
    + +
    +
    +
    + Cancel +
    +
    +*/ +#shadowbox_body { + position: relative; + overflow: hidden; + margin: 0; + padding: 0; + border: 10px solid #fff; + background-color: #eee; +} +#shadowbox_body_inner { + position: relative; + overflow: hidden; +} +#shadowbox_loading { + position: absolute; + top: 0; + left: 0; + height: 10000px; /* overflow:hidden will clip this */ + width: 100%; + background-color: #ccc; +} +#shadowbox_loading img { + float: left; + margin: 10px 10px 0 10px; +} +#shadowbox_loading span { + float: left; + margin-top: 16px; + font-size: 10px; +} +#shadowbox_loading span a, +#shadowbox_loading span a:link, +#shadowbox_loading span a:visited { + color: #fff; +} +#shadowbox_content.html { /* make html content scrollable */ + height: 100%; + width: 100%; + overflow: auto; +} + +/*_________________________________________________________________ Toolb= ar */ +/* +HTML snapshot: +
    +
    +
    + C= lose +
    + +
    + Previous +
    +
    + 1 + 2 + 3 +
    +
    +
    +*/ +#shadowbox_toolbar { + margin: 0; + padding: 0; + height: 26px; + overflow: hidden; +} +#shadowbox_toolbar_inner { + height: 26px; + background-color: #fff; +} +#shadowbox_toolbar_inner div { + padding-top: 6px; + font-size: 10px; + height: 10px; + line-height: 10px; +} +#shadowbox_toolbar_inner div span.shortcut { + text-decoration: underline; + font-weight: bold; +} +#shadowbox_toolbar_inner div a { + text-decoration: none; + color: #888; +} +#shadowbox_nav_close, +#shadowbox_nav_previous, +#shadowbox_nav_next { + float: right; + padding-right: 10px; +} +#shadowbox_counter { + float: left; + padding-left: 10px; +} +#shadowbox_counter a { + padding: 0 4px 0 0; +} +#shadowbox_counter a.shadowbox_counter_current { + text-decoration: underline; + font-weight: bold; +} + +/*________________________________________________________________ Messag= es */ +div.shadowbox_message { + text-align: center; + padding: 10px; +} +div.shadowbox_message a:link, +div.shadowbox_message a:visited { + text-decoration: none; + color: #bed333; +} +div.shadowbox_message a:hover, +div.shadowbox_message a:focus { + text-decoration: underline; +} Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/= shadowbox.css =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/sha= dowbox.css (rev 0) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/sha= dowbox.css 2008-02-11 02:47:55 UTC (rev 9930) @@ -0,0 +1,212 @@ +/** + * The CSS for Shadowbox. + * + * This file is part of Shadowbox. + * + * Shadowbox is free software: you can redistribute it and/or modify it un= der + * the terms of the GNU Lesser General Public License as published by the = Free + * Software Foundation, either version 3 of the License, or (at your optio= n) + * any later version. + * + * Shadowbox is distributed in the hope that it will be useful, but WITHOU= T ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNE= SS + * 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 Shadowbox. If not, see . + * + * @author Michael J. I. Jackson + * @copyright 2007 Michael J. I. Jackson + * @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU LGPL 3.0 + * @version SVN: $Id: shadowbox.js 150 2007-12-04 18:42:03Z michael $ + */ + +/*_________________________________________________________________ Overl= ay */ +#shadowbox_overlay { + visibility: hidden; + position: absolute; + display: block; + margin: 0; + padding: 0; + top: 0; + left: 0; + z-index: 998; +} + +/*_______________________________________________________________ Contain= er */ +#shadowbox_container { + position: fixed; + height: 0px; + width: 100%; + margin: 0; + padding: 0; + top: 0; + left: 0; + z-index: 999; + text-align: center; /* centers in quirks and IE */ +} + +/*_______________________________________________________________ Shadowb= ox */ +#shadowbox { + visibility: hidden; + margin: 0 auto; + position: relative; + font-family: 'Lucida Grande', Tahoma, sans-serif; + text-align: left; /* reset left alignment */ +} + +/*___________________________________________________________________ Tit= le */ +/* +HTML snapshot: +
    +
    Title Here
    +
    +*/ +#shadowbox_title { + height: 25px; + padding: 0; + overflow: hidden; +} +#shadowbox_title_inner { + height: 16px; + font-size: 16px; + line-height: 16px; + white-space: nowrap; + padding: 5px 0 4px 8px; + color: #fff; +} + +/*____________________________________________________________________ Bo= dy */ +/* +HTML snapsnot: +
    +
    + +
    +
    + 3D"loading"
    + Cancel +
    +
  • +*/ +#shadowbox_body { + position: relative; + overflow: hidden; + margin: 0; + padding: 0; + border: 2px solid #fff; + background-color: #000; +} +#shadowbox_body_inner { + position: relative; + overflow: hidden; +} +#shadowbox_loading { + position: absolute; + top: 0; + left: 0; + height: 10000px; /* overflow:hidden will clip this */ + width: 100%; + background-color: #222; +} +#shadowbox_loading img { + float: left; + margin: 10px 10px 0 10px; +} +#shadowbox_loading span { + float: left; + margin-top: 16px; + font-size: 10px; +} +#shadowbox_loading span a, +#shadowbox_loading span a:link, +#shadowbox_loading span a:visited { + color: #fff; +} + +#shadowbox_content.html { /* make html content scrollable */ + height: 100%; + width: 100%; + overflow: auto; +} + +/*_________________________________________________________________ Toolb= ar */ +/* +HTML snapshot: +
    +
    +
    + C= lose +
    + +
    + Previous +
    +
    + 1 + 2 + 3 +
    +
    +
    +*/ +#shadowbox_toolbar { + margin: 0; + padding: 0; + height: 20px; + overflow: hidden; +} +#shadowbox_toolbar_inner { + height: 20px; + color: #fff; +} +#shadowbox_toolbar_inner div { + padding-top: 4px; + padding-bottom: 2px; + font-size: 10px; + height: 10px; + line-height: 10px; +} +#shadowbox_toolbar_inner div span.shortcut { + text-decoration: underline; + font-weight: bold; +} +#shadowbox_toolbar_inner div a { + text-decoration: none; + color: #fff; +} +#shadowbox_nav_close, +#shadowbox_nav_previous, +#shadowbox_nav_next { + float: right; + padding-right: 10px; +} +#shadowbox_counter { + float: left; + padding-left: 10px; +} +#shadowbox_counter a { + padding: 0 4px 0 0; +} +#shadowbox_counter a.shadowbox_counter_current { + text-decoration: underline; + font-weight: bold; +} + +/*________________________________________________________________ Messag= es */ +div.shadowbox_message { + text-align: center; + padding: 10px; +} +div.shadowbox_message a:link, +div.shadowbox_message a:visited { + text-decoration: none; + color: #bed333; +} +div.shadowbox_message a:hover, +div.shadowbox_message a:focus { + text-decoration: underline; +} Property changes on: modules/portlet/trunk/test/src/test/resources/simple-p= ortal-war/css/shadowbox.css ___________________________________________________________________ Name: svn:executable + * Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/imag= es/loading-light.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/test/src/test/resources/simple-p= ortal-war/images/loading-light.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/imag= es/loading.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/test/src/test/resources/simple-p= ortal-war/images/loading.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/imag= es/overlay-85.png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/test/src/test/resources/simple-p= ortal-war/images/overlay-85.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/js/p= rototype.js =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/js/prot= otype.js (rev 0) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/js/prot= otype.js 2008-02-11 02:47:55 UTC (rev 9930) @@ -0,0 +1,4221 @@ +/* Prototype JavaScript framework, version 1.6.0.2 + * (c) 2005-2008 Sam Stephenson + * + * Prototype is freely distributable under the terms of an MIT-style lice= nse. + * For details, see the Prototype web site: http://www.prototypejs.org/ + * + *------------------------------------------------------------------------= --*/ + +var Prototype =3D { + Version: '1.6.0.2', + + Browser: { + IE: !!(window.attachEvent && !window.opera), + Opera: !!window.opera, + WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1, + Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAge= nt.indexOf('KHTML') =3D=3D -1, + MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/) + }, + + BrowserFeatures: { + XPath: !!document.evaluate, + ElementExtensions: !!window.HTMLElement, + SpecificElementExtensions: + document.createElement('div').__proto__ && + document.createElement('div').__proto__ !=3D=3D + document.createElement('form').__proto__ + }, + + ScriptFragment: ']*>([\\S\\s]*?)<\/script>', + JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/, + + emptyFunction: function() { }, + K: function(x) { return x } +}; + +if (Prototype.Browser.MobileSafari) + Prototype.BrowserFeatures.SpecificElementExtensions =3D false; + + +/* Based on Alex Arnell's inheritance implementation. */ +var Class =3D { + create: function() { + var parent =3D null, properties =3D $A(arguments); + if (Object.isFunction(properties[0])) + parent =3D properties.shift(); + + function klass() { + this.initialize.apply(this, arguments); + } + + Object.extend(klass, Class.Methods); + klass.superclass =3D parent; + klass.subclasses =3D []; + + if (parent) { + var subclass =3D function() { }; + subclass.prototype =3D parent.prototype; + klass.prototype =3D new subclass; + parent.subclasses.push(klass); + } + + for (var i =3D 0; i < properties.length; i++) + klass.addMethods(properties[i]); + + if (!klass.prototype.initialize) + klass.prototype.initialize =3D Prototype.emptyFunction; + + klass.prototype.constructor =3D klass; + + return klass; + } +}; + +Class.Methods =3D { + addMethods: function(source) { + var ancestor =3D this.superclass && this.superclass.prototype; + var properties =3D Object.keys(source); + + if (!Object.keys({ toString: true }).length) + properties.push("toString", "valueOf"); + + for (var i =3D 0, length =3D properties.length; i < length; i++) { + var property =3D properties[i], value =3D source[property]; + if (ancestor && Object.isFunction(value) && + value.argumentNames().first() =3D=3D "$super") { + var method =3D value, value =3D Object.extend((function(m) { + return function() { return ancestor[m].apply(this, arguments) }; + })(property).wrap(method), { + valueOf: function() { return method }, + toString: function() { return method.toString() } + }); + } + this.prototype[property] =3D value; + } + + return this; + } +}; + +var Abstract =3D { }; + +Object.extend =3D function(destination, source) { + for (var property in source) + destination[property] =3D source[property]; + return destination; +}; + +Object.extend(Object, { + inspect: function(object) { + try { + if (Object.isUndefined(object)) return 'undefined'; + if (object =3D=3D=3D null) return 'null'; + return object.inspect ? object.inspect() : String(object); + } catch (e) { + if (e instanceof RangeError) return '...'; + throw e; + } + }, + + toJSON: function(object) { + var type =3D typeof object; + switch (type) { + case 'undefined': + case 'function': + case 'unknown': return; + case 'boolean': return object.toString(); + } + + if (object =3D=3D=3D null) return 'null'; + if (object.toJSON) return object.toJSON(); + if (Object.isElement(object)) return; + + var results =3D []; + for (var property in object) { + var value =3D Object.toJSON(object[property]); + if (!Object.isUndefined(value)) + results.push(property.toJSON() + ': ' + value); + } + + return '{' + results.join(', ') + '}'; + }, + + toQueryString: function(object) { + return $H(object).toQueryString(); + }, + + toHTML: function(object) { + return object && object.toHTML ? object.toHTML() : String.interpret(ob= ject); + }, + + keys: function(object) { + var keys =3D []; + for (var property in object) + keys.push(property); + return keys; + }, + + values: function(object) { + var values =3D []; + for (var property in object) + values.push(object[property]); + return values; + }, + + clone: function(object) { + return Object.extend({ }, object); + }, + + isElement: function(object) { + return object && object.nodeType =3D=3D 1; + }, + + isArray: function(object) { + return object !=3D null && typeof object =3D=3D "object" && + 'splice' in object && 'join' in object; + }, + + isHash: function(object) { + return object instanceof Hash; + }, + + isFunction: function(object) { + return typeof object =3D=3D "function"; + }, + + isString: function(object) { + return typeof object =3D=3D "string"; + }, + + isNumber: function(object) { + return typeof object =3D=3D "number"; + }, + + isUndefined: function(object) { + return typeof object =3D=3D "undefined"; + } +}); + +Object.extend(Function.prototype, { + argumentNames: function() { + var names =3D this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[= 1].split(",").invoke("strip"); + return names.length =3D=3D 1 && !names[0] ? [] : names; + }, + + bind: function() { + if (arguments.length < 2 && Object.isUndefined(arguments[0])) return t= his; + var __method =3D this, args =3D $A(arguments), object =3D args.shift(); + return function() { + return __method.apply(object, args.concat($A(arguments))); + } + }, + + bindAsEventListener: function() { + var __method =3D this, args =3D $A(arguments), object =3D args.shift(); + return function(event) { + return __method.apply(object, [event || window.event].concat(args)); + } + }, + + curry: function() { + if (!arguments.length) return this; + var __method =3D this, args =3D $A(arguments); + return function() { + return __method.apply(this, args.concat($A(arguments))); + } + }, + + delay: function() { + var __method =3D this, args =3D $A(arguments), timeout =3D args.shift(= ) * 1000; + return window.setTimeout(function() { + return __method.apply(__method, args); + }, timeout); + }, + + wrap: function(wrapper) { + var __method =3D this; + return function() { + return wrapper.apply(this, [__method.bind(this)].concat($A(arguments= ))); + } + }, + + methodize: function() { + if (this._methodized) return this._methodized; + var __method =3D this; + return this._methodized =3D function() { + return __method.apply(null, [this].concat($A(arguments))); + }; + } +}); + +Function.prototype.defer =3D Function.prototype.delay.curry(0.01); + +Date.prototype.toJSON =3D function() { + return '"' + this.getUTCFullYear() + '-' + + (this.getUTCMonth() + 1).toPaddedString(2) + '-' + + this.getUTCDate().toPaddedString(2) + 'T' + + this.getUTCHours().toPaddedString(2) + ':' + + this.getUTCMinutes().toPaddedString(2) + ':' + + this.getUTCSeconds().toPaddedString(2) + 'Z"'; +}; + +var Try =3D { + these: function() { + var returnValue; + + for (var i =3D 0, length =3D arguments.length; i < length; i++) { + var lambda =3D arguments[i]; + try { + returnValue =3D lambda(); + break; + } catch (e) { } + } + + return returnValue; + } +}; + +RegExp.prototype.match =3D RegExp.prototype.test; + +RegExp.escape =3D function(str) { + return String(str).replace(/([.*+?^=3D!:${}()|[\]\/\\])/g, '\\$1'); +}; + +/*------------------------------------------------------------------------= --*/ + +var PeriodicalExecuter =3D Class.create({ + initialize: function(callback, frequency) { + this.callback =3D callback; + this.frequency =3D frequency; + this.currentlyExecuting =3D false; + + this.registerCallback(); + }, + + registerCallback: function() { + this.timer =3D setInterval(this.onTimerEvent.bind(this), this.frequenc= y * 1000); + }, + + execute: function() { + this.callback(this); + }, + + stop: function() { + if (!this.timer) return; + clearInterval(this.timer); + this.timer =3D null; + }, + + onTimerEvent: function() { + if (!this.currentlyExecuting) { + try { + this.currentlyExecuting =3D true; + this.execute(); + } finally { + this.currentlyExecuting =3D false; + } + } + } +}); +Object.extend(String, { + interpret: function(value) { + return value =3D=3D null ? '' : String(value); + }, + specialChar: { + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '\\': '\\\\' + } +}); + +Object.extend(String.prototype, { + gsub: function(pattern, replacement) { + var result =3D '', source =3D this, match; + replacement =3D arguments.callee.prepareReplacement(replacement); + + while (source.length > 0) { + if (match =3D source.match(pattern)) { + result +=3D source.slice(0, match.index); + result +=3D String.interpret(replacement(match)); + source =3D source.slice(match.index + match[0].length); + } else { + result +=3D source, source =3D ''; + } + } + return result; + }, + + sub: function(pattern, replacement, count) { + replacement =3D this.gsub.prepareReplacement(replacement); + count =3D Object.isUndefined(count) ? 1 : count; + + return this.gsub(pattern, function(match) { + if (--count < 0) return match[0]; + return replacement(match); + }); + }, + + scan: function(pattern, iterator) { + this.gsub(pattern, iterator); + return String(this); + }, + + truncate: function(length, truncation) { + length =3D length || 30; + truncation =3D Object.isUndefined(truncation) ? '...' : truncation; + return this.length > length ? + this.slice(0, length - truncation.length) + truncation : String(this= ); + }, + + strip: function() { + return this.replace(/^\s+/, '').replace(/\s+$/, ''); + }, + + stripTags: function() { + return this.replace(/<\/?[^>]+>/gi, ''); + }, + + stripScripts: function() { + return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); + }, + + extractScripts: function() { + var matchAll =3D new RegExp(Prototype.ScriptFragment, 'img'); + var matchOne =3D new RegExp(Prototype.ScriptFragment, 'im'); + return (this.match(matchAll) || []).map(function(scriptTag) { + return (scriptTag.match(matchOne) || ['', ''])[1]; + }); + }, + + evalScripts: function() { + return this.extractScripts().map(function(script) { return eval(script= ) }); + }, + + escapeHTML: function() { + var self =3D arguments.callee; + self.text.data =3D this; + return self.div.innerHTML; + }, + + unescapeHTML: function() { + var div =3D new Element('div'); + div.innerHTML =3D this.stripTags(); + return div.childNodes[0] ? (div.childNodes.length > 1 ? + $A(div.childNodes).inject('', function(memo, node) { return memo+nod= e.nodeValue }) : + div.childNodes[0].nodeValue) : ''; + }, + + toQueryParams: function(separator) { + var match =3D this.strip().match(/([^?#]*)(#.*)?$/); + if (!match) return { }; + + return match[1].split(separator || '&').inject({ }, function(hash, pai= r) { + if ((pair =3D pair.split('=3D'))[0]) { + var key =3D decodeURIComponent(pair.shift()); + var value =3D pair.length > 1 ? pair.join('=3D') : pair[0]; + if (value !=3D undefined) value =3D decodeURIComponent(value); + + if (key in hash) { + if (!Object.isArray(hash[key])) hash[key] =3D [hash[key]]; + hash[key].push(value); + } + else hash[key] =3D value; + } + return hash; + }); + }, + + toArray: function() { + return this.split(''); + }, + + succ: function() { + return this.slice(0, this.length - 1) + + String.fromCharCode(this.charCodeAt(this.length - 1) + 1); + }, + + times: function(count) { + return count < 1 ? '' : new Array(count + 1).join(this); + }, + + camelize: function() { + var parts =3D this.split('-'), len =3D parts.length; + if (len =3D=3D 1) return parts[0]; + + var camelized =3D this.charAt(0) =3D=3D '-' + ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1) + : parts[0]; + + for (var i =3D 1; i < len; i++) + camelized +=3D parts[i].charAt(0).toUpperCase() + parts[i].substring= (1); + + return camelized; + }, + + capitalize: function() { + return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); + }, + + underscore: function() { + return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').g= sub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase(); + }, + + dasherize: function() { + return this.gsub(/_/,'-'); + }, + + inspect: function(useDoubleQuotes) { + var escapedString =3D this.gsub(/[\x00-\x1f\\]/, function(match) { + var character =3D String.specialChar[match[0]]; + return character ? character : '\\u00' + match[0].charCodeAt().toPad= dedString(2, 16); + }); + if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') += '"'; + return "'" + escapedString.replace(/'/g, '\\\'') + "'"; + }, + + toJSON: function() { + return this.inspect(true); + }, + + unfilterJSON: function(filter) { + return this.sub(filter || Prototype.JSONFilter, '#{1}'); + }, + + isJSON: function() { + var str =3D this; + if (str.blank()) return false; + str =3D this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''); + return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str); + }, + + evalJSON: function(sanitize) { + var json =3D this.unfilterJSON(); + try { + if (!sanitize || json.isJSON()) return eval('(' + json + ')'); + } catch (e) { } + throw new SyntaxError('Badly formed JSON string: ' + this.inspect()); + }, + + include: function(pattern) { + return this.indexOf(pattern) > -1; + }, + + startsWith: function(pattern) { + return this.indexOf(pattern) =3D=3D=3D 0; + }, + + endsWith: function(pattern) { + var d =3D this.length - pattern.length; + return d >=3D 0 && this.lastIndexOf(pattern) =3D=3D=3D d; + }, + + empty: function() { + return this =3D=3D ''; + }, + + blank: function() { + return /^\s*$/.test(this); + }, + + interpolate: function(object, pattern) { + return new Template(this, pattern).evaluate(object); + } +}); + +if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String= .prototype, { + escapeHTML: function() { + return this.replace(/&/g,'&').replace(//g,'&= gt;'); + }, + unescapeHTML: function() { + return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g= ,'>'); + } +}); + +String.prototype.gsub.prepareReplacement =3D function(replacement) { + if (Object.isFunction(replacement)) return replacement; + var template =3D new Template(replacement); + return function(match) { return template.evaluate(match) }; +}; + +String.prototype.parseQuery =3D String.prototype.toQueryParams; + +Object.extend(String.prototype.escapeHTML, { + div: document.createElement('div'), + text: document.createTextNode('') +}); + +with (String.prototype.escapeHTML) div.appendChild(text); + +var Template =3D Class.create({ + initialize: function(template, pattern) { + this.template =3D template.toString(); + this.pattern =3D pattern || Template.Pattern; + }, + + evaluate: function(object) { + if (Object.isFunction(object.toTemplateReplacements)) + object =3D object.toTemplateReplacements(); + + return this.template.gsub(this.pattern, function(match) { + if (object =3D=3D null) return ''; + + var before =3D match[1] || ''; + if (before =3D=3D '\\') return match[2]; + + var ctx =3D object, expr =3D match[3]; + var pattern =3D /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/; + match =3D pattern.exec(expr); + if (match =3D=3D null) return before; + + while (match !=3D null) { + var comp =3D match[1].startsWith('[') ? match[2].gsub('\\\\]', ']'= ) : match[1]; + ctx =3D ctx[comp]; + if (null =3D=3D ctx || '' =3D=3D match[3]) break; + expr =3D expr.substring('[' =3D=3D match[3] ? match[1].length : ma= tch[0].length); + match =3D pattern.exec(expr); + } + + return before + String.interpret(ctx); + }); + } +}); +Template.Pattern =3D /(^|.|\r|\n)(#\{(.*?)\})/; + +var $break =3D { }; + +var Enumerable =3D { + each: function(iterator, context) { + var index =3D 0; + iterator =3D iterator.bind(context); + try { + this._each(function(value) { + iterator(value, index++); + }); + } catch (e) { + if (e !=3D $break) throw e; + } + return this; + }, + + eachSlice: function(number, iterator, context) { + iterator =3D iterator ? iterator.bind(context) : Prototype.K; + var index =3D -number, slices =3D [], array =3D this.toArray(); + while ((index +=3D number) < array.length) + slices.push(array.slice(index, index+number)); + return slices.collect(iterator, context); + }, + + all: function(iterator, context) { + iterator =3D iterator ? iterator.bind(context) : Prototype.K; + var result =3D true; + this.each(function(value, index) { + result =3D result && !!iterator(value, index); + if (!result) throw $break; + }); + return result; + }, + + any: function(iterator, context) { + iterator =3D iterator ? iterator.bind(context) : Prototype.K; + var result =3D false; + this.each(function(value, index) { + if (result =3D !!iterator(value, index)) + throw $break; + }); + return result; + }, + + collect: function(iterator, context) { + iterator =3D iterator ? iterator.bind(context) : Prototype.K; + var results =3D []; + this.each(function(value, index) { + results.push(iterator(value, index)); + }); + return results; + }, + + detect: function(iterator, context) { + iterator =3D iterator.bind(context); + var result; + this.each(function(value, index) { + if (iterator(value, index)) { + result =3D value; + throw $break; + } + }); + return result; + }, + + findAll: function(iterator, context) { + iterator =3D iterator.bind(context); + var results =3D []; + this.each(function(value, index) { + if (iterator(value, index)) + results.push(value); + }); + return results; + }, + + grep: function(filter, iterator, context) { + iterator =3D iterator ? iterator.bind(context) : Prototype.K; + var results =3D []; + + if (Object.isString(filter)) + filter =3D new RegExp(filter); + + this.each(function(value, index) { + if (filter.match(value)) + results.push(iterator(value, index)); + }); + return results; + }, + + include: function(object) { + if (Object.isFunction(this.indexOf)) + if (this.indexOf(object) !=3D -1) return true; + + var found =3D false; + this.each(function(value) { + if (value =3D=3D object) { + found =3D true; + throw $break; + } + }); + return found; + }, + + inGroupsOf: function(number, fillWith) { + fillWith =3D Object.isUndefined(fillWith) ? null : fillWith; + return this.eachSlice(number, function(slice) { + while(slice.length < number) slice.push(fillWith); + return slice; + }); + }, + + inject: function(memo, iterator, context) { + iterator =3D iterator.bind(context); + this.each(function(value, index) { + memo =3D iterator(memo, value, index); + }); + return memo; + }, + + invoke: function(method) { + var args =3D $A(arguments).slice(1); + return this.map(function(value) { + return value[method].apply(value, args); + }); + }, + + max: function(iterator, context) { + iterator =3D iterator ? iterator.bind(context) : Prototype.K; + var result; + this.each(function(value, index) { + value =3D iterator(value, index); + if (result =3D=3D null || value >=3D result) + result =3D value; + }); + return result; + }, + + min: function(iterator, context) { + iterator =3D iterator ? iterator.bind(context) : Prototype.K; + var result; + this.each(function(value, index) { + value =3D iterator(value, index); + if (result =3D=3D null || value < result) + result =3D value; + }); + return result; + }, + + partition: function(iterator, context) { + iterator =3D iterator ? iterator.bind(context) : Prototype.K; + var trues =3D [], falses =3D []; + this.each(function(value, index) { + (iterator(value, index) ? + trues : falses).push(value); + }); + return [trues, falses]; + }, + + pluck: function(property) { + var results =3D []; + this.each(function(value) { + results.push(value[property]); + }); + return results; + }, + + reject: function(iterator, context) { + iterator =3D iterator.bind(context); + var results =3D []; + this.each(function(value, index) { + if (!iterator(value, index)) + results.push(value); + }); + return results; + }, + + sortBy: function(iterator, context) { + iterator =3D iterator.bind(context); + return this.map(function(value, index) { + return {value: value, criteria: iterator(value, index)}; + }).sort(function(left, right) { + var a =3D left.criteria, b =3D right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + }).pluck('value'); + }, + + toArray: function() { + return this.map(); + }, + + zip: function() { + var iterator =3D Prototype.K, args =3D $A(arguments); + if (Object.isFunction(args.last())) + iterator =3D args.pop(); + + var collections =3D [this].concat(args).map($A); + return this.map(function(value, index) { + return iterator(collections.pluck(index)); + }); + }, + + size: function() { + return this.toArray().length; + }, + + inspect: function() { + return '#'; + } +}; + +Object.extend(Enumerable, { + map: Enumerable.collect, + find: Enumerable.detect, + select: Enumerable.findAll, + filter: Enumerable.findAll, + member: Enumerable.include, + entries: Enumerable.toArray, + every: Enumerable.all, + some: Enumerable.any +}); +function $A(iterable) { + if (!iterable) return []; + if (iterable.toArray) return iterable.toArray(); + var length =3D iterable.length || 0, results =3D new Array(length); + while (length--) results[length] =3D iterable[length]; + return results; +} + +if (Prototype.Browser.WebKit) { + $A =3D function(iterable) { + if (!iterable) return []; + if (!(Object.isFunction(iterable) && iterable =3D=3D '[object NodeList= ]') && + iterable.toArray) return iterable.toArray(); + var length =3D iterable.length || 0, results =3D new Array(length); + while (length--) results[length] =3D iterable[length]; + return results; + }; +} + +Array.from =3D $A; + +Object.extend(Array.prototype, Enumerable); + +if (!Array.prototype._reverse) Array.prototype._reverse =3D Array.prototyp= e.reverse; + +Object.extend(Array.prototype, { + _each: function(iterator) { + for (var i =3D 0, length =3D this.length; i < length; i++) + iterator(this[i]); + }, + + clear: function() { + this.length =3D 0; + return this; + }, + + first: function() { + return this[0]; + }, + + last: function() { + return this[this.length - 1]; + }, + + compact: function() { + return this.select(function(value) { + return value !=3D null; + }); + }, + + flatten: function() { + return this.inject([], function(array, value) { + return array.concat(Object.isArray(value) ? + value.flatten() : [value]); + }); + }, + + without: function() { + var values =3D $A(arguments); + return this.select(function(value) { + return !values.include(value); + }); + }, + + reverse: function(inline) { + return (inline !=3D=3D false ? this : this.toArray())._reverse(); + }, + + reduce: function() { + return this.length > 1 ? this : this[0]; + }, + + uniq: function(sorted) { + return this.inject([], function(array, value, index) { + if (0 =3D=3D index || (sorted ? array.last() !=3D value : !array.inc= lude(value))) + array.push(value); + return array; + }); + }, + + intersect: function(array) { + return this.uniq().findAll(function(item) { + return array.detect(function(value) { return item =3D=3D=3D value }); + }); + }, + + clone: function() { + return [].concat(this); + }, + + size: function() { + return this.length; + }, + + inspect: function() { + return '[' + this.map(Object.inspect).join(', ') + ']'; + }, + + toJSON: function() { + var results =3D []; + this.each(function(object) { + var value =3D Object.toJSON(object); + if (!Object.isUndefined(value)) results.push(value); + }); + return '[' + results.join(', ') + ']'; + } +}); + +// use native browser JS 1.6 implementation if available +if (Object.isFunction(Array.prototype.forEach)) + Array.prototype._each =3D Array.prototype.forEach; + +if (!Array.prototype.indexOf) Array.prototype.indexOf =3D function(item, i= ) { + i || (i =3D 0); + var length =3D this.length; + if (i < 0) i =3D length + i; + for (; i < length; i++) + if (this[i] =3D=3D=3D item) return i; + return -1; +}; + +if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf =3D function= (item, i) { + i =3D isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1; + var n =3D this.slice(0, i).reverse().indexOf(item); + return (n < 0) ? n : i - n - 1; +}; + +Array.prototype.toArray =3D Array.prototype.clone; + +function $w(string) { + if (!Object.isString(string)) return []; + string =3D string.strip(); + return string ? string.split(/\s+/) : []; +} + +if (Prototype.Browser.Opera){ + Array.prototype.concat =3D function() { + var array =3D []; + for (var i =3D 0, length =3D this.length; i < length; i++) array.push(= this[i]); + for (var i =3D 0, length =3D arguments.length; i < length; i++) { + if (Object.isArray(arguments[i])) { + for (var j =3D 0, arrayLength =3D arguments[i].length; j < arrayLe= ngth; j++) + array.push(arguments[i][j]); + } else { + array.push(arguments[i]); + } + } + return array; + }; +} +Object.extend(Number.prototype, { + toColorPart: function() { + return this.toPaddedString(2, 16); + }, + + succ: function() { + return this + 1; + }, + + times: function(iterator) { + $R(0, this, true).each(iterator); + return this; + }, + + toPaddedString: function(length, radix) { + var string =3D this.toString(radix || 10); + return '0'.times(length - string.length) + string; + }, + + toJSON: function() { + return isFinite(this) ? this.toString() : 'null'; + } +}); + +$w('abs round ceil floor').each(function(method){ + Number.prototype[method] =3D Math[method].methodize(); +}); +function $H(object) { + return new Hash(object); +}; + +var Hash =3D Class.create(Enumerable, (function() { + + function toQueryPair(key, value) { + if (Object.isUndefined(value)) return key; + return key + '=3D' + encodeURIComponent(String.interpret(value)); + } + + return { + initialize: function(object) { + this._object =3D Object.isHash(object) ? object.toObject() : Object.= clone(object); + }, + + _each: function(iterator) { + for (var key in this._object) { + var value =3D this._object[key], pair =3D [key, value]; + pair.key =3D key; + pair.value =3D value; + iterator(pair); + } + }, + + set: function(key, value) { + return this._object[key] =3D value; + }, + + get: function(key) { + return this._object[key]; + }, + + unset: function(key) { + var value =3D this._object[key]; + delete this._object[key]; + return value; + }, + + toObject: function() { + return Object.clone(this._object); + }, + + keys: function() { + return this.pluck('key'); + }, + + values: function() { + return this.pluck('value'); + }, + + index: function(value) { + var match =3D this.detect(function(pair) { + return pair.value =3D=3D=3D value; + }); + return match && match.key; + }, + + merge: function(object) { + return this.clone().update(object); + }, + + update: function(object) { + return new Hash(object).inject(this, function(result, pair) { + result.set(pair.key, pair.value); + return result; + }); + }, + + toQueryString: function() { + return this.map(function(pair) { + var key =3D encodeURIComponent(pair.key), values =3D pair.value; + + if (values && typeof values =3D=3D 'object') { + if (Object.isArray(values)) + return values.map(toQueryPair.curry(key)).join('&'); + } + return toQueryPair(key, values); + }).join('&'); + }, + + inspect: function() { + return '#'; + }, + + toJSON: function() { + return Object.toJSON(this.toObject()); + }, + + clone: function() { + return new Hash(this); + } + } +})()); + +Hash.prototype.toTemplateReplacements =3D Hash.prototype.toObject; +Hash.from =3D $H; +var ObjectRange =3D Class.create(Enumerable, { + initialize: function(start, end, exclusive) { + this.start =3D start; + this.end =3D end; + this.exclusive =3D exclusive; + }, + + _each: function(iterator) { + var value =3D this.start; + while (this.include(value)) { + iterator(value); + value =3D value.succ(); + } + }, + + include: function(value) { + if (value < this.start) + return false; + if (this.exclusive) + return value < this.end; + return value <=3D this.end; + } +}); + +var $R =3D function(start, end, exclusive) { + return new ObjectRange(start, end, exclusive); +}; + +var Ajax =3D { + getTransport: function() { + return Try.these( + function() {return new XMLHttpRequest()}, + function() {return new ActiveXObject('Msxml2.XMLHTTP')}, + function() {return new ActiveXObject('Microsoft.XMLHTTP')} + ) || false; + }, + + activeRequestCount: 0 +}; + +Ajax.Responders =3D { + responders: [], + + _each: function(iterator) { + this.responders._each(iterator); + }, + + register: function(responder) { + if (!this.include(responder)) + this.responders.push(responder); + }, + + unregister: function(responder) { + this.responders =3D this.responders.without(responder); + }, + + dispatch: function(callback, request, transport, json) { + this.each(function(responder) { + if (Object.isFunction(responder[callback])) { + try { + responder[callback].apply(responder, [request, transport, json]); + } catch (e) { } + } + }); + } +}; + +Object.extend(Ajax.Responders, Enumerable); + +Ajax.Responders.register({ + onCreate: function() { Ajax.activeRequestCount++ }, + onComplete: function() { Ajax.activeRequestCount-- } +}); + +Ajax.Base =3D Class.create({ + initialize: function(options) { + this.options =3D { + method: 'post', + asynchronous: true, + contentType: 'application/x-www-form-urlencoded', + encoding: 'UTF-8', + parameters: '', + evalJSON: true, + evalJS: true + }; + Object.extend(this.options, options || { }); + + this.options.method =3D this.options.method.toLowerCase(); + + if (Object.isString(this.options.parameters)) + this.options.parameters =3D this.options.parameters.toQueryParams(); + else if (Object.isHash(this.options.parameters)) + this.options.parameters =3D this.options.parameters.toObject(); + } +}); + +Ajax.Request =3D Class.create(Ajax.Base, { + _complete: false, + + initialize: function($super, url, options) { + $super(options); + this.transport =3D Ajax.getTransport(); + this.request(url); + }, + + request: function(url) { + this.url =3D url; + this.method =3D this.options.method; + var params =3D Object.clone(this.options.parameters); + + if (!['get', 'post'].include(this.method)) { + // simulate other verbs over post + params['_method'] =3D this.method; + this.method =3D 'post'; + } + + this.parameters =3D params; + + if (params =3D Object.toQueryString(params)) { + // when GET, append parameters to URL + if (this.method =3D=3D 'get') + this.url +=3D (this.url.include('?') ? '&' : '?') + params; + else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) + params +=3D '&_=3D'; + } + + try { + var response =3D new Ajax.Response(this); + if (this.options.onCreate) this.options.onCreate(response); + Ajax.Responders.dispatch('onCreate', this, response); + + this.transport.open(this.method.toUpperCase(), this.url, + this.options.asynchronous); + + if (this.options.asynchronous) this.respondToReadyState.bind(this).d= efer(1); + + this.transport.onreadystatechange =3D this.onStateChange.bind(this); + this.setRequestHeaders(); + + this.body =3D this.method =3D=3D 'post' ? (this.options.postBody || = params) : null; + this.transport.send(this.body); + + /* Force Firefox to handle ready state 4 for synchronous requests */ + if (!this.options.asynchronous && this.transport.overrideMimeType) + this.onStateChange(); + + } + catch (e) { + this.dispatchException(e); + } + }, + + onStateChange: function() { + var readyState =3D this.transport.readyState; + if (readyState > 1 && !((readyState =3D=3D 4) && this._complete)) + this.respondToReadyState(this.transport.readyState); + }, + + setRequestHeaders: function() { + var headers =3D { + 'X-Requested-With': 'XMLHttpRequest', + 'X-Prototype-Version': Prototype.Version, + 'Accept': 'text/javascript, text/html, application/xml, text/xml, */= *' + }; + + if (this.method =3D=3D 'post') { + headers['Content-type'] =3D this.options.contentType + + (this.options.encoding ? '; charset=3D' + this.options.encoding : = ''); + + /* Force "Connection: close" for older Mozilla browsers to work + * around a bug where XMLHttpRequest sends an incorrect + * Content-length header. See Mozilla Bugzilla #246651. + */ + if (this.transport.overrideMimeType && + (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2= 005) + headers['Connection'] =3D 'close'; + } + + // user-defined headers + if (typeof this.options.requestHeaders =3D=3D 'object') { + var extras =3D this.options.requestHeaders; + + if (Object.isFunction(extras.push)) + for (var i =3D 0, length =3D extras.length; i < length; i +=3D 2) + headers[extras[i]] =3D extras[i+1]; + else + $H(extras).each(function(pair) { headers[pair.key] =3D pair.value = }); + } + + for (var name in headers) + this.transport.setRequestHeader(name, headers[name]); + }, + + success: function() { + var status =3D this.getStatus(); + return !status || (status >=3D 200 && status < 300); + }, + + getStatus: function() { + try { + return this.transport.status || 0; + } catch (e) { return 0 } + }, + + respondToReadyState: function(readyState) { + var state =3D Ajax.Request.Events[readyState], response =3D new Ajax.R= esponse(this); + + if (state =3D=3D 'Complete') { + try { + this._complete =3D true; + (this.options['on' + response.status] + || this.options['on' + (this.success() ? 'Success' : 'Failure')] + || Prototype.emptyFunction)(response, response.headerJSON); + } catch (e) { + this.dispatchException(e); + } + + var contentType =3D response.getHeader('Content-type'); + if (this.options.evalJS =3D=3D 'force' + || (this.options.evalJS && this.isSameOrigin() && contentType + && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)sc= ript(;.*)?\s*$/i))) + this.evalResponse(); + } + + try { + (this.options['on' + state] || Prototype.emptyFunction)(response, re= sponse.headerJSON); + Ajax.Responders.dispatch('on' + state, this, response, response.head= erJSON); + } catch (e) { + this.dispatchException(e); + } + + if (state =3D=3D 'Complete') { + // avoid memory leak in MSIE: clean up + this.transport.onreadystatechange =3D Prototype.emptyFunction; + } + }, + + isSameOrigin: function() { + var m =3D this.url.match(/^\s*https?:\/\/[^\/]*/); + return !m || (m[0] =3D=3D '#{protocol}//#{domain}#{port}'.interpolate({ + protocol: location.protocol, + domain: document.domain, + port: location.port ? ':' + location.port : '' + })); + }, + + getHeader: function(name) { + try { + return this.transport.getResponseHeader(name) || null; + } catch (e) { return null } + }, + + evalResponse: function() { + try { + return eval((this.transport.responseText || '').unfilterJSON()); + } catch (e) { + this.dispatchException(e); + } + }, + + dispatchException: function(exception) { + (this.options.onException || Prototype.emptyFunction)(this, exception); + Ajax.Responders.dispatch('onException', this, exception); + } +}); + +Ajax.Request.Events =3D + ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; + +Ajax.Response =3D Class.create({ + initialize: function(request){ + this.request =3D request; + var transport =3D this.transport =3D request.transport, + readyState =3D this.readyState =3D transport.readyState; + + if((readyState > 2 && !Prototype.Browser.IE) || readyState =3D=3D 4) { + this.status =3D this.getStatus(); + this.statusText =3D this.getStatusText(); + this.responseText =3D String.interpret(transport.responseText); + this.headerJSON =3D this._getHeaderJSON(); + } + + if(readyState =3D=3D 4) { + var xml =3D transport.responseXML; + this.responseXML =3D Object.isUndefined(xml) ? null : xml; + this.responseJSON =3D this._getResponseJSON(); + } + }, + + status: 0, + statusText: '', + + getStatus: Ajax.Request.prototype.getStatus, + + getStatusText: function() { + try { + return this.transport.statusText || ''; + } catch (e) { return '' } + }, + + getHeader: Ajax.Request.prototype.getHeader, + + getAllHeaders: function() { + try { + return this.getAllResponseHeaders(); + } catch (e) { return null } + }, + + getResponseHeader: function(name) { + return this.transport.getResponseHeader(name); + }, + + getAllResponseHeaders: function() { + return this.transport.getAllResponseHeaders(); + }, + + _getHeaderJSON: function() { + var json =3D this.getHeader('X-JSON'); + if (!json) return null; + json =3D decodeURIComponent(escape(json)); + try { + return json.evalJSON(this.request.options.sanitizeJSON || + !this.request.isSameOrigin()); + } catch (e) { + this.request.dispatchException(e); + } + }, + + _getResponseJSON: function() { + var options =3D this.request.options; + if (!options.evalJSON || (options.evalJSON !=3D 'force' && + !(this.getHeader('Content-type') || '').include('application/json'))= || + this.responseText.blank()) + return null; + try { + return this.responseText.evalJSON(options.sanitizeJSON || + !this.request.isSameOrigin()); + } catch (e) { + this.request.dispatchException(e); + } + } +}); + +Ajax.Updater =3D Class.create(Ajax.Request, { + initialize: function($super, container, url, options) { + this.container =3D { + success: (container.success || container), + failure: (container.failure || (container.success ? null : container= )) + }; + + options =3D Object.clone(options); + var onComplete =3D options.onComplete; + options.onComplete =3D (function(response, json) { + this.updateContent(response.responseText); + if (Object.isFunction(onComplete)) onComplete(response, json); + }).bind(this); + + $super(url, options); + }, + + updateContent: function(responseText) { + var receiver =3D this.container[this.success() ? 'success' : 'failure'= ], + options =3D this.options; + + if (!options.evalScripts) responseText =3D responseText.stripScripts(); + + if (receiver =3D $(receiver)) { + if (options.insertion) { + if (Object.isString(options.insertion)) { + var insertion =3D { }; insertion[options.insertion] =3D response= Text; + receiver.insert(insertion); + } + else options.insertion(receiver, responseText); + } + else receiver.update(responseText); + } + } +}); + +Ajax.PeriodicalUpdater =3D Class.create(Ajax.Base, { + initialize: function($super, container, url, options) { + $super(options); + this.onComplete =3D this.options.onComplete; + + this.frequency =3D (this.options.frequency || 2); + this.decay =3D (this.options.decay || 1); + + this.updater =3D { }; + this.container =3D container; + this.url =3D url; + + this.start(); + }, + + start: function() { + this.options.onComplete =3D this.updateComplete.bind(this); + this.onTimerEvent(); + }, + + stop: function() { + this.updater.options.onComplete =3D undefined; + clearTimeout(this.timer); + (this.onComplete || Prototype.emptyFunction).apply(this, arguments); + }, + + updateComplete: function(response) { + if (this.options.decay) { + this.decay =3D (response.responseText =3D=3D this.lastText ? + this.decay * this.options.decay : 1); + + this.lastText =3D response.responseText; + } + this.timer =3D this.onTimerEvent.bind(this).delay(this.decay * this.fr= equency); + }, + + onTimerEvent: function() { + this.updater =3D new Ajax.Updater(this.container, this.url, this.optio= ns); + } +}); +function $(element) { + if (arguments.length > 1) { + for (var i =3D 0, elements =3D [], length =3D arguments.length; i < le= ngth; i++) + elements.push($(arguments[i])); + return elements; + } + if (Object.isString(element)) + element =3D document.getElementById(element); + return Element.extend(element); +} + +if (Prototype.BrowserFeatures.XPath) { + document._getElementsByXPath =3D function(expression, parentElement) { + var results =3D []; + var query =3D document.evaluate(expression, $(parentElement) || docume= nt, + null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); + for (var i =3D 0, length =3D query.snapshotLength; i < length; i++) + results.push(Element.extend(query.snapshotItem(i))); + return results; + }; +} + +/*------------------------------------------------------------------------= --*/ + +if (!window.Node) var Node =3D { }; + +if (!Node.ELEMENT_NODE) { + // DOM level 2 ECMAScript Language Binding + Object.extend(Node, { + ELEMENT_NODE: 1, + ATTRIBUTE_NODE: 2, + TEXT_NODE: 3, + CDATA_SECTION_NODE: 4, + ENTITY_REFERENCE_NODE: 5, + ENTITY_NODE: 6, + PROCESSING_INSTRUCTION_NODE: 7, + COMMENT_NODE: 8, + DOCUMENT_NODE: 9, + DOCUMENT_TYPE_NODE: 10, + DOCUMENT_FRAGMENT_NODE: 11, + NOTATION_NODE: 12 + }); +} + +(function() { + var element =3D this.Element; + this.Element =3D function(tagName, attributes) { + attributes =3D attributes || { }; + tagName =3D tagName.toLowerCase(); + var cache =3D Element.cache; + if (Prototype.Browser.IE && attributes.name) { + tagName =3D '<' + tagName + ' name=3D"' + attributes.name + '">'; + delete attributes.name; + return Element.writeAttribute(document.createElement(tagName), attri= butes); + } + if (!cache[tagName]) cache[tagName] =3D Element.extend(document.create= Element(tagName)); + return Element.writeAttribute(cache[tagName].cloneNode(false), attribu= tes); + }; + Object.extend(this.Element, element || { }); +}).call(window); + +Element.cache =3D { }; + +Element.Methods =3D { + visible: function(element) { + return $(element).style.display !=3D 'none'; + }, + + toggle: function(element) { + element =3D $(element); + Element[Element.visible(element) ? 'hide' : 'show'](element); + return element; + }, + + hide: function(element) { + $(element).style.display =3D 'none'; + return element; + }, + + show: function(element) { + $(element).style.display =3D ''; + return element; + }, + + remove: function(element) { + element =3D $(element); + element.parentNode.removeChild(element); + return element; + }, + + update: function(element, content) { + element =3D $(element); + if (content && content.toElement) content =3D content.toElement(); + if (Object.isElement(content)) return element.update().insert(content); + content =3D Object.toHTML(content); + element.innerHTML =3D content.stripScripts(); + content.evalScripts.bind(content).defer(); + return element; + }, + + replace: function(element, content) { + element =3D $(element); + if (content && content.toElement) content =3D content.toElement(); + else if (!Object.isElement(content)) { + content =3D Object.toHTML(content); + var range =3D element.ownerDocument.createRange(); + range.selectNode(element); + content.evalScripts.bind(content).defer(); + content =3D range.createContextualFragment(content.stripScripts()); + } + element.parentNode.replaceChild(content, element); + return element; + }, + + insert: function(element, insertions) { + element =3D $(element); + + if (Object.isString(insertions) || Object.isNumber(insertions) || + Object.isElement(insertions) || (insertions && (insertions.toEleme= nt || insertions.toHTML))) + insertions =3D {bottom:insertions}; + + var content, insert, tagName, childNodes; + + for (var position in insertions) { + content =3D insertions[position]; + position =3D position.toLowerCase(); + insert =3D Element._insertionTranslations[position]; + + if (content && content.toElement) content =3D content.toElement(); + if (Object.isElement(content)) { + insert(element, content); + continue; + } + + content =3D Object.toHTML(content); + + tagName =3D ((position =3D=3D 'before' || position =3D=3D 'after') + ? element.parentNode : element).tagName.toUpperCase(); + + childNodes =3D Element._getContentFromAnonymousElement(tagName, cont= ent.stripScripts()); + + if (position =3D=3D 'top' || position =3D=3D 'after') childNodes.rev= erse(); + childNodes.each(insert.curry(element)); + + content.evalScripts.bind(content).defer(); + } + + return element; + }, + + wrap: function(element, wrapper, attributes) { + element =3D $(element); + if (Object.isElement(wrapper)) + $(wrapper).writeAttribute(attributes || { }); + else if (Object.isString(wrapper)) wrapper =3D new Element(wrapper, at= tributes); + else wrapper =3D new Element('div', wrapper); + if (element.parentNode) + element.parentNode.replaceChild(wrapper, element); + wrapper.appendChild(element); + return wrapper; + }, + + inspect: function(element) { + element =3D $(element); + var result =3D '<' + element.tagName.toLowerCase(); + $H({'id': 'id', 'className': 'class'}).each(function(pair) { + var property =3D pair.first(), attribute =3D pair.last(); + var value =3D (element[property] || '').toString(); + if (value) result +=3D ' ' + attribute + '=3D' + value.inspect(true); + }); + return result + '>'; + }, + + recursivelyCollect: function(element, property) { + element =3D $(element); + var elements =3D []; + while (element =3D element[property]) + if (element.nodeType =3D=3D 1) + elements.push(Element.extend(element)); + return elements; + }, + + ancestors: function(element) { + return $(element).recursivelyCollect('parentNode'); + }, + + descendants: function(element) { + return $(element).select("*"); + }, + + firstDescendant: function(element) { + element =3D $(element).firstChild; + while (element && element.nodeType !=3D 1) element =3D element.nextSib= ling; + return $(element); + }, + + immediateDescendants: function(element) { + if (!(element =3D $(element).firstChild)) return []; + while (element && element.nodeType !=3D 1) element =3D element.nextSib= ling; + if (element) return [element].concat($(element).nextSiblings()); + return []; + }, + + previousSiblings: function(element) { + return $(element).recursivelyCollect('previousSibling'); + }, + + nextSiblings: function(element) { + return $(element).recursivelyCollect('nextSibling'); + }, + + siblings: function(element) { + element =3D $(element); + return element.previousSiblings().reverse().concat(element.nextSibling= s()); + }, + + match: function(element, selector) { + if (Object.isString(selector)) + selector =3D new Selector(selector); + return selector.match($(element)); + }, + + up: function(element, expression, index) { + element =3D $(element); + if (arguments.length =3D=3D 1) return $(element.parentNode); + var ancestors =3D element.ancestors(); + return Object.isNumber(expression) ? ancestors[expression] : + Selector.findElement(ancestors, expression, index); + }, + + down: function(element, expression, index) { + element =3D $(element); + if (arguments.length =3D=3D 1) return element.firstDescendant(); + return Object.isNumber(expression) ? element.descendants()[expression]= : + element.select(expression)[index || 0]; + }, + + previous: function(element, expression, index) { + element =3D $(element); + if (arguments.length =3D=3D 1) return $(Selector.handlers.previousElem= entSibling(element)); + var previousSiblings =3D element.previousSiblings(); + return Object.isNumber(expression) ? previousSiblings[expression] : + Selector.findElement(previousSiblings, expression, index); + }, + + next: function(element, expression, index) { + element =3D $(element); + if (arguments.length =3D=3D 1) return $(Selector.handlers.nextElementS= ibling(element)); + var nextSiblings =3D element.nextSiblings(); + return Object.isNumber(expression) ? nextSiblings[expression] : + Selector.findElement(nextSiblings, expression, index); + }, + + select: function() { + var args =3D $A(arguments), element =3D $(args.shift()); + return Selector.findChildElements(element, args); + }, + + adjacent: function() { + var args =3D $A(arguments), element =3D $(args.shift()); + return Selector.findChildElements(element.parentNode, args).without(el= ement); + }, + + identify: function(element) { + element =3D $(element); + var id =3D element.readAttribute('id'), self =3D arguments.callee; + if (id) return id; + do { id =3D 'anonymous_element_' + self.counter++ } while ($(id)); + element.writeAttribute('id', id); + return id; + }, + + readAttribute: function(element, name) { + element =3D $(element); + if (Prototype.Browser.IE) { + var t =3D Element._attributeTranslations.read; + if (t.values[name]) return t.values[name](element, name); + if (t.names[name]) name =3D t.names[name]; + if (name.include(':')) { + return (!element.attributes || !element.attributes[name]) ? null : + element.attributes[name].value; + } + } + return element.getAttribute(name); + }, + + writeAttribute: function(element, name, value) { + element =3D $(element); + var attributes =3D { }, t =3D Element._attributeTranslations.write; + + if (typeof name =3D=3D 'object') attributes =3D name; + else attributes[name] =3D Object.isUndefined(value) ? true : value; + + for (var attr in attributes) { + name =3D t.names[attr] || attr; + value =3D attributes[attr]; + if (t.values[attr]) name =3D t.values[attr](element, value); + if (value =3D=3D=3D false || value =3D=3D=3D null) + element.removeAttribute(name); + else if (value =3D=3D=3D true) + element.setAttribute(name, name); + else element.setAttribute(name, value); + } + return element; + }, + + getHeight: function(element) { + return $(element).getDimensions().height; + }, + + getWidth: function(element) { + return $(element).getDimensions().width; + }, + + classNames: function(element) { + return new Element.ClassNames(element); + }, + + hasClassName: function(element, className) { + if (!(element =3D $(element))) return; + var elementClassName =3D element.className; + return (elementClassName.length > 0 && (elementClassName =3D=3D classN= ame || + new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName)= )); + }, + + addClassName: function(element, className) { + if (!(element =3D $(element))) return; + if (!element.hasClassName(className)) + element.className +=3D (element.className ? ' ' : '') + className; + return element; + }, + + removeClassName: function(element, className) { + if (!(element =3D $(element))) return; + element.className =3D element.className.replace( + new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip(); + return element; + }, + + toggleClassName: function(element, className) { + if (!(element =3D $(element))) return; + return element[element.hasClassName(className) ? + 'removeClassName' : 'addClassName'](className); + }, + + // removes whitespace-only text node children + cleanWhitespace: function(element) { + element =3D $(element); + var node =3D element.firstChild; + while (node) { + var nextNode =3D node.nextSibling; + if (node.nodeType =3D=3D 3 && !/\S/.test(node.nodeValue)) + element.removeChild(node); + node =3D nextNode; + } + return element; + }, + + empty: function(element) { + return $(element).innerHTML.blank(); + }, + + descendantOf: function(element, ancestor) { + element =3D $(element), ancestor =3D $(ancestor); + var originalAncestor =3D ancestor; + + if (element.compareDocumentPosition) + return (element.compareDocumentPosition(ancestor) & 8) =3D=3D=3D 8; + + if (element.sourceIndex && !Prototype.Browser.Opera) { + var e =3D element.sourceIndex, a =3D ancestor.sourceIndex, + nextAncestor =3D ancestor.nextSibling; + if (!nextAncestor) { + do { ancestor =3D ancestor.parentNode; } + while (!(nextAncestor =3D ancestor.nextSibling) && ancestor.parent= Node); + } + if (nextAncestor && nextAncestor.sourceIndex) + return (e > a && e < nextAncestor.sourceIndex); + } + + while (element =3D element.parentNode) + if (element =3D=3D originalAncestor) return true; + return false; + }, + + scrollTo: function(element) { + element =3D $(element); + var pos =3D element.cumulativeOffset(); + window.scrollTo(pos[0], pos[1]); + return element; + }, + + getStyle: function(element, style) { + element =3D $(element); + style =3D style =3D=3D 'float' ? 'cssFloat' : style.camelize(); + var value =3D element.style[style]; + if (!value) { + var css =3D document.defaultView.getComputedStyle(element, null); + value =3D css ? css[style] : null; + } + if (style =3D=3D 'opacity') return value ? parseFloat(value) : 1.0; + return value =3D=3D 'auto' ? null : value; + }, + + getOpacity: function(element) { + return $(element).getStyle('opacity'); + }, + + setStyle: function(element, styles) { + element =3D $(element); + var elementStyle =3D element.style, match; + if (Object.isString(styles)) { + element.style.cssText +=3D ';' + styles; + return styles.include('opacity') ? + element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : el= ement; + } + for (var property in styles) + if (property =3D=3D 'opacity') element.setOpacity(styles[property]); + else + elementStyle[(property =3D=3D 'float' || property =3D=3D 'cssFloat= ') ? + (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'sty= leFloat') : + property] =3D styles[property]; + + return element; + }, + + setOpacity: function(element, value) { + element =3D $(element); + element.style.opacity =3D (value =3D=3D 1 || value =3D=3D=3D '') ? '' : + (value < 0.00001) ? 0 : value; + return element; + }, + + getDimensions: function(element) { + element =3D $(element); + var display =3D $(element).getStyle('display'); + if (display !=3D 'none' && display !=3D null) // Safari bug + return {width: element.offsetWidth, height: element.offsetHeight}; + + // All *Width and *Height properties give 0 on elements with display n= one, + // so enable the element temporarily + var els =3D element.style; + var originalVisibility =3D els.visibility; + var originalPosition =3D els.position; + var originalDisplay =3D els.display; + els.visibility =3D 'hidden'; + els.position =3D 'absolute'; + els.display =3D 'block'; + var originalWidth =3D element.clientWidth; + var originalHeight =3D element.clientHeight; + els.display =3D originalDisplay; + els.position =3D originalPosition; + els.visibility =3D originalVisibility; + return {width: originalWidth, height: originalHeight}; + }, + + makePositioned: function(element) { + element =3D $(element); + var pos =3D Element.getStyle(element, 'position'); + if (pos =3D=3D 'static' || !pos) { + element._madePositioned =3D true; + element.style.position =3D 'relative'; + // Opera returns the offset relative to the positioning context, whe= n an + // element is position relative but top and left have not been defin= ed + if (window.opera) { + element.style.top =3D 0; + element.style.left =3D 0; + } + } + return element; + }, + + undoPositioned: function(element) { + element =3D $(element); + if (element._madePositioned) { + element._madePositioned =3D undefined; + element.style.position =3D + element.style.top =3D + element.style.left =3D + element.style.bottom =3D + element.style.right =3D ''; + } + return element; + }, + + makeClipping: function(element) { + element =3D $(element); + if (element._overflow) return element; + element._overflow =3D Element.getStyle(element, 'overflow') || 'auto'; + if (element._overflow !=3D=3D 'hidden') + element.style.overflow =3D 'hidden'; + return element; + }, + + undoClipping: function(element) { + element =3D $(element); + if (!element._overflow) return element; + element.style.overflow =3D element._overflow =3D=3D 'auto' ? '' : elem= ent._overflow; + element._overflow =3D null; + return element; + }, + + cumulativeOffset: function(element) { + var valueT =3D 0, valueL =3D 0; + do { + valueT +=3D element.offsetTop || 0; + valueL +=3D element.offsetLeft || 0; + element =3D element.offsetParent; + } while (element); + return Element._returnOffset(valueL, valueT); + }, + + positionedOffset: function(element) { + var valueT =3D 0, valueL =3D 0; + do { + valueT +=3D element.offsetTop || 0; + valueL +=3D element.offsetLeft || 0; + element =3D element.offsetParent; + if (element) { + if (element.tagName =3D=3D 'BODY') break; + var p =3D Element.getStyle(element, 'position'); + if (p !=3D=3D 'static') break; + } + } while (element); + return Element._returnOffset(valueL, valueT); + }, + + absolutize: function(element) { + element =3D $(element); + if (element.getStyle('position') =3D=3D 'absolute') return; + // Position.prepare(); // To be done manually by Scripty when it needs= it. + + var offsets =3D element.positionedOffset(); + var top =3D offsets[1]; + var left =3D offsets[0]; + var width =3D element.clientWidth; + var height =3D element.clientHeight; + + element._originalLeft =3D left - parseFloat(element.style.left || 0= ); + element._originalTop =3D top - parseFloat(element.style.top || 0); + element._originalWidth =3D element.style.width; + element._originalHeight =3D element.style.height; + + element.style.position =3D 'absolute'; + element.style.top =3D top + 'px'; + element.style.left =3D left + 'px'; + element.style.width =3D width + 'px'; + element.style.height =3D height + 'px'; + return element; + }, + + relativize: function(element) { + element =3D $(element); + if (element.getStyle('position') =3D=3D 'relative') return; + // Position.prepare(); // To be done manually by Scripty when it needs= it. + + element.style.position =3D 'relative'; + var top =3D parseFloat(element.style.top || 0) - (element._originalT= op || 0); + var left =3D parseFloat(element.style.left || 0) - (element._originalL= eft || 0); + + element.style.top =3D top + 'px'; + element.style.left =3D left + 'px'; + element.style.height =3D element._originalHeight; + element.style.width =3D element._originalWidth; + return element; + }, + + cumulativeScrollOffset: function(element) { + var valueT =3D 0, valueL =3D 0; + do { + valueT +=3D element.scrollTop || 0; + valueL +=3D element.scrollLeft || 0; + element =3D element.parentNode; + } while (element); + return Element._returnOffset(valueL, valueT); + }, + + getOffsetParent: function(element) { + if (element.offsetParent) return $(element.offsetParent); + if (element =3D=3D document.body) return $(element); + + while ((element =3D element.parentNode) && element !=3D document.body) + if (Element.getStyle(element, 'position') !=3D 'static') + return $(element); + + return $(document.body); + }, + + viewportOffset: function(forElement) { + var valueT =3D 0, valueL =3D 0; + + var element =3D forElement; + do { + valueT +=3D element.offsetTop || 0; + valueL +=3D element.offsetLeft || 0; + + // Safari fix + if (element.offsetParent =3D=3D document.body && + Element.getStyle(element, 'position') =3D=3D 'absolute') break; + + } while (element =3D element.offsetParent); + + element =3D forElement; + do { + if (!Prototype.Browser.Opera || element.tagName =3D=3D 'BODY') { + valueT -=3D element.scrollTop || 0; + valueL -=3D element.scrollLeft || 0; + } + } while (element =3D element.parentNode); + + return Element._returnOffset(valueL, valueT); + }, + + clonePosition: function(element, source) { + var options =3D Object.extend({ + setLeft: true, + setTop: true, + setWidth: true, + setHeight: true, + offsetTop: 0, + offsetLeft: 0 + }, arguments[2] || { }); + + // find page position of source + source =3D $(source); + var p =3D source.viewportOffset(); + + // find coordinate system to use + element =3D $(element); + var delta =3D [0, 0]; + var parent =3D null; + // delta [0,0] will do fine with position: fixed elements, + // position:absolute needs offsetParent deltas + if (Element.getStyle(element, 'position') =3D=3D 'absolute') { + parent =3D element.getOffsetParent(); + delta =3D parent.viewportOffset(); + } + + // correct by body offsets (fixes Safari) + if (parent =3D=3D document.body) { + delta[0] -=3D document.body.offsetLeft; + delta[1] -=3D document.body.offsetTop; + } + + // set position + if (options.setLeft) element.style.left =3D (p[0] - delta[0] + opti= ons.offsetLeft) + 'px'; + if (options.setTop) element.style.top =3D (p[1] - delta[1] + opti= ons.offsetTop) + 'px'; + if (options.setWidth) element.style.width =3D source.offsetWidth + 'p= x'; + if (options.setHeight) element.style.height =3D source.offsetHeight + = 'px'; + return element; + } +}; + +Element.Methods.identify.counter =3D 1; + +Object.extend(Element.Methods, { + getElementsBySelector: Element.Methods.select, + childElements: Element.Methods.immediateDescendants +}); + +Element._attributeTranslations =3D { + write: { + names: { + className: 'class', + htmlFor: 'for' + }, + values: { } + } +}; + +if (Prototype.Browser.Opera) { + Element.Methods.getStyle =3D Element.Methods.getStyle.wrap( + function(proceed, element, style) { + switch (style) { + case 'left': case 'top': case 'right': case 'bottom': + if (proceed(element, 'position') =3D=3D=3D 'static') return null; + case 'height': case 'width': + // returns '0px' for hidden elements; we want it to return null + if (!Element.visible(element)) return null; + + // returns the border-box dimensions rather than the content-box + // dimensions, so we subtract padding and borders from the value + var dim =3D parseInt(proceed(element, style), 10); + + if (dim !=3D=3D element['offset' + style.capitalize()]) + return dim + 'px'; + + var properties; + if (style =3D=3D=3D 'height') { + properties =3D ['border-top-width', 'padding-top', + 'padding-bottom', 'border-bottom-width']; + } + else { + properties =3D ['border-left-width', 'padding-left', + 'padding-right', 'border-right-width']; + } + return properties.inject(dim, function(memo, property) { + var val =3D proceed(element, property); + return val =3D=3D=3D null ? memo : memo - parseInt(val, 10); + }) + 'px'; + default: return proceed(element, style); + } + } + ); + + Element.Methods.readAttribute =3D Element.Methods.readAttribute.wrap( + function(proceed, element, attribute) { + if (attribute =3D=3D=3D 'title') return element.title; + return proceed(element, attribute); + } + ); +} + +else if (Prototype.Browser.IE) { + // IE doesn't report offsets correctly for static elements, so we change= them + // to "relative" to get the values, then change them back. + Element.Methods.getOffsetParent =3D Element.Methods.getOffsetParent.wrap( + function(proceed, element) { + element =3D $(element); + var position =3D element.getStyle('position'); + if (position !=3D=3D 'static') return proceed(element); + element.setStyle({ position: 'relative' }); + var value =3D proceed(element); + element.setStyle({ position: position }); + return value; + } + ); + + $w('positionedOffset viewportOffset').each(function(method) { + Element.Methods[method] =3D Element.Methods[method].wrap( + function(proceed, element) { + element =3D $(element); + var position =3D element.getStyle('position'); + if (position !=3D=3D 'static') return proceed(element); + // Trigger hasLayout on the offset parent so that IE6 reports + // accurate offsetTop and offsetLeft values for position: fixed. + var offsetParent =3D element.getOffsetParent(); + if (offsetParent && offsetParent.getStyle('position') =3D=3D=3D 'f= ixed') + offsetParent.setStyle({ zoom: 1 }); + element.setStyle({ position: 'relative' }); + var value =3D proceed(element); + element.setStyle({ position: position }); + return value; + } + ); + }); + + Element.Methods.getStyle =3D function(element, style) { + element =3D $(element); + style =3D (style =3D=3D 'float' || style =3D=3D 'cssFloat') ? 'styleFl= oat' : style.camelize(); + var value =3D element.style[style]; + if (!value && element.currentStyle) value =3D element.currentStyle[sty= le]; + + if (style =3D=3D 'opacity') { + if (value =3D (element.getStyle('filter') || '').match(/alpha\(opaci= ty=3D(.*)\)/)) + if (value[1]) return parseFloat(value[1]) / 100; + return 1.0; + } + + if (value =3D=3D 'auto') { + if ((style =3D=3D 'width' || style =3D=3D 'height') && (element.getS= tyle('display') !=3D 'none')) + return element['offset' + style.capitalize()] + 'px'; + return null; + } + return value; + }; + + Element.Methods.setOpacity =3D function(element, value) { + function stripAlpha(filter){ + return filter.replace(/alpha\([^\)]*\)/gi,''); + } + element =3D $(element); + var currentStyle =3D element.currentStyle; + if ((currentStyle && !currentStyle.hasLayout) || + (!currentStyle && element.style.zoom =3D=3D 'normal')) + element.style.zoom =3D 1; + + var filter =3D element.getStyle('filter'), style =3D element.style; + if (value =3D=3D 1 || value =3D=3D=3D '') { + (filter =3D stripAlpha(filter)) ? + style.filter =3D filter : style.removeAttribute('filter'); + return element; + } else if (value < 0.00001) value =3D 0; + style.filter =3D stripAlpha(filter) + + 'alpha(opacity=3D' + (value * 100) + ')'; + return element; + }; + + Element._attributeTranslations =3D { + read: { + names: { + 'class': 'className', + 'for': 'htmlFor' + }, + values: { + _getAttr: function(element, attribute) { + return element.getAttribute(attribute, 2); + }, + _getAttrNode: function(element, attribute) { + var node =3D element.getAttributeNode(attribute); + return node ? node.value : ""; + }, + _getEv: function(element, attribute) { + attribute =3D element.getAttribute(attribute); + return attribute ? attribute.toString().slice(23, -2) : null; + }, + _flag: function(element, attribute) { + return $(element).hasAttribute(attribute) ? attribute : null; + }, + style: function(element) { + return element.style.cssText.toLowerCase(); + }, + title: function(element) { + return element.title; + } + } + } + }; + + Element._attributeTranslations.write =3D { + names: Object.extend({ + cellpadding: 'cellPadding', + cellspacing: 'cellSpacing' + }, Element._attributeTranslations.read.names), + values: { + checked: function(element, value) { + element.checked =3D !!value; + }, + + style: function(element, value) { + element.style.cssText =3D value ? value : ''; + } + } + }; + + Element._attributeTranslations.has =3D {}; + + $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' + + 'encType maxLength readOnly longDesc').each(function(attr) { + Element._attributeTranslations.write.names[attr.toLowerCase()] =3D att= r; + Element._attributeTranslations.has[attr.toLowerCase()] =3D attr; + }); + + (function(v) { + Object.extend(v, { + href: v._getAttr, + src: v._getAttr, + type: v._getAttr, + action: v._getAttrNode, + disabled: v._flag, + checked: v._flag, + readonly: v._flag, + multiple: v._flag, + onload: v._getEv, + onunload: v._getEv, + onclick: v._getEv, + ondblclick: v._getEv, + onmousedown: v._getEv, + onmouseup: v._getEv, + onmouseover: v._getEv, + onmousemove: v._getEv, + onmouseout: v._getEv, + onfocus: v._getEv, + onblur: v._getEv, + onkeypress: v._getEv, + onkeydown: v._getEv, + onkeyup: v._getEv, + onsubmit: v._getEv, + onreset: v._getEv, + onselect: v._getEv, + onchange: v._getEv + }); + })(Element._attributeTranslations.read.values); +} + +else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)= ) { + Element.Methods.setOpacity =3D function(element, value) { + element =3D $(element); + element.style.opacity =3D (value =3D=3D 1) ? 0.999999 : + (value =3D=3D=3D '') ? '' : (value < 0.00001) ? 0 : value; + return element; + }; +} + +else if (Prototype.Browser.WebKit) { + Element.Methods.setOpacity =3D function(element, value) { + element =3D $(element); + element.style.opacity =3D (value =3D=3D 1 || value =3D=3D=3D '') ? '' : + (value < 0.00001) ? 0 : value; + + if (value =3D=3D 1) + if(element.tagName =3D=3D 'IMG' && element.width) { + element.width++; element.width--; + } else try { + var n =3D document.createTextNode(' '); + element.appendChild(n); + element.removeChild(n); + } catch (e) { } + + return element; + }; + + // Safari returns margins on body which is incorrect if the child is abs= olutely + // positioned. For performance reasons, redefine Element#cumulativeOffs= et for + // KHTML/WebKit only. + Element.Methods.cumulativeOffset =3D function(element) { + var valueT =3D 0, valueL =3D 0; + do { + valueT +=3D element.offsetTop || 0; + valueL +=3D element.offsetLeft || 0; + if (element.offsetParent =3D=3D document.body) + if (Element.getStyle(element, 'position') =3D=3D 'absolute') break; + + element =3D element.offsetParent; + } while (element); + + return Element._returnOffset(valueL, valueT); + }; +} + +if (Prototype.Browser.IE || Prototype.Browser.Opera) { + // IE and Opera are missing .innerHTML support for TABLE-related and SEL= ECT elements + Element.Methods.update =3D function(element, content) { + element =3D $(element); + + if (content && content.toElement) content =3D content.toElement(); + if (Object.isElement(content)) return element.update().insert(content); + + content =3D Object.toHTML(content); + var tagName =3D element.tagName.toUpperCase(); + + if (tagName in Element._insertionTranslations.tags) { + $A(element.childNodes).each(function(node) { element.removeChild(nod= e) }); + Element._getContentFromAnonymousElement(tagName, content.stripScript= s()) + .each(function(node) { element.appendChild(node) }); + } + else element.innerHTML =3D content.stripScripts(); + + content.evalScripts.bind(content).defer(); + return element; + }; +} + +if ('outerHTML' in document.createElement('div')) { + Element.Methods.replace =3D function(element, content) { + element =3D $(element); + + if (content && content.toElement) content =3D content.toElement(); + if (Object.isElement(content)) { + element.parentNode.replaceChild(content, element); + return element; + } + + content =3D Object.toHTML(content); + var parent =3D element.parentNode, tagName =3D parent.tagName.toUpperC= ase(); + + if (Element._insertionTranslations.tags[tagName]) { + var nextSibling =3D element.next(); + var fragments =3D Element._getContentFromAnonymousElement(tagName, c= ontent.stripScripts()); + parent.removeChild(element); + if (nextSibling) + fragments.each(function(node) { parent.insertBefore(node, nextSibl= ing) }); + else + fragments.each(function(node) { parent.appendChild(node) }); + } + else element.outerHTML =3D content.stripScripts(); + + content.evalScripts.bind(content).defer(); + return element; + }; +} + +Element._returnOffset =3D function(l, t) { + var result =3D [l, t]; + result.left =3D l; + result.top =3D t; + return result; +}; + +Element._getContentFromAnonymousElement =3D function(tagName, html) { + var div =3D new Element('div'), t =3D Element._insertionTranslations.tag= s[tagName]; + if (t) { + div.innerHTML =3D t[0] + html + t[1]; + t[2].times(function() { div =3D div.firstChild }); + } else div.innerHTML =3D html; + return $A(div.childNodes); +}; + +Element._insertionTranslations =3D { + before: function(element, node) { + element.parentNode.insertBefore(node, element); + }, + top: function(element, node) { + element.insertBefore(node, element.firstChild); + }, + bottom: function(element, node) { + element.appendChild(node); + }, + after: function(element, node) { + element.parentNode.insertBefore(node, element.nextSibling); + }, + tags: { + TABLE: ['', '
    ', 1], + TBODY: ['', '
    ', 2], + TR: ['', '
    ', 3], + TD: ['
    ', '
    ', 4], + SELECT: ['', 1] + } +}; + +(function() { + Object.extend(this.tags, { + THEAD: this.tags.TBODY, + TFOOT: this.tags.TBODY, + TH: this.tags.TD + }); +}).call(Element._insertionTranslations); + +Element.Methods.Simulated =3D { + hasAttribute: function(element, attribute) { + attribute =3D Element._attributeTranslations.has[attribute] || attribu= te; + var node =3D $(element).getAttributeNode(attribute); + return node && node.specified; + } +}; + +Element.Methods.ByTag =3D { }; + +Object.extend(Element, Element.Methods); + +if (!Prototype.BrowserFeatures.ElementExtensions && + document.createElement('div').__proto__) { + window.HTMLElement =3D { }; + window.HTMLElement.prototype =3D document.createElement('div').__proto__; + Prototype.BrowserFeatures.ElementExtensions =3D true; +} + +Element.extend =3D (function() { + if (Prototype.BrowserFeatures.SpecificElementExtensions) + return Prototype.K; + + var Methods =3D { }, ByTag =3D Element.Methods.ByTag; + + var extend =3D Object.extend(function(element) { + if (!element || element._extendedByPrototype || + element.nodeType !=3D 1 || element =3D=3D window) return element; + + var methods =3D Object.clone(Methods), + tagName =3D element.tagName, property, value; + + // extend methods for specific tags + if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]); + + for (property in methods) { + value =3D methods[property]; + if (Object.isFunction(value) && !(property in element)) + element[property] =3D value.methodize(); + } + + element._extendedByPrototype =3D Prototype.emptyFunction; + return element; + + }, { + refresh: function() { + // extend methods for all tags (Safari doesn't need this) + if (!Prototype.BrowserFeatures.ElementExtensions) { + Object.extend(Methods, Element.Methods); + Object.extend(Methods, Element.Methods.Simulated); + } + } + }); + + extend.refresh(); + return extend; +})(); + +Element.hasAttribute =3D function(element, attribute) { + if (element.hasAttribute) return element.hasAttribute(attribute); + return Element.Methods.Simulated.hasAttribute(element, attribute); +}; + +Element.addMethods =3D function(methods) { + var F =3D Prototype.BrowserFeatures, T =3D Element.Methods.ByTag; + + if (!methods) { + Object.extend(Form, Form.Methods); + Object.extend(Form.Element, Form.Element.Methods); + Object.extend(Element.Methods.ByTag, { + "FORM": Object.clone(Form.Methods), + "INPUT": Object.clone(Form.Element.Methods), + "SELECT": Object.clone(Form.Element.Methods), + "TEXTAREA": Object.clone(Form.Element.Methods) + }); + } + + if (arguments.length =3D=3D 2) { + var tagName =3D methods; + methods =3D arguments[1]; + } + + if (!tagName) Object.extend(Element.Methods, methods || { }); + else { + if (Object.isArray(tagName)) tagName.each(extend); + else extend(tagName); + } + + function extend(tagName) { + tagName =3D tagName.toUpperCase(); + if (!Element.Methods.ByTag[tagName]) + Element.Methods.ByTag[tagName] =3D { }; + Object.extend(Element.Methods.ByTag[tagName], methods); + } + + function copy(methods, destination, onlyIfAbsent) { + onlyIfAbsent =3D onlyIfAbsent || false; + for (var property in methods) { + var value =3D methods[property]; + if (!Object.isFunction(value)) continue; + if (!onlyIfAbsent || !(property in destination)) + destination[property] =3D value.methodize(); + } + } + + function findDOMClass(tagName) { + var klass; + var trans =3D { + "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph", + "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList", + "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading= ", + "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote", + "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION": + "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD": + "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "T= R": + "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET": + "FrameSet", "IFRAME": "IFrame" + }; + if (trans[tagName]) klass =3D 'HTML' + trans[tagName] + 'Element'; + if (window[klass]) return window[klass]; + klass =3D 'HTML' + tagName + 'Element'; + if (window[klass]) return window[klass]; + klass =3D 'HTML' + tagName.capitalize() + 'Element'; + if (window[klass]) return window[klass]; + + window[klass] =3D { }; + window[klass].prototype =3D document.createElement(tagName).__proto__; + return window[klass]; + } + + if (F.ElementExtensions) { + copy(Element.Methods, HTMLElement.prototype); + copy(Element.Methods.Simulated, HTMLElement.prototype, true); + } + + if (F.SpecificElementExtensions) { + for (var tag in Element.Methods.ByTag) { + var klass =3D findDOMClass(tag); + if (Object.isUndefined(klass)) continue; + copy(T[tag], klass.prototype); + } + } + + Object.extend(Element, Element.Methods); + delete Element.ByTag; + + if (Element.extend.refresh) Element.extend.refresh(); + Element.cache =3D { }; +}; + +document.viewport =3D { + getDimensions: function() { + var dimensions =3D { }; + var B =3D Prototype.Browser; + $w('width height').each(function(d) { + var D =3D d.capitalize(); + dimensions[d] =3D (B.WebKit && !document.evaluate) ? self['inner' + = D] : + (B.Opera) ? document.body['client' + D] : document.documentElement= ['client' + D]; + }); + return dimensions; + }, + + getWidth: function() { + return this.getDimensions().width; + }, + + getHeight: function() { + return this.getDimensions().height; + }, + + getScrollOffsets: function() { + return Element._returnOffset( + window.pageXOffset || document.documentElement.scrollLeft || documen= t.body.scrollLeft, + window.pageYOffset || document.documentElement.scrollTop || document= .body.scrollTop); + } +}; +/* Portions of the Selector class are derived from Jack Slocum=EF=BF=BD=DB= =AAs DomQuery, + * part of YUI-Ext version 0.40, distributed under the terms of an MIT-sty= le + * license. Please see http://www.yui-ext.com/ for more information. */ + +var Selector =3D Class.create({ + initialize: function(expression) { + this.expression =3D expression.strip(); + this.compileMatcher(); + }, + + shouldUseXPath: function() { + if (!Prototype.BrowserFeatures.XPath) return false; + + var e =3D this.expression; + + // Safari 3 chokes on :*-of-type and :empty + if (Prototype.Browser.WebKit && + (e.include("-of-type") || e.include(":empty"))) + return false; + + // XPath can't do namespaced attributes, nor can it read + // the "checked" property from DOM nodes + if ((/(\[[\w-]*?:|:checked)/).test(this.expression)) + return false; + + return true; + }, + + compileMatcher: function() { + if (this.shouldUseXPath()) + return this.compileXPathMatcher(); + + var e =3D this.expression, ps =3D Selector.patterns, h =3D Selector.ha= ndlers, + c =3D Selector.criteria, le, p, m; + + if (Selector._cache[e]) { + this.matcher =3D Selector._cache[e]; + return; + } + + this.matcher =3D ["this.matcher =3D function(root) {", + "var r =3D root, h =3D Selector.handlers, c =3D false,= n;"]; + + while (e && le !=3D e && (/\S/).test(e)) { + le =3D e; + for (var i in ps) { + p =3D ps[i]; + if (m =3D e.match(p)) { + this.matcher.push(Object.isFunction(c[i]) ? c[i](m) : + new Template(c[i]).evaluate(m)); + e =3D e.replace(m[0], ''); + break; + } + } + } + + this.matcher.push("return h.unique(n);\n}"); + eval(this.matcher.join('\n')); + Selector._cache[this.expression] =3D this.matcher; + }, + + compileXPathMatcher: function() { + var e =3D this.expression, ps =3D Selector.patterns, + x =3D Selector.xpath, le, m; + + if (Selector._cache[e]) { + this.xpath =3D Selector._cache[e]; return; + } + + this.matcher =3D ['.//*']; + while (e && le !=3D e && (/\S/).test(e)) { + le =3D e; + for (var i in ps) { + if (m =3D e.match(ps[i])) { + this.matcher.push(Object.isFunction(x[i]) ? x[i](m) : + new Template(x[i]).evaluate(m)); + e =3D e.replace(m[0], ''); + break; + } + } + } + + this.xpath =3D this.matcher.join(''); + Selector._cache[this.expression] =3D this.xpath; + }, + + findElements: function(root) { + root =3D root || document; + if (this.xpath) return document._getElementsByXPath(this.xpath, root); + return this.matcher(root); + }, + + match: function(element) { + this.tokens =3D []; + + var e =3D this.expression, ps =3D Selector.patterns, as =3D Selector.a= ssertions; + var le, p, m; + + while (e && le !=3D=3D e && (/\S/).test(e)) { + le =3D e; + for (var i in ps) { + p =3D ps[i]; + if (m =3D e.match(p)) { + // use the Selector.assertions methods unless the selector + // is too complex. + if (as[i]) { + this.tokens.push([i, Object.clone(m)]); + e =3D e.replace(m[0], ''); + } else { + // reluctantly do a document-wide search + // and look for a match in the array + return this.findElements(document).include(element); + } + } + } + } + + var match =3D true, name, matches; + for (var i =3D 0, token; token =3D this.tokens[i]; i++) { + name =3D token[0], matches =3D token[1]; + if (!Selector.assertions[name](element, matches)) { + match =3D false; break; + } + } + + return match; + }, + + toString: function() { + return this.expression; + }, + + inspect: function() { + return "#"; + } +}); + +Object.extend(Selector, { + _cache: { }, + + xpath: { + descendant: "//*", + child: "/*", + adjacent: "/following-sibling::*[1]", + laterSibling: '/following-sibling::*', + tagName: function(m) { + if (m[1] =3D=3D '*') return ''; + return "[local-name()=3D'" + m[1].toLowerCase() + + "' or local-name()=3D'" + m[1].toUpperCase() + "']"; + }, + className: "[contains(concat(' ', @class, ' '), ' #{1} ')]", + id: "[@id=3D'#{1}']", + attrPresence: function(m) { + m[1] =3D m[1].toLowerCase(); + return new Template("[@#{1}]").evaluate(m); + }, + attr: function(m) { + m[1] =3D m[1].toLowerCase(); + m[3] =3D m[5] || m[6]; + return new Template(Selector.xpath.operators[m[2]]).evaluate(m); + }, + pseudo: function(m) { + var h =3D Selector.xpath.pseudos[m[1]]; + if (!h) return ''; + if (Object.isFunction(h)) return h(m); + return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m); + }, + operators: { + '=3D': "[@#{1}=3D'#{3}']", + '!=3D': "[@#{1}!=3D'#{3}']", + '^=3D': "[starts-with(@#{1}, '#{3}')]", + '$=3D': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{= 3}') + 1))=3D'#{3}']", + '*=3D': "[contains(@#{1}, '#{3}')]", + '~=3D': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]", + '|=3D': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]" + }, + pseudos: { + 'first-child': '[not(preceding-sibling::*)]', + 'last-child': '[not(following-sibling::*)]', + 'only-child': '[not(preceding-sibling::* or following-sibling::*)]', + 'empty': "[count(*) =3D 0 and (count(text()) =3D 0 or translat= e(text(), ' \t\r\n', '') =3D '')]", + 'checked': "[@checked]", + 'disabled': "[@disabled]", + 'enabled': "[not(@disabled)]", + 'not': function(m) { + var e =3D m[6], p =3D Selector.patterns, + x =3D Selector.xpath, le, v; + + var exclusion =3D []; + while (e && le !=3D e && (/\S/).test(e)) { + le =3D e; + for (var i in p) { + if (m =3D e.match(p[i])) { + v =3D Object.isFunction(x[i]) ? x[i](m) : new Template(x[i])= .evaluate(m); + exclusion.push("(" + v.substring(1, v.length - 1) + ")"); + e =3D e.replace(m[0], ''); + break; + } + } + } + return "[not(" + exclusion.join(" and ") + ")]"; + }, + 'nth-child': function(m) { + return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) = + 1) ", m); + }, + 'nth-last-child': function(m) { + return Selector.xpath.pseudos.nth("(count(./following-sibling::*) = + 1) ", m); + }, + 'nth-of-type': function(m) { + return Selector.xpath.pseudos.nth("position() ", m); + }, + 'nth-last-of-type': function(m) { + return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m); + }, + 'first-of-type': function(m) { + m[6] =3D "1"; return Selector.xpath.pseudos['nth-of-type'](m); + }, + 'last-of-type': function(m) { + m[6] =3D "1"; return Selector.xpath.pseudos['nth-last-of-type'](m); + }, + 'only-of-type': function(m) { + var p =3D Selector.xpath.pseudos; return p['first-of-type'](m) + p= ['last-of-type'](m); + }, + nth: function(fragment, m) { + var mm, formula =3D m[6], predicate; + if (formula =3D=3D 'even') formula =3D '2n+0'; + if (formula =3D=3D 'odd') formula =3D '2n+1'; + if (mm =3D formula.match(/^(\d+)$/)) // digit only + return '[' + fragment + "=3D " + mm[1] + ']'; + if (mm =3D formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b + if (mm[1] =3D=3D "-") mm[1] =3D -1; + var a =3D mm[1] ? Number(mm[1]) : 1; + var b =3D mm[2] ? Number(mm[2]) : 0; + predicate =3D "[((#{fragment} - #{b}) mod #{a} =3D 0) and " + + "((#{fragment} - #{b}) div #{a} >=3D 0)]"; + return new Template(predicate).evaluate({ + fragment: fragment, a: a, b: b }); + } + } + } + }, + + criteria: { + tagName: 'n =3D h.tagName(n, r, "#{1}", c); c =3D false;', + className: 'n =3D h.className(n, r, "#{1}", c); c =3D false;', + id: 'n =3D h.id(n, r, "#{1}", c); c =3D false;', + attrPresence: 'n =3D h.attrPresence(n, r, "#{1}", c); c =3D false;', + attr: function(m) { + m[3] =3D (m[5] || m[6]); + return new Template('n =3D h.attr(n, r, "#{1}", "#{3}", "#{2}", c); = c =3D false;').evaluate(m); + }, + pseudo: function(m) { + if (m[6]) m[6] =3D m[6].replace(/"/g, '\\"'); + return new Template('n =3D h.pseudo(n, "#{1}", "#{6}", r, c); c =3D = false;').evaluate(m); + }, + descendant: 'c =3D "descendant";', + child: 'c =3D "child";', + adjacent: 'c =3D "adjacent";', + laterSibling: 'c =3D "laterSibling";' + }, + + patterns: { + // combinators must be listed first + // (and descendant needs to be last combinator) + laterSibling: /^\s*~\s*/, + child: /^\s*>\s*/, + adjacent: /^\s*\+\s*/, + descendant: /^\s/, + + // selectors follow + tagName: /^\s*(\*|[\w\-]+)(\b|$)?/, + id: /^#([\w\-\*]+)(\b|$)/, + className: /^\.([\w\-\*]+)(\b|$)/, + pseudo: +/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)= abled|not)(\((.*?)\))?(\b|$|(?=3D\s|[:+~>]))/, + attrPresence: /^\[([\w]+)\]/, + attr: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=3D)\s*((['"])([^= \4]*?)\4|([^'"][^\]]*?)))?\]/ + }, + + // for Selector.match and Element#match + assertions: { + tagName: function(element, matches) { + return matches[1].toUpperCase() =3D=3D element.tagName.toUpperCase(); + }, + + className: function(element, matches) { + return Element.hasClassName(element, matches[1]); + }, + + id: function(element, matches) { + return element.id =3D=3D=3D matches[1]; + }, + + attrPresence: function(element, matches) { + return Element.hasAttribute(element, matches[1]); + }, + + attr: function(element, matches) { + var nodeValue =3D Element.readAttribute(element, matches[1]); + return nodeValue && Selector.operators[matches[2]](nodeValue, matche= s[5] || matches[6]); + } + }, + + handlers: { + // UTILITY FUNCTIONS + // joins two collections + concat: function(a, b) { + for (var i =3D 0, node; node =3D b[i]; i++) + a.push(node); + return a; + }, + + // marks an array of nodes for counting + mark: function(nodes) { + var _true =3D Prototype.emptyFunction; + for (var i =3D 0, node; node =3D nodes[i]; i++) + node._countedByPrototype =3D _true; + return nodes; + }, + + unmark: function(nodes) { + for (var i =3D 0, node; node =3D nodes[i]; i++) + node._countedByPrototype =3D undefined; + return nodes; + }, + + // mark each child node with its position (for nth calls) + // "ofType" flag indicates whether we're indexing for nth-of-type + // rather than nth-child + index: function(parentNode, reverse, ofType) { + parentNode._countedByPrototype =3D Prototype.emptyFunction; + if (reverse) { + for (var nodes =3D parentNode.childNodes, i =3D nodes.length - 1, = j =3D 1; i >=3D 0; i--) { + var node =3D nodes[i]; + if (node.nodeType =3D=3D 1 && (!ofType || node._countedByPrototy= pe)) node.nodeIndex =3D j++; + } + } else { + for (var i =3D 0, j =3D 1, nodes =3D parentNode.childNodes; node = =3D nodes[i]; i++) + if (node.nodeType =3D=3D 1 && (!ofType || node._countedByPrototy= pe)) node.nodeIndex =3D j++; + } + }, + + // filters out duplicates and extends all nodes + unique: function(nodes) { + if (nodes.length =3D=3D 0) return nodes; + var results =3D [], n; + for (var i =3D 0, l =3D nodes.length; i < l; i++) + if (!(n =3D nodes[i])._countedByPrototype) { + n._countedByPrototype =3D Prototype.emptyFunction; + results.push(Element.extend(n)); + } + return Selector.handlers.unmark(results); + }, + + // COMBINATOR FUNCTIONS + descendant: function(nodes) { + var h =3D Selector.handlers; + for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) + h.concat(results, node.getElementsByTagName('*')); + return results; + }, + + child: function(nodes) { + var h =3D Selector.handlers; + for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) { + for (var j =3D 0, child; child =3D node.childNodes[j]; j++) + if (child.nodeType =3D=3D 1 && child.tagName !=3D '!') results.p= ush(child); + } + return results; + }, + + adjacent: function(nodes) { + for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) { + var next =3D this.nextElementSibling(node); + if (next) results.push(next); + } + return results; + }, + + laterSibling: function(nodes) { + var h =3D Selector.handlers; + for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) + h.concat(results, Element.nextSiblings(node)); + return results; + }, + + nextElementSibling: function(node) { + while (node =3D node.nextSibling) + if (node.nodeType =3D=3D 1) return node; + return null; + }, + + previousElementSibling: function(node) { + while (node =3D node.previousSibling) + if (node.nodeType =3D=3D 1) return node; + return null; + }, + + // TOKEN FUNCTIONS + tagName: function(nodes, root, tagName, combinator) { + var uTagName =3D tagName.toUpperCase(); + var results =3D [], h =3D Selector.handlers; + if (nodes) { + if (combinator) { + // fastlane for ordinary descendant combinators + if (combinator =3D=3D "descendant") { + for (var i =3D 0, node; node =3D nodes[i]; i++) + h.concat(results, node.getElementsByTagName(tagName)); + return results; + } else nodes =3D this[combinator](nodes); + if (tagName =3D=3D "*") return nodes; + } + for (var i =3D 0, node; node =3D nodes[i]; i++) + if (node.tagName.toUpperCase() =3D=3D=3D uTagName) results.push(= node); + return results; + } else return root.getElementsByTagName(tagName); + }, + + id: function(nodes, root, id, combinator) { + var targetNode =3D $(id), h =3D Selector.handlers; + if (!targetNode) return []; + if (!nodes && root =3D=3D document) return [targetNode]; + if (nodes) { + if (combinator) { + if (combinator =3D=3D 'child') { + for (var i =3D 0, node; node =3D nodes[i]; i++) + if (targetNode.parentNode =3D=3D node) return [targetNode]; + } else if (combinator =3D=3D 'descendant') { + for (var i =3D 0, node; node =3D nodes[i]; i++) + if (Element.descendantOf(targetNode, node)) return [targetNo= de]; + } else if (combinator =3D=3D 'adjacent') { + for (var i =3D 0, node; node =3D nodes[i]; i++) + if (Selector.handlers.previousElementSibling(targetNode) =3D= =3D node) + return [targetNode]; + } else nodes =3D h[combinator](nodes); + } + for (var i =3D 0, node; node =3D nodes[i]; i++) + if (node =3D=3D targetNode) return [targetNode]; + return []; + } + return (targetNode && Element.descendantOf(targetNode, root)) ? [tar= getNode] : []; + }, + + className: function(nodes, root, className, combinator) { + if (nodes && combinator) nodes =3D this[combinator](nodes); + return Selector.handlers.byClassName(nodes, root, className); + }, + + byClassName: function(nodes, root, className) { + if (!nodes) nodes =3D Selector.handlers.descendant([root]); + var needle =3D ' ' + className + ' '; + for (var i =3D 0, results =3D [], node, nodeClassName; node =3D node= s[i]; i++) { + nodeClassName =3D node.className; + if (nodeClassName.length =3D=3D 0) continue; + if (nodeClassName =3D=3D className || (' ' + nodeClassName + ' ').= include(needle)) + results.push(node); + } + return results; + }, + + attrPresence: function(nodes, root, attr, combinator) { + if (!nodes) nodes =3D root.getElementsByTagName("*"); + if (nodes && combinator) nodes =3D this[combinator](nodes); + var results =3D []; + for (var i =3D 0, node; node =3D nodes[i]; i++) + if (Element.hasAttribute(node, attr)) results.push(node); + return results; + }, + + attr: function(nodes, root, attr, value, operator, combinator) { + if (!nodes) nodes =3D root.getElementsByTagName("*"); + if (nodes && combinator) nodes =3D this[combinator](nodes); + var handler =3D Selector.operators[operator], results =3D []; + for (var i =3D 0, node; node =3D nodes[i]; i++) { + var nodeValue =3D Element.readAttribute(node, attr); + if (nodeValue =3D=3D=3D null) continue; + if (handler(nodeValue, value)) results.push(node); + } + return results; + }, + + pseudo: function(nodes, name, value, root, combinator) { + if (nodes && combinator) nodes =3D this[combinator](nodes); + if (!nodes) nodes =3D root.getElementsByTagName("*"); + return Selector.pseudos[name](nodes, value, root); + } + }, + + pseudos: { + 'first-child': function(nodes, value, root) { + for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) { + if (Selector.handlers.previousElementSibling(node)) continue; + results.push(node); + } + return results; + }, + 'last-child': function(nodes, value, root) { + for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) { + if (Selector.handlers.nextElementSibling(node)) continue; + results.push(node); + } + return results; + }, + 'only-child': function(nodes, value, root) { + var h =3D Selector.handlers; + for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) + if (!h.previousElementSibling(node) && !h.nextElementSibling(node)) + results.push(node); + return results; + }, + 'nth-child': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, formula, root); + }, + 'nth-last-child': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, formula, root, true); + }, + 'nth-of-type': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, formula, root, false, true); + }, + 'nth-last-of-type': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, formula, root, true, true); + }, + 'first-of-type': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, "1", root, false, true); + }, + 'last-of-type': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, "1", root, true, true); + }, + 'only-of-type': function(nodes, formula, root) { + var p =3D Selector.pseudos; + return p['last-of-type'](p['first-of-type'](nodes, formula, root), f= ormula, root); + }, + + // handles the an+b logic + getIndices: function(a, b, total) { + if (a =3D=3D 0) return b > 0 ? [b] : []; + return $R(1, total).inject([], function(memo, i) { + if (0 =3D=3D (i - b) % a && (i - b) / a >=3D 0) memo.push(i); + return memo; + }); + }, + + // handles nth(-last)-child, nth(-last)-of-type, and (first|last)-of-t= ype + nth: function(nodes, formula, root, reverse, ofType) { + if (nodes.length =3D=3D 0) return []; + if (formula =3D=3D 'even') formula =3D '2n+0'; + if (formula =3D=3D 'odd') formula =3D '2n+1'; + var h =3D Selector.handlers, results =3D [], indexed =3D [], m; + h.mark(nodes); + for (var i =3D 0, node; node =3D nodes[i]; i++) { + if (!node.parentNode._countedByPrototype) { + h.index(node.parentNode, reverse, ofType); + indexed.push(node.parentNode); + } + } + if (formula.match(/^\d+$/)) { // just a number + formula =3D Number(formula); + for (var i =3D 0, node; node =3D nodes[i]; i++) + if (node.nodeIndex =3D=3D formula) results.push(node); + } else if (m =3D formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b + if (m[1] =3D=3D "-") m[1] =3D -1; + var a =3D m[1] ? Number(m[1]) : 1; + var b =3D m[2] ? Number(m[2]) : 0; + var indices =3D Selector.pseudos.getIndices(a, b, nodes.length); + for (var i =3D 0, node, l =3D indices.length; node =3D nodes[i]; i= ++) { + for (var j =3D 0; j < l; j++) + if (node.nodeIndex =3D=3D indices[j]) results.push(node); + } + } + h.unmark(nodes); + h.unmark(indexed); + return results; + }, + + 'empty': function(nodes, value, root) { + for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) { + // IE treats comments as element nodes + if (node.tagName =3D=3D '!' || (node.firstChild && !node.innerHTML= .match(/^\s*$/))) continue; + results.push(node); + } + return results; + }, + + 'not': function(nodes, selector, root) { + var h =3D Selector.handlers, selectorType, m; + var exclusions =3D new Selector(selector).findElements(root); + h.mark(exclusions); + for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) + if (!node._countedByPrototype) results.push(node); + h.unmark(exclusions); + return results; + }, + + 'enabled': function(nodes, value, root) { + for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) + if (!node.disabled) results.push(node); + return results; + }, + + 'disabled': function(nodes, value, root) { + for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) + if (node.disabled) results.push(node); + return results; + }, + + 'checked': function(nodes, value, root) { + for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) + if (node.checked) results.push(node); + return results; + } + }, + + operators: { + '=3D': function(nv, v) { return nv =3D=3D v; }, + '!=3D': function(nv, v) { return nv !=3D v; }, + '^=3D': function(nv, v) { return nv.startsWith(v); }, + '$=3D': function(nv, v) { return nv.endsWith(v); }, + '*=3D': function(nv, v) { return nv.include(v); }, + '~=3D': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' = '); }, + '|=3D': function(nv, v) { return ('-' + nv.toUpperCase() + '-').includ= e('-' + v.toUpperCase() + '-'); } + }, + + split: function(expression) { + var expressions =3D []; + expression.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m= ) { + expressions.push(m[1].strip()); + }); + return expressions; + }, + + matchElements: function(elements, expression) { + var matches =3D $$(expression), h =3D Selector.handlers; + h.mark(matches); + for (var i =3D 0, results =3D [], element; element =3D elements[i]; i+= +) + if (element._countedByPrototype) results.push(element); + h.unmark(matches); + return results; + }, + + findElement: function(elements, expression, index) { + if (Object.isNumber(expression)) { + index =3D expression; expression =3D false; + } + return Selector.matchElements(elements, expression || '*')[index || 0]; + }, + + findChildElements: function(element, expressions) { + expressions =3D Selector.split(expressions.join(',')); + var results =3D [], h =3D Selector.handlers; + for (var i =3D 0, l =3D expressions.length, selector; i < l; i++) { + selector =3D new Selector(expressions[i].strip()); + h.concat(results, selector.findElements(element)); + } + return (l > 1) ? h.unique(results) : results; + } +}); + +if (Prototype.Browser.IE) { + Object.extend(Selector.handlers, { + // IE returns comment nodes on getElementsByTagName("*"). + // Filter them out. + concat: function(a, b) { + for (var i =3D 0, node; node =3D b[i]; i++) + if (node.tagName !=3D=3D "!") a.push(node); + return a; + }, + + // IE improperly serializes _countedByPrototype in (inner|outer)HTML. + unmark: function(nodes) { + for (var i =3D 0, node; node =3D nodes[i]; i++) + node.removeAttribute('_countedByPrototype'); + return nodes; + } + }); +} + +function $$() { + return Selector.findChildElements(document, $A(arguments)); +} +var Form =3D { + reset: function(form) { + $(form).reset(); + return form; + }, + + serializeElements: function(elements, options) { + if (typeof options !=3D 'object') options =3D { hash: !!options }; + else if (Object.isUndefined(options.hash)) options.hash =3D true; + var key, value, submitted =3D false, submit =3D options.submit; + + var data =3D elements.inject({ }, function(result, element) { + if (!element.disabled && element.name) { + key =3D element.name; value =3D $(element).getValue(); + if (value !=3D null && (element.type !=3D 'submit' || (!submitted = && + submit !=3D=3D false && (!submit || key =3D=3D submit) && (sub= mitted =3D true)))) { + if (key in result) { + // a key is already present; construct an array of values + if (!Object.isArray(result[key])) result[key] =3D [result[key]= ]; + result[key].push(value); + } + else result[key] =3D value; + } + } + return result; + }); + + return options.hash ? data : Object.toQueryString(data); + } +}; + +Form.Methods =3D { + serialize: function(form, options) { + return Form.serializeElements(Form.getElements(form), options); + }, + + getElements: function(form) { + return $A($(form).getElementsByTagName('*')).inject([], + function(elements, child) { + if (Form.Element.Serializers[child.tagName.toLowerCase()]) + elements.push(Element.extend(child)); + return elements; + } + ); + }, + + getInputs: function(form, typeName, name) { + form =3D $(form); + var inputs =3D form.getElementsByTagName('input'); + + if (!typeName && !name) return $A(inputs).map(Element.extend); + + for (var i =3D 0, matchingInputs =3D [], length =3D inputs.length; i <= length; i++) { + var input =3D inputs[i]; + if ((typeName && input.type !=3D typeName) || (name && input.name != =3D name)) + continue; + matchingInputs.push(Element.extend(input)); + } + + return matchingInputs; + }, + + disable: function(form) { + form =3D $(form); + Form.getElements(form).invoke('disable'); + return form; + }, + + enable: function(form) { + form =3D $(form); + Form.getElements(form).invoke('enable'); + return form; + }, + + findFirstElement: function(form) { + var elements =3D $(form).getElements().findAll(function(element) { + return 'hidden' !=3D element.type && !element.disabled; + }); + var firstByIndex =3D elements.findAll(function(element) { + return element.hasAttribute('tabIndex') && element.tabIndex >=3D 0; + }).sortBy(function(element) { return element.tabIndex }).first(); + + return firstByIndex ? firstByIndex : elements.find(function(element) { + return ['input', 'select', 'textarea'].include(element.tagName.toLow= erCase()); + }); + }, + + focusFirstElement: function(form) { + form =3D $(form); + form.findFirstElement().activate(); + return form; + }, + + request: function(form, options) { + form =3D $(form), options =3D Object.clone(options || { }); + + var params =3D options.parameters, action =3D form.readAttribute('acti= on') || ''; + if (action.blank()) action =3D window.location.href; + options.parameters =3D form.serialize(true); + + if (params) { + if (Object.isString(params)) params =3D params.toQueryParams(); + Object.extend(options.parameters, params); + } + + if (form.hasAttribute('method') && !options.method) + options.method =3D form.method; + + return new Ajax.Request(action, options); + } +}; + +/*------------------------------------------------------------------------= --*/ + +Form.Element =3D { + focus: function(element) { + $(element).focus(); + return element; + }, + + select: function(element) { + $(element).select(); + return element; + } +}; + +Form.Element.Methods =3D { + serialize: function(element) { + element =3D $(element); + if (!element.disabled && element.name) { + var value =3D element.getValue(); + if (value !=3D undefined) { + var pair =3D { }; + pair[element.name] =3D value; + return Object.toQueryString(pair); + } + } + return ''; + }, + + getValue: function(element) { + element =3D $(element); + var method =3D element.tagName.toLowerCase(); + return Form.Element.Serializers[method](element); + }, + + setValue: function(element, value) { + element =3D $(element); + var method =3D element.tagName.toLowerCase(); + Form.Element.Serializers[method](element, value); + return element; + }, + + clear: function(element) { + $(element).value =3D ''; + return element; + }, + + present: function(element) { + return $(element).value !=3D ''; + }, + + activate: function(element) { + element =3D $(element); + try { + element.focus(); + if (element.select && (element.tagName.toLowerCase() !=3D 'input' || + !['button', 'reset', 'submit'].include(element.type))) + element.select(); + } catch (e) { } + return element; + }, + + disable: function(element) { + element =3D $(element); + element.blur(); + element.disabled =3D true; + return element; + }, + + enable: function(element) { + element =3D $(element); + element.disabled =3D false; + return element; + } +}; + +/*------------------------------------------------------------------------= --*/ + +var Field =3D Form.Element; +var $F =3D Form.Element.Methods.getValue; + +/*------------------------------------------------------------------------= --*/ + +Form.Element.Serializers =3D { + input: function(element, value) { + switch (element.type.toLowerCase()) { + case 'checkbox': + case 'radio': + return Form.Element.Serializers.inputSelector(element, value); + default: + return Form.Element.Serializers.textarea(element, value); + } + }, + + inputSelector: function(element, value) { + if (Object.isUndefined(value)) return element.checked ? element.value = : null; + else element.checked =3D !!value; + }, + + textarea: function(element, value) { + if (Object.isUndefined(value)) return element.value; + else element.value =3D value; + }, + + select: function(element, index) { + if (Object.isUndefined(index)) + return this[element.type =3D=3D 'select-one' ? + 'selectOne' : 'selectMany'](element); + else { + var opt, value, single =3D !Object.isArray(index); + for (var i =3D 0, length =3D element.length; i < length; i++) { + opt =3D element.options[i]; + value =3D this.optionValue(opt); + if (single) { + if (value =3D=3D index) { + opt.selected =3D true; + return; + } + } + else opt.selected =3D index.include(value); + } + } + }, + + selectOne: function(element) { + var index =3D element.selectedIndex; + return index >=3D 0 ? this.optionValue(element.options[index]) : null; + }, + + selectMany: function(element) { + var values, length =3D element.length; + if (!length) return null; + + for (var i =3D 0, values =3D []; i < length; i++) { + var opt =3D element.options[i]; + if (opt.selected) values.push(this.optionValue(opt)); + } + return values; + }, + + optionValue: function(opt) { + // extend element because hasAttribute may not be native + return Element.extend(opt).hasAttribute('value') ? opt.value : opt.tex= t; + } +}; + +/*------------------------------------------------------------------------= --*/ + +Abstract.TimedObserver =3D Class.create(PeriodicalExecuter, { + initialize: function($super, element, frequency, callback) { + $super(callback, frequency); + this.element =3D $(element); + this.lastValue =3D this.getValue(); + }, + + execute: function() { + var value =3D this.getValue(); + if (Object.isString(this.lastValue) && Object.isString(value) ? + this.lastValue !=3D value : String(this.lastValue) !=3D String(val= ue)) { + this.callback(this.element, value); + this.lastValue =3D value; + } + } +}); + +Form.Element.Observer =3D Class.create(Abstract.TimedObserver, { + getValue: function() { + return Form.Element.getValue(this.element); + } +}); + +Form.Observer =3D Class.create(Abstract.TimedObserver, { + getValue: function() { + return Form.serialize(this.element); + } +}); + +/*------------------------------------------------------------------------= --*/ + +Abstract.EventObserver =3D Class.create({ + initialize: function(element, callback) { + this.element =3D $(element); + this.callback =3D callback; + + this.lastValue =3D this.getValue(); + if (this.element.tagName.toLowerCase() =3D=3D 'form') + this.registerFormCallbacks(); + else + this.registerCallback(this.element); + }, + + onElementEvent: function() { + var value =3D this.getValue(); + if (this.lastValue !=3D value) { + this.callback(this.element, value); + this.lastValue =3D value; + } + }, + + registerFormCallbacks: function() { + Form.getElements(this.element).each(this.registerCallback, this); + }, + + registerCallback: function(element) { + if (element.type) { + switch (element.type.toLowerCase()) { + case 'checkbox': + case 'radio': + Event.observe(element, 'click', this.onElementEvent.bind(this)); + break; + default: + Event.observe(element, 'change', this.onElementEvent.bind(this)); + break; + } + } + } +}); + +Form.Element.EventObserver =3D Class.create(Abstract.EventObserver, { + getValue: function() { + return Form.Element.getValue(this.element); + } +}); + +Form.EventObserver =3D Class.create(Abstract.EventObserver, { + getValue: function() { + return Form.serialize(this.element); + } +}); +if (!window.Event) var Event =3D { }; + +Object.extend(Event, { + KEY_BACKSPACE: 8, + KEY_TAB: 9, + KEY_RETURN: 13, + KEY_ESC: 27, + KEY_LEFT: 37, + KEY_UP: 38, + KEY_RIGHT: 39, + KEY_DOWN: 40, + KEY_DELETE: 46, + KEY_HOME: 36, + KEY_END: 35, + KEY_PAGEUP: 33, + KEY_PAGEDOWN: 34, + KEY_INSERT: 45, + + cache: { }, + + relatedTarget: function(event) { + var element; + switch(event.type) { + case 'mouseover': element =3D event.fromElement; break; + case 'mouseout': element =3D event.toElement; break; + default: return null; + } + return Element.extend(element); + } +}); + +Event.Methods =3D (function() { + var isButton; + + if (Prototype.Browser.IE) { + var buttonMap =3D { 0: 1, 1: 4, 2: 2 }; + isButton =3D function(event, code) { + return event.button =3D=3D buttonMap[code]; + }; + + } else if (Prototype.Browser.WebKit) { + isButton =3D function(event, code) { + switch (code) { + case 0: return event.which =3D=3D 1 && !event.metaKey; + case 1: return event.which =3D=3D 1 && event.metaKey; + default: return false; + } + }; + + } else { + isButton =3D function(event, code) { + return event.which ? (event.which =3D=3D=3D code + 1) : (event.butto= n =3D=3D=3D code); + }; + } + + return { + isLeftClick: function(event) { return isButton(event, 0) }, + isMiddleClick: function(event) { return isButton(event, 1) }, + isRightClick: function(event) { return isButton(event, 2) }, + + element: function(event) { + var node =3D Event.extend(event).target; + return Element.extend(node.nodeType =3D=3D Node.TEXT_NODE ? node.par= entNode : node); + }, + + findElement: function(event, expression) { + var element =3D Event.element(event); + if (!expression) return element; + var elements =3D [element].concat(element.ancestors()); + return Selector.findElement(elements, expression, 0); + }, + + pointer: function(event) { + return { + x: event.pageX || (event.clientX + + (document.documentElement.scrollLeft || document.body.scrollLeft= )), + y: event.pageY || (event.clientY + + (document.documentElement.scrollTop || document.body.scrollTop)) + }; + }, + + pointerX: function(event) { return Event.pointer(event).x }, + pointerY: function(event) { return Event.pointer(event).y }, + + stop: function(event) { + Event.extend(event); + event.preventDefault(); + event.stopPropagation(); + event.stopped =3D true; + } + }; +})(); + +Event.extend =3D (function() { + var methods =3D Object.keys(Event.Methods).inject({ }, function(m, name)= { + m[name] =3D Event.Methods[name].methodize(); + return m; + }); + + if (Prototype.Browser.IE) { + Object.extend(methods, { + stopPropagation: function() { this.cancelBubble =3D true }, + preventDefault: function() { this.returnValue =3D false }, + inspect: function() { return "[object Event]" } + }); + + return function(event) { + if (!event) return false; + if (event._extendedByPrototype) return event; + + event._extendedByPrototype =3D Prototype.emptyFunction; + var pointer =3D Event.pointer(event); + Object.extend(event, { + target: event.srcElement, + relatedTarget: Event.relatedTarget(event), + pageX: pointer.x, + pageY: pointer.y + }); + return Object.extend(event, methods); + }; + + } else { + Event.prototype =3D Event.prototype || document.createEvent("HTMLEvent= s").__proto__; + Object.extend(Event.prototype, methods); + return Prototype.K; + } +})(); + +Object.extend(Event, (function() { + var cache =3D Event.cache; + + function getEventID(element) { + if (element._prototypeEventID) return element._prototypeEventID[0]; + arguments.callee.id =3D arguments.callee.id || 1; + return element._prototypeEventID =3D [++arguments.callee.id]; + } + + function getDOMEventName(eventName) { + if (eventName && eventName.include(':')) return "dataavailable"; + return eventName; + } + + function getCacheForID(id) { + return cache[id] =3D cache[id] || { }; + } + + function getWrappersForEventName(id, eventName) { + var c =3D getCacheForID(id); + return c[eventName] =3D c[eventName] || []; + } + + function createWrapper(element, eventName, handler) { + var id =3D getEventID(element); + var c =3D getWrappersForEventName(id, eventName); + if (c.pluck("handler").include(handler)) return false; + + var wrapper =3D function(event) { + if (!Event || !Event.extend || + (event.eventName && event.eventName !=3D eventName)) + return false; + + Event.extend(event); + handler.call(element, event); + }; + + wrapper.handler =3D handler; + c.push(wrapper); + return wrapper; + } + + function findWrapper(id, eventName, handler) { + var c =3D getWrappersForEventName(id, eventName); + return c.find(function(wrapper) { return wrapper.handler =3D=3D handle= r }); + } + + function destroyWrapper(id, eventName, handler) { + var c =3D getCacheForID(id); + if (!c[eventName]) return false; + c[eventName] =3D c[eventName].without(findWrapper(id, eventName, handl= er)); + } + + function destroyCache() { + for (var id in cache) + for (var eventName in cache[id]) + cache[id][eventName] =3D null; + } + + if (window.attachEvent) { + window.attachEvent("onunload", destroyCache); + } + + return { + observe: function(element, eventName, handler) { + element =3D $(element); + var name =3D getDOMEventName(eventName); + + var wrapper =3D createWrapper(element, eventName, handler); + if (!wrapper) return element; + + if (element.addEventListener) { + element.addEventListener(name, wrapper, false); + } else { + element.attachEvent("on" + name, wrapper); + } + + return element; + }, + + stopObserving: function(element, eventName, handler) { + element =3D $(element); + var id =3D getEventID(element), name =3D getDOMEventName(eventName); + + if (!handler && eventName) { + getWrappersForEventName(id, eventName).each(function(wrapper) { + element.stopObserving(eventName, wrapper.handler); + }); + return element; + + } else if (!eventName) { + Object.keys(getCacheForID(id)).each(function(eventName) { + element.stopObserving(eventName); + }); + return element; + } + + var wrapper =3D findWrapper(id, eventName, handler); + if (!wrapper) return element; + + if (element.removeEventListener) { + element.removeEventListener(name, wrapper, false); + } else { + element.detachEvent("on" + name, wrapper); + } + + destroyWrapper(id, eventName, handler); + + return element; + }, + + fire: function(element, eventName, memo) { + element =3D $(element); + if (element =3D=3D document && document.createEvent && !element.disp= atchEvent) + element =3D document.documentElement; + + var event; + if (document.createEvent) { + event =3D document.createEvent("HTMLEvents"); + event.initEvent("dataavailable", true, true); + } else { + event =3D document.createEventObject(); + event.eventType =3D "ondataavailable"; + } + + event.eventName =3D eventName; + event.memo =3D memo || { }; + + if (document.createEvent) { + element.dispatchEvent(event); + } else { + element.fireEvent(event.eventType, event); + } + + return Event.extend(event); + } + }; +})()); + +Object.extend(Event, Event.Methods); + +Element.addMethods({ + fire: Event.fire, + observe: Event.observe, + stopObserving: Event.stopObserving +}); + +Object.extend(document, { + fire: Element.Methods.fire.methodize(), + observe: Element.Methods.observe.methodize(), + stopObserving: Element.Methods.stopObserving.methodize(), + loaded: false +}); + +(function() { + /* Support for the DOMContentLoaded event is based on work by Dan Webb, + Matthias Miller, Dean Edwards and John Resig. */ + + var timer; + + function fireContentLoadedEvent() { + if (document.loaded) return; + if (timer) window.clearInterval(timer); + document.fire("dom:loaded"); + document.loaded =3D true; + } + + if (document.addEventListener) { + if (Prototype.Browser.WebKit) { + timer =3D window.setInterval(function() { + if (/loaded|complete/.test(document.readyState)) + fireContentLoadedEvent(); + }, 0); + + Event.observe(window, "load", fireContentLoadedEvent); + + } else { + document.addEventListener("DOMContentLoaded", + fireContentLoadedEvent, false); + } + + } else { + document.write(" + + + + --===============8885246203895835885==-- From portal-commits at lists.jboss.org Sun Feb 10 21:57:55 2008 Content-Type: multipart/mixed; boundary="===============5797208760909540506==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9931 - modules/portlet/trunk/test/src/test/resources/simple-portal-war/js. Date: Sun, 10 Feb 2008 21:57:55 -0500 Message-ID: --===============5797208760909540506== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-10 21:57:55 -0500 (Sun, 10 Feb 2008) New Revision: 9931 Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/js/shado= wbox.js Log: small fix Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/j= s/shadowbox.js =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/js/shad= owbox.js 2008-02-11 02:47:55 UTC (rev 9930) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/js/shad= owbox.js 2008-02-11 02:57:55 UTC (rev 9931) @@ -69,7 +69,7 @@ * * @var {String} loadingImage */ - loadingImage: 'images/loading.gif', + loadingImage: '../images/loading.gif', = /** * Enable animations. @@ -118,7 +118,7 @@ * * @var {String} overlayBgImage */ - overlayBgImage: 'images/overlay-85.png', + overlayBgImage: '../images/overlay-85.png', = /** * Automatically play movies. --===============5797208760909540506==-- From portal-commits at lists.jboss.org Sun Feb 10 23:05:51 2008 Content-Type: multipart/mixed; boundary="===============2127310055338555483==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9932 - in modules/portlet/trunk/test/src: main/java/org/jboss/portal/portlet/portal/samples/event and 2 other directories. Date: Sun, 10 Feb 2008 23:05:51 -0500 Message-ID: --===============2127310055338555483== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-10 23:05:50 -0500 (Sun, 10 Feb 2008) New Revision: 9932 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/basic/HeaderPortlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/event/CartPortlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/event/CatalogPortlet.java modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= tags/portal/portlet.tag modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o1.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o3.jsp Log: some script enhancements Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /portal/samples/basic/HeaderPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/HeaderPortlet.java 2008-02-11 02:57:55 UTC (rev 9931) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/HeaderPortlet.java 2008-02-11 04:05:50 UTC (rev 9932) @@ -54,7 +54,7 @@ // resp.setContentType("text/html"); PrintWriter writer =3D resp.getWriter(); - writer.print("Click me to trigger script"); + writer.print(""); } = public void serveResource(ResourceRequest req, ResourceResponse resp) t= hrows PortletException, IOException @@ -62,7 +62,8 @@ String namespace =3Dresp.getNamespace(); resp.setContentType("text/javascript"); PrintWriter writer =3D resp.getWriter(); - writer.print("function " + namespace + "_handle() { alert('Some ale= rt'); }"); + writer.print("function " + namespace + "_handle() { " + + "new Effect.Grow(document.getElementById('header-portlet')) }"); writer.close(); } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /portal/samples/event/CartPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/event/CartPortlet.java 2008-02-11 02:57:55 UTC (rev 9931) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/event/CartPortlet.java 2008-02-11 04:05:50 UTC (rev 9932) @@ -52,7 +52,7 @@ = if (!items.isEmpty()) { - writer.append("Description<= tbody>"); + writer.append("
    Price
    "); int total =3D 0; for (CatalogItem item : items) { Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /portal/samples/event/CatalogPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/event/CatalogPortlet.java 2008-02-11 02:57:55 UTC (rev 9931) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/event/CatalogPortlet.java 2008-02-11 04:05:50 UTC (rev 9932) @@ -56,7 +56,7 @@ { addURL.setParameter("id", item.getId()); writer.append(""); + .append(""); } = writer.append("
    DescriptionPric= e
    ").append(item.getDescription()).append("<= /td>$").append("" + item.getPrice()) - .append("Add to cart
    Add to cart
    "); Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/tags/portal/portlet.tag =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /tags/portal/portlet.tag 2008-02-11 02:57:55 UTC (rev 9931) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /tags/portal/portlet.tag 2008-02-11 04:05:50 UTC (rev 9932) @@ -1,11 +1,13 @@ <%@ tag body-content=3D"scriptless" %> <%@ attribute name=3D"name" rtexprvalue=3D"true" required=3D"true" %> <%@ attribute name=3D"applicationName" rtexprvalue=3D"true" required=3D"tr= ue" %> +<%@ attribute name=3D"id" rtexprvalue=3D"true" required=3D"false" %> <%@ attribute name=3D"content" fragment=3D"true" required=3D"false" %> <%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> +<%@ taglib prefix=3D"fn" uri=3D"http://java.sun.com/jsp/jstl/functions" %> = -
    +
    Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/demo1.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo1.jsp 2008-02-11 02:57:55 UTC (rev 9931) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo1.jsp 2008-02-11 04:05:50 UTC (rev 9932) @@ -10,10 +10,10 @@ - + - + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/demo3.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo3.jsp 2008-02-11 02:57:55 UTC (rev 9931) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo3.jsp 2008-02-11 04:05:50 UTC (rev 9932) @@ -10,14 +10,11 @@ - - - - + --===============2127310055338555483==-- From portal-commits at lists.jboss.org Sun Feb 10 23:56:13 2008 Content-Type: multipart/mixed; boundary="===============9009366675599817940==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9933 - modules/portlet/trunk/test/src/test. Date: Sun, 10 Feb 2008 23:56:13 -0500 Message-ID: --===============9009366675599817940== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-10 23:56:13 -0500 (Sun, 10 Feb 2008) New Revision: 9933 Modified: modules/portlet/trunk/test/src/test/build.xml Log: - Started packaging effort. Only as42 version has been tested so far. Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-11 04:05:50 UTC (= rev 9932) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-11 04:56:13 UTC (= rev 9933) @@ -404,7 +404,6 @@ = = - @@ -688,10 +687,40 @@ = = + + + + + + + + + + + + + + + + + + + + + + + + = - + = + + + + + + @@ -722,83 +751,77 @@ + = - + + + + + + - - = - + + = - - - - - - - - - - - - - - = - + = - + = - - - + + = - + + + + - + - - + + = - + - - + + = - + - - + + = - + - - + + = - + - - + + = --===============9009366675599817940==-- From portal-commits at lists.jboss.org Mon Feb 11 02:52:14 2008 Content-Type: multipart/mixed; boundary="===============7515469155169777392==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9934 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Mon, 11 Feb 2008 02:52:14 -0500 Message-ID: --===============7515469155169777392== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-11 02:52:14 -0500 (Mon, 11 Feb 2008) New Revision: 9934 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: minor rivisions to 5.2.1.4. Application Descriptors Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-11 04:56:13 UTC (rev 9933) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-11 07:52:14 UTC (rev 9934) @@ -297,7 +297,7 @@ HelloWorldPortlet]]> - Define the portlet name. It does not have to be the Class name. + Define the portlet name. It does not have to be the class name. @@ -318,11 +318,8 @@ The <supports> element allows you to declare al= l the markup types your portlet supports in the render method. This is accomp= lished via the - <mime-type> element, which is required for ever= y portlet. The declared MIME types must match the capability of the portlet. + <mime-type> element, which is required for ever= y portlet. The declared MIME types must match the capability of the portlet= . As well, it allows you to pair which modes and window states are supporte= d for each markup type. All portlets must support the VIEW portlet mode, so= this does not have to be declared. Use <mime-type> to define which markup type your portlet supports, which in this example,= is text/html. This section tells the portal that it wil= l only output text and HTML, and that it only supports the VIEW mode. - - As well, it allows you to pair which modes and window states are support= ed for each markup type. All portlets must support the VIEW portlet mode, s= o this does not have to be declared. Use <mime-type> to define which markup type your portlet supports, which in this example= , is text/html. This section tells the portal that it wi= ll only output text and HTML, and that it only supports the VIEW mode. - - The HelloWorldPortlet/WEB-INF/portlet-instances.xml= file is a JBoss Portal specific descriptor, that allows you to create inst= ances of portlets. The <portlet-ref> value must match the <= ;portlet-name> value given in the HelloWorldPortlet/WEB-INF/portlet.xml = file. The <instance-id> - value can be named anything, but it must match the <instance= -ref> values given - in the *-object.xml files, which in this example, wou= ld be HelloWorldPortlet/WEB-INF/helloworld-object.xml. -The following is an example of the HelloWorldPortlet/WEB-= INF/portlet-instances.xml file: + value can be named anything, but it must match the <instance= -ref> value given + in the *-object.xml files, which in this example, wou= ld be the HelloWorldPortlet/WEB-INF/helloworld-object.xml file. + + + The following is an example of the HelloWorldPortlet/WEB-INF/po= rtlet-instances.xml file: - specifies that it will display the markup generated by the He= lloWorldPortletInstance portlet instance. + specifies that the window will display the markup generated by the HelloWorldPortletInstance portlet instance. @@ -386,7 +384,7 @@ - specifies where the window will appear on the page, by the <region> element. + the <region> element specifies = where the window will appear on the page. @@ -421,8 +419,7 @@ - Tells the portal where this portlet should appear. In this case, default.default specifies that this portlet shoul= d appear in the portal instance named default and the pa= ge named - default. + Tells the portal where this portlet should appear. In this case, default.default specifies that the portlet will a= ppear in the portal instance named default, and on the p= age named default. @@ -431,7 +428,7 @@ - Instructs the portal to overwrite or keep this object if it already exis= ts. Possible values are overwrite or keep. overwrite will destroy the existing object and cre= ate a new one based on the content of the deployment. keep will maintain the existing object deployment or create a new one if it d= oes not yet exist. + Instructs the portal to overwrite or keep this object if it already exis= ts. Possible values are overwrite or keep. The overwrite value will destroy the existing obje= ct and create a new one based on the content of the deployment. The keep option will maintain the existing object deployment or cre= ate a new one if it does not exist. @@ -449,8 +446,8 @@ - The value of instance-ref must match the value of one= of the - instance-id found in <= literal>portlet-instances.xml. + The value of <instance-ref> must match the valu= e of one of the + <instance-id> elements found in the = HelloWorldPortlet/WEB-INF/portlet-instances.xml file. @@ -460,22 +457,23 @@ - Specify the layout region and order this window will be found on the por= tal page. + Specifies the layout region, and the order this window will be found on = the portal page. - - - To illustrate the relationship between the descriptors, we = have provided this simple diagram + + The following diagram illustrates the relationship between the = portlet.xml, portlet-instances.xml, and helloworld-object.xml descriptors: + + - + = Portal 2.6 introduces the notion of content type<= /emphasis>, which is a generic mechanism to --===============7515469155169777392==-- From portal-commits at lists.jboss.org Mon Feb 11 16:01:11 2008 Content-Type: multipart/mixed; boundary="===============3414310378971464815==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9935 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Mon, 11 Feb 2008 16:01:10 -0500 Message-ID: --===============3414310378971464815== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-11 16:01:10 -0500 (Mon, 11 Feb 2008) New Revision: 9935 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: revising last two paragraphs for 5.2.1.4. Application Descriptors Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-11 07:52:14 UTC (rev 9934) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-11 21:01:10 UTC (rev 9935) @@ -476,11 +476,13 @@ = - Portal 2.6 introduces the notion of content type<= /emphasis>, which is a generic mechanism to - specify which content will be displayed by a given portlet = window. The window section - of the previous example can be re-written to take advantage= of the new content framework, resulting in - the following deployment descriptor: - + JBoss Portal 2.6 introduces the notion of content= type, which is a generic mechanism to + specify what content will be displayed by a given portlet w= indow. The window section + of the previous example, HelloWorldPortlet/WEB-INF/hello= world-object.xml, can be re-written to take advantage of the new= content framework. The following is an example deployment descriptor that = uses the new content framework: + + + @@ -498,17 +500,24 @@ 1 -]]> - - +]]> + + + = - This declaration is equivalent to the previous example. We = specify that the content being displayed by - the HelloWorldPortletWindow is a portlet content. The content URI - identifies which content to be displayed, in this case, the= HelloWorldPortletInstance. - It is possible to declare windows with a cms content type and use directly the path to - the file in the CMS to make the window show the content of = the associated file. That behavior is - pluggable and it is possible to plug virtually any kind of = content. - = + This is equivalent to the previous HelloWorldPortlet/WEB-INF/h= elloworld-object.xml example. The content to be display can be s= pecified using <content-type>. In th= is example, the content being displayed is a portlet. The &= lt;content-uri> specifies which content to display, in = this case, the HelloWorldPortletInstance: + + + + portlet + HelloWorldPortletInstance +]]> + + + + To display certain content or a file, use the cms content-type, with the <content-uri> being the path to the file in the CMS. This behavior is pluggab= le, and it is possible to plug almost any kind of content. + = Building your portlet --===============3414310378971464815==-- From portal-commits at lists.jboss.org Mon Feb 11 16:47:48 2008 Content-Type: multipart/mixed; boundary="===============0700211780321578687==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9936 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Mon, 11 Feb 2008 16:47:48 -0500 Message-ID: --===============0700211780321578687== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-11 16:47:47 -0500 (Mon, 11 Feb 2008) New Revision: 9936 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: 5.2.1.4. Application Descriptors rewriting me rewrite, seemed to have missed the point... Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-11 21:01:10 UTC (rev 9935) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-11 21:47:47 UTC (rev 9936) @@ -505,7 +505,7 @@ = - This is equivalent to the previous HelloWorldPortlet/WEB-INF/h= elloworld-object.xml example. The content to be display can be s= pecified using <content-type>. In th= is example, the content being displayed is a portlet. The &= lt;content-uri> specifies which content to display, in = this case, the HelloWorldPortletInstance: + This declaration is equivalent to the previous HelloWorldPortl= et/WEB-INF/helloworld-object.xml example. Use &l= t;content-type> to specify the content to display. In t= his example, the content being displayed by HelloWorldPortl= etWindow is a portlet. The <content-uri= > element specifies which content to display, in this e= xample, the HelloWorldPortletInstance: --===============8952835185116777965== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-11 20:08:04 -0500 (Mon, 11 Feb 2008) New Revision: 9937 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: 5.2.1.4. Application Descriptors final revision, updating certain literal tags to computeroutput, as per content in screen tags... Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-11 21:47:47 UTC (rev 9936) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-12 01:08:04 UTC (rev 9937) @@ -316,9 +316,8 @@ ]]> - The <supports> element allows you to declare al= l the markup types your - portlet supports in the render method. This is accomp= lished via the - <mime-type> element, which is required for ever= y portlet. The declared MIME types must match the capability of the portlet= . As well, it allows you to pair which modes and window states are supporte= d for each markup type. All portlets must support the VIEW portlet mode, so= this does not have to be declared. Use <mime-type> to define which markup type your portlet supports, which in this example,= is text/html. This section tells the portal that it wil= l only output text and HTML, and that it only supports the VIEW mode. + The <supports> element allows you= to declare all the markup types your portlet supports in the rend= er method. This is accomplished via the + <mime-type> element, which is req= uired for every portlet. The declared MIME types must match the capability = of the portlet. As well, it allows you to pair which modes and window state= s are supported for each markup type. All portlets must support the VIEW po= rtlet mode, so this does not have to be declared. Use <m= ime-type> to define which markup type your portlet supp= orts, which in this example, is text/html.= This section tells the portal that it will only output text and HTML, and = that it only supports the VIEW mode. @@ -336,10 +335,10 @@ The HelloWorldPortlet/WEB-INF/portlet-instances.xml= file is a JBoss Portal specific descriptor, that allows you to create inst= ances of portlets. The - <portlet-ref> value must match the <= ;portlet-name> value - given in the HelloWorldPortlet/WEB-INF/portlet.xml = file. The <instance-id> - value can be named anything, but it must match the <instance= -ref> value given - in the *-object.xml files, which in this example, wou= ld be the HelloWorldPortlet/WEB-INF/helloworld-object.xml file. + <portlet-ref> value must match th= e <portlet-name> value + given in the HelloWorldPortlet/WEB-INF/portlet.xml = file. The <instance-id> + value can be named anything, but it must match the <i= nstance-ref> value given + in the *-object.xml files, which in this example, w= ould be the HelloWorldPortlet/WEB-INF/helloworld-object.xml file. The following is an example of the HelloWorldPortlet/WEB-INF/po= rtlet-instances.xml file: @@ -361,8 +360,8 @@ - The *-object.xml files are JBoss Portal specific descr= iptors that allow users to - define the structure of their portal instances, as well as create and con= figure their windows and + The *-object.xml files are JBoss Portal specific des= criptors that allow users to + define the structure of their portal instances, and create and configure = their windows and pages. In the following example: @@ -374,12 +373,12 @@ - specifies that the window will display the markup generated by the HelloWorldPortletInstance portlet instance. + specifies that the window will display the markup generated by the HelloWorldPortletInstance portlet instance. - the window is assigned to the default.default page. + the window is assigned to the default.default page. @@ -419,7 +418,7 @@ - Tells the portal where this portlet should appear. In this case, default.default specifies that the portlet will a= ppear in the portal instance named default, and on the p= age named default. + Tells the portal where this portlet should appear. In this case, default.default specifies that the portlet will a= ppear in the portal instance named default= , and on the page named default. @@ -437,7 +436,7 @@ - Can be named anything. + This can be named anything. @@ -446,8 +445,8 @@ - The value of <instance-ref> must match the valu= e of one of the - <instance-id> elements found in the = HelloWorldPortlet/WEB-INF/portlet-instances.xml file. + The value of <instance-ref> must = match the value of one of the + <instance-id> elements found in t= he HelloWorldPortlet/WEB-INF/portlet-instances.xml fi= le. @@ -457,7 +456,7 @@ - Specifies the layout region, and the order this window will be found on = the portal page. + Specifies the layout region and the order this window will be found on t= he portal page. @@ -505,7 +504,7 @@ = - This declaration is equivalent to the previous HelloWorldPortl= et/WEB-INF/helloworld-object.xml example. Use &l= t;content-type> to specify the content to display. In t= his example, the content being displayed by HelloWorldPortl= etWindow is a portlet. The <content-uri= > element specifies which content to display, in this e= xample, the HelloWorldPortletInstance: + This declaration is equivalent to the previous HelloWorldPortl= et/WEB-INF/helloworld-object.xml example. Use &l= t;content-type> to specify the content to display. In t= his example, the content being displayed by the HelloWorldP= ortletWindow is a portlet= . The <content-uri> element specifie= s which content to display, which in this example, is the H= elloWorldPortletInstance: - To display certain content or a file, use the cms content-type, with the <content-uri> being the path to the file in the CMS. This behavior is pluggab= le, and it is possible to plug almost any kind of content. + To display certain content or a file, use the cms content-type, with the <content-uri> element being the path to the file in the CMS. This behavior is= pluggable, and it is possible to plug in almost any kind of content. = --===============8952835185116777965==-- From portal-commits at lists.jboss.org Mon Feb 11 22:35:38 2008 Content-Type: multipart/mixed; boundary="===============1331141599181595527==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9938 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Mon, 11 Feb 2008 22:35:38 -0500 Message-ID: --===============1331141599181595527== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-11 22:35:38 -0500 (Mon, 11 Feb 2008) New Revision: 9938 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: revising 5.2.1.5. Building your Portlet adding orderedlist/procedure for building/exploding helloworldportlet example Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-12 01:08:04 UTC (rev 9937) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-12 03:35:38 UTC (rev 9938) @@ -519,41 +519,67 @@ = - Building your portlet - If you have downloaded the sample, you can execute the b= uild.xml with ant or inside your IDE. - Executing the deploy target will compile= all the source files and produce a - helloworldportlet.war file under - HelloWorldPortlet\helloworldportlet.war. - + Building your Portlet - - - - - - + A pre-compiled HelloWorldPortlet/helloworldportlet.war file is created after extracting the HelloWorldPorlet.zip file. To manually build the <= filename>helloworldportlet.war file: + + + + + + Change into the HelloWorldPortlet/ directory= , and remove the existing helloworldportlet.war file. + + + + + Run the ant deploy command: + + + + + + + + + + + - If you want to create an expanded WAR directory, after exec= uting the above deploy target, you should - execute the explode target. + Expanding the helloworldportlet.war allows you = to deploy the portlet as an expanded directory, which makes development eas= ier. This gives you access to the XML descriptors, resource files, JSF, and= JSP pages. To expand the helloworldportlet.war file: + + + + + + If you do not have the HelloWorldPortlet/helloworldport= let.war file, change into the run the HelloWorldPortle= t/ directory and run the ant deploy command t= o create it. + + + + + Change into the HelloWorldPortlet/ directory= and run the ant explode command: + + + + + + + + + + + + + The ant explode command creates a directory struc= ture such as the following: + + - - - - - - The above target will produce the following: - - - This will deflate helloworldportlet.war,= and allow you to deploy it as an - expanded directory. It will work just the same but is easie= r to work with during development as you can - easily modify the XML descriptors, resources files, JSF/JSP= pages. A simple touch - operation (or equivalent) on the web.xml= file will let any live JBoss Application - Server instance know that it needs to hot-redeploy your web= application. + + + The expanded directory and the XML descriptors are located in the <= filename>HelloWorldPortlet/output/lib/exploded/helloworldportlet.war/ directory. Touching the web.xml file will let an= y live JBoss AS instance know that it needs to hot re-deploy the web applic= ation. --===============1331141599181595527==-- From portal-commits at lists.jboss.org Tue Feb 12 08:41:35 2008 Content-Type: multipart/mixed; boundary="===============6824808690477708716==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9939 - in modules/portlet/trunk/test/src/test/resources/simple-portal-war: layouts/nav and 1 other directory. Date: Tue, 12 Feb 2008 08:41:35 -0500 Message-ID: --===============6824808690477708716== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-12 08:41:35 -0500 (Tue, 12 Feb 2008) New Revision: 9939 Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/wik= ipedia.jsp Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/hom= e.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= nav/main.jsp Log: wikipedia stuff and new home page Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/home.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/ho= me.jsp 2008-02-12 03:35:38 UTC (rev 9938) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/ho= me.jsp 2008-02-12 13:41:35 UTC (rev 9939) @@ -7,79 +7,7 @@ <%@ include file=3D"/layouts/header.jsp" %> = -
    -
    - -
    -

    Demo Page Title

    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed= do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ex= ercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehender= it in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non = proident, sunt in culpa qui officia deserunt - mollit anim id est laborum. -
    -
    - + =
    = <%@ include file=3D"/layouts/footer.jsp" %> \ No newline at end of file Copied: modules/portlet/trunk/test/src/test/resources/simple-portal-war/dem= o/wikipedia.jsp (from rev 9936, modules/portlet/trunk/test/src/test/resourc= es/simple-portal-war/demo/home.jsp) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/wi= kipedia.jsp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/wi= kipedia.jsp 2008-02-12 13:41:35 UTC (rev 9939) @@ -0,0 +1,37 @@ +<%@ page contentType=3D"text/html" %> +<%@ page language=3D"java" %> +<%@ taglib prefix=3D"jbp" tagdir=3D"/WEB-INF/tags/portal" %> +<%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> +<%@ page isELIgnored=3D"false" %> + + <%@ include file=3D"/layouts/header.jsp" %> + + + +
    +
    + +
    +

    St. Augustine, Florida

    +

    St. Augustine is the county seat of St. Johns County [1], = Florida, in the United States. It is the oldest continuously occupied Europ= ean-established city, and the oldest port in the continental United States.= [2] St. Augustine lies in a region of Florida known as The First Coast, whi= ch extends from Amelia Island in the north, south to Jacksonville, St. Augu= stine and Palm Coast. According to the 2000 census, the city population was= 11,592; in 2004, the population estimated by the U.S. Census Bureau was 12= ,157 [1].

    +
    +

    St. Augustine was founded by the Spanish in 1565.[2] The f= irst Christian worship service held in a permanent settlement in the contin= ental United States was a Catholic Mass celebrated in St. Augustine. A few = settlements were founded prior to St. Augustine but all failed, including t= he original Pensacola colony in West Florida, founded by Trist=EF=BF=BDn de= Luna y Arellano in 1559, with the area abandoned in 1561 due to hurricanes= , famine and warring tribes, and Fort Caroline in what is today Jacksonvill= e, Florida, in 1564. The city was founded by the Spanish admiral Pedro Men= =EF=BF=BDndez de Avil=EF=BF=BDs on September 8, 1565. Men=EF=BF=BDndez firs= t sighted land on August 28, the feast day of Augustine of Hippo, and conse= quently named the settlement San Agust=EF=BF=BDn. Mart=EF=BF=BDn de Arg=EF= =BF=BDelles was born here one year later in 1566, the first child of Europe= an ancestry to be born in what is now the continental United States. This c= ame 21 years before the English settlement at Roanoke Island in Virginia! Colony, and 42 years before the successful settlements of Santa Fe, New M= exico, and Jamestown, Virginia. In all the territory under the jurisdiction= of the United States, only (European) settlements in Puerto Rico are older= than St. Augustine, with the oldest being Caparra, founded in 1508, whose = inhabitants relocated and founded San Juan, in 1521. +
    In 1586 St. Augustine was attacked and burned by Sir Fr= ancis Drake. In 1668 it was plundered by pirates and most of the inhabitant= s were killed. In 1702 and 1740 it was unsuccessfully attacked by British f= orces from their new colonies in the Carolinas and Georgia. The most seriou= s of these came in the latter year, when James Oglethorpe of Georgia allied= himself with Ahaya the Cowkeeper, chief of the Alachua band of the Seminol= e tribe to lay siege to the city.

    +
    + In 1763, the Treaty of Paris ended the French and Indian War = and gave Florida and St. Augustine to the British, an acquisition the Briti= sh had been unable to take by force and keep due to the strong fort there. = St. Augustine came under British rule and served as a Loyalist colony durin= g the American Revolutionary War. The Treaty of Paris in 1783 gave the Amer= ican colonies north of Florida their independence, and ceded Florida to Spa= in in recognition of Spanish efforts on behalf of the American colonies dur= ing the war. +
    + Florida was under Spanish control again from 1784 to 1821. Du= ring this time, Spain was being invaded by Napoleon and was struggling to r= etain its colonies. Florida no longer held its past importance to Spain. Th= e expanding United States, however, regarded Florida as vital to its intere= sts. In 1821, the Adams-On=EF=BF=BDs Treaty peaceably turned the Spanish co= lonies in Florida and, with them, St. Augustine, over to the United States. +
    + Florida was a United States territory until 1845 when it beca= me a U.S. state. In 1861, the American Civil War began and Florida seceded = from the Union and joined the Confederacy. Days before Florida seceded, sta= te troops took the fort at St. Augustine from a small Union garrison (Janua= ry 7, 1861). However, federal troops loyal to the United States Government = quickly reoccupied the city (March 11, 1862) and remained in control throug= hout the four-year-long war. In 1865, Florida rejoined the United States. +
    + Spanish Colonial era buildings still existing in the city inc= lude the fortress Castillo de San Marcos. The fortress successfully repelle= d the British attacks of the 18th century, served as a prison for the Nativ= e American leader Osceola in 1837, and was occupied by Union troops during = the American Civil War. It was removed from the Army's active duty rolls in= 1900 after 205 years of service under five different flags. It is now the = Castillo de San Marcos National Monument. +
    + In the late 19th century the railroad came to town, and led b= y northeastern industrialist Henry Flagler, St. Augustine became a winter r= esort for the very wealthy. A number of mansions and palatial grand hotels = of this era still exist, some converted to other use, such as housing parts= of Flagler College and museums. Flagler went on to develop much more of Fl= orida's east coast, including his Florida East Coast Railway which eventual= ly reached Key West in 1912. +
    + The city is a popular tourist attraction, for the rich Spanis= h Colonial Revival Style architectural heritage as well as elite 19th centu= ry architecture. In 1938 the theme park Marineland opened just south of St.= Augustine, becoming one of Florida's first themed parks and setting the st= age for the development of this industry in the following decades. The city= is also one terminus of the Old Spanish Trail, which in the 1920's linked = St. Augustine, Florida, to San Diego, California with 3000 miles of roadway= s. + = +
    + +
    + + <%@ include file=3D"/layouts/footer.jsp" %> \ No newline at end of file Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/l= ayouts/nav/main.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /nav/main.jsp 2008-02-12 03:35:38 UTC (rev 9938) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /nav/main.jsp 2008-02-12 13:41:35 UTC (rev 9939) @@ -15,6 +15,10 @@ = Home +
  • + + Wikipedia +
  • Demo Portlets
  • --===============6824808690477708716==-- From portal-commits at lists.jboss.org Tue Feb 12 13:47:38 2008 Content-Type: multipart/mixed; boundary="===============3289364875456279878==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9940 - in modules/portlet/trunk: test and 5 other directories. Date: Tue, 12 Feb 2008 13:47:37 -0500 Message-ID: --===============3289364875456279878== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-12 13:47:37 -0500 (Tue, 12 Feb 2008) New Revision: 9940 Removed: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= jboss-web.xml Modified: modules/portlet/trunk/build/pom.xml modules/portlet/trunk/test/pom.xml modules/portlet/trunk/test/src/test/build.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/META-INF= /context.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= context.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= web.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mast= er.css modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= header.jsp Log: - More work on packaging. Tomcat is getting better but portlets are not tak= en into account yet... - Removed mapping to simple as it's not possible to do it with Tomcat. Mapp= ing will now be simple-portal. Adapted files accordingly. - Added JSTL dependencies for Tomcat. Modified: modules/portlet/trunk/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/build/pom.xml 2008-02-12 13:41:35 UTC (rev 9939) +++ modules/portlet/trunk/build/pom.xml 2008-02-12 18:47:37 UTC (rev 9940) @@ -9,23 +9,24 @@ the property --> - - org.jboss.portal - jboss-portal-parent - 1-SNAPSHOT - - 4.0.0 - org.jboss.portal.portlet - module-parent - 2.0-SNAPSHOT - pom - JBoss Portal Portlet Module - http://www.jboss.com/products/jbossmc - JBoss Portal Portlet Module + xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://ma= ven.apache.org/maven-v4_0_0.xsd"> + + org.jboss.portal + jboss-portal-parent + 1-SNAPSHOT + + 4.0.0 + org.jboss.portal.portlet + module-parent + 2.0-SNAPSHOT + pom + JBoss Portal Portlet Module + http://www.jboss.com/products/jbossmc + JBoss Portal Portlet Module = 1.0.3 + 1.1.2 1.0.2 1.3.4 2.5 @@ -79,7 +80,7 @@ = = - + org.apache.maven.plugins @@ -99,7 +100,7 @@ - + = @@ -131,16 +132,30 @@ portals-bridges-common ${version.apache.portals.bridges} + + + apache-taglibs + jstl + ${version.apache-taglibs} + + + apache-taglibs + standard + ${version.apache-taglibs} + + + + sun-jaxb jaxb-api ${version.sun-jaxb} = - - - + + + org.jboss.portal.common @@ -178,9 +193,9 @@ ${version.javax.servlet.jsp} - - - + + + = @@ -344,39 +359,39 @@ ${version.jboss.aop} - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + commons-logging Modified: modules/portlet/trunk/test/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/pom.xml 2008-02-12 13:41:35 UTC (rev 9939) +++ modules/portlet/trunk/test/pom.xml 2008-02-12 18:47:37 UTC (rev 9940) @@ -24,9 +24,6 @@ portlet-controller ${project.version} - - - org.jboss.portal.portlet portlet-portlet @@ -196,6 +193,15 @@ portlet-api = + + + apache-taglibs + jstl + + + apache-taglibs + standard + = @@ -363,7 +369,7 @@ value=3D"${maven.dependency.org.jboss.po= rtal.portlet.portlet-portlet.jar.path}"/> - @@ -371,11 +377,17 @@ = + + + + - = + Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-12 13:41:35 UTC (= rev 9939) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-12 18:47:37 UTC (= rev 9940) @@ -698,6 +698,7 @@ + = @@ -722,7 +723,7 @@ = = - + = @@ -738,10 +739,9 @@ = = - - + @@ -753,21 +753,31 @@ = + + + + = - + - + + + + + + + = - + = = Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/M= ETA-INF/context.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/META-IN= F/context.xml 2008-02-12 13:41:35 UTC (rev 9939) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/META-IN= F/context.xml 2008-02-12 18:47:37 UTC (rev 9940) @@ -1,2 +1,2 @@ - \ No newline at end of file + \ No newline at end of file Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/context.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /context.xml 2008-02-12 13:41:35 UTC (rev 9939) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /context.xml 2008-02-12 18:47:37 UTC (rev 9940) @@ -1,2 +1,2 @@ - \ No newline at end of file + \ No newline at end of file Deleted: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WE= B-INF/jboss-web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-web.xml 2008-02-12 13:41:35 UTC (rev 9939) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-web.xml 2008-02-12 18:47:37 UTC (rev 9940) @@ -1,26 +0,0 @@ - - - - /simple - Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /web.xml 2008-02-12 13:41:35 UTC (rev 9939) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /web.xml 2008-02-12 18:47:37 UTC (rev 9940) @@ -23,9 +23,9 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~--> = + xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation=3D"http://java.sun.com/xml/ns/javaee http://ja= va.sun.com/xml/ns/javaee/web-app_2_5.xsd" + version=3D"2.5"> ControllerFilter org.jboss.portal.portlet.test.jsp.ControllerFilter @@ -48,6 +48,6 @@ PortalServlet - /simple + /simple-portal Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/c= ss/master.css =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-12 13:41:35 UTC (rev 9939) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-12 18:47:37 UTC (rev 9940) @@ -82,10 +82,10 @@ } = body, -div, -form, -ul, -li { + div, + form, + ul, + li { margin: 0; padding: 0; } @@ -130,7 +130,6 @@ padding: 0; } = - /*-------------------------------Container Decoration*/ = div#container>div.header { @@ -139,31 +138,31 @@ } = div#container div.header div.logo { - background-image: url( /simple/images/logo-header.gif ); + background-image: url( /simple-portal/images/logo-header.gif ); background-repeat: no-repeat; background-position: top left; - height:40px; + height: 40px; } = div#container div.header div.pc20 { - text-align: right; + text-align: right; } = div#container div.header div.pc20 img { - margin: 5px 10px 0 0; + margin: 5px 10px 0 0; } = div#container div.nav { - background-image: url( /simple/images/nav-bg.gif ); + background-image: url( /simple-portal/images/nav-bg.gif ); background-repeat: repeat-x; background-position: top left; border-top: 1px solid #878787; border-bottom: 1px solid #383838; - height:24px; + height: 24px; } = div#container div.nav ul { - height:24px; + height: 24px; margin: 0 0 0 10px; } = @@ -171,34 +170,32 @@ display: inline; float: left; text-align: center; - height: 24px; - /*border: 1px solid #929292;*/ + height: 24px; /*border: 1px solid #929292;*/ } = div#container div.nav ul li a, -div#container div.nav ul li a:hover { + div#container div.nav ul li a:hover { display: block; - height:16px; + height: 16px; padding: 5px 14px 4px 14px; background-repeat: repeat-x; background-position: top left; - text-decoration:none; + text-decoration: none; font: bold 11px; } = -div#container div.nav ul li a{ - color: #fff; - /*background-image: url( /simple/images/inactive-button-bg.gif );*/ +div#container div.nav ul li a { + color: #fff; /*background-image: url( /simple-portal/images/inactive-bu= tton-bg.gif );*/ } = div#container div.nav ul li a:hover, -div#container div.nav ul li a.selected{ + div#container div.nav ul li a.selected { color: #fff; - background-image: url( /simple/images/active-button2-bg.gif ); + background-image: url( /simple-portal/images/active-button2-bg.gif ); } = div#container div#content { - background-image: url( /simple/images/portal-bg.gif ); + background-image: url( /simple-portal/images/portal-bg.gif ); background-repeat: repeat-x; background-position: top left; min-height: 600px; @@ -207,46 +204,46 @@ = /*-------------------------------Portlet Decoration*/ = -div#container div#content div.portlet{ +div#container div#content div.portlet { border: 1px solid #969696; background-color: #e2e2e2; padding: 2px; - float:left; - margin:10px; + float: left; + margin: 10px; width: 95%; } = -div#container div#content div.portlet-frame{ +div#container div#content div.portlet-frame { background-color: #fff; border: 1px solid #fff; } = div#container div#content div.portlet div.header { - background-image: url( /simple/images/portlet-titlebg.gif ); + background-image: url( /simple-portal/images/portlet-titlebg.gif ); background-repeat: repeat-x; background-position: top left; - height:20px; + height: 20px; } = div#container div#content div.portlet div.header div.header-layer { - background-image: url( /simple/images/portlet-title-rt-bg.gif ); + background-image: url( /simple-portal/images/portlet-title-rt-bg.gif ); background-repeat: no-repeat; background-position: top right; - height:20px; + height: 20px; } = -div#container div#content div.portlet div.header div.header-layer div.titl= e h2{ +div#container div#content div.portlet div.header div.header-layer div.titl= e h2 { font: bold 12px Lucida Sans, Trebuchet, tahoma, sans-serif; color: #fff; padding: 2px; } = -div#container div#content div.portlet div.header div.header-layer div.cont= rols{ +div#container div#content div.portlet div.header div.header-layer div.cont= rols { text-align: right; padding: 3px 0 0 0; } = -div#container div#content div.portlet div.header div.header-layer div.cont= rols span.mode-button{ +div#container div#content div.portlet div.header div.header-layer div.cont= rols span.mode-button { text-align: right; padding: 0 5px 0 0; } @@ -254,7 +251,7 @@ div#container div#content div.portlet div.header div.header-layer div.cont= rols span.mode-button a { color: #e1d77e; font: normal 11px; - text-decoration:none; + text-decoration: none; } = /*----------------------------------Error portlet*/ @@ -285,7 +282,7 @@ color: #cc1100 } = -div.exception code{ +div.exception code { color: #33ff00; } = @@ -308,5 +305,5 @@ } = div.remote-container ul li a { - color: #332299 = + color: #332299 } Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/l= ayouts/header.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /header.jsp 2008-02-12 13:41:35 UTC (rev 9939) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /header.jsp 2008-02-12 18:47:37 UTC (rev 9940) @@ -1,30 +1,32 @@ <%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> +PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" +"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -Portlet Container 2.0 - - - - - - + Portlet Container 2.0 + + + + + + - + =
    -
    3D"Portlet
    +
    3D"Portlet

    <%@ include file=3D"nav/main.jsp" %> --===============3289364875456279878==-- From portal-commits at lists.jboss.org Tue Feb 12 15:10:38 2008 Content-Type: multipart/mixed; boundary="===============0703422673029182705==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9941 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples. Date: Tue, 12 Feb 2008 15:10:38 -0500 Message-ID: --===============0703422673029182705== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-12 15:10:38 -0500 (Tue, 12 Feb 2008) New Revision: 9941 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/RemoteControlResourcePortlet.java Log: - Removed preference code for now as it's not working. Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /portal/samples/RemoteControlResourcePortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/RemoteControlResourcePortlet.java 2008-02-12 18:47:37 UTC (rev 99= 40) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/RemoteControlResourcePortlet.java 2008-02-12 20:10:38 UTC (rev 99= 41) @@ -32,14 +32,14 @@ renderResponse.setContentType("text/html"); PrintWriter printWriter =3D renderResponse.getWriter(); printWriter.print(""); + "window.open(url, 'jbp_remote', 'width=3D400,height=3D200,scrolla= ble=3Dyes')}"); printWriter.print("

    Open remote control!

    "); - String color =3D renderRequest.getPreferences().getValue("color", "0= 00"); + /*String color =3D renderRequest.getPreferences().getValue("color", = "000"); printWriter.print("

    Preferred color:  

    "); + + color + ";'> 

    ");*/ } = @Override @@ -47,7 +47,7 @@ { resourceResponse.setContentType("text/html"); PrintWriter writer =3D resourceResponse.getWriter(); - resourceRequest.getPreferences().setValue("color", COLORS[COLOR_INDE= X++ % 8]); +// resourceRequest.getPreferences().setValue("color", COLORS[COLOR_IN= DEX++ % 8]); writer.print("" + ""); PortletURL url =3D resourceResponse.createRenderURL(); --===============0703422673029182705==-- From portal-commits at lists.jboss.org Tue Feb 12 16:43:55 2008 Content-Type: multipart/mixed; boundary="===============6613809314447957602==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9942 - in modules/common/trunk: build and 3 other directories. Date: Tue, 12 Feb 2008 16:43:54 -0500 Message-ID: --===============6613809314447957602== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-12 16:43:53 -0500 (Tue, 12 Feb 2008) New Revision: 9942 Modified: modules/common/trunk/build/pom.xml modules/common/trunk/common/pom.xml modules/common/trunk/mc/pom.xml modules/common/trunk/pom.xml modules/common/trunk/portal/pom.xml Log: version update to 1.2.0-Beta1 = Modified: modules/common/trunk/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/build/pom.xml 2008-02-12 20:10:38 UTC (rev 9941) +++ modules/common/trunk/build/pom.xml 2008-02-12 21:43:53 UTC (rev 9942) @@ -10,7 +10,7 @@ module-parent pom JBoss Portal Modules Common - 1.2.0-SNAPSHOT + 1.2.0-Beta1 http://labs.jboss.com/jbossportal = Modified: modules/common/trunk/common/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/pom.xml 2008-02-12 20:10:38 UTC (rev 9941) +++ modules/common/trunk/common/pom.xml 2008-02-12 21:43:53 UTC (rev 9942) @@ -3,7 +3,7 @@ org.jboss.portal.common module-parent - 1.2.0-SNAPSHOT + 1.2.0-Beta1 ../build/pom.xml 4.0.0 Modified: modules/common/trunk/mc/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/mc/pom.xml 2008-02-12 20:10:38 UTC (rev 9941) +++ modules/common/trunk/mc/pom.xml 2008-02-12 21:43:53 UTC (rev 9942) @@ -3,7 +3,7 @@ org.jboss.portal.common module-parent - 1.2.0-SNAPSHOT + 1.2.0-Beta1 ../build/pom.xml 4.0.0 Modified: modules/common/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/pom.xml 2008-02-12 20:10:38 UTC (rev 9941) +++ modules/common/trunk/pom.xml 2008-02-12 21:43:53 UTC (rev 9942) @@ -5,7 +5,7 @@ module-aggregator pom JBoss Portal Modules Common (aggregator) - 1.2.0-SNAPSHOT + 1.2.0-Beta1 = Modified: modules/common/trunk/portal/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/portal/pom.xml 2008-02-12 20:10:38 UTC (rev 9941) +++ modules/common/trunk/portal/pom.xml 2008-02-12 21:43:53 UTC (rev 9942) @@ -3,7 +3,7 @@ org.jboss.portal.common module-parent - 1.2.0-SNAPSHOT + 1.2.0-Beta1 ../build/pom.xml 4.0.0 --===============6613809314447957602==-- From portal-commits at lists.jboss.org Tue Feb 12 16:56:00 2008 Content-Type: multipart/mixed; boundary="===============7300407028968974508==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9944 - modules/common/tags. Date: Tue, 12 Feb 2008 16:56:00 -0500 Message-ID: --===============7300407028968974508== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-12 16:56:00 -0500 (Tue, 12 Feb 2008) New Revision: 9944 Added: modules/common/tags/JBP_COMMON_1_2_0_BETA1/ Log: tag 1.2.0-Beta1 Copied: modules/common/tags/JBP_COMMON_1_2_0_BETA1 (from rev 9943, modules/= common/trunk) --===============7300407028968974508==-- From portal-commits at lists.jboss.org Tue Feb 12 17:05:48 2008 Content-Type: multipart/mixed; boundary="===============7664317441974969084==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9946 - modules/web/trunk/build. Date: Tue, 12 Feb 2008 17:05:48 -0500 Message-ID: --===============7664317441974969084== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-12 17:05:48 -0500 (Tue, 12 Feb 2008) New Revision: 9946 Modified: modules/web/trunk/build/pom.xml Log: update common module version to 1.2.0-Beta1 Modified: modules/web/trunk/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/build/pom.xml 2008-02-12 22:03:43 UTC (rev 9945) +++ modules/web/trunk/build/pom.xml 2008-02-12 22:05:48 UTC (rev 9946) @@ -36,7 +36,7 @@ 2.0.0.CR3 3.6-beta 2.2.1.GA - 1.2.0-SNAPSHOT + 1.2.0-Beta1 1.2.0-SNAPSHOT 1.2.14 1.1.1 --===============7664317441974969084==-- From portal-commits at lists.jboss.org Tue Feb 12 17:18:32 2008 Content-Type: multipart/mixed; boundary="===============3204472964645821351==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9947 - modules/portlet/trunk/build. Date: Tue, 12 Feb 2008 17:18:31 -0500 Message-ID: --===============3204472964645821351== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-12 17:18:31 -0500 (Tue, 12 Feb 2008) New Revision: 9947 Modified: modules/portlet/trunk/build/pom.xml Log: update common to 1.2.0-Beta1 Modified: modules/portlet/trunk/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/build/pom.xml 2008-02-12 22:05:48 UTC (rev 9946) +++ modules/portlet/trunk/build/pom.xml 2008-02-12 22:18:31 UTC (rev 9947) @@ -39,7 +39,7 @@ 2.0.0.CR5 3.6-beta 2.2.1.GA - 1.2.0-SNAPSHOT + 1.2.0-Beta1 1.2.0-SNAPSHOT 1.2.0-Beta1 1.2.14 --===============3204472964645821351==-- From portal-commits at lists.jboss.org Tue Feb 12 18:09:19 2008 Content-Type: multipart/mixed; boundary="===============4469513960000598818==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9948 - in modules/portlet/trunk/test/src: test and 1 other directories. Date: Tue, 12 Feb 2008 18:09:19 -0500 Message-ID: --===============4469513960000598818== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-12 18:09:19 -0500 (Tue, 12 Feb 2008) New Revision: 9948 Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/ Modified: modules/portlet/trunk/test/src/test/build.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= web.xml Log: - Added missing libraries for Tomcat. - Fixed improper packaging of portlets (was fine with AS but not Tomcat). - Removed useless SimplePortalServlet. Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-12 22:18:31 UTC (= rev 9947) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-12 23:09:19 UTC (= rev 9948) @@ -753,10 +753,6 @@ = - - - - = @@ -768,7 +764,8 @@ - + + @@ -794,6 +791,8 @@ = + + @@ -803,14 +802,19 @@ = - + + + = + + @@ -820,6 +824,8 @@ = + + @@ -828,6 +834,8 @@ = + + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /web.xml 2008-02-12 22:18:31 UTC (rev 9947) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /web.xml 2008-02-12 23:09:19 UTC (rev 9948) @@ -42,12 +42,4 @@ org.jboss.portal.web.impl.tomcat.TC6ContainerServlet<= /servlet-class> 0 - - PortalServlet - org.jboss.portal.simple.SimplePortalServlet - - - PortalServlet - /simple-portal - --===============4469513960000598818==-- From portal-commits at lists.jboss.org Tue Feb 12 18:24:49 2008 Content-Type: multipart/mixed; boundary="===============9043940056537783208==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9949 - modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo. Date: Tue, 12 Feb 2008 18:24:49 -0500 Message-ID: --===============9043940056537783208== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-12 18:24:48 -0500 (Tue, 12 Feb 2008) New Revision: 9949 Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/wik= ipedia.jsp Log: - Added page encoding attribute (but does not seem to fix encoding issues).= Re-formatted. Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/wikipedia.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/wi= kipedia.jsp 2008-02-12 23:09:19 UTC (rev 9948) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/wi= kipedia.jsp 2008-02-12 23:24:48 UTC (rev 9949) @@ -1,37 +1,85 @@ -<%@ page contentType=3D"text/html" %> +<%@ page contentType=3D"text/html" pageEncoding=3D"UTF-8" %> <%@ page language=3D"java" %> <%@ taglib prefix=3D"jbp" tagdir=3D"/WEB-INF/tags/portal" %> <%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> <%@ page isELIgnored=3D"false" %> = - <%@ include file=3D"/layouts/header.jsp" %> +<%@ include file=3D"/layouts/header.jsp" %> = - - -
    -
    - -
    -

    St. Augustine, Florida

    -

    St. Augustine is the county seat of St. Johns County [1], = Florida, in the United States. It is the oldest continuously occupied Europ= ean-established city, and the oldest port in the continental United States.= [2] St. Augustine lies in a region of Florida known as The First Coast, whi= ch extends from Amelia Island in the north, south to Jacksonville, St. Augu= stine and Palm Coast. According to the 2000 census, the city population was= 11,592; in 2004, the population estimated by the U.S. Census Bureau was 12= ,157 [1].

    -
    -

    St. Augustine was founded by the Spanish in 1565.[2] The f= irst Christian worship service held in a permanent settlement in the contin= ental United States was a Catholic Mass celebrated in St. Augustine. A few = settlements were founded prior to St. Augustine but all failed, including t= he original Pensacola colony in West Florida, founded by Trist=EF=BF=BDn de= Luna y Arellano in 1559, with the area abandoned in 1561 due to hurricanes= , famine and warring tribes, and Fort Caroline in what is today Jacksonvill= e, Florida, in 1564. The city was founded by the Spanish admiral Pedro Men= =EF=BF=BDndez de Avil=EF=BF=BDs on September 8, 1565. Men=EF=BF=BDndez firs= t sighted land on August 28, the feast day of Augustine of Hippo, and conse= quently named the settlement San Agust=EF=BF=BDn. Mart=EF=BF=BDn de Arg=EF= =BF=BDelles was born here one year later in 1566, the first child of Europe= an ancestry to be born in what is now the continental United States. This c= ame 21 years before the English settlement at Roanoke Island in Virginia! Colony, and 42 years before the successful settlements of Santa Fe, New M= exico, and Jamestown, Virginia. In all the territory under the jurisdiction= of the United States, only (European) settlements in Puerto Rico are older= than St. Augustine, with the oldest being Caparra, founded in 1508, whose = inhabitants relocated and founded San Juan, in 1521. -
    In 1586 St. Augustine was attacked and burned by Sir Fr= ancis Drake. In 1668 it was plundered by pirates and most of the inhabitant= s were killed. In 1702 and 1740 it was unsuccessfully attacked by British f= orces from their new colonies in the Carolinas and Georgia. The most seriou= s of these came in the latter year, when James Oglethorpe of Georgia allied= himself with Ahaya the Cowkeeper, chief of the Alachua band of the Seminol= e tribe to lay siege to the city.

    -
    - In 1763, the Treaty of Paris ended the French and Indian War = and gave Florida and St. Augustine to the British, an acquisition the Briti= sh had been unable to take by force and keep due to the strong fort there. = St. Augustine came under British rule and served as a Loyalist colony durin= g the American Revolutionary War. The Treaty of Paris in 1783 gave the Amer= ican colonies north of Florida their independence, and ceded Florida to Spa= in in recognition of Spanish efforts on behalf of the American colonies dur= ing the war. -
    - Florida was under Spanish control again from 1784 to 1821. Du= ring this time, Spain was being invaded by Napoleon and was struggling to r= etain its colonies. Florida no longer held its past importance to Spain. Th= e expanding United States, however, regarded Florida as vital to its intere= sts. In 1821, the Adams-On=EF=BF=BDs Treaty peaceably turned the Spanish co= lonies in Florida and, with them, St. Augustine, over to the United States. -
    - Florida was a United States territory until 1845 when it beca= me a U.S. state. In 1861, the American Civil War began and Florida seceded = from the Union and joined the Confederacy. Days before Florida seceded, sta= te troops took the fort at St. Augustine from a small Union garrison (Janua= ry 7, 1861). However, federal troops loyal to the United States Government = quickly reoccupied the city (March 11, 1862) and remained in control throug= hout the four-year-long war. In 1865, Florida rejoined the United States. -
    - Spanish Colonial era buildings still existing in the city inc= lude the fortress Castillo de San Marcos. The fortress successfully repelle= d the British attacks of the 18th century, served as a prison for the Nativ= e American leader Osceola in 1837, and was occupied by Union troops during = the American Civil War. It was removed from the Army's active duty rolls in= 1900 after 205 years of service under five different flags. It is now the = Castillo de San Marcos National Monument. -
    - In the late 19th century the railroad came to town, and led b= y northeastern industrialist Henry Flagler, St. Augustine became a winter r= esort for the very wealthy. A number of mansions and palatial grand hotels = of this era still exist, some converted to other use, such as housing parts= of Flagler College and museums. Flagler went on to develop much more of Fl= orida's east coast, including his Florida East Coast Railway which eventual= ly reached Key West in 1912. -
    - The city is a popular tourist attraction, for the rich Spanis= h Colonial Revival Style architectural heritage as well as elite 19th centu= ry architecture. In 1938 the theme park Marineland opened just south of St.= Augustine, becoming one of Florida's first themed parks and setting the st= age for the development of this industry in the following decades. The city= is also one terminus of the Old Spanish Trail, which in the 1920's linked = St. Augustine, Florida, to San Diego, California with 3000 miles of roadway= s. - = -
    + + +
    +
    + +
    +

    St. Augustine, Florida

    = - +

    St. Augustine is the county seat of St. Johns County, Florida, in= the United States. It is the + oldest continuously occupied European-established city, and the o= ldest port in the continental United + States. St. Augustine lies in a region of Florida known as The Fi= rst Coast, which extends from + Amelia Island in the north, south to Jacksonville, St. Augustine = and Palm Coast. According to the 2000 + census, the city population was 11,592; in 2004, the population e= stimated by the U.S. Census Bureau was + 12,157.

    = - <%@ include file=3D"/layouts/footer.jsp" %> \ No newline at end of file +

    St. Augustine was founded by the Spanish in 1565. The first Chris= tian worship service held in a + permanent settlement in the continental United States was a Catho= lic Mass celebrated in St. Augustine. + A few settlements were founded prior to St. Augustine but all fai= led, including the original Pensacola + colony in West Florida, founded by Trist=C3=A1n de Luna y Arellan= o in 1559, with the area abandoned in 1561 + due to hurricanes, famine and warring tribes, and Fort Caroline i= n what is today Jacksonville, Florida, + in 1564. The city was founded by the Spanish admiral Pedro Men=C3= =A9ndez de Avil=C3=A9s on September 8, 1565. + Men=C3=A9ndez first sighted land on August 28, the feast day of A= ugustine of Hippo, and consequently named + the settlement San Agust=C3=ADn. Mart=C3=ADn de Arg=C3=BCelles wa= s born here one year later in 1566, the first child of + European ancestry to be born in what is now the continental Unite= d States. This came 21 years before the + English settlement at Roanoke Island in Virginia Colony, and 42 y= ears before the successful settlements + of Santa Fe, New Mexico, and Jamestown, Virginia. In all the terr= itory under the jurisdiction of the + United States, only (European) settlements in Puerto Rico are old= er than St. Augustine, with the oldest + being Caparra, founded in 1508, whose inhabitants relocated and f= ounded San Juan, in 1521.

    + +

    In 1586 St. Augustine was attacked and burned by Sir Francis Drak= e. In 1668 it was plundered by pirates + and most of the inhabitants were killed. In 1702 and 1740 it was = unsuccessfully attacked by British + forces from their new colonies in the Carolinas and Georgia. The = most serious of these came in the + latter year, when James Oglethorpe of Georgia allied himself with= Ahaya the Cowkeeper, chief of the + Alachua band of the Seminole tribe to lay siege to the city.

    + +

    In 1763, the Treaty of Paris ended the French and Indian War and = gave Florida and St. Augustine to the + British, an acquisition the British had been unable to take by fo= rce and keep due to the strong fort + there. St. Augustine came under British rule and served as a Loya= list colony during the American + Revolutionary War. The Treaty of Paris in 1783 gave the American = colonies north of Florida their + independence, and ceded Florida to Spain in recognition of Spanis= h efforts on behalf of the American + colonies during the war.

    + +

    Florida was under Spanish control again from 1784 to 1821. During= this time, Spain was being invaded by + Napoleon and was struggling to retain its colonies. Florida no lo= nger held its past importance to Spain. + The expanding United States, however, regarded Florida as vital t= o its interests. In 1821, the + Adams-On=C3=ADs Treaty peaceably turned the Spanish colonies in F= lorida and, with them, St. Augustine, over + to the United States.

    + +

    Florida was a United States territory until 1845 when it became a= U.S. state. In 1861, the American + Civil War began and Florida seceded from the Union and joined the= Confederacy. Days before Florida + seceded, state troops took the fort at St. Augustine from a small= Union garrison (January 7, 1861). + However, federal troops loyal to the United States Government qui= ckly reoccupied the city (March 11, + 1862) and remained in control throughout the four-year-long war. = In 1865, Florida rejoined the United + States.

    + +

    Spanish Colonial era buildings still existing in the city include= the fortress Castillo de San Marcos. + The fortress successfully repelled the British attacks of the 18t= h century, served as a prison for the + Native American leader Osceola in 1837, and was occupied by Union= troops during the American Civil War. + It was removed from the Army's active duty rolls in 1900 after 20= 5 years of service under five different + flags. It is now the Castillo de San Marcos National Monument.

    + +

    In the late 19th century the railroad came to town, and led by no= rtheastern industrialist Henry Flagler, + St. Augustine became a winter resort for the very wealthy. A numb= er of mansions and palatial grand + hotels of this era still exist, some converted to other use, such= as housing parts of Flagler College + and museums. Flagler went on to develop much more of Florida's ea= st coast, including his Florida East + Coast Railway which eventually reached Key West in 1912.

    + +

    The city is a popular tourist attraction, for the rich Spanish Co= lonial Revival Style architectural + heritage as well as elite 19th century architecture. In 1938 the = theme park Marineland opened just south + of St. Augustine, becoming one of Florida's first themed parks an= d setting the stage for the development + of this industry in the following decades. The city is also one t= erminus of the Old Spanish Trail, which + in the 1920's linked St. Augustine, Florida, to San Diego, Califo= rnia with 3000 miles of roadways.

    +
    + +
    + +<%@ include file=3D"/layouts/footer.jsp" %> \ No newline at end of file --===============9043940056537783208==-- From portal-commits at lists.jboss.org Wed Feb 13 00:05:59 2008 Content-Type: multipart/mixed; boundary="===============1126338361574696468==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9950 - in modules/portlet/trunk/test/src: test/resources/simple-portal-war/demo and 1 other directory. Date: Wed, 13 Feb 2008 00:05:58 -0500 Message-ID: --===============1126338361574696468== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-13 00:05:58 -0500 (Wed, 13 Feb 2008) New Revision: 9950 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/basic/HeaderPortlet.java modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o3.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/hom= e.jsp Log: start of ajax portlet Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /portal/samples/basic/HeaderPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/HeaderPortlet.java 2008-02-12 23:24:48 UTC (rev 9949) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/HeaderPortlet.java 2008-02-13 05:05:58 UTC (rev 9950) @@ -45,25 +45,51 @@ ResourceURL resourceURL =3D resp.createResourceURL(); = // - Element elt =3D resp.createElement("script"); - elt.setAttribute("type", "text/javascript"); - elt.setAttribute("src", resourceURL.toString()); - elt.appendChild(elt.getOwnerDocument().createTextNode("")); - resp.addProperty("script", elt); +// Element elt =3D resp.createElement("script"); +// elt.setAttribute("type", "text/javascript"); +// elt.setAttribute("src", resourceURL.toString()); +// elt.appendChild(elt.getOwnerDocument().createTextNode("")); +// resp.addProperty("script", elt); = // resp.setContentType("text/html"); PrintWriter writer =3D resp.getWriter(); - writer.print(""); + writer.print("" + + "" + + "
    "); +// "" + +// "Cl= ick me to trigger script" + + resourceURL.setParameter("prodId","1"); + writer.print("Product 1
    "); + + resourceURL.setParameter("prodId","2"); + writer.print("Product 2
    "); + + resourceURL.setParameter("prodId","3"); + writer.print("Product 3
    "); + + writer.print("
    " + + "
    " + + "
    Product Details
    "); } = public void serveResource(ResourceRequest req, ResourceResponse resp) t= hrows PortletException, IOException { String namespace =3Dresp.getNamespace(); - resp.setContentType("text/javascript"); + //resp.setContentType("application/json"); + resp.setContentType("text/html"); PrintWriter writer =3D resp.getWriter(); - writer.print("function " + namespace + "_handle() { " + - "new Effect.Grow(document.getElementById('header-portlet')) }"); + + writer.print("
    " + req.getParameter("prodId") +"
    "); + writer.close(); } } Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/demo3.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo3.jsp 2008-02-12 23:24:48 UTC (rev 9949) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo3.jsp 2008-02-13 05:05:58 UTC (rev 9950) @@ -5,7 +5,7 @@ <%@ page isELIgnored=3D"false" %> = <%@ include file=3D"/layouts/header.jsp" %> - + = @@ -14,9 +14,11 @@ + + + - <%@ include file=3D"/layouts/footer.jsp" %> \ No newline at end of file Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/home.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/ho= me.jsp 2008-02-12 23:24:48 UTC (rev 9949) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/ho= me.jsp 2008-02-13 05:05:58 UTC (rev 9950) @@ -7,7 +7,14 @@ <%@ include file=3D"/layouts/header.jsp" %> = - = + + + + + + + + = <%@ include file=3D"/layouts/footer.jsp" %> \ No newline at end of file --===============1126338361574696468==-- From portal-commits at lists.jboss.org Wed Feb 13 03:11:27 2008 Content-Type: multipart/mixed; boundary="===============0968496407894117594==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9951 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Wed, 13 Feb 2008 03:11:26 -0500 Message-ID: --===============0968496407894117594== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-13 03:11:26 -0500 (Wed, 13 Feb 2008) New Revision: 9951 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: 5.2.1.5. Building your Portlet minor revisions Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-13 05:05:58 UTC (rev 9950) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-13 08:11:26 UTC (rev 9951) @@ -515,13 +515,13 @@ - To display certain content or a file, use the cms content-type, with the <content-uri> element being the path to the file in the CMS. This behavior is= pluggable, and it is possible to plug in almost any kind of content. + To display certain content or a file, use the cms content-type, with the <content-uri> element being the path to the file in the CMS. This behavior is= pluggable: you can plug in almost any type of content. = Building your Portlet - A pre-compiled HelloWorldPortlet/helloworldportlet.war file is created after extracting the HelloWorldPorlet.zip file. To manually build the <= filename>helloworldportlet.war file: + A pre-compiled HelloWorldPortlet/helloworldportlet.war file is created after extracting the HelloWorldPorlet.zip= file. To manually build the helloworldportlet.war file: @@ -545,18 +545,18 @@ - Expanding the helloworldportlet.war allows you = to deploy the portlet as an expanded directory, which makes development eas= ier. This gives you access to the XML descriptors, resource files, JSF, and= JSP pages. To expand the helloworldportlet.war file: + Expanding the helloworldportlet.war allows you = to deploy the portlet as an expanded directory, which makes development eas= ier. As well, it gives you access to the XML descriptors, resource files, J= SF, and JSP pages. To expand the helloworldportlet.war= file: - If you do not have the HelloWorldPortlet/helloworldport= let.war file, change into the run the HelloWorldPortle= t/ directory and run the ant deploy command t= o create it. + If you do not have the HelloWorldPortlet/helloworldport= let.war file, change into the HelloWorldPortlet/ directory, and run the ant deploy command. This cr= eates a helloworldportlet.war file. - Change into the HelloWorldPortlet/ directory= and run the ant explode command: + To expand the war file, change into the HelloWorldPortl= et/ directory, and run the ant explode comman= d: @@ -579,7 +579,7 @@ - The expanded directory and the XML descriptors are located in the <= filename>HelloWorldPortlet/output/lib/exploded/helloworldportlet.war/ directory. Touching the web.xml file will let an= y live JBoss AS instance know that it needs to hot re-deploy the web applic= ation. + The expanded war file and the XML descriptors are located in the HelloWorldPortlet/output/lib/exploded/helloworldportlet.war/ directory. @@ -594,6 +594,8 @@ warUrl=3D.../tmp/deploy/tmp35219helloworldportlet-exp.war/]]>= Pointing your browser to http://localhost:8080/portal/, should yield a view of our HelloWorldPortlet, added to the = default page of Portal: + = + --===============0968496407894117594==-- From portal-commits at lists.jboss.org Wed Feb 13 12:15:27 2008 Content-Type: multipart/mixed; boundary="===============3595808016741445729==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9953 - in modules/web/trunk/web/src/main/java/org/jboss/portal/web: impl/tomcat and 1 other directory. Date: Wed, 13 Feb 2008 12:15:25 -0500 Message-ID: --===============3595808016741445729== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-13 12:15:25 -0500 (Wed, 13 Feb 2008) New Revision: 9953 Modified: modules/web/trunk/web/src/main/java/org/jboss/portal/web/ServletContaine= r.java modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/tomcat/TC6= ServletContainerContext.java Log: - Replaced output to sysout by logging. Modified: modules/web/trunk/web/src/main/java/org/jboss/portal/web/ServletC= ontainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/web/src/main/java/org/jboss/portal/web/ServletContain= er.java 2008-02-13 14:45:12 UTC (rev 9952) +++ modules/web/trunk/web/src/main/java/org/jboss/portal/web/ServletContain= er.java 2008-02-13 17:15:25 UTC (rev 9953) @@ -22,6 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.web; = +import org.jboss.logging.Logger; import org.jboss.portal.web.spi.ServletContainerContext; import org.jboss.portal.web.spi.WebAppContext; = @@ -29,12 +30,12 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.InputStream; import java.util.ArrayList; +import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import java.util.HashMap; -import java.io.InputStream; -import java.io.IOException; = /** * A static registry for the servlet container context. @@ -44,6 +45,7 @@ */ public class ServletContainer { + private final static Logger log =3D Logger.getLogger(ServletContainer.c= lass); = /** . */ private final Object lock =3D new Object(); @@ -58,15 +60,15 @@ private RegistrationImpl registration; = /** - * Register a servlet container context. The registration is considered= as successful if no existing context - * is already registered. + * Register a servlet container context. The registration is considered= as successful if no existing context is + * already registered. * * @param context the servlet container context to register * @throws IllegalArgumentException if the context is null */ public void register(ServletContainerContext context) { - synchronized(lock) + synchronized (lock) { if (context =3D=3D null) { @@ -87,7 +89,7 @@ = public boolean addWebAppListener(WebAppListener listener) { - synchronized(lock) + synchronized (lock) { if (listener =3D=3D null) { @@ -110,7 +112,7 @@ = public boolean removeWebAppListener(WebAppListener listener) { - synchronized(lock) + synchronized (lock) { if (listener =3D=3D null) { @@ -147,7 +149,7 @@ = private void fireEvent(WebAppEvent event) { - for (Iterator i =3D listeners.iterator();i.hasNext();) + for (Iterator i =3D listeners.iterator(); i.hasNext();) { safeFireEvent((WebAppListener)i.next(), event); } @@ -157,10 +159,10 @@ * Generic detyped request dispatch to a servlet context using the incl= ude mechanism. * * @param targetServletContext the target servlet context to dispatch to - * @param request the request valid in the current servlet context - * @param response the response valid in the current servlet context - * @param callback the callback to perform after the dispatch operation - * @param handback the handback object to provide + * @param request the request valid in the current servlet= context + * @param response the response valid in the current servle= t context + * @param callback the callback to perform after the dispat= ch operation + * @param handback the handback object to provide * @return any object * @throws Exception any exception */ @@ -207,7 +209,7 @@ { throw new IllegalStateException("Disposed registration"); } - synchronized(container.lock) + synchronized (container.lock) { if (webAppContext =3D=3D null) { @@ -220,14 +222,14 @@ // if (container.webAppMap.containsKey(key)) { - System.out.println("Web application " + key + " is already = registered"); + log.debug("Web application " + key + " is already registere= d"); return false; } else { try { - System.out.println("Web application " + key + " registra= tion"); + log.debug("Web application " + key + " registration"); webAppContext.start(); WebAppImpl webApp =3D new WebAppImpl(webAppContext); container.webAppMap.put(key, webApp); @@ -236,7 +238,7 @@ } catch (Exception e) { - System.out.println("Was not able to start web app contex= t "+ key); + log.debug("Was not able to start web app context " + key= ); e.printStackTrace(); return false; } @@ -250,7 +252,7 @@ { throw new IllegalStateException("Disposed registration"); } - synchronized(container.lock) + synchronized (container.lock) { if (webAppId =3D=3D null) { @@ -261,14 +263,14 @@ WebAppImpl webApp =3D (WebAppImpl)container.webAppMap.remove(w= ebAppId); if (webApp !=3D null) { - System.out.println("Web application " + webAppId + " cleanu= p"); + log.debug("Web application " + webAppId + " cleanup"); container.fireEvent(new WebAppLifeCycleEvent(webApp, WebApp= LifeCycleEvent.REMOVED)); webApp.context.stop(); return true; } else { - System.out.println("Web application " + webAppId + " was no= t registered"); + log.debug("Web application " + webAppId + " was not registe= red"); return false; } } @@ -280,7 +282,7 @@ { throw new IllegalStateException("Disposed registration"); } - synchronized(container.lock) + synchronized (container.lock) { // Unregister all web apps for (Iterator i =3D container.webAppMap.values().iterator(); i= .hasNext();) @@ -311,9 +313,7 @@ } } = - /** - * Implementation of the WebApp interface. - */ + /** Implementation of the WebApp interface. */ private static class WebAppImpl implements WebApp { = Modified: modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/tom= cat/TC6ServletContainerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/tomcat/TC= 6ServletContainerContext.java 2008-02-13 14:45:12 UTC (rev 9952) +++ modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/tomcat/TC= 6ServletContainerContext.java 2008-02-13 17:15:25 UTC (rev 9953) @@ -22,27 +22,28 @@ *************************************************************************= *****/ package org.jboss.portal.web.impl.tomcat; = -import org.jboss.portal.web.RequestDispatchCallback; -import org.jboss.portal.web.impl.DefaultServletContainerFactory; -import org.jboss.portal.web.command.CommandDispatcher; -import org.jboss.portal.web.spi.ServletContainerContext; import org.apache.catalina.Container; +import org.apache.catalina.ContainerEvent; +import org.apache.catalina.ContainerListener; +import org.apache.catalina.Context; import org.apache.catalina.Engine; import org.apache.catalina.Host; -import org.apache.catalina.ContainerEvent; -import org.apache.catalina.Context; -import org.apache.catalina.ContainerListener; import org.apache.catalina.Lifecycle; +import org.apache.catalina.LifecycleEvent; import org.apache.catalina.LifecycleListener; -import org.apache.catalina.LifecycleEvent; +import org.jboss.logging.Logger; +import org.jboss.portal.web.RequestDispatchCallback; +import org.jboss.portal.web.command.CommandDispatcher; +import org.jboss.portal.web.impl.DefaultServletContainerFactory; +import org.jboss.portal.web.spi.ServletContainerContext; = import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.HashSet; import java.util.Set; -import java.util.HashSet; -import java.io.IOException; = /** * An implementation of the ServletContainerContext for Tomca= t. @@ -52,6 +53,7 @@ */ public class TC6ServletContainerContext implements ServletContainerContext= , ContainerListener, LifecycleListener { + private final static Logger log =3D Logger.getLogger(TC6ServletContaine= rContext.class); = /** . */ private final CommandDispatcher dispatcher =3D new CommandDispatcher(); @@ -185,9 +187,8 @@ } = /** - * Register an host for registration which means that we fire events fo= r all the contexts it - * contains and we subscribe for its life cycle events. If the host is = already monitored - * nothing is done. + * Register an host for registration which means that we fire events fo= r all the contexts it contains and we + * subscribe for its life cycle events. If the host is already monitore= d nothing is done. * * @param host the host to register for monitoring */ @@ -281,7 +282,7 @@ { try { - System.out.println("Context added " + context.getPath()); + log.debug("Context added " + context.getPath()); TC6WebAppContext webAppContext =3D new TC6WebAppContext(context); = // --===============3595808016741445729==-- From portal-commits at lists.jboss.org Wed Feb 13 12:34:09 2008 Content-Type: multipart/mixed; boundary="===============2509975241632012980==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9954 - in branches/JBoss_Portal_Branch_2_6: core-cms/src/bin/portal-cms-sar/portal/cms/conf/default-content/default and 1 other directory. Date: Wed, 13 Feb 2008 12:34:08 -0500 Message-ID: --===============2509975241632012980== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-13 12:34:08 -0500 (Wed, 13 Feb 2008) New Revision: 9954 Modified: branches/JBoss_Portal_Branch_2_6/cms/src/resources/portal-cms-sar/defaul= t-content/default/index.html branches/JBoss_Portal_Branch_2_6/core-cms/src/bin/portal-cms-sar/portal/= cms/conf/default-content/default/index.html Log: - Improved HTML (id is an identifier and, as its name implies should only b= e used once in the document ^_^), added alt tags where it made sense. Modified: branches/JBoss_Portal_Branch_2_6/cms/src/resources/portal-cms-sar= /default-content/default/index.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_6/cms/src/resources/portal-cms-sar/defau= lt-content/default/index.html 2008-02-13 17:15:25 UTC (rev 9953) +++ branches/JBoss_Portal_Branch_2_6/cms/src/resources/portal-cms-sar/defau= lt-content/default/index.html 2008-02-13 17:34:08 UTC (rev 9954) @@ -14,7 +14,7 @@ margin-bottom: 30px; } = - #welcomegreyboxTD { + .welcomegreyboxTD { border-left: 1px solid #d5d5d5; padding-left: 15px; } @@ -27,12 +27,14 @@ = - +
    3D"JBoss=
    -
    +
    3D"JBoss,

    JBoss Portal provides an open source platform for ho= sting and serving a portal Web interface, publishing and managing its content, and customizing its experience. Wh= ile most packaged Portal frameworks help enterprises launch Portals more quickly, only JBoss Portal delivers the= benefits of a zero-cost open source license @@ -45,11 +47,11 @@ =

    JBoss Inc. offers various support services tailored to fit = your needs. Explore support and service options for JBoss Portal.

    -

    PortletSwap

    +

    PortletSwap

    =

    Po= rtletswap.com is an open community sponsored by JBoss, Inc. to facilitate the exchange of portlets and l= ayouts for use in JBoss Portal.

    -

    Project Informatio= n

    +

    Project Informa= tion

    =

    Learn more about the JBoss= Portal project, on-going development, open issues, and our @@ -61,42 +63,4 @@

    Thank you for downloading and deploying JBoss Portal. We hope your enjo= y working with it as much as we enjoy developing it!

    Baci e abbracci,
    - The JBoss Portal Team.

    - - + The JBoss Portal Team.

    \ No newline at end of file Modified: branches/JBoss_Portal_Branch_2_6/core-cms/src/bin/portal-cms-sar/= portal/cms/conf/default-content/default/index.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_6/core-cms/src/bin/portal-cms-sar/portal= /cms/conf/default-content/default/index.html 2008-02-13 17:15:25 UTC (rev 9= 953) +++ branches/JBoss_Portal_Branch_2_6/core-cms/src/bin/portal-cms-sar/portal= /cms/conf/default-content/default/index.html 2008-02-13 17:34:08 UTC (rev 9= 954) @@ -12,7 +12,7 @@ margin-bottom: 30px; } = - #welcomegreyboxTD { + .welcomegreyboxTD { } = #welcomegreybox h3 { @@ -22,15 +22,16 @@ =
    - + 3D"JBoss
    = -
    +
    3D"JBoss,

    JBoss Portal provides an open source platform for ho= sting and serving a portal Web interface, publishing and managing its content, and customizing its experience. Wh= ile most packaged Portal frameworks help enterprises launch Portals more quickly, only JBoss Portal delivers the= benefits of a zero-cost open source license combined with a flexible and scalable underling platform.

    -
    +
    @@ -38,11 +39,11 @@ =

    JBoss Inc. offers various support services tailored to fit = your needs. Explore support and service options for JBoss Portal.

    - - + + + + Modified: modules/portlet/trunk/docs/user-guide/en/modules/introduction.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/docs/user-guide/en/modules/introduction.xml 2008-= 02-15 01:56:01 UTC (rev 9981) +++ modules/portlet/trunk/docs/user-guide/en/modules/introduction.xml 2008-= 02-15 01:58:37 UTC (rev 9982) @@ -6,14 +6,44 @@ Vietjulien(a)jboss.org + + Chris + Laprun + chris.laprun(a)jboss.com + Introduction Motivation - + JBoss Portlet Container is the next generation portlet contain= er on which future versions of JBoss Portal, + and the JBoss Portal platform will be based. It provides a standa= rd-compliant implementation of the JSR-286 + Portlet 2.0 specification. It has been developed with reusability= in mind so that advanced users, who don't + require a full-fledged portal, can leverage the portlet managemen= t services it provides in their own + applications. JBoss Portlet Container is available through the bu= siness-friendly LGPL open source license. + - Principles - + Audience + JBoss Portlet Container is targeted at developers and advanced= users who want to be able to deploy + portlet-based applications but don't need a full-fledged portal. + + + Simple Portal: showcasing JBoss Portlet Container + A simple portal has been built on top of the base portlet cont= ainer. A JSP taglib is also provided to make + it easy to display portlet content in JSP pages. We also provide = samples of portlets implementing some of the + advanced capabilities of JSR-286. + + + + Resources + + + Project= website + + + Project Wi= ki + + + --===============2618200536948200204==-- From portal-commits at lists.jboss.org Thu Feb 14 20:59:07 2008 Content-Type: multipart/mixed; boundary="===============4826876701479897851==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9983 - modules/portlet/trunk/docs/user-guide/en/images. Date: Thu, 14 Feb 2008 20:59:07 -0500 Message-ID: --===============4826876701479897851== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-14 20:59:07 -0500 (Thu, 14 Feb 2008) New Revision: 9983 Added: modules/portlet/trunk/docs/user-guide/en/images/simple-portal.png Log: - Forgot to add image. Added: modules/portlet/trunk/docs/user-guide/en/images/simple-portal.png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/user-guide/en/images/simple= -portal.png ___________________________________________________________________ Name: svn:mime-type + image/png --===============4826876701479897851==-- From portal-commits at lists.jboss.org Thu Feb 14 21:42:16 2008 Content-Type: multipart/mixed; boundary="===============7157852480339302607==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9984 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Thu, 14 Feb 2008 21:42:15 -0500 Message-ID: --===============7157852480339302607== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-14 21:42:15 -0500 (Thu, 14 Feb 2008) New Revision: 9984 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: 5.2.2.4. JSP Files and the Portlet Tag Library minor punctuation and tag revisions Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-15 01:59:07 UTC (rev 9983) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-15 02:42:15 UTC (rev 9984) @@ -773,7 +773,7 @@ - The doView implementation is responsible for dispatch= ing to the appropriate JSP, HelloWorldJSPPortlet/WEB-INF/jsp/view= .jsp, or HelloWorldJSPPortlet/WEB-INF/jsp/view2.jsp, depending on the existence of the yourname par= ameter passed in from processAction. + The doView implementation is responsible for dispatch= ing to the appropriate JSP, HelloWorldJSPPortlet/WEB-INF/jsp/view= .jsp or HelloWorldJSPPortlet/WEB-INF/jsp/view2.jsp, depending on the existence of the yourname para= meter passed in from processAction. @@ -835,7 +835,7 @@ Calling defineObjects makes available implicit object= s in the JSP, such as - renderRequest, actionRequest, portletConfig. + renderRequest, actionRequest, and = portletConfig. @@ -845,7 +845,7 @@ - A HTML form is created. This form posts to the URL defined by the portle= t taglib. In this example, an actionURL is= created, that activates the processAction method, which= passes the input parameters in the form. + A HTML form is created. This form posts to the URL defined by the portle= t taglib. In this example, an actionURL is= created, that activates the processAction method, which= passes the input parameters from the form. --===============7157852480339302607==-- From portal-commits at lists.jboss.org Thu Feb 14 23:44:18 2008 Content-Type: multipart/mixed; boundary="===============0746784965338610595==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9985 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Thu, 14 Feb 2008 23:44:18 -0500 Message-ID: --===============0746784965338610595== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-14 23:44:18 -0500 (Thu, 14 Feb 2008) New Revision: 9985 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: 5.2.2.5. Building and deploying your portlet revising with more content so that it is consistent with = 5.2.1. Deploying your First Portlet *** this will break the book***, but I wanted a backup :) Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-15 02:42:15 UTC (rev 9984) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-15 04:44:18 UTC (rev 9985) @@ -137,7 +137,7 @@ --> = - Deploying your First Portlet + Deploying your first Portlet Introduction @@ -518,7 +518,7 @@ Building your Portlet - A pre-compiled HelloWorldPortlet/helloworldportlet.war file is created after extracting the HelloWorldPortlet.zi= p file. To manually build the helloworldportlet.war file: + The HelloWorldPortlet.zip file contains a pre-c= ompiled helloworldportlet.war file; however, to manual= ly build the helloworldportlet.war file: @@ -534,7 +534,7 @@ - Run the ant deploy command: + Run the ant deploy command. On Microsoft Windo= ws, the output will be similar to the following: @@ -543,6 +543,9 @@ + + Note: the directory names will be different for your system. + @@ -553,12 +556,12 @@ - If you do not have the HelloWorldPortlet/helloworldport= let.war file, change into the HelloWorldPortlet/ directory, and run the ant deploy command. This cr= eates a helloworldportlet.war file. + If you do not have the HelloWorldPortlet/helloworldport= let.war file, change into the HelloWorldPortlet/ directory, and run the ant deploy command. This cr= eates the helloworldportlet.war file. - To expand the war file, change into the HelloWorldPortl= et/ directory, and run the ant explode comman= d: + To expand the war file, change into the HelloWorldPortl= et/ directory, and run the ant explode comman= d. On Microsoft Windows, the output will be similar to the following: @@ -567,6 +570,9 @@ + + Note: the directory names will be different for your system. + @@ -863,7 +869,95 @@ - Building and deploying your portlet + Building your Portlet + + The HelloWorldJSPPortlet.zip file contains a pr= e-compiled helloworldjspportlet.war file; however, to = manually build the helloworldjspportlet.war file: + + + + + + Change into the HelloWorldJSPPortlet/ direct= ory, and remove the existing helloworldjspportlet.war = file. + + + + + If required, edit the HelloWorldJSPPortlet/src/main/org= /jboss/portlet/hello/HelloWorldJSPPortlet.java file, and the XML= descriptors in the HelloWorldJSPPortlet/src/resources/helloworld= jspportlet-war/WEB-INF directory. + + + + + Run the ant deploy command. On Linux, the outp= ut will be similar to the following: + + + + + + + + + + + + + Note: the directory names will be different for your system. + = + + Expanding the helloworldjspportlet.war file all= ows you to deploy the portlet as an expanded directory, which makes develop= ment easier. As well, it gives you access to the XML descriptors, resource = files, JSF, and JSP pages. To expand the helloworldjspportlet.war= file: + + + + + + If you do not have the HelloWorldJSPPortlet/helloworldj= spportlet.war file, change into the HelloWorldJSPPortl= et/ directory, and run the ant deploy command= . This creates the helloworldjspportlet.war file. + + + + + To expand the war file, change into the HelloWorldJSPPo= rtlet/ directory, and run the ant explode com= mand. On Linux, the output will be similar to the following: + + + + + + + + + + + + + Note: the directory names will be different for your system. + + + The ant explode command creates a directory struc= ture such as the following: + + + + + + + + + + The expanded war file and the XML descriptors are located in the HelloWorldPortlet/output/lib/exploded/helloworldportlet.war/ directory. + + = + = + + = + = + = + = + = + = + = + = + = + = + = + = + = If you have downloaded the sample, you can execute the b= uild.xml with ant or inside your IDE. Executing the deploy target will compile= all source files and produce a helloworldjspportlet.war file in a way s= imilar to what we saw in @@ -873,7 +967,7 @@ The explode target will produce the foll= owing: - + --===============0746784965338610595==-- From portal-commits at lists.jboss.org Fri Feb 15 00:51:47 2008 Content-Type: multipart/mixed; boundary="===============5868062823940616632==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9986 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Fri, 15 Feb 2008 00:51:47 -0500 Message-ID: --===============5868062823940616632== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-15 00:51:47 -0500 (Fri, 15 Feb 2008) New Revision: 9986 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: revising 5.2.2. An example JSP Portlet adding: 5.2.2.5. Building your JSP Portlet, 5.2.2.6. Deploying your JSP Por= tlet to be consistent with 5.2.1.5. Building your Portlet Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-15 04:44:18 UTC (rev 9985) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-15 05:51:47 UTC (rev 9986) @@ -869,7 +869,7 @@ - Building your Portlet + Building your JSP Portlet The HelloWorldJSPPortlet.zip file contains a pr= e-compiled helloworldjspportlet.war file; however, to = manually build the helloworldjspportlet.war file: @@ -940,8 +940,55 @@ - The expanded war file and the XML descriptors are located in the HelloWorldPortlet/output/lib/exploded/helloworldportlet.war/ directory. + The expanded war file and the XML descriptors are located in the HelloWorldJSPPortlet/output/lib/exploded/helloworldjspportlet.war/ directory. + + + Deploying your JSP Portlet + + If you did not expand the helloworldjspportlet.war file, copy the HelloWorldJSPPortlet/helloworldjspportlet.war<= /filename> file into the correct JBoss AS or JBoss EAP deploy/ directory. If you expanded the helloworldjspportlet.war<= /filename> file, copy the HelloWorldJSPPortlet/output/lib/explode= d/helloworldjspportlet.war/ directory into the correct JBoss AS = or JBoss EAP deploy/ directory. For example, if you ar= e using JBoss AS, copy the war file or the expanded directory into the $JBOSS_HOME/server/default/deploy/ directory. + + + Performing this step on a running instance of JBoss AS or JBoss EAP,= and JBoss Portal, will trigger a hot-deploy of the portlet: + + + + + + + To see the HelloWorldJSPPortlet, navigate to http://localhost:8080/portal= /, or, if the default JBoss Portal page is already open, refresh the page. = The HelloWorldJSPPortlett is added to the bottom of the default JBoss Porta= l page: + + + + + + + + + + To re-deploy the portlet, for example, if you have made changes to any of= the XML descriptors, touch the $JBOSS_HOME/server/configuration/deploy/hel= loworldjspportlet.war/WEB-INF/web.xml file. On Linux, run the following com= mand to re-deploy the HelloWorldJSPPortlet: + + + +touch $JBOSS_HOME/server/configuration/deploy//= helloworldjspportlet.war/WEB-INF/web.xml + + + + Re-deploying the HelloWorldJSPPortlet will produce output to the JBoss AS= or JBoss EAP console, similar to the following: + + + + + + Package Content --===============5868062823940616632==-- From portal-commits at lists.jboss.org Fri Feb 15 01:27:59 2008 Content-Type: multipart/mixed; boundary="===============2188501369660900239==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9987 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/tutorials/jsp_portlet. Date: Fri, 15 Feb 2008 01:27:58 -0500 Message-ID: --===============2188501369660900239== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-15 01:27:57 -0500 (Fri, 15 Feb 2008) New Revision: 9987 Added: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/tutorials= /jsp_portlet/jsp_ant_deploy.png docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/tutorials= /jsp_portlet/jsp_ant_explode.png Log: adding image files for = 5.2.1.5. Building your Portlet 5.2.1.6. Deploying your Portlet Added: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/tutor= ials/jsp_portlet/jsp_ant_deploy.png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/e= n/images/tutorials/jsp_portlet/jsp_ant_deploy.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/tutor= ials/jsp_portlet/jsp_ant_explode.png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/e= n/images/tutorials/jsp_portlet/jsp_ant_explode.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream --===============2188501369660900239==-- From portal-commits at lists.jboss.org Fri Feb 15 01:32:35 2008 Content-Type: multipart/mixed; boundary="===============8749659118211654079==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9988 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Fri, 15 Feb 2008 01:32:35 -0500 Message-ID: --===============8749659118211654079== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-15 01:32:34 -0500 (Fri, 15 Feb 2008) New Revision: 9988 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: accidentally commented out 5.2.3. A simple Sun's JSF Reference Implementat= ion (RI) portlet on JBoss AS 4.2 appears again Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-15 06:27:57 UTC (rev 9987) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-15 06:32:34 UTC (rev 9988) @@ -986,50 +986,8 @@ warUrl=3D.../deploy/helloworldjspportlet.war/]]> - + = Package Content --===============8749659118211654079==-- From portal-commits at lists.jboss.org Fri Feb 15 03:15:41 2008 Content-Type: multipart/mixed; boundary="===============0004490671856905212==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9989 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Fri, 15 Feb 2008 03:15:41 -0500 Message-ID: --===============0004490671856905212== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-15 03:15:41 -0500 (Fri, 15 Feb 2008) New Revision: 9989 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: revising 5.2.2. An example JSP Portlet Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-15 06:32:34 UTC (rev 9988) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-15 08:15:41 UTC (rev 9989) @@ -534,7 +534,7 @@ - Run the ant deploy command. On Microsoft Windo= ws, the output will be similar to the following: + Change into HelloWorldPortlet/ directory, an= d run the ant deploy command. On Microsoft Windows, the = output will be similar to the following: @@ -543,12 +543,12 @@ - - Note: the directory names will be different for your system. - + + Note: the directory names will be different for your system. + Expanding the helloworldportlet.war file allows= you to deploy the portlet as an expanded directory, which makes developmen= t easier. As well, it gives you access to the XML descriptors, resource fil= es, JSF, and JSP pages. To expand the helloworldportlet.war file: @@ -570,13 +570,13 @@ - - Note: the directory names will be different for your system. - + Note: the directory names will be different for your system. + + The ant explode command creates a directory struc= ture such as the following: @@ -587,7 +587,7 @@ - The expanded war file and the XML descriptors are located in the HelloWorldPortlet/output/lib/exploded/helloworldportlet.war/ directory. + The expanded war file and the XML descriptors are located in the HelloWorldPortlet/output/lib/exploded/helloworldportlet.war/WEB-INF= / directory. @@ -882,12 +882,12 @@ - If required, edit the HelloWorldJSPPortlet/src/main/org= /jboss/portlet/hello/HelloWorldJSPPortlet.java file, and the XML= descriptors in the HelloWorldJSPPortlet/src/resources/helloworld= jspportlet-war/WEB-INF directory. + If required, edit the HelloWorldJSPPortlet/src/main/org= /jboss/portlet/hello/HelloWorldJSPPortlet.java file, and the XML= descriptors in the HelloWorldJSPPortlet/src/resources/helloworld= jspportlet-war/WEB-INF/ directory. - Run the ant deploy command. On Linux, the outp= ut will be similar to the following: + Change into HelloWorldJSPPortlet/ directory,= and run the ant deploy command. On Linux, the output wi= ll be similar to the following: @@ -940,7 +940,7 @@ - The expanded war file and the XML descriptors are located in the HelloWorldJSPPortlet/output/lib/exploded/helloworldjspportlet.war/ directory. + The expanded war file and the XML descriptors are located in the HelloWorldJSPPortlet/output/lib/exploded/helloworldjspportlet.war/WE= B-INF/ directory. @@ -958,7 +958,7 @@ - To see the HelloWorldJSPPortlet, navigate to http://localhost:8080/portal= /, or, if the default JBoss Portal page is already open, refresh the page. = The HelloWorldJSPPortlett is added to the bottom of the default JBoss Porta= l page: + To see the HelloWorldJSPPortlet, navigate to , or, if the default JBoss Portal page is already = open, refresh the page. The HelloWorldJSPPortlet is added to the bottom of = the default JBoss Portal page: @@ -989,7 +989,7 @@ - A simple Sun's JSF Reference Implementation (RI) portlet o= n JBoss AS 4.2 + A Sun JSF Reference Implementation (RI) portlet Introduction This section will introduce the reader to deploying a si= mple JSF portlet in JBoss Portal, using --===============0004490671856905212==-- From portal-commits at lists.jboss.org Fri Feb 15 06:57:45 2008 Content-Type: multipart/mixed; boundary="===============3807324227554852375==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9990 - modules/portlet/tags. Date: Fri, 15 Feb 2008 06:57:43 -0500 Message-ID: --===============3807324227554852375== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-15 06:57:43 -0500 (Fri, 15 Feb 2008) New Revision: 9990 Added: modules/portlet/tags/JBP_PORTLET_2_0_0_BETA1/ Log: tagging portlet container 2.0.0 beta 1 Copied: modules/portlet/tags/JBP_PORTLET_2_0_0_BETA1 (from rev 9983, module= s/portlet/trunk) --===============3807324227554852375==-- From portal-commits at lists.jboss.org Fri Feb 15 14:27:12 2008 Content-Type: multipart/mixed; boundary="===============5548764229459943337==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9991 - modules/portlet/trunk/docs. Date: Fri, 15 Feb 2008 14:27:11 -0500 Message-ID: --===============5548764229459943337== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-15 14:27:11 -0500 (Fri, 15 Feb 2008) New Revision: 9991 Removed: modules/portlet/trunk/docs/docbook-support/ Modified: modules/portlet/trunk/docs/ Log: use svn:externals instead of direct docbook for docbook support Property changes on: modules/portlet/trunk/docs ___________________________________________________________________ Name: svn:externals + docbook-support http://anonsvn.jboss.org/repos/portal/tools/docbook/su= pport/ docbook-support/styles http://anonsvn.jboss.org/repos/portal/tools/docbook/= styles/renaissance/ --===============5548764229459943337==-- From portal-commits at lists.jboss.org Fri Feb 15 15:16:12 2008 Content-Type: multipart/mixed; boundary="===============4617353322753592687==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9992 - in demo/trunk: conf/core-cms and 2 other directories. Date: Fri, 15 Feb 2008 15:16:12 -0500 Message-ID: --===============4617353322753592687== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-15 15:16:12 -0500 (Fri, 15 Feb 2008) New Revision: 9992 Added: demo/trunk/portlets/seamBooking/ demo/trunk/portlets/seamBooking/seamEAR.ear Modified: demo/trunk/build.properties demo/trunk/build.xml demo/trunk/conf/core-cms/jboss-service.xml Log: Modified: demo/trunk/build.properties =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- demo/trunk/build.properties 2008-02-15 19:27:11 UTC (rev 9991) +++ demo/trunk/build.properties 2008-02-15 20:16:12 UTC (rev 9992) @@ -1,7 +1,7 @@ # Location of the JBoss Portal + 4.0.5 AS bundle -portal.bundle.url=3D/home/theute/Portal/workspace_2.6/demo/jboss-portal-2.= 6.3-bundled.zip +portal.bundle.url=3D/home/theute/Downloads/jboss-portal-2.6.4-bundled.zip # Name used as top directory in the bundle -portal.name.dir=3Djboss-portal-2.6.3 +portal.name.dir=3Djboss-portal-2.6.4 # Where to create the demo website and associated tgz file destination.dir=3D/home/theute/Portal/demoWebsite # Where to put temporary files during the construction of the portal demo Modified: demo/trunk/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- demo/trunk/build.xml 2008-02-15 19:27:11 UTC (rev 9991) +++ demo/trunk/build.xml 2008-02-15 20:16:12 UTC (rev 9992) @@ -113,6 +113,11 @@ = + + + + = + @@ -137,8 +142,8 @@ = + update-context,install-objectsdescriptor, install-wsrpdescriptor= , install-jbossforums, install-seamBooking, install-jbosswiki, activate-wor= kflow, default-cms-content"> = - \ No newline at end of file + Modified: demo/trunk/conf/core-cms/jboss-service.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- demo/trunk/conf/core-cms/jboss-service.xml 2008-02-15 19:27:11 UTC (rev= 9991) +++ demo/trunk/conf/core-cms/jboss-service.xml 2008-02-15 20:16:12 UTC (rev= 9992) @@ -24,9 +24,11 @@ = + + + + jboss.jca:service=3DDataSourceBinding,name=3DPortalDS portal:service=3DJAASLoginModule portal:service=3DHibernate,type=3DCMS - portal:service=3DModule,type=3DIdentityServiceControlle= r - = + cms.pm.cache:service=3DTreeCache + portal:service=3DAuthorizationManager,type=3Dcms + portal:service=3DApprovePublish,type=3DWorkflow - = + portal:service=3DInterceptorStackFactory,type=3DCms true portal/cms/conf/default-c= ontent/default/ en PortalRepository ${jboss.server.data.dir}${/}portal${/}cm= s${/}conf = - java:/portal/IdentitySess= ionFactory - = + name=3D"cms.pm.cache:service=3DTreeCache"> = jboss:service=3DNaming jboss:service=3DTransactionManager portal:service=3DHibernate,type=3DCMS - portal:service=3DCMS - @@ -431,7 +431,7 @@ false false - = + portal:service=3DInterceptor,type=3DCms,nam= e=3DACL portal:service=3DInterceptor,type=3DCms,nam= e=3DApprovalWorkflow - = - = + + = + + admin = portal:service=3DModule,type=3DIdentityServiceControlle= r = - = + portal:service=3DHibernate,type=3DCMS portal:service=3DModule,type=3DIdentityServiceController = - = + portal:commandFactory=3DCMSObject + portal:service=3DPortalAuthorizationMana= gerFactory + portal:container=3DInstance + + + + + + portal:service=3DWorkflow,type=3DWorkflowService + + + portal:service=3DModule,type=3DIdentityServiceController + + + + + + + = + + + + + + = + + + = + + = + = = + = = + = + = + = + ]]> + + + false + + Admin + java:portal/ApprovePublishWorkflow + + + + = + = Added: demo/trunk/portlets/seamBooking/seamEAR.ear =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: demo/trunk/portlets/seamBooking/seamEAR.ear ___________________________________________________________________ Name: svn:mime-type + application/octet-stream --===============4617353322753592687==-- From portal-commits at lists.jboss.org Fri Feb 15 16:13:25 2008 Content-Type: multipart/mixed; boundary="===============2517949382331822871==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9993 - in modules/portlet/tags/JBP_PORTLET_2_0_0_BETA1: test/src/test and 1 other directory. Date: Fri, 15 Feb 2008 16:13:25 -0500 Message-ID: --===============2517949382331822871== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-15 16:13:25 -0500 (Fri, 15 Feb 2008) New Revision: 9993 Modified: modules/portlet/tags/JBP_PORTLET_2_0_0_BETA1/build/pom.xml modules/portlet/tags/JBP_PORTLET_2_0_0_BETA1/test/src/test/build.xml Log: make beta1 tag not use snapshots........ Modified: modules/portlet/tags/JBP_PORTLET_2_0_0_BETA1/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/tags/JBP_PORTLET_2_0_0_BETA1/build/pom.xml 2008-02-15 2= 0:16:12 UTC (rev 9992) +++ modules/portlet/tags/JBP_PORTLET_2_0_0_BETA1/build/pom.xml 2008-02-15 2= 1:13:25 UTC (rev 9993) @@ -39,7 +39,7 @@ 3.6-beta 2.2.1.GA 1.2.0-Beta1 - 1.2.0-SNAPSHOT + 1.2.0-Beta1 1.2.0-Beta1 1.2.14 1.1.1 @@ -95,7 +95,7 @@ org.jboss.unit jboss-unit-tooling-maven2 - 1.2.0-SNAPSHOT + 1.2.0-Beta1 Modified: modules/portlet/tags/JBP_PORTLET_2_0_0_BETA1/test/src/test/build.= xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/tags/JBP_PORTLET_2_0_0_BETA1/test/src/test/build.xml 20= 08-02-15 20:16:12 UTC (rev 9992) +++ modules/portlet/tags/JBP_PORTLET_2_0_0_BETA1/test/src/test/build.xml 20= 08-02-15 21:13:25 UTC (rev 9993) @@ -407,9 +407,6 @@ - - - @@ -446,8 +443,6 @@ - - @@ -604,6 +599,9 @@ = + + + --===============2517949382331822871==-- From portal-commits at lists.jboss.org Fri Feb 15 16:23:23 2008 Content-Type: multipart/mixed; boundary="===============7066694522735320273==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9994 - in demo/trunk: conf and 1 other directory. Date: Fri, 15 Feb 2008 16:23:23 -0500 Message-ID: --===============7066694522735320273== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-15 16:23:23 -0500 (Fri, 15 Feb 2008) New Revision: 9994 Modified: demo/trunk/build.xml demo/trunk/conf/default-object.xml Log: Modified: demo/trunk/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- demo/trunk/build.xml 2008-02-15 21:13:25 UTC (rev 9993) +++ demo/trunk/build.xml 2008-02-15 21:23:23 UTC (rev 9994) @@ -110,6 +110,7 @@ + = Modified: demo/trunk/conf/default-object.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- demo/trunk/conf/default-object.xml 2008-02-15 21:13:25 UTC (rev 9993) +++ demo/trunk/conf/default-object.xml 2008-02-15 21:23:23 UTC (rev 9994) @@ -270,7 +270,7 @@ WeatherPortletWindow WeatherPortletInstance - left + center 0 --===============7066694522735320273==-- From portal-commits at lists.jboss.org Fri Feb 15 16:29:46 2008 Content-Type: multipart/mixed; boundary="===============5054982360174304295==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9995 - in modules/portlet/trunk: test/src/test and 1 other directory. Date: Fri, 15 Feb 2008 16:29:46 -0500 Message-ID: --===============5054982360174304295== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-15 16:29:46 -0500 (Fri, 15 Feb 2008) New Revision: 9995 Modified: modules/portlet/trunk/build/pom.xml modules/portlet/trunk/test/src/test/build.xml Log: remove snapshot from portlet trunk for now Modified: modules/portlet/trunk/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/build/pom.xml 2008-02-15 21:23:23 UTC (rev 9994) +++ modules/portlet/trunk/build/pom.xml 2008-02-15 21:29:46 UTC (rev 9995) @@ -39,7 +39,7 @@ 3.6-beta 2.2.1.GA 1.2.0-Beta1 - 1.2.0-SNAPSHOT + 1.2.0-Beta1 1.2.0-Beta1 1.2.14 1.1.1 @@ -95,7 +95,7 @@ org.jboss.unit jboss-unit-tooling-maven2 - 1.2.0-SNAPSHOT + 1.2.0-Beta1 Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-15 21:23:23 UTC (= rev 9994) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-15 21:29:46 UTC (= rev 9995) @@ -407,9 +407,6 @@ - - - @@ -446,8 +443,6 @@ - - @@ -604,6 +599,9 @@ = + + + --===============5054982360174304295==-- From portal-commits at lists.jboss.org Fri Feb 15 16:44:14 2008 Content-Type: multipart/mixed; boundary="===============7238846020160241159==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9996 - in demo/trunk: portlets/jbosswiki and 1 other directory. Date: Fri, 15 Feb 2008 16:44:13 -0500 Message-ID: --===============7238846020160241159== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-15 16:44:13 -0500 (Fri, 15 Feb 2008) New Revision: 9996 Added: demo/trunk/portlets/jbosswiki/portlet-instances.xml Modified: demo/trunk/build.xml Log: Modified: demo/trunk/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- demo/trunk/build.xml 2008-02-15 21:29:46 UTC (rev 9995) +++ demo/trunk/build.xml 2008-02-15 21:44:13 UTC (rev 9996) @@ -111,7 +111,8 @@ - + + = Added: demo/trunk/portlets/jbosswiki/portlet-instances.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- demo/trunk/portlets/jbosswiki/portlet-instances.xml = (rev 0) +++ demo/trunk/portlets/jbosswiki/portlet-instances.xml 2008-02-15 21:44:13= UTC (rev 9996) @@ -0,0 +1,10 @@ + + + + overwrite + + WikiPortletInstance + wikiportlet.WikiPortlet + + + \ No newline at end of file --===============7238846020160241159==-- From portal-commits at lists.jboss.org Fri Feb 15 21:54:58 2008 Content-Type: multipart/mixed; boundary="===============2541235356316430933==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9997 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Fri, 15 Feb 2008 21:54:58 -0500 Message-ID: --===============2541235356316430933== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-15 21:54:58 -0500 (Fri, 15 Feb 2008) New Revision: 9997 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: revising 5.2.3. An example Sun JSF Reference Implementation (RI) Portle *** this will break the book until later commits *** Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-15 21:44:13 UTC (rev 9996) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-16 02:54:58 UTC (rev 9997) @@ -141,7 +141,7 @@ Introduction - This section describes how to deploy a portlet for JBoss Portal. Bef= ore proceeding, download the HelloWorldPortlet from JBoss PortletSwap. @@ -264,7 +264,10 @@ - The following is an example of the HelloWorldPortlet/WEB-IN= F/portlet.xml file. In order to create the WEB-INF/ and META-INF/ directories, extract the helloworldportlet.war file.This file must adhere to its defi= nition in the JSR-168 Portlet Specification. You may define more than one p= ortlet application in this file: + To create the WEB-INF/ and META-INF/<= /filename> directories, extract the helloworldportlet.war file. + + + The following is an example of the HelloWorldPortlet/WEB-I= NF/portlet.xml file. This file must adhere to its definition in = the JSR-168 Portlet Specification. You may define more than one portlet app= lication in this file: Introduction - This section describes how to deploy a JSP portlet for JBoss Portal.= Before proceeding, download the HelloWorldJSP= Portlet from JBos= s PortletSwap. The HelloWorldJSPPortlet demonstrates how to use JSP= s for view rendering, and the portlet taglib for generating links. + This section describes how to deploy a JSP portlet in JBoss Portal. = Before proceeding, download the HelloWorldJSPP= ortlet from JBoss= PortletSwap. The HelloWorldJSPPortlet demonstrates how to use JSPs= for view rendering, and the portlet tag library (taglib) for generating li= nks. - Package Content + Package Structure The application descriptors for the HelloWorldJSPPortlet portlet are= similar to those from the HelloWorldPortlet (). See for further = information about application descriptors. - The following is an example of the directory structure of the HelloW= orldJSPPortlet portlet. The HelloWorldJSPPortlet portlet contains the tradi= tional portlet and JBoss Portal specific application descriptors. In order = to create the WEB-INF/ and META-INF/ directories, extract the helloworldjspportlet.war = file. + The HelloWorldJSPPortlet portlet contains the traditional portlet an= d JBoss Portal specific application descriptors. The following is an exampl= e of the directory structure of the HelloWorldJSPPortlet portlet: @@ -658,9 +661,12 @@ + + To create the WEB-INF/ and META-INF/<= /filename> directories, extract the helloworldjspportlet.war file. + - Portlet Class + Portlet Classes The HelloWorldJSPPortlet contai= ns the HelloWorldJSPPortlet/src/main/org/jboss/portlet/hello/Hell= oWorldJSPPortlet.java file: @@ -789,7 +795,7 @@ JSP Files and the Portlet Tag Library - The HelloWorldJSPPortlet/WEB-INF/jsp/view.jsp a= nd HelloWorldJSPPortlet/WEB-INF/jsp/view2.jsp JSP file= s are included in the HelloWorldJSPPortlet portlet. The view.jsp<= /filename> file allows a user to input their name. This is then posted to t= he processAction method in the portlet cla= ss, which is set as a aResponse.setRenderParameter. The render method, doView, is invoked, which dispatches to the view2.jsp JSP: + The HelloWorldJSPPortlet/WEB-INF/jsp/view.jsp a= nd HelloWorldJSPPortlet/WEB-INF/jsp/view2.jsp JSP file= s are included in the HelloWorldJSPPortlet portlet. The view.jsp<= /filename> file allows a user to input their name. This is then posted to t= he processAction method in the portlet cla= ss, which is set as a aResponse.setRenderParameter. The doView render method is invoked, which dispatches to the view2.jsp JSP: @@ -831,7 +837,7 @@ - Define the portlet tag library (taglib). You do not need to bundle the p= ortlet taglib - JBoss Portal handles this for you. + Define the portlet taglib. You do not need to bundle the portlet taglib = - JBoss Portal handles this for you. @@ -861,7 +867,7 @@ - You can create a link to the doView met= hod by creating a renderURL, that passes t= he yourname parameter. + You can create a link to the doView met= hod by creating a renderURL, which passes = the yourname parameter. @@ -972,7 +978,7 @@ -touch $JBOSS_HOME/server/configuration/deploy//= helloworldjspportlet.war/WEB-INF/web.xml +touch $JBOSS_HOME/server/configuration/deploy/h= elloworldjspportlet.war/WEB-INF/web.xml @@ -989,43 +995,59 @@ - A Sun JSF Reference Implementation (RI) portlet + An example Sun JSF Reference Implementation (RI) Portlet</= title> <sect3> <title>Introduction - This section will introduce the reader to deploying a si= mple JSF portlet in JBoss Portal, using - Apache's MyFaces JSF implementation on JBoss AS 4.2.x. It r= equires you download the HelloWorldJSFSunRIPortlet - from PortletSwap.com, using this link: - http://anonsvn.jboss.org/= repos/portletswap/portlets/2_6/bundles/HelloWorldJSFSunRIPortlet.zip. + + This section describes how to deploy a JSF portlet in JBoss Portal, = using the Apache MyFaces JSF implementation on JBoss AS or JBoss EAP. Befor= e proceeding, download the HelloWorldJSFS= unRIPortlet from = JBoss PortletSwap. = - Package Content + Package Structure + + JBoss Portal requires certain descriptors to be included in a portle= t WAR file. Some of these descriptors are defined by the JSR-168 Portlet Sp= ecification, and others are specific to JBoss Portal. Like a typical JSF ap= plication, the HelloWorldJSFSunRIPortlet package contains a faces= -config.xml file, that defines managed-beans, converters, valida= tors, navigation rules, and so on. The following is an example of the direc= tory structure of the HelloWorldJSFSunRIPortlet portlet: + - Like a typical JSF application, we also package our faces-c= onfig.xml that defines our - managed-beans, converters, validators, navigation rules, et= c... - JBoss Application Server version 4.2.x bundles Sun's = JSF Reference Implementation (RI) in - JBOSS_HOME/server/default/deploy/jboss-web.depl= oyer/jsf-libs/. As a result, - you do not need to package Sun RI's libraries with your = portlet application. + + + To create the WEB-INF/ and META-INF/= directories, extract the helloworldjsfsunriportlet.war file. + + + + Bundled Sun JSF RI + + JBoss AS version 4.2.x and JBoss EAP = bundle Sun's JSF RI in the + $JBOSS_HOME/server/default/deploy/jboss-web.de= ployer/jsf-libs/ directory. Therefore, you do not need to packag= e the Sun JSF RI libraries with your portlet application. + - For the sake of brevity, we only discuss the po= rtlet.xml and - faces-config.xml descriptors here. For d= iscussion on the other descriptors, please - view or the c= hapter on descriptors: - . + + + Application Descriptors + + For brevity, only the portlet.xml, fa= ces-config.xml, and web.xml descriptors are= defined. For more information on other discriptors, refer to and . + + + The following is an example of the directory structure of the HelloW= orldJSFSunRIPortlet portlet: + + - - - portlet.xml - + + + The following is an example of the HelloWorldJSFSunRIPor= tlet/WEB-INF/portlet.xml file. This file must adhere to its defi= nition in the JSR-168 Portlet Specification. You may define more than one p= ortlet application in this file: + + + HelloWorld JSF Portlet -]]> - This file must adhere to its definition in the Por= tlet Specification. You may define more than - one portlet application in this file. Now let's lo= ok at the portions that deal with our use of - JSF: - - - - c= om.sun.faces.portlet.FacesPortlet]]> - Here we specify that com.sun.faces.portle= t.FacesPortlet will handle all requests/responses from our - users. This class is part of jsf-portlet.= jar as explained later. - - - - - We need to initialize the portlet with a = default view page for it to render, much like - a welcome page: - +]]> + + + + + com.sun.faces.portlet.FacesPortlet]]> + + + + This specifies that the com.sun.faces.portlet.FacesPortl= et handles all requests and responses from users. This cla= ss is part of the HelloWorldJSFSunRIPortlet/WEB-INF/lib/jsf-portl= et.jar file. + + + + com.sun.faces.portlet.INIT_VIEW /WEB-INF/jsp/index.jsp -]]> - - - - - +]]> + + + + You must initializes the portlet with a default view page to render, sim= ilar to the default JBoss Portal page. + + + + + = faces-config.xml --===============2541235356316430933==-- From portal-commits at lists.jboss.org Fri Feb 15 23:01:17 2008 Content-Type: multipart/mixed; boundary="===============5464103666281618717==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9998 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Fri, 15 Feb 2008 23:01:16 -0500 Message-ID: --===============5464103666281618717== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-15 23:01:16 -0500 (Fri, 15 Feb 2008) New Revision: 9998 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: 5.2.3.3. Application Descriptors revising, replacing itemizedlist with variable trying to make it more consistent with = 5.2.1.4. Application Descriptors Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-16 02:54:58 UTC (rev 9997) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-16 04:01:16 UTC (rev 9998) @@ -1093,12 +1093,15 @@ You must initializes the portlet with a default view page to render, sim= ilar to the default JBoss Portal page. - + + - = - - faces-config.xml - + + The following is an example HelloWorldJSFSunRIPortlet/WEB-INF/f= aces-config.xml file: + + + @@ -1115,16 +1118,18 @@ /WEB-INF/jsp/result.jsp -]]> - There is nothing special about the faces-= config.xml file included here. This - application would work just as well outside of a p= ortlet as it would inside a portlet container. - In the above lines, we define a basic Use= r Bean and a navigation rule to - handle the submittal of the original form on index.jsp. - - - - web.xml - +]]> + + + + Without the faces-config.xml, the application would = work the same outside of the portlet, as it would inside a portlet containe= r. In this exampel, a basic user bean, <managed-bean-nam= e>user</managed-bean-name>, and a navigation <navigation-rule> rule are defined, whic= h handle submitting the original form in the HelloWorldJSFSunRIPo= rtlet/WEB-INF/jsp/index.jsp file. + + + The following is an example of the HelloWorldJSFSunRIPortlet/WE= B-INF/web.xml file: + + + @@ -1144,18 +1149,20 @@ *.jsf = -]]> - For the Sun RI, this definition is mandatory to as= sociate jsf extension with the faces servlet. - - - - jsf-portlet.jar This library= that can be downloaded here: https://jsfportletbridge.dev.java.net/= servlets/ProjectDocumentList - contains the classes for the JSF-Portlet bridge. Sinc= e 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. - - - +]]> + + + + For the Sun JSF RI, this definition is mandatory to associate .= jsf extensions with the faces servlet. + + + + Classes for the JSF-Portlet bridge are not included + + The classes for the JSF-Portlet bridge are not included with the JSF im= plementation (unlike Apache MyFaces), JBoss AS, or JBoss EAP. This library = must be available in your application package. Navigate to the JSF= -Portlet bridge webpage to download the JSF-Portlet bridge library. + + + Building and deploying your portlet --===============5464103666281618717==-- From portal-commits at lists.jboss.org Sat Feb 16 00:05:06 2008 Content-Type: multipart/mixed; boundary="===============7681845069019466206==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9999 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Sat, 16 Feb 2008 00:05:05 -0500 Message-ID: --===============7681845069019466206== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-16 00:05:05 -0500 (Sat, 16 Feb 2008) New Revision: 9999 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: minor corrections/revisions 5.2.3. An example Sun JSF Reference Implementation (RI) Portlet Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-16 04:01:16 UTC (rev 9998) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-16 05:05:05 UTC (rev 9999) @@ -974,7 +974,7 @@ - To re-deploy the portlet, for example, if you have made changes to any of= the XML descriptors, touch the $JBOSS_HOME/server/configuration/deploy/hel= loworldjspportlet.war/WEB-INF/web.xml file. On Linux, run the following com= mand to re-deploy the HelloWorldJSPPortlet: + To re-deploy the portlet, for example, if you have made changes to any of= the XML descriptors, touch the $JBOSS_HOME/server/c= onfiguration/deploy/helloworldjspportlet.war/WEB-INF/web.xml<= /filename> file. On Linux, run the following command to re-deploy the Hello= WorldJSPPortlet: @@ -999,13 +999,13 @@ Introduction - This section describes how to deploy a JSF portlet in JBoss Portal, = using the Apache MyFaces JSF implementation on JBoss AS or JBoss EAP. Befor= e proceeding, download the HelloWorldJSFS= unRIPortlet from = JBoss PortletSwap. + This section describes how to deploy a JSF portlet in JBoss Portal, = using the Apache MyFaces JSF implementation in JBoss AS or JBoss EAP. Befor= e proceeding, download the HelloWorldJSFS= unRIPortlet from = JBoss PortletSwap. = Package Structure - JBoss Portal requires certain descriptors to be included in a portle= t WAR file. Some of these descriptors are defined by the JSR-168 Portlet Sp= ecification, and others are specific to JBoss Portal. Like a typical JSF ap= plication, the HelloWorldJSFSunRIPortlet package contains a faces= -config.xml file, that defines managed-beans, converters, valida= tors, navigation rules, and so on. The following is an example of the direc= tory structure of the HelloWorldJSFSunRIPortlet portlet: + JBoss Portal requires certain descriptors to be included in a portle= t WAR file. Some of these descriptors are defined by the JSR-168 Portlet Sp= ecification, and others are specific to JBoss Portal. Like a typical JSF ap= plication, the HelloWorldJSFSunRIPortlet package contains a faces= -config.xml file that defines managed-beans, converters, validat= ors, navigation rules, and so on. The following is an example of the direct= ory structure of the HelloWorldJSFSunRIPortlet portlet: @@ -1015,7 +1015,7 @@ - To create the WEB-INF/ and META-INF/= directories, extract the helloworldjsfsunriportlet.war file. + To create the WEB-INF/ and META-INF/= directories, extract the helloworldjsfsunriportlet.wa= r file. @@ -1030,18 +1030,8 @@ Application Descriptors - For brevity, only the portlet.xml, fa= ces-config.xml, and web.xml descriptors are= defined. For more information on other discriptors, refer to and . + For brevity, only the portlet.xml, fa= ces-config.xml, and web.xml descriptors are= described here. For more information about application descriptors, refer = to and . - - The following is an example of the directory structure of the HelloW= orldJSFSunRIPortlet portlet: - - - - - - - - The following is an example of the HelloWorldJSFSunRIPor= tlet/WEB-INF/portlet.xml file. This file must adhere to its defi= nition in the JSR-168 Portlet Specification. You may define more than one p= ortlet application in this file: @@ -1078,7 +1068,7 @@ - This specifies that the com.sun.faces.portlet.FacesPortl= et handles all requests and responses from users. This cla= ss is part of the HelloWorldJSFSunRIPortlet/WEB-INF/lib/jsf-portl= et.jar file. + This specifies that the com.sun.faces.portlet.FacesPortl= et handles all requests and responses from the users. This= class is part of the HelloWorldJSFSunRIPortlet/WEB-INF/lib/jsf-p= ortlet.jar file. @@ -1090,7 +1080,7 @@ - You must initializes the portlet with a default view page to render, sim= ilar to the default JBoss Portal page. + You must initialize the portlet with a default page to render, similar t= o what is done with the default JBoss Portal page. @@ -1122,10 +1112,10 @@ - Without the faces-config.xml, the application would = work the same outside of the portlet, as it would inside a portlet containe= r. In this exampel, a basic user bean, <managed-bean-nam= e>user</managed-bean-name>, and a navigation <navigation-rule> rule are defined, whic= h handle submitting the original form in the HelloWorldJSFSunRIPo= rtlet/WEB-INF/jsp/index.jsp file. + Without the faces-config.xml file, the application w= ould work the same outside of the portlet, as it would inside a portlet con= tainer. In this example, a basic user bean, <managed-bea= n-name>user</managed-bean-name>, and a navigation= rule are defined, which handle submitting the original form in the HelloWorldJSFSunRIPortlet/WEB-INF/jsp/index.jsp file. - The following is an example of the HelloWorldJSFSunRIPortlet/WE= B-INF/web.xml file: + The following is an example of the Faces Servlet section from the HelloWorldJSFSunRIPortlet/WEB-INF/web.x= ml file: - For the Sun JSF RI, this definition is mandatory to associate .= jsf extensions with the faces servlet. + For the Sun JSF RI, this definition is mandatory to associate files with = .jsf extensions with the Apache MyFaces servlet. Classes for the JSF-Portlet bridge are not included - The classes for the JSF-Portlet bridge are not included with the JSF im= plementation (unlike Apache MyFaces), JBoss AS, or JBoss EAP. This library = must be available in your application package. Navigate to the JSF= -Portlet bridge webpage to download the JSF-Portlet bridge library. + Unlike Apache MyFaces, the classes for the JSF-Portlet bridge are not i= ncluded with the JSF implementation, JBoss AS, or JBoss EAP. This library m= ust be available in your application package. Navigate to the JSF-Po= rtlet bridge webpage to download the JSF-Portlet bridge library. --===============7681845069019466206==-- From portal-commits at lists.jboss.org Sat Feb 16 01:20:27 2008 Content-Type: multipart/mixed; boundary="===============5133479651549738608==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10000 - in docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en: images/tutorials/jsp_portlet and 1 other directories. Date: Sat, 16 Feb 2008 01:20:27 -0500 Message-ID: --===============5133479651549738608== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-16 01:20:27 -0500 (Sat, 16 Feb 2008) New Revision: 10000 Added: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/tutorials= /jsf_portlet/jsf_ant_deploy.png docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/tutorials= /jsf_portlet/jsf_ant_explode.png Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/tutorials= /jsp_portlet/jsp_ant_explode.png docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: 5.2.3. An example Sun JSF Reference Implementation (RI) Portlet * adding images of ant deploy and ant explode * fixing my images that had a black line * revising 5.2.3 to be consistent with 5.2.1. Deploying your first Portlet and 5.2.2. An example JSP Portlet Added: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/tutor= ials/jsf_portlet/jsf_ant_deploy.png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/e= n/images/tutorials/jsf_portlet/jsf_ant_deploy.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/tutor= ials/jsf_portlet/jsf_ant_explode.png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/e= n/images/tutorials/jsf_portlet/jsf_ant_explode.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/tu= torials/jsp_portlet/jsp_ant_explode.png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-16 05:05:05 UTC (rev 9999) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-16 06:20:27 UTC (rev 10000) @@ -1155,34 +1155,114 @@ - Building and deploying your portlet - If you have downloaded the sample, you can execute the b= uild.xml with ant or inside your IDE. - Executing ant will compile all source fi= les and produce a - helloworldjspportlet.war file in a way s= imilar to what we saw in - . + Building your JSF Portlet + + The HelloWorldJSFSunRIPortlet.zip file contains a= pre-compiled helloworldjsfsunriportlet.war file; howe= ver, to manually build the helloworldjsfsunriportlet.war file: + + + + + + Change into the HHelloWorldJSFSunRIPortlet dir= ectory, and remove the existing helloworldjsfsunriportlet.war file. + + + + + If required, edit the HelloWorldJSFSunRIPortlet/src/main/= org/jboss/portlet/hello/bean/User.java file, and the XML descrip= tors in the HelloWorldJSFSunRIPortlet/src/resources/helloworldjsf= sunriportlet-war/WEB-INF/ directory. + + + + + Change into HelloWorldJSFSunRIPortlet/ directo= ry, and run the ant deploy command. On Linux, the output= will be similar to the following: + + + + + + + + + + + + + Note: the directory names will be different for your system. + + + Expanding the helloworldjsfsunriportlet.war fil= e allows you to deploy the portlet as an expanded directory, which makes de= velopment easier. As well, it gives you access to the XML descriptors, reso= urce files, JSF, and JSP pages. To expand the helloworldjsfsunrip= ortlet.war file: + + + + + + If you do not have the HelloWorldJSFSunRIPortlet/hellow= orldjsfsunriportlet.war file, change into the HelloWor= ldJSFSunRIPortlet/ directory, and run the ant deploy command. This creates the helloworldjsfsunriportlet.war file. + + + + + To expand the war file, change into the HelloWorldJSFSu= nRIPortlet/ directory, and run the ant explode command. On Linux, the output will be similar to the following: + + + + + + + + + + + + + Note: the directory names will be different for your system. + + + The expanded war file and the XML descriptors are located in the HelloWorldJSFSunRIPortlet/output/lib/exploded/helloworldjsfsunriport= let.war directory. - - - Deploying the portlet is as easy as copying/moving the helloworldjspportlet.war file - to the server deploy directory. We can t= hen see our portlet on the Portal default - page (http://l= ocalhost:8080/portal/): - - - - - - - - + + To re-deploy the portlet, for example, if you have made changes to a= ny of the XML descriptors, touch the $JBOSS_HOME/server/configuration/deploy/helloworldjsfsunriportlet.war/WEB-IN= F/web.xml file. On Linux, run the following command to re-deploy= the HelloWorldPortlet: + + + +touch $JBOSS_HOME/server/configuration/deploy/h= elloworldjsfsunriportlet.war/WEB-INF/web.xml + + + + Re-deploying the HelloWorldJSFPortlet will produce output to the JBos= s AS or JBoss EAP console, similar to the following: + + + + + + + - A simple MyFaces JSF Portlet on JBoss AS 4.2 + An example Apache MyFaces JSF Portlet Introduction - This section will introduce the reader to deploying a si= mple JSF portlet in JBoss Portal, using - Apache's MyFaces JSF implementation on JBoss AS 4.2. It req= uires you download the HelloWorldJSFMyFaces42Portlet - from PortletSwap.com, using this link: - http://anonsvn.jboss.= org/repos/portletswap/portlets/2_6/bundles/HelloWorldJSFMyFaces42Portlet.zi= p. - There are actually different ways to do it, one would be to= use MyFaces globally for the whole server and replace the Sun RI - libraries by the myFaces ones, but in this section the port= let will not affect the application server and embed its - own libraries. - + + This section describes how to deploy a JSF portlet in JBoss Portal, = using the Apache MyFaces JSF implementation in JBoss AS or JBoss EAP. Befor= e proceeding, download the HelloWorld= JSFMyFaces42Portlet from JBoss PortletSwap. + + + Apache MyFaces can be used globally for the entire server, replacing= the Sun JSF RI libraries, but the HelloWorldJSFMyFaces42Portlet uses its o= wn libraries, and will not affect the application server. + - Package Content + Package Structure + + JBoss Portal requires certain descriptors to be included in a portle= t WAR file. Some of these descriptors are defined by the JSR-168 Portlet Sp= ecification, and others are specific to JBoss Portal. Like a typical JSF ap= plication, the HelloWorldJSFMyFaces42Portlet package contains a f= aces-config.xml file that defines managed-beans, converters, val= idators, navigation rules, and so on. The following is an example of the di= rectory structure of the HelloWorldJSFMyFaces42Portlet portlet: + - Like a typical JSF application, we also package our faces-c= onfig.xml that defines our - managed-beans, converters, validators, navigation rules, et= c... - The WEB-INF/lib must contain the MyFac= es libraries along with dependent libraries. + + + To create the WEB-INF/ and META-INF= / directories, extract the helloworldjsfmyfacesportlet= .war file. The WEB-INF/lib/ directory must = contain the MyFaces libraries, along with the dependent libraries. + + + Application Descriptors For the sake of brevity, we only discuss the po= rtlet.xml, web.xml and faces-config.xml descriptors here. For d= iscussion on the other descriptors, please view or the c= hapter on descriptors: @@ -1441,12 +1446,15 @@ - Building and deploying your portlet + Building your Apache MyFaces JSF Porlet If you have downloaded the sample, you can execute the b= uild.xml with ant or inside your IDE. Executing ant will compile all source fi= les and produce a helloworldjsfportlet.war file in a way s= imilar to what we saw in . + + + Deploying your Apache MyFaces JSF Portlet Deploying the portlet is as easy as copying/moving the helloworldjsfmyfacesportlet.war file to the server deploy directory. We can t= hen see our portlet on the Portal default --===============1680793742671664088==-- From portal-commits at lists.jboss.org Sun Feb 17 21:28:34 2008 Content-Type: multipart/mixed; boundary="===============0212284040436605100==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10009 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Sun, 17 Feb 2008 21:28:34 -0500 Message-ID: --===============0212284040436605100== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-17 21:28:34 -0500 (Sun, 17 Feb 2008) New Revision: 10009 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: periodic backup revising 5.2.4. A simple MyFaces JSF Portlet on JBoss AS 4.2 *** this will break the book until later commits *** Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-18 01:52:50 UTC (rev 10008) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-18 02:28:34 UTC (rev 10009) @@ -1348,14 +1348,15 @@ Application Descriptors - For the sake of brevity, we only discuss the po= rtlet.xml, web.xml and - faces-config.xml descriptors here. For d= iscussion on the other descriptors, please - view or the c= hapter on descriptors: - . - - - portlet.xml - + + For brevity, only the portlet.xml, fa= ces-config.xml, and web.xml descriptors are= described here. For more information about application descriptors, refer = to and . + + + The following is an example of the HelloWorldJSFMyFaces42P= ortlet/WEB-INF/portlet.xml file. This file must adhere to its de= finition in the JSR-168 Portlet Specification. You may define more than one= portlet application in this file: + + + HelloWorld JSF Portlet -]]> - This file must adhere to its definition in the Por= tlet Specification. You may define more than - one portlet application in this file. Now let's lo= ok at the portions that deal with our use of - JSF: - - - - o= rg.apache.myfaces.portlet.MyFacesGenericPortlet]]> - Here we specify that MyFacesGenericPortle= t will handle all requests/responses from our - users. There is therefore no need to deve= lop a specific portlet class, MyFaces - providing a generic implementation bridgi= ng the JSF and portlet worlds. - If you wanted to add more functiona= lity to your JSF portlet, not included in the - MyFacesGenericPortlet, you could subla= ss it and create your own Class. - - - - - We need to initialize the portlet with a = default view page for it to render, much like - a welcome page: - +]]> + + + + + org.apache.myfaces.portlet.MyFacesGenericPortlet]]> + + + + Here we specify that MyFacesGenericPortlet will handle all requests/resp= onses from our + users. There is therefore no need to develop a specific portlet class, M= yFaces + providing a generic implementation bridging the JSF and portlet worlds. + If you wanted to add more functionality to your JSF portlet,= not included in the + MyFacesGenericPortlet, you could sublass it and create your own Class. + + + + default-view /WEB-INF/jsp/index.jsp -]]> - - - - - - - web.xml +]]> + + + + We need to initialize the portlet with a default view page for it to ren= der, much like + a welcome page: + + + + + + + The following is an example HelloWorldJSFMyFaces42Portlet/WEB-I= NF/faces-config.xml file: + + + + + + + Basic UserBean + user + org.jboss.portlet.hello.bean.User + session + + + + done + /WEB-INF/jsp/result.jsp + + +]]> + = + = + web.xml org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL true --===============0212284040436605100==-- From portal-commits at lists.jboss.org Sun Feb 17 23:12:51 2008 Content-Type: multipart/mixed; boundary="===============1947981454157156793==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10010 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Sun, 17 Feb 2008 23:12:51 -0500 Message-ID: --===============1947981454157156793== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-17 23:12:51 -0500 (Sun, 17 Feb 2008) New Revision: 10010 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: 5.2.4. An example Apache MyFaces JSF Portlet revising to make more consistent with 5.2.1. Deploying your first Portlet Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-18 02:28:34 UTC (rev 10009) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-18 04:12:51 UTC (rev 10010) @@ -1084,6 +1084,18 @@ + + text/html + VIEW +]]> + + + The <supports> element all= ows you to declare all the markup types your portlet supports in the render method. This is accomplished via the + <mime-type> element, which= is required for every portlet. The declared MIME types must match the capa= bility of the portlet. As well, it allows you to pair which modes and windo= w states are supported for each markup type. All portlets must support the = VIEW portlet mode, so this does not have to be declared. Use <mime-type> to define which markup type your portl= et supports, which in this example, is text/html. This section tells the portal that it will only output text and HTM= L, and that it only supports the VIEW mode. + + + @@ -1343,7 +1355,7 @@ - To create the WEB-INF/ and META-INF= / directories, extract the helloworldjsfmyfacesportlet= .war file. The WEB-INF/lib/ directory must = contain the MyFaces libraries, along with the dependent libraries. + To create the WEB-INF/ and META-INF= / directories, extract the helloworldjsfmyfacesportlet= .war file. The WEB-INF/lib/ directory must = contain the Apache MyFaces libraries, along with the dependent libraries. @@ -1387,11 +1399,7 @@ - Here we specify that MyFacesGenericPortlet will handle all requests/resp= onses from our - users. There is therefore no need to develop a specific portlet class, M= yFaces - providing a generic implementation bridging the JSF and portlet worlds. - If you wanted to add more functionality to your JSF portlet,= not included in the - MyFacesGenericPortlet, you could sublass it and create your own Class. + This specifies that the org.apache.myfaces.portlet.MyFac= esGenericPortlet handles all requests and responses from t= he users. Therefore, there is no need to develop a specific portlet class, = as Apache MyFaces provides a generic implementation which bridges the JSF a= nd portlet worlds. @@ -1403,14 +1411,33 @@ - We need to initialize the portlet with a default view page for it to ren= der, much like - a welcome page: + You must initialize the portlet with a default page to render, similar t= o a welcome page. + + text/html + VIEW +]]> + + + The <supports> element all= ows you to declare all the markup types your portlet supports in the render method. This is accomplished via the + <mime-type> element, which= is required for every portlet. The declared MIME types must match the capa= bility of the portlet. As well, it allows you to pair which modes and windo= w states are supported for each markup type. All portlets must support the = VIEW portlet mode, so this does not have to be declared. Use <mime-type> to define which markup type your portl= et supports, which in this example, is text/html. This section tells the portal that it will only output text and HTM= L, and that it only supports the VIEW mode. + + + + + Adding Functionality to a Apache MyFaces JSF Porlet + + To add functionality to a Apache MyFaces JSF Porlet, sub-class it and c= reate your own class. + + + + The following is an example HelloWorldJSFMyFaces42Portlet/WEB-I= NF/faces-config.xml file: @@ -1433,48 +1460,26 @@ ]]> - = - = - web.xml - + + + + Without the faces-config.xml file, the application = would work the same outside of the portlet as it would inside a portlet con= tainer. In this example, a basic user bean, <managed-bea= n-name>user</managed-bean-name>, and a navigation= rule are defined, which handle the submission of the original form in the = HelloWorldJSFMyFaces42Portlet/WEB-INF/jsp/index.jsp fi= le. + + + The following is an example of the Faces Servlet section from the HelloWo= rldJSFMyFaces42Portlet/WEB-INF/web.xml file: + + + org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL true -]]> - We need this extra parameter to let the applicatio= n server know that the package embeds its own libraries. - It will avoid collision with the Sun RI JSF librar= ies bundled with JBoss AS. - More details on this procedure can be found at = http://wiki.jboss.org/wiki/Wiki.jsp?page=3DJBossFaces. - - - - faces-config.xml - - - - - Basic UserBean - user - org.jboss.portlet.hello.bean.User - session - - - - done - /WEB-INF/jsp/result.jsp - - -]]> - There is nothing special about the faces-= config.xml file included here. This - application would work just as well outside of a p= ortlet as it would inside a portlet container. - In the above lines, we define a basic Use= r Bean and a navigation rule to - handle the submittal of the original form on index.jsp. - - - - - +]]> + + + + These extra parameters let the application server know that the portlet e= mbeds its own libraries. This avoids collision with the Sun JSF RI librarie= s bundled with JBoss AS And JBoss EAP. For further details, refer to the Apache M= yFaces page on the JBoss Wiki. + + Building your Apache MyFaces JSF Porlet If you have downloaded the sample, you can execute the b= uild.xml with ant or inside your IDE. --===============1947981454157156793==-- From portal-commits at lists.jboss.org Mon Feb 18 01:04:58 2008 Content-Type: multipart/mixed; boundary="===============6145940216133660122==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10011 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Mon, 18 Feb 2008 01:04:53 -0500 Message-ID: --===============6145940216133660122== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-18 01:04:52 -0500 (Mon, 18 Feb 2008) New Revision: 10011 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: 5.2.4. An example Apache MyFaces JSF Portlet minor revisions, fixing my spelling errors Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-18 04:12:51 UTC (rev 10010) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-18 06:04:52 UTC (rev 10011) @@ -1466,7 +1466,7 @@ Without the faces-config.xml file, the application = would work the same outside of the portlet as it would inside a portlet con= tainer. In this example, a basic user bean, <managed-bea= n-name>user</managed-bean-name>, and a navigation= rule are defined, which handle the submission of the original form in the = HelloWorldJSFMyFaces42Portlet/WEB-INF/jsp/index.jsp fi= le. - The following is an example of the Faces Servlet section from the HelloWo= rldJSFMyFaces42Portlet/WEB-INF/web.xml file: + The following is an example of the <context-parm> section from the HelloWorldJSFMyFaces42Portlet/WE= B-INF/web.xml file: - These extra parameters let the application server know that the portlet e= mbeds its own libraries. This avoids collision with the Sun JSF RI librarie= s bundled with JBoss AS And JBoss EAP. For further details, refer to the Apache M= yFaces page on the JBoss Wiki. + These extra parameters let the application server know that the portlet e= mbeds its own libraries. This avoids collision with the Sun JSF RI librarie= s bundled with JBoss AS And JBoss EAP. For more information, refer to the <= ulink url=3D"http://wiki.jboss.org/wiki/Wiki.jsp?page=3DJBossFaces">Apache = MyFaces page on the JBoss Wiki. --===============6145940216133660122==-- From portal-commits at lists.jboss.org Mon Feb 18 03:25:42 2008 Content-Type: multipart/mixed; boundary="===============8999360715345881624==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10012 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Mon, 18 Feb 2008 03:25:42 -0500 Message-ID: --===============8999360715345881624== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-18 03:25:42 -0500 (Mon, 18 Feb 2008) New Revision: 10012 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: 5.2.4.4. Building your Apache MyFaces JSF Porlet revising and adding content to make this section consistent with 5.2.2.5. Building your JSP Portlet Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-18 06:04:52 UTC (rev 10011) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-18 08:25:42 UTC (rev 10012) @@ -1431,9 +1431,9 @@ - Adding Functionality to a Apache MyFaces JSF Porlet + Adding Functionality to an Apache MyFaces JSF Porlet - To add functionality to a Apache MyFaces JSF Porlet, sub-class it and c= reate your own class. + To add functionality to an Apache MyFaces JSF Porlet, sub-class it and = create your own class. @@ -1482,11 +1482,68 @@ Building your Apache MyFaces JSF Porlet - If you have downloaded the sample, you can execute the b= uild.xml with ant or inside your IDE. - Executing ant will compile all source fi= les and produce a - helloworldjsfportlet.war file in a way s= imilar to what we saw in - . - + + The HelloWorldJSFMyFaces42Portlet.zip file cont= ains a pre-compiled helloworldjsfmyfacesportlet.war fi= le; however, to manually build the helloworldjsfmyfacesportlet.wa= r file: + + + + + + Change into the HelloWorldJSFMyFaces42Portlet/ directory, and remove the existing helloworldjsfmyfacesportlet= .war file. + + + + + If required, edit the HelloWorldJSFMyFaces42Portlet/src= /main/org/jboss/portlet/hello/bean/User.java file, and the appli= cation descriptors in the HelloWorldJSFMyFaces42Portlet/src/resou= rces/helloworldjsfmyfacesportlet-war/WEB-INF/ directory. + + + + + Change into HelloWorldJSFMyFaces42Portlet/ d= irectory, and run the ant deploy command. On Linux, the = output will be similar to the following: + + + + + + + + + + + + + Note: the directory names will be different for your system. + + + Expanding the helloworldjsfmyfacesportlet.war f= ile allows you to deploy the portlet as an expanded directory, which makes = development easier. As well, it gives you access to the application descrip= tors, resource files, JSF, and JSP pages. To expand the helloworl= djsfmyfacesportlet.war file: + + + + + + If you do not have the HelloWorldJSFMyFaces42Portlet/he= lloworldjsfmyfacesportlet.war file, change into the He= lloWorldJSFMyFaces42Portlet/ directory, and run the ant= deploy command. This creates the helloworldjsfmyfacesp= ortlet.war file. + + + + + To expand the WAR file, change into the HelloWorldJSFMy= Faces42Portlet/ directory, and run the ant explode command. On Linux, the output will be similar to the following: + + + + + + + + + + + + + Note: the directory names will be different for your system. + + + The expanded WAR file and the application descriptors are located in= the HelloWorldJSFMyFaces42Portlet/output/lib/exploded/helloworld= jsfmyfacesportlet.war/WEB-INF/ directory. + Deploying your Apache MyFaces JSF Portlet --===============8999360715345881624==-- From portal-commits at lists.jboss.org Mon Feb 18 03:26:22 2008 Content-Type: multipart/mixed; boundary="===============7058659493011720951==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10013 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/tutorials/jsf_portlet. Date: Mon, 18 Feb 2008 03:26:22 -0500 Message-ID: --===============7058659493011720951== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-18 03:26:22 -0500 (Mon, 18 Feb 2008) New Revision: 10013 Added: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/tutorials= /jsf_portlet/myfaces_ant_deploy.png docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/tutorials= /jsf_portlet/myfaces_ant_explode.png Log: adding images for ant deploy and explode 5.2.4.4. Building your Apache MyFaces JSF Porlet Added: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/tutor= ials/jsf_portlet/myfaces_ant_deploy.png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/e= n/images/tutorials/jsf_portlet/myfaces_ant_deploy.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/tutor= ials/jsf_portlet/myfaces_ant_explode.png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/e= n/images/tutorials/jsf_portlet/myfaces_ant_explode.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream --===============7058659493011720951==-- From portal-commits at lists.jboss.org Mon Feb 18 06:21:09 2008 Content-Type: multipart/mixed; boundary="===============1936542540757329291==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10014 - in modules/portlet/trunk: controller/src/main/java/org/jboss/portal/portlet/controller and 13 other directories. Date: Mon, 18 Feb 2008 06:21:09 -0500 Message-ID: --===============1936542540757329291== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-18 06:21:08 -0500 (Mon, 18 Feb 2008) New Revision: 10014 Added: modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/= controller/ modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/= controller/EventControllerContextSupport.java modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/= controller/PortletControllerContextSupport.java modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/= controller/PortletControllerTestCase.java modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/= controller/PortletInvocationContextSupport.java modules/portlet/trunk/controller/src/test/resources/local-jboss-unit.xml modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/sup= port/ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/sup= port/PortletInvokerSupport.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/sup= port/PortletSupport.java Removed: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/state/PortletInvokerSupport.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/state/PortletSupport.java Modified: modules/portlet/trunk/controller/pom.xml modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/PortletController.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/PortletRequestHandler.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/PortletResourceRequestHandler.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/RequestHandler.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/event/Event.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/request/ContainerRequest.java modules/portlet/trunk/federation/src/test/java/org/jboss/portal/test/por= tlet/federation/FederatingPortletInvokerTestCase.java modules/portlet/trunk/federation/src/test/java/org/jboss/portal/test/por= tlet/federation/OneInvokerNoPortletsTestCase.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sta= te/consumer/ConsumerPortlet.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sta= te/consumer/ConsumerPortletInvoker.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sta= te/producer/ProducerPortlet.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sta= te/producer/ProducerPortletInvoker.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sup= port/info/EventInfoSupport.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sup= port/info/EventingInfoSupport.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/state/AbstractStatefulPortletInvokerTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/state/ConsumerStatefulPortletInvokerTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/state/ProducerStatefulPortletInvokerTestCase.java Log: started to add test case for portlet controller + refactor some stuff to be= reused in portlet controller test cases Modified: modules/portlet/trunk/controller/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/pom.xml 2008-02-18 08:26:22 UTC (rev 1= 0013) +++ modules/portlet/trunk/controller/pom.xml 2008-02-18 11:21:08 UTC (rev 1= 0014) @@ -20,6 +20,22 @@ jar = + + + + org.jboss.unit + jboss-unit-remote + test + + + + org.jboss.portal.portlet + portlet-portlet + ${project.version} + test-jar + test + + - + + = Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-beans.xml 2008-02-19 10:58:39 UTC (rev 10025) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-beans.xml 2008-02-19 11:39:23 UTC (rev 10026) @@ -91,7 +91,8 @@ - + + = --===============6098656336510097220==-- From portal-commits at lists.jboss.org Tue Feb 19 07:08:49 2008 Content-Type: multipart/mixed; boundary="===============5747218388318320173==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10027 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/container/managed and 3 other directories. Date: Tue, 19 Feb 2008 07:08:49 -0500 Message-ID: --===============5747218388318320173== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-19 07:08:48 -0500 (Tue, 19 Feb 2008) New Revision: 10027 Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/ManagedPortletApplication.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/ManagedPortletContainer.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/PortletApplicationRegistrationContext.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/PortletApplicationRegistry.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/PortletApplicationRegistryListener.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/K= ernelPortletApplication.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/K= ernelPortletContainer.java Removed: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/PortletApplicationRegistrationContext.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/PortletApplicationRegistry.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/PortletApplicationRegistryListener.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/container/PortletApplicationContextImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/container/PortletApplicationRegistryImpl.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/info/AbstractInfoTest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletApplicationDeployer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletApplicationDeployment.java Log: start to revamp the container registry to something more managed Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portl= et/container/PortletApplicationRegistrationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletApplicationRegistrationContext.java 2008-02-19 11:39:23 UTC = (rev 10026) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletApplicationRegistrationContext.java 2008-02-19 12:08:48 UTC = (rev 10027) @@ -1,47 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.container; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -public interface PortletApplicationRegistrationContext -{ - - /** - * Register a portlet. - * - * @param portletContainer the portlet container - */ - void registerPortlet(PortletContainer portletContainer); - - /** - * Unregister a portlet. - * - * @param portletContainer the portlet container - */ - void unregisterPortlet(PortletContainer portletContainer); - - -} Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portl= et/container/PortletApplicationRegistry.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletApplicationRegistry.java 2008-02-19 11:39:23 UTC (rev 10026) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletApplicationRegistry.java 2008-02-19 12:08:48 UTC (rev 10027) @@ -1,69 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.container; - -import java.util.Collection; - -/** - * @author Julien Viet - * @author Thomas Heute - * @version $Revision: 6699 $ - */ -public interface PortletApplicationRegistry -{ - /** - * Register a portlet application. - * - * @param portletApplication the portlet application to register - * @throws IllegalArgumentException if the portlet application is null = or already registered - */ - PortletApplicationRegistrationContext registerPortletApplication(Portle= tApplication portletApplication) throws IllegalArgumentException; - - /** - * Unregister a portlet application. - * - * @param portletApplication the portlet application to unregister - * @throws IllegalArgumentException if the portlet application is null = or not registered - */ - void unregisterPortletApplication(PortletApplication portletApplication= ) throws IllegalArgumentException; - - /** Return an immutable list all the known portlet application in the r= egistry. */ - Collection getPortletApplications(); - - /** Return a portlet app using its id or null if it does not exist. */ - PortletApplication getPortletApplication(String id); - - /** - * Adds a portlet container registry listener. - * - * @param listener - */ - void addListener(PortletApplicationRegistryListener listener); - - /** - * Removes a portlet container registry listener. - * - * @param listener - */ - void removeListener(PortletApplicationRegistryListener listener); -} Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portl= et/container/PortletApplicationRegistryListener.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletApplicationRegistryListener.java 2008-02-19 11:39:23 UTC (re= v 10026) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletApplicationRegistryListener.java 2008-02-19 12:08:48 UTC (re= v 10027) @@ -1,41 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.container; - -/** - * @author Thomas Heute - */ -public interface PortletApplicationRegistryListener -{ - - /** - * A portlet container has been registered. - */ - void portletContainerRegistered(PortletContainer portletContainer); - - /** - * A portlet container has been unregistered. = - */ - void portletContainerUnregistered(PortletContainer portletContainer); - -} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /container/managed/ManagedPortletApplication.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedPortletApplication.java (rev= 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedPortletApplication.java 2008-02-19 12:08:48 UTC (rev= 10027) @@ -0,0 +1,42 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container.managed; + +import java.util.Collection; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public interface ManagedPortletApplication +{ + + String getId(); + + void managedStart() throws Exception; + + void managedStop(); + + Collection getManagedPortletContaine= rs(); + +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /container/managed/ManagedPortletContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedPortletContainer.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedPortletContainer.java 2008-02-19 12:08:48 UTC (rev 1= 0027) @@ -0,0 +1,44 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container.managed; + +import org.jboss.portal.portlet.info.PortletInfo; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public interface ManagedPortletContainer +{ + + String getId(); + + PortletInfo getPortletInfo(); + + ManagedPortletApplication getManagedPortletApplication(); + + void managedStart() throws Exception; + + void managedStop(); + +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /container/managed/PortletApplicationRegistrationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/PortletApplicationRegistrationContext.java = (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/PortletApplicationRegistrationContext.java 2008-02-19 12:08= :48 UTC (rev 10027) @@ -0,0 +1,49 @@ +/*************************************************************************= ***** + * 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.portlet.container.managed; + +import org.jboss.portal.portlet.container.PortletContainer; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public interface PortletApplicationRegistrationContext +{ + + /** + * Register a portlet. + * + * @param portletContainer the portlet container + */ + void registerPortlet(PortletContainer portletContainer); + + /** + * Unregister a portlet. + * + * @param portletContainer the portlet container + */ + void unregisterPortlet(PortletContainer portletContainer); + + +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /container/managed/PortletApplicationRegistry.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/PortletApplicationRegistry.java (re= v 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/PortletApplicationRegistry.java 2008-02-19 12:08:48 UTC (re= v 10027) @@ -0,0 +1,71 @@ +/*************************************************************************= ***** + * 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.portlet.container.managed; + +import org.jboss.portal.portlet.container.PortletApplication; + +import java.util.Collection; + +/** + * @author Julien Viet + * @author Thomas Heute + * @version $Revision: 6699 $ + */ +public interface PortletApplicationRegistry +{ + /** + * Register a portlet application. + * + * @param portletApplication the portlet application to register + * @throws IllegalArgumentException if the portlet application is null = or already registered + */ + PortletApplicationRegistrationContext registerPortletApplication(Portle= tApplication portletApplication) throws IllegalArgumentException; + + /** + * Unregister a portlet application. + * + * @param portletApplication the portlet application to unregister + * @throws IllegalArgumentException if the portlet application is null = or not registered + */ + void unregisterPortletApplication(PortletApplication portletApplication= ) throws IllegalArgumentException; + + /** Return an immutable list all the known portlet application in the r= egistry. */ + Collection getPortletApplications(); + + /** Return a portlet app using its id or null if it does not exist. */ + PortletApplication getPortletApplication(String id); + + /** + * Adds a portlet container registry listener. + * + * @param listener + */ + void addListener(PortletApplicationRegistryListener listener); + + /** + * Removes a portlet container registry listener. + * + * @param listener + */ + void removeListener(PortletApplicationRegistryListener listener); +} Property changes on: modules/portlet/trunk/portlet/src/main/java/org/jboss/= portal/portlet/container/managed/PortletApplicationRegistry.java ___________________________________________________________________ Name: svn:executable + * Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /container/managed/PortletApplicationRegistryListener.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/PortletApplicationRegistryListener.java = (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/PortletApplicationRegistryListener.java 2008-02-19 12:08:48= UTC (rev 10027) @@ -0,0 +1,43 @@ +/*************************************************************************= ***** + * 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.portlet.container.managed; + +import org.jboss.portal.portlet.container.PortletContainer; + +/** + * @author Thomas Heute + */ +public interface PortletApplicationRegistryListener +{ + + /** + * A portlet container has been registered. + */ + void portletContainerRegistered(PortletContainer portletContainer); + + /** + * A portlet container has been unregistered. = + */ + void portletContainerUnregistered(PortletContainer portletContainer); + +} Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/container/PortletApplicationContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/PortletApplicationContextImpl.java 2008-02-19 11:39:23 UTC (re= v 10026) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/PortletApplicationContextImpl.java 2008-02-19 12:08:48 UTC (re= v 10027) @@ -23,8 +23,8 @@ package org.jboss.portal.portlet.impl.container; = import org.jboss.portal.portlet.container.PortletApplicationContext; -import org.jboss.portal.portlet.container.PortletApplicationRegistrationCo= ntext; -import org.jboss.portal.portlet.container.PortletApplicationRegistry; +import org.jboss.portal.portlet.container.managed.PortletApplicationRegist= rationContext; +import org.jboss.portal.portlet.container.managed.PortletApplicationRegist= ry; import org.jboss.portal.portlet.container.PortletContainer; import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl; import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory; Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/container/PortletApplicationRegistryImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/PortletApplicationRegistryImpl.java 2008-02-19 11:39:23 UTC (r= ev 10026) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/PortletApplicationRegistryImpl.java 2008-02-19 12:08:48 UTC (r= ev 10027) @@ -22,10 +22,10 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.impl.container; = -import org.jboss.portal.portlet.container.PortletApplicationRegistry; -import org.jboss.portal.portlet.container.PortletApplicationRegistrationCo= ntext; +import org.jboss.portal.portlet.container.managed.PortletApplicationRegist= ry; +import org.jboss.portal.portlet.container.managed.PortletApplicationRegist= rationContext; import org.jboss.portal.portlet.container.PortletApplication; -import org.jboss.portal.portlet.container.PortletApplicationRegistryListen= er; +import org.jboss.portal.portlet.container.managed.PortletApplicationRegist= ryListener; import org.jboss.portal.portlet.container.PortletContainer; = import java.util.ArrayList; Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/info/AbstractInfoTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/info/AbstractInfoTest.java 2008-02-19 11:39:23 UTC (rev 10026) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/info/AbstractInfoTest.java 2008-02-19 12:08:48 UTC (rev 10027) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.test.portlet.info; = -import org.jboss.portal.portlet.container.PortletApplicationRegistry; +import org.jboss.portal.portlet.container.managed.PortletApplicationRegist= ry; import org.jboss.unit.info.TestInfo; import org.jboss.unit.info.impl.SimpleTestSuiteInfo; import org.jboss.unit.remote.driver.RemoteTestDriver; Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/KernelPortletApplication.java (from rev 10026, modules/portlet/trunk/te= st/src/main/java/org/jboss/portal/portlet/test/ManagedPortletApplication.ja= va) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelPortletApplication.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelPortletApplication.java 2008-02-19 12:08:48 UTC (rev 10027) @@ -0,0 +1,136 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test; + +import org.jboss.portal.portlet.container.PortletApplicationContext; +import org.jboss.portal.portlet.container.PortletApplication; +import org.jboss.portal.portlet.container.managed.ManagedPortletApplicatio= n; +import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; +import org.jboss.portal.web.WebApp; +import org.jboss.portal.common.NotYetImplemented; + +import javax.servlet.ServletContext; +import java.util.Map; +import java.util.HashMap; +import java.util.Collection; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class KernelPortletApplication implements PortletApplicationContext= , ManagedPortletApplication +{ + + /** . */ + private final WebApp webApp; + + /** . */ + private PortletApplication portletApplication; + + /** . */ + private final Map kernelPortletContaine= rs; + + public KernelPortletApplication(WebApp webApp) + { + this.webApp =3D webApp; + this.portletApplication =3D null; + this.kernelPortletContainers =3D new HashMap(); + } + + public void addKernelPortletContainer(KernelPortletContainer kernelPort= letContainer) + { + kernelPortletContainers.put(kernelPortletContainer.getPortletContain= er().getId(), kernelPortletContainer); + } + + public void removeKernelPortletContainer(KernelPortletContainer kernelP= ortletContainer) + { + kernelPortletContainers.remove(kernelPortletContainer.getPortletCont= ainer().getId()); + } + + public PortletApplication getPortletApplication() + { + return portletApplication; + } + + public void setPortletApplication(PortletApplication portletApplication) + { + this.portletApplication =3D portletApplication; + } + + public void start() throws Exception + { + } + + public void stop() + { + } + + // PortletApplicationContext ******************************************= ********************************************** + + public ServletContext getServletContext() + { + return webApp.getServletContext(); + } + + public String getContextPath() + { + return webApp.getContextPath(); + } + + public ClassLoader getClassLoader() + { + return webApp.getClassLoader(); + } + + public void invokeStart() throws Exception + { + throw new NotYetImplemented(); + } + + public void invokeStop() + { + throw new NotYetImplemented(); + } + + // + + public String getId() + { + return portletApplication.getId(); + } + + public void managedStart() throws Exception + { + throw new NotYetImplemented(); + } + + public void managedStop() + { + throw new NotYetImplemented(); + } + + public Collection getManagedPortletC= ontainers() + { + return kernelPortletContainers.values(); + } +} Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/t= est/KernelPortletContainer.java (from rev 10026, modules/portlet/trunk/test= /src/main/java/org/jboss/portal/portlet/test/ManagedPortletContainer.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelPortletContainer.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelPortletContainer.java 2008-02-19 12:08:48 UTC (rev 10027) @@ -0,0 +1,111 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test; + +import org.jboss.portal.portlet.container.PortletContainerContext; +import org.jboss.portal.portlet.container.PortletContainer; +import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; +import org.jboss.portal.portlet.container.managed.ManagedPortletApplicatio= n; +import org.jboss.portal.portlet.info.PortletInfo; +import org.jboss.portal.common.NotYetImplemented; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class KernelPortletContainer implements PortletContainerContext, Ma= nagedPortletContainer +{ + + /** . */ + private PortletContainer portletContainer; + + /** . */ + private KernelPortletApplication kernelPortletApplication; + + public KernelPortletApplication getKernelPortletApplication() + { + return kernelPortletApplication; + } + + public void setKernelPortletApplication(KernelPortletApplication kernel= PortletApplication) + { + this.kernelPortletApplication =3D kernelPortletApplication; + } + + public PortletContainer getPortletContainer() + { + return portletContainer; + } + + public void setPortletContainer(PortletContainer portletContainer) + { + this.portletContainer =3D portletContainer; + } + + public void start() throws Exception + { + } + + public void stop() + { + } + + // + + public void invokeStart() throws Exception + { + throw new NotYetImplemented(); + } + + public void invokeStop() + { + throw new NotYetImplemented(); + } + + // + + public String getId() + { + return portletContainer.getId(); + } + + public ManagedPortletApplication getManagedPortletApplication() + { + return kernelPortletApplication; + } + + public PortletInfo getPortletInfo() + { + return portletContainer.getInfo(); + } + + public void managedStart() throws Exception + { + throw new NotYetImplemented(); + } + + public void managedStop() + { + throw new NotYetImplemented(); + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortletApplicationDeployer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployer.java 2008-02-19 11:39:23 UTC (rev 10026) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployer.java 2008-02-19 12:08:48 UTC (rev 10027) @@ -28,8 +28,8 @@ import org.jboss.kernel.spi.dependency.KernelControllerContextAware; import org.jboss.portal.common.io.IOTools; import org.jboss.portal.portlet.container.PortletApplication; -import org.jboss.portal.portlet.container.PortletApplicationRegistrationCo= ntext; -import org.jboss.portal.portlet.container.PortletApplicationRegistry; +import org.jboss.portal.portlet.container.managed.PortletApplicationRegist= rationContext; +import org.jboss.portal.portlet.container.managed.PortletApplicationRegist= ry; import org.jboss.portal.portlet.container.PortletContainer; import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConsta= nts.PORTLET_JSR_168_NS; @@ -100,8 +100,8 @@ private ClassLoader classLoader; = /** . */ - private final Map registrationContextMap =3D - new HashMap(); + private final Map registrationContextMap =3D + new HashMap(); = public PortletApplicationRegistry getRegistry() { @@ -270,35 +270,35 @@ } = /** Called by MC to install application. */ - public void addManagedPortletApplication(ManagedPortletApplication mana= gedPortletApplication) + public void addManagedPortletApplication(KernelPortletApplication kerne= lPortletApplication) { - PortletApplication portletApplication =3D managedPortletApplication.= getPortletApplication(); + PortletApplication portletApplication =3D kernelPortletApplication.g= etPortletApplication(); PortletApplicationRegistrationContext context =3D registry.registerP= ortletApplication(portletApplication); - registrationContextMap.put(managedPortletApplication, context); + registrationContextMap.put(kernelPortletApplication, context); } = /** Called by MC to install container. */ - public void addManagedPortletContainer(ManagedPortletContainer managedP= ortletContainer) + public void addManagedPortletContainer(KernelPortletContainer kernelPor= tletContainer) { - ManagedPortletApplication managedPortletApplication =3D managedPortl= etContainer.getManagedPortletApplication(); - PortletApplicationRegistrationContext context =3D registrationContex= tMap.get(managedPortletApplication); - PortletContainer portletContainer =3D managedPortletContainer.getPor= tletContainer(); + KernelPortletApplication kernelPortletApplication =3D kernelPortletC= ontainer.getKernelPortletApplication(); + PortletApplicationRegistrationContext context =3D registrationContex= tMap.get(kernelPortletApplication); + PortletContainer portletContainer =3D kernelPortletContainer.getPort= letContainer(); context.registerPortlet(portletContainer); } = /** Called by MC to uninstall application. */ - public void removeManagedPortletApplication(ManagedPortletApplication m= anagedPortletApplication) + public void removeManagedPortletApplication(KernelPortletApplication ke= rnelPortletApplication) { - PortletApplication portletApplication =3D managedPortletApplication.= getPortletApplication(); + PortletApplication portletApplication =3D kernelPortletApplication.g= etPortletApplication(); registry.unregisterPortletApplication(portletApplication); } = /** Called by MC to uninstall container. */ - public void removeManagedPortletContainer(ManagedPortletContainer manag= edPortletContainer) + public void removeManagedPortletContainer(KernelPortletContainer kernel= PortletContainer) { - ManagedPortletApplication managedPortletApplication =3D managedPortl= etContainer.getManagedPortletApplication(); - PortletApplicationRegistrationContext context =3D registrationContex= tMap.get(managedPortletApplication); - PortletContainer portletContainer =3D managedPortletContainer.getPor= tletContainer(); + KernelPortletApplication kernelPortletApplication =3D kernelPortletC= ontainer.getKernelPortletApplication(); + PortletApplicationRegistrationContext context =3D registrationContex= tMap.get(kernelPortletApplication); + PortletContainer portletContainer =3D kernelPortletContainer.getPort= letContainer(); context.unregisterPortlet(portletContainer); } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortletApplicationDeployment.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployment.java 2008-02-19 11:39:23 UTC (rev 10026) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployment.java 2008-02-19 12:08:48 UTC (rev 10027) @@ -88,9 +88,9 @@ this.installed =3D new LinkedHashMap(); } = - public AbstractBeanMetaData createManagedPortletContainerMetaData(Strin= g managedPortletContainerId) + public AbstractBeanMetaData createKernelPortletContainerMetaData(String= kernelPortletContainerId) { - AbstractBeanMetaData beanMD =3D new AbstractBeanMetaData(managedPort= letContainerId, ManagedPortletContainer.class.getName()); + AbstractBeanMetaData beanMD =3D new AbstractBeanMetaData(kernelPortl= etContainerId, KernelPortletContainer.class.getName()); = // AbstractConstructorMetaData ctorMD =3D new AbstractConstructorMetaDa= ta(); @@ -110,9 +110,9 @@ return beanMD; } = - public AbstractBeanMetaData createManagedPortletApplicationMetaData(Str= ing managedPortletApplicationId) + public AbstractBeanMetaData createKernelPortletApplicationMetaData(Stri= ng kernelPortletApplicationId) { - AbstractBeanMetaData beanMD =3D new AbstractBeanMetaData(managedPort= letApplicationId, ManagedPortletApplication.class.getName()); + AbstractBeanMetaData beanMD =3D new AbstractBeanMetaData(kernelPortl= etApplicationId, KernelPortletApplication.class.getName()); = // AbstractConstructorMetaData ctorMD =3D new AbstractConstructorMetaDa= ta(); @@ -192,7 +192,7 @@ String portletApplicationId =3D "PortletApplication[" + webApp.getCo= ntextPath() + "]"; = // - String managedPortletApplicationId =3D "ManagedPortletApplication[" = + webApp.getContextPath() + "]"; + String kernelPortletApplicationId =3D "KernelPortletApplication[" + = webApp.getContextPath() + "]"; = // ContainerInfoBuilderContext builderContext =3D new ContainerInfoBuil= derContextImpl(metaData, webApp); @@ -207,21 +207,21 @@ { // String portletContainerId =3D "PortletContainer[" + webApp.getCon= textPath() + "," + containerInfo.getName() + "]"; - String managedPortletContainerId =3D "ManagedPortletContainer[" += webApp.getContextPath() + "," + containerInfo.getName() + "]"; + String kernelPortletContainerId =3D "KernelPortletContainer[" + w= ebApp.getContextPath() + "," + containerInfo.getName() + "]"; = // AbstractBeanMetaData portletContainerMD =3D createPortletContaine= rMetaData(portletContainerId, containerInfo); - AbstractBeanMetaData managedPortletContainerMD =3D createManagedP= ortletContainerMetaData(managedPortletContainerId); + AbstractBeanMetaData kernelPortletContainerMD =3D createKernelPor= tletContainerMetaData(kernelPortletContainerId); = // - AbstractDependencyValueMetaData portletContainerContextDependency= MD =3D new AbstractDependencyValueMetaData(managedPortletContainerId); + AbstractDependencyValueMetaData portletContainerContextDependency= MD =3D new AbstractDependencyValueMetaData(kernelPortletContainerId); portletContainerContextDependencyMD.setDependentState(ControllerS= tate.INSTANTIATED); portletContainerMD.getProperties().add(new AbstractPropertyMetaDa= ta("context", portletContainerContextDependencyMD)); = // AbstractDependencyValueMetaData portletContainerDependencyMD =3D = new AbstractDependencyValueMetaData(portletContainerId); portletContainerDependencyMD.setDependentState(ControllerState.ST= ART); - managedPortletContainerMD.getProperties().add(new AbstractPropert= yMetaData("portletContainer", portletContainerDependencyMD)); + kernelPortletContainerMD.getProperties().add(new AbstractProperty= MetaData("portletContainer", portletContainerDependencyMD)); = // AbstractDependencyValueMetaData portletApplicationDependencyMD = =3D new AbstractDependencyValueMetaData(portletApplicationId); @@ -242,51 +242,51 @@ uninstallPortletContainerMD.setParameters(Collections.singletonLi= st((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData()= ))); uninstallPortletContainerMD.setMethodName("removeContainer"); uninstallPortletContainerMD.setDependentState(ControllerState.STA= RT); - managedPortletContainerMD.getUninstalls().add(uninstallPortletCon= tainerMD); + kernelPortletContainerMD.getUninstalls().add(uninstallPortletCont= ainerMD); = - // Inject the managed portlet application in the managed portlet = container - AbstractDependencyValueMetaData managedPortletApplicationDependen= cyMD =3D new AbstractDependencyValueMetaData(managedPortletApplicationId); - managedPortletApplicationDependencyMD.setDependentState(Controlle= rState.START); - managedPortletContainerMD.getProperties().add(new AbstractPropert= yMetaData("managedPortletApplication", managedPortletApplicationDependencyM= D)); + // Inject the kernel portlet application in the kernel portlet co= ntainer + AbstractDependencyValueMetaData kernelPortletApplicationDependenc= yMD =3D new AbstractDependencyValueMetaData(kernelPortletApplicationId); + kernelPortletApplicationDependencyMD.setDependentState(Controller= State.START); + kernelPortletContainerMD.getProperties().add(new AbstractProperty= MetaData("kernelPortletApplication", kernelPortletApplicationDependencyMD)); = - // Install the managed portlet container on the managed portlet a= pplication - AbstractInstallMetaData installManagedPortletContainerMD =3D new = AbstractInstallMetaData(); - installManagedPortletContainerMD.setBean(managedPortletApplicatio= nId); - installManagedPortletContainerMD.setParameters(Collections.single= tonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaD= ata()))); - installManagedPortletContainerMD.setMethodName("addManagedPortlet= Container"); - installManagedPortletContainerMD.setDependentState(ControllerStat= e.START); - managedPortletContainerMD.getInstalls().add(installManagedPortlet= ContainerMD); + // Install the kernel portlet container on the kernel portlet app= lication + AbstractInstallMetaData installKernelPortletContainerMD =3D new A= bstractInstallMetaData(); + installKernelPortletContainerMD.setBean(kernelPortletApplicationI= d); + installKernelPortletContainerMD.setParameters(Collections.singlet= onList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaDa= ta()))); + installKernelPortletContainerMD.setMethodName("addKernelPortletCo= ntainer"); + installKernelPortletContainerMD.setDependentState(ControllerState= .START); + kernelPortletContainerMD.getInstalls().add(installKernelPortletCo= ntainerMD); = - // Uninstall the managed portlet container from the managed portl= et application - AbstractInstallMetaData uninstallManagedPortletContainerMD =3D ne= w AbstractInstallMetaData(); - uninstallManagedPortletContainerMD.setBean(managedPortletApplicat= ionId); - uninstallManagedPortletContainerMD.setParameters(Collections.sing= letonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMet= aData()))); - uninstallManagedPortletContainerMD.setMethodName("removeManagedPo= rtletContainer"); - uninstallManagedPortletContainerMD.setDependentState(ControllerSt= ate.START); - managedPortletContainerMD.getUninstalls().add(uninstallManagedPor= tletContainerMD); + // Uninstall the kernel portlet container from the kernel portlet= application + AbstractInstallMetaData uninstallKernelPortletContainerMD =3D new= AbstractInstallMetaData(); + uninstallKernelPortletContainerMD.setBean(kernelPortletApplicatio= nId); + uninstallKernelPortletContainerMD.setParameters(Collections.singl= etonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMeta= Data()))); + uninstallKernelPortletContainerMD.setMethodName("removeKernelPort= letContainer"); + uninstallKernelPortletContainerMD.setDependentState(ControllerSta= te.START); + kernelPortletContainerMD.getUninstalls().add(uninstallKernelPortl= etContainerMD); = // toInstall.add(portletContainerMD); - toInstall.add(managedPortletContainerMD); + toInstall.add(kernelPortletContainerMD); } = // AbstractBeanMetaData portletApplicationMD =3D createPortletApplicati= onMetaData(builder.getApplication(), portletApplicationId); - AbstractBeanMetaData managedPortletApplicationMD =3D createManagedPo= rtletApplicationMetaData(managedPortletApplicationId); + AbstractBeanMetaData kernelPortletApplicationMD =3D createKernelPort= letApplicationMetaData(kernelPortletApplicationId); = // - AbstractDependencyValueMetaData portletApplicationContextDependencyM= D =3D new AbstractDependencyValueMetaData(managedPortletApplicationId); + AbstractDependencyValueMetaData portletApplicationContextDependencyM= D =3D new AbstractDependencyValueMetaData(kernelPortletApplicationId); portletApplicationContextDependencyMD.setDependentState(ControllerSt= ate.INSTANTIATED); portletApplicationMD.getProperties().add(new AbstractPropertyMetaDat= a("context", portletApplicationContextDependencyMD)); = // AbstractDependencyValueMetaData portletApplicationDependencyMD =3D n= ew AbstractDependencyValueMetaData(portletApplicationId); portletApplicationDependencyMD.setDependentState(ControllerState.STA= RT); - managedPortletApplicationMD.getProperties().add(new AbstractProperty= MetaData("portletApplication", portletApplicationDependencyMD)); + kernelPortletApplicationMD.getProperties().add(new AbstractPropertyM= etaData("portletApplication", portletApplicationDependencyMD)); = // toInstall.add(portletApplicationMD); - toInstall.add(managedPortletApplicationMD); + toInstall.add(kernelPortletApplicationMD); = // Install beans for (AbstractBeanMetaData beanMetaData : toInstall) --===============5747218388318320173==-- From portal-commits at lists.jboss.org Tue Feb 19 07:14:38 2008 Content-Type: multipart/mixed; boundary="===============0290719142322621702==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10028 - modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container. Date: Tue, 19 Feb 2008 07:14:38 -0500 Message-ID: --===============0290719142322621702== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-19 07:14:38 -0500 (Tue, 19 Feb 2008) New Revision: 10028 Removed: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/container/PortletApplicationContextImpl.java Log: remove very obsolete class Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portl= et/impl/container/PortletApplicationContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/PortletApplicationContextImpl.java 2008-02-19 12:08:48 UTC (re= v 10027) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/PortletApplicationContextImpl.java 2008-02-19 12:14:38 UTC (re= v 10028) @@ -1,204 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.impl.container; - -import org.jboss.portal.portlet.container.PortletApplicationContext; -import org.jboss.portal.portlet.container.managed.PortletApplicationRegist= rationContext; -import org.jboss.portal.portlet.container.managed.PortletApplicationRegist= ry; -import org.jboss.portal.portlet.container.PortletContainer; -import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl; -import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory; -import org.jboss.portal.portlet.impl.jsr168.spi.PortletInfoFactory; -import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; -import org.jboss.portal.portlet.metadata.JBossApplicationMetaData; -import org.jboss.portal.common.FixMe; - -import javax.servlet.ServletContext; - -/** - * @author Julien Viet - * @version $Revision: 6697 $ - */ -public class PortletApplicationContextImpl implements PortletApplicationCo= ntext -{ - - /** . */ - private final PortletAPIFactory portletAPIFactory; - - /** . */ - private final PortletApplication10MetaData portletAppMD; - - /** . */ - private final JBossApplicationMetaData jbossAppMD; - - /** . */ - private final ServletContext servletContext; - - /** . */ - private final ClassLoader classLoader; - - /** . */ - private PortletApplicationImpl portletApp; - - /** . */ - private PortletApplicationRegistry registry; - - /** . */ - private PortletApplicationRegistrationContext registrationContext; - = - /** . */ - private String contextPath; - - public PortletApplicationContextImpl( - PortletApplicationRegistry registry, - PortletAPIFactory portletAPIFactory, - PortletInfoFactory portletInfoFactory, - PortletApplication10MetaData portletAppMD, - JBossApplicationMetaData jbossAppMD, - ServletContext servletContext, - ClassLoader classLoader, - String contextPath) - { - this.registry =3D registry; - this.portletAPIFactory =3D portletAPIFactory; - this.portletAppMD =3D portletAppMD; - this.jbossAppMD =3D jbossAppMD; - this.servletContext =3D servletContext; - this.classLoader =3D classLoader; - this.contextPath =3D contextPath; - } - - public PortletApplicationImpl getPortletApplication() - { - return portletApp; - } - - // PortletApplicationContext implementation ***************************= ********************************************** - - public void invokeStart() throws Exception - { - throw new FixMe("Not used anymore for now, check or reimplement in 2= .6"); -/* - portletApp =3D new PortletApplicationImpl(portletAppMD, jbossAppMD, = this, portletAPIFactory); - portletApp.start(); - - // - registrationContext =3D registry.registerPortletApplication(portletA= pp); - - // Fixme here need the web App - ContainerInfoBuilderContext builderContext =3D new ContainerInfoBuil= derContextImpl(portletAppMD, null); - ContainerInfoBuilder builder =3D new ContainerInfoBuilder(portletApp= MD, builderContext); - builder.build(); - - // - for (ContainerPortletInfo containerInfo : builder.getPortlets()) - { -// JBossPortletMetaData jBossPortletMD =3D null; -// if (jbossAppMD !=3D null) -// { -// jBossPortletMD =3D (JBossPortletMetaData)jbossAppMD.getPortl= ets().get(portletMD.getName()); -// } - - - // - PortletContainerImpl container =3D new PortletContainerImpl(conta= inerInfo); - - // - container.setApplication(portletApp); - portletApp.addContainer(container); - - // - try - { - container.start(); - registrationContext.registerPortlet(container); - } - catch (Exception e) - { - e.printStackTrace(); - } - } -*/ - } - - public void invokeStop() - { - // if the portlet application wasn't properly started, we shouldn't = be trying to stop it - if (portletApp !=3D null) - { - for (PortletContainer container : portletApp.getPortletContainers= ()) - { - try - { - registrationContext.unregisterPortlet(container); - container.stop(); - } - catch (Exception e) - { - e.printStackTrace(); - } - - // - portletApp.removeContainer(container); - container.setApplication(null); - } - - // - registry.unregisterPortletApplication(portletApp); - portletApp.stop(); - - // - portletApp =3D null; - registrationContext =3D null; - } - } - - public void startPortletContainer(String portletName) throws Exception - { - PortletContainer container =3D portletApp.getPortletContainer(portle= tName); - container.start(); - registrationContext.registerPortlet(container); - } - - public void stopPortletContainer(String portletName) - { - PortletContainer container =3D portletApp.getPortletContainer(portle= tName); - registrationContext.unregisterPortlet(container); - container.stop(); - } - - public ServletContext getServletContext() - { - return servletContext; - } - - public String getContextPath() - { - return contextPath; - } - = - public ClassLoader getClassLoader() - { - return classLoader; - } -} --===============0290719142322621702==-- From portal-commits at lists.jboss.org Tue Feb 19 08:23:47 2008 Content-Type: multipart/mixed; boundary="===============5885457738525842751==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10029 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/container and 4 other directories. Date: Tue, 19 Feb 2008 08:23:47 -0500 Message-ID: --===============5885457738525842751== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-19 08:23:47 -0500 (Tue, 19 Feb 2008) New Revision: 10029 Removed: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/PortletApplicationRegistrationContext.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/PortletApplicationRegistryListener.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/container/PortletApplicationRegistryImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/M= anagedPortletApplication.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/M= anagedPortletContainer.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/ManagedPortletApplication.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/ManagedPortletContainer.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/PortletApplicationRegistry.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/info/CacheInfoTest.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/info/CapabilitiesInfoTest.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/info/MetaInfoTest.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/info/ModeInfoTest.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/info/PortletInfoTest.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/info/PreferenceInfoTest.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/info/SecurityInfoTest.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/info/SessionInfoTest.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/K= ernelPortletApplication.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/K= ernelPortletContainer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletApplicationDeployer.java modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/j= boss-beans.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= jboss-beans.xml Log: consolidate the portlet application registry with the managed objects Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/managed/ManagedPortletApplication.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedPortletApplication.java 2008-02-19 12:14:38 UTC (rev= 10028) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedPortletApplication.java 2008-02-19 13:23:47 UTC (rev= 10029) @@ -39,4 +39,6 @@ = Collection getManagedPortletContaine= rs(); = + ManagedPortletContainer getManagedPortletContainer(String portletContai= nerId); + } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/managed/ManagedPortletContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedPortletContainer.java 2008-02-19 12:14:38 UTC (rev 1= 0028) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedPortletContainer.java 2008-02-19 13:23:47 UTC (rev 1= 0029) @@ -33,7 +33,7 @@ = String getId(); = - PortletInfo getPortletInfo(); + PortletInfo getInfo(); = ManagedPortletApplication getManagedPortletApplication(); = Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portl= et/container/managed/PortletApplicationRegistrationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/PortletApplicationRegistrationContext.java 2008-02-19 12:14= :38 UTC (rev 10028) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/PortletApplicationRegistrationContext.java 2008-02-19 13:23= :47 UTC (rev 10029) @@ -1,49 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.container.managed; - -import org.jboss.portal.portlet.container.PortletContainer; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -public interface PortletApplicationRegistrationContext -{ - - /** - * Register a portlet. - * - * @param portletContainer the portlet container - */ - void registerPortlet(PortletContainer portletContainer); - - /** - * Unregister a portlet. - * - * @param portletContainer the portlet container - */ - void unregisterPortlet(PortletContainer portletContainer); - - -} Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/managed/PortletApplicationRegistry.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/PortletApplicationRegistry.java 2008-02-19 12:14:38 UTC (re= v 10028) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/PortletApplicationRegistry.java 2008-02-19 13:23:47 UTC (re= v 10029) @@ -22,8 +22,6 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.container.managed; = -import org.jboss.portal.portlet.container.PortletApplication; - import java.util.Collection; = /** @@ -33,39 +31,20 @@ */ public interface PortletApplicationRegistry { - /** - * Register a portlet application. - * - * @param portletApplication the portlet application to register - * @throws IllegalArgumentException if the portlet application is null = or already registered - */ - PortletApplicationRegistrationContext registerPortletApplication(Portle= tApplication portletApplication) throws IllegalArgumentException; = /** - * Unregister a portlet application. + * Return an immutable list all the known portlet application in the re= gistry. * - * @param portletApplication the portlet application to unregister - * @throws IllegalArgumentException if the portlet application is null = or not registered + * @return the registered portlet applications */ - void unregisterPortletApplication(PortletApplication portletApplication= ) throws IllegalArgumentException; + Collection getManagedPortletApplic= ations(); = - /** Return an immutable list all the known portlet application in the r= egistry. */ - Collection getPortletApplications(); - - /** Return a portlet app using its id or null if it does not exist. */ - PortletApplication getPortletApplication(String id); - /** - * Adds a portlet container registry listener. + * Return a portlet app using its id or null if it does not exist. * - * @param listener + * @param id the portlet application id = + * @return a specified registered portlet application */ - void addListener(PortletApplicationRegistryListener listener); + ManagedPortletApplication getManagedPortletApplication(String id); = - /** - * Removes a portlet container registry listener. - * - * @param listener - */ - void removeListener(PortletApplicationRegistryListener listener); } Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portl= et/container/managed/PortletApplicationRegistryListener.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/PortletApplicationRegistryListener.java 2008-02-19 12:14:38= UTC (rev 10028) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/PortletApplicationRegistryListener.java 2008-02-19 13:23:47= UTC (rev 10029) @@ -1,43 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.container.managed; - -import org.jboss.portal.portlet.container.PortletContainer; - -/** - * @author Thomas Heute - */ -public interface PortletApplicationRegistryListener -{ - - /** - * A portlet container has been registered. - */ - void portletContainerRegistered(PortletContainer portletContainer); - - /** - * A portlet container has been unregistered. = - */ - void portletContainerUnregistered(PortletContainer portletContainer); - -} Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portl= et/impl/container/PortletApplicationRegistryImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/PortletApplicationRegistryImpl.java 2008-02-19 12:14:38 UTC (r= ev 10028) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/PortletApplicationRegistryImpl.java 2008-02-19 13:23:47 UTC (r= ev 10029) @@ -1,249 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.impl.container; - -import org.jboss.portal.portlet.container.managed.PortletApplicationRegist= ry; -import org.jboss.portal.portlet.container.managed.PortletApplicationRegist= rationContext; -import org.jboss.portal.portlet.container.PortletApplication; -import org.jboss.portal.portlet.container.managed.PortletApplicationRegist= ryListener; -import org.jboss.portal.portlet.container.PortletContainer; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @author Julien Viet - * @author Thomas Heute - * @version $Revision: 6720 $ - */ -public class PortletApplicationRegistryImpl implements PortletApplicationR= egistry -{ - - /** . */ - private Map portletApplications =3D new Has= hMap(); - - /** . */ - private Map portletContainers =3D new H= ashMap(); - = - /** . */ - private List listeners =3D new Arra= yList(); - - public PortletApplicationRegistrationContext registerPortletApplication= (PortletApplication portletApplication) - { - if (portletApplication =3D=3D null) - { - throw new IllegalArgumentException("No null portlet app accepted"= ); - } - synchronized (this) - { - String key =3D portletApplication.getId(); - if (portletApplications.containsKey(key)) - { - throw new IllegalArgumentException("This portlet app is alread= y registered: " + key); - } - PortletApplicationRegistrationContext ctx =3D new PortletApplicat= ionRegistrationContextImpl(portletApplication); - Map webAppsCopy =3D new HashMap(portletApplications); - webAppsCopy.put(key, portletApplication); - portletApplications =3D webAppsCopy; - return ctx; - } - } - - public void unregisterPortletApplication(PortletApplication portletAppl= ication) - { - if (portletApplication =3D=3D null) - { - throw new IllegalArgumentException("No null portlet app accepted"= ); - } - synchronized (this) - { - String key =3D portletApplication.getId(); - if (!portletApplications.containsKey(key)) - { - throw new IllegalArgumentException("This portlet app does not = exist here: " + key); - } - Map webAppsCopy =3D new HashMap(portletApplications); - webAppsCopy.remove(key); - portletApplications =3D webAppsCopy; - } - } - - public Collection getPortletApplications() - { - return Collections.unmodifiableCollection(portletApplications.values= ()); - } - - public PortletApplication getPortletApplication(String id) - { - return portletApplications.get(id); - } - - public void addListener(PortletApplicationRegistryListener listener) - { - if (listener =3D=3D null) - { - throw new IllegalArgumentException("No null listener accepted"); - } - else - { - synchronized (this) - { - listeners.add(listener); - } - } - } - - public void removeListener(PortletApplicationRegistryListener listener) - { - if (listener =3D=3D null) - { - throw new IllegalArgumentException("No null listener accepted"); - } - else - { - synchronized (this) - { - listeners.remove(listener); - } - } - } - - private void fireRegisterPortletContainerEvent(PortletContainer portlet) - { - for (PortletApplicationRegistryListener listener : listeners) - { - listener.portletContainerRegistered(portlet); - } - } - - private void fireUnregisterPortletContainerEvent(PortletContainer portl= et) - { - for (PortletApplicationRegistryListener listener : listeners) - { - listener.portletContainerUnregistered(portlet); - } - } - - private static class ContainerKey - { - /** . */ - private final String applicationId; - - /** . */ - private final String containerId; - - public ContainerKey(PortletContainer container) - { - this.applicationId =3D container.getApplication().getId(); - this.containerId =3D container.getId(); - } - - public boolean equals(Object obj) - { - if (obj =3D=3D this) - { - return true; - } - if (obj instanceof ContainerKey) - { - ContainerKey that =3D (ContainerKey)obj; - return applicationId.equals(that.applicationId) && containerId= .equals(containerId); - } - return false; - } - - public int hashCode() - { - return applicationId.hashCode() & containerId.hashCode(); - } - } - - private class PortletApplicationRegistrationContextImpl implements Port= letApplicationRegistrationContext - { - - /** . */ - private PortletApplication portletApplication; - - /** . */ - private boolean active; - - public PortletApplicationRegistrationContextImpl(PortletApplication = portletApplication) - { - this.portletApplication =3D portletApplication; - this.active =3D true; - } - - public void registerPortlet(PortletContainer portletContainer) - { - if (portletContainer =3D=3D null) - { - throw new IllegalArgumentException("No null portlet accepted"); - } - if (portletContainer.getApplication() !=3D portletApplication) - { - throw new IllegalArgumentException("The container does not bel= ong to the application owning the registration"); - } - if (!active) - { - throw new IllegalStateException("Not anymore active"); - } - synchronized (this) - { - Map componentsCopy =3D new Has= hMap(portletContainers); - componentsCopy.put(new ContainerKey(portletContainer), portlet= Container); - portletContainers =3D componentsCopy; - - // - fireRegisterPortletContainerEvent(portletContainer); - } - } - - public void unregisterPortlet(PortletContainer portletContainer) - { - if (portletContainer =3D=3D null) - { - throw new IllegalArgumentException("No null portlet accepted"); - } - if (portletContainer.getApplication() !=3D portletApplication) - { - throw new IllegalArgumentException("The container does not bel= ong to the application owning the registration"); - } - if (!active) - { - throw new IllegalStateException("Not anymore active"); - } - synchronized (this) - { - Map componentsCopy =3D new Has= hMap(portletContainers); - ContainerKey key =3D new ContainerKey(portletContainer); - componentsCopy.remove(key); - portletContainers =3D componentsCopy; - fireUnregisterPortletContainerEvent(portletContainer); - } - } - } -} Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/info/CacheInfoTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/info/CacheInfoTest.java 2008-02-19 12:14:38 UTC (rev 10028) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/info/CacheInfoTest.java 2008-02-19 13:23:47 UTC (rev 10029) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.test.portlet.info; = -import org.jboss.portal.portlet.container.PortletContainer; +import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; import org.jboss.portal.portlet.info.CacheInfo; import org.jboss.portal.portlet.info.PortletInfo; = @@ -42,7 +42,7 @@ = public void execute() { - PortletContainer container =3D registry.getPortletApplication("/test= -info").getPortletContainer("CachePortlet"); + ManagedPortletContainer container =3D registry.getManagedPortletAppl= ication("/test-info").getManagedPortletContainer("CachePortlet"); PortletInfo info =3D container.getInfo(); CacheInfo cacheInfo =3D info.getCache(); assertEquals(65, cacheInfo.getExpirationSecs()); Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/info/CapabilitiesInfoTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/info/CapabilitiesInfoTest.java 2008-02-19 12:14:38 UTC (rev 10028) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/info/CapabilitiesInfoTest.java 2008-02-19 13:23:47 UTC (rev 10029) @@ -25,7 +25,7 @@ = import org.jboss.portal.Mode; import org.jboss.portal.WindowState; -import org.jboss.portal.portlet.container.PortletContainer; +import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; import org.jboss.portal.portlet.info.CapabilitiesInfo; import org.jboss.portal.portlet.info.ModeInfo; import org.jboss.portal.portlet.info.PortletInfo; @@ -52,7 +52,7 @@ = public void execute() { - PortletContainer container =3D registry.getPortletApplication("/test= -info").getPortletContainer("CapabilitiesPortlet"); + ManagedPortletContainer container =3D registry.getManagedPortletAppl= ication("/test-info").getManagedPortletContainer("CapabilitiesPortlet"); PortletInfo info =3D container.getInfo(); CapabilitiesInfo capInfo =3D info.getCapabilities(); = Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/info/MetaInfoTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/info/MetaInfoTest.java 2008-02-19 12:14:38 UTC (rev 10028) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/info/MetaInfoTest.java 2008-02-19 13:23:47 UTC (rev 10029) @@ -23,7 +23,7 @@ package org.jboss.portal.test.portlet.info; = import org.jboss.portal.common.i18n.LocalizedString; -import org.jboss.portal.portlet.container.PortletContainer; +import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; import org.jboss.portal.portlet.info.MetaInfo; import org.jboss.portal.portlet.info.PortletInfo; = @@ -45,7 +45,7 @@ = public void execute() { - PortletContainer container =3D registry.getPortletApplication("/test= -info").getPortletContainer("NoBundlePortlet"); + ManagedPortletContainer container =3D registry.getManagedPortletAppl= ication("/test-info").getManagedPortletContainer("NoBundlePortlet"); PortletInfo info =3D container.getInfo(); MetaInfo metaInfo =3D info.getMeta(); = Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/info/ModeInfoTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/info/ModeInfoTest.java 2008-02-19 12:14:38 UTC (rev 10028) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/info/ModeInfoTest.java 2008-02-19 13:23:47 UTC (rev 10029) @@ -23,7 +23,7 @@ package org.jboss.portal.test.portlet.info; = import org.jboss.portal.Mode; -import org.jboss.portal.portlet.container.PortletContainer; +import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; import org.jboss.portal.portlet.info.CapabilitiesInfo; import org.jboss.portal.portlet.info.ModeInfo; = @@ -47,8 +47,8 @@ = public void execute() { - PortletContainer container1 =3D registry.getPortletApplication("/tes= t-info").getPortletContainer("ModePortlet1"); - PortletContainer container2 =3D registry.getPortletApplication("/tes= t-info").getPortletContainer("ModePortlet2"); + ManagedPortletContainer container1 =3D registry.getManagedPortletApp= lication("/test-info").getManagedPortletContainer("ModePortlet1"); + ManagedPortletContainer container2 =3D registry.getManagedPortletApp= lication("/test-info").getManagedPortletContainer("ModePortlet2"); CapabilitiesInfo capaInfo =3D container1.getInfo().getCapabilities(); = //Portlet 1 with VIEW, EDIT, HELP Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/info/PortletInfoTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/info/PortletInfoTest.java 2008-02-19 12:14:38 UTC (rev 10028) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/info/PortletInfoTest.java 2008-02-19 13:23:47 UTC (rev 10029) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.test.portlet.info; = -import org.jboss.portal.portlet.container.PortletContainer; +import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; import org.jboss.portal.portlet.info.PortletInfo; = import static org.jboss.unit.api.Assert.*; @@ -42,7 +42,7 @@ public void execute() { //This asserts only .isRemotable() as rest is checked in other tests - PortletContainer container =3D registry.getPortletApplication("/test= -info").getPortletContainer("RemotablePortlet1"); + ManagedPortletContainer container =3D registry.getManagedPortletAppl= ication("/test-info").getManagedPortletContainer("RemotablePortlet1"); PortletInfo info =3D container.getInfo(); assertEquals(Boolean.TRUE, info.isRemotable()); = @@ -54,11 +54,11 @@ assertNotNull(info.getSecurity()); assertNotNull(info.getSession()); = - container =3D registry.getPortletApplication("/test-info").getPortle= tContainer("RemotablePortlet2"); + container =3D registry.getManagedPortletApplication("/test-info").ge= tManagedPortletContainer("RemotablePortlet2"); info =3D container.getInfo(); assertEquals(Boolean.FALSE, info.isRemotable()); = - container =3D registry.getPortletApplication("/test-info").getPortle= tContainer("RemotablePortlet3"); + container =3D registry.getManagedPortletApplication("/test-info").ge= tManagedPortletContainer("RemotablePortlet3"); info =3D container.getInfo(); assertEquals(Boolean.TRUE, info.isRemotable()); } Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/info/PreferenceInfoTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/info/PreferenceInfoTest.java 2008-02-19 12:14:38 UTC (rev 10028) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/info/PreferenceInfoTest.java 2008-02-19 13:23:47 UTC (rev 10029) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.test.portlet.info; = -import org.jboss.portal.portlet.container.PortletContainer; +import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; import org.jboss.portal.portlet.impl.info.ContainerPreferenceInfo; import org.jboss.portal.portlet.impl.info.ContainerPreferencesInfo; import org.jboss.portal.portlet.info.PortletInfo; @@ -46,7 +46,7 @@ = public void execute() { - PortletContainer container =3D registry.getPortletApplication("/test= -info").getPortletContainer("PreferenceInfoPortlet"); + ManagedPortletContainer container =3D registry.getManagedPortletAppl= ication("/test-info").getManagedPortletContainer("PreferenceInfoPortlet"); = // PortletInfo info =3D container.getInfo(); Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/info/SecurityInfoTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/info/SecurityInfoTest.java 2008-02-19 12:14:38 UTC (rev 10028) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/info/SecurityInfoTest.java 2008-02-19 13:23:47 UTC (rev 10029) @@ -23,7 +23,7 @@ package org.jboss.portal.test.portlet.info; = import org.jboss.portal.portlet.TransportGuarantee; -import org.jboss.portal.portlet.container.PortletContainer; +import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.info.SecurityInfo; = @@ -45,7 +45,7 @@ { //This asserts only .isRemotable() as rest is checked in other tests = - PortletContainer container =3D registry.getPortletApplication("/test= -info").getPortletContainer("SecuredPortlet1"); + ManagedPortletContainer container =3D registry.getManagedPortletAppl= ication("/test-info").getManagedPortletContainer("SecuredPortlet1"); PortletInfo info =3D container.getInfo(); SecurityInfo secInfo =3D info.getSecurity(); = @@ -56,7 +56,7 @@ assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.NON= E)); = = - container =3D registry.getPortletApplication("/test-info").getPortle= tContainer("SecuredPortlet2"); + container =3D registry.getManagedPortletApplication("/test-info").ge= tManagedPortletContainer("SecuredPortlet2"); info =3D container.getInfo(); = secInfo =3D info.getSecurity(); @@ -66,7 +66,7 @@ assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.NON= E)); = = - container =3D registry.getPortletApplication("/test-info").getPortle= tContainer("SecuredPortlet3"); + container =3D registry.getManagedPortletApplication("/test-info").ge= tManagedPortletContainer("SecuredPortlet3"); info =3D container.getInfo(); secInfo =3D info.getSecurity(); assertEquals(2, secInfo.getTransportGuarantees().size()); Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/info/SessionInfoTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/info/SessionInfoTest.java 2008-02-19 12:14:38 UTC (rev 10028) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/info/SessionInfoTest.java 2008-02-19 13:23:47 UTC (rev 10029) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.test.portlet.info; = -import org.jboss.portal.portlet.container.PortletContainer; +import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.info.SessionInfo; = @@ -42,7 +42,7 @@ = public void execute() { - PortletContainer container =3D registry.getPortletApplication("/test= -info").getPortletContainer("DistributedPortlet1"); + ManagedPortletContainer container =3D registry.getManagedPortletAppl= ication("/test-info").getManagedPortletContainer("DistributedPortlet1"); PortletInfo info =3D container.getInfo(); SessionInfo sessionInfo =3D info.getSession(); assertNotNull(sessionInfo); @@ -50,7 +50,7 @@ assertEquals(Boolean.TRUE, distributed); = = - container =3D registry.getPortletApplication("/test-info").getPortle= tContainer("DistributedPortlet2"); + container =3D registry.getManagedPortletApplication("/test-info").ge= tManagedPortletContainer("DistributedPortlet2"); info =3D container.getInfo(); sessionInfo =3D info.getSession(); assertNotNull(sessionInfo); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/KernelPortletApplication.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelPortletApplication.java 2008-02-19 12:14:38 UTC (rev 10028) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelPortletApplication.java 2008-02-19 13:23:47 UTC (rev 10029) @@ -133,4 +133,9 @@ { return kernelPortletContainers.values(); } + + public ManagedPortletContainer getManagedPortletContainer(String portle= tContainerId) + { + return kernelPortletContainers.get(portletContainerId); + } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/KernelPortletContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelPortletContainer.java 2008-02-19 12:14:38 UTC (rev 10028) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelPortletContainer.java 2008-02-19 13:23:47 UTC (rev 10029) @@ -94,7 +94,7 @@ return kernelPortletApplication; } = - public PortletInfo getPortletInfo() + public PortletInfo getInfo() { return portletContainer.getInfo(); } Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/ManagedPortletApplication.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= ManagedPortletApplication.java 2008-02-19 12:14:38 UTC (rev 10028) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= ManagedPortletApplication.java 2008-02-19 13:23:47 UTC (rev 10029) @@ -1,111 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test; - -import org.jboss.portal.portlet.container.PortletApplicationContext; -import org.jboss.portal.portlet.container.PortletApplication; -import org.jboss.portal.web.WebApp; -import org.jboss.portal.common.NotYetImplemented; - -import javax.servlet.ServletContext; -import java.util.Map; -import java.util.HashMap; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class ManagedPortletApplication implements PortletApplicationContext -{ - - /** . */ - private final WebApp webApp; - - /** . */ - private PortletApplication portletApplication; - - /** . */ - private final Map managedPortletContai= ners; - - public ManagedPortletApplication(WebApp webApp) - { - this.webApp =3D webApp; - this.portletApplication =3D null; - this.managedPortletContainers =3D new HashMap(); - } - - public void addManagedPortletContainer(ManagedPortletContainer managedP= ortletContainer) - { - managedPortletContainers.put(managedPortletContainer.getPortletConta= iner().getId(), managedPortletContainer); - } - - public void removeManagedPortletContainer(ManagedPortletContainer manag= edPortletContainer) - { - managedPortletContainers.remove(managedPortletContainer.getPortletCo= ntainer().getId()); - } - - public PortletApplication getPortletApplication() - { - return portletApplication; - } - - public void setPortletApplication(PortletApplication portletApplication) - { - this.portletApplication =3D portletApplication; - } - - public void start() throws Exception - { - } - - public void stop() - { - } - - // PortletApplicationContext ******************************************= ********************************************** - - public ServletContext getServletContext() - { - return webApp.getServletContext(); - } - - public String getContextPath() - { - return webApp.getContextPath(); - } - - public ClassLoader getClassLoader() - { - return webApp.getClassLoader(); - } - - public void invokeStart() throws Exception - { - throw new NotYetImplemented(); - } - - public void invokeStop() - { - throw new NotYetImplemented(); - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/ManagedPortletContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= ManagedPortletContainer.java 2008-02-19 12:14:38 UTC (rev 10028) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= ManagedPortletContainer.java 2008-02-19 13:23:47 UTC (rev 10029) @@ -1,81 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test; - -import org.jboss.portal.portlet.container.PortletContainerContext; -import org.jboss.portal.portlet.container.PortletContainer; -import org.jboss.portal.common.NotYetImplemented; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class ManagedPortletContainer implements PortletContainerContext -{ - - /** . */ - private PortletContainer portletContainer; - - /** . */ - private ManagedPortletApplication managedPortletApplication; - - public ManagedPortletApplication getManagedPortletApplication() - { - return managedPortletApplication; - } - - public void setManagedPortletApplication(ManagedPortletApplication mana= gedPortletApplication) - { - this.managedPortletApplication =3D managedPortletApplication; - } - - public PortletContainer getPortletContainer() - { - return portletContainer; - } - - public void setPortletContainer(PortletContainer portletContainer) - { - this.portletContainer =3D portletContainer; - } - - public void start() throws Exception - { - } - - public void stop() - { - } - - // - - public void invokeStart() throws Exception - { - throw new NotYetImplemented(); - } - - public void invokeStop() - { - throw new NotYetImplemented(); - } -} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortletApplicationDeployer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployer.java 2008-02-19 12:14:38 UTC (rev 10028) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployer.java 2008-02-19 13:23:47 UTC (rev 10029) @@ -27,10 +27,8 @@ import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.dependency.KernelControllerContextAware; import org.jboss.portal.common.io.IOTools; -import org.jboss.portal.portlet.container.PortletApplication; -import org.jboss.portal.portlet.container.managed.PortletApplicationRegist= rationContext; import org.jboss.portal.portlet.container.managed.PortletApplicationRegist= ry; -import org.jboss.portal.portlet.container.PortletContainer; +import org.jboss.portal.portlet.container.managed.ManagedPortletApplicatio= n; import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConsta= nts.PORTLET_JSR_168_NS; import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConsta= nts.PORTLET_JSR_286_NS; @@ -54,12 +52,13 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; +import java.util.Collection; = /** * @author Julien Viet * @version $Revision: 1.1 $ */ -public class PortletApplicationDeployer implements WebAppListener, KernelC= ontrollerContextAware +public class PortletApplicationDeployer implements WebAppListener, KernelC= ontrollerContextAware, PortletApplicationRegistry { = static @@ -100,8 +99,7 @@ private ClassLoader classLoader; = /** . */ - private final Map registrationContextMap =3D - new HashMap(); + private final Map applications =3D ne= w HashMap(); = public PortletApplicationRegistry getRegistry() { @@ -269,36 +267,53 @@ return null; } = - /** Called by MC to install application. */ - public void addManagedPortletApplication(KernelPortletApplication kerne= lPortletApplication) + /** + * Called by MC to install application. + * + * @param kernelPortletApplication kernel portlet application + */ + public void addKernelPortletApplication(KernelPortletApplication kernel= PortletApplication) { - PortletApplication portletApplication =3D kernelPortletApplication.g= etPortletApplication(); - PortletApplicationRegistrationContext context =3D registry.registerP= ortletApplication(portletApplication); - registrationContextMap.put(kernelPortletApplication, context); + applications.put(kernelPortletApplication.getId(), kernelPortletAppl= ication); } = - /** Called by MC to install container. */ - public void addManagedPortletContainer(KernelPortletContainer kernelPor= tletContainer) + /** + * Called by MC to uninstall application. + * + * @param kernelPortletApplication kernel portlet application + */ + public void removeKernelPortletApplication(KernelPortletApplication ker= nelPortletApplication) { - KernelPortletApplication kernelPortletApplication =3D kernelPortletC= ontainer.getKernelPortletApplication(); - PortletApplicationRegistrationContext context =3D registrationContex= tMap.get(kernelPortletApplication); - PortletContainer portletContainer =3D kernelPortletContainer.getPort= letContainer(); - context.registerPortlet(portletContainer); + applications.remove(kernelPortletApplication.getId()); } = - /** Called by MC to uninstall application. */ - public void removeManagedPortletApplication(KernelPortletApplication ke= rnelPortletApplication) + /** + * Called by MC to install application. + * + * @param kernelPortletContainer kernel portlet container + */ + public void addKernelPortletContainer(KernelPortletContainer kernelPort= letContainer) { - PortletApplication portletApplication =3D kernelPortletApplication.g= etPortletApplication(); - registry.unregisterPortletApplication(portletApplication); + // To be used for life cycle events } = - /** Called by MC to uninstall container. */ - public void removeManagedPortletContainer(KernelPortletContainer kernel= PortletContainer) + /** + * Called by MC to uninstall application. + * + * @param kernelPortletContainer kernel portlet container + */ + public void removeKernelPortletContainer(KernelPortletContainer kernelP= ortletContainer) { - KernelPortletApplication kernelPortletApplication =3D kernelPortletC= ontainer.getKernelPortletApplication(); - PortletApplicationRegistrationContext context =3D registrationContex= tMap.get(kernelPortletApplication); - PortletContainer portletContainer =3D kernelPortletContainer.getPort= letContainer(); - context.unregisterPortlet(portletContainer); + // To be used for life cycle events } + + public Collection getManagedPortle= tApplications() + { + return applications.values(); + } + + public ManagedPortletApplication getManagedPortletApplication(String id) + { + return applications.get(id); + } } Modified: modules/portlet/trunk/test/src/test/resources/portlet-test-war/WE= B-INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/= jboss-beans.xml 2008-02-19 12:14:38 UTC (rev 10028) +++ modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/= jboss-beans.xml 2008-02-19 13:23:47 UTC (rev 10029) @@ -34,18 +34,13 @@ = - - - - - - - - + + + + = Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-beans.xml 2008-02-19 12:14:38 UTC (rev 10028) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-beans.xml 2008-02-19 13:23:47 UTC (rev 10029) @@ -23,17 +23,12 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~--> = - - - - - - - - + + + + = --===============5885457738525842751==-- From portal-commits at lists.jboss.org Tue Feb 19 09:07:51 2008 Content-Type: multipart/mixed; boundary="===============4707639697514135940==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10030 - in modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet: container and 2 other directories. Date: Tue, 19 Feb 2008 09:07:51 -0500 Message-ID: --===============4707639697514135940== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-19 09:07:50 -0500 (Tue, 19 Feb 2008) New Revision: 10030 Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/object/ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/object/PortletApplicationObject.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/object/PortletContainerObject.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/asp= ects/portlet/ValveInterceptor.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/PortletApplication.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/PortletContainer.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/PortletContainerInvoker.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletApplicationImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletContainerImpl.java Log: - move wiring / service concerns of application/containers to dedicated int= erfaces Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/aspects/portlet/ValveInterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/as= pects/portlet/ValveInterceptor.java 2008-02-19 13:23:47 UTC (rev 10029) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/as= pects/portlet/ValveInterceptor.java 2008-02-19 14:07:50 UTC (rev 10030) @@ -22,12 +22,10 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.aspects.portlet; = -import org.jboss.portal.common.concurrent.Valve; import org.jboss.portal.common.invocation.InvocationException; -import org.jboss.portal.portlet.container.PortletApplication; -import org.jboss.portal.portlet.container.PortletApplicationContext; import org.jboss.portal.portlet.container.PortletContainer; import org.jboss.portal.portlet.container.PortletContainerInvoker; +import org.jboss.portal.portlet.container.PortletContainerContext; import org.jboss.portal.portlet.invocation.PortletInterceptor; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; @@ -45,47 +43,27 @@ */ public class ValveInterceptor extends PortletInterceptor { + protected Object invoke(PortletInvocation invocation) throws Exception,= InvocationException { -/* - PortletContainer container =3D (PortletContainer)invocation.getAttri= bute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CO= NTAINER); - Valve valve =3D container.getValve(); + PortletInvocationResponse response =3D (PortletInvocationResponse)in= vocation.invokeNext(); = - // Try to aquire the valve - if (valve.beforeInvocation()) + // Stop the container if necessary + if (response instanceof UnavailableResponse) { - PortletInvocationResponse response =3D null; + // This call will wait until all the current threads have exited = the component valve. + // Perhaps this should be done asynchronously as it may lead to a= long delay ? + // It could be made parametrizable too, so the deployer can choos= e what mode is preferable + PortletContainer container =3D (PortletContainer)invocation.getAt= tribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET= _CONTAINER); = - try - { - response =3D (PortletInvocationResponse)invocation.invokeNext(= ); - } - finally - { - // Release the valve - valve.afterInvocation(); - } + // Get the context + PortletContainerContext context =3D container.getContext(); = - // Stop the container if necessary - if (response instanceof UnavailableResponse) - { - // This call will wait until all the current threads have exit= ed the component valve. - // Perhaps this should be done asynchronously as it may lead t= o a long delay ? - // It could be made parametrizable too, so the deployer can ch= oose what mode is preferable - PortletApplication application =3D container.getApplication(); - PortletApplicationContext applicationContext =3D application.g= etContext(); - applicationContext.stopPortletContainer(container.getId()); - } - - // - return response; + // Invoke stop + context.invokeStop(); } - else - { - return new UnavailableResponse(); - } -*/ = - return invocation.invokeNext(); + // + return response; } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/PortletApplication.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletApplication.java 2008-02-19 13:23:47 UTC (rev 10029) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletApplication.java 2008-02-19 14:07:50 UTC (rev 10030) @@ -22,6 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.container; = +import javax.servlet.ServletContext; import java.util.Collection; = /** @@ -40,34 +41,6 @@ String getId(); = /** - * Set the context required by that application. - * - * @param context the context - */ - void setContext(PortletApplicationContext context); - - /** - * Returns the context related to this application. - * - * @return the context - */ - PortletApplicationContext getContext(); - - /** - * Wire a container. - * - * @param container the container - */ - void addContainer(PortletContainer container); - - /** - * Unwire a container. - * - * @param container the container - */ - void removeContainer(PortletContainer container); - - /** * Returns the set of related portlet containers. * * @return the portlet containers @@ -82,15 +55,7 @@ */ PortletContainer getPortletContainer(String containerId); = - /** - * Starts the application only. It does not take care of starting its c= omponents. - * - * @throws Exception any exception preventing the start - */ - void start() throws Exception; + PortletApplicationContext getContext(); = - /** - * Stops the application only. It does not take care of stopping its co= mponents. - */ - void stop(); + } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/PortletContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletContainer.java 2008-02-19 13:23:47 UTC (rev 10029) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletContainer.java 2008-02-19 14:07:50 UTC (rev 10030) @@ -22,7 +22,6 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.container; = -import org.jboss.portal.common.concurrent.Valve; import org.jboss.portal.common.invocation.InvocationException; import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.info.PortletInfo; @@ -51,27 +50,6 @@ PortletInfo getInfo(); = /** - * Wire the application. - * - * @param application the related application - */ - void setApplication(PortletApplication application); - - /** - * Returns the wired application. - * - * @return the application - */ - PortletApplication getApplication(); - - /** - * Wire the portlet container context. - * - * @param context the context - */ - void setContext(PortletContainerContext context); - - /** * Invoke the portlet container. * * @param invocation the portlet invocation @@ -82,14 +60,11 @@ PortletInvocationResponse dispatch(PortletInvocation invocation) throws= PortletInvokerException, InvocationException; = /** - * Starts the portlet container. + * Returns the wired application. * - * @throws Exception any exception preventing the start + * @return the application */ - void start() throws Exception; + PortletApplication getApplication(); = - /** - * Stops the portlet container. - */ - void stop(); + PortletContainerContext getContext(); } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/PortletContainerInvoker.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletContainerInvoker.java 2008-02-19 13:23:47 UTC (rev 10029) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletContainerInvoker.java 2008-02-19 14:07:50 UTC (rev 10030) @@ -119,11 +119,11 @@ this.portlets =3D portlets; } = - public synchronized void start() throws Exception + public void start() throws Exception { } = - public synchronized void stop() throws Exception + public void stop() throws Exception { } = Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /container/object/PortletApplicationObject.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/object/PortletApplicationObject.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/object/PortletApplicationObject.java 2008-02-19 14:07:50 UTC (rev 1= 0030) @@ -0,0 +1,77 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container.object; + +import org.jboss.portal.portlet.container.PortletApplicationContext; +import org.jboss.portal.portlet.container.PortletContainer; +import org.jboss.portal.portlet.container.PortletApplication; + +/** + * Contains life cycle and wiring details for the kernel environment. + * = + * @author Julien Viet + * @version $Revision: 630 $ + */ +public interface PortletApplicationObject extends PortletApplication +{ + + /** + * Set the context required by that application. + * + * @param context the context + */ + void setContext(PortletApplicationContext context); + + /** + * Returns the context related to this application. + * + * @return the context + */ + PortletApplicationContext getContext(); + + /** + * Wire a container. + * + * @param container the container + */ + void addContainer(PortletContainer container); + + /** + * Unwire a container. + * + * @param container the container + */ + void removeContainer(PortletContainer container); + + /** + * Starts the application only. It does not take care of starting its c= omponents. + * + * @throws Exception any exception preventing the start + */ + void start() throws Exception; + + /** + * Stops the application only. It does not take care of stopping its co= mponents. + */ + void stop(); +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /container/object/PortletContainerObject.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/object/PortletContainerObject.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/object/PortletContainerObject.java 2008-02-19 14:07:50 UTC (rev 100= 30) @@ -0,0 +1,63 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container.object; + +import org.jboss.portal.portlet.container.PortletApplication; +import org.jboss.portal.portlet.container.PortletContainerContext; +import org.jboss.portal.portlet.container.PortletContainer; + +/** + * Contains life cycle and wiring details for the kernel environment. + * = + * @author Julien Viet + * @version $Revision: 630 $ + */ +public interface PortletContainerObject extends PortletContainer +{ + + /** + * Wire the application. + * + * @param application the related application + */ + void setApplication(PortletApplication application); + + /** + * Wire the portlet container context. + * + * @param context the context + */ + void setContext(PortletContainerContext context); + + /** + * Starts the portlet container. + * + * @throws Exception any exception preventing the start + */ + void start() throws Exception; + + /** + * Stops the portlet container. + */ + void stop(); +} Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletApplicationImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletApplicationImpl.java 2008-02-19 13:23:47 UTC (rev 10029) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletApplicationImpl.java 2008-02-19 14:07:50 UTC (rev 10030) @@ -35,6 +35,7 @@ import org.jboss.portal.portlet.container.PortletApplicationContext; import org.jboss.portal.portlet.container.PortletContainer; import org.jboss.portal.portlet.container.PortletInitializationException; +import org.jboss.portal.portlet.container.object.PortletApplicationObject; import org.jboss.portal.portlet.LifeCyclePhase; import org.apache.log4j.Logger; = @@ -59,7 +60,7 @@ * @author Julien Viet * @version $Revision: 7226 $ */ -public class PortletApplicationImpl implements PortletApplication +public class PortletApplicationImpl implements PortletApplicationObject { = private static final EnumMap> phaseToType =3D Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletContainerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletContainerImpl.java 2008-02-19 13:23:47 UTC (rev 10029) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletContainerImpl.java 2008-02-19 14:07:50 UTC (rev 10030) @@ -28,9 +28,9 @@ import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.aspects.portlet.ContextDispatcherIntercept= or; import org.jboss.portal.portlet.container.PortletApplication; -import org.jboss.portal.portlet.container.PortletContainer; import org.jboss.portal.portlet.container.PortletInitializationException; import org.jboss.portal.portlet.container.PortletContainerContext; +import org.jboss.portal.portlet.container.object.PortletContainerObject; import org.jboss.portal.portlet.impl.jsr168.api.ActionRequestImpl; import org.jboss.portal.portlet.impl.jsr168.api.ActionResponseImpl; import org.jboss.portal.portlet.impl.jsr168.api.PortletConfigImpl; @@ -91,7 +91,7 @@ * @author Julien Viet * @version $Revision: 6365 $ */ -public class PortletContainerImpl implements PortletContainer +public class PortletContainerImpl implements PortletContainerObject { = /** Logger. */ @@ -164,6 +164,11 @@ this.context =3D context; } = + public PortletContainerContext getContext() + { + return context; + } + public ContainerPortletInfo getInfo() { if (started) @@ -428,6 +433,26 @@ = public PortletInvocationResponse dispatch(PortletInvocation invocation)= throws PortletInvokerException, InvocationException { + if (valve.beforeInvocation()) + { + try + { + return invokeDispatch(invocation); + } + finally + { + // Release the valve + valve.afterInvocation(); + } + } + else + { + return new UnavailableResponse(); + } + } + + private PortletInvocationResponse invokeDispatch(PortletInvocation invo= cation) throws PortletInvokerException, InvocationException + { HttpServletRequest dreq =3D invocation.getDispatchedRequest(); HttpServletResponse dresp =3D invocation.getDispatchedResponse(); = --===============4707639697514135940==-- From portal-commits at lists.jboss.org Tue Feb 19 13:03:32 2008 Content-Type: multipart/mixed; boundary="===============4803855467066121046==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10031 - in modules/web/trunk/web/src: test and 4 other directories. Date: Tue, 19 Feb 2008 13:03:32 -0500 Message-ID: --===============4803855467066121046== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-19 13:03:31 -0500 (Tue, 19 Feb 2008) New Revision: 10031 Modified: modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/tomcat/TC6= ServletContainerContext.java modules/web/trunk/web/src/test/build.xml modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/WebAppRegi= stry.java modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/spi/SPITes= tCase.java modules/web/trunk/web/src/test/resources/support/jboss-4.2-generic/serve= r-war/WEB-INF/web.xml modules/web/trunk/web/src/test/resources/support/tomcat-6.0-generic/serv= er-war/WEB-INF/web.xml Log: JBPORTAL-1903 : The web application containing the integration SPI does not= participate in the life cycle of the web SPI Modified: modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/tom= cat/TC6ServletContainerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/tomcat/TC= 6ServletContainerContext.java 2008-02-19 14:07:50 UTC (rev 10030) +++ modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/tomcat/TC= 6ServletContainerContext.java 2008-02-19 18:03:31 UTC (rev 10031) @@ -36,6 +36,7 @@ import org.jboss.portal.web.command.CommandDispatcher; import org.jboss.portal.web.impl.DefaultServletContainerFactory; import org.jboss.portal.web.spi.ServletContainerContext; +import org.apache.catalina.core.StandardContext; = import javax.servlet.ServletContext; import javax.servlet.ServletException; @@ -59,10 +60,10 @@ private final CommandDispatcher dispatcher =3D new CommandDispatcher(); = /** The monitored hosts. */ - private final Set monitoredHosts =3D new HashSet(); + private final Set monitoredHosts =3D new HashSet(); = /** The monitored contexts. */ - private final Set monitoredContexts =3D new HashSet(); + private final Set monitoredContexts =3D new HashSet(); = /** . */ private final Engine engine; @@ -111,9 +112,9 @@ unregisterHost(host); } } - else if (event.getData() instanceof Context) + else if (event.getData() instanceof StandardContext) { - Context context =3D (Context)event.getData(); + StandardContext context =3D (StandardContext)event.getData(); = // if (Container.ADD_CHILD_EVENT.equals(event.getType())) @@ -151,9 +152,8 @@ = // Container[] childrenContainers =3D engine.findChildren(); - for (int i =3D 0; i < childrenContainers.length; i++) + for (Container childContainer : childrenContainers) { - Container childContainer =3D childrenContainers[i]; if (childContainer instanceof Host) { Host host =3D (Host)childContainer; @@ -171,9 +171,8 @@ = // Container[] childrenContainers =3D engine.findChildren(); - for (int i =3D 0; i < childrenContainers.length; i++) + for (Container childContainer : childrenContainers) { - Container childContainer =3D childrenContainers[i]; if (childContainer instanceof Host) { Host host =3D (Host)childContainer; @@ -197,12 +196,11 @@ if (!monitoredHosts.contains(host.getName())) { Container[] childrenContainers =3D host.findChildren(); - for (int i =3D 0; i < childrenContainers.length; i++) + for (Container childContainer : childrenContainers) { - Container childContainer =3D childrenContainers[i]; - if (childContainer instanceof Context) + if (childContainer instanceof StandardContext) { - Context context =3D (Context)childContainer; + StandardContext context =3D (StandardContext)childContainer; registerContext(context); } } @@ -226,29 +224,25 @@ = // Container[] childrenContainers =3D host.findChildren(); - for (int i =3D 0; i < childrenContainers.length; i++) + for (Container childContainer : childrenContainers) { - Container childContainer =3D childrenContainers[i]; if (childContainer instanceof Context) { - Context context =3D (Context)childContainer; + StandardContext context =3D (StandardContext)childContainer; unregisterContext(context); } } } } = - private void registerContext(Context context) + private void registerContext(StandardContext context) { if (!monitoredContexts.contains(context.getName())) { - if (context instanceof Lifecycle) - { - ((Lifecycle)context).addLifecycleListener(this); - } + context.addLifecycleListener(this); = // - if (context.getAvailable()) + if (context.getState() =3D=3D 1) { start(context); } @@ -258,7 +252,7 @@ } } = - private void unregisterContext(Context context) + private void unregisterContext(StandardContext context) { if (monitoredContexts.contains(context.getName())) { @@ -271,10 +265,7 @@ } = // - if (context instanceof Lifecycle) - { - ((Lifecycle)context).removeLifecycleListener(this); - } + context.removeLifecycleListener(this); } } = Modified: modules/web/trunk/web/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/web/src/test/build.xml 2008-02-19 14:07:50 UTC (rev 1= 0030) +++ modules/web/trunk/web/src/test/build.xml 2008-02-19 18:03:31 UTC (rev 1= 0031) @@ -572,21 +572,21 @@ - + - + - + Modified: modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/Web= AppRegistry.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/WebAppReg= istry.java 2008-02-19 14:07:50 UTC (rev 10030) +++ modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/WebAppReg= istry.java 2008-02-19 18:03:31 UTC (rev 10031) @@ -39,7 +39,7 @@ { = /** . */ - final Map map =3D new HashMap(); + final Map map =3D new HashMap(); = public void onEvent(WebAppEvent event) { @@ -64,10 +64,10 @@ { throw new IllegalArgumentException(); } - return (WebApp)map.get(key); + return map.get(key); } = - public Set getKeys() + public Set getKeys() { return map.keySet(); } Modified: modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/spi= /SPITestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/spi/SPITe= stCase.java 2008-02-19 14:07:50 UTC (rev 10030) +++ modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/spi/SPITe= stCase.java 2008-02-19 18:03:31 UTC (rev 10031) @@ -48,7 +48,6 @@ import java.io.IOException; import java.util.Set; import java.util.HashSet; -import java.util.Collection; = /** * @author Julien Viet @@ -70,6 +69,13 @@ { if (getRequestCount() =3D=3D 1) { + // Check that this web app is here + String key =3D req.getContextPath(); + if (!keys.contains(key)) + { + fail("The current test web app with key " + key + " is not see= n as deployed among " + keys); + } + // Should try ServletContext appContext =3D testServlet.getServletContext().get= Context("/test-spi-app"); = @@ -147,7 +153,7 @@ // Register and save the deployed web apps registry =3D new WebAppRegistry(); container.addWebAppListener(registry); - keys =3D new HashSet((Collection)regist= ry.getKeys()); + keys =3D new HashSet(registry.getKeys()); = // Deploy the application web app return new DeployResponse("test-spi-app.war"); @@ -155,7 +161,7 @@ else if (getRequestCount() =3D=3D 0) { // Compute the difference with the previous deployed web apps - Set diff =3D new HashSet((Collection)re= gistry.getKeys()); + Set diff =3D new HashSet(registry.getKeys()); diff.removeAll(keys); = // It should be 1 Modified: modules/web/trunk/web/src/test/resources/support/jboss-4.2-generi= c/server-war/WEB-INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/web/src/test/resources/support/jboss-4.2-generic/serv= er-war/WEB-INF/web.xml 2008-02-19 14:07:50 UTC (rev 10030) +++ modules/web/trunk/web/src/test/resources/support/jboss-4.2-generic/serv= er-war/WEB-INF/web.xml 2008-02-19 18:03:31 UTC (rev 10031) @@ -42,8 +42,17 @@ org.jboss.portal.test.web.TestServlet 0 + + BootstrapServlet + org.jboss.portal.web.impl.generic.PortletContainerBoo= tstrapServlet + 0 + TestServlet / + + BootstrapServlet + /jbossportlet + Modified: modules/web/trunk/web/src/test/resources/support/tomcat-6.0-gener= ic/server-war/WEB-INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/web/src/test/resources/support/tomcat-6.0-generic/ser= ver-war/WEB-INF/web.xml 2008-02-19 14:07:50 UTC (rev 10030) +++ modules/web/trunk/web/src/test/resources/support/tomcat-6.0-generic/ser= ver-war/WEB-INF/web.xml 2008-02-19 18:03:31 UTC (rev 10031) @@ -42,8 +42,17 @@ org.jboss.portal.test.web.TestServlet 0 + + BootstrapServlet + org.jboss.portal.web.impl.generic.PortletContainerBoo= tstrapServlet + 0 + TestServlet / + + BootstrapServlet + /jbossportlet + --===============4803855467066121046==-- From portal-commits at lists.jboss.org Tue Feb 19 13:09:38 2008 Content-Type: multipart/mixed; boundary="===============0775801057776478359==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10032 - modules/web/trunk/build. Date: Tue, 19 Feb 2008 13:09:37 -0500 Message-ID: --===============0775801057776478359== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-19 13:09:37 -0500 (Tue, 19 Feb 2008) New Revision: 10032 Modified: modules/web/trunk/build/pom.xml Log: it's rather SNAPSHOT than 1.2.Beta1 Modified: modules/web/trunk/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/build/pom.xml 2008-02-19 18:03:31 UTC (rev 10031) +++ modules/web/trunk/build/pom.xml 2008-02-19 18:09:37 UTC (rev 10032) @@ -18,7 +18,7 @@ 4.0.0 org.jboss.portal.web module-parent - 1.2.0-Beta1 + 1.2.0-SNAPSHOT pom JBoss Portal Test Module http://www.jboss.com/products/jbossmc --===============0775801057776478359==-- From portal-commits at lists.jboss.org Tue Feb 19 13:37:26 2008 Content-Type: multipart/mixed; boundary="===============0346805279964874407==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10033 - in modules/web/trunk: web and 2 other directories. Date: Tue, 19 Feb 2008 13:37:26 -0500 Message-ID: --===============0346805279964874407== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-19 13:37:25 -0500 (Tue, 19 Feb 2008) New Revision: 10033 Modified: modules/web/trunk/pom.xml modules/web/trunk/web/pom.xml modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/tomcat/TC6= ServletContainerContext.java modules/web/trunk/web/src/test/build.xml Log: hopefully now it's right Modified: modules/web/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/pom.xml 2008-02-19 18:09:37 UTC (rev 10032) +++ modules/web/trunk/pom.xml 2008-02-19 18:37:25 UTC (rev 10033) @@ -5,7 +5,7 @@ module-aggregator pom JBoss Portal Web Module - 1.2.0-Beta1 + 1.2.0-SNAPSHOT http://labs.jboss.com/jbossportal = Modified: modules/web/trunk/web/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/web/pom.xml 2008-02-19 18:09:37 UTC (rev 10032) +++ modules/web/trunk/web/pom.xml 2008-02-19 18:37:25 UTC (rev 10033) @@ -3,7 +3,7 @@ org.jboss.portal.web module-parent - 1.2.0-Beta1 + 1.2.0-SNAPSHOT ../build/pom.xml 4.0.0 Modified: modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/tom= cat/TC6ServletContainerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/tomcat/TC= 6ServletContainerContext.java 2008-02-19 18:09:37 UTC (rev 10032) +++ modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/tomcat/TC= 6ServletContainerContext.java 2008-02-19 18:37:25 UTC (rev 10033) @@ -226,7 +226,7 @@ Container[] childrenContainers =3D host.findChildren(); for (Container childContainer : childrenContainers) { - if (childContainer instanceof Context) + if (childContainer instanceof StandardContext) { StandardContext context =3D (StandardContext)childContainer; unregisterContext(context); @@ -259,7 +259,7 @@ monitoredContexts.remove(context.getName()); = // - if (context.getAvailable()) + if (context.getState() =3D=3D 1) { stop(context); } Modified: modules/web/trunk/web/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/web/src/test/build.xml 2008-02-19 18:09:37 UTC (rev 1= 0032) +++ modules/web/trunk/web/src/test/build.xml 2008-02-19 18:37:25 UTC (rev 1= 0033) @@ -190,9 +190,6 @@ - - - @@ -215,9 +212,6 @@ - - - @@ -241,9 +235,6 @@ - - - @@ -262,9 +253,6 @@ - - - @@ -283,9 +271,6 @@ - - - @@ -398,6 +383,7 @@ action=3D"start" wait=3D"${cargo.wait}"> + @@ -508,6 +494,11 @@ action=3D"start" wait=3D"${cargo.wait}"> + + + + + --===============0346805279964874407==-- From portal-commits at lists.jboss.org Tue Feb 19 16:16:52 2008 Content-Type: multipart/mixed; boundary="===============1494609786192654169==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10034 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/container/managed and 7 other directories. Date: Tue, 19 Feb 2008 16:16:52 -0500 Message-ID: --===============1494609786192654169== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-19 16:16:51 -0500 (Tue, 19 Feb 2008) New Revision: 10034 Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/ManagedObject.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/ManagedObjectStatus.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /admin/ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /admin/ui/ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /admin/ui/AdminPortlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/K= ernelObject.java modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= portlet.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/adm= in.jsp Modified: modules/portlet/trunk/build/pom.xml modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/ManagedPortletApplication.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/ManagedPortletContainer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/K= ernelPortletApplication.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/K= ernelPortletContainer.java modules/portlet/trunk/test/src/test/build.xml Log: - start to build small UI for displaying managed container object status, n= eed to add life cycle change Modified: modules/portlet/trunk/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/build/pom.xml 2008-02-19 18:37:25 UTC (rev 10033) +++ modules/portlet/trunk/build/pom.xml 2008-02-19 21:16:51 UTC (rev 10034) @@ -39,7 +39,7 @@ 3.6-beta 2.2.1.GA 1.2.0-Beta1 - 1.2.0-Beta1 + 1.2.0-SNAPSHOT 1.2.0-Beta1 1.2.14 1.1.1 Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /container/managed/ManagedObject.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedObject.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedObject.java 2008-02-19 21:16:51 UTC (rev 10034) @@ -0,0 +1,38 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container.managed; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public interface ManagedObject +{ + + ManagedObjectStatus getStatus(); + + void managedStart() throws Exception; + + void managedStop(); + = +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /container/managed/ManagedObjectStatus.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedObjectStatus.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedObjectStatus.java 2008-02-19 21:16:51 UTC (rev 10034) @@ -0,0 +1,34 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container.managed; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public enum ManagedObjectStatus +{ + + STOPPED, STARTED, FAILED + +} Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/managed/ManagedPortletApplication.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedPortletApplication.java 2008-02-19 18:37:25 UTC (rev= 10033) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedPortletApplication.java 2008-02-19 21:16:51 UTC (rev= 10034) @@ -28,17 +28,14 @@ * @author Julien Viet * @version $Revision: 630 $ */ -public interface ManagedPortletApplication +public interface ManagedPortletApplication extends ManagedObject { = String getId(); = - void managedStart() throws Exception; - - void managedStop(); - Collection getManagedPortletContaine= rs(); = ManagedPortletContainer getManagedPortletContainer(String portletContai= nerId); + = = } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/managed/ManagedPortletContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedPortletContainer.java 2008-02-19 18:37:25 UTC (rev 1= 0033) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedPortletContainer.java 2008-02-19 21:16:51 UTC (rev 1= 0034) @@ -28,7 +28,7 @@ * @author Julien Viet * @version $Revision: 630 $ */ -public interface ManagedPortletContainer +public interface ManagedPortletContainer extends ManagedObject { = String getId(); @@ -37,8 +37,4 @@ = ManagedPortletApplication getManagedPortletApplication(); = - void managedStart() throws Exception; - - void managedStop(); - } Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/po= rtal/admin/ui/AdminPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/admin/ui/AdminPortlet.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/admin/ui/AdminPortlet.java 2008-02-19 21:16:51 UTC (rev 10034) @@ -0,0 +1,66 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.admin.ui; + +import org.jboss.portal.portlet.container.managed.PortletApplicationRegist= ry; +import org.jboss.portal.portlet.container.managed.ManagedPortletApplicatio= n; +import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; + +import javax.portlet.GenericPortlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import java.io.IOException; +import java.io.PrintWriter; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class AdminPortlet extends GenericPortlet +{ + + protected void doView(RenderRequest req, RenderResponse resp) throws Po= rtletException, IOException + { + + resp.setContentType("text/html"); + + PrintWriter writer =3D resp.getWriter(); + + // Use an alias + PortletApplicationRegistry registry =3D (PortletApplicationRegistry)= getPortletContext().getAttribute("PortletApplicationDeployer"); + + for (ManagedPortletApplication application : registry.getManagedPort= letApplications()) + { + writer.print("
    • Application " + application.getId() + " " += application.getStatus() + "
      • "); + for (ManagedPortletContainer container : application.getManagedPo= rtletContainers()) + { + writer.print("
      • Container " + container.getId() + " " + cont= ainer.getStatus() + "
      • "); + } + writer.print("
    "); + } + + writer.close(); + + } +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/KernelObject.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelObject.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelObject.java 2008-02-19 21:16:51 UTC (rev 10034) @@ -0,0 +1,125 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test; + +import org.jboss.kernel.spi.dependency.KernelControllerContextAware; +import org.jboss.kernel.spi.dependency.KernelControllerContext; +import org.jboss.dependency.spi.ControllerState; +import org.jboss.portal.portlet.container.managed.ManagedObject; +import org.jboss.portal.portlet.container.managed.ManagedObjectStatus; + +import java.lang.reflect.UndeclaredThrowableException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class KernelObject implements ManagedObject, KernelControllerContex= tAware +{ + + /** . */ + private KernelControllerContext controllerContext; + + public final void setKernelControllerContext(KernelControllerContext co= ntrollerContext) throws Exception + { + this.controllerContext =3D controllerContext; + } + + public final void unsetKernelControllerContext(KernelControllerContext = controllerContext) throws Exception + { + this.controllerContext =3D null; + } + + public final ManagedObjectStatus getStatus() + { + ControllerState state =3D controllerContext.getState(); + + // + if (state =3D=3D ControllerState.INSTALLED) + { + return ManagedObjectStatus.STARTED; + } + else if (state =3D=3D ControllerState.ERROR) + { + return ManagedObjectStatus.FAILED; + } + else + { + return ManagedObjectStatus.STOPPED; + } + } + + public final void managedStart() throws Exception + { + controllerStart(); + } + + public final void managedStop() + { + controllerStop(); + } + + protected final void controllerStart() throws Exception + { + if (controllerContext =3D=3D null) + { + throw new IllegalStateException("No under the controller of the k= ernel"); + } + + // + try + { + controllerContext.getController().change(controllerContext, Contr= ollerState.INSTALLED); + } + catch (Throwable throwable) + { + if (throwable instanceof Exception) + { + throw ((Exception)throwable); + } + if (throwable instanceof Error) + { + throw ((Error)throwable); + } + throw new UndeclaredThrowableException(throwable); + } + } + + protected final void controllerStop() + { + if (controllerContext =3D=3D null) + { + throw new IllegalStateException("No under the controller of the k= ernel"); + } + + // + try + { + controllerContext.getController().change(controllerContext, Contr= ollerState.CREATE); + } + catch (Throwable throwable) + { + throwable.printStackTrace(); + } + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/KernelPortletApplication.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelPortletApplication.java 2008-02-19 18:37:25 UTC (rev 10033) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelPortletApplication.java 2008-02-19 21:16:51 UTC (rev 10034) @@ -27,7 +27,6 @@ import org.jboss.portal.portlet.container.managed.ManagedPortletApplicatio= n; import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; import org.jboss.portal.web.WebApp; -import org.jboss.portal.common.NotYetImplemented; = import javax.servlet.ServletContext; import java.util.Map; @@ -38,7 +37,7 @@ * @author Julien Viet * @version $Revision: 630 $ */ -public class KernelPortletApplication implements PortletApplicationContext= , ManagedPortletApplication +public class KernelPortletApplication extends KernelObject implements Port= letApplicationContext, ManagedPortletApplication { = /** . */ @@ -104,12 +103,12 @@ = public void invokeStart() throws Exception { - throw new NotYetImplemented(); + controllerStart(); } = public void invokeStop() { - throw new NotYetImplemented(); + controllerStop(); } = // @@ -119,16 +118,6 @@ return portletApplication.getId(); } = - public void managedStart() throws Exception - { - throw new NotYetImplemented(); - } - - public void managedStop() - { - throw new NotYetImplemented(); - } - public Collection getManagedPortletC= ontainers() { return kernelPortletContainers.values(); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/KernelPortletContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelPortletContainer.java 2008-02-19 18:37:25 UTC (rev 10033) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelPortletContainer.java 2008-02-19 21:16:51 UTC (rev 10034) @@ -27,13 +27,12 @@ import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; import org.jboss.portal.portlet.container.managed.ManagedPortletApplicatio= n; import org.jboss.portal.portlet.info.PortletInfo; -import org.jboss.portal.common.NotYetImplemented; = /** * @author Julien Viet * @version $Revision: 630 $ */ -public class KernelPortletContainer implements PortletContainerContext, Ma= nagedPortletContainer +public class KernelPortletContainer extends KernelObject implements Portle= tContainerContext, ManagedPortletContainer { = /** . */ @@ -74,12 +73,12 @@ = public void invokeStart() throws Exception { - throw new NotYetImplemented(); + controllerStart(); } = public void invokeStop() { - throw new NotYetImplemented(); + controllerStop(); } = // @@ -98,14 +97,4 @@ { return portletContainer.getInfo(); } - - public void managedStart() throws Exception - { - throw new NotYetImplemented(); - } - - public void managedStop() - { - throw new NotYetImplemented(); - } } Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-19 18:37:25 UTC (= rev 10033) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-19 21:16:51 UTC (= rev 10034) @@ -721,7 +721,7 @@ = = - + = Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-= INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portlet.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portlet.xml 2008-02-19 21:16:51 UTC (rev 10034) @@ -0,0 +1,45 @@ + + + + + + Administration Portlet + AdminPortlet + Admin Portlet + org.jboss.portal.portlet.portal.admin.ui.AdminPortlet= + + text/html + VIEW + + + Admin Portlet + admin + + + + + Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo= /admin.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/ad= min.jsp (rev 0) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/ad= min.jsp 2008-02-19 21:16:51 UTC (rev 10034) @@ -0,0 +1,14 @@ +<%@ page contentType=3D"text/html" %> +<%@ page language=3D"java" %> +<%@ taglib prefix=3D"jbp" tagdir=3D"/WEB-INF/tags/portal" %> +<%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> +<%@ page isELIgnored=3D"false" %> + +<%@ include file=3D"/layouts/header.jsp" %> + = + + + + + +<%@ include file=3D"/layouts/footer.jsp" %> \ No newline at end of file --===============1494609786192654169==-- From portal-commits at lists.jboss.org Tue Feb 19 17:18:45 2008 Content-Type: multipart/mixed; boundary="===============0069894541444499242==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10035 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/container and 4 other directories. Date: Tue, 19 Feb 2008 17:17:41 -0500 Message-ID: --===============0069894541444499242== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-19 17:17:41 -0500 (Tue, 19 Feb 2008) New Revision: 10035 Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/PortletRequestHandler.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/PortletApplication.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletAPIFactoryImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletContainerImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/ActionRequestImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/ClientDataRequestImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/EventRequestImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletRequestImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/RenderRequestImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/ResourceRequestImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /admin/ui/AdminPortlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/K= ernelPortletApplication.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/K= ernelPortletContainer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletApplicationDeployment.java Log: reduce the number of kernel beans Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/PortletRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/PortletRequestHandler.java 2008-02-19 21:16:51 UTC (rev 10034) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/PortletRequestHandler.java 2008-02-19 22:17:41 UTC (rev 10035) @@ -267,7 +267,12 @@ } = // - ParameterMap publicNS =3D pageState.getPublicNavigationalState(po= rtletRequest.getWindowId()); + ParameterMap publicNS =3D null; + if (pageState !=3D null) + { + publicNS =3D pageState.getPublicNavigationalState(portletReque= st.getWindowId()); + } + PortletInvocationContext portletInvocationContext =3D context.cre= atePortletInvocationContext(portletRequest.getWindowId(), pageState); ActionInvocation actionInvocation =3D new ActionInvocation(portle= tInvocationContext); = Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/PortletApplication.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletApplication.java 2008-02-19 21:16:51 UTC (rev 10034) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletApplication.java 2008-02-19 22:17:41 UTC (rev 10035) @@ -45,7 +45,7 @@ * * @return the portlet containers */ - Collection getPortletContainers(); + Collection getPortletContainers(); = /** * Returns a specific container or null if it does not exist Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletAPIFactoryImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletAPIFactoryImpl.java 2008-02-19 21:16:51 UTC (rev 10034) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletAPIFactoryImpl.java 2008-02-19 22:17:41 UTC (rev 10035) @@ -44,7 +44,7 @@ { public ActionRequestImpl createActionRequest(ActionInvocation invocatio= n) { - return new ActionRequestImpl(invocation); + return new ActionRequestImpl(null, invocation); } = public ActionResponseImpl createActionResponse(ActionInvocation invocat= ion, ActionRequestImpl actionRequest) @@ -54,7 +54,7 @@ = public EventRequestImpl createEventRequest(EventInvocation invocation) { - return new EventRequestImpl(invocation); + return new EventRequestImpl(null, invocation); } = public EventResponseImpl createEventResponse(EventInvocation invocation= , EventRequestImpl eventRequest) @@ -64,7 +64,7 @@ = public RenderRequestImpl createRenderRequest(RenderInvocation invocatio= n) { - return new RenderRequestImpl(invocation); + return new RenderRequestImpl(null, invocation); } = public RenderResponseImpl createRenderResponse(RenderInvocation invocat= ion, RenderRequestImpl renderRequest) @@ -74,7 +74,7 @@ = public ResourceRequestImpl createResourceRequest(ResourceInvocation inv= ocation) { - return new ResourceRequestImpl(invocation); + return new ResourceRequestImpl(null, invocation); } = public ResourceResponseImpl createResourceResponse(ResourceInvocation i= nvocation, ResourceRequestImpl renderRequest) Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletContainerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletContainerImpl.java 2008-02-19 21:16:51 UTC (rev 10034) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletContainerImpl.java 2008-02-19 22:17:41 UTC (rev 10035) @@ -463,28 +463,28 @@ FilterChainImpl chain; if (invocation instanceof ActionInvocation) { - req =3D new ActionRequestImpl((ActionInvocation)invocation); + req =3D new ActionRequestImpl(this, (ActionInvocation)invocation); resp =3D new ActionResponseImpl((ActionInvocation)invocation, req= ); phase =3D "ACTION_PHASE"; chain =3D new FilterChainImpl(actionFilterList, Act= ionFilter.class); } else if (invocation instanceof RenderInvocation) { - req =3D new RenderRequestImpl((RenderInvocation)invocation); + req =3D new RenderRequestImpl(this, (RenderInvocation)invocation); resp =3D new RenderResponseImpl((RenderInvocation)invocation, req= ); phase =3D "RENDER_PHASE"; chain =3D new FilterChainImpl(renderFilterList, Ren= derFilter.class); } else if (invocation instanceof EventInvocation) { - req =3D new EventRequestImpl((EventInvocation)invocation); + req =3D new EventRequestImpl(this, (EventInvocation)invocation); resp =3D new EventResponseImpl((EventInvocation)invocation, req); phase =3D "EVENT_PHASE"; chain =3D new FilterChainImpl(eventFilterList, Event= Filter.class); } else if (invocation instanceof ResourceInvocation) { - req =3D new ResourceRequestImpl((ResourceInvocation)invocation); + req =3D new ResourceRequestImpl(this, (ResourceInvocation)invocat= ion); resp =3D new ResourceResponseImpl((ResourceInvocation)invocation,= req); phase =3D "RESOURCE_SERVING_PHASE"; chain =3D new FilterChainImpl(resourceFilterList,= ResourceFilter.class); Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/ActionRequestImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/ActionRequestImpl.java 2008-02-19 21:16:51 UTC (rev 10034) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/ActionRequestImpl.java 2008-02-19 22:17:41 UTC (rev 10035) @@ -23,6 +23,7 @@ package org.jboss.portal.portlet.impl.jsr168.api; = import org.jboss.portal.portlet.invocation.ActionInvocation; +import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl; = import javax.portlet.ActionRequest; = @@ -32,8 +33,8 @@ */ public class ActionRequestImpl extends ClientDataRequestImpl implements Ac= tionRequest { - public ActionRequestImpl(ActionInvocation invocation) + public ActionRequestImpl(PortletContainerImpl container, ActionInvocati= on invocation) { - super(invocation); + super(container, invocation); } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/ClientDataRequestImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/ClientDataRequestImpl.java 2008-02-19 21:16:51 UTC (rev 10034) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/ClientDataRequestImpl.java 2008-02-19 22:17:41 UTC (rev 10035) @@ -25,6 +25,7 @@ import org.jboss.portal.portlet.invocation.ActionInvocation; import org.jboss.portal.portlet.invocation.ResourceInvocation; import org.jboss.portal.portlet.spi.RequestContext; +import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl; = import javax.portlet.ClientDataRequest; import java.io.InputStream; @@ -42,17 +43,17 @@ /** . */ protected final RequestContext requestContext; = - public ClientDataRequestImpl(ActionInvocation invocation) + public ClientDataRequestImpl(PortletContainerImpl container, ActionInvo= cation invocation) { - super(invocation); + super(container, invocation); = // this.requestContext =3D invocation.getRequestContext(); } = - public ClientDataRequestImpl(ResourceInvocation invocation) + public ClientDataRequestImpl(PortletContainerImpl container, ResourceIn= vocation invocation) { - super(invocation); + super(container, invocation); = // this.requestContext =3D invocation.getRequestContext(); Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/EventRequestImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/EventRequestImpl.java 2008-02-19 21:16:51 UTC (rev 10034) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/EventRequestImpl.java 2008-02-19 22:17:41 UTC (rev 10035) @@ -23,6 +23,7 @@ package org.jboss.portal.portlet.impl.jsr168.api; = import org.jboss.portal.portlet.invocation.EventInvocation; +import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl; = import javax.portlet.EventRequest; import javax.portlet.Event; @@ -40,9 +41,9 @@ /** . */ private EventInvocation eventInvocation; = - public EventRequestImpl(EventInvocation invocation) + public EventRequestImpl(PortletContainerImpl container, EventInvocation= invocation) { - super(invocation); + super(container, invocation); = // this.eventInvocation =3D invocation; Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/PortletRequestImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletRequestImpl.java 2008-02-19 21:16:51 UTC (rev 10034) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletRequestImpl.java 2008-02-19 22:17:41 UTC (rev 10035) @@ -138,9 +138,8 @@ /** . */ private final String contextPath; = - public PortletRequestImpl(PortletInvocation invocation) + public PortletRequestImpl(PortletContainerImpl container, PortletInvoca= tion invocation) { - PortletContainerImpl container =3D (PortletContainerImpl)invocation.= getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PO= RTLET_CONTAINER); int mode =3D this instanceof RenderRequest ? PortletPreferencesImpl.= RENDER : PortletPreferencesImpl.ACTION; PropertyContext prefs =3D (PropertyContext)invocation.getAttribute(P= ortletInvocation.INVOCATION_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE); PreferencesValidator validator =3D container.getPreferencesValidator= (); Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/RenderRequestImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/RenderRequestImpl.java 2008-02-19 21:16:51 UTC (rev 10034) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/RenderRequestImpl.java 2008-02-19 22:17:41 UTC (rev 10035) @@ -23,6 +23,7 @@ package org.jboss.portal.portlet.impl.jsr168.api; = import org.jboss.portal.portlet.invocation.RenderInvocation; +import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl; import org.jboss.portal.common.NotYetImplemented; import org.jboss.portal.common.util.MultiValuedPropertyMap; = @@ -39,9 +40,9 @@ /** . */ private final String validationToken; = - public RenderRequestImpl(RenderInvocation invocation) + public RenderRequestImpl(PortletContainerImpl container, RenderInvocati= on invocation) { - super(invocation); + super(container, invocation); = // this.validationToken =3D invocation.getValidationToken(); Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/ResourceRequestImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/ResourceRequestImpl.java 2008-02-19 21:16:51 UTC (rev 10034) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/ResourceRequestImpl.java 2008-02-19 22:17:41 UTC (rev 10035) @@ -24,6 +24,7 @@ = import org.jboss.portal.portlet.invocation.ResourceInvocation; import org.jboss.portal.portlet.impl.jsr168.ResourceRequestParameterMap; +import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl; import org.jboss.portal.common.util.MultiValuedPropertyMap; import org.jboss.portal.common.util.ParameterMap; = @@ -41,9 +42,9 @@ /** . */ private final ResourceInvocation resourceInvocation; = - public ResourceRequestImpl(ResourceInvocation invocation) + public ResourceRequestImpl(PortletContainerImpl container, ResourceInvo= cation invocation) { - super(invocation); + super(container, invocation); = // this.resourceInvocation =3D invocation; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /portal/admin/ui/AdminPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/admin/ui/AdminPortlet.java 2008-02-19 21:16:51 UTC (rev 10034) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/admin/ui/AdminPortlet.java 2008-02-19 22:17:41 UTC (rev 10035) @@ -30,6 +30,9 @@ import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import javax.portlet.PortletException; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.PortletURL; import java.io.IOException; import java.io.PrintWriter; = @@ -40,6 +43,58 @@ public class AdminPortlet extends GenericPortlet { = + public void processAction(ActionRequest req, ActionResponse resp) throw= s PortletException, IOException + { + + String lifeCycle =3D req.getParameter("lifecycle"); + + // + String applicationId =3D req.getParameter("application"); + + // + if (applicationId !=3D null) + { + // Use an alias + PortletApplicationRegistry registry =3D (PortletApplicationRegist= ry)getPortletContext().getAttribute("PortletApplicationDeployer"); + + // + ManagedPortletApplication application =3D registry.getManagedPort= letApplication(applicationId); + + // + String containerId =3D req.getParameter("container"); + + // + if (containerId !=3D null) + { + final ManagedPortletContainer container =3D application.getMan= agedPortletContainer(containerId); + + // + if ("start".equals(lifeCycle)) + { + try + { + container.managedStart(); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + else if ("stop".equals(lifeCycle)) + { + // Async stop otherwise it is not possible to stop the admi= n portlet (self deadlock) + new Thread() + { + public void run() + { + container.managedStop(); + } + }.start(); + } + } + } + } + protected void doView(RenderRequest req, RenderResponse resp) throws Po= rtletException, IOException { = @@ -52,10 +107,26 @@ = for (ManagedPortletApplication application : registry.getManagedPort= letApplications()) { + PortletURL url =3D resp.createActionURL(); + url.setParameter("application", application.getId()); + + // writer.print("
    • Application " + application.getId() + " " += application.getStatus() + "
      • "); + + // for (ManagedPortletContainer container : application.getManagedPo= rtletContainers()) { - writer.print("
      • Container " + container.getId() + " " + cont= ainer.getStatus() + "
      • "); + + url.setParameter("container", container.getId()); + + url.setParameter("lifecycle", "stop"); + String stopURL =3D url.toString(); + + url.setParameter("lifecycle", "start"); + String startURL =3D url.toString(); + + writer.print("
      • Container " + container.getId() + " " + cont= ainer.getStatus() + "Start Stop= " + "
      • "); } writer.print("
    "); } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/KernelPortletApplication.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelPortletApplication.java 2008-02-19 21:16:51 UTC (rev 10034) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelPortletApplication.java 2008-02-19 22:17:41 UTC (rev 10035) @@ -24,8 +24,15 @@ = import org.jboss.portal.portlet.container.PortletApplicationContext; import org.jboss.portal.portlet.container.PortletApplication; +import org.jboss.portal.portlet.container.PortletContainer; +import org.jboss.portal.portlet.container.object.PortletApplicationObject; import org.jboss.portal.portlet.container.managed.ManagedPortletApplicatio= n; import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; +import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo; +import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; +import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory; +import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl; +import org.jboss.portal.portlet.metadata.JBossApplicationMetaData; import org.jboss.portal.web.WebApp; = import javax.servlet.ServletContext; @@ -37,32 +44,46 @@ * @author Julien Viet * @version $Revision: 630 $ */ -public class KernelPortletApplication extends KernelObject implements Port= letApplicationContext, ManagedPortletApplication +public class KernelPortletApplication extends KernelObject implements Port= letApplicationContext, ManagedPortletApplication, PortletApplication { = /** . */ private final WebApp webApp; = /** . */ - private PortletApplication portletApplication; + final PortletApplicationObject portletApplication; = /** . */ private final Map kernelPortletContaine= rs; = - public KernelPortletApplication(WebApp webApp) + public KernelPortletApplication( + ContainerPortletApplicationInfo info, + PortletApplication10MetaData metaData, + JBossApplicationMetaData jbossMetaData, + PortletAPIFactory portletAPIFactory, + WebApp webApp) { this.webApp =3D webApp; - this.portletApplication =3D null; + this.portletApplication =3D new PortletApplicationImpl(info, metaDat= a, jbossMetaData, portletAPIFactory); this.kernelPortletContainers =3D new HashMap(); + + // + portletApplication.setContext(this); } = public void addKernelPortletContainer(KernelPortletContainer kernelPort= letContainer) { kernelPortletContainers.put(kernelPortletContainer.getPortletContain= er().getId(), kernelPortletContainer); + + // + portletApplication.addContainer(kernelPortletContainer.portletContai= ner); } = public void removeKernelPortletContainer(KernelPortletContainer kernelP= ortletContainer) { + portletApplication.removeContainer(kernelPortletContainer.portletCon= tainer); + + // kernelPortletContainers.remove(kernelPortletContainer.getPortletCont= ainer().getId()); } = @@ -71,17 +92,14 @@ return portletApplication; } = - public void setPortletApplication(PortletApplication portletApplication) - { - this.portletApplication =3D portletApplication; - } - public void start() throws Exception { + portletApplication.start(); } = public void stop() { + portletApplication.stop(); } = // PortletApplicationContext ******************************************= ********************************************** @@ -127,4 +145,21 @@ { return kernelPortletContainers.get(portletContainerId); } + + // PortletApplication *************************************************= ********************************************** + + public Collection getPortletContainers() + { + return kernelPortletContainers.values(); + } + + public PortletContainer getPortletContainer(String containerId) + { + return kernelPortletContainers.get(containerId); + } + + public PortletApplicationContext getContext() + { + return this; + } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/KernelPortletContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelPortletContainer.java 2008-02-19 21:16:51 UTC (rev 10034) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelPortletContainer.java 2008-02-19 22:17:41 UTC (rev 10035) @@ -24,23 +24,39 @@ = import org.jboss.portal.portlet.container.PortletContainerContext; import org.jboss.portal.portlet.container.PortletContainer; +import org.jboss.portal.portlet.container.PortletApplication; +import org.jboss.portal.portlet.container.object.PortletContainerObject; import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; import org.jboss.portal.portlet.container.managed.ManagedPortletApplicatio= n; import org.jboss.portal.portlet.info.PortletInfo; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.impl.info.ContainerPortletInfo; +import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl; +import org.jboss.portal.common.invocation.InvocationException; = /** * @author Julien Viet * @version $Revision: 630 $ */ -public class KernelPortletContainer extends KernelObject implements Portle= tContainerContext, ManagedPortletContainer +public class KernelPortletContainer extends KernelObject implements Portle= tContainerContext, ManagedPortletContainer, PortletContainer { = /** . */ - private PortletContainer portletContainer; + final PortletContainerObject portletContainer; = /** . */ private KernelPortletApplication kernelPortletApplication; = + public KernelPortletContainer(ContainerPortletInfo info) + { + portletContainer =3D new PortletContainerImpl(info); + + // + portletContainer.setContext(this); + } + public KernelPortletApplication getKernelPortletApplication() { return kernelPortletApplication; @@ -49,6 +65,16 @@ public void setKernelPortletApplication(KernelPortletApplication kernel= PortletApplication) { this.kernelPortletApplication =3D kernelPortletApplication; + + // + if (kernelPortletApplication !=3D null) + { + portletContainer.setApplication(kernelPortletApplication.portletA= pplication); + } + else + { + portletContainer.setApplication(null); + } } = public PortletContainer getPortletContainer() @@ -56,17 +82,14 @@ return portletContainer; } = - public void setPortletContainer(PortletContainer portletContainer) - { - this.portletContainer =3D portletContainer; - } - public void start() throws Exception { + portletContainer.start(); } = public void stop() { + portletContainer.stop(); } = // @@ -88,6 +111,8 @@ return portletContainer.getId(); } = + // + public ManagedPortletApplication getManagedPortletApplication() { return kernelPortletApplication; @@ -97,4 +122,21 @@ { return portletContainer.getInfo(); } + + // PortletContainer implementation ************************************= ********************************************** + + public PortletInvocationResponse dispatch(PortletInvocation invocation)= throws PortletInvokerException, InvocationException + { + return portletContainer.dispatch(invocation); + } + + public PortletApplication getApplication() + { + return kernelPortletApplication; + } + + public PortletContainerContext getContext() + { + return this; + } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortletApplicationDeployment.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployment.java 2008-02-19 21:16:51 UTC (rev 10034) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployment.java 2008-02-19 22:17:41 UTC (rev 10035) @@ -44,8 +44,6 @@ import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo; import org.jboss.portal.portlet.impl.info.ContainerPortletInfo; import org.jboss.portal.portlet.impl.jsr168.ContainerInfoBuilderContextImp= l; -import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl; -import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl; import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory; import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; import org.jboss.portal.portlet.metadata.JBossApplicationMetaData; @@ -88,13 +86,13 @@ this.installed =3D new LinkedHashMap(); } = - public AbstractBeanMetaData createKernelPortletContainerMetaData(String= kernelPortletContainerId) + public AbstractBeanMetaData createKernelPortletContainerMetaData(String= kernelPortletContainerId, ContainerPortletInfo portletInfo) { AbstractBeanMetaData beanMD =3D new AbstractBeanMetaData(kernelPortl= etContainerId, KernelPortletContainer.class.getName()); = // AbstractConstructorMetaData ctorMD =3D new AbstractConstructorMetaDa= ta(); - ctorMD.setParameters(new ArrayList()); + ctorMD.setParameters(Tools.toList((ParameterMetaData)new AbstractPar= ameterMetaData(ContainerPortletInfo.class.getName(), portletInfo))); beanMD.setConstructor(ctorMD); = // @@ -110,61 +108,18 @@ return beanMD; } = - public AbstractBeanMetaData createKernelPortletApplicationMetaData(Stri= ng kernelPortletApplicationId) + public AbstractBeanMetaData createKernelPortletApplicationMetaData(Cont= ainerPortletApplicationInfo portletApplicationInfo, String kernelPortletApp= licationId) { AbstractBeanMetaData beanMD =3D new AbstractBeanMetaData(kernelPortl= etApplicationId, KernelPortletApplication.class.getName()); = // AbstractConstructorMetaData ctorMD =3D new AbstractConstructorMetaDa= ta(); - ctorMD.setParameters(Tools.toList((ParameterMetaData)new AbstractPar= ameterMetaData(WebApp.class.getName(), webApp))); - beanMD.setConstructor(ctorMD); - - // - beanMD.setProperties(new HashSet()); - beanMD.setInstalls(new ArrayList()); - beanMD.setUninstalls(new ArrayList()); - - // - beanMD.setStart(new AbstractLifecycleMetaData("start")); - beanMD.setStop(new AbstractLifecycleMetaData("stop")); - - // - return beanMD; - } - - public AbstractBeanMetaData createPortletContainerMetaData(String portl= etContainerId, ContainerPortletInfo portletInfo) - { - AbstractBeanMetaData beanMD =3D new AbstractBeanMetaData(portletCont= ainerId, PortletContainerImpl.class.getName()); - - // - AbstractConstructorMetaData ctorMD =3D new AbstractConstructorMetaDa= ta(); - ctorMD.setParameters(Tools.toList((ParameterMetaData)new AbstractPar= ameterMetaData(ContainerPortletInfo.class.getName(), portletInfo))); - beanMD.setConstructor(ctorMD); - - // - beanMD.setProperties(new HashSet()); - beanMD.setInstalls(new ArrayList()); - beanMD.setUninstalls(new ArrayList()); - - // - beanMD.setStart(new AbstractLifecycleMetaData("start")); - beanMD.setStop(new AbstractLifecycleMetaData("stop")); - - // - return beanMD; - } - - public AbstractBeanMetaData createPortletApplicationMetaData(ContainerP= ortletApplicationInfo portletApplicationInfo, String portletApplicationId) - { - AbstractBeanMetaData beanMD =3D new AbstractBeanMetaData(portletAppl= icationId, PortletApplicationImpl.class.getName()); - - // - AbstractConstructorMetaData ctorMD =3D new AbstractConstructorMetaDa= ta(); ctorMD.setParameters(Tools.toList( (ParameterMetaData)new AbstractParameterMetaData(ContainerPortlet= ApplicationInfo.class.getName(), portletApplicationInfo), new AbstractParameterMetaData(PortletApplication10MetaData.class.= getName(), metaData), new AbstractParameterMetaData(JBossApplicationMetaData.class.getN= ame(), (Object)null), - new AbstractParameterMetaData(PortletAPIFactory.class.getName(), = new AbstractDependencyValueMetaData("PortletAPIFactory")))); + new AbstractParameterMetaData(PortletAPIFactory.class.getName(), = new AbstractDependencyValueMetaData("PortletAPIFactory")), + new AbstractParameterMetaData(WebApp.class.getName(), webApp))); beanMD.setConstructor(ctorMD); = // @@ -189,12 +144,9 @@ KernelController controller =3D kernel.getController(); = // - String portletApplicationId =3D "PortletApplication[" + webApp.getCo= ntextPath() + "]"; + String kernelPortletApplicationId =3D "PortletApplication[" + webApp= .getContextPath() + "]"; = // - String kernelPortletApplicationId =3D "KernelPortletApplication[" + = webApp.getContextPath() + "]"; - - // ContainerInfoBuilderContext builderContext =3D new ContainerInfoBuil= derContextImpl(metaData, webApp); ContainerInfoBuilder builder =3D new ContainerInfoBuilder(metaData, = builderContext); builder.build(); @@ -206,44 +158,11 @@ for (ContainerPortletInfo containerInfo : builder.getPortlets()) { // - String portletContainerId =3D "PortletContainer[" + webApp.getCon= textPath() + "," + containerInfo.getName() + "]"; - String kernelPortletContainerId =3D "KernelPortletContainer[" + w= ebApp.getContextPath() + "," + containerInfo.getName() + "]"; + String kernelPortletContainerId =3D "PortletContainer[" + webApp.= getContextPath() + "," + containerInfo.getName() + "]"; = // - AbstractBeanMetaData portletContainerMD =3D createPortletContaine= rMetaData(portletContainerId, containerInfo); - AbstractBeanMetaData kernelPortletContainerMD =3D createKernelPor= tletContainerMetaData(kernelPortletContainerId); + AbstractBeanMetaData kernelPortletContainerMD =3D createKernelPor= tletContainerMetaData(kernelPortletContainerId, containerInfo); = - // - AbstractDependencyValueMetaData portletContainerContextDependency= MD =3D new AbstractDependencyValueMetaData(kernelPortletContainerId); - portletContainerContextDependencyMD.setDependentState(ControllerS= tate.INSTANTIATED); - portletContainerMD.getProperties().add(new AbstractPropertyMetaDa= ta("context", portletContainerContextDependencyMD)); - - // - AbstractDependencyValueMetaData portletContainerDependencyMD =3D = new AbstractDependencyValueMetaData(portletContainerId); - portletContainerDependencyMD.setDependentState(ControllerState.ST= ART); - kernelPortletContainerMD.getProperties().add(new AbstractProperty= MetaData("portletContainer", portletContainerDependencyMD)); - - // - AbstractDependencyValueMetaData portletApplicationDependencyMD = =3D new AbstractDependencyValueMetaData(portletApplicationId); - portletApplicationDependencyMD.setDependentState(ControllerState.= START); - portletContainerMD.getProperties().add(new AbstractPropertyMetaDa= ta("application", portletApplicationDependencyMD)); - - // Install the portlet container on the portlet application - AbstractInstallMetaData installPortletContainerMD =3D new Abstrac= tInstallMetaData(); - installPortletContainerMD.setBean(portletApplicationId); - installPortletContainerMD.setParameters(Collections.singletonList= ((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData()))= ); - installPortletContainerMD.setMethodName("addContainer"); - installPortletContainerMD.setDependentState(ControllerState.START= ); - portletContainerMD.getInstalls().add(installPortletContainerMD); - - // Uninstall the portlet container from the portlet application - AbstractInstallMetaData uninstallPortletContainerMD =3D new Abstr= actInstallMetaData(); - uninstallPortletContainerMD.setBean(portletApplicationId); - uninstallPortletContainerMD.setParameters(Collections.singletonLi= st((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData()= ))); - uninstallPortletContainerMD.setMethodName("removeContainer"); - uninstallPortletContainerMD.setDependentState(ControllerState.STA= RT); - kernelPortletContainerMD.getUninstalls().add(uninstallPortletCont= ainerMD); - // Inject the kernel portlet application in the kernel portlet co= ntainer AbstractDependencyValueMetaData kernelPortletApplicationDependenc= yMD =3D new AbstractDependencyValueMetaData(kernelPortletApplicationId); kernelPortletApplicationDependencyMD.setDependentState(Controller= State.START); @@ -266,26 +185,13 @@ kernelPortletContainerMD.getUninstalls().add(uninstallKernelPortl= etContainerMD); = // - toInstall.add(portletContainerMD); toInstall.add(kernelPortletContainerMD); } = // - AbstractBeanMetaData portletApplicationMD =3D createPortletApplicati= onMetaData(builder.getApplication(), portletApplicationId); - AbstractBeanMetaData kernelPortletApplicationMD =3D createKernelPort= letApplicationMetaData(kernelPortletApplicationId); + AbstractBeanMetaData kernelPortletApplicationMD =3D createKernelPort= letApplicationMetaData(builder.getApplication(), kernelPortletApplicationId= ); = // - AbstractDependencyValueMetaData portletApplicationContextDependencyM= D =3D new AbstractDependencyValueMetaData(kernelPortletApplicationId); - portletApplicationContextDependencyMD.setDependentState(ControllerSt= ate.INSTANTIATED); - portletApplicationMD.getProperties().add(new AbstractPropertyMetaDat= a("context", portletApplicationContextDependencyMD)); - - // - AbstractDependencyValueMetaData portletApplicationDependencyMD =3D n= ew AbstractDependencyValueMetaData(portletApplicationId); - portletApplicationDependencyMD.setDependentState(ControllerState.STA= RT); - kernelPortletApplicationMD.getProperties().add(new AbstractPropertyM= etaData("portletApplication", portletApplicationDependencyMD)); - - // - toInstall.add(portletApplicationMD); toInstall.add(kernelPortletApplicationMD); = // Install beans @@ -356,10 +262,6 @@ = // log.debug("Uninstalled"); - - // -// portletApplicationControllerContext =3D null; -// portletContainerControllerContexts =3D null; } = private void logBeanFailure(KernelControllerContext context) --===============0069894541444499242==-- From portal-commits at lists.jboss.org Tue Feb 19 19:03:59 2008 Content-Type: multipart/mixed; boundary="===============2251640609357309006==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10036 - in modules/portlet/trunk/test/src: test/resources/portal/samples/basic-war/WEB-INF and 1 other directories. Date: Tue, 19 Feb 2008 19:03:59 -0500 Message-ID: --===============2251640609357309006== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-19 19:03:59 -0500 (Tue, 19 Feb 2008) New Revision: 10036 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletApplicationDeployment.java modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/W= EB-INF/portlet.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o3.jsp Log: add a couple of stuff Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortletApplicationDeployment.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployment.java 2008-02-19 22:17:41 UTC (rev 10035) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployment.java 2008-02-20 00:03:59 UTC (rev 10036) @@ -155,6 +155,12 @@ List toInstall =3D new ArrayList(); = // + AbstractBeanMetaData kernelPortletApplicationMD =3D createKernelPort= letApplicationMetaData(builder.getApplication(), kernelPortletApplicationId= ); + + // + toInstall.add(kernelPortletApplicationMD); + + // for (ContainerPortletInfo containerInfo : builder.getPortlets()) { // @@ -165,7 +171,7 @@ = // Inject the kernel portlet application in the kernel portlet co= ntainer AbstractDependencyValueMetaData kernelPortletApplicationDependenc= yMD =3D new AbstractDependencyValueMetaData(kernelPortletApplicationId); - kernelPortletApplicationDependencyMD.setDependentState(Controller= State.START); +// kernelPortletApplicationDependencyMD.setDependentState(Controll= erState.START); kernelPortletContainerMD.getProperties().add(new AbstractProperty= MetaData("kernelPortletApplication", kernelPortletApplicationDependencyMD)); = // Install the kernel portlet container on the kernel portlet app= lication @@ -173,7 +179,7 @@ installKernelPortletContainerMD.setBean(kernelPortletApplicationI= d); installKernelPortletContainerMD.setParameters(Collections.singlet= onList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaDa= ta()))); installKernelPortletContainerMD.setMethodName("addKernelPortletCo= ntainer"); - installKernelPortletContainerMD.setDependentState(ControllerState= .START); +// installKernelPortletContainerMD.setState(ControllerState.st); kernelPortletContainerMD.getInstalls().add(installKernelPortletCo= ntainerMD); = // Uninstall the kernel portlet container from the kernel portlet= application @@ -181,19 +187,13 @@ uninstallKernelPortletContainerMD.setBean(kernelPortletApplicatio= nId); uninstallKernelPortletContainerMD.setParameters(Collections.singl= etonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMeta= Data()))); uninstallKernelPortletContainerMD.setMethodName("removeKernelPort= letContainer"); - uninstallKernelPortletContainerMD.setDependentState(ControllerSta= te.START); +// uninstallKernelPortletContainerMD.setState(ControllerState.INST= ANTIATED); kernelPortletContainerMD.getUninstalls().add(uninstallKernelPortl= etContainerMD); = // toInstall.add(kernelPortletContainerMD); } = - // - AbstractBeanMetaData kernelPortletApplicationMD =3D createKernelPort= letApplicationMetaData(builder.getApplication(), kernelPortletApplicationId= ); - - // - toInstall.add(kernelPortletApplicationMD); - // Install beans for (AbstractBeanMetaData beanMetaData : toInstall) { Modified: modules/portlet/trunk/test/src/test/resources/portal/samples/basi= c-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/= WEB-INF/portlet.xml 2008-02-19 22:17:41 UTC (rev 10035) +++ modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/= WEB-INF/portlet.xml 2008-02-20 00:03:59 UTC (rev 10036) @@ -34,7 +34,7 @@ text/html - ExceptionPortlet + Exception portlet = @@ -48,8 +48,22 @@ text/javascript - HeaderPortlet + Header portlet = + + FailDuringInitPortlet + org.jboss.portal.portlet.portal.samples.basic.FailDur= ingInitPortlet + + text/html + + + text/javascript + + + Fail during init portlet + + + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/demo3.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo3.jsp 2008-02-19 22:17:41 UTC (rev 10035) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo3.jsp 2008-02-20 00:03:59 UTC (rev 10036) @@ -14,9 +14,10 @@ + - + = = --===============2251640609357309006==-- From portal-commits at lists.jboss.org Tue Feb 19 19:40:48 2008 Content-Type: multipart/mixed; boundary="===============2708056706837410820==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10037 - in modules/common/trunk/common/src: test/java/org/jboss/portal/test/common/util and 1 other directory. Date: Tue, 19 Feb 2008 19:40:46 -0500 Message-ID: --===============2708056706837410820== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-19 19:40:46 -0500 (Tue, 19 Feb 2008) New Revision: 10037 Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/C= ollectionMap.java modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/L= istMap.java modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/S= etMap.java modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/u= til/CollectionMapTestCase.java Log: - JBPORTAL-1833: SetMap now properly uses comparator, added test case. Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common= /util/CollectionMap.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/= CollectionMap.java 2008-02-20 00:03:59 UTC (rev 10036) +++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/= CollectionMap.java 2008-02-20 00:40:46 UTC (rev 10037) @@ -22,13 +22,14 @@ *************************************************************************= *****/ package org.jboss.portal.common.util; = -import java.util.Map; +import java.io.Serializable; import java.util.Collection; -import java.util.Iterator; import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; import java.util.Set; -import java.io.Serializable; = /** * A map of collections. @@ -41,13 +42,15 @@ = /** The underlying map. */ private final Map> map; + /** An optional comparator. */ + protected Comparator comparator; = public CollectionMap() { map =3D init(null); } = - public CollectionMap(SetMap other) throws IllegalArgumentException + public CollectionMap(CollectionMap other) throws IllegalArgumentE= xception { if (other =3D=3D null) { @@ -56,6 +59,31 @@ map =3D init(other); } = + public CollectionMap(CollectionMap other, Comparator comparato= r) throws IllegalArgumentException + { + this(other); + initComparator(comparator); + } + + public CollectionMap(Comparator comparator) + { + this(); + + initComparator(comparator); + } + + private void initComparator(Comparator comparator) + { + // + if (comparator =3D=3D null) + { + throw new IllegalArgumentException("No null comparator allowed"); + } + + // + this.comparator =3D comparator; + } + /** * Add an object in the set keyed under the specified key. * @@ -78,9 +106,7 @@ add(collection, o); } = - /** - * Return the set of keys. - */ + /** Return the set of keys. */ public final Set keySet() { return map.keySet(); @@ -156,9 +182,7 @@ } } = - /** - * Return the collection specified by the key. - */ + /** Return the collection specified by the key. */ public Collection get(K key) { return map.get(key); @@ -194,10 +218,12 @@ { return iterator.hasNext(); } + public V next() { return iterator.next(); } + public void remove() { iterator.remove(); @@ -232,9 +258,8 @@ protected abstract void add(Collection c, V o); = /** - * Removes an object from the collection. The type of the object to rem= ove is intentionnally - * Object and not the parameterized type = because the Collection - * interface is designed that way. + * Removes an object from the collection. The type of the object to rem= ove is intentionnally Object and + * not the parameterized type because the Collection interface is designed that way. * * @param c the collection to remove from * @param o the object to remove Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common= /util/ListMap.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/= ListMap.java 2008-02-20 00:03:59 UTC (rev 10036) +++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/= ListMap.java 2008-02-20 00:40:46 UTC (rev 10037) @@ -22,12 +22,11 @@ *************************************************************************= *****/ package org.jboss.portal.common.util; = -import java.util.Collection; -import java.util.Comparator; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; +import java.util.Comparator; import java.util.List; -import java.util.Set; = /** * @author Julien Viet @@ -36,9 +35,6 @@ public class ListMap extends CollectionMap { = - /** An optional comparator. */ - protected Comparator comparator; - public ListMap() { } @@ -50,35 +46,15 @@ = public ListMap(SetMap other, Comparator comparator) throws Ill= egalArgumentException { - super(other); - - // - if (comparator =3D=3D null) - { - throw new IllegalArgumentException("No null comparator allowed"); - } - - // - this.comparator =3D comparator; + super(other, comparator); } = public ListMap(Comparator comparator) { - super(); - - // - if (comparator =3D=3D null) - { - throw new IllegalArgumentException("No null comparator allowed"); - } - - // - this.comparator =3D comparator; + super(comparator); } = - /** - * Return the list specified by the key. - */ + /** Return the list specified by the key. */ public List get(K key) { return (List)super.get(key); Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common= /util/SetMap.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/= SetMap.java 2008-02-20 00:03:59 UTC (rev 10036) +++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/= SetMap.java 2008-02-20 00:40:46 UTC (rev 10037) @@ -22,17 +22,15 @@ *************************************************************************= *****/ package org.jboss.portal.common.util; = +import java.util.Collection; +import java.util.Comparator; import java.util.HashSet; import java.util.Set; -import java.util.Comparator; -import java.util.TreeSet; import java.util.SortedSet; -import java.util.Collection; -import java.util.Map; +import java.util.TreeSet; = /** - * A map of set. This object does not handle synchronization and use HashM= ap and HashSet - * as underlying data structures; + * A map of set. This object does not handle synchronization and use HashM= ap and HashSet as underlying data structures; * * @author Julien Viet * @version $Revision: 7322 $ @@ -43,9 +41,6 @@ /** Version. */ static final long serialVersionUID =3D -7239767000556095977L; = - /** An optional comparator. */ - protected Comparator comparator; - public SetMap() { } @@ -83,9 +78,7 @@ this.comparator =3D comparator; } = - /** - * Return the set specified by the key. - */ + /** Return the set specified by the key. */ public Set get(K key) { return (Set)super.get(key); Modified: modules/common/trunk/common/src/test/java/org/jboss/portal/test/c= ommon/util/CollectionMapTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/= util/CollectionMapTestCase.java 2008-02-20 00:03:59 UTC (rev 10036) +++ modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/= util/CollectionMapTestCase.java 2008-02-20 00:40:46 UTC (rev 10037) @@ -28,6 +28,7 @@ import org.jboss.portal.common.util.SetMap; = import java.util.ArrayList; +import java.util.Comparator; import java.util.Iterator; import java.util.List; = @@ -80,6 +81,54 @@ testThrowNPE(new ListMap()); } = + public void testSorting() + { + Comparator comp =3D new Comparator() + { + public int compare(Value o1, Value o2) + { + return o1.i - o2.i; + } + }; + + testComparatorSorting(new ListMap(comp)); + testComparatorSorting(new SetMap(comp)); + } + + private void testComparatorSorting(CollectionMap map) + { + Value v1 =3D new Value(1); + Value v2 =3D new Value(2); + Value v3 =3D new Value(3); + Value v4 =3D new Value(4); + + map.put(k1, v2); + map.put(k1, v4); + map.put(k1, v3); + map.put(k1, v1); + + Iterator iterator =3D map.iterator(k1); + for (int i =3D 0; iterator.hasNext(); i++) + { + Value value =3D iterator.next(); + switch (i) + { + case 0: + assertEquals(v1, value); + break; + case 1: + assertEquals(v2, value); + break; + case 2: + assertEquals(v3, value); + break; + case 3: + assertEquals(v4, value); + break; + } + } + } + private void testNormal(CollectionMap map) { assertFalse(map.contains(k1, v1)); @@ -212,6 +261,22 @@ = private static class Value { + int i; + + private Value() + { + } + + private Value(int i) + { + this.i =3D i; + } + + @Override + public String toString() + { + return "Value " + i; + } } = private static class ValueExt extends Value --===============2708056706837410820==-- From portal-commits at lists.jboss.org Tue Feb 19 21:33:20 2008 Content-Type: multipart/mixed; boundary="===============3345461836955573714==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10038 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Tue, 19 Feb 2008 21:33:20 -0500 Message-ID: --===============3345461836955573714== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-19 21:33:20 -0500 (Tue, 19 Feb 2008) New Revision: 10038 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: minor corrections, with/in etc Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-20 00:40:46 UTC (rev 10037) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-20 02:33:20 UTC (rev 10038) @@ -999,7 +999,7 @@ Introduction - This section describes how to deploy a JSF portlet in JBoss Portal, = using the Apache MyFaces JSF implementation in JBoss AS or JBoss EAP. Befor= e proceeding, download the HelloWorldJSFS= unRIPortlet from = JBoss PortletSwap. + This section describes how to deploy a JSF portlet in JBoss Portal, = using the Apache MyFaces JSF implementation in JBoss AS and JBoss EAP. Befo= re proceeding, download the HelloWorldJSF= SunRIPortlet from JBoss PortletSwap. = @@ -1128,7 +1128,7 @@ Without the faces-config.xml file, the application w= ould work the same outside of the portlet as it would inside a portlet cont= ainer. In this example, a basic user bean, <managed-bean= -name>user</managed-bean-name>, and a navigation = rule are defined, which handle the submission of the original form in the <= filename>HelloWorldJSFSunRIPortlet/WEB-INF/jsp/index.jsp file. - The following is an example of the Faces Servlet section from the HelloWorldJSFSunRIPortlet/WEB-INF/web.x= ml file: + The following is an example of the Faces Servlet and Faces Servlet Mapping section= s from the HelloWorldJSFSunRIPortlet/WEB-INF/web.xml f= ile: - - *.jsf]]> - - - - For the Sun JSF RI, this definition is mandatory to associate files with= .jsf extensions with the Apache MyFaces servlet. - - - - + For Sun JSF RI portlets, the Faces Servlet and Faces Servlet Mapping sections are = required to associate files with the .jsf extension to= the Apache MyFaces servlet. Classes for the JSF-Portlet bridge are not included - Unlike Apache MyFaces, the classes for the JSF-Portlet bridge are not i= ncluded with the JSF implementation, JBoss AS, or JBoss EAP. This library m= ust be available in your application package. Navigate to the JSF-Po= rtlet bridge webpage to download the JSF-Portlet bridge library. + Unlike Apache MyFaces, the classes for the JSF-Portlet bridge are not i= ncluded in the JSF implementation, JBoss AS, or JBoss EAP. This library mus= t be available in your application package. Navigate to the JSF-Port= let bridge webpage to download the JSF-Portlet bridge library. @@ -1337,7 +1327,7 @@ Introduction - This section describes how to deploy a JSF portlet in JBoss Portal, = using the Apache MyFaces JSF implementation in JBoss AS or JBoss EAP. Befor= e proceeding, download the HelloWorld= JSFMyFaces42Portlet from JBoss PortletSwap. + This section describes how to deploy a JSF portlet in JBoss Portal, = using the Apache MyFaces JSF implementation in JBoss AS and JBoss EAP. Befo= re proceeding, download the HelloWorl= dJSFMyFaces42Portlet from JBoss PortletSwap. Apache MyFaces can be used globally for the entire server, replacing= the Sun JSF RI libraries, but the HelloWorldJSFMyFaces42Portlet uses its o= wn libraries, and will not affect the application server. --===============3345461836955573714==-- From portal-commits at lists.jboss.org Tue Feb 19 22:19:56 2008 Content-Type: multipart/mixed; boundary="===============7947300385877022791==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10039 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Tue, 19 Feb 2008 22:19:54 -0500 Message-ID: --===============7947300385877022791== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-19 22:19:54 -0500 (Tue, 19 Feb 2008) New Revision: 10039 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescr= iptors.xml Log: start minor revisions for 6.1. Changes from previous releases Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/x= mldescriptors.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-20 02:33:20 UTC (rev 10038) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-20 03:19:54 UTC (rev 10039) @@ -9,33 +9,38 @@ XML Descriptors - Changes since previous releases - The previous releases of JBoss Portal did not have an external= schema to validate the various XML - descriptors although it was internally validated by the portal. Sinc= e 2.6 we have worked on providing - Document Type Definition (DTD) for the various descriptors. The DTD = validation will be only effective - if you XML descriptors declares it like that: - + Changes from previous releases + The previous releases of JBoss Portal did not have an external= schema to validate the various XML descriptors; however, it was internally= validated by the portal. Since JBoss Portal 2.6, a Document Type Definitio= n (DTD) has been provided to validate descriptors. + + + To use the DTD, add the following declaration to the start of the d= esired descriptors: + + + -...]]> - If you do not perform the declaration then the previous mechan= ism will be used. The main difference - between using the DTD and not is that the additional DTD validation = is more strict specifically on the order - of the XML elements. The following example will be accepted without = the DTD declaration and will not with the DTD - declaration: - - - overwrite - default.default - ... -]]> - The correct descriptor is rather: - - - default.default - overwrite - ... -]]> +"http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">]]> + + + + If you do not use the DTD declaration, the previous mechanism for XML va= lidation will be used. The DTD is more strict, specifically with the order = of the XML elements. For example, the following will be valid if you are no= t using the DTD, but will be rejected if you are: + + +overwrite +default.default]]> + + + + The correct element order, and one which would be valid against th= e DTD, would be as follows: + + +default.default +overwrite]]> + + The various DTD available are: For -object.xml descriptors: "-//JBoss Portal//DTD Port= al Object 2.6//EN" --===============7947300385877022791==-- From portal-commits at lists.jboss.org Wed Feb 20 00:45:07 2008 Content-Type: multipart/mixed; boundary="===============4143424570026071761==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10040 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Wed, 20 Feb 2008 00:45:06 -0500 Message-ID: --===============4143424570026071761== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-20 00:45:06 -0500 (Wed, 20 Feb 2008) New Revision: 10040 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescr= iptors.xml Log: minor revisions/rephrasing 6.1. Changes from previous releases Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/x= mldescriptors.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-20 03:19:54 UTC (rev 10039) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-20 05:45:06 UTC (rev 10040) @@ -24,7 +24,7 @@ - If you do not use the DTD declaration, the previous mechanism for XML va= lidation will be used. The DTD is more strict, specifically with the order = of the XML elements. For example, the following will be valid if you are no= t using the DTD, but will be rejected if you are: + If you do not use the DTD declaration, the previous mechanism for XML va= lidation will be used. The DTD is more strict, specifically with the order = of XML elements. The following is an example from a *-object.xml<= /filename> descriptor, which will be valid if you are not using the DTD, bu= t will be rejected if you are: overwrite]]> - The various DTD available are: + + The following DTDs are available: + + - For -object.xml descriptors: "-//JBoss Portal//DTD Port= al Object 2.6//EN" - For jboss-app.xml descriptors: "-//JBoss Portal//DTD JB= oss Web Application 2.6//EN" - For jboss-portlet.xml descriptors: "-//JBoss Portal//DT= D JBoss Portlet 2.6//EN" - For portlet-instances.xml descriptors: "-//JBoss Portal= //DTD Portlet Instances 2.6//EN" + + + for -object.xml descriptors: "-//JBoss= Portal//DTD Portal Object 2.6//EN" + + + + + for jboss-app.xml descriptors: "-//JBo= ss Portal//DTD JBoss Web Application 2.6//EN" + + + + + for jboss-portlet.xml descriptors: "-/= /JBoss Portal//DTD JBoss Portlet 2.6//EN" + + + + + for portlet-instances.xml descriptors: "-//JBoss Portal//DTD Portlet Instances 2.6//EN" + + - Those files are available in the jboss-portal.sar/dt= d/ folder + + + The files for the DTDs are located in the $JBOSS_HOME/server/configuration/deploy/jboss-portal.sar/dtd/ directory. + JBoss Portlet DTD --===============4143424570026071761==-- From portal-commits at lists.jboss.org Wed Feb 20 02:49:08 2008 Content-Type: multipart/mixed; boundary="===============4567403435021048883==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10041 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Wed, 20 Feb 2008 02:49:08 -0500 Message-ID: --===============4567403435021048883== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-20 02:49:06 -0500 (Wed, 20 Feb 2008) New Revision: 10041 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescr= iptors.xml Log: 6.1.1. The JBoss Portlet DTD replacing itemizedlist with variablelist *** this will break the book until later commits *** Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/x= mldescriptors.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-20 05:45:06 UTC (rev 10040) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-20 07:49:06 UTC (rev 10041) @@ -72,59 +72,83 @@ The files for the DTDs are located in the $JBOSS_HOME/server/configuration/deploy/jboss-portal.sar/dtd/ directory. - JBoss Portlet DTD + The JBoss Portlet DTD - + The following list refers to elements found in the JBoss Portlet DTD, <= filename>$JBOSS_HOME/server/configuration/deploy= /jboss-portal.sar/dtd/jboss-portlet_version_number.dtd: + + + + ]]> + - -Element ]]> - - - -Element ]]> - + Use the remotable element to configure = the default behavior of portlets with respect to WSRP exposure: if no value= is given, the value is either the value globally defined at the portlet ap= plication level, or false. Accepted values are true and false. = + + + You can configure specific settings for the portlet container for each p= ortlet defined in the WEB-INF/portlet.xml file. Use th= e service element to inject services into = the portlet context of applications. + + + +]]> + + + + Additional configuration for a portlet. The portlet-name= element defines the portlet name. It must match a portlet= defined in the WEB-INF/portlet.xml file for that appl= ication. + + + Use the remotable element to configure = the default behavior of portlets with respect to WSRP exposure: if no value= is given, the value is either the value globally defined at the portlet ap= plication level, or false. Accepted values are true and false. + + + The trans-attribute element specifies t= he behavior of the portlet when it is invoked at runtime, with respect to t= he transactionnal context. Depending on how the portlet is +invoked, a transaction may or may not exist before the portlet is invoked.= The portal transaction is usually present in the local context. By default= , the value is NotSupported, which means t= hat the portal transaction will be suspended for the duration of the portle= t invocation. + + + The following example uses the portlet-name, remotable, and trans= -attribute elements: + + + MyPortlet true Required -]]> - - +]]> + + + + +]]> - - - + + + + The portlet name. + + + +]]> - - - + + + + Use the remotable element to configure = the default behavior of portlets with respect to WSRP exposure: if no value= is given, the value is either the value globally defined at the portlet ap= plication level, or false. Accepted values are true and false. + + + +]]> - + + + Use the ajax element to configure the A= synchronous JavaScript and XML (AJAX) capabilities of the portlet. If a por= tlet uses the true value for the partial-refresh element, then the portal uses parti= al page refreshing, and only renders that portlet. If the p= artial-refresh element uses a false value, the portal uses a full-page refresh when the portlet is r= efreshed. + + + + = + = + = + The ajax tag allows to configure the ajax capabilities of the portlet. If the portlet is tagged as partial-refresh then the portal may use partial p= age refreshing and render only that portlet. If the portlet partial-refresh va= lue is false, then the portal will perform a full page refresh when the portle= t is refreshed.]]> --===============4567403435021048883==-- From portal-commits at lists.jboss.org Wed Feb 20 03:23:53 2008 Content-Type: multipart/mixed; boundary="===============4934105744121718571==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10042 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Wed, 20 Feb 2008 03:23:53 -0500 Message-ID: --===============4934105744121718571== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-20 03:23:52 -0500 (Wed, 20 Feb 2008) New Revision: 10042 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescr= iptors.xml Log: revising 6.1.1. The JBoss Portlet DTD replacing itemizedlist with variablelist *** this will break the book until later commits *** Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/x= mldescriptors.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-20 07:49:06 UTC (rev 10041) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-20 08:23:52 UTC (rev 10042) @@ -145,55 +145,75 @@ - = - = - = - The ajax tag allows to configure the ajax capabilities of the portlet. If -the portlet is tagged as partial-refresh then the portal may use partial p= age -refreshing and render only that portlet. If the portlet partial-refresh va= lue -is false, then the portal will perform a full page refresh when the portle= t is refreshed.]]> - - -Element ]]> - - - +]]> + + + + The authorized values for the partial-refresh element are true or false. + + + +]]> - + + + This element configure the portlet session of the portlet. The distribut= ed element instructs the container to distribute the session attributes usi= ng the portal session replication. It applies only to local portlets are no= t to remote portlets. The default value is false. + + + For example: + + + true -]]> - - +]]> + + + + +]]> - - - + + + + The authorized values for the distributed element are true or false. + + + +]]> - + + + Defines how the portlet behaves with the transactionnal context. The def= ault value is Never. + + + For example: + + + Required -]]> - - +]]> + + + + +]]> -= - - + + + + The trans-attribute value defines the transactionnal behavior. The accep= ted values are Required, Mandatory, Never, Supports, NotSupported and Requi= resNew. + + + +]]> + + --===============4934105744121718571==-- From portal-commits at lists.jboss.org Wed Feb 20 03:49:47 2008 Content-Type: multipart/mixed; boundary="===============4931587632248473903==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10043 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Wed, 20 Feb 2008 03:49:47 -0500 Message-ID: --===============4931587632248473903== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-20 03:49:47 -0500 (Wed, 20 Feb 2008) New Revision: 10043 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescr= iptors.xml Log: 6.1.1. The JBoss Portlet DTD finished changing itemizedlist to variablelist Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/x= mldescriptors.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-20 08:23:52 UTC (rev 10042) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-20 08:49:47 UTC (rev 10043) @@ -119,7 +119,7 @@ ]]> +]]> @@ -128,7 +128,7 @@ ]]> +]]> @@ -137,7 +137,7 @@ ]]> +]]> @@ -155,7 +155,7 @@ ]]> +]]> @@ -174,7 +174,7 @@ ]]> +]]> @@ -183,7 +183,7 @@ ]]> +]]> @@ -202,7 +202,7 @@ ]]> +]]> @@ -211,62 +211,102 @@ ]]> +]]> - - - - -Element ]]> - - - -Element ]]> - - - -Element ]]> - - - + + + Specify content which should be included in the portal aggregated page w= hen the portlet +is present on that page. This setting only applies when the portlet is use= d in the local mode. + + + +]]> + + + + No content is allowed inside an link element. + + + +]]> + + + + The script header element can contain inline script definitions. + + + +]]> + + + + No content is allowed for meta element. + + + +]]> - + + + Declare a service that will be injected by the portlet container as an a= ttribute of the portlet context. + + + For example: + + + UserModule org.jboss.portal.identity.UserModule :service=3DModule,type=3DUser - - -In the portlet it is then possible to use it by doing a lookup on the serv= ice -name, for example in the init() lifecycle method : - +]]> + + + In the portlet it is then possible to use it by doing a lookup on t= he service name, for example in the init() lifecycle method : + + + - - -Element ]]> - - - -Element ]]> - - - -Element ]]> - - - - +}]]> + + + + +]]> + + + + The service name that will be used to bind the service as a portlet cont= ext attribute. + + + +]]> + + + + The full qualified name of the interface that the service implements. + + + +]]> + + + + The reference to the service. In the JMX Microkernel environment it cons= ist of the JMX name of the service MBean. For an MBean reference if the dom= ain is left out, then the current domain of the portal will be used. + + + + +
    Portlet Instance DTD --===============4931587632248473903==-- From portal-commits at lists.jboss.org Wed Feb 20 06:56:13 2008 Content-Type: multipart/mixed; boundary="===============4533448562051613347==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10044 - in modules/portlet/trunk/docs: user-guide and 1 other directory. Date: Wed, 20 Feb 2008 06:56:13 -0500 Message-ID: --===============4533448562051613347== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-20 06:56:12 -0500 (Wed, 20 Feb 2008) New Revision: 10044 Added: modules/portlet/trunk/docs/pom.xml modules/portlet/trunk/docs/user-guide/pom.xml Removed: modules/portlet/trunk/docs/common/ modules/portlet/trunk/docs/user-guide/build.xml Log: use maven support for docbook Added: modules/portlet/trunk/docs/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/docs/pom.xml (rev 0) +++ modules/portlet/trunk/docs/pom.xml 2008-02-20 11:56:12 UTC (rev 10044) @@ -0,0 +1,20 @@ + + 4.0.0 + + org.jboss.portal.portlet + module-parent + 2.0-Beta1 + ../build/pom.xml + + docs-aggregator + pom + JBoss Portal Portlet Docs Aggregator + 2.0-Beta1 + http://labs.jboss.com/jbossportal + + + user-guide + + + Deleted: modules/portlet/trunk/docs/user-guide/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/docs/user-guide/build.xml 2008-02-20 08:49:47 UTC= (rev 10043) +++ modules/portlet/trunk/docs/user-guide/build.xml 2008-02-20 11:56:12 UTC= (rev 10044) @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - Added: modules/portlet/trunk/docs/user-guide/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/docs/user-guide/pom.xml (= rev 0) +++ modules/portlet/trunk/docs/user-guide/pom.xml 2008-02-20 11:56:12 UTC (= rev 10044) @@ -0,0 +1,68 @@ + + + 4.0.0 + + + org.jboss + documentation + 1.0 + + org.jboss.portal.portlet + user-guide-${translation} + 2.0-Beta1 + jdocbook + User_Guide_(${translation}) + + + + + repository.jboss.org + JBoss Repository + default + http://repository.jboss.org/maven2/ + + false + + + + snapshots.jboss.org + JBoss Snapshots Repository + default + http://snapshots.jboss.org/maven2/ + + true + + + false + + + + + + + repository.jboss.org + JBoss Repository + default + http://repository.jboss.org/maven2/ + + false + + + + snapshots.jboss.org + JBoss Snapshots Repository + default + http://snapshots.jboss.org/maven2/ + + true + + + false + + + + = + + --===============4533448562051613347==-- From portal-commits at lists.jboss.org Wed Feb 20 06:59:56 2008 Content-Type: multipart/mixed; boundary="===============7222249326408823872==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10045 - modules/portlet/trunk/docs. Date: Wed, 20 Feb 2008 06:59:56 -0500 Message-ID: --===============7222249326408823872== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-20 06:59:56 -0500 (Wed, 20 Feb 2008) New Revision: 10045 Modified: modules/portlet/trunk/docs/ Log: disable docbook-support externals Property changes on: modules/portlet/trunk/docs ___________________________________________________________________ Name: svn:externals - docbook-support http://anonsvn.jboss.org/repos/portal/tools/docbook/su= pport/ docbook-support/styles http://anonsvn.jboss.org/repos/portal/tools/docbook/= styles/renaissance/ + = --===============7222249326408823872==-- From portal-commits at lists.jboss.org Wed Feb 20 07:01:09 2008 Content-Type: multipart/mixed; boundary="===============8871841544932227575==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10046 - modules/portlet/trunk/docs. Date: Wed, 20 Feb 2008 07:01:08 -0500 Message-ID: --===============8871841544932227575== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-20 07:01:08 -0500 (Wed, 20 Feb 2008) New Revision: 10046 Modified: modules/portlet/trunk/docs/ Log: disable docbook-support externals Property changes on: modules/portlet/trunk/docs ___________________________________________________________________ Name: svn:externals - = --===============8871841544932227575==-- From portal-commits at lists.jboss.org Wed Feb 20 07:03:45 2008 Content-Type: multipart/mixed; boundary="===============7211371671764329986==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10047 - modules/portlet/trunk. Date: Wed, 20 Feb 2008 07:03:44 -0500 Message-ID: --===============7211371671764329986== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-20 07:03:43 -0500 (Wed, 20 Feb 2008) New Revision: 10047 Modified: modules/portlet/trunk/pom.xml Log: add docs to maven build Modified: modules/portlet/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/pom.xml 2008-02-20 12:01:08 UTC (rev 10046) +++ modules/portlet/trunk/pom.xml 2008-02-20 12:03:43 UTC (rev 10047) @@ -34,6 +34,7 @@ federation management test + docs = --===============7211371671764329986==-- From portal-commits at lists.jboss.org Wed Feb 20 07:14:27 2008 Content-Type: multipart/mixed; boundary="===============4187082749419983178==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10048 - in modules/test/trunk: docs and 1 other directories. Date: Wed, 20 Feb 2008 07:14:26 -0500 Message-ID: --===============4187082749419983178== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-20 07:14:26 -0500 (Wed, 20 Feb 2008) New Revision: 10048 Added: modules/test/trunk/docs/pom.xml modules/test/trunk/docs/user-guide/pom.xml Removed: modules/test/trunk/docs/user-guide/build.xml Modified: modules/test/trunk/docs/ modules/test/trunk/pom.xml Log: use maven to build docbook Property changes on: modules/test/trunk/docs ___________________________________________________________________ Name: svn:externals - docbook-support http://anonsvn.jboss.org/repos/portal/tools/docbook/su= pport/ docbook-support/styles http://anonsvn.jboss.org/repos/portal/tools/docbook/= styles/renaissance/ Added: modules/test/trunk/docs/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/docs/pom.xml (rev 0) +++ modules/test/trunk/docs/pom.xml 2008-02-20 12:14:26 UTC (rev 10048) @@ -0,0 +1,20 @@ + + 4.0.0 + + org.jboss.unit + module-parent + 1.2.0-Beta1 + ../build/pom.xml + + docs-aggregator + pom + JBoss Portal Portlet Docs Aggregator + 1.2.0-Beta1 + http://labs.jboss.com/jbossportal + + + user-guide + + + Deleted: modules/test/trunk/docs/user-guide/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/docs/user-guide/build.xml 2008-02-20 12:03:43 UTC (r= ev 10047) +++ modules/test/trunk/docs/user-guide/build.xml 2008-02-20 12:14:26 UTC (r= ev 10048) @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - = - - - Added: modules/test/trunk/docs/user-guide/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/docs/user-guide/pom.xml (rev= 0) +++ modules/test/trunk/docs/user-guide/pom.xml 2008-02-20 12:14:26 UTC (rev= 10048) @@ -0,0 +1,67 @@ + + + 4.0.0 + + + org.jboss + documentation + 1.0 + + + + + repository.jboss.org + JBoss Repository + default + http://repository.jboss.org/maven2/ + + false + + + + snapshots.jboss.org + JBoss Snapshots Repository + default + http://snapshots.jboss.org/maven2/ + + true + + + false + + + + + + + repository.jboss.org + JBoss Repository + default + http://repository.jboss.org/maven2/ + + false + + + + snapshots.jboss.org + JBoss Snapshots Repository + default + http://snapshots.jboss.org/maven2/ + + true + + + false + + + + = + org.jboss.unit + user-guide-${translation} + 1.2.0-SNAPSHOT + jdocbook + User_Guide_(${translation}) + + Modified: modules/test/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/pom.xml 2008-02-20 12:03:43 UTC (rev 10047) +++ modules/test/trunk/pom.xml 2008-02-20 12:14:26 UTC (rev 10048) @@ -35,7 +35,8 @@ test/opends test/generic test/jboss - test/agent + test/agent + docs = --===============4187082749419983178==-- From portal-commits at lists.jboss.org Wed Feb 20 07:16:50 2008 Content-Type: multipart/mixed; boundary="===============2420835759917837734==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10049 - modules/test/trunk/docs/user-guide. Date: Wed, 20 Feb 2008 07:16:50 -0500 Message-ID: --===============2420835759917837734== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-20 07:16:50 -0500 (Wed, 20 Feb 2008) New Revision: 10049 Modified: modules/test/trunk/docs/user-guide/pom.xml Log: formatting Modified: modules/test/trunk/docs/user-guide/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/docs/user-guide/pom.xml 2008-02-20 12:14:26 UTC (rev= 10048) +++ modules/test/trunk/docs/user-guide/pom.xml 2008-02-20 12:16:50 UTC (rev= 10049) @@ -59,9 +59,9 @@ = org.jboss.unit - user-guide-${translation} - 1.2.0-SNAPSHOT - jdocbook - User_Guide_(${translation}) + user-guide-${translation} + 1.2.0-SNAPSHOT + jdocbook + User_Guide_(${translation}) = --===============2420835759917837734==-- From portal-commits at lists.jboss.org Wed Feb 20 08:07:19 2008 Content-Type: multipart/mixed; boundary="===============4502570285123444493==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10050 - in docs/branches/JBoss_Portal_Branch_2_6: quickstartuser and 2 other directories. Date: Wed, 20 Feb 2008 08:07:19 -0500 Message-ID: --===============4502570285123444493== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-20 08:07:19 -0500 (Wed, 20 Feb 2008) New Revision: 10050 Added: docs/branches/JBoss_Portal_Branch_2_6/pom.xml docs/branches/JBoss_Portal_Branch_2_6/quickstartuser/pom.xml docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/pom.xml docs/branches/JBoss_Portal_Branch_2_6/userGuide/pom.xml Log: add maven build Added: docs/branches/JBoss_Portal_Branch_2_6/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/pom.xml (= rev 0) +++ docs/branches/JBoss_Portal_Branch_2_6/pom.xml 2008-02-20 13:07:19 UTC (= rev 10050) @@ -0,0 +1,16 @@ + + 4.0.0 + org.jboss.portal + docs-aggregator + pom + JBoss Portal Docs Aggregator + 2.6.4- + + + userGuide + referenceGuide + quickstartuser + + + Added: docs/branches/JBoss_Portal_Branch_2_6/quickstartuser/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/quickstartuser/pom.xml = (rev 0) +++ docs/branches/JBoss_Portal_Branch_2_6/quickstartuser/pom.xml 2008-02-20= 13:07:19 UTC (rev 10050) @@ -0,0 +1,67 @@ + + + 4.0.0 + + + org.jboss + documentation + 1.0 + + + + + repository.jboss.org + JBoss Repository + default + http://repository.jboss.org/maven2/ + + false + + + + snapshots.jboss.org + JBoss Snapshots Repository + default + http://snapshots.jboss.org/maven2/ + + true + + + false + + + + + + + repository.jboss.org + JBoss Repository + default + http://repository.jboss.org/maven2/ + + false + + + + snapshots.jboss.org + JBoss Snapshots Repository + default + http://snapshots.jboss.org/maven2/ + + true + + + false + + + + = + org.jboss.portal + quickstartuser-${translation} + 2.6.4 + jdocbook + Quick_Start_User_(${translation}) + + Added: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/pom.xml = (rev 0) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/pom.xml 2008-02-20= 13:07:19 UTC (rev 10050) @@ -0,0 +1,67 @@ + + + 4.0.0 + + + org.jboss + documentation + 1.0 + + + + + repository.jboss.org + JBoss Repository + default + http://repository.jboss.org/maven2/ + + false + + + + snapshots.jboss.org + JBoss Snapshots Repository + default + http://snapshots.jboss.org/maven2/ + + true + + + false + + + + + + + repository.jboss.org + JBoss Repository + default + http://repository.jboss.org/maven2/ + + false + + + + snapshots.jboss.org + JBoss Snapshots Repository + default + http://snapshots.jboss.org/maven2/ + + true + + + false + + + + = + org.jboss.portal + referenceGuide-${translation} + 2.6.4 + jdocbook + Reference_Guide_(${translation}) + + Added: docs/branches/JBoss_Portal_Branch_2_6/userGuide/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/userGuide/pom.xml = (rev 0) +++ docs/branches/JBoss_Portal_Branch_2_6/userGuide/pom.xml 2008-02-20 13:0= 7:19 UTC (rev 10050) @@ -0,0 +1,67 @@ + + + 4.0.0 + + + org.jboss + documentation + 1.0 + + + + + repository.jboss.org + JBoss Repository + default + http://repository.jboss.org/maven2/ + + false + + + + snapshots.jboss.org + JBoss Snapshots Repository + default + http://snapshots.jboss.org/maven2/ + + true + + + false + + + + + + + repository.jboss.org + JBoss Repository + default + http://repository.jboss.org/maven2/ + + false + + + + snapshots.jboss.org + JBoss Snapshots Repository + default + http://snapshots.jboss.org/maven2/ + + true + + + false + + + + = + org.jboss.portal + user-guide-${translation} + 2.6.4 + jdocbook + User_Guide_(${translation}) + + --===============4502570285123444493==-- From portal-commits at lists.jboss.org Wed Feb 20 12:04:09 2008 Content-Type: multipart/mixed; boundary="===============2731923582267823857==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10051 - in branches/presentation: presentation and 4 other directories. Date: Wed, 20 Feb 2008 12:04:09 -0500 Message-ID: --===============2731923582267823857== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sohil.shah(a)jboss.com Date: 2008-02-20 12:04:09 -0500 (Wed, 20 Feb 2008) New Revision: 10051 Added: branches/presentation/presentation/src/main/org/jboss/portal/presentatio= n/test/ajax/JBossUnitSandBox.java branches/presentation/presentation/src/resources/jboss-unit/ branches/presentation/presentation/src/resources/jboss-unit/config/ branches/presentation/presentation/src/resources/jboss-unit/config/jboss= -unit.xml Modified: branches/presentation/ branches/presentation/presentation/build.xml Log: starting jboss-unit based test cases Property changes on: branches/presentation ___________________________________________________________________ Name: svn:ignore - thirdparty .classpath .project .settings core-samples cms core-admin core-cms search workflow presentation-samples + thirdparty .classpath .project .settings core-samples cms core-admin core-cms search workflow presentation-samples bin Modified: branches/presentation/presentation/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/presentation/presentation/build.xml 2008-02-20 13:07:19 UTC (r= ev 10050) +++ branches/presentation/presentation/build.xml 2008-02-20 17:04:09 UTC (r= ev 10051) @@ -93,10 +93,13 @@ - - - - + + + + + + + = @@ -322,5 +325,14 @@ - + = + + + + + = + + + + Added: branches/presentation/presentation/src/main/org/jboss/portal/present= ation/test/ajax/JBossUnitSandBox.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/ajax/JBossUnitSandBox.java (rev 0) +++ branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/ajax/JBossUnitSandBox.java 2008-02-20 17:04:09 UTC (rev 10051) @@ -0,0 +1,38 @@ +/*************************************************************************= ***** + * 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.presentation.test.ajax; + +import org.jboss.unit.api.pojo.annotations.Test; + +/** + * @author Sohil Shah + * + */ +public class JBossUnitSandBox = +{ + @Test + public void test() + { + System.out.println("Simple JBossUnit Test in the PresentationFramework s= uccessfully executed...."); + } +} Added: branches/presentation/presentation/src/resources/jboss-unit/config/j= boss-unit.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/presentation/presentation/src/resources/jboss-unit/config/jbos= s-unit.xml (rev 0) +++ branches/presentation/presentation/src/resources/jboss-unit/config/jbos= s-unit.xml 2008-02-20 17:04:09 UTC (rev 10051) @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file --===============2731923582267823857==-- From portal-commits at lists.jboss.org Wed Feb 20 19:36:58 2008 Content-Type: multipart/mixed; boundary="===============4106476951145493082==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10052 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Wed, 20 Feb 2008 19:36:58 -0500 Message-ID: --===============4106476951145493082== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-20 19:36:58 -0500 (Wed, 20 Feb 2008) New Revision: 10052 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescr= iptors.xml Log: 6.1.1. The JBoss Portlet DTD revisions, minor corrections. *** this will break the book until later commits *** Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/x= mldescriptors.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-20 17:04:09 UTC (rev 10051) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-21 00:36:58 UTC (rev 10052) @@ -69,7 +69,7 @@ - The files for the DTDs are located in the $JBOSS_HOME/server/configuration/deploy/jboss-portal.sar/dtd/ directory. + The DTDs are located in the $JBOSS_HOME/server/con= figuration/deploy/jboss-portal.sar/dtd/ directory. The JBoss Portlet DTD @@ -83,29 +83,29 @@ - Use the remotable element to configure = the default behavior of portlets with respect to WSRP exposure: if no value= is given, the value is either the value globally defined at the portlet ap= plication level, or false. Accepted values are true and false. = + Use the remotable element to configure = the default behavior of portlets with respect to WSRP exposure: if no value= is given, the value is either the value globally defined at the portlet ap= plication level, or false. Accepted values= are true and false. = - You can configure specific settings for the portlet container for each p= ortlet defined in the WEB-INF/portlet.xml file. Use th= e service element to inject services into = the portlet context of applications. + You can configure specific settings for the portlet container for each p= ortlet defined in the WEB-INF/portlet.xml file. Use th= e <service> element to inject servic= es into the portlet context of applications. ]]> + ]]> - Additional configuration for a portlet. The portlet-name= element defines the portlet name. It must match a portlet= defined in the WEB-INF/portlet.xml file for that appl= ication. + Additional configuration for the portlet. The <portle= t-name> element defines the portlet name. It must match= a portlet defined in the WEB-INF/portlet.xml file for= that application. - Use the remotable element to configure = the default behavior of portlets with respect to WSRP exposure: if no value= is given, the value is either the value globally defined at the portlet ap= plication level, or false. Accepted values are true and false. + Use the <remotable> element to co= nfigure the default behavior of portlets with respect to WSRP exposure: if = no value is given, the value is either the value globally defined at the po= rtlet application level, or false. Accepte= d values are true and fals= e. - The trans-attribute element specifies t= he behavior of the portlet when it is invoked at runtime, with respect to t= he transactionnal context. Depending on how the portlet is + The <trans-attribute> element spe= cifies the behavior of the portlet when it is invoked at runtime, with resp= ect to the transactionnal context. Depending on how the portlet is invoked, a transaction may or may not exist before the portlet is invoked.= The portal transaction is usually present in the local context. By default= , the value is NotSupported, which means t= hat the portal transaction will be suspended for the duration of the portle= t invocation. - The following example uses the portlet-name, remotable, and trans= -attribute elements: + The following example uses the <portlet-name>, <remotable>, and <trans-attribute> elements: ]]> +]]> @@ -128,20 +128,20 @@ ]]> +]]> - Use the remotable element to configure = the default behavior of portlets with respect to WSRP exposure: if no value= is given, the value is either the value globally defined at the portlet ap= plication level, or false. Accepted values are true and false. + Use the <remotable> element to co= nfigure the default behavior of portlets with respect to WSRP exposure: if = no value is given, the value is either the value globally defined at the po= rtlet application level, or false. Accepte= d values are true and fals= e. ]]> +]]> - Use the ajax element to configure the A= synchronous JavaScript and XML (AJAX) capabilities of the portlet. If a por= tlet uses the true value for the partial-refresh element, then the portal uses parti= al page refreshing, and only renders that portlet. If the p= artial-refresh element uses a false value, the portal uses a full-page refresh when the portlet is r= efreshed. + Use the ajax element to configure the A= synchronous JavaScript and XML (AJAX) capabilities of the portlet. If a por= tlet uses the true value for the <partial-refresh> element, the portal uses pa= rtial page refreshing and only renders that portlet. If the <partial-refresh> element uses a fa= lse value, the portal uses a full-page refresh when the po= rtlet is refreshed. @@ -150,15 +150,16 @@ - The authorized values for the partial-refresh element are true or false. + If a portlet uses the true value for th= e <partial-refresh> element, the por= tal uses partial page refreshing and only renders that portlet. If the <partial-refresh> element uses a false value, the portal uses a full-page refresh = when the portlet is refreshed. ]]> +]]> + The <session-config> This element configure the portlet session of the portlet. The distribut= ed element instructs the container to distribute the session attributes usi= ng the portal session replication. It applies only to local portlets are no= t to remote portlets. The default value is false. @@ -248,7 +249,7 @@ ]]> +]]> --===============4106476951145493082==-- From portal-commits at lists.jboss.org Wed Feb 20 20:56:09 2008 Content-Type: multipart/mixed; boundary="===============6383047516141169741==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10053 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Wed, 20 Feb 2008 20:56:09 -0500 Message-ID: --===============6383047516141169741== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-20 20:56:09 -0500 (Wed, 20 Feb 2008) New Revision: 10053 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescr= iptors.xml Log: 6.1.1. JBoss Portlet DTD revising *** this will break the book until later commits *** Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/x= mldescriptors.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-21 00:36:58 UTC (rev 10052) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-21 01:56:09 UTC (rev 10053) @@ -83,7 +83,7 @@ - Use the remotable element to configure = the default behavior of portlets with respect to WSRP exposure: if no value= is given, the value is either the value globally defined at the portlet ap= plication level, or false. Accepted values= are true and false. = + Use the <remotable> element to co= nfigure the default behavior of portlets with respect to WSRP exposure: if = no value is given, the value is either the value globally defined at the po= rtlet application level, or false. Accepte= d values are true and fals= e. = You can configure specific settings for the portlet container for each p= ortlet defined in the WEB-INF/portlet.xml file. Use th= e <service> element to inject servic= es into the portlet context of applications. @@ -102,7 +102,7 @@ The <trans-attribute> element spe= cifies the behavior of the portlet when it is invoked at runtime, with resp= ect to the transactionnal context. Depending on how the portlet is -invoked, a transaction may or may not exist before the portlet is invoked.= The portal transaction is usually present in the local context. By default= , the value is NotSupported, which means t= hat the portal transaction will be suspended for the duration of the portle= t invocation. + invoked, a transaction may or may not exist before the portlet is invoke= d. The portal transaction is usually present in the local context. By defau= lt, the value is NotSupported, which means= that the portal transaction will be suspended for the duration of the port= let invocation. Accepted values are Required, Mandatory, Never, Supports, Not= Supported, and RequiresNew. The following example uses the <portlet-name>, <remotable>, and <trans-attribute> elements: @@ -159,11 +159,10 @@ - The <session-config> - This element configure the portlet session of the portlet. The distribut= ed element instructs the container to distribute the session attributes usi= ng the portal session replication. It applies only to local portlets are no= t to remote portlets. The default value is false. + The <session-config> configures t= he portlet session of the portlet. The <distributed><= /computeroutput> element instructs the container to distribute the session = attributes using the portal session replication. This only applies to local= portlets, not remote portlets. Accepted values are true and false. The default valu= e is false. - For example: + The following is an example of the <session-config>= ; and <distributed>= elements: = - The authorized values for the distributed element are true or false. + The <distributed> element instruc= ts the container to distribute the session attributes using the portal sess= ion replication. This only applies to local portlets, not remote portlets. = Accepted values are true and false. The default value is false. @@ -188,10 +187,10 @@ - Defines how the portlet behaves with the transactionnal context. The def= ault value is Never. + Define how the portlet behaves with the transactionnal context. The <trans-attribute> element specifies the = behavior of the portlet when it is invoked at runtime, with respect to the = transactionnal context. Depending on how the portlet is invoked, a transact= ion may or may not exist before the portlet is invoked. The portal transact= ion is usually present in the local context. - For example: + The following is an example of the <trans-attribute&g= t; element: - The trans-attribute value defines the transactionnal behavior. The accep= ted values are Required, Mandatory, Never, Supports, NotSupported and Requi= resNew. + The <trans-attribute> value defin= es the transactionnal behavior. By default, the value is No= tSupported, which means that the portal transaction will b= e suspended for the duration of the portlet invocation. Accepted values are= Required, Mandatory, Never, Suppor= ts, NotSupported, and RequiresNew. @@ -216,8 +215,7 @@ - Specify content which should be included in the portal aggregated page w= hen the portlet -is present on that page. This setting only applies when the portlet is use= d in the local mode. + Specify content to be included in the portal aggregated page, when the p= ortlet is present on that page. This setting only applies when the portlet = is used in the local mode. --===============6383047516141169741==-- From portal-commits at lists.jboss.org Wed Feb 20 22:11:42 2008 Content-Type: multipart/mixed; boundary="===============6435047516439082066==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10054 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Wed, 20 Feb 2008 22:11:41 -0500 Message-ID: --===============6435047516439082066== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-20 22:11:40 -0500 (Wed, 20 Feb 2008) New Revision: 10054 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescr= iptors.xml Log: changing layout of 6.1.1. The JBoss Portlet DTD Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/x= mldescriptors.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-21 01:56:09 UTC (rev 10053) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-21 03:11:40 UTC (rev 10054) @@ -91,7 +91,7 @@ ]]> +]]> @@ -116,12 +116,12 @@ ]]> - - - +]]> - - + + + The portlet name. --===============6435047516439082066==-- From portal-commits at lists.jboss.org Wed Feb 20 22:52:58 2008 Content-Type: multipart/mixed; boundary="===============9063733671893223755==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10055 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Wed, 20 Feb 2008 22:52:58 -0500 Message-ID: --===============9063733671893223755== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-20 22:52:58 -0500 (Wed, 20 Feb 2008) New Revision: 10055 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescr= iptors.xml Log: 6.1.1. The JBoss Portlet DTD revising use of lists/layout Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/x= mldescriptors.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-21 03:11:40 UTC (rev 10054) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-21 03:52:58 UTC (rev 10055) @@ -125,12 +125,11 @@ The portlet name. - - - +]]> - - + + Use the <remotable> element to co= nfigure the default behavior of portlets with respect to WSRP exposure: if = no value is given, the value is either the value globally defined at the po= rtlet application level, or false. Accepte= d values are true and fals= e. @@ -143,12 +142,11 @@ Use the ajax element to configure the A= synchronous JavaScript and XML (AJAX) capabilities of the portlet. If a por= tlet uses the true value for the <partial-refresh> element, the portal uses pa= rtial page refreshing and only renders that portlet. If the <partial-refresh> element uses a fa= lse value, the portal uses a full-page refresh when the po= rtlet is refreshed. - - - +]]> - - + + If a portlet uses the true value for th= e <partial-refresh> element, the por= tal uses partial page refreshing and only renders that portlet. If the <partial-refresh> element uses a false value, the portal uses a full-page refresh = when the portlet is refreshed. @@ -199,12 +197,11 @@ ]]> - - - +]]> - - + + The <trans-attribute> value defin= es the transactionnal behavior. By default, the value is No= tSupported, which means that the portal transaction will b= e suspended for the duration of the portlet invocation. Accepted values are= Required, Mandatory, Never, Suppor= ts, NotSupported, and RequiresNew. @@ -215,32 +212,29 @@ - Specify content to be included in the portal aggregated page, when the p= ortlet is present on that page. This setting only applies when the portlet = is used in the local mode. + Specify content to be included in the portal aggregated page when the po= rtlet is present on that page. This setting only applies when the portlet i= s used in the local mode. - - - +]]> - - + + No content is allowed inside an link element. - - - +]]> - - + + The script header element can contain inline script definitions. - - - +]]> - - + + No content is allowed for meta element. @@ -275,30 +269,27 @@ }]]> - - - +]]> - - + + The service name that will be used to bind the service as a portlet cont= ext attribute. - - - +]]> - - + + The full qualified name of the interface that the service implements. - - - +]]> - - + + The reference to the service. In the JMX Microkernel environment it cons= ist of the JMX name of the service MBean. For an MBean reference if the dom= ain is left out, then the current domain of the portal will be used. --===============9063733671893223755==-- From portal-commits at lists.jboss.org Wed Feb 20 23:18:31 2008 Content-Type: multipart/mixed; boundary="===============2484879299891871957==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10056 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Wed, 20 Feb 2008 23:18:31 -0500 Message-ID: --===============2484879299891871957== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-20 23:18:31 -0500 (Wed, 20 Feb 2008) New Revision: 10056 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescr= iptors.xml Log: 6.1.1. The JBoss Portlet DTD trying to fix my mess Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/x= mldescriptors.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-21 03:52:58 UTC (rev 10055) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-21 04:18:31 UTC (rev 10056) @@ -131,7 +131,7 @@ - Use the <remotable> element to co= nfigure the default behavior of portlets with respect to WSRP exposure: if = no value is given, the value is either the value globally defined at the po= rtlet application level, or false. Accepte= d values are true and fals= e. + Accepted values are true and false. @@ -169,19 +169,18 @@ ]]> - - -]]> - - +]]> + + + The <distributed> element instruc= ts the container to distribute the session attributes using the portal sess= ion replication. This only applies to local portlets, not remote portlets. = Accepted values are true and false. The default value is false. ]]> +]]> @@ -199,7 +198,7 @@ ]]> +]]> @@ -208,7 +207,7 @@ ]]> +]]> @@ -216,7 +215,7 @@ ]]> +]]> @@ -224,7 +223,7 @@ ]]> +]]> @@ -232,7 +231,7 @@ ]]> +]]> @@ -241,7 +240,7 @@ ]]> +]]> @@ -271,7 +270,7 @@ ]]> +]]> @@ -279,7 +278,7 @@ ]]> +]]> @@ -287,7 +286,7 @@ ]]> +]]> --===============2484879299891871957==-- From portal-commits at lists.jboss.org Thu Feb 21 00:08:13 2008 Content-Type: multipart/mixed; boundary="===============7538125737423496599==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10057 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Thu, 21 Feb 2008 00:08:12 -0500 Message-ID: --===============7538125737423496599== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-21 00:08:12 -0500 (Thu, 21 Feb 2008) New Revision: 10057 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescr= iptors.xml Log: 6.1.1. The JBoss Portlet DTD minor revisions, spelling corrections, removing doubled-up content. Mess almost fixed... Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/x= mldescriptors.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-21 04:18:31 UTC (rev 10056) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-21 05:08:12 UTC (rev 10057) @@ -98,10 +98,10 @@ Additional configuration for the portlet. The <portle= t-name> element defines the portlet name. It must match= a portlet defined in the WEB-INF/portlet.xml file for= that application. - Use the <remotable> element to co= nfigure the default behavior of portlets with respect to WSRP exposure: if = no value is given, the value is either the value globally defined at the po= rtlet application level, or false. Accepte= d values are true and fals= e. + Use the <remotable> element to co= nfigure the default behavior of portlets with respect to WSRP exposure: if = no value is given, the value is either the value globally defined at the po= rtlet application level, or false. - The <trans-attribute> element spe= cifies the behavior of the portlet when it is invoked at runtime, with resp= ect to the transactionnal context. Depending on how the portlet is + The <trans-attribute> element spe= cifies the behavior of the portlet when it is invoked at runtime, with resp= ect to the transactional context. Depending on how the portlet is invoked, a transaction may or may not exist before the portlet is invoke= d. The portal transaction is usually present in the local context. By defau= lt, the value is NotSupported, which means= that the portal transaction will be suspended for the duration of the port= let invocation. Accepted values are Required, Mandatory, Never, Supports, Not= Supported, and RequiresNew. @@ -157,7 +157,7 @@ - The <session-config> configures t= he portlet session of the portlet. The <distributed><= /computeroutput> element instructs the container to distribute the session = attributes using the portal session replication. This only applies to local= portlets, not remote portlets. Accepted values are true and false. The default valu= e is false. + The <session-config> configures t= he portlet session of the portlet. The <distributed><= /computeroutput> element instructs the container to distribute the session = attributes using the portal session replication. This only applies to local= portlets, not remote portlets. The following is an example of the <session-config>= ; and <distributed>= elements: = @@ -175,7 +175,7 @@ - The <distributed> element instruc= ts the container to distribute the session attributes using the portal sess= ion replication. This only applies to local portlets, not remote portlets. = Accepted values are true and false. The default value is false. + Accepted values are true and false. The default value is false. @@ -184,7 +184,7 @@ - Define how the portlet behaves with the transactionnal context. The <trans-attribute> element specifies the = behavior of the portlet when it is invoked at runtime, with respect to the = transactionnal context. Depending on how the portlet is invoked, a transact= ion may or may not exist before the portlet is invoked. The portal transact= ion is usually present in the local context. + Define how the portlet behaves with the transactional context. The <trans-attribute> element specifies the b= ehavior of the portlet when it is invoked at runtime, with respect to the t= ransactional context. Depending on how the portlet is invoked, a transactio= n may or may not exist before the portlet is invoked. The portal transactio= n is usually present in the local context. The following is an example of the <trans-attribute&g= t; element: @@ -202,7 +202,7 @@ - The <trans-attribute> value defin= es the transactionnal behavior. By default, the value is No= tSupported, which means that the portal transaction will b= e suspended for the duration of the portlet invocation. Accepted values are= Required, Mandatory, Never, Suppor= ts, NotSupported, and RequiresNew. + The default value is NotSupported, whic= h means that the portal transaction will be suspended for the duration of t= he portlet invocation. Accepted values are Required, Mandatory, Neve= r, Supports, NotSupported, and RequiresNew. @@ -219,7 +219,7 @@ - No content is allowed inside an link element. + No content is allowed inside a link element. - The script header element can contain inline script definitions. + Use the <script> element for inli= ne script definitions. - No content is allowed for meta element. + No content is allowed for the <meta> element. @@ -247,7 +247,7 @@ Declare a service that will be injected by the portlet container as an a= ttribute of the portlet context. - For example: + The following is an example of the <service> element: ]]> - In the portlet it is then possible to use it by doing a lookup on t= he service name, for example in the init() lifecycle method : + + To use an injected service in a portlet, perform a lookup of the <service-name>, for example, using the init() lifecycle method: - The service name that will be used to bind the service as a portlet cont= ext attribute. + The <service-name> element define= s the name that binds the service as a portlet context attribute. - The full qualified name of the interface that the service implements. + The <service-class> element defin= es the fully qualified name of the interface that the service implements. - The reference to the service. In the JMX Microkernel environment it cons= ist of the JMX name of the service MBean. For an MBean reference if the dom= ain is left out, then the current domain of the portal will be used. + The <service-ref> defines the ref= erence to the service. In the JMX Microkernel environment, this consist of = the JMX name of the service MBean. For an MBean reference, if the domain is= left out, then the current domain of the portal is used. --===============7538125737423496599==-- From portal-commits at lists.jboss.org Thu Feb 21 02:36:26 2008 Content-Type: multipart/mixed; boundary="===============5834272152879742519==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10058 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Thu, 21 Feb 2008 02:36:26 -0500 Message-ID: --===============5834272152879742519== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-21 02:36:26 -0500 (Thu, 21 Feb 2008) New Revision: 10058 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescr= iptors.xml Log: 6.1.1. The JBoss Portlet DTD minor revisions Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/x= mldescriptors.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-21 05:08:12 UTC (rev 10057) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-21 07:36:26 UTC (rev 10058) @@ -101,11 +101,11 @@ Use the <remotable> element to co= nfigure the default behavior of portlets with respect to WSRP exposure: if = no value is given, the value is either the value globally defined at the po= rtlet application level, or false. - The <trans-attribute> element spe= cifies the behavior of the portlet when it is invoked at runtime, with resp= ect to the transactional context. Depending on how the portlet is - invoked, a transaction may or may not exist before the portlet is invoke= d. The portal transaction is usually present in the local context. By defau= lt, the value is NotSupported, which means= that the portal transaction will be suspended for the duration of the port= let invocation. Accepted values are Required, Mandatory, Never, Supports, Not= Supported, and RequiresNew. + The <trans-attribute> element spe= cifies the behavior of the portlet when it is invoked at runtime with respe= ct to the transactional context. Depending on how the portlet is + invoked, a transaction may or may not exist before the portlet is invoke= d. The portal transaction is usually present in the local context. The defa= ult value is NotSupported, which means tha= t the portal transaction will be suspended for the duration of the session.= Accepted values are Required, Mandatory, Never, Supports, NotSupported, and RequiresNew. - The following example uses the <portlet-name>, <remotable>, and <trans-attribute> elements: + The following is an example section from a WEB-INF/portlet.xml= file, which uses the <portlet-name>, <remotable>, and <trans-attribute> elements: - Use the ajax element to configure the A= synchronous JavaScript and XML (AJAX) capabilities of the portlet. If a por= tlet uses the true value for the <partial-refresh> element, the portal uses pa= rtial page refreshing and only renders that portlet. If the <partial-refresh> element uses a fa= lse value, the portal uses a full-page refresh when the po= rtlet is refreshed. + Use the ajax element to configure the A= synchronous JavaScript and XML (AJAX) capabilities of the portlet. - If a portlet uses the true value for th= e <partial-refresh> element, the por= tal uses partial page refreshing and only renders that portlet. If the <partial-refresh> element uses a false value, the portal uses a full-page refresh = when the portlet is refreshed. + If a portlet uses the true value for th= e <partial-refresh> element, the por= tal uses partial-page refreshing and only renders the portlet. If the <partial-refresh> element uses a false value, the portal uses a full-page refresh w= hen the portlet is refreshed. @@ -157,7 +157,7 @@ - The <session-config> configures t= he portlet session of the portlet. The <distributed><= /computeroutput> element instructs the container to distribute the session = attributes using the portal session replication. This only applies to local= portlets, not remote portlets. + The <session-config> element conf= igures the portlet session of the portlet. The <distribu= ted> element instructs the container to distribute the = session attributes using portal session replication. This only applies to l= ocal portlets, not remote portlets. The following is an example of the <session-config>= ; and <distributed>= elements: = --===============5834272152879742519==-- From portal-commits at lists.jboss.org Thu Feb 21 02:48:57 2008 Content-Type: multipart/mixed; boundary="===============3487777312608744127==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10059 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Thu, 21 Feb 2008 02:48:57 -0500 Message-ID: --===============3487777312608744127== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-21 02:48:57 -0500 (Thu, 21 Feb 2008) New Revision: 10059 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configur= ation.xml Log: s/server/service on a port less than 1024 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/c= onfiguration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configu= ration.xml 2008-02-21 07:36:26 UTC (rev 10058) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configu= ration.xml 2008-02-21 07:48:57 UTC (rev 10059) @@ -40,7 +40,7 @@ Root User Privileges - Linux systems require root user privileges to run a server on a p= ort less than 1024. Starting JBoss EAP or JBoss AS on port 80 as a non-priv= ileged user will not work. Running JBoss EAP or JBoss AS as the root user c= ould lead to security breaches. + Linux systems require root user privileges to run a service on a = port less than 1024. Starting JBoss EAP or JBoss AS on port 80 as a non-pri= vileged user will not work. Running JBoss EAP or JBoss AS as the root user = could lead to security breaches. --===============3487777312608744127==-- From portal-commits at lists.jboss.org Thu Feb 21 07:10:56 2008 Content-Type: multipart/mixed; boundary="===============1976321161248116702==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10060 - branches. Date: Thu, 21 Feb 2008 07:10:56 -0500 Message-ID: --===============1976321161248116702== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-21 07:10:56 -0500 (Thu, 21 Feb 2008) New Revision: 10060 Added: branches/JBoss_Portal_Branch_2_7/ Log: 2.7 Copied: branches/JBoss_Portal_Branch_2_7 (from rev 10059, branches/JBoss_Po= rtal_Branch_2_6) --===============1976321161248116702==-- From portal-commits at lists.jboss.org Thu Feb 21 07:16:53 2008 Content-Type: multipart/mixed; boundary="===============5882868766149182400==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10061 - docs/branches. Date: Thu, 21 Feb 2008 07:16:53 -0500 Message-ID: --===============5882868766149182400== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-21 07:16:53 -0500 (Thu, 21 Feb 2008) New Revision: 10061 Added: docs/branches/JBoss_Portal_Branch_2_7/ Log: branching 2.7 for docs Copied: docs/branches/JBoss_Portal_Branch_2_7 (from rev 10060, docs/branche= s/JBoss_Portal_Branch_2_6) --===============5882868766149182400==-- From portal-commits at lists.jboss.org Thu Feb 21 07:20:46 2008 Content-Type: multipart/mixed; boundary="===============6414482982151028160==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10062 - trunk. Date: Thu, 21 Feb 2008 07:20:46 -0500 Message-ID: --===============6414482982151028160== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-21 07:20:46 -0500 (Thu, 21 Feb 2008) New Revision: 10062 Modified: trunk/ Log: updating svn:externals to point to 2.7 Property changes on: trunk ___________________________________________________________________ Name: svn:externals - src http://anonsvn.jboss.org/repos/portal/branches/JBoss_Portal_Branch= _2_6 + src http://anonsvn.jboss.org/repos/portal/branches/JBoss_Portal_Branch= _2_7 --===============6414482982151028160==-- From portal-commits at lists.jboss.org Thu Feb 21 07:41:09 2008 Content-Type: multipart/mixed; boundary="===============7535119001800926104==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10063 - docs/trunk. Date: Thu, 21 Feb 2008 07:41:09 -0500 Message-ID: --===============7535119001800926104== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-21 07:41:08 -0500 (Thu, 21 Feb 2008) New Revision: 10063 Modified: docs/trunk/ Log: remove externals in doc trunk Property changes on: docs/trunk ___________________________________________________________________ Name: svn:externals - docbook-support http://anonsvn.jboss.org/repos/portal/tools/docbook/su= pport/ docbook-support/styles http://anonsvn.jboss.org/repos/portal/tools/docbook/= styles/renaissance/ + = --===============7535119001800926104==-- From portal-commits at lists.jboss.org Thu Feb 21 07:42:52 2008 Content-Type: multipart/mixed; boundary="===============1654803419558805907==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10064 - docs. Date: Thu, 21 Feb 2008 07:42:52 -0500 Message-ID: --===============1654803419558805907== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-21 07:42:52 -0500 (Thu, 21 Feb 2008) New Revision: 10064 Removed: docs/trunk/ Modified: docs/ Log: make trunk point to 2.7 branch for docs Property changes on: docs ___________________________________________________________________ Name: svn:externals + trunk https://svn.jboss.org/repos/portal/docs/branches/JBoss_Portal_Br= anch_2_7 --===============1654803419558805907==-- From portal-commits at lists.jboss.org Thu Feb 21 07:44:07 2008 Content-Type: multipart/mixed; boundary="===============6775011380644938822==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10065 - trunk. Date: Thu, 21 Feb 2008 07:44:06 -0500 Message-ID: --===============6775011380644938822== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-21 07:44:06 -0500 (Thu, 21 Feb 2008) New Revision: 10065 Modified: trunk/ Log: update svn externals for trunk Property changes on: trunk ___________________________________________________________________ Name: svn:externals - src http://anonsvn.jboss.org/repos/portal/branches/JBoss_Portal_Branch= _2_7 + = --===============6775011380644938822==-- From portal-commits at lists.jboss.org Thu Feb 21 07:45:10 2008 Content-Type: multipart/mixed; boundary="===============8253086331865467395==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10066 - /. Date: Thu, 21 Feb 2008 07:45:09 -0500 Message-ID: --===============8253086331865467395== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-21 07:45:09 -0500 (Thu, 21 Feb 2008) New Revision: 10066 Removed: trunk/ Modified: / Log: svn externals for trunk src to 2.7 Property changes on: = ___________________________________________________________________ Name: svn:externals + trunk http://anonsvn.jboss.org/repos/portal/branches/JBoss_Portal_Bran= ch_2_7 --===============8253086331865467395==-- From portal-commits at lists.jboss.org Thu Feb 21 07:46:11 2008 Content-Type: multipart/mixed; boundary="===============4480967684331739692==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10067 - docs. Date: Thu, 21 Feb 2008 07:46:11 -0500 Message-ID: --===============4480967684331739692== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-21 07:46:11 -0500 (Thu, 21 Feb 2008) New Revision: 10067 Modified: docs/ Log: svn externals for trunk docs to 2.7 Property changes on: docs ___________________________________________________________________ Name: svn:externals - trunk https://svn.jboss.org/repos/portal/docs/branches/JBoss_Portal_Br= anch_2_7 + trunk http://anonsvn.jboss.org/repos/portal/docs/branches/JBoss_Portal= _Branch_2_7 --===============4480967684331739692==-- From portal-commits at lists.jboss.org Thu Feb 21 07:49:52 2008 Content-Type: multipart/mixed; boundary="===============5294572181840923137==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10068 - docs and 1 other directory. Date: Thu, 21 Feb 2008 07:49:52 -0500 Message-ID: --===============5294572181840923137== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-21 07:49:52 -0500 (Thu, 21 Feb 2008) New Revision: 10068 Modified: / docs/ Log: removing non usable svn externals Property changes on: = ___________________________________________________________________ Name: svn:externals - trunk http://anonsvn.jboss.org/repos/portal/branches/JBoss_Portal_Bran= ch_2_7 + = Property changes on: docs ___________________________________________________________________ Name: svn:externals - trunk http://anonsvn.jboss.org/repos/portal/docs/branches/JBoss_Portal= _Branch_2_7 + = --===============5294572181840923137==-- From portal-commits at lists.jboss.org Thu Feb 21 17:21:39 2008 Content-Type: multipart/mixed; boundary="===============6806329659988029700==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10069 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/container and 13 other directories. Date: Thu, 21 Feb 2008 17:21:38 -0500 Message-ID: --===============6806329659988029700== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-21 17:21:37 -0500 (Thu, 21 Feb 2008) New Revision: 10069 Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/PortletFilter.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/PortletFilterContext.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/LifeCycleStatus.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/ManagedObjectAddedEvent.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/ManagedObjectEvent.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/ManagedObjectLifeCycleEvent.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/ManagedObjectRegistryEvent.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/ManagedObjectRegistryEventBroadcaster.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/ManagedObjectRegistryEventListener.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/ManagedObjectRemovedEvent.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/ManagedPortletFilter.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/object/PortletFilterObject.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/container/DependencyNotResolvedException.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/container/LifeCycle.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/container/NullManagedObjectRegistryEventListener.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/container/PortletApplicationLifeCycle.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/container/PortletContainerLifeCycle.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/container/PortletFilterLifeCycle.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletFilterImpl.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/con= tainer/ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/con= tainer/LifeCycle1Test.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/con= tainer/ManagedObjectRegistryEventList.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/con= tainer/ObjectSupport.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/con= tainer/PortletApplicationContextSupport.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/con= tainer/PortletApplicationObjectSupport.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/con= tainer/PortletContainerContextSupport.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/con= tainer/PortletContainerObjectSupport.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/con= tainer/PortletFilterContextSupport.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/con= tainer/PortletFilterObjectSupport.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/basic/FailDuringInitPortlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletApplicationContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletContainerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletFilterContextImpl.java Removed: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/ManagedObjectStatus.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/K= ernelObject.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/K= ernelPortletApplication.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/K= ernelPortletContainer.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/asp= ects/portlet/ValveInterceptor.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/PortletApplicationContext.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/PortletContainerContext.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/ManagedObject.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/ManagedPortletApplication.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/managed/PortletApplicationRegistry.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/object/PortletApplicationObject.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/object/PortletContainerObject.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerFilterInfo.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/ClassInstanceLifeCycle.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletApplicationImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletContainerImpl.java modules/portlet/trunk/portlet/src/test/resources/local-jboss-unit.xml modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletApplicationDeployer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletApplicationDeployment.java modules/portlet/trunk/test/src/test/build.xml modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/j= boss-beans.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= jboss-beans.xml Log: refactor of the kernel integration layer to take in account filter dependen= cies Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/aspects/portlet/ValveInterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/as= pects/portlet/ValveInterceptor.java 2008-02-21 12:49:52 UTC (rev 10068) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/as= pects/portlet/ValveInterceptor.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -60,7 +60,7 @@ PortletContainerContext context =3D container.getContext(); = // Invoke stop - context.invokeStop(); +// context.invokeStop(); } = // Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/PortletApplicationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletApplicationContext.java 2008-02-21 12:49:52 UTC (rev 10068) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletApplicationContext.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -54,16 +54,4 @@ * @return the classloader */ ClassLoader getClassLoader(); - - /** - * Start the portlet application and its components. - * - * @throws Exception any exception - */ - void invokeStart() throws Exception; - - /** - * Stop the portlet application and its components. - */ - void invokeStop(); } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/PortletContainerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletContainerContext.java 2008-02-21 12:49:52 UTC (rev 10068) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletContainerContext.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -28,17 +28,4 @@ */ public interface PortletContainerContext { - - /** - * Start the portlet container. - * - * @throws Exception any exception - */ - void invokeStart() throws Exception; - - /** - * Stop the portlet container. - */ - void invokeStop(); - } Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /container/PortletFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletFilter.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletFilter.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -0,0 +1,39 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public interface PortletFilter +{ + + /** + * Returns the id. + * + * @return the id + */ + String getId(); + +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /container/PortletFilterContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletFilterContext.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletFilterContext.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -0,0 +1,31 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public interface PortletFilterContext +{ +} Copied: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portle= t/container/managed/LifeCycleStatus.java (from rev 10034, modules/portlet/t= runk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/Manag= edObjectStatus.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/LifeCycleStatus.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/LifeCycleStatus.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -0,0 +1,34 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container.managed; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public enum LifeCycleStatus +{ + + STOPPED, STARTED, FAILED + +} Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/managed/ManagedObject.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedObject.java 2008-02-21 12:49:52 UTC (rev 10068) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedObject.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -29,9 +29,9 @@ public interface ManagedObject { = - ManagedObjectStatus getStatus(); + LifeCycleStatus getStatus(); = - void managedStart() throws Exception; + void managedStart() throws IllegalStateException; = void managedStop(); = Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /container/managed/ManagedObjectAddedEvent.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedObjectAddedEvent.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedObjectAddedEvent.java 2008-02-21 22:21:37 UTC (rev 1= 0069) @@ -0,0 +1,35 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container.managed; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ManagedObjectAddedEvent extends ManagedObjectEvent +{ + public ManagedObjectAddedEvent(ManagedObject managedObject) + { + super(managedObject); + } +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /container/managed/ManagedObjectEvent.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedObjectEvent.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedObjectEvent.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -0,0 +1,48 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container.managed; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ManagedObjectEvent extends ManagedObjectRegistryEvent +{ + + /** . */ + private final ManagedObject managedObject; + + public ManagedObjectEvent(ManagedObject managedObject) + { + if (managedObject =3D=3D null) + { + throw new IllegalArgumentException(); + } + this.managedObject =3D managedObject; + } + + public ManagedObject getManagedObject() + { + return managedObject; + } +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /container/managed/ManagedObjectLifeCycleEvent.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedObjectLifeCycleEvent.java (r= ev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedObjectLifeCycleEvent.java 2008-02-21 22:21:37 UTC (r= ev 10069) @@ -0,0 +1,47 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container.managed; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ManagedObjectLifeCycleEvent extends ManagedObjectEvent +{ + + /** . */ + private final LifeCycleStatus status; + + public ManagedObjectLifeCycleEvent(ManagedObject managedObject, LifeCyc= leStatus status) + { + super(managedObject); + + // + this.status =3D status; + } + + public LifeCycleStatus getStatus() + { + return status; + } +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /container/managed/ManagedObjectRegistryEvent.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedObjectRegistryEvent.java (re= v 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedObjectRegistryEvent.java 2008-02-21 22:21:37 UTC (re= v 10069) @@ -0,0 +1,31 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container.managed; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ManagedObjectRegistryEvent +{ +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /container/managed/ManagedObjectRegistryEventBroadcaster.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedObjectRegistryEventBroadcaster.java = (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedObjectRegistryEventBroadcaster.java 2008-02-21 22:21= :37 UTC (rev 10069) @@ -0,0 +1,85 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container.managed; + +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ManagedObjectRegistryEventBroadcaster implements ManagedObjec= tRegistryEventListener +{ + + /** . */ + private final List listeners; + + public ManagedObjectRegistryEventBroadcaster() + { + listeners =3D new CopyOnWriteArrayList(); + } + + public void addListener(ManagedObjectRegistryEventListener listener) + { + if (listener =3D=3D null) + { + throw new IllegalArgumentException(); + } + + // + if (!listeners.contains(listener)) + { + listeners.add(listener); + } + } + + public void removeListener(ManagedObjectRegistryEventListener listener) + { + if (listener =3D=3D null) + { + throw new IllegalArgumentException(); + } + + // + if (listeners.contains(listener)) + { + listeners.remove(listener); + } + } + + public void onEvent(ManagedObjectRegistryEvent event) + { + for (ManagedObjectRegistryEventListener listener : listeners) + { + try + { + listener.onEvent(event); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /container/managed/ManagedObjectRegistryEventListener.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedObjectRegistryEventListener.java = (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedObjectRegistryEventListener.java 2008-02-21 22:21:37= UTC (rev 10069) @@ -0,0 +1,32 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container.managed; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public interface ManagedObjectRegistryEventListener +{ + void onEvent(ManagedObjectRegistryEvent event); +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /container/managed/ManagedObjectRemovedEvent.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedObjectRemovedEvent.java (rev= 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedObjectRemovedEvent.java 2008-02-21 22:21:37 UTC (rev= 10069) @@ -0,0 +1,35 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container.managed; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ManagedObjectRemovedEvent extends ManagedObjectEvent +{ + public ManagedObjectRemovedEvent(ManagedObject managedObject) + { + super(managedObject); + } +} Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portl= et/container/managed/ManagedObjectStatus.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedObjectStatus.java 2008-02-21 12:49:52 UTC (rev 10068) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedObjectStatus.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -1,34 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.container.managed; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public enum ManagedObjectStatus -{ - - STOPPED, STARTED, FAILED - -} Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/managed/ManagedPortletApplication.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedPortletApplication.java 2008-02-21 12:49:52 UTC (rev= 10068) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedPortletApplication.java 2008-02-21 22:21:37 UTC (rev= 10069) @@ -37,5 +37,8 @@ = ManagedPortletContainer getManagedPortletContainer(String portletContai= nerId); = + Collection getManagedPortletFilters(); = + ManagedPortletFilter getManagedPortletFilter(String portletFilterId); + } Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /container/managed/ManagedPortletFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedPortletFilter.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/ManagedPortletFilter.java 2008-02-21 22:21:37 UTC (rev 1006= 9) @@ -0,0 +1,36 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container.managed; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public interface ManagedPortletFilter extends ManagedObject +{ + + String getId(); + + ManagedPortletApplication getManagedPortletApplication(); + +} Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/managed/PortletApplicationRegistry.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/PortletApplicationRegistry.java 2008-02-21 12:49:52 UTC (re= v 10068) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/managed/PortletApplicationRegistry.java 2008-02-21 22:21:37 UTC (re= v 10069) @@ -47,4 +47,8 @@ */ ManagedPortletApplication getManagedPortletApplication(String id); = + void addListener(ManagedObjectRegistryEventListener listener); + + void removeListener(ManagedObjectRegistryEventListener listener); + } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/object/PortletApplicationObject.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/object/PortletApplicationObject.java 2008-02-21 12:49:52 UTC (rev 1= 0068) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/object/PortletApplicationObject.java 2008-02-21 22:21:37 UTC (rev 1= 0069) @@ -25,6 +25,7 @@ import org.jboss.portal.portlet.container.PortletApplicationContext; import org.jboss.portal.portlet.container.PortletContainer; import org.jboss.portal.portlet.container.PortletApplication; +import org.jboss.portal.portlet.container.PortletFilter; = /** * Contains life cycle and wiring details for the kernel environment. @@ -50,20 +51,34 @@ PortletApplicationContext getContext(); = /** - * Wire a container. + * Add a container. * * @param container the container */ void addContainer(PortletContainer container); = /** - * Unwire a container. + * Remove a container. * * @param container the container */ void removeContainer(PortletContainer container); = /** + * Add a filter. + * + * @param filter the filter + */ + void addFilter(PortletFilter filter); + + /** + * Remove a filter. + * + * @param filter the filter + */ + void removeFilter(PortletFilter filter); + + /** * Starts the application only. It does not take care of starting its c= omponents. * * @throws Exception any exception preventing the start Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/object/PortletContainerObject.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/object/PortletContainerObject.java 2008-02-21 12:49:52 UTC (rev 100= 68) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/object/PortletContainerObject.java 2008-02-21 22:21:37 UTC (rev 100= 69) @@ -25,6 +25,7 @@ import org.jboss.portal.portlet.container.PortletApplication; import org.jboss.portal.portlet.container.PortletContainerContext; import org.jboss.portal.portlet.container.PortletContainer; +import org.jboss.portal.portlet.container.PortletFilter; = /** * Contains life cycle and wiring details for the kernel environment. @@ -36,20 +37,34 @@ { = /** - * Wire the application. + * Set/unset the application. * * @param application the related application */ void setApplication(PortletApplication application); = /** - * Wire the portlet container context. + * Set/unset the portlet container context. * * @param context the context */ void setContext(PortletContainerContext context); = /** + * Add a filter. + * + * @param filter the portlet filter + */ + void addFilter(PortletFilter filter); + + /** + * Remove a filter. + * + * @param filter the portlet filter + */ + void removeFilter(PortletFilter filter); + + /** * Starts the portlet container. * * @throws Exception any exception preventing the start Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /container/object/PortletFilterObject.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/object/PortletFilterObject.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/object/PortletFilterObject.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -0,0 +1,61 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container.object; + +import org.jboss.portal.portlet.container.PortletApplication; +import org.jboss.portal.portlet.container.PortletFilter; +import org.jboss.portal.portlet.container.PortletFilterContext; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public interface PortletFilterObject extends PortletFilter +{ + + /** + * Set the application on the portlet filter. + * = + * @param application the application + */ + void setApplication(PortletApplication application); + + /** + * Set the context required by that filter. + * + * @param context the context + */ + void setContext(PortletFilterContext context); + + /** + * Starts the portlet container. + * + * @throws Exception any exception preventing the start + */ + void start() throws Exception; + + /** + * Stops the portlet container. + */ + void stop(); +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/container/DependencyNotResolvedException.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/DependencyNotResolvedException.java (r= ev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/DependencyNotResolvedException.java 2008-02-21 22:21:37 UTC (r= ev 10069) @@ -0,0 +1,37 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.impl.container; + +/** + * Internally used only. + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +class DependencyNotResolvedException extends Exception +{ + public DependencyNotResolvedException(String message) + { + super(message); + } +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/container/LifeCycle.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/LifeCycle.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/LifeCycle.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -0,0 +1,171 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.impl.container; + +import org.jboss.portal.portlet.container.managed.ManagedObject; +import org.jboss.portal.portlet.container.managed.LifeCycleStatus; +import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= ntListener; +import org.jboss.portal.portlet.container.managed.ManagedObjectLifeCycleEv= ent; +import org.apache.log4j.Logger; + +import java.util.Set; +import java.util.HashSet; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public abstract class LifeCycle implements ManagedObject +{ + + /** . */ + private Logger log =3D Logger.getLogger(LifeCycle.class); + + /** . */ + private LifeCycleStatus status =3D LifeCycleStatus.STOPPED; + + public final LifeCycleStatus getStatus() + { + return status; + } + + private static final ThreadLocal> faileds =3D new ThreadLoc= al>(); + + public final void managedStart() throws IllegalStateException + { + boolean clearFaileds =3D false; + + // + try + { + if (faileds.get() =3D=3D null) + { + clearFaileds =3D true; + faileds.set(new HashSet()); + } + else if (faileds.get().contains(this)) + { + return; + } + + // + LifeCycleStatus previousStatus =3D status; + + // + if (status !=3D LifeCycleStatus.STARTED) + { + LifeCycleStatus status =3D LifeCycleStatus.FAILED; + try + { + invokeStart(); + status =3D LifeCycleStatus.STARTED; + } + catch (DependencyNotResolvedException ignore) + { + status =3D LifeCycleStatus.STOPPED; + } + catch (Exception e) + { + log.error("Cannot start object", e); + } + catch (Error e) + { + log.error("Cannot start object", e); + } + finally + { + this.status =3D status; + + // + if (status =3D=3D LifeCycleStatus.FAILED) + { + faileds.get().add(this); + } + } + } + + // + if (status !=3D previousStatus) + { + getListener().onEvent(new ManagedObjectLifeCycleEvent(this, st= atus)); + } + + // + if (status =3D=3D LifeCycleStatus.STARTED) + { + startDependents(); + } + } + finally + { + if (clearFaileds) + { + faileds.set(null); + } + } + } + + public final void managedStop() + { + stopDependents(); + + // + if (status =3D=3D LifeCycleStatus.STARTED) + { + try + { + invokeStop(); + } + catch (Exception e) + { + log.error("Error during object stop", e); + } + catch (Error e) + { + log.error("Error during object stop", e); + } + finally + { + status =3D LifeCycleStatus.STOPPED; + } + + // + getListener().onEvent(new ManagedObjectLifeCycleEvent(this, LifeC= ycleStatus.STOPPED)); + } + } + + protected void startDependents() + { + } + + protected void stopDependents() + { + } + + protected abstract void invokeStart() throws Exception; + + protected abstract void invokeStop(); + + protected abstract ManagedObjectRegistryEventListener getListener(); + +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/container/NullManagedObjectRegistryEventListener.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/NullManagedObjectRegistryEventListener.java = (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/NullManagedObjectRegistryEventListener.java 2008-02-21 22:21:3= 7 UTC (rev 10069) @@ -0,0 +1,50 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.impl.container; + +import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= ntListener; +import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= nt; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +class NullManagedObjectRegistryEventListener implements ManagedObjectRegis= tryEventListener +{ + + /** . */ + private final static ManagedObjectRegistryEventListener INSTANCE =3D ne= w NullManagedObjectRegistryEventListener(); + + public static ManagedObjectRegistryEventListener getInstance() + { + return INSTANCE; + } + + private NullManagedObjectRegistryEventListener() + { + } + + public void onEvent(ManagedObjectRegistryEvent event) + { + } +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/container/PortletApplicationLifeCycle.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/PortletApplicationLifeCycle.java (rev = 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/PortletApplicationLifeCycle.java 2008-02-21 22:21:37 UTC (rev = 10069) @@ -0,0 +1,417 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.impl.container; + +import org.jboss.portal.portlet.container.object.PortletApplicationObject; +import org.jboss.portal.portlet.container.object.PortletContainerObject; +import org.jboss.portal.portlet.container.object.PortletFilterObject; +import org.jboss.portal.portlet.container.managed.LifeCycleStatus; +import org.jboss.portal.portlet.container.managed.ManagedPortletApplicatio= n; +import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= ntListener; +import org.jboss.portal.portlet.container.managed.ManagedObjectAddedEvent; +import org.jboss.portal.portlet.container.managed.ManagedObjectRemovedEven= t; +import org.jboss.portal.portlet.container.PortletApplicationContext; +import org.jboss.portal.portlet.container.PortletContainerContext; +import org.jboss.portal.portlet.container.PortletFilterContext; +import org.jboss.portal.portlet.container.PortletApplication; + +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Collection; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletApplicationLifeCycle extends LifeCycle implements Mana= gedPortletApplication +{ + + /** . */ + private final PortletApplicationContext portletApplicationContext; + + /** . */ + private final PortletApplicationObject portletApplication; + + /** . */ + private final Map portletContainerLi= feCycles; + + /** . */ + private final Map portletFilterLifeCycl= es; + + /** . */ + private final Map> filterToContainerDependencies; + + /** Internal status to know about wiring. */ + private boolean created; + + /** . */ + private ManagedObjectRegistryEventListener listener; + + public PortletApplicationLifeCycle( + ManagedObjectRegistryEventListener listener, + PortletApplicationContext portletApplicationContext, + PortletApplicationObject portletApplication) + { + this.listener =3D listener; + this.portletApplicationContext =3D portletApplicationContext; + this.portletApplication =3D portletApplication; + this.portletContainerLifeCycles =3D new HashMap(); + this.portletFilterLifeCycles =3D new HashMap(); + this.filterToContainerDependencies =3D new HashMap>(); + } + + public PortletApplicationLifeCycle( + PortletApplicationContext portletApplicationContext, + PortletApplicationObject portletApplication) + { + this(NullManagedObjectRegistryEventListener.getInstance(), portletAp= plicationContext, portletApplication); + } + + public void create() + { + if (created) + { + throw new IllegalStateException(); + } + + // + portletApplication.setContext(portletApplicationContext); + + // + for (PortletFilterLifeCycle portletFilterLifeCycle : portletFilterLi= feCycles.values()) + { + portletFilterLifeCycle.portletFilter.setContext(portletFilterLife= Cycle.portletFilterContext); + portletFilterLifeCycle.portletFilter.setApplication(portletApplic= ation); + portletApplication.addFilter(portletFilterLifeCycle.portletFilter= ); + + // + listener.onEvent(new ManagedObjectAddedEvent(portletFilterLifeCyc= le)); + } + + // + for (PortletContainerLifeCycle portletContainerLifeCycle : portletCo= ntainerLifeCycles.values()) + { + portletContainerLifeCycle.portletContainer.setContext(portletCont= ainerLifeCycle.portletContainerContext); + portletContainerLifeCycle.portletContainer.setApplication(portlet= Application); + portletApplication.addContainer(portletContainerLifeCycle.portlet= Container); + + // + listener.onEvent(new ManagedObjectAddedEvent(portletContainerLife= Cycle)); + } + + // + for (Map.Entry> entry : filterToContainerDependencies.entrySet()) + { + for (PortletContainerLifeCycle portletContainerLifeCycle : entry.= getValue()) + { + portletContainerLifeCycle.portletContainer.addFilter(entry.get= Key().portletFilter); + } + } + + // + created =3D true; + } + + public void destroy() + { + if (getStatus() =3D=3D LifeCycleStatus.STARTED) + { + managedStop(); + } + + // + if (created) + { + for (Map.Entry> entry : filterToContainerDependencies.entrySet()) + { + for (PortletContainerLifeCycle portletContainerLifeCycle : ent= ry.getValue()) + { + portletContainerLifeCycle.portletContainer.removeFilter(ent= ry.getKey().portletFilter); + } + } + + for (PortletContainerLifeCycle portletContainerLifeCycle : portle= tContainerLifeCycles.values()) + { + listener.onEvent(new ManagedObjectRemovedEvent(portletContaine= rLifeCycle)); + + // + portletApplication.removeContainer(portletContainerLifeCycle.p= ortletContainer); + portletContainerLifeCycle.portletContainer.setApplication(null= ); + portletContainerLifeCycle.portletContainer.setContext(null); + } + + // + for (PortletFilterLifeCycle portletFilterLifeCycle : portletFilte= rLifeCycles.values()) + { + listener.onEvent(new ManagedObjectRemovedEvent(portletFilterLi= feCycle)); + + // + portletApplication.removeFilter(portletFilterLifeCycle.portlet= Filter); + portletFilterLifeCycle.portletFilter.setApplication(null); + portletFilterLifeCycle.portletFilter.setContext(null); + } + } + + // + this.created =3D false; + } + + public PortletContainerLifeCycle addPortletContainer(PortletContainerCo= ntext portletContainerContext, PortletContainerObject portletContainer) + { + if (getStatus() !=3D LifeCycleStatus.STOPPED) + { + throw new IllegalStateException("Cannot add portlet container bec= ause not stopped"); + } + if (portletContainer =3D=3D null) + { + throw new IllegalArgumentException("No null portlet container can= be added"); + } + + // + if (portletContainerLifeCycles.containsKey(portletContainer.getId())) + { + throw new IllegalStateException(); + } + + // + PortletContainerLifeCycle portletContainerLifeCycle =3D new PortletC= ontainerLifeCycle(this, portletContainerContext, portletContainer); + + // Manage + portletContainerLifeCycles.put(portletContainer.getId(), portletCont= ainerLifeCycle); + + // + return portletContainerLifeCycle; + } + + public PortletFilterLifeCycle addPortletFilter(PortletFilterContext por= tletFilterContext, PortletFilterObject portletFilter) + { + if (getStatus() !=3D LifeCycleStatus.STOPPED) + { + throw new IllegalStateException("Cannot add portlet container bec= ause not stopped"); + } + if (portletFilter =3D=3D null) + { + throw new IllegalArgumentException("No null portlet filter can be= added"); + } + + // + if (portletFilterLifeCycles.containsKey(portletFilter.getId())) + { + throw new IllegalStateException(); + } + + // + PortletFilterLifeCycle portletFilterLifeCycle =3D new PortletFilterL= ifeCycle(this, portletFilterContext, portletFilter); + + // + portletFilterLifeCycles.put(portletFilter.getId(), portletFilterLife= Cycle); + + // + return portletFilterLifeCycle; + } + + public void addDependency(PortletFilterLifeCycle portletFilterLifeCycle= , PortletContainerLifeCycle portletContainerLifeCycle) + { + if (portletFilterLifeCycle =3D=3D null) + { + throw new IllegalArgumentException(); + } + if (portletContainerLifeCycle =3D=3D null) + { + throw new IllegalArgumentException(); + } + + // + if (!portletFilterLifeCycles.containsValue(portletFilterLifeCycle)) + { + throw new IllegalStateException(); + } + if (!portletContainerLifeCycles.containsValue(portletContainerLifeCy= cle)) + { + throw new IllegalStateException(); + } + + // + Set containerDependencies =3D filterToCo= ntainerDependencies.get(portletFilterLifeCycle); + + // + if (containerDependencies =3D=3D null) + { + containerDependencies =3D new HashSet(= ); + filterToContainerDependencies.put(portletFilterLifeCycle, contain= erDependencies); + } + + // + if (containerDependencies.contains(portletContainerLifeCycle)) + { + throw new IllegalStateException(); + } + + // + containerDependencies.add(portletContainerLifeCycle); + } + + public Set getDependencies(PortletContainerLife= Cycle portletContainerLifeCycle) + { + if (portletContainerLifeCycle =3D=3D null) + { + throw new IllegalArgumentException(); + } + + // + Set dependencies =3D new HashSet(); + + // + for (Map.Entry> entry : filterToContainerDependencies.entrySet()) + { + if (entry.getValue().contains(portletContainerLifeCycle)) + { + dependencies.add(entry.getKey()); + } + } + + // + return dependencies; + } + + public Set getDependencies(PortletFilterLife= Cycle portletFilterLifeCycle) + { + if (portletFilterLifeCycle =3D=3D null) + { + throw new IllegalArgumentException(); + } + + // + Set dependencies =3D filterToContainerDep= endencies.get(portletFilterLifeCycle); + + if (dependencies =3D=3D null) + { + dependencies =3D new HashSet(); + } + else + { + dependencies =3D new HashSet(dependenc= ies); + } + + // + return dependencies; + } + + protected void invokeStart() throws Exception + { + if (!created) + { + throw new DependencyNotResolvedException("Application is not wire= d"); + } + + // + portletApplication.start(); + } + + protected void startDependents() + { + for (PortletFilterLifeCycle portletFilterLifeCycle : portletFilterLi= feCycles.values()) + { + try + { + portletFilterLifeCycle.managedStart(); + } + catch (IllegalStateException ignore) + { + } + } + + // + for (PortletContainerLifeCycle portletContainerLifeCycle : portletCo= ntainerLifeCycles.values()) + { + try + { + portletContainerLifeCycle.managedStart(); + } + catch (IllegalStateException ignore) + { + } + } + } + + protected void stopDependents() + { + for (PortletContainerLifeCycle portletContainerLifeCycle : portletCo= ntainerLifeCycles.values()) + { + portletContainerLifeCycle.managedStop(); + } + + // + for (PortletFilterLifeCycle portletFilterLifeCycle : portletFilterLi= feCycles.values()) + { + portletFilterLifeCycle.managedStop(); + } + } + + protected void invokeStop() + { + portletApplication.stop(); + } + + public String getId() + { + return portletApplication.getId(); + } + + public Collection getManagedPortle= tContainers() + { + return portletContainerLifeCycles.values(); + } + + public PortletContainerLifeCycle getManagedPortletContainer(String port= letContainerId) + { + return portletContainerLifeCycles.get(portletContainerId); + } + + public Collection getManagedPortletFi= lters() + { + return portletFilterLifeCycles.values(); + } + + public PortletFilterLifeCycle getManagedPortletFilter(String portletFil= terId) + { + return portletFilterLifeCycles.get(portletFilterId); + } + + public String toString() + { + return "PortletApplicationLifeCycle[" + portletApplication.getId() += "]"; + } + + public PortletApplication getPortletApplication() + { + return portletApplication; + } + + protected ManagedObjectRegistryEventListener getListener() + { + return listener; + } +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/container/PortletContainerLifeCycle.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/PortletContainerLifeCycle.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/PortletContainerLifeCycle.java 2008-02-21 22:21:37 UTC (rev 10= 069) @@ -0,0 +1,113 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.impl.container; + +import org.jboss.portal.portlet.container.object.PortletContainerObject; +import org.jboss.portal.portlet.container.managed.LifeCycleStatus; +import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; +import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= ntListener; +import org.jboss.portal.portlet.container.PortletContainerContext; +import org.jboss.portal.portlet.container.PortletContainer; +import org.jboss.portal.portlet.info.PortletInfo; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletContainerLifeCycle extends LifeCycle implements Manage= dPortletContainer +{ + + /** . */ + private PortletApplicationLifeCycle portletApplicationLifeCycle; + + /** . */ + final PortletContainerContext portletContainerContext; + + /** . */ + final PortletContainerObject portletContainer; + + PortletContainerLifeCycle( + PortletApplicationLifeCycle portletApplicationLifeCycle, + PortletContainerContext portletContainerContext, + PortletContainerObject portletContainer) + { + this.portletApplicationLifeCycle =3D portletApplicationLifeCycle; + this.portletContainerContext =3D portletContainerContext; + this.portletContainer =3D portletContainer; + } + + protected void invokeStart() throws Exception + { + if (portletApplicationLifeCycle.getStatus() !=3D LifeCycleStatus.STA= RTED) + { + throw new DependencyNotResolvedException("The parent application = is not started"); + } + + // + for (PortletFilterLifeCycle portletFilterLifeCycle : portletApplicat= ionLifeCycle.getDependencies(this)) + { + if (portletFilterLifeCycle.getStatus() !=3D LifeCycleStatus.START= ED) + { + throw new DependencyNotResolvedException("The filter " + portl= etFilterLifeCycle + " is not started"); + } + } + + // + portletContainer.start(); + } + + protected void invokeStop() + { + portletContainer.stop(); + } + + public String getId() + { + return portletContainer.getId(); + } + + public PortletInfo getInfo() + { + return portletContainer.getInfo(); + } + + public PortletApplicationLifeCycle getManagedPortletApplication() + { + return portletApplicationLifeCycle; + } + + public String toString() + { + return "PortletContainerLifeCycle[" + portletContainer.getId() + "]"; + } + + public PortletContainer getPortletContainer() + { + return portletContainer; + } + + protected ManagedObjectRegistryEventListener getListener() + { + return portletApplicationLifeCycle.getListener(); + } +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/container/PortletFilterLifeCycle.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/PortletFilterLifeCycle.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/PortletFilterLifeCycle.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -0,0 +1,115 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.impl.container; + +import org.jboss.portal.portlet.container.object.PortletFilterObject; +import org.jboss.portal.portlet.container.managed.LifeCycleStatus; +import org.jboss.portal.portlet.container.managed.ManagedPortletFilter; +import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= ntListener; +import org.jboss.portal.portlet.container.PortletFilterContext; +import org.jboss.portal.portlet.container.PortletFilter; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletFilterLifeCycle extends LifeCycle implements ManagedPo= rtletFilter +{ + + /** . */ + private PortletApplicationLifeCycle portletApplicationLifeCycle; + + /** . */ + final PortletFilterContext portletFilterContext; + + /** . */ + final PortletFilterObject portletFilter; + + PortletFilterLifeCycle( + PortletApplicationLifeCycle portletApplicationLifeCycle, + PortletFilterContext portletFilterContext, + PortletFilterObject portletFilter) + { + this.portletApplicationLifeCycle =3D portletApplicationLifeCycle; + this.portletFilterContext =3D portletFilterContext; + this.portletFilter =3D portletFilter; + } + + protected void invokeStart() throws Exception + { + if (portletApplicationLifeCycle.getStatus() !=3D LifeCycleStatus.STA= RTED) + { + throw new DependencyNotResolvedException("The parent application = is not started"); + } + + // + portletFilter.start(); + } + + protected void startDependents() + { + // Dependent containers may or not start (for instance if a containe= r depends on several filters) + for (PortletContainerLifeCycle portletContainerLifeCycle : portletAp= plicationLifeCycle.getDependencies(this)) + { + portletContainerLifeCycle.managedStart(); + } + } + + protected void stopDependents() + { + for (PortletContainerLifeCycle portletContainerLifeCycle : portletAp= plicationLifeCycle.getDependencies(this)) + { + portletContainerLifeCycle.managedStop(); + } + } + + protected void invokeStop() + { + portletFilter.stop(); + } + + public String getId() + { + return portletFilter.getId(); + } + + public PortletApplicationLifeCycle getManagedPortletApplication() + { + return portletApplicationLifeCycle; + } + + public String toString() + { + return "PortletFilterLifeCycle[" + portletFilter.getId() + "]"; + } + + public PortletFilter getPortletFilter() + { + return portletFilter; + } + + protected ManagedObjectRegistryEventListener getListener() + { + return portletApplicationLifeCycle.getListener(); + } +} Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/info/ContainerFilterInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerFilterInfo.java 2008-02-21 12:49:52 UTC (rev 10068) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerFilterInfo.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -42,7 +42,7 @@ private final String className; = /** . */ - private final Set lifeCycles; + private final Set phases; = /** . */ private final LocalizedString displayName; @@ -56,14 +56,14 @@ public ContainerFilterInfo( String name, String className, - Set lifeCycles, + Set phases, LocalizedString displayName, LocalizedString description, Map parameters) { this.name =3D name; this.className =3D className; - this.lifeCycles =3D lifeCycles; + this.phases =3D phases; this.displayName =3D displayName; this.description =3D description; this.parameters =3D parameters; @@ -79,9 +79,9 @@ return className; } = - public Set getLifeCycles() + public Set getPhases() { - return lifeCycles; + return phases; } = public LocalizedString getDisplayName() Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/ClassInstanceLifeCycle.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/ClassInstanceLifeCycle.java 2008-02-21 12:49:52 UTC (rev 10068) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/ClassInstanceLifeCycle.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -175,5 +175,4 @@ { = } - } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletApplicationImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletApplicationImpl.java 2008-02-21 12:49:52 UTC (rev 10068) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletApplicationImpl.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -36,25 +36,17 @@ import org.jboss.portal.portlet.container.PortletContainer; import org.jboss.portal.portlet.container.PortletInitializationException; import org.jboss.portal.portlet.container.object.PortletApplicationObject; -import org.jboss.portal.portlet.LifeCyclePhase; import org.apache.log4j.Logger; = import javax.portlet.PortletContext; import javax.portlet.PortletURLGenerationListener; import javax.portlet.filter.PortletFilter; -import javax.portlet.filter.ActionFilter; -import javax.portlet.filter.EventFilter; -import javax.portlet.filter.RenderFilter; -import javax.portlet.filter.ResourceFilter; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.Set; import java.util.List; import java.util.LinkedList; import java.util.Collections; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; = /** * @author Julien Viet @@ -63,17 +55,6 @@ public class PortletApplicationImpl implements PortletApplicationObject { = - private static final EnumMap> phaseToType =3D - new EnumMap>(LifeCycl= ePhase.class); - - static - { - phaseToType.put(LifeCyclePhase.ACTION, ActionFilter.class); - phaseToType.put(LifeCyclePhase.EVENT, EventFilter.class); - phaseToType.put(LifeCyclePhase.RENDER, RenderFilter.class); - phaseToType.put(LifeCyclePhase.RESOURCE, ResourceFilter.class); - } - /** . */ protected final ContainerPortletApplicationInfo info; = @@ -104,9 +85,6 @@ /** . */ protected PortletURLGenerationListener urlListener; = - /** . */ - protected Map filters; - /** * Todo remove meta data reference and use info instead. */ @@ -134,6 +112,16 @@ return metaData.getId(); } = + public void addFilter(org.jboss.portal.portlet.container.PortletFilter = filter) + { + + } + + public void removeFilter(org.jboss.portal.portlet.container.PortletFilt= er filter) + { + = + } + public ContainerPortletApplicationInfo getInfo() { return info; @@ -207,66 +195,16 @@ } = // - HashMap filters =3D new HashMap(); - for (ContainerFilterInfo filterInfo : info.getFilters().values()) - { - try - { - String className =3D filterInfo.getClassName(); - FilterLifecycle lifeCycle =3D new FilterLifecycle( - PortletFilter.class, - context.getClassLoader(), - className, - "filter", - filterInfo); - - // - lifeCycle.create(); - - // - for (LifeCyclePhase phase : filterInfo.getLifeCycles()) - { - Class type =3D phaseToType.get(pha= se); - - // - if (type.isInstance(lifeCycle.getInstance())) - { - FilterKey key =3D new FilterKey(filterInfo.getName(), ty= pe); - filters.put(key, lifeCycle); - } - else - { - log.error("Cannot realize filter mapping on phase " + ph= ase + " for filter " + filterInfo.getName() + - " with class " + className + " that does not implemen= t the interface " + type.getName()); - } - } - } - catch (PortletInitializationException e) - { - log.error(e.getMessage(), e); - } - } - - // this.version =3D metaData.getVersion(); this.portletContext =3D portletContext; this.urlListener =3D listeners.size() =3D=3D 0 ? null : new PortletU= RLGenerationListenerChain(Collections.unmodifiableList(listeners)); - this.filters =3D filters; } = public void stop() { - // Stop filters - for (FilterLifecycle filter : filters.values()) - { - filter.destroy(); - } - - // this.version =3D null; this.portletContext =3D null; this.urlListener =3D null; - this.filters =3D null; } = public String getVersion() @@ -290,6 +228,7 @@ return null; } = +/* public T getFilter(String filterName, Class phase) { FilterLifecycle lifeCycle =3D filters.get(new FilterKey(filterName, = phase)); @@ -303,6 +242,7 @@ // Should be ok return phase.cast(lifeCycle.getInstance()); } +*/ = // WebApp implementation **********************************************= ********************************************** = @@ -363,23 +303,28 @@ } } = - private class FilterLifecycle extends ClassInstanceLifeCycle + static class FilterLifecycle extends ClassInstanceLifeCycle { = /** . */ private final ContainerFilterInfo info; = - private FilterLifecycle( - Class expectedClass, + /** . */ + private final PortletContext portletContext; + + FilterLifecycle( + Logger log, ClassLoader classLoader, String className, String type, - ContainerFilterInfo info) + ContainerFilterInfo info, + PortletContext portletContext) { - super(log, expectedClass, classLoader, className, type); + super(log, PortletFilter.class, classLoader, className, type); = // this.info =3D info; + this.portletContext =3D portletContext; } = public void start(PortletFilter instance) throws Exception Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletContainerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletContainerImpl.java 2008-02-21 12:49:52 UTC (rev 10068) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletContainerImpl.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -86,6 +86,7 @@ import java.util.List; import java.util.ArrayList; import java.util.Collections; +import java.util.HashSet; = /** * @author Julien Viet @@ -139,6 +140,9 @@ /** . */ private PortletContainerContext context; = + /** . */ + private Set fil= ters; + /** * The preference validator, this is not exposed as runtime meta data a= s it is only used by the JSR 168 portlet * container implementation. @@ -157,6 +161,7 @@ this.valve =3D new Valve(); this.log =3D Logger.getLogger("org.jboss.portal.portlet.container." = + info.getClassName().replace('.', '_')); this.started =3D false; + this.filters =3D new HashSet(); } = public void setContext(PortletContainerContext context) @@ -185,6 +190,16 @@ return info.getName(); } = + public void addFilter(org.jboss.portal.portlet.container.PortletFilter = filter) + { + filters.add((PortletFilterImpl)filter); + } + + public void removeFilter(org.jboss.portal.portlet.container.PortletFilt= er filter) + { + filters.remove((PortletFilterImpl)filter); + } + public boolean isStarted() { return valve.getState() =3D=3D Valve.OPEN; @@ -308,8 +323,17 @@ ArrayList list =3D new ArrayList(); for (String filterRef : info.getFilterRefs()) { - T filter =3D application.getFilter(filterRef, type); - list.add(filter); + for (org.jboss.portal.portlet.impl.jsr168.PortletFilterImpl filte= r : filters) + { + if (filter.getId().equals(filterRef)) + { + T filterInstance =3D filter.instance(type); + if (filterInstance =3D=3D null) + { + list.add(filterInstance); + } + } + } } return list; } Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/jsr168/PortletFilterImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletFilterImpl.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletFilterImpl.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -0,0 +1,149 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.impl.jsr168; + +import org.jboss.portal.portlet.container.PortletApplication; +import org.jboss.portal.portlet.container.PortletFilterContext; +import org.jboss.portal.portlet.container.object.PortletFilterObject; +import org.jboss.portal.portlet.impl.info.ContainerFilterInfo; +import org.jboss.portal.portlet.LifeCyclePhase; +import org.apache.log4j.Logger; + +import javax.portlet.PortletContext; +import javax.portlet.filter.ActionFilter; +import javax.portlet.filter.EventFilter; +import javax.portlet.filter.RenderFilter; +import javax.portlet.filter.ResourceFilter; +import java.util.Map; +import java.util.HashMap; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletFilterImpl implements PortletFilterObject +{ + + /** . */ + private static final Map, LifeCyclePhase> typeToPhase =3D + new HashMap, Lif= eCyclePhase>(); + + static + { + typeToPhase.put(ActionFilter.class, LifeCyclePhase.ACTION); + typeToPhase.put(EventFilter.class, LifeCyclePhase.EVENT); + typeToPhase.put(RenderFilter.class, LifeCyclePhase.RENDER); + typeToPhase.put(ResourceFilter.class, LifeCyclePhase.RESOURCE); + } + + /** . */ + private final Logger log; + + /** . */ + private final ContainerFilterInfo info; + + /** . */ + private PortletFilterContext context; + + /** . */ + private PortletApplicationImpl application; + + /** . */ + private PortletApplicationImpl.FilterLifecycle lifeCycle; + + public PortletFilterImpl(ContainerFilterInfo info) + { + this.info =3D info; + this.log =3D Logger.getLogger(PortletFilterImpl.class); + } + + public T instance(Class type) + { + LifeCyclePhase phase =3D typeToPhase.get(type); + + // It means we can cast unless the developers did not implement the = correct interface + if (info.getPhases().contains(phase)) + { + if (type.isInstance(lifeCycle.getInstance())) + { + return type.cast(lifeCycle.getInstance()); + } + } + + // + return null; + } + + public ContainerFilterInfo getInfo() + { + return info; + } + + public String getId() + { + return null; + } + + public void setApplication(PortletApplication application) + { + this.application =3D (PortletApplicationImpl)application; + } + + public void setContext(PortletFilterContext context) + { + this.context =3D context; + } + + public void start() throws Exception + { + PortletContext portletContext =3D application.portletContext; + String className =3D info.getClassName(); + ClassLoader classLoader =3D application.getContext().getClassLoader(= ); + + // + PortletApplicationImpl.FilterLifecycle lifeCycle =3D new PortletAppl= icationImpl.FilterLifecycle( + log, + classLoader, + className, + "filter", + info, + portletContext); + + // + lifeCycle.create(); + + // + this.lifeCycle =3D lifeCycle; + } + + public void stop() + { + if (lifeCycle !=3D null) + { + lifeCycle.destroy(); + + // + lifeCycle =3D null; + } + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet= /container/LifeCycle1Test.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/LifeCycle1Test.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/LifeCycle1Test.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -0,0 +1,397 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container; + +import org.jboss.unit.api.pojo.annotations.Test; +import org.jboss.unit.api.pojo.annotations.Create; +import org.jboss.portal.portlet.impl.container.PortletApplicationLifeCycle; +import org.jboss.portal.portlet.impl.container.PortletFilterLifeCycle; +import org.jboss.portal.portlet.impl.container.PortletContainerLifeCycle; +import org.jboss.portal.portlet.container.managed.LifeCycleStatus; + +import static org.jboss.unit.api.Assert.*; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)Test +public class LifeCycle1Test +{ + + ManagedObjectRegistryEventList events; + + PortletApplicationObjectSupport application; + PortletApplicationLifeCycle applicationLC; + + PortletFilterObjectSupport filter; + PortletContainerObjectSupport container; + PortletFilterLifeCycle filterLC; + PortletContainerLifeCycle containerLC; + + @Create + public void create() + { + events =3D new ManagedObjectRegistryEventList(); + + application =3D new PortletApplicationObjectSupport("application"); + applicationLC =3D new PortletApplicationLifeCycle(events, new Portle= tApplicationContextSupport(), application); + + filter =3D new PortletFilterObjectSupport("filter2"); + container =3D new PortletContainerObjectSupport("container2"); + filterLC =3D applicationLC.addPortletFilter(new PortletFilterContext= Support(), filter); + containerLC =3D applicationLC.addPortletContainer(new PortletContain= erContextSupport(), container); + applicationLC.addDependency(filterLC, containerLC); + + applicationLC.create(); + } + + private void testState( + int applicationStarted, + int applicationStopped, + LifeCycleStatus applicationStatus, + int containerStarted, + int containerStopped, + LifeCycleStatus containerStatus, + int filterStarted, + int filterStopped, + LifeCycleStatus filterStatus + ) + { + assertEquals(applicationStarted, application.getStarted()); + assertEquals(applicationStopped, application.getStopped()); + assertEquals(applicationStatus, applicationLC.getStatus()); + assertEquals(containerStarted, container.getStarted()); + assertEquals(containerStopped, container.getStopped()); + assertEquals(containerStatus, containerLC.getStatus()); + assertEquals(filterStarted, filter.getStarted()); + assertEquals(filterStopped, filter.getStopped()); + assertEquals(filterStatus, filterLC.getStatus()); + } + + @Test + public void testWiring() + { + events.assertAddedEvent(filterLC); + events.assertAddedEvent(containerLC); + events.assertEmpty(); + + assertEquals(1, application.containers.size()); + assertSame(container, application.containers.get(container.getId())); + assertEquals(1, application.filters.size()); + assertSame(filter, application.filters.get(filter.getId())); + + // + assertSame(application, filter.application); + + // + assertSame(application, container.application); + assertEquals(1, container.filters.size()); + assertSame(filter, container.filters.get(filter.getId())); + } + + @Test + public void testApplicationLifeCycle() + { + events.clear(); + + // + applicationLC.managedStart(); + + // + testState(1, 0, LifeCycleStatus.STARTED, 1, 0, LifeCycleStatus.START= ED, 1, 0, LifeCycleStatus.STARTED); + events.assertStartedEvent(applicationLC); + events.assertStartedEvent(filterLC); + events.assertStartedEvent(containerLC); + events.assertEmpty(); + + // + applicationLC.managedStart(); + + // + testState(1, 0, LifeCycleStatus.STARTED, 1, 0, LifeCycleStatus.START= ED, 1, 0, LifeCycleStatus.STARTED); + events.assertEmpty(); + + // + applicationLC.managedStop(); + + // + testState(1, 1, LifeCycleStatus.STOPPED, 1, 1, LifeCycleStatus.STOPP= ED, 1, 1, LifeCycleStatus.STOPPED); + events.assertStoppedEvent(containerLC); + events.assertStoppedEvent(filterLC); + events.assertStoppedEvent(applicationLC); + events.assertEmpty(); + } + + @Test + public void testFilterLifeCycle() + { + events.clear(); + + // + applicationLC.managedStart(); + + // + events.clear(); + + // Filter stop triggers + filterLC.managedStop(); + + // + testState(1, 0, LifeCycleStatus.STARTED, 1, 1, LifeCycleStatus.STOPP= ED, 1, 1, LifeCycleStatus.STOPPED); + events.assertStoppedEvent(containerLC); + events.assertStoppedEvent(filterLC); + events.assertEmpty(); + + // Container does not start if its filter is stopped + containerLC.managedStart(); + + // + testState(1, 0, LifeCycleStatus.STARTED, 1, 1, LifeCycleStatus.STOPP= ED, 1, 1, LifeCycleStatus.STOPPED); + events.assertEmpty(); + + // Filter start triggers container start + filterLC.managedStart(); + + // + testState(1, 0, LifeCycleStatus.STARTED, 2, 1, LifeCycleStatus.START= ED, 2, 1, LifeCycleStatus.STARTED); + events.assertStartedEvent(filterLC); + events.assertStartedEvent(containerLC); + events.assertEmpty(); + } + + @Test + public void testContainerLifeCycle() + { + events.clear(); + + // + applicationLC.managedStart(); + + // + events.clear(); + + // + containerLC.managedStop(); + + // + testState(1, 0, LifeCycleStatus.STARTED, 1, 1, LifeCycleStatus.STOPP= ED, 1, 0, LifeCycleStatus.STARTED); + events.assertStoppedEvent(containerLC); + events.assertEmpty(); + + // + containerLC.managedStart(); + + // + testState(1, 0, LifeCycleStatus.STARTED, 2, 1, LifeCycleStatus.START= ED, 1, 0, LifeCycleStatus.STARTED); + events.assertStartedEvent(containerLC); + events.assertEmpty(); + } + + @Test + public void testContainerFailsOnStart() + { + events.clear(); + + // + container.failOnStart =3D true; + + // + applicationLC.managedStart(); + + // + testState(1, 0, LifeCycleStatus.STARTED, 1, 0, LifeCycleStatus.FAILE= D, 1, 0, LifeCycleStatus.STARTED); + events.assertStartedEvent(applicationLC); + events.assertStartedEvent(filterLC); + events.assertFailedEvent(containerLC); + events.assertEmpty(); + + // + applicationLC.managedStop(); + + // + testState(1, 1, LifeCycleStatus.STOPPED, 1, 0, LifeCycleStatus.FAILE= D, 1, 1, LifeCycleStatus.STOPPED); + events.assertStoppedEvent(filterLC); + events.assertStoppedEvent(applicationLC); + events.assertEmpty(); + + // + applicationLC.managedStart(); + + // + testState(2, 1, LifeCycleStatus.STARTED, 2, 0, LifeCycleStatus.FAILE= D, 2, 1, LifeCycleStatus.STARTED); + events.assertStartedEvent(applicationLC); + events.assertStartedEvent(filterLC); + events.assertEmpty(); + + // + containerLC.managedStart(); + + // + testState(2, 1, LifeCycleStatus.STARTED, 3, 0, LifeCycleStatus.FAILE= D, 2, 1, LifeCycleStatus.STARTED); + events.assertEmpty(); + + // + containerLC.managedStop(); + + // + testState(2, 1, LifeCycleStatus.STARTED, 3, 0, LifeCycleStatus.FAILE= D, 2, 1, LifeCycleStatus.STARTED); + events.assertEmpty(); + + // + filterLC.managedStop(); + + // + testState(2, 1, LifeCycleStatus.STARTED, 3, 0, LifeCycleStatus.FAILE= D, 2, 2, LifeCycleStatus.STOPPED); + events.assertStoppedEvent(filterLC); + events.assertEmpty(); + + // + filterLC.managedStart(); + + // + testState(2, 1, LifeCycleStatus.STARTED, 4, 0, LifeCycleStatus.FAILE= D, 3, 2, LifeCycleStatus.STARTED); + events.assertStartedEvent(filterLC); + events.assertEmpty(); + } + + @Test + public void testApplicationFailsOnStart() + { + events.clear(); + + // + application.failOnStart =3D true; + + // + applicationLC.managedStart(); + + // + testState(1, 0, LifeCycleStatus.FAILED, 0, 0, LifeCycleStatus.STOPPE= D, 0, 0, LifeCycleStatus.STOPPED); + events.assertFailedEvent(applicationLC); + events.assertEmpty(); + + // + applicationLC.managedStart(); + + // + testState(2, 0, LifeCycleStatus.FAILED, 0, 0, LifeCycleStatus.STOPPE= D, 0, 0, LifeCycleStatus.STOPPED); + events.assertEmpty(); + + // + applicationLC.managedStop(); + + // + testState(2, 0, LifeCycleStatus.FAILED, 0, 0, LifeCycleStatus.STOPPE= D, 0, 0, LifeCycleStatus.STOPPED); + events.assertEmpty(); + } + + @Test + public void testFilterFailsOnStart() + { + events.clear(); + + // + filter.failOnStart =3D true; + + // + applicationLC.managedStart(); + + // + testState(1, 0, LifeCycleStatus.STARTED, 0, 0, LifeCycleStatus.STOPP= ED, 1, 0, LifeCycleStatus.FAILED); + events.assertStartedEvent(applicationLC); + events.assertFailedEvent(filterLC); + events.assertEmpty(); + + // + applicationLC.managedStop(); + + // + testState(1, 1, LifeCycleStatus.STOPPED, 0, 0, LifeCycleStatus.STOPP= ED, 1, 0, LifeCycleStatus.FAILED); + events.assertStoppedEvent(applicationLC); + events.assertEmpty(); + + // + applicationLC.managedStart(); + + // + testState(2, 1, LifeCycleStatus.STARTED, 0, 0, LifeCycleStatus.STOPP= ED, 2, 0, LifeCycleStatus.FAILED); + events.assertStartedEvent(applicationLC); + events.assertEmpty(); + + // + filterLC.managedStart(); + + // + testState(2, 1, LifeCycleStatus.STARTED, 0, 0, LifeCycleStatus.STOPP= ED, 3, 0, LifeCycleStatus.FAILED); + events.assertEmpty(); + + // + filterLC.managedStop(); + + // + testState(2, 1, LifeCycleStatus.STARTED, 0, 0, LifeCycleStatus.STOPP= ED, 3, 0, LifeCycleStatus.FAILED); + events.assertEmpty(); + + // + filterLC.managedStart(); + + // + testState(2, 1, LifeCycleStatus.STARTED, 0, 0, LifeCycleStatus.STOPP= ED, 4, 0, LifeCycleStatus.FAILED); + events.assertEmpty(); + + // + containerLC.managedStart(); + + // + testState(2, 1, LifeCycleStatus.STARTED, 0, 0, LifeCycleStatus.STOPP= ED, 4, 0, LifeCycleStatus.FAILED); + events.assertEmpty(); + } + + @Test + public void testContainerFailsOnStop() + { + container.failOnStop =3D true; + + // + testApplicationLifeCycle(); + } + + @Test + public void testApplicationFailsOnStop() + { + application.failOnStop =3D true; + + // + testApplicationLifeCycle(); + } + + @Test + public void testFilterFailsOnStop() + { + filter.failOnStop =3D true; + + // + testApplicationLifeCycle(); + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet= /container/ManagedObjectRegistryEventList.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/ManagedObjectRegistryEventList.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/ManagedObjectRegistryEventList.java 2008-02-21 22:21:37 UTC (rev 10= 069) @@ -0,0 +1,94 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container; + +import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= ntListener; +import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= nt; +import org.jboss.portal.portlet.container.managed.ManagedObject; +import org.jboss.portal.portlet.container.managed.ManagedObjectAddedEvent; +import org.jboss.portal.portlet.container.managed.LifeCycleStatus; +import org.jboss.portal.portlet.container.managed.ManagedObjectLifeCycleEv= ent; + +import java.util.LinkedList; + +import static org.jboss.unit.api.Assert.*; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ManagedObjectRegistryEventList implements ManagedObjectRegist= ryEventListener +{ + + /** . */ + final LinkedList list =3D new LinkedList(); + + public void onEvent(ManagedObjectRegistryEvent event) + { + list.add(event); + } + + public void assertAddedEvent(ManagedObject managedObject) + { + ManagedObjectAddedEvent event =3D nextEvent(ManagedObjectAddedEvent.= class); + assertSame(managedObject, event.getManagedObject()); + } + + public void assertStartedEvent(ManagedObject managedObject) + { + assertLifeCycleEvent(managedObject, LifeCycleStatus.STARTED); + } + + public void assertStoppedEvent(ManagedObject managedObject) + { + assertLifeCycleEvent(managedObject, LifeCycleStatus.STOPPED); + } + + public void assertFailedEvent(ManagedObject managedObject) + { + assertLifeCycleEvent(managedObject, LifeCycleStatus.FAILED); + } + + public void assertLifeCycleEvent(ManagedObject managedObject, LifeCycle= Status status) + { + ManagedObjectLifeCycleEvent event =3D nextEvent(ManagedObjectLifeCyc= leEvent.class); + assertSame(managedObject, event.getManagedObject()); + assertEquals(status, event.getStatus()); + } + + public void assertEmpty() + { + assertTrue(list.isEmpty()); + } + + public void clear() + { + list.clear(); + } + + private T nextEvent(Class typ= e) + { + assertFalse(list.isEmpty()); + return assertInstanceOf(list.removeFirst(), type); + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet= /container/ObjectSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/ObjectSupport.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/ObjectSupport.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -0,0 +1,90 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ObjectSupport +{ + + /** . */ + private final String id; + + /** . */ + private int started; + + /** . */ + private int stopped; + + /** . */ + boolean failOnStart; + + /** . */ + boolean failOnStop; + + public ObjectSupport(String id) + { + this.id =3D id; + this.failOnStart =3D false; + this.failOnStop =3D false; + } + + public String getId() + { + return id; + } + + public int getStarted() + { + return started; + } + + public int getStopped() + { + return stopped; + } + + public void start() throws Exception + { + started++; + + // + if (failOnStart) + { + throw new RuntimeException(); + } + } + + public void stop() + { + stopped++; + + // + if (failOnStop) + { + throw new RuntimeException(); + } + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet= /container/PortletApplicationContextSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletApplicationContextSupport.java (rev = 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletApplicationContextSupport.java 2008-02-21 22:21:37 UTC (rev = 10069) @@ -0,0 +1,47 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container; + +import javax.servlet.ServletContext; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletApplicationContextSupport implements PortletApplicatio= nContext +{ + public ServletContext getServletContext() + { + throw new UnsupportedOperationException(); + } + + public String getContextPath() + { + throw new UnsupportedOperationException(); + } + + public ClassLoader getClassLoader() + { + throw new UnsupportedOperationException(); + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet= /container/PortletApplicationObjectSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletApplicationObjectSupport.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletApplicationObjectSupport.java 2008-02-21 22:21:37 UTC (rev 1= 0069) @@ -0,0 +1,123 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container; + +import org.jboss.portal.portlet.container.object.PortletApplicationObject; + +import java.util.Collection; +import java.util.Map; +import java.util.HashMap; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletApplicationObjectSupport extends ObjectSupport impleme= nts PortletApplicationObject +{ + + /** . */ + final Map containers =3D new HashMap(); + + /** . */ + final Map filters =3D new HashMap(); + + /** . */ + PortletApplicationContext context; + + public PortletApplicationObjectSupport(String id) + { + super(id); + } + + public void setContext(PortletApplicationContext context) + { + this.context =3D context; + } + + public PortletApplicationContext getContext() + { + throw new UnsupportedOperationException(); + } + + public void addContainer(PortletContainer container) + { + if (container =3D=3D null) + { + throw new AssertionError(); + } + if (containers.containsKey(container.getId())) + { + throw new AssertionError(); + } + containers.put(container.getId(), container); + } + + public void removeContainer(PortletContainer container) + { + if (container =3D=3D null) + { + throw new AssertionError(); + } + if (!containers.containsKey(container.getId())) + { + throw new AssertionError(); + } + containers.remove(container.getId()); + } + + public void addFilter(PortletFilter filter) + { + if (filter =3D=3D null) + { + throw new AssertionError(); + } + if (filters.containsKey(filter.getId())) + { + throw new AssertionError(); + } + filters.put(filter.getId(), filter); + } + + public void removeFilter(PortletFilter filter) + { + if (filter =3D=3D null) + { + throw new AssertionError(); + } + if (!filters.containsKey(filter.getId())) + { + throw new AssertionError(); + } + filters.remove(filter.getId()); + } + + public Collection getPortletContainers() + { + throw new UnsupportedOperationException(); + } + + public PortletContainer getPortletContainer(String containerId) + { + throw new UnsupportedOperationException(); + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet= /container/PortletContainerContextSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletContainerContextSupport.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletContainerContextSupport.java 2008-02-21 22:21:37 UTC (rev 10= 069) @@ -0,0 +1,31 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletContainerContextSupport implements PortletContainerCon= text +{ +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet= /container/PortletContainerObjectSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletContainerObjectSupport.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletContainerObjectSupport.java 2008-02-21 22:21:37 UTC (rev 100= 69) @@ -0,0 +1,111 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container; + +import org.jboss.portal.portlet.container.object.PortletContainerObject; +import org.jboss.portal.portlet.info.PortletInfo; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.common.invocation.InvocationException; + +import java.util.Map; +import java.util.HashMap; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletContainerObjectSupport extends ObjectSupport implement= s PortletContainerObject +{ + + /** . */ + final Map filters =3D new HashMap(); + + /** . */ + PortletApplication application; + + /** . */ + PortletContainerContext context; + + public PortletContainerObjectSupport(String id) + { + super(id); + } + + public void setApplication(PortletApplication application) + { + this.application =3D application; + } + + public void setContext(PortletContainerContext context) + { + this.context =3D context; + } + + public void addFilter(PortletFilter filter) + { + if (filter =3D=3D null) + { + throw new AssertionError(); + } + if (filters.containsKey(filter.getId())) + { + throw new AssertionError(); + } + filters.put(filter.getId(), filter); + } + + public void removeFilter(PortletFilter filter) + { + if (filter =3D=3D null) + { + throw new AssertionError(); + } + if (!filters.containsKey(filter.getId())) + { + throw new AssertionError(); + } + filters.remove(filter.getId()); + } + + public PortletInfo getInfo() + { + throw new UnsupportedOperationException(); + } + + public PortletInvocationResponse dispatch(PortletInvocation invocation)= throws PortletInvokerException, InvocationException + { + throw new UnsupportedOperationException(); + } + + public PortletApplication getApplication() + { + throw new UnsupportedOperationException(); + } + + public PortletContainerContext getContext() + { + throw new UnsupportedOperationException(); + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet= /container/PortletFilterContextSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletFilterContextSupport.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletFilterContextSupport.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -0,0 +1,31 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletFilterContextSupport implements PortletFilterContext +{ +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet= /container/PortletFilterObjectSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletFilterObjectSupport.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletFilterObjectSupport.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -0,0 +1,54 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container; + +import org.jboss.portal.portlet.container.object.PortletFilterObject; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletFilterObjectSupport extends ObjectSupport implements P= ortletFilterObject +{ + + /** . */ + PortletApplication application; + + /** . */ + PortletFilterContext context; + + public PortletFilterObjectSupport(String id) + { + super(id); + } + + public void setApplication(PortletApplication application) + { + this.application =3D application; + } + + public void setContext(PortletFilterContext context) + { + this.context =3D context; + } +} Modified: modules/portlet/trunk/portlet/src/test/resources/local-jboss-unit= .xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/resources/local-jboss-unit.xml 2= 008-02-21 12:49:52 UTC (rev 10068) +++ modules/portlet/trunk/portlet/src/test/resources/local-jboss-unit.xml 2= 008-02-21 22:21:37 UTC (rev 10069) @@ -4,6 +4,7 @@ xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=3D"urn:jboss:jboss-unit:1.0 jboss-unit_1_0.xsd"> + + + + Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/po= rtal/samples/basic/FailDuringInitPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/FailDuringInitPortlet.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/FailDuringInitPortlet.java 2008-02-21 22:21:37 UTC (rev 100= 69) @@ -0,0 +1,53 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.samples.basic; + +import javax.portlet.GenericPortlet; +import javax.portlet.PortletException; + +/** + * A portlet that will fail only one time during startup (so it is possibl= e to restart it). + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class FailDuringInitPortlet extends GenericPortlet +{ + + private static int initCount =3D 0; + + public void init() throws PortletException + { + if (initCount =3D=3D 0) + { + initCount =3D 1; + + // + throw new PortletException(); + } + else + { + // Nothing + } + } +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/KernelObject.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelObject.java 2008-02-21 12:49:52 UTC (rev 10068) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelObject.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -1,125 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test; - -import org.jboss.kernel.spi.dependency.KernelControllerContextAware; -import org.jboss.kernel.spi.dependency.KernelControllerContext; -import org.jboss.dependency.spi.ControllerState; -import org.jboss.portal.portlet.container.managed.ManagedObject; -import org.jboss.portal.portlet.container.managed.ManagedObjectStatus; - -import java.lang.reflect.UndeclaredThrowableException; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class KernelObject implements ManagedObject, KernelControllerContex= tAware -{ - - /** . */ - private KernelControllerContext controllerContext; - - public final void setKernelControllerContext(KernelControllerContext co= ntrollerContext) throws Exception - { - this.controllerContext =3D controllerContext; - } - - public final void unsetKernelControllerContext(KernelControllerContext = controllerContext) throws Exception - { - this.controllerContext =3D null; - } - - public final ManagedObjectStatus getStatus() - { - ControllerState state =3D controllerContext.getState(); - - // - if (state =3D=3D ControllerState.INSTALLED) - { - return ManagedObjectStatus.STARTED; - } - else if (state =3D=3D ControllerState.ERROR) - { - return ManagedObjectStatus.FAILED; - } - else - { - return ManagedObjectStatus.STOPPED; - } - } - - public final void managedStart() throws Exception - { - controllerStart(); - } - - public final void managedStop() - { - controllerStop(); - } - - protected final void controllerStart() throws Exception - { - if (controllerContext =3D=3D null) - { - throw new IllegalStateException("No under the controller of the k= ernel"); - } - - // - try - { - controllerContext.getController().change(controllerContext, Contr= ollerState.INSTALLED); - } - catch (Throwable throwable) - { - if (throwable instanceof Exception) - { - throw ((Exception)throwable); - } - if (throwable instanceof Error) - { - throw ((Error)throwable); - } - throw new UndeclaredThrowableException(throwable); - } - } - - protected final void controllerStop() - { - if (controllerContext =3D=3D null) - { - throw new IllegalStateException("No under the controller of the k= ernel"); - } - - // - try - { - controllerContext.getController().change(controllerContext, Contr= ollerState.CREATE); - } - catch (Throwable throwable) - { - throwable.printStackTrace(); - } - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/KernelPortletApplication.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelPortletApplication.java 2008-02-21 12:49:52 UTC (rev 10068) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelPortletApplication.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -1,165 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test; - -import org.jboss.portal.portlet.container.PortletApplicationContext; -import org.jboss.portal.portlet.container.PortletApplication; -import org.jboss.portal.portlet.container.PortletContainer; -import org.jboss.portal.portlet.container.object.PortletApplicationObject; -import org.jboss.portal.portlet.container.managed.ManagedPortletApplicatio= n; -import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; -import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo; -import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; -import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory; -import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl; -import org.jboss.portal.portlet.metadata.JBossApplicationMetaData; -import org.jboss.portal.web.WebApp; - -import javax.servlet.ServletContext; -import java.util.Map; -import java.util.HashMap; -import java.util.Collection; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class KernelPortletApplication extends KernelObject implements Port= letApplicationContext, ManagedPortletApplication, PortletApplication -{ - - /** . */ - private final WebApp webApp; - - /** . */ - final PortletApplicationObject portletApplication; - - /** . */ - private final Map kernelPortletContaine= rs; - - public KernelPortletApplication( - ContainerPortletApplicationInfo info, - PortletApplication10MetaData metaData, - JBossApplicationMetaData jbossMetaData, - PortletAPIFactory portletAPIFactory, - WebApp webApp) - { - this.webApp =3D webApp; - this.portletApplication =3D new PortletApplicationImpl(info, metaDat= a, jbossMetaData, portletAPIFactory); - this.kernelPortletContainers =3D new HashMap(); - - // - portletApplication.setContext(this); - } - - public void addKernelPortletContainer(KernelPortletContainer kernelPort= letContainer) - { - kernelPortletContainers.put(kernelPortletContainer.getPortletContain= er().getId(), kernelPortletContainer); - - // - portletApplication.addContainer(kernelPortletContainer.portletContai= ner); - } - - public void removeKernelPortletContainer(KernelPortletContainer kernelP= ortletContainer) - { - portletApplication.removeContainer(kernelPortletContainer.portletCon= tainer); - - // - kernelPortletContainers.remove(kernelPortletContainer.getPortletCont= ainer().getId()); - } - - public PortletApplication getPortletApplication() - { - return portletApplication; - } - - public void start() throws Exception - { - portletApplication.start(); - } - - public void stop() - { - portletApplication.stop(); - } - - // PortletApplicationContext ******************************************= ********************************************** - - public ServletContext getServletContext() - { - return webApp.getServletContext(); - } - - public String getContextPath() - { - return webApp.getContextPath(); - } - - public ClassLoader getClassLoader() - { - return webApp.getClassLoader(); - } - - public void invokeStart() throws Exception - { - controllerStart(); - } - - public void invokeStop() - { - controllerStop(); - } - - // - - public String getId() - { - return portletApplication.getId(); - } - - public Collection getManagedPortletC= ontainers() - { - return kernelPortletContainers.values(); - } - - public ManagedPortletContainer getManagedPortletContainer(String portle= tContainerId) - { - return kernelPortletContainers.get(portletContainerId); - } - - // PortletApplication *************************************************= ********************************************** - - public Collection getPortletContainers() - { - return kernelPortletContainers.values(); - } - - public PortletContainer getPortletContainer(String containerId) - { - return kernelPortletContainers.get(containerId); - } - - public PortletApplicationContext getContext() - { - return this; - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/KernelPortletContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelPortletContainer.java 2008-02-21 12:49:52 UTC (rev 10068) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= KernelPortletContainer.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -1,142 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test; - -import org.jboss.portal.portlet.container.PortletContainerContext; -import org.jboss.portal.portlet.container.PortletContainer; -import org.jboss.portal.portlet.container.PortletApplication; -import org.jboss.portal.portlet.container.object.PortletContainerObject; -import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; -import org.jboss.portal.portlet.container.managed.ManagedPortletApplicatio= n; -import org.jboss.portal.portlet.info.PortletInfo; -import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.invocation.PortletInvocation; -import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.impl.info.ContainerPortletInfo; -import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl; -import org.jboss.portal.common.invocation.InvocationException; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class KernelPortletContainer extends KernelObject implements Portle= tContainerContext, ManagedPortletContainer, PortletContainer -{ - - /** . */ - final PortletContainerObject portletContainer; - - /** . */ - private KernelPortletApplication kernelPortletApplication; - - public KernelPortletContainer(ContainerPortletInfo info) - { - portletContainer =3D new PortletContainerImpl(info); - - // - portletContainer.setContext(this); - } - - public KernelPortletApplication getKernelPortletApplication() - { - return kernelPortletApplication; - } - - public void setKernelPortletApplication(KernelPortletApplication kernel= PortletApplication) - { - this.kernelPortletApplication =3D kernelPortletApplication; - - // - if (kernelPortletApplication !=3D null) - { - portletContainer.setApplication(kernelPortletApplication.portletA= pplication); - } - else - { - portletContainer.setApplication(null); - } - } - - public PortletContainer getPortletContainer() - { - return portletContainer; - } - - public void start() throws Exception - { - portletContainer.start(); - } - - public void stop() - { - portletContainer.stop(); - } - - // - - public void invokeStart() throws Exception - { - controllerStart(); - } - - public void invokeStop() - { - controllerStop(); - } - - // - - public String getId() - { - return portletContainer.getId(); - } - - // - - public ManagedPortletApplication getManagedPortletApplication() - { - return kernelPortletApplication; - } - - public PortletInfo getInfo() - { - return portletContainer.getInfo(); - } - - // PortletContainer implementation ************************************= ********************************************** - - public PortletInvocationResponse dispatch(PortletInvocation invocation)= throws PortletInvokerException, InvocationException - { - return portletContainer.dispatch(invocation); - } - - public PortletApplication getApplication() - { - return kernelPortletApplication; - } - - public PortletContainerContext getContext() - { - return this; - } -} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/PortletApplicationContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationContextImpl.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationContextImpl.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -0,0 +1,59 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test; + +import org.jboss.portal.portlet.container.PortletApplicationContext; +import org.jboss.portal.web.WebApp; + +import javax.servlet.ServletContext; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletApplicationContextImpl implements PortletApplicationCo= ntext +{ + + /** . */ + private final WebApp webApp; + + public PortletApplicationContextImpl(WebApp webApp) + { + this.webApp =3D webApp; + } + + public ServletContext getServletContext() + { + return webApp.getServletContext(); + } + + public String getContextPath() + { + return webApp.getContextPath(); + } + + public ClassLoader getClassLoader() + { + return webApp.getClassLoader(); + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortletApplicationDeployer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployer.java 2008-02-21 12:49:52 UTC (rev 10068) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployer.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -23,15 +23,24 @@ package org.jboss.portal.portlet.test; = import org.apache.log4j.Logger; -import org.jboss.kernel.Kernel; -import org.jboss.kernel.spi.dependency.KernelControllerContext; -import org.jboss.kernel.spi.dependency.KernelControllerContextAware; import org.jboss.portal.common.io.IOTools; import org.jboss.portal.portlet.container.managed.PortletApplicationRegist= ry; import org.jboss.portal.portlet.container.managed.ManagedPortletApplicatio= n; +import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= ntBroadcaster; +import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= ntListener; +import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= nt; +import org.jboss.portal.portlet.container.managed.ManagedObjectAddedEvent; +import org.jboss.portal.portlet.container.managed.ManagedObjectEvent; +import org.jboss.portal.portlet.container.managed.ManagedObject; +import org.jboss.portal.portlet.container.managed.ManagedObjectLifeCycleEv= ent; +import org.jboss.portal.portlet.container.managed.LifeCycleStatus; +import org.jboss.portal.portlet.container.PortletContainerInvoker; +import org.jboss.portal.portlet.container.PortletContainer; import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConsta= nts.PORTLET_JSR_168_NS; import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConsta= nts.PORTLET_JSR_286_NS; +import org.jboss.portal.portlet.impl.container.PortletApplicationLifeCycle; +import org.jboss.portal.portlet.impl.container.PortletContainerLifeCycle; import org.jboss.portal.portlet.test.metadata.factory.PortletApplicationMo= delFactory; import org.jboss.portal.portlet.test.metadata.impl.AnnotationPortletApplic= ation10MetaData; import org.jboss.portal.portlet.test.metadata.impl.AnnotationPortletApplic= ation20MetaData; @@ -58,7 +67,7 @@ * @author Julien Viet * @version $Revision: 1.1 $ */ -public class PortletApplicationDeployer implements WebAppListener, KernelC= ontrollerContextAware, PortletApplicationRegistry +public class PortletApplicationDeployer implements WebAppListener, Portlet= ApplicationRegistry { = static @@ -90,17 +99,20 @@ private ServletContainer servletContainer; = /** . */ - private KernelControllerContext controllerContext; - - /** . */ private Map deploymentMap =3D new= HashMap(); = /** . */ private ClassLoader classLoader; = /** . */ - private final Map applications =3D ne= w HashMap(); + private final Map applications =3D= new HashMap(); = + /** . */ + private PortletContainerInvoker portletContainerInvoker; + + /** . */ + private ManagedObjectRegistryEventBroadcaster broadcaster; + public PortletApplicationRegistry getRegistry() { return registry; @@ -121,6 +133,16 @@ this.servletContainer =3D servletContainer; } = + public PortletContainerInvoker getPortletContainerInvoker() + { + return portletContainerInvoker; + } + + public void setPortletContainerInvoker(PortletContainerInvoker portletC= ontainerInvoker) + { + this.portletContainerInvoker =3D portletContainerInvoker; + } + public void onEvent(WebAppEvent event) { if (event instanceof WebAppLifeCycleEvent) @@ -160,10 +182,13 @@ try { Thread.currentThread().setContextClassLoader(classLoader); - Kernel kernel =3D controllerContext.getKernel(); - PortletApplicationDeployment deployment =3D new PortletApplica= tionDeployment(kernel, webApp, metaData); + PortletApplicationDeployment deployment =3D new PortletApplica= tionDeployment(broadcaster, webApp, metaData); deploymentMap.put(webApp.getContextPath(), deployment); deployment.install(); + + // + PortletApplicationLifeCycle portletApplicationLifeCycle =3D de= ployment.getPortletApplicationLifeCycle(); + applications.put(portletApplicationLifeCycle.getId(), portletA= pplicationLifeCycle); } finally { @@ -177,6 +202,10 @@ PortletApplicationDeployment deployment =3D deploymentMap.remove(web= App.getContextPath()); if (deployment !=3D null) { + PortletApplicationLifeCycle portletApplicationLifeCycle =3D deplo= yment.getPortletApplicationLifeCycle(); + applications.remove(portletApplicationLifeCycle.getId()); + + // ClassLoader oldCL =3D Thread.currentThread().getContextClassLoade= r(); try { @@ -190,36 +219,25 @@ } } = - public void setKernelControllerContext(KernelControllerContext controll= erContext) throws Exception - { - log.debug("Set controller context " + controllerContext); - - // - this.controllerContext =3D controllerContext; - } - - public void unsetKernelControllerContext(KernelControllerContext contro= llerContext) throws Exception - { - log.debug("Unset controller context " + controllerContext); - - // - this.controllerContext =3D null; - } - public void start() { + broadcaster =3D new ManagedObjectRegistryEventBroadcaster(); classLoader =3D Thread.currentThread().getContextClassLoader(); = // + broadcaster.addListener(bridgeToInvoker); servletContainer.addWebAppListener(this); } = public void stop() { + // This should generate remove web app event and in cascade clear th= e registry + // as well as the portlet container invoker servletContainer.removeWebAppListener(this); = // classLoader =3D null; + broadcaster =3D null; } = private PortletApplication10MetaData buildPortletApplicationMetaData(We= bApp webApp) @@ -267,53 +285,64 @@ return null; } = - /** - * Called by MC to install application. - * - * @param kernelPortletApplication kernel portlet application - */ - public void addKernelPortletApplication(KernelPortletApplication kernel= PortletApplication) + public Collection getManagedPortle= tApplications() { - applications.put(kernelPortletApplication.getId(), kernelPortletAppl= ication); + return applications.values(); } = - /** - * Called by MC to uninstall application. - * - * @param kernelPortletApplication kernel portlet application - */ - public void removeKernelPortletApplication(KernelPortletApplication ker= nelPortletApplication) + public ManagedPortletApplication getManagedPortletApplication(String id) { - applications.remove(kernelPortletApplication.getId()); + return applications.get(id); } = - /** - * Called by MC to install application. - * - * @param kernelPortletContainer kernel portlet container - */ - public void addKernelPortletContainer(KernelPortletContainer kernelPort= letContainer) + public void addListener(ManagedObjectRegistryEventListener listener) { - // To be used for life cycle events + broadcaster.addListener(listener); } = - /** - * Called by MC to uninstall application. - * - * @param kernelPortletContainer kernel portlet container - */ - public void removeKernelPortletContainer(KernelPortletContainer kernelP= ortletContainer) + public void removeListener(ManagedObjectRegistryEventListener listener) { - // To be used for life cycle events + broadcaster.addListener(listener); } = - public Collection getManagedPortle= tApplications() + /** + * Bridge managed object event to add/remove portlet container in portl= et container invoker. + */ + private final ManagedObjectRegistryEventListener bridgeToInvoker =3D ne= w ManagedObjectRegistryEventListener() { - return applications.values(); - } + public void onEvent(ManagedObjectRegistryEvent event) + { + if (event instanceof ManagedObjectEvent) + { + ManagedObjectEvent managedObjectEvent =3D (ManagedObjectEvent)= event; + ManagedObject managedObject =3D managedObjectEvent.getManagedO= bject(); = - public ManagedPortletApplication getManagedPortletApplication(String id) - { - return applications.get(id); - } + // + if (managedObject instanceof PortletContainerLifeCycle) + { + PortletContainerLifeCycle portletContainerLifeCycle =3D (Po= rtletContainerLifeCycle)managedObject; + PortletContainer portletContainer =3D portletContainerLifeC= ycle.getPortletContainer(); + + // + if (managedObjectEvent instanceof ManagedObjectLifeCycleEve= nt) + { + ManagedObjectLifeCycleEvent lifeCycleEvent =3D (ManagedO= bjectLifeCycleEvent)managedObjectEvent; + + // + LifeCycleStatus status =3D lifeCycleEvent.getStatus(); + + // + if (status =3D=3D LifeCycleStatus.STARTED) + { + portletContainerInvoker.addPortletContainer(portletCo= ntainer); + } + else + { + portletContainerInvoker.removePortletContainer(portle= tContainer); + } + } + } + } + } + }; } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortletApplicationDeployment.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployment.java 2008-02-21 12:49:52 UTC (rev 10068) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployment.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -23,38 +23,29 @@ package org.jboss.portal.portlet.test; = import org.apache.log4j.Logger; -import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; -import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; -import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; -import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData; -import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; -import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; -import org.jboss.beans.metadata.plugins.AbstractInstallMetaData; -import org.jboss.beans.metadata.plugins.ThisValueMetaData; -import org.jboss.beans.metadata.spi.ParameterMetaData; -import org.jboss.beans.metadata.spi.PropertyMetaData; -import org.jboss.beans.metadata.spi.InstallMetaData; -import org.jboss.dependency.spi.ControllerState; -import org.jboss.kernel.Kernel; -import org.jboss.kernel.spi.dependency.KernelController; -import org.jboss.kernel.spi.dependency.KernelControllerContext; -import org.jboss.portal.common.util.Tools; import org.jboss.portal.portlet.impl.info.ContainerInfoBuilder; import org.jboss.portal.portlet.impl.info.ContainerInfoBuilderContext; -import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo; import org.jboss.portal.portlet.impl.info.ContainerPortletInfo; +import org.jboss.portal.portlet.impl.info.ContainerFilterInfo; import org.jboss.portal.portlet.impl.jsr168.ContainerInfoBuilderContextImp= l; -import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory; +import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl; +import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl; +import org.jboss.portal.portlet.impl.jsr168.PortletFilterImpl; +import org.jboss.portal.portlet.impl.jsr168.PortletAPIFactoryImpl; import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; +import org.jboss.portal.portlet.impl.container.PortletApplicationLifeCycle; +import org.jboss.portal.portlet.impl.container.PortletFilterLifeCycle; +import org.jboss.portal.portlet.impl.container.PortletContainerLifeCycle; +import org.jboss.portal.portlet.container.object.PortletApplicationObject; +import org.jboss.portal.portlet.container.object.PortletContainerObject; +import org.jboss.portal.portlet.container.object.PortletFilterObject; +import org.jboss.portal.portlet.container.PortletApplicationContext; +import org.jboss.portal.portlet.container.PortletContainerContext; +import org.jboss.portal.portlet.container.PortletFilterContext; +import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= ntListener; import org.jboss.portal.portlet.metadata.JBossApplicationMetaData; import org.jboss.portal.web.WebApp; = -import java.util.ArrayList; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.HashSet; - /** * @author Julien Viet * @version $Revision: 1.1 $ @@ -66,172 +57,99 @@ private final Logger log; = /** . */ - private final Kernel kernel; - - /** . */ private final WebApp webApp; = /** . */ private final PortletApplication10MetaData metaData; = /** . */ - private final LinkedHashMap installed; + private final ManagedObjectRegistryEventListener listener; = - public PortletApplicationDeployment(Kernel kernel, WebApp webApp, Portl= etApplication10MetaData metaData) + /** . */ + private PortletApplicationLifeCycle portletApplicationLifeCycle; + + public PortletApplicationDeployment( + ManagedObjectRegistryEventListener listener, + WebApp webApp, + PortletApplication10MetaData metaData) { - this.kernel =3D kernel; + this.listener =3D listener; this.webApp =3D webApp; this.metaData =3D metaData; this.log =3D Logger.getLogger(PortletApplicationDeployment.class + "= ." + webApp.getContextPath().replace('.', '_')); - this.installed =3D new LinkedHashMap(); } = - public AbstractBeanMetaData createKernelPortletContainerMetaData(String= kernelPortletContainerId, ContainerPortletInfo portletInfo) + public PortletApplicationLifeCycle getPortletApplicationLifeCycle() { - AbstractBeanMetaData beanMD =3D new AbstractBeanMetaData(kernelPortl= etContainerId, KernelPortletContainer.class.getName()); - - // - AbstractConstructorMetaData ctorMD =3D new AbstractConstructorMetaDa= ta(); - ctorMD.setParameters(Tools.toList((ParameterMetaData)new AbstractPar= ameterMetaData(ContainerPortletInfo.class.getName(), portletInfo))); - beanMD.setConstructor(ctorMD); - - // - beanMD.setProperties(new HashSet()); - beanMD.setInstalls(new ArrayList()); - beanMD.setUninstalls(new ArrayList()); - - // - beanMD.setStart(new AbstractLifecycleMetaData("start")); - beanMD.setStop(new AbstractLifecycleMetaData("stop")); - - // - return beanMD; + return portletApplicationLifeCycle; } = - public AbstractBeanMetaData createKernelPortletApplicationMetaData(Cont= ainerPortletApplicationInfo portletApplicationInfo, String kernelPortletApp= licationId) - { - AbstractBeanMetaData beanMD =3D new AbstractBeanMetaData(kernelPortl= etApplicationId, KernelPortletApplication.class.getName()); - - // - AbstractConstructorMetaData ctorMD =3D new AbstractConstructorMetaDa= ta(); - ctorMD.setParameters(Tools.toList( - (ParameterMetaData)new AbstractParameterMetaData(ContainerPortlet= ApplicationInfo.class.getName(), portletApplicationInfo), - new AbstractParameterMetaData(PortletApplication10MetaData.class.= getName(), metaData), - new AbstractParameterMetaData(JBossApplicationMetaData.class.getN= ame(), (Object)null), - new AbstractParameterMetaData(PortletAPIFactory.class.getName(), = new AbstractDependencyValueMetaData("PortletAPIFactory")), - new AbstractParameterMetaData(WebApp.class.getName(), webApp))); - beanMD.setConstructor(ctorMD); - - // - beanMD.setProperties(new HashSet()); - beanMD.setInstalls(new ArrayList()); - beanMD.setUninstalls(new ArrayList()); - - // - beanMD.setStart(new AbstractLifecycleMetaData("start")); - beanMD.setStop(new AbstractLifecycleMetaData("stop")); - - // - return beanMD; - } - void install() { = log.debug("Starting installation"); = // - KernelController controller =3D kernel.getController(); - - // - String kernelPortletApplicationId =3D "PortletApplication[" + webApp= .getContextPath() + "]"; - - // ContainerInfoBuilderContext builderContext =3D new ContainerInfoBuil= derContextImpl(metaData, webApp); ContainerInfoBuilder builder =3D new ContainerInfoBuilder(metaData, = builderContext); builder.build(); = // - List toInstall =3D new ArrayList(); + PortletApplicationObject portletApplicationObject =3D new PortletApp= licationImpl( + builder.getApplication(), metaData, new JBossApplicationMetaData(= ), new PortletAPIFactoryImpl()); + PortletApplicationContext portletApplicationContext =3D new PortletA= pplicationContextImpl(webApp); = - // - AbstractBeanMetaData kernelPortletApplicationMD =3D createKernelPort= letApplicationMetaData(builder.getApplication(), kernelPortletApplicationId= ); = // - toInstall.add(kernelPortletApplicationMD); + portletApplicationLifeCycle =3D new PortletApplicationLifeCycle( + listener, + portletApplicationContext, + portletApplicationObject); = // - for (ContainerPortletInfo containerInfo : builder.getPortlets()) + for (ContainerFilterInfo filterInfo : builder.getApplication().getFi= lters().values()) { - // - String kernelPortletContainerId =3D "PortletContainer[" + webApp.= getContextPath() + "," + containerInfo.getName() + "]"; + PortletFilterObject portletFilterObject =3D new PortletFilterImpl= (filterInfo); + PortletFilterContext portletFilterContext =3D new PortletFilterCo= ntextImpl(); = // - AbstractBeanMetaData kernelPortletContainerMD =3D createKernelPor= tletContainerMetaData(kernelPortletContainerId, containerInfo); - - // Inject the kernel portlet application in the kernel portlet co= ntainer - AbstractDependencyValueMetaData kernelPortletApplicationDependenc= yMD =3D new AbstractDependencyValueMetaData(kernelPortletApplicationId); -// kernelPortletApplicationDependencyMD.setDependentState(Controll= erState.START); - kernelPortletContainerMD.getProperties().add(new AbstractProperty= MetaData("kernelPortletApplication", kernelPortletApplicationDependencyMD)); - - // Install the kernel portlet container on the kernel portlet app= lication - AbstractInstallMetaData installKernelPortletContainerMD =3D new A= bstractInstallMetaData(); - installKernelPortletContainerMD.setBean(kernelPortletApplicationI= d); - installKernelPortletContainerMD.setParameters(Collections.singlet= onList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaDa= ta()))); - installKernelPortletContainerMD.setMethodName("addKernelPortletCo= ntainer"); -// installKernelPortletContainerMD.setState(ControllerState.st); - kernelPortletContainerMD.getInstalls().add(installKernelPortletCo= ntainerMD); - - // Uninstall the kernel portlet container from the kernel portlet= application - AbstractInstallMetaData uninstallKernelPortletContainerMD =3D new= AbstractInstallMetaData(); - uninstallKernelPortletContainerMD.setBean(kernelPortletApplicatio= nId); - uninstallKernelPortletContainerMD.setParameters(Collections.singl= etonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMeta= Data()))); - uninstallKernelPortletContainerMD.setMethodName("removeKernelPort= letContainer"); -// uninstallKernelPortletContainerMD.setState(ControllerState.INST= ANTIATED); - kernelPortletContainerMD.getUninstalls().add(uninstallKernelPortl= etContainerMD); - - // - toInstall.add(kernelPortletContainerMD); + portletApplicationLifeCycle.addPortletFilter(portletFilterContext= , portletFilterObject); } = - // Install beans - for (AbstractBeanMetaData beanMetaData : toInstall) + // + for (ContainerPortletInfo containerInfo : builder.getPortlets()) { - String beanName =3D beanMetaData.getName(); - try + PortletContainerObject portletContainerObject =3D new PortletCont= ainerImpl(containerInfo); + PortletContainerContext portletContainerContext =3D new PortletCo= ntainerContextImpl(); + = + // + PortletContainerLifeCycle portletContainerLifeCycle =3D portletAp= plicationLifeCycle.addPortletContainer(portletContainerContext, portletCont= ainerObject); + + // Now create deps + for (String filterRef : containerInfo.getFilterRefs()) { -// beanMetaData.setMode(ControllerMode.MANUAL); + PortletFilterLifeCycle portletFilterLifeCycle =3D (PortletFilt= erLifeCycle)portletApplicationLifeCycle.getManagedPortletFilter(filterRef); = // - log.debug("Installing bean " + beanName); - KernelControllerContext kcc =3D controller.install(beanMetaDat= a); - - // - installed.put(beanName, kcc); - log.debug("Installed bean " + beanName); - - // - logBeanFailure(kcc); + if (portletFilterLifeCycle !=3D null) + { + portletApplicationLifeCycle.addDependency(portletFilterLife= Cycle, portletContainerLifeCycle); + } + else + { + // todo + } } - catch (Throwable throwable) - { - log.debug("Installation of bean " + beanName + " produced an e= rror", throwable); - } } = - // Print bean names - for (KernelControllerContext kcc : installed.values()) - { + // + portletApplicationLifeCycle.create(); = - if (kcc.getState() =3D=3D ControllerState.ERROR) - { - log.error("Bean " + kcc.getName() + " threw an error during st= art", kcc.getError()); - } - else - { - log.debug("Bean " + kcc.getName() + " was installed with state= " + kcc.getState()); - } - } + // + portletApplicationLifeCycle.managedStart(); + + // + } = void uninstall() @@ -239,37 +157,9 @@ log.debug("Uninstalling"); = // - KernelController controller =3D kernel.getController(); + portletApplicationLifeCycle.managedStop(); = // - List beanNames =3D new ArrayList(installed.keySet()); - Collections.reverse(beanNames); - for (String beanName : beanNames) - { - try - { - log.debug("Uninstalling bean " + beanName); - controller.uninstall(beanName); - log.debug("Uninstalled bean " + beanName); - } - catch (Throwable t) - { - // MC throws Error .... need to catch them here - - log.error("Bean " + beanName + " undeployment threw something"= , t); - } - } - - // log.debug("Uninstalled"); } - - private void logBeanFailure(KernelControllerContext context) - { - Throwable t =3D context.getError(); - if (t !=3D null) - { - log.debug("Installation of bean " + context.getName() + " produce= d an error", t); - } - } } Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/PortletContainerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletContainerContextImpl.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletContainerContextImpl.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -0,0 +1,33 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test; + +import org.jboss.portal.portlet.container.PortletContainerContext; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletContainerContextImpl implements PortletContainerContext +{ +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/PortletFilterContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletFilterContextImpl.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletFilterContextImpl.java 2008-02-21 22:21:37 UTC (rev 10069) @@ -0,0 +1,33 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test; + +import org.jboss.portal.portlet.container.PortletFilterContext; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletFilterContextImpl implements PortletFilterContext +{ +} Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-21 12:49:52 UTC (= rev 10068) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-21 22:21:37 UTC (= rev 10069) @@ -661,7 +661,7 @@ = = - + = Modified: modules/portlet/trunk/test/src/test/resources/portlet-test-war/WE= B-INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/= jboss-beans.xml 2008-02-21 12:49:52 UTC (rev 10068) +++ modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/= jboss-beans.xml 2008-02-21 22:21:37 UTC (rev 10069) @@ -37,10 +37,7 @@ - - - - + = @@ -98,8 +95,6 @@ - - = Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-beans.xml 2008-02-21 12:49:52 UTC (rev 10068) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-beans.xml 2008-02-21 22:21:37 UTC (rev 10069) @@ -25,10 +25,7 @@ = - - - - + = @@ -86,8 +83,6 @@ - - = --===============6806329659988029700==-- From portal-commits at lists.jboss.org Thu Feb 21 17:27:48 2008 Content-Type: multipart/mixed; boundary="===============0549226354274064241==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10070 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet and 6 other directories. Date: Thu, 21 Feb 2008 17:27:48 -0500 Message-ID: --===============0549226354274064241== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-21 17:27:47 -0500 (Thu, 21 Feb 2008) New Revision: 10070 Modified: modules/portlet/trunk/bridge/src/main/java/org/jboss/portal/portlet/brid= ge/JBossServletContextProvider.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/asp= ects/portlet/ContextDispatcherInterceptor.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/PortletApplication.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/PortletContainer.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/PortletContainerInvoker.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/PortletFilter.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/object/PortletApplicationObject.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/object/PortletContainerObject.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/object/PortletFilterObject.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/container/PortletApplicationLifeCycle.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletApplicationImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletContainerImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletFilterImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletRequestAttributes.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/BaseURLImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletRequestDispatcherImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletRequestImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/StateAwareResponseImpl.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/con= tainer/PortletApplicationObjectSupport.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/con= tainer/PortletContainerObjectSupport.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/con= tainer/PortletFilterObjectSupport.java Log: correct minor consistency in the model Modified: modules/portlet/trunk/bridge/src/main/java/org/jboss/portal/portl= et/bridge/JBossServletContextProvider.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/bridge/src/main/java/org/jboss/portal/portlet/bri= dge/JBossServletContextProvider.java 2008-02-21 22:21:37 UTC (rev 10069) +++ modules/portlet/trunk/bridge/src/main/java/org/jboss/portal/portlet/bri= dge/JBossServletContextProvider.java 2008-02-21 22:27:47 UTC (rev 10070) @@ -126,7 +126,7 @@ = // this.invocation =3D invocation; - this.ctx =3D container.getApplication().getContext().getServletCo= ntext(); + this.ctx =3D container.getPortletApplication().getContext().getSe= rvletContext(); this.breq =3D null; this.bresp =3D null; } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/aspects/portlet/ContextDispatcherInterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/as= pects/portlet/ContextDispatcherInterceptor.java 2008-02-21 22:21:37 UTC (re= v 10069) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/as= pects/portlet/ContextDispatcherInterceptor.java 2008-02-21 22:27:47 UTC (re= v 10070) @@ -67,7 +67,7 @@ protected Object invoke(PortletInvocation invocation) throws Exception,= InvocationException { PortletContainer container =3D (PortletContainer)invocation.getAttri= bute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CO= NTAINER); - PortletApplication portletApplication =3D container.getApplication(); + PortletApplication portletApplication =3D container.getPortletApplic= ation(); ServerContext reqCtx =3D invocation.getServerContext(); ServletContext targetCtx =3D portletApplication.getContext().getServ= letContext(); ServletContainer servletContainer =3D servletContainerFactory.getSer= vletContainer(); Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/PortletApplication.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletApplication.java 2008-02-21 22:21:37 UTC (rev 10069) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletApplication.java 2008-02-21 22:27:47 UTC (rev 10070) @@ -55,6 +55,11 @@ */ PortletContainer getPortletContainer(String containerId); = + /** + * Returns the context of the portlet application. + * + * @return the context + */ PortletApplicationContext getContext(); = = Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/PortletContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletContainer.java 2008-02-21 22:21:37 UTC (rev 10069) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletContainer.java 2008-02-21 22:27:47 UTC (rev 10070) @@ -64,7 +64,12 @@ * * @return the application */ - PortletApplication getApplication(); + PortletApplication getPortletApplication(); = + /** + * Returns the context of the portlet container. + * + * @return the context + */ PortletContainerContext getContext(); } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/PortletContainerInvoker.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletContainerInvoker.java 2008-02-21 22:21:37 UTC (rev 10069) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletContainerInvoker.java 2008-02-21 22:27:47 UTC (rev 10070) @@ -254,7 +254,7 @@ public PortletImpl(PortletContainer container) { this.container =3D container; - this.context =3D PortletContext.createPortletContext(container.ge= tApplication().getId() + "." + container.getId()); + this.context =3D PortletContext.createPortletContext(container.ge= tPortletApplication().getId() + "." + container.getId()); } = public PortletContext getContext() Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/PortletFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletFilter.java 2008-02-21 22:21:37 UTC (rev 10069) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletFilter.java 2008-02-21 22:27:47 UTC (rev 10070) @@ -36,4 +36,17 @@ */ String getId(); = + /** + * Returns the wired application. + * + * @return the application + */ + PortletApplication getPortletApplication(); + + /** + * Returns the context of the portlet filter + * + * @return the context + */ + PortletFilterContext getContext(); } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/object/PortletApplicationObject.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/object/PortletApplicationObject.java 2008-02-21 22:21:37 UTC (rev 1= 0069) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/object/PortletApplicationObject.java 2008-02-21 22:27:47 UTC (rev 1= 0070) @@ -55,28 +55,28 @@ * * @param container the container */ - void addContainer(PortletContainer container); + void addPortletContainer(PortletContainer container); = /** * Remove a container. * * @param container the container */ - void removeContainer(PortletContainer container); + void removePortletContainer(PortletContainer container); = /** * Add a filter. * * @param filter the filter */ - void addFilter(PortletFilter filter); + void addPortletFilter(PortletFilter filter); = /** * Remove a filter. * * @param filter the filter */ - void removeFilter(PortletFilter filter); + void removePortletFilter(PortletFilter filter); = /** * Starts the application only. It does not take care of starting its c= omponents. Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/object/PortletContainerObject.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/object/PortletContainerObject.java 2008-02-21 22:21:37 UTC (rev 100= 69) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/object/PortletContainerObject.java 2008-02-21 22:27:47 UTC (rev 100= 70) @@ -41,7 +41,7 @@ * * @param application the related application */ - void setApplication(PortletApplication application); + void setPortletApplication(PortletApplication application); = /** * Set/unset the portlet container context. @@ -55,14 +55,14 @@ * * @param filter the portlet filter */ - void addFilter(PortletFilter filter); + void addPortletFilter(PortletFilter filter); = /** * Remove a filter. * * @param filter the portlet filter */ - void removeFilter(PortletFilter filter); + void removePortletFilter(PortletFilter filter); = /** * Starts the portlet container. Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/object/PortletFilterObject.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/object/PortletFilterObject.java 2008-02-21 22:21:37 UTC (rev 10069) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/object/PortletFilterObject.java 2008-02-21 22:27:47 UTC (rev 10070) @@ -38,7 +38,7 @@ * = * @param application the application */ - void setApplication(PortletApplication application); + void setPortletApplication(PortletApplication application); = /** * Set the context required by that filter. Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/container/PortletApplicationLifeCycle.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/PortletApplicationLifeCycle.java 2008-02-21 22:21:37 UTC (rev = 10069) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/PortletApplicationLifeCycle.java 2008-02-21 22:27:47 UTC (rev = 10070) @@ -103,8 +103,8 @@ for (PortletFilterLifeCycle portletFilterLifeCycle : portletFilterLi= feCycles.values()) { portletFilterLifeCycle.portletFilter.setContext(portletFilterLife= Cycle.portletFilterContext); - portletFilterLifeCycle.portletFilter.setApplication(portletApplic= ation); - portletApplication.addFilter(portletFilterLifeCycle.portletFilter= ); + portletFilterLifeCycle.portletFilter.setPortletApplication(portle= tApplication); + portletApplication.addPortletFilter(portletFilterLifeCycle.portle= tFilter); = // listener.onEvent(new ManagedObjectAddedEvent(portletFilterLifeCyc= le)); @@ -114,8 +114,8 @@ for (PortletContainerLifeCycle portletContainerLifeCycle : portletCo= ntainerLifeCycles.values()) { portletContainerLifeCycle.portletContainer.setContext(portletCont= ainerLifeCycle.portletContainerContext); - portletContainerLifeCycle.portletContainer.setApplication(portlet= Application); - portletApplication.addContainer(portletContainerLifeCycle.portlet= Container); + portletContainerLifeCycle.portletContainer.setPortletApplication(= portletApplication); + portletApplication.addPortletContainer(portletContainerLifeCycle.= portletContainer); = // listener.onEvent(new ManagedObjectAddedEvent(portletContainerLife= Cycle)); @@ -126,7 +126,7 @@ { for (PortletContainerLifeCycle portletContainerLifeCycle : entry.= getValue()) { - portletContainerLifeCycle.portletContainer.addFilter(entry.get= Key().portletFilter); + portletContainerLifeCycle.portletContainer.addPortletFilter(en= try.getKey().portletFilter); } } = @@ -148,7 +148,7 @@ { for (PortletContainerLifeCycle portletContainerLifeCycle : ent= ry.getValue()) { - portletContainerLifeCycle.portletContainer.removeFilter(ent= ry.getKey().portletFilter); + portletContainerLifeCycle.portletContainer.removePortletFil= ter(entry.getKey().portletFilter); } } = @@ -157,8 +157,8 @@ listener.onEvent(new ManagedObjectRemovedEvent(portletContaine= rLifeCycle)); = // - portletApplication.removeContainer(portletContainerLifeCycle.p= ortletContainer); - portletContainerLifeCycle.portletContainer.setApplication(null= ); + portletApplication.removePortletContainer(portletContainerLife= Cycle.portletContainer); + portletContainerLifeCycle.portletContainer.setPortletApplicati= on(null); portletContainerLifeCycle.portletContainer.setContext(null); } = @@ -168,8 +168,8 @@ listener.onEvent(new ManagedObjectRemovedEvent(portletFilterLi= feCycle)); = // - portletApplication.removeFilter(portletFilterLifeCycle.portlet= Filter); - portletFilterLifeCycle.portletFilter.setApplication(null); + portletApplication.removePortletFilter(portletFilterLifeCycle.= portletFilter); + portletFilterLifeCycle.portletFilter.setPortletApplication(nul= l); portletFilterLifeCycle.portletFilter.setContext(null); } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletApplicationImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletApplicationImpl.java 2008-02-21 22:21:37 UTC (rev 10069) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletApplicationImpl.java 2008-02-21 22:27:47 UTC (rev 10070) @@ -112,12 +112,12 @@ return metaData.getId(); } = - public void addFilter(org.jboss.portal.portlet.container.PortletFilter = filter) + public void addPortletFilter(org.jboss.portal.portlet.container.Portlet= Filter filter) { = } = - public void removeFilter(org.jboss.portal.portlet.container.PortletFilt= er filter) + public void removePortletFilter(org.jboss.portal.portlet.container.Port= letFilter filter) { = } @@ -142,12 +142,12 @@ return jbossMetaData; } = - public void addContainer(PortletContainer container) + public void addPortletContainer(PortletContainer container) { portlets.put(container.getId(), container); } = - public void removeContainer(PortletContainer container) + public void removePortletContainer(PortletContainer container) { portlets.remove(container.getId()); } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletContainerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletContainerImpl.java 2008-02-21 22:21:37 UTC (rev 10069) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletContainerImpl.java 2008-02-21 22:27:47 UTC (rev 10070) @@ -190,12 +190,12 @@ return info.getName(); } = - public void addFilter(org.jboss.portal.portlet.container.PortletFilter = filter) + public void addPortletFilter(org.jboss.portal.portlet.container.Portlet= Filter filter) { filters.add((PortletFilterImpl)filter); } = - public void removeFilter(org.jboss.portal.portlet.container.PortletFilt= er filter) + public void removePortletFilter(org.jboss.portal.portlet.container.Port= letFilter filter) { filters.remove((PortletFilterImpl)filter); } @@ -380,12 +380,12 @@ } = // Cannot use covariant here as it will break the javabean property get= ter convention used by MC. - public PortletApplication getApplication() + public PortletApplication getPortletApplication() { return application; } = - public void setApplication(PortletApplication application) + public void setPortletApplication(PortletApplication application) { this.application =3D (PortletApplicationImpl)application; } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletFilterImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletFilterImpl.java 2008-02-21 22:21:37 UTC (rev 10069) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletFilterImpl.java 2008-02-21 22:27:47 UTC (rev 10070) @@ -104,16 +104,26 @@ return null; } = - public void setApplication(PortletApplication application) + public void setPortletApplication(PortletApplication application) { this.application =3D (PortletApplicationImpl)application; } = + public PortletApplication getPortletApplication() + { + return application; + } + public void setContext(PortletFilterContext context) { this.context =3D context; } = + public PortletFilterContext getContext() + { + return context; + } + public void start() throws Exception { PortletContext portletContext =3D application.portletContext; Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletRequestAttributes.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletRequestAttributes.java 2008-02-21 22:21:37 UTC (rev 10069) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletRequestAttributes.java 2008-02-21 22:27:47 UTC (rev 10070) @@ -105,7 +105,7 @@ if (infos !=3D null) { // Get portlet application metadata - PortletApplicationImpl portletApp =3D (PortletApplicationImpl)= container.getApplication(); + PortletApplicationImpl portletApp =3D (PortletApplicationImpl)= container.getPortletApplication(); PortletApplication10MetaData pamd =3D portletApp.getMetaData(); Map uaMD =3D pamd.getUserAttrib= utes(); = Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/BaseURLImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/BaseURLImpl.java 2008-02-21 22:21:37 UTC (rev 10069) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/BaseURLImpl.java 2008-02-21 22:27:47 UTC (rev 10070) @@ -25,7 +25,6 @@ import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.spi.PortletInvocationContext; import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl; -import org.jboss.portal.common.NotYetImplemented; import org.jboss.portal.common.io.WriterCharWriter; import org.jboss.portal.common.text.EntityEncoder; = @@ -142,7 +141,7 @@ = public String toString() { - PortletURLGenerationListener listener =3D ((PortletApplicationImpl)p= req.container.getApplication()).getListener(PortletURLGenerationListener.cl= ass); + PortletURLGenerationListener listener =3D ((PortletApplicationImpl)p= req.container.getPortletApplication()).getListener(PortletURLGenerationList= ener.class); = // InternalContainerURL url; Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/PortletRequestDispatcherImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletRequestDispatcherImpl.java 2008-02-21 22:21:37 UTC (re= v 10069) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletRequestDispatcherImpl.java 2008-02-21 22:27:47 UTC (re= v 10070) @@ -101,7 +101,7 @@ // try { - PortletApplication application =3D req.container.getApplication(); + PortletApplication application =3D req.container.getPortletApplic= ation(); PortletApplicationContext applicationContext =3D application.getC= ontext(); ServletContext servletContext =3D applicationContext.getServletCo= ntext(); = Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/PortletRequestImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletRequestImpl.java 2008-02-21 22:21:37 UTC (rev 10069) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletRequestImpl.java 2008-02-21 22:27:47 UTC (rev 10070) @@ -28,7 +28,6 @@ import org.jboss.portal.common.util.MultiValuedPropertyMap; import org.jboss.portal.common.util.SimpleMultiValuedPropertyMap; import org.jboss.portal.common.util.ContentInfo; -import org.jboss.portal.portlet.container.PortletContainerInvoker; import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl; import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl; import org.jboss.portal.portlet.impl.jsr168.PortletUtils; @@ -428,7 +427,7 @@ { // For sure we need a session we will obtain a valid one HttpSession hsession =3D realReq.getSession(); - PortletApplicationImpl portletApp =3D (PortletApplicationImpl)con= tainer.getApplication(); + PortletApplicationImpl portletApp =3D (PortletApplicationImpl)con= tainer.getPortletApplication(); psession =3D new PortletSessionImpl(hsession, windowContext.getId= (), portletApp.getPortletContext()); } else @@ -439,7 +438,7 @@ // if (hsession !=3D null) { - PortletApplicationImpl portletApp =3D (PortletApplicationImpl)= container.getApplication(); + PortletApplicationImpl portletApp =3D (PortletApplicationImpl)= container.getPortletApplication(); psession =3D new PortletSessionImpl(hsession, windowContext.ge= tId(), portletApp.getPortletContext()); } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/StateAwareResponseImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/StateAwareResponseImpl.java 2008-02-21 22:21:37 UTC (rev 1006= 9) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/StateAwareResponseImpl.java 2008-02-21 22:27:47 UTC (rev 1007= 0) @@ -320,7 +320,7 @@ } = // - ContainerPortletApplicationInfo info =3D ((PortletApplicationImpl)pr= eq.container.getApplication()).getInfo(); + ContainerPortletApplicationInfo info =3D ((PortletApplicationImpl)pr= eq.container.getPortletApplication()).getInfo(); QName name =3D new QName(info.getDefaultNamespace(), localName); setEvent(name, value); } Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/port= let/container/PortletApplicationObjectSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletApplicationObjectSupport.java 2008-02-21 22:21:37 UTC (rev 1= 0069) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletApplicationObjectSupport.java 2008-02-21 22:27:47 UTC (rev 1= 0070) @@ -59,7 +59,7 @@ throw new UnsupportedOperationException(); } = - public void addContainer(PortletContainer container) + public void addPortletContainer(PortletContainer container) { if (container =3D=3D null) { @@ -72,7 +72,7 @@ containers.put(container.getId(), container); } = - public void removeContainer(PortletContainer container) + public void removePortletContainer(PortletContainer container) { if (container =3D=3D null) { @@ -85,7 +85,7 @@ containers.remove(container.getId()); } = - public void addFilter(PortletFilter filter) + public void addPortletFilter(PortletFilter filter) { if (filter =3D=3D null) { @@ -98,7 +98,7 @@ filters.put(filter.getId(), filter); } = - public void removeFilter(PortletFilter filter) + public void removePortletFilter(PortletFilter filter) { if (filter =3D=3D null) { Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/port= let/container/PortletContainerObjectSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletContainerObjectSupport.java 2008-02-21 22:21:37 UTC (rev 100= 69) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletContainerObjectSupport.java 2008-02-21 22:27:47 UTC (rev 100= 70) @@ -53,7 +53,7 @@ super(id); } = - public void setApplication(PortletApplication application) + public void setPortletApplication(PortletApplication application) { this.application =3D application; } @@ -63,7 +63,7 @@ this.context =3D context; } = - public void addFilter(PortletFilter filter) + public void addPortletFilter(PortletFilter filter) { if (filter =3D=3D null) { @@ -76,7 +76,7 @@ filters.put(filter.getId(), filter); } = - public void removeFilter(PortletFilter filter) + public void removePortletFilter(PortletFilter filter) { if (filter =3D=3D null) { @@ -99,7 +99,7 @@ throw new UnsupportedOperationException(); } = - public PortletApplication getApplication() + public PortletApplication getPortletApplication() { throw new UnsupportedOperationException(); } Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/port= let/container/PortletFilterObjectSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletFilterObjectSupport.java 2008-02-21 22:21:37 UTC (rev 10069) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletFilterObjectSupport.java 2008-02-21 22:27:47 UTC (rev 10070) @@ -42,13 +42,24 @@ super(id); } = - public void setApplication(PortletApplication application) + public void setPortletApplication(PortletApplication application) { this.application =3D application; } = + public PortletApplication getPortletApplication() + { + return application; + } + public void setContext(PortletFilterContext context) { this.context =3D context; } + + public PortletFilterContext getContext() + { + return context; + } + } --===============0549226354274064241==-- From portal-commits at lists.jboss.org Thu Feb 21 17:45:43 2008 Content-Type: multipart/mixed; boundary="===============7241047228891959200==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10071 - modules/portlet/trunk/test/src/test. Date: Thu, 21 Feb 2008 17:45:43 -0500 Message-ID: --===============7241047228891959200== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-21 17:45:43 -0500 (Thu, 21 Feb 2008) New Revision: 10071 Modified: modules/portlet/trunk/test/src/test/build.xml Log: set jpda=3Dfalse again Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-21 22:27:47 UTC (= rev 10070) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-21 22:45:43 UTC (= rev 10071) @@ -661,7 +661,7 @@ = = - + = --===============7241047228891959200==-- From portal-commits at lists.jboss.org Thu Feb 21 18:41:05 2008 Content-Type: multipart/mixed; boundary="===============1755896602267213625==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10072 - in modules/portlet/trunk/portlet/src: test/java/org/jboss/portal/portlet/container and 1 other directories. Date: Thu, 21 Feb 2008 18:41:05 -0500 Message-ID: --===============1755896602267213625== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-21 18:41:05 -0500 (Thu, 21 Feb 2008) New Revision: 10072 Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/con= tainer/LifeCycleReentranceDetectionTest.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/container/LifeCycle.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/con= tainer/LifeCycle1Test.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/con= tainer/ObjectSupport.java modules/portlet/trunk/portlet/src/test/resources/local-jboss-unit.xml Log: implement reentrancy detection + test case Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/container/LifeCycle.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/LifeCycle.java 2008-02-21 22:45:43 UTC (rev 10071) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/container/LifeCycle.java 2008-02-21 23:41:05 UTC (rev 10072) @@ -44,6 +44,9 @@ /** . */ private LifeCycleStatus status =3D LifeCycleStatus.STOPPED; = + /** Cheap reentrancy detection. */ + private boolean active =3D false; + public final LifeCycleStatus getStatus() { return status; @@ -51,8 +54,17 @@ = private static final ThreadLocal> faileds =3D new ThreadLoc= al>(); = - public final void managedStart() throws IllegalStateException + public synchronized final void managedStart() throws IllegalStateExcept= ion { + if (active) + { + throw new IllegalStateException("Reentrancy detected"); + } + + // + active =3D true; + + // boolean clearFaileds =3D false; = // @@ -122,36 +134,55 @@ { faileds.set(null); } + + // + active =3D false; } } = - public final void managedStop() + public synchronized final void managedStop() { - stopDependents(); + if (active) + { + throw new IllegalStateException("Reentrancy detected"); + } = // - if (status =3D=3D LifeCycleStatus.STARTED) + active =3D true; + + // + try { - try + stopDependents(); + + // + if (status =3D=3D LifeCycleStatus.STARTED) { - invokeStop(); + try + { + invokeStop(); + } + catch (Exception e) + { + log.error("Error during object stop", e); + } + catch (Error e) + { + log.error("Error during object stop", e); + } + finally + { + status =3D LifeCycleStatus.STOPPED; + } + + // + getListener().onEvent(new ManagedObjectLifeCycleEvent(this, Li= feCycleStatus.STOPPED)); } - catch (Exception e) - { - log.error("Error during object stop", e); - } - catch (Error e) - { - log.error("Error during object stop", e); - } - finally - { - status =3D LifeCycleStatus.STOPPED; - } - - // - getListener().onEvent(new ManagedObjectLifeCycleEvent(this, LifeC= ycleStatus.STOPPED)); } + finally + { + active =3D false; + } } = protected void startDependents() Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/port= let/container/LifeCycle1Test.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/LifeCycle1Test.java 2008-02-21 22:45:43 UTC (rev 10071) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/LifeCycle1Test.java 2008-02-21 23:41:05 UTC (rev 10072) @@ -214,7 +214,7 @@ events.clear(); = // - container.failOnStart =3D true; + container.startCallback =3D ObjectSupport.FAILURE_CALLBACK; = // applicationLC.managedStart(); @@ -281,7 +281,7 @@ events.clear(); = // - application.failOnStart =3D true; + application.startCallback =3D ObjectSupport.FAILURE_CALLBACK; = // applicationLC.managedStart(); @@ -312,7 +312,7 @@ events.clear(); = // - filter.failOnStart =3D true; + filter.startCallback =3D ObjectSupport.FAILURE_CALLBACK; = // applicationLC.managedStart(); @@ -371,7 +371,7 @@ @Test public void testContainerFailsOnStop() { - container.failOnStop =3D true; + container.stopCallback =3D ObjectSupport.FAILURE_CALLBACK; = // testApplicationLifeCycle(); @@ -380,7 +380,7 @@ @Test public void testApplicationFailsOnStop() { - application.failOnStop =3D true; + application.stopCallback =3D ObjectSupport.FAILURE_CALLBACK; = // testApplicationLifeCycle(); @@ -389,7 +389,7 @@ @Test public void testFilterFailsOnStop() { - filter.failOnStop =3D true; + filter.stopCallback =3D ObjectSupport.FAILURE_CALLBACK; = // testApplicationLifeCycle(); Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet= /container/LifeCycleReentranceDetectionTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/LifeCycleReentranceDetectionTest.java (rev = 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/LifeCycleReentranceDetectionTest.java 2008-02-21 23:41:05 UTC (rev = 10072) @@ -0,0 +1,219 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.container; + +import org.jboss.unit.api.pojo.annotations.Test; +import org.jboss.unit.api.pojo.annotations.Create; +import org.jboss.portal.portlet.impl.container.PortletApplicationLifeCycle; +import org.jboss.portal.portlet.impl.container.PortletContainerLifeCycle; +import org.jboss.portal.portlet.impl.container.LifeCycle; +import org.jboss.portal.portlet.container.managed.LifeCycleStatus; + +import static org.jboss.unit.api.Assert.*; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)Test +public class LifeCycleReentranceDetectionTest +{ + + PortletApplicationLifeCycle applicationLF; + PortletApplicationObjectSupport application; + PortletContainerLifeCycle containerLF; + PortletContainerObjectSupport container; + + IllegalStateException ise; + + @Create + public void create() + { + this.ise =3D null; + } + + private class InvokeLifeCycleCallback implements ObjectSupport.Callback + { + + /** . */ + private LifeCycle lifeCycle; + + /** . */ + private boolean invokeStart; + + /** . */ + private boolean rethrowISE; + + private InvokeLifeCycleCallback(LifeCycle lifeCycle, boolean invokeS= tart, boolean rethrowISE) + { + this.lifeCycle =3D lifeCycle; + this.invokeStart =3D invokeStart; + this.rethrowISE =3D rethrowISE; + } + + public void execute() + { + try + { + if (invokeStart) + { + lifeCycle.managedStart(); + } + else + { + lifeCycle.managedStop(); + } + } + catch (IllegalStateException e) + { + ise =3D e; + + // + if (rethrowISE) + { + throw e; + } + } + } + } + + @Test + public void applicationReentersApplication1() + { + application =3D new PortletApplicationObjectSupport("application"); + applicationLF =3D new PortletApplicationLifeCycle(new PortletApplica= tionContextSupport(), application); + application.startCallback =3D new InvokeLifeCycleCallback(applicatio= nLF, true, false); + + // + applicationLF.create(); + + // + applicationLF.managedStart(); + + // + assertNotNull(ise); + assertEquals(LifeCycleStatus.STARTED, applicationLF.getStatus()); + } + + @Test + public void applicationReentersApplication2() + { + application =3D new PortletApplicationObjectSupport("application"); + applicationLF =3D new PortletApplicationLifeCycle(new PortletApplica= tionContextSupport(), application); + application.startCallback =3D new InvokeLifeCycleCallback(applicatio= nLF, true, true); + + // + applicationLF.create(); + + // + applicationLF.managedStart(); + + // + assertNotNull(ise); + assertEquals(LifeCycleStatus.FAILED, applicationLF.getStatus()); + } + + @Test + public void containerReentersContainer1() + { + application =3D new PortletApplicationObjectSupport("application"); + applicationLF =3D new PortletApplicationLifeCycle(new PortletApplica= tionContextSupport(), application); + container =3D new PortletContainerObjectSupport("container"); + containerLF =3D applicationLF.addPortletContainer(new PortletContain= erContextSupport(), container); + container.startCallback =3D new InvokeLifeCycleCallback(containerLF= , true, false); + + // + applicationLF.create(); + + // + applicationLF.managedStart(); + + // + assertNotNull(ise); + assertEquals(LifeCycleStatus.STARTED, applicationLF.getStatus()); + assertEquals(LifeCycleStatus.STARTED, containerLF.getStatus()); + } + + @Test + public void containerReentersContainer2() + { + application =3D new PortletApplicationObjectSupport("application"); + applicationLF =3D new PortletApplicationLifeCycle(new PortletApplica= tionContextSupport(), application); + container =3D new PortletContainerObjectSupport("container"); + containerLF =3D applicationLF.addPortletContainer(new PortletContain= erContextSupport(), container); + container.startCallback =3D new InvokeLifeCycleCallback(containerLF= , true, true); + + // + applicationLF.create(); + + // + applicationLF.managedStart(); + + // + assertNotNull(ise); + assertEquals(LifeCycleStatus.STARTED, applicationLF.getStatus()); + assertEquals(LifeCycleStatus.FAILED, containerLF.getStatus()); + } + + @Test + public void containerReentersApplication1() + { + application =3D new PortletApplicationObjectSupport("application"); + applicationLF =3D new PortletApplicationLifeCycle(new PortletApplica= tionContextSupport(), application); + container =3D new PortletContainerObjectSupport("container"); + containerLF =3D applicationLF.addPortletContainer(new PortletContain= erContextSupport(), container); + container.startCallback =3D new InvokeLifeCycleCallback(application= LF, true, false); + + // + applicationLF.create(); + + // + applicationLF.managedStart(); + + // + assertNotNull(ise); + assertEquals(LifeCycleStatus.STARTED, applicationLF.getStatus()); + assertEquals(LifeCycleStatus.STARTED, containerLF.getStatus()); + } + + @Test + public void containerReentersApplication2() + { + application =3D new PortletApplicationObjectSupport("application"); + applicationLF =3D new PortletApplicationLifeCycle(new PortletApplica= tionContextSupport(), application); + container =3D new PortletContainerObjectSupport("container"); + containerLF =3D applicationLF.addPortletContainer(new PortletContain= erContextSupport(), container); + container.startCallback =3D new InvokeLifeCycleCallback(application= LF, true, true); + + // + applicationLF.create(); + + // + applicationLF.managedStart(); + + // + assertNotNull(ise); + assertEquals(LifeCycleStatus.STARTED, applicationLF.getStatus()); + assertEquals(LifeCycleStatus.FAILED, containerLF.getStatus()); + } +} Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/port= let/container/ObjectSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/ObjectSupport.java 2008-02-21 22:45:43 UTC (rev 10071) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/ObjectSupport.java 2008-02-21 23:41:05 UTC (rev 10072) @@ -39,16 +39,16 @@ private int stopped; = /** . */ - boolean failOnStart; + Callback startCallback; = /** . */ - boolean failOnStop; + Callback stopCallback; = public ObjectSupport(String id) { this.id =3D id; - this.failOnStart =3D false; - this.failOnStop =3D false; + this.startCallback =3D null; + this.stopCallback =3D null; } = public String getId() @@ -71,9 +71,9 @@ started++; = // - if (failOnStart) + if (startCallback !=3D null) { - throw new RuntimeException(); + startCallback.execute(); } } = @@ -82,9 +82,22 @@ stopped++; = // - if (failOnStop) + if (stopCallback !=3D null) { + stopCallback.execute(); + } + } + + public interface Callback + { + void execute(); + } + + public static Callback FAILURE_CALLBACK =3D new Callback() + { + public void execute() + { throw new RuntimeException(); } - } + }; } Modified: modules/portlet/trunk/portlet/src/test/resources/local-jboss-unit= .xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/resources/local-jboss-unit.xml 2= 008-02-21 22:45:43 UTC (rev 10071) +++ modules/portlet/trunk/portlet/src/test/resources/local-jboss-unit.xml 2= 008-02-21 23:41:05 UTC (rev 10072) @@ -4,7 +4,6 @@ xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=3D"urn:jboss:jboss-unit:1.0 jboss-unit_1_0.xsd"> - + + + --===============1755896602267213625==-- From portal-commits at lists.jboss.org Thu Feb 21 19:12:06 2008 Content-Type: multipart/mixed; boundary="===============4295633384123516998==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10073 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/spi and 3 other directories. Date: Thu, 21 Feb 2008 19:12:06 -0500 Message-ID: --===============4295633384123516998== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-21 19:12:06 -0500 (Thu, 21 Feb 2008) New Revision: 10073 Removed: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletAPIFactoryImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/spi/PortletAPIFactory.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletApplicationImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletApplicationDeployment.java modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/j= boss-beans.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= jboss-beans.xml Log: - remote PortletAPIFactory Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portl= et/impl/jsr168/PortletAPIFactoryImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletAPIFactoryImpl.java 2008-02-21 23:41:05 UTC (rev 10072) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletAPIFactoryImpl.java 2008-02-22 00:12:06 UTC (rev 10073) @@ -1,84 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.impl.jsr168; - -import org.jboss.portal.portlet.invocation.ActionInvocation; -import org.jboss.portal.portlet.invocation.RenderInvocation; -import org.jboss.portal.portlet.invocation.EventInvocation; -import org.jboss.portal.portlet.invocation.ResourceInvocation; -import org.jboss.portal.portlet.impl.jsr168.api.ActionResponseImpl; -import org.jboss.portal.portlet.impl.jsr168.api.ActionRequestImpl; -import org.jboss.portal.portlet.impl.jsr168.api.RenderRequestImpl; -import org.jboss.portal.portlet.impl.jsr168.api.RenderResponseImpl; -import org.jboss.portal.portlet.impl.jsr168.api.EventRequestImpl; -import org.jboss.portal.portlet.impl.jsr168.api.EventResponseImpl; -import org.jboss.portal.portlet.impl.jsr168.api.ResourceRequestImpl; -import org.jboss.portal.portlet.impl.jsr168.api.ResourceResponseImpl; -import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory; - -/** - * @author Julien Viet - * @version $Revision: 7226 $ - */ -public class PortletAPIFactoryImpl implements PortletAPIFactory -{ - public ActionRequestImpl createActionRequest(ActionInvocation invocatio= n) - { - return new ActionRequestImpl(null, invocation); - } - - public ActionResponseImpl createActionResponse(ActionInvocation invocat= ion, ActionRequestImpl actionRequest) - { - return new ActionResponseImpl(invocation, actionRequest); - } - - public EventRequestImpl createEventRequest(EventInvocation invocation) - { - return new EventRequestImpl(null, invocation); - } - - public EventResponseImpl createEventResponse(EventInvocation invocation= , EventRequestImpl eventRequest) - { - return new EventResponseImpl(invocation, eventRequest); - } - - public RenderRequestImpl createRenderRequest(RenderInvocation invocatio= n) - { - return new RenderRequestImpl(null, invocation); - } - - public RenderResponseImpl createRenderResponse(RenderInvocation invocat= ion, RenderRequestImpl renderRequest) - { - return new RenderResponseImpl(invocation, renderRequest); - } - - public ResourceRequestImpl createResourceRequest(ResourceInvocation inv= ocation) - { - return new ResourceRequestImpl(null, invocation); - } - - public ResourceResponseImpl createResourceResponse(ResourceInvocation i= nvocation, ResourceRequestImpl renderRequest) - { - return new ResourceResponseImpl(invocation, renderRequest); - } -} Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletApplicationImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletApplicationImpl.java 2008-02-21 23:41:05 UTC (rev 10072) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletApplicationImpl.java 2008-02-22 00:12:06 UTC (rev 10073) @@ -25,7 +25,6 @@ import org.jboss.portal.portlet.impl.jsr168.api.PortletContextImpl; import org.jboss.portal.portlet.impl.jsr168.api.PortletURLGenerationListen= erChain; import org.jboss.portal.portlet.impl.jsr168.api.FilterConfigImpl; -import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory; import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo; import org.jboss.portal.portlet.impl.info.ContainerListenerInfo; @@ -65,9 +64,6 @@ protected final JBossApplicationMetaData jbossMetaData; = /** . */ - protected final PortletAPIFactory portletAPIFactory; - - /** . */ protected PortletApplicationContext context; = /** Logger. */ @@ -91,13 +87,11 @@ public PortletApplicationImpl( ContainerPortletApplicationInfo info, PortletApplication10MetaData metaData, - JBossApplicationMetaData jbossMetaData, - PortletAPIFactory portletAPIFactory) + JBossApplicationMetaData jbossMetaData) { this.info =3D info; this.metaData =3D metaData; this.jbossMetaData =3D jbossMetaData; - this.portletAPIFactory =3D portletAPIFactory; this.portlets =3D new LinkedHashMap(); this.log =3D Logger.getLogger(PortletApplication.class); } @@ -127,11 +121,6 @@ return info; } = - public PortletAPIFactory getPortletAPIFactory() - { - return portletAPIFactory; - } - public PortletApplication10MetaData getMetaData() { return metaData; Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portl= et/impl/jsr168/spi/PortletAPIFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/spi/PortletAPIFactory.java 2008-02-21 23:41:05 UTC (rev 10072) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/spi/PortletAPIFactory.java 2008-02-22 00:12:06 UTC (rev 10073) @@ -1,77 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.impl.jsr168.spi; - -import org.jboss.portal.portlet.invocation.ActionInvocation; -import org.jboss.portal.portlet.invocation.RenderInvocation; -import org.jboss.portal.portlet.invocation.EventInvocation; -import org.jboss.portal.portlet.invocation.ResourceInvocation; -import org.jboss.portal.portlet.impl.jsr168.api.RenderRequestImpl; -import org.jboss.portal.portlet.impl.jsr168.api.ActionRequestImpl; -import org.jboss.portal.portlet.impl.jsr168.api.ActionResponseImpl; -import org.jboss.portal.portlet.impl.jsr168.api.RenderResponseImpl; -import org.jboss.portal.portlet.impl.jsr168.api.EventRequestImpl; -import org.jboss.portal.portlet.impl.jsr168.api.EventResponseImpl; -import org.jboss.portal.portlet.impl.jsr168.api.ResourceRequestImpl; -import org.jboss.portal.portlet.impl.jsr168.api.ResourceResponseImpl; - -/** - * Factory for portlet API implementation. - * - * @author Julien Viet - * @version $Revision: 7226 $ - */ -public interface PortletAPIFactory -{ - /** - */ - ActionRequestImpl createActionRequest(ActionInvocation invocation); - - /** - */ - ActionResponseImpl createActionResponse(ActionInvocation invocation, Ac= tionRequestImpl actionRequest); - - /** - */ - EventRequestImpl createEventRequest(EventInvocation invocation); - - /** - */ - EventResponseImpl createEventResponse(EventInvocation invocation, Event= RequestImpl eventRequest); - - /** - */ - RenderRequestImpl createRenderRequest(RenderInvocation invocation); - - /** - */ - RenderResponseImpl createRenderResponse(RenderInvocation invocation, Re= nderRequestImpl renderRequest); - - /** - */ - ResourceRequestImpl createResourceRequest(ResourceInvocation invocation= ); - - /** - */ - ResourceResponseImpl createResourceResponse(ResourceInvocation invocati= on, ResourceRequestImpl renderRequest); -} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortletApplicationDeployment.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployment.java 2008-02-21 23:41:05 UTC (rev 10072) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployment.java 2008-02-22 00:12:06 UTC (rev 10073) @@ -31,7 +31,6 @@ import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl; import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl; import org.jboss.portal.portlet.impl.jsr168.PortletFilterImpl; -import org.jboss.portal.portlet.impl.jsr168.PortletAPIFactoryImpl; import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; import org.jboss.portal.portlet.impl.container.PortletApplicationLifeCycle; import org.jboss.portal.portlet.impl.container.PortletFilterLifeCycle; @@ -96,7 +95,9 @@ = // PortletApplicationObject portletApplicationObject =3D new PortletApp= licationImpl( - builder.getApplication(), metaData, new JBossApplicationMetaData(= ), new PortletAPIFactoryImpl()); + builder.getApplication(), + metaData, + new JBossApplicationMetaData()); PortletApplicationContext portletApplicationContext =3D new PortletA= pplicationContextImpl(webApp); = = Modified: modules/portlet/trunk/test/src/test/resources/portlet-test-war/WE= B-INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/= jboss-beans.xml 2008-02-21 23:41:05 UTC (rev 10072) +++ modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/= jboss-beans.xml 2008-02-22 00:12:06 UTC (rev 10073) @@ -40,8 +40,6 @@ = - - Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-beans.xml 2008-02-21 23:41:05 UTC (rev 10072) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-beans.xml 2008-02-22 00:12:06 UTC (rev 10073) @@ -28,8 +28,6 @@ = - - --===============4295633384123516998==-- From portal-commits at lists.jboss.org Thu Feb 21 20:12:17 2008 Content-Type: multipart/mixed; boundary="===============2505999160623011622==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10074 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168 and 2 other directories. Date: Thu, 21 Feb 2008 20:12:15 -0500 Message-ID: --===============2505999160623011622== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-21 20:12:15 -0500 (Thu, 21 Feb 2008) New Revision: 10074 Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerUserInfo.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerInfoBuilder.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerPortletApplicationInfo.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletApplicationImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletRequestAttributes.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/spi/PortletInfoFactory.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletApplicationDeployer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletApplicationDeployment.java Log: cleanup in metadata usage in container impl, now it does not use anymore th= e meta data build from the xml descriptors Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/info/ContainerInfoBuilder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerInfoBuilder.java 2008-02-22 00:12:06 UTC (rev 10073) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerInfoBuilder.java 2008-02-22 01:12:15 UTC (rev 10074) @@ -40,6 +40,7 @@ import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData; import org.jboss.portal.portlet.impl.metadata.PublicRenderParameterMetaDat= a; import org.jboss.portal.portlet.impl.metadata.ListenerMetaData; +import org.jboss.portal.portlet.impl.metadata.UserAttributeMetaData; import org.jboss.portal.portlet.impl.metadata.filter.FilterMetaData; import org.jboss.portal.portlet.impl.metadata.filter.FilterMappingMetaData; import org.jboss.portal.portlet.info.MetaInfo; @@ -67,6 +68,7 @@ import java.util.LinkedHashMap; import java.util.Collections; import java.util.HashSet; +import java.util.Set; import java.net.URI; import java.net.URISyntaxException; = @@ -150,6 +152,9 @@ private ContainerPortletApplicationInfo portletApplication; = /** . */ + private final String portletApplicationId; + + /** . */ private final Map portlets; = /** . */ @@ -159,9 +164,11 @@ private Map applicationOptions; = public ContainerInfoBuilder( + String portletApplicationId, PortletApplication10MetaData portletApplicationMD, ContainerInfoBuilderContext context) { + this.portletApplicationId =3D portletApplicationId; this.portletApplicationMD =3D portletApplicationMD; this.context =3D context; this.events =3D new LinkedHashMap(); @@ -409,7 +416,25 @@ } = // - return new ContainerPortletApplicationInfo(defaultNamespace, allFilt= ers.values(), listeners); + Map userAttributesMD =3D portletAppli= cationMD.getUserAttributes(); + Set supportedUserAttributes; + if (userAttributesMD !=3D null) + { + supportedUserAttributes =3D Collections.unmodifiableSet(userAttri= butesMD.keySet()); + } + else + { + supportedUserAttributes =3D Collections.emptySet(); + } + ContainerUserInfo user =3D new ContainerUserInfo(supportedUserAttrib= utes); + + // + return new ContainerPortletApplicationInfo( + portletApplicationId, + defaultNamespace, + allFilters.values(), + listeners, + user); } = private ContainerListenerInfo build(ListenerMetaData listenerMD) Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/info/ContainerPortletApplicationInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerPortletApplicationInfo.java 2008-02-22 00:12:06 UTC (rev 1= 0073) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerPortletApplicationInfo.java 2008-02-22 01:12:15 UTC (rev 1= 0074) @@ -36,18 +36,26 @@ { = /** . */ + private final String id; + + /** . */ private final String defaultNamespace; = /** . */ private final List listeners; = /** . */ + private final ContainerUserInfo user; + + /** . */ private final Map filters; = public ContainerPortletApplicationInfo( + String id, String defaultNamespace, Collection filters, - List listeners) + List listeners, + ContainerUserInfo user) { LinkedHashMap tmp =3D new LinkedHashMap= (); for (ContainerFilterInfo filter : filters) @@ -56,11 +64,18 @@ } = // + this.id =3D id; this.defaultNamespace =3D defaultNamespace; this.listeners =3D listeners; this.filters =3D Collections.unmodifiableMap(tmp); + this.user =3D user; } = + public String getId() + { + return id; + } + public String getDefaultNamespace() { return defaultNamespace; @@ -75,4 +90,9 @@ { return filters; } + + public ContainerUserInfo getUser() + { + return user; + } } Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/info/ContainerUserInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerUserInfo.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerUserInfo.java 2008-02-22 01:12:15 UTC (rev 10074) @@ -0,0 +1,46 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.impl.info; + +import java.util.Set; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ContainerUserInfo +{ + + /** . */ + private Set supportedUserAttributes; + + public ContainerUserInfo(Set supportedUserAttributes) + { + this.supportedUserAttributes =3D supportedUserAttributes; + } + + public Set getSupportedUserAttributes() + { + return supportedUserAttributes; + } +} Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletApplicationImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletApplicationImpl.java 2008-02-22 00:12:06 UTC (rev 10073) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletApplicationImpl.java 2008-02-22 01:12:15 UTC (rev 10074) @@ -25,11 +25,9 @@ import org.jboss.portal.portlet.impl.jsr168.api.PortletContextImpl; import org.jboss.portal.portlet.impl.jsr168.api.PortletURLGenerationListen= erChain; import org.jboss.portal.portlet.impl.jsr168.api.FilterConfigImpl; -import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo; import org.jboss.portal.portlet.impl.info.ContainerListenerInfo; import org.jboss.portal.portlet.impl.info.ContainerFilterInfo; -import org.jboss.portal.portlet.metadata.JBossApplicationMetaData; import org.jboss.portal.portlet.container.PortletApplication; import org.jboss.portal.portlet.container.PortletApplicationContext; import org.jboss.portal.portlet.container.PortletContainer; @@ -57,18 +55,12 @@ /** . */ protected final ContainerPortletApplicationInfo info; = - /** . */ - protected final PortletApplication10MetaData metaData; + /** Logger. */ + protected final Logger log; = /** . */ - protected final JBossApplicationMetaData jbossMetaData; - - /** . */ protected PortletApplicationContext context; = - /** Logger. */ - protected Logger log; - /** . */ protected LinkedHashMap portlets; = @@ -76,24 +68,16 @@ protected PortletContextImpl portletContext; = /** . */ - protected String version; - - /** . */ protected PortletURLGenerationListener urlListener; = /** - * Todo remove meta data reference and use info instead. + * @param info the portlet application info */ - public PortletApplicationImpl( - ContainerPortletApplicationInfo info, - PortletApplication10MetaData metaData, - JBossApplicationMetaData jbossMetaData) + public PortletApplicationImpl(ContainerPortletApplicationInfo info) { this.info =3D info; - this.metaData =3D metaData; - this.jbossMetaData =3D jbossMetaData; this.portlets =3D new LinkedHashMap(); - this.log =3D Logger.getLogger(PortletApplication.class); + this.log =3D Logger.getLogger(PortletApplication.class.getName() + "= ." + info.getId().replace('.', '_')); } = public void setContext(PortletApplicationContext context) @@ -103,17 +87,17 @@ = public String getId() { - return metaData.getId(); + return info.getId(); } = public void addPortletFilter(org.jboss.portal.portlet.container.Portlet= Filter filter) { - + // } = public void removePortletFilter(org.jboss.portal.portlet.container.Port= letFilter filter) { - = + // } = public ContainerPortletApplicationInfo getInfo() @@ -121,16 +105,6 @@ return info; } = - public PortletApplication10MetaData getMetaData() - { - return metaData; - } - - public JBossApplicationMetaData getJBossMetaData() - { - return jbossMetaData; - } - public void addPortletContainer(PortletContainer container) { portlets.put(container.getId(), container); @@ -145,8 +119,6 @@ = public void start() throws Exception { -// this.log =3D Logger.getLogger(PortletApplication.class.getName() += "." + context.getContextPath().replace('.', '_')); - PortletContextImpl portletContext =3D new PortletContextImpl(context= .getServletContext()); = // @@ -184,23 +156,16 @@ } = // - this.version =3D metaData.getVersion(); this.portletContext =3D portletContext; this.urlListener =3D listeners.size() =3D=3D 0 ? null : new PortletU= RLGenerationListenerChain(Collections.unmodifiableList(listeners)); } = public void stop() { - this.version =3D null; this.portletContext =3D null; this.urlListener =3D null; } = - public String getVersion() - { - return version; - } - public PortletContext getPortletContext() { return portletContext; @@ -254,44 +219,9 @@ = public String toString() { - return "PortletWebApp[" + metaData.getId() + "]"; + return "PortletApplication[" + getId() + "]"; } = - private static class FilterKey - { - - /** . */ - private final String name; - - /** . */ - private final Class phase; - - private FilterKey(String name, Class phase) - { - this.name =3D name; - this.phase =3D phase; - } - - public int hashCode() - { - return name.hashCode() + name.hashCode(); - } - - public boolean equals(Object obj) - { - if (obj =3D=3D this) - { - return true; - } - if (obj instanceof FilterKey) - { - FilterKey that =3D (FilterKey)obj; - return name.equals(that.name) && phase =3D=3D that.phase; - } - return false; - } - } - static class FilterLifecycle extends ClassInstanceLifeCycle { = Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletRequestAttributes.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletRequestAttributes.java 2008-02-22 00:12:06 UTC (rev 10073) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletRequestAttributes.java 2008-02-22 01:12:15 UTC (rev 10074) @@ -22,8 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.impl.jsr168; = -import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; -import org.jboss.portal.portlet.impl.metadata.UserAttributeMetaData; +import org.jboss.portal.portlet.impl.info.ContainerUserInfo; import org.jboss.portal.portlet.spi.UserContext; import org.jboss.portal.portlet.container.PortletContainer; = @@ -106,14 +105,13 @@ { // Get portlet application metadata PortletApplicationImpl portletApp =3D (PortletApplicationImpl)= container.getPortletApplication(); - PortletApplication10MetaData pamd =3D portletApp.getMetaData(); - Map uaMD =3D pamd.getUserAttrib= utes(); + ContainerUserInfo userInfo =3D portletApp.getInfo().getUser(); = // Clone the map infos =3D new HashMap(infos); = // Keep only what is of interest with respect to what the port= let app defines - infos.keySet().retainAll(uaMD.keySet()); + infos.keySet().retainAll(userInfo.getSupportedUserAttributes()= ); = // Make it immutable infos =3D Collections.unmodifiableMap(infos); Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/spi/PortletInfoFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/spi/PortletInfoFactory.java 2008-02-22 00:12:06 UTC (rev 10073) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/spi/PortletInfoFactory.java 2008-02-22 01:12:15 UTC (rev 10074) @@ -22,11 +22,8 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.impl.jsr168.spi; = -import org.jboss.portal.portlet.container.PortletApplicationContext; import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData; -import org.jboss.portal.portlet.metadata.JBossPortletMetaData; -import org.jboss.portal.common.i18n.ResourceBundleManager; = /** * Enables the creation of custom portlet info implementations. @@ -40,13 +37,7 @@ * Create a new portlet info from the provided meta data. * * @param portletMD the portlet meta data - * @param jbossPortletMD - * @param resourceBundleManager the resource bundle manager * @return the runtime portlet meta data */ - PortletInfo createPortletInfo( - PortletApplicationContext portletApplicationContext, - PortletMetaData portletMD, - JBossPortletMetaData jbossPortletMD, - ResourceBundleManager resourceBundleManager); + PortletInfo createPortletInfo(PortletMetaData portletMD); } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortletApplicationDeployer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployer.java 2008-02-22 00:12:06 UTC (rev 10073) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployer.java 2008-02-22 01:12:15 UTC (rev 10074) @@ -29,7 +29,6 @@ import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= ntBroadcaster; import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= ntListener; import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= nt; -import org.jboss.portal.portlet.container.managed.ManagedObjectAddedEvent; import org.jboss.portal.portlet.container.managed.ManagedObjectEvent; import org.jboss.portal.portlet.container.managed.ManagedObject; import org.jboss.portal.portlet.container.managed.ManagedObjectLifeCycleEv= ent; @@ -263,7 +262,6 @@ = // Unmarshal PortletApplication10MetaData portletApplicationMD =3D (Port= letApplication10MetaData)unmarshaller.unmarshal(in, new ValueTrimmingFilter= (factory), null); - portletApplicationMD.setId(webApp.getContextPath()); = // return portletApplicationMD; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortletApplicationDeployment.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployment.java 2008-02-22 00:12:06 UTC (rev 10073) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployment.java 2008-02-22 01:12:15 UTC (rev 10074) @@ -42,7 +42,6 @@ import org.jboss.portal.portlet.container.PortletContainerContext; import org.jboss.portal.portlet.container.PortletFilterContext; import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= ntListener; -import org.jboss.portal.portlet.metadata.JBossApplicationMetaData; import org.jboss.portal.web.WebApp; = /** @@ -90,14 +89,11 @@ = // ContainerInfoBuilderContext builderContext =3D new ContainerInfoBuil= derContextImpl(metaData, webApp); - ContainerInfoBuilder builder =3D new ContainerInfoBuilder(metaData, = builderContext); + ContainerInfoBuilder builder =3D new ContainerInfoBuilder(webApp.get= ContextPath(), metaData, builderContext); builder.build(); = // - PortletApplicationObject portletApplicationObject =3D new PortletApp= licationImpl( - builder.getApplication(), - metaData, - new JBossApplicationMetaData()); + PortletApplicationObject portletApplicationObject =3D new PortletApp= licationImpl(builder.getApplication()); PortletApplicationContext portletApplicationContext =3D new PortletA= pplicationContextImpl(webApp); = = @@ -129,7 +125,7 @@ // Now create deps for (String filterRef : containerInfo.getFilterRefs()) { - PortletFilterLifeCycle portletFilterLifeCycle =3D (PortletFilt= erLifeCycle)portletApplicationLifeCycle.getManagedPortletFilter(filterRef); + PortletFilterLifeCycle portletFilterLifeCycle =3D portletAppli= cationLifeCycle.getManagedPortletFilter(filterRef); = // if (portletFilterLifeCycle !=3D null) --===============2505999160623011622==-- From portal-commits at lists.jboss.org Thu Feb 21 20:13:50 2008 Content-Type: multipart/mixed; boundary="===============1769259399743220813==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10075 - modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/metadata. Date: Thu, 21 Feb 2008 20:13:49 -0500 Message-ID: --===============1769259399743220813== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-21 20:13:49 -0500 (Thu, 21 Feb 2008) New Revision: 10075 Removed: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/met= adata/JBossApplicationMetaData.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/met= adata/JBossPortletMetaData.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/met= adata/PolicyPermissionMetaData.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/met= adata/SecurityConstraintMetaData.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/met= adata/SessionConfigMetaData.java Log: remove legacy classes Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portl= et/metadata/JBossApplicationMetaData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/me= tadata/JBossApplicationMetaData.java 2008-02-22 01:12:15 UTC (rev 10074) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/me= tadata/JBossApplicationMetaData.java 2008-02-22 01:13:49 UTC (rev 10075) @@ -1,60 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.metadata; - -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * @author Julien Viet - * @version $Revision: 5448 $ - */ -public class JBossApplicationMetaData -{ - - /** . */ - protected Boolean remotable; - - /** . */ - protected Map portlets; - - public JBossApplicationMetaData() - { - portlets =3D new LinkedHashMap(); - } - - public Map getPortlets() - { - return portlets; - } - - public Boolean getRemotable() - { - return remotable; - } - - public void setRemotable(Boolean remotable) - { - this.remotable =3D remotable; - } -} Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portl= et/metadata/JBossPortletMetaData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/me= tadata/JBossPortletMetaData.java 2008-02-22 01:12:15 UTC (rev 10074) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/me= tadata/JBossPortletMetaData.java 2008-02-22 01:13:49 UTC (rev 10075) @@ -1,163 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.metadata; - -import org.jboss.portal.common.transaction.Transactions; - -/** - * Specific metadata specified to jboss portlet container. - * - * @author Julien Viet - * @version $Revision: 7226 $ - */ -public class JBossPortletMetaData implements Cloneable -{ - - /** . */ - private String name; - - /** . */ - private Boolean remotable; - - /** . */ - private SecurityConstraintMetaData securityConstraint; - - /** . */ - private Integer cacheRefType; - - /** . */ - private Transactions.Type txType; - - /** . */ - private Boolean distributed; - - public String getName() - { - return name; - } - - public void setName(String name) - { - this.name =3D name; - } - - public Boolean getRemotable() - { - return remotable; - } - - public void setRemotable(Boolean remotable) - { - this.remotable =3D remotable; - } - - public Boolean getDistributed() - { - return distributed; - } - - public void setDistributed(Boolean distributed) - { - this.distributed =3D distributed; - } - - public SecurityConstraintMetaData getSecurityConstraint() - { - return securityConstraint; - } - - public void setSecurityConstraint(SecurityConstraintMetaData securityCo= nstraint) - { - this.securityConstraint =3D securityConstraint; - } - - public Integer getCacheRefType() - { - return cacheRefType; - } - - public void setCacheRefType(Integer cacheRefType) - { - this.cacheRefType =3D cacheRefType; - } - - public Transactions.Type getTxType() - { - return txType; - } - - public void setTxType(Transactions.Type txType) - { - this.txType =3D txType; - } - - /** - * Merge the current meta data with portlet application. - */ - public void merge(JBossApplicationMetaData application) - { - if (remotable =3D=3D null) - { - remotable =3D application.getRemotable(); - } - } - - /** - * Merge the current meta data with a specified one. - */ - public void merge(JBossPortletMetaData portlet) - { - if (remotable =3D=3D null) - { - remotable =3D portlet.getRemotable(); - } - if (txType =3D=3D null) - { - txType =3D portlet.getTxType(); - } - if (cacheRefType =3D=3D null) - { - cacheRefType =3D portlet.getCacheRefType(); - } - if (securityConstraint =3D=3D null) - { - securityConstraint =3D portlet.getSecurityConstraint(); - } - if (distributed =3D=3D null) - { - distributed =3D portlet.getDistributed(); - } - } - - public Object clone() - { - try - { - return super.clone(); - } - catch (CloneNotSupportedException e) - { - throw new Error(e); - } - } -} Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portl= et/metadata/PolicyPermissionMetaData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/me= tadata/PolicyPermissionMetaData.java 2008-02-22 01:12:15 UTC (rev 10074) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/me= tadata/PolicyPermissionMetaData.java 2008-02-22 01:13:49 UTC (rev 10075) @@ -1,62 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.metadata; - -import java.util.HashSet; -import java.util.Set; - -/** - * @author Julien Viet - * @version $Revision: 5448 $ - */ -public class PolicyPermissionMetaData -{ - - private String roleName; - private Set actions; - - public PolicyPermissionMetaData() - { - actions =3D new HashSet(); - } - - public String getRoleName() - { - return roleName; - } - - public void setRoleName(String roleName) - { - this.roleName =3D roleName; - } - - public Set getActions() - { - return actions; - } - - public void setActions(Set actions) - { - this.actions =3D actions; - } -} Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portl= et/metadata/SecurityConstraintMetaData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/me= tadata/SecurityConstraintMetaData.java 2008-02-22 01:12:15 UTC (rev 10074) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/me= tadata/SecurityConstraintMetaData.java 2008-02-22 01:13:49 UTC (rev 10075) @@ -1,51 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.metadata; - -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * @author Julien Viet - * @version $Revision: 5448 $ - */ -public class SecurityConstraintMetaData -{ - - private Map policyPermissions; - - public SecurityConstraintMetaData() - { - policyPermissions =3D new LinkedHashMap(); - } - - public Map getPolicyPermissions() - { - return policyPermissions; - } - - public void setPolicyPermissions(Map policyPermissions) - { - this.policyPermissions =3D policyPermissions; - } -} Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portl= et/metadata/SessionConfigMetaData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/me= tadata/SessionConfigMetaData.java 2008-02-22 01:12:15 UTC (rev 10074) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/me= tadata/SessionConfigMetaData.java 2008-02-22 01:13:49 UTC (rev 10075) @@ -1,47 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.metadata; - -/** - * @author Julien Viet - * @version $Revision: 5448 $ - */ -public class SessionConfigMetaData -{ - - private boolean distributed; - - public SessionConfigMetaData() - { - } - - public boolean isDistributed() - { - return distributed; - } - - public void setDistributed(boolean distributed) - { - this.distributed =3D distributed; - } -} --===============1769259399743220813==-- From portal-commits at lists.jboss.org Thu Feb 21 20:14:41 2008 Content-Type: multipart/mixed; boundary="===============3267023513867141297==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10076 - modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet. Date: Thu, 21 Feb 2008 20:14:40 -0500 Message-ID: --===============3267023513867141297== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-21 20:14:40 -0500 (Thu, 21 Feb 2008) New Revision: 10076 Removed: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/met= adata/ Log: remove empty dir --===============3267023513867141297==-- From portal-commits at lists.jboss.org Thu Feb 21 22:57:05 2008 Content-Type: multipart/mixed; boundary="===============4867157054377531290==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10077 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Thu, 21 Feb 2008 22:57:05 -0500 Message-ID: --===============4867157054377531290== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-21 22:57:05 -0500 (Thu, 21 Feb 2008) New Revision: 10077 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescr= iptors.xml Log: 6.1.1. The JBoss Portlet DTD minor, changed two words... Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/x= mldescriptors.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-22 01:14:40 UTC (rev 10076) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-22 03:57:05 UTC (rev 10077) @@ -148,7 +148,7 @@ - If a portlet uses the true value for th= e <partial-refresh> element, the por= tal uses partial-page refreshing and only renders the portlet. If the <partial-refresh> element uses a false value, the portal uses a full-page refresh w= hen the portlet is refreshed. + If a portlet uses the true value for th= e <partial-refresh> element, the por= tal uses partial-page refreshing and only renders that portlet. If the <partial-refresh> element uses a false value, the portal uses a full-page refresh = when the portlet is refreshed. @@ -157,7 +157,7 @@ - The <session-config> element conf= igures the portlet session of the portlet. The <distribu= ted> element instructs the container to distribute the = session attributes using portal session replication. This only applies to l= ocal portlets, not remote portlets. + The <session-config> element conf= igures the portlet session for the portlet. The <distrib= uted> element instructs the container to distribute the= session attributes using portal session replication. This only applies to = local portlets, not remote portlets. The following is an example of the <session-config>= ; and <distributed>= elements: = --===============4867157054377531290==-- From portal-commits at lists.jboss.org Fri Feb 22 00:58:14 2008 Content-Type: multipart/mixed; boundary="===============0176792083352915624==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10078 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Fri, 22 Feb 2008 00:58:14 -0500 Message-ID: --===============0176792083352915624== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-22 00:58:14 -0500 (Fri, 22 Feb 2008) New Revision: 10078 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescr= iptors.xml Log: 6.1.1. The JBoss Portlet DTD minor revisions and corrections Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/x= mldescriptors.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-22 03:57:05 UTC (rev 10077) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-22 05:58:14 UTC (rev 10078) @@ -184,10 +184,10 @@ - Define how the portlet behaves with the transactional context. The <trans-attribute> element specifies the b= ehavior of the portlet when it is invoked at runtime, with respect to the t= ransactional context. Depending on how the portlet is invoked, a transactio= n may or may not exist before the portlet is invoked. The portal transactio= n is usually present in the local context. + The <transaction> element defines= how the portlet behaves with regards to the transactional context. The <trans-attribute> element specifies the= behavior of the portlet when it is invoked at runtime, with respect to the= transactional context. Depending on how the portlet is invoked, a transact= ion may or may not exist before the portlet is invoked. The portal transact= ion is usually present in the local context. - The following is an example of the <trans-attribute&g= t; element: + The following is an example of the <transaction> and <trans-attribute> elements: - The default value is NotSupported, whic= h means that the portal transaction will be suspended for the duration of t= he portlet invocation. Accepted values are Required, Mandatory, Neve= r, Supports, NotSupported, and RequiresNew. + The default value is NotSupported, whic= h means that the portal transaction will be suspended for the duration of t= he session. Accepted values are Required, = Mandatory, Never, Supports, NotSupp= orted, and RequiresNew. --===============0176792083352915624==-- From portal-commits at lists.jboss.org Fri Feb 22 05:14:26 2008 Content-Type: multipart/mixed; boundary="===============4592863050261986365==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10079 - modules/portlet/trunk. Date: Fri, 22 Feb 2008 05:14:25 -0500 Message-ID: --===============4592863050261986365== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-22 05:14:25 -0500 (Fri, 22 Feb 2008) New Revision: 10079 Modified: modules/portlet/trunk/pom.xml Log: Move docs generation to separate profile Modified: modules/portlet/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/pom.xml 2008-02-22 05:58:14 UTC (rev 10078) +++ modules/portlet/trunk/pom.xml 2008-02-22 10:14:25 UTC (rev 10079) @@ -25,6 +25,15 @@ = + + + docs + + docs + + + + build jsr168api @@ -34,7 +43,6 @@ federation management test - docs = --===============4592863050261986365==-- From portal-commits at lists.jboss.org Fri Feb 22 05:18:36 2008 Content-Type: multipart/mixed; boundary="===============0195282056172749518==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10080 - modules/test/trunk. Date: Fri, 22 Feb 2008 05:18:36 -0500 Message-ID: --===============0195282056172749518== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-22 05:18:36 -0500 (Fri, 22 Feb 2008) New Revision: 10080 Modified: modules/test/trunk/pom.xml Log: move docs build to separate profile Modified: modules/test/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/pom.xml 2008-02-22 10:14:25 UTC (rev 10079) +++ modules/test/trunk/pom.xml 2008-02-22 10:18:36 UTC (rev 10080) @@ -25,6 +25,15 @@ = + + + docs + + docs + + + + build unit @@ -35,8 +44,7 @@ test/opends test/generic test/jboss - test/agent - docs + test/agent = --===============0195282056172749518==-- From portal-commits at lists.jboss.org Fri Feb 22 05:31:17 2008 Content-Type: multipart/mixed; boundary="===============2168251416028860022==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10081 - modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168. Date: Fri, 22 Feb 2008 05:31:17 -0500 Message-ID: --===============2168251416028860022== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-22 05:31:17 -0500 (Fri, 22 Feb 2008) New Revision: 10081 Removed: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/spi/ Log: remove PortletInfoFactory --===============2168251416028860022==-- From portal-commits at lists.jboss.org Fri Feb 22 06:34:25 2008 Content-Type: multipart/mixed; boundary="===============4674476929047540593==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10082 - in modules/portlet/trunk: test/src/main/java/org/jboss/portal/portlet/portal/admin/ui and 2 other directories. Date: Fri, 22 Feb 2008 06:34:19 -0500 Message-ID: --===============4674476929047540593== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-22 06:34:17 -0500 (Fri, 22 Feb 2008) New Revision: 10082 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/basic/NullFilter.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletFilterImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /admin/ui/AdminPortlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/basic/FailDuringInitPortlet.java modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/W= EB-INF/portlet.xml Log: - fix a bug with wrong filter name - add filters in basic sample to test the filter -> container dependencies Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletFilterImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletFilterImpl.java 2008-02-22 10:31:17 UTC (rev 10081) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletFilterImpl.java 2008-02-22 11:34:17 UTC (rev 10082) @@ -101,7 +101,7 @@ = public String getId() { - return null; + return info.getName(); } = public void setPortletApplication(PortletApplication application) Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /portal/admin/ui/AdminPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/admin/ui/AdminPortlet.java 2008-02-22 10:31:17 UTC (rev 10081) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/admin/ui/AdminPortlet.java 2008-02-22 11:34:17 UTC (rev 10082) @@ -25,6 +25,8 @@ import org.jboss.portal.portlet.container.managed.PortletApplicationRegist= ry; import org.jboss.portal.portlet.container.managed.ManagedPortletApplicatio= n; import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; +import org.jboss.portal.portlet.container.managed.ManagedPortletFilter; +import org.jboss.portal.portlet.container.managed.ManagedObject; = import javax.portlet.GenericPortlet; import javax.portlet.RenderRequest; @@ -59,26 +61,30 @@ = // ManagedPortletApplication application =3D registry.getManagedPort= letApplication(applicationId); + ManagedObject managedObject =3D application; = // String containerId =3D req.getParameter("container"); + if (containerId !=3D null) + { + managedObject =3D application.getManagedPortletContainer(conta= inerId); + } + else + { + String filterId =3D req.getParameter("filter"); + if (filterId !=3D null) + { + managedObject =3D application.getManagedPortletFilter(filte= rId); + } + } = // - if (containerId !=3D null) + final ManagedObject tmp =3D managedObject; + if (tmp !=3D null) { - final ManagedPortletContainer container =3D application.getMan= agedPortletContainer(containerId); - - // if ("start".equals(lifeCycle)) { - try - { - container.managedStart(); - } - catch (Exception e) - { - e.printStackTrace(); - } + tmp.managedStart(); } else if ("stop".equals(lifeCycle)) { @@ -87,7 +93,7 @@ { public void run() { - container.managedStop(); + tmp.managedStop(); } }.start(); } @@ -97,40 +103,69 @@ = protected void doView(RenderRequest req, RenderResponse resp) throws Po= rtletException, IOException { - resp.setContentType("text/html"); - PrintWriter writer =3D resp.getWriter(); = // Use an alias PortletApplicationRegistry registry =3D (PortletApplicationRegistry)= getPortletContext().getAttribute("PortletApplicationDeployer"); = + // for (ManagedPortletApplication application : registry.getManagedPort= letApplications()) { PortletURL url =3D resp.createActionURL(); url.setParameter("application", application.getId()); = // - writer.print("
    • Application " + application.getId() + " " += application.getStatus() + "
      • "); + url.setParameter("lifecycle", "stop"); + String stopURL =3D url.toString(); = // + url.setParameter("lifecycle", "start"); + String startURL =3D url.toString(); + + // + writer.print("
        • Application " + application.getId() + " " += application.getStatus() + + " Start Stop
          • "); + + // + for (ManagedPortletFilter filter : application.getManagedPortletF= ilters()) + { + url.setParameter("filter", filter.getId()); + + // + url.setParameter("lifecycle", "stop"); + stopURL =3D url.toString(); + + // + url.setParameter("lifecycle", "start"); + startURL =3D url.toString(); + + // + writer.print("
          • Filter " + filter.getId() + " " + filter.get= Status() + " Start Stop=
          • "); + } + + // for (ManagedPortletContainer container : application.getManagedPo= rtletContainers()) { - url.setParameter("container", container.getId()); = + // url.setParameter("lifecycle", "stop"); - String stopURL =3D url.toString(); + stopURL =3D url.toString(); = + // url.setParameter("lifecycle", "start"); - String startURL =3D url.toString(); + startURL =3D url.toString(); = - writer.print("
          • Container " + container.getId() + " " + cont= ainer.getStatus() + "Start Stop= " + "
          • "); + // + writer.print("
          • Container " + container.getId() + " " + cont= ainer.getStatus() + " Start Stop=
          • "); } writer.print("
        "); } = + // writer.close(); = } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /portal/samples/basic/FailDuringInitPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/FailDuringInitPortlet.java 2008-02-22 10:31:17 UTC (rev 100= 81) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/FailDuringInitPortlet.java 2008-02-22 11:34:17 UTC (rev 100= 82) @@ -24,6 +24,10 @@ = import javax.portlet.GenericPortlet; import javax.portlet.PortletException; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import java.io.IOException; +import java.io.PrintWriter; = /** * A portlet that will fail only one time during startup (so it is possibl= e to restart it). @@ -50,4 +54,12 @@ // Nothing } } + + protected void doView(RenderRequest renderRequest, RenderResponse rende= rResponse) throws PortletException, IOException + { + renderResponse.setContentType("text/html"); + PrintWriter writer =3D renderResponse.getWriter(); + writer.print("A portlet that may fail during init"); + writer.close(); + } } Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/po= rtal/samples/basic/NullFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/NullFilter.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/NullFilter.java 2008-02-22 11:34:17 UTC (rev 10082) @@ -0,0 +1,75 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.samples.basic; + +import javax.portlet.filter.RenderFilter; +import javax.portlet.filter.ActionFilter; +import javax.portlet.filter.EventFilter; +import javax.portlet.filter.ResourceFilter; +import javax.portlet.filter.FilterChain; +import javax.portlet.filter.FilterConfig; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class NullFilter implements RenderFilter, ActionFilter, EventFilter= , ResourceFilter +{ + public void init(FilterConfig config) throws PortletException + { + } + + public void doFilter(RenderRequest req, RenderResponse resp, FilterChai= n chain) throws IOException, PortletException + { + chain.doFilter(req, resp); + } + + public void doFilter(ActionRequest req, ActionResponse resp, FilterChai= n chain) throws IOException, PortletException + { + chain.doFilter(req, resp); + } + + public void doFilter(EventRequest req, EventResponse resp, FilterChain = chain) throws IOException, PortletException + { + chain.doFilter(req, resp); + } + + public void doFilter(ResourceRequest req, ResourceResponse resp, Filter= Chain chain) throws IOException, PortletException + { + chain.doFilter(req, resp); + } + + public void destroy() + { + } +} Modified: modules/portlet/trunk/test/src/test/resources/portal/samples/basi= c-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/= WEB-INF/portlet.xml 2008-02-22 10:31:17 UTC (rev 10081) +++ modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/= WEB-INF/portlet.xml 2008-02-22 11:34:17 UTC (rev 10082) @@ -66,4 +66,32 @@ = + + FilterA + org.jboss.portal.portlet.portal.samples.basic.NullFilt= er + ACTION_PHASE + EVENT_PHASE + RENDER_PHASE + RESOURCE_PHASE + + + + FilterB + org.jboss.portal.portlet.portal.samples.basic.NullFilt= er + ACTION_PHASE + EVENT_PHASE + RENDER_PHASE + RESOURCE_PHASE + + + + FilterA + * + + + + FilterB + HeaderPortlet + + --===============4674476929047540593==-- From portal-commits at lists.jboss.org Fri Feb 22 08:20:02 2008 Content-Type: multipart/mixed; boundary="===============8853054441496552771==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10083 - in modules/test/trunk: build and 16 other directories. Date: Fri, 22 Feb 2008 08:20:01 -0500 Message-ID: --===============8853054441496552771== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-22 08:20:01 -0500 (Fri, 22 Feb 2008) New Revision: 10083 Modified: modules/test/trunk/build/pom.xml modules/test/trunk/docs/pom.xml modules/test/trunk/mc/pom.xml modules/test/trunk/mc/src/test/java/org/jboss/test/unit/mc/SomeTest.java modules/test/trunk/pom.xml modules/test/trunk/remote/pom.xml modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/driver/Rem= oteTestDriverClient.java modules/test/trunk/test/agent/pom.xml modules/test/trunk/test/core/pom.xml modules/test/trunk/test/generic/pom.xml modules/test/trunk/test/jboss/pom.xml modules/test/trunk/test/opends/pom.xml modules/test/trunk/tooling/ant/pom.xml modules/test/trunk/tooling/core/pom.xml modules/test/trunk/tooling/examples/maven2/pom.xml modules/test/trunk/tooling/maven2/pom.xml modules/test/trunk/tooling/pom.xml modules/test/trunk/unit/pom.xml Log: JBUNIT-9 : migration to MC 2 beta 9 Modified: modules/test/trunk/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/build/pom.xml 2008-02-22 11:34:17 UTC (rev 10082) +++ modules/test/trunk/build/pom.xml 2008-02-22 13:20:01 UTC (rev 10083) @@ -18,7 +18,7 @@ 4.0.0 org.jboss.unit module-parent - 1.2.0-Beta1 + 1.2.0-SNAPSHOT pom JBoss Portal Test Module http://www.jboss.com/products/jbossmc @@ -26,7 +26,7 @@ = 1.2.0-SNAPSHOT - 2.0.0.Beta4 + 2.0.0.Beta9 3.0.1 0.9-portal legacy Modified: modules/test/trunk/docs/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/docs/pom.xml 2008-02-22 11:34:17 UTC (rev 10082) +++ modules/test/trunk/docs/pom.xml 2008-02-22 13:20:01 UTC (rev 10083) @@ -4,13 +4,13 @@ org.jboss.unit module-parent - 1.2.0-Beta1 + 1.2.0-SNAPSHOT ../build/pom.xml docs-aggregator pom JBoss Portal Portlet Docs Aggregator - 1.2.0-Beta1 + 1.2.0-SNAPSHOT http://labs.jboss.com/jbossportal = Modified: modules/test/trunk/mc/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/mc/pom.xml 2008-02-22 11:34:17 UTC (rev 10082) +++ modules/test/trunk/mc/pom.xml 2008-02-22 13:20:01 UTC (rev 10083) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-Beta1 + 1.2.0-SNAPSHOT ../build/pom.xml 4.0.0 Modified: modules/test/trunk/mc/src/test/java/org/jboss/test/unit/mc/SomeTe= st.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/mc/src/test/java/org/jboss/test/unit/mc/SomeTest.jav= a 2008-02-22 11:34:17 UTC (rev 10082) +++ modules/test/trunk/mc/src/test/java/org/jboss/test/unit/mc/SomeTest.jav= a 2008-02-22 13:20:01 UTC (rev 10083) @@ -24,7 +24,7 @@ = import org.jboss.unit.api.pojo.annotations.Test; import org.jboss.unit.mc.api.annotations.Bootstrap; -import org.jboss.beans.metadata.plugins.annotations.Inject; +import org.jboss.beans.metadata.api.annotations.Inject; = /** * @author Julien Viet Modified: modules/test/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/pom.xml 2008-02-22 11:34:17 UTC (rev 10082) +++ modules/test/trunk/pom.xml 2008-02-22 13:20:01 UTC (rev 10083) @@ -5,7 +5,7 @@ module-aggregator pom JBoss Portal Modules Test - 1.2.0-Beta1 + 1.2.0-SNAPSHOT http://labs.jboss.com/jbossportal = Modified: modules/test/trunk/remote/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/remote/pom.xml 2008-02-22 11:34:17 UTC (rev 10082) +++ modules/test/trunk/remote/pom.xml 2008-02-22 13:20:01 UTC (rev 10083) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-Beta1 + 1.2.0-SNAPSHOT ../build/pom.xml 4.0.0 Modified: modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/dri= ver/RemoteTestDriverClient.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/driver/Re= moteTestDriverClient.java 2008-02-22 11:34:17 UTC (rev 10082) +++ modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/driver/Re= moteTestDriverClient.java 2008-02-22 13:20:01 UTC (rev 10083) @@ -25,7 +25,7 @@ import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; -import org.jboss.beans.metadata.plugins.annotations.Inject; +import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap; import org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer; import org.jboss.kernel.spi.deployment.KernelDeployment; Modified: modules/test/trunk/test/agent/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/agent/pom.xml 2008-02-22 11:34:17 UTC (rev 1008= 2) +++ modules/test/trunk/test/agent/pom.xml 2008-02-22 13:20:01 UTC (rev 1008= 3) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-Beta1 + 1.2.0-SNAPSHOT ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/test/core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/core/pom.xml 2008-02-22 11:34:17 UTC (rev 10082) +++ modules/test/trunk/test/core/pom.xml 2008-02-22 13:20:01 UTC (rev 10083) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-Beta1 + 1.2.0-SNAPSHOT ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/test/generic/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/generic/pom.xml 2008-02-22 11:34:17 UTC (rev 10= 082) +++ modules/test/trunk/test/generic/pom.xml 2008-02-22 13:20:01 UTC (rev 10= 083) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-Beta1 + 1.2.0-SNAPSHOT ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/test/jboss/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/jboss/pom.xml 2008-02-22 11:34:17 UTC (rev 1008= 2) +++ modules/test/trunk/test/jboss/pom.xml 2008-02-22 13:20:01 UTC (rev 1008= 3) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-Beta1 + 1.2.0-SNAPSHOT ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/test/opends/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/opends/pom.xml 2008-02-22 11:34:17 UTC (rev 100= 82) +++ modules/test/trunk/test/opends/pom.xml 2008-02-22 13:20:01 UTC (rev 100= 83) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-Beta1 + 1.2.0-SNAPSHOT ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/tooling/ant/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/tooling/ant/pom.xml 2008-02-22 11:34:17 UTC (rev 100= 82) +++ modules/test/trunk/tooling/ant/pom.xml 2008-02-22 13:20:01 UTC (rev 100= 83) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-Beta1 + 1.2.0-SNAPSHOT ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/tooling/core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/tooling/core/pom.xml 2008-02-22 11:34:17 UTC (rev 10= 082) +++ modules/test/trunk/tooling/core/pom.xml 2008-02-22 13:20:01 UTC (rev 10= 083) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-Beta1 + 1.2.0-SNAPSHOT ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/tooling/examples/maven2/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/tooling/examples/maven2/pom.xml 2008-02-22 11:34:17 = UTC (rev 10082) +++ modules/test/trunk/tooling/examples/maven2/pom.xml 2008-02-22 13:20:01 = UTC (rev 10083) @@ -11,7 +11,7 @@ org.jboss.unit jboss-unit - 1.2.0-Beta1 + 1.2.0-SNAPSHOT = @@ -39,7 +39,7 @@ org.jboss.unit jboss-unit-tooling-maven2 - 1.2.0-Beta1 + 1.2.0-SNAPSHOT test Modified: modules/test/trunk/tooling/maven2/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/tooling/maven2/pom.xml 2008-02-22 11:34:17 UTC (rev = 10082) +++ modules/test/trunk/tooling/maven2/pom.xml 2008-02-22 13:20:01 UTC (rev = 10083) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-Beta1 + 1.2.0-SNAPSHOT ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/tooling/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/tooling/pom.xml 2008-02-22 11:34:17 UTC (rev 10082) +++ modules/test/trunk/tooling/pom.xml 2008-02-22 13:20:01 UTC (rev 10083) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-Beta1 + 1.2.0-SNAPSHOT ../build/pom.xml 4.0.0 @@ -11,7 +11,7 @@ jboss-unit-tooling-aggregator pom JBoss Unit Tooling (aggregator) - 1.2.0-Beta1 + 1.2.0-SNAPSHOT core ant Modified: modules/test/trunk/unit/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/unit/pom.xml 2008-02-22 11:34:17 UTC (rev 10082) +++ modules/test/trunk/unit/pom.xml 2008-02-22 13:20:01 UTC (rev 10083) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-Beta1 + 1.2.0-SNAPSHOT ../build/pom.xml 4.0.0 --===============8853054441496552771==-- From portal-commits at lists.jboss.org Fri Feb 22 08:28:59 2008 Content-Type: multipart/mixed; boundary="===============7338997490378279961==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10084 - in modules/common/trunk: build and 3 other directories. Date: Fri, 22 Feb 2008 08:28:59 -0500 Message-ID: --===============7338997490378279961== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-22 08:28:59 -0500 (Fri, 22 Feb 2008) New Revision: 10084 Modified: modules/common/trunk/build/pom.xml modules/common/trunk/common/pom.xml modules/common/trunk/mc/pom.xml modules/common/trunk/pom.xml modules/common/trunk/portal/pom.xml Log: JBPORTAL-1898 : Upgrade JBoss MC to the same version than ASB4 Modified: modules/common/trunk/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/build/pom.xml 2008-02-22 13:20:01 UTC (rev 10083) +++ modules/common/trunk/build/pom.xml 2008-02-22 13:28:59 UTC (rev 10084) @@ -10,7 +10,7 @@ module-parent pom JBoss Portal Modules Common - 1.2.0-Beta1 + 1.2.0-SNAPSHOT http://labs.jboss.com/jbossportal = @@ -24,7 +24,7 @@ 2.2.0.GA 1.2.14 3.0.1 - 2.0.0.Beta4 + 2.0.0.Beta9 0.8 3.8.1 1.6.5 Modified: modules/common/trunk/common/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/pom.xml 2008-02-22 13:20:01 UTC (rev 10083) +++ modules/common/trunk/common/pom.xml 2008-02-22 13:28:59 UTC (rev 10084) @@ -3,7 +3,7 @@ org.jboss.portal.common module-parent - 1.2.0-Beta1 + 1.2.0-SNAPSHOT ../build/pom.xml 4.0.0 Modified: modules/common/trunk/mc/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/mc/pom.xml 2008-02-22 13:20:01 UTC (rev 10083) +++ modules/common/trunk/mc/pom.xml 2008-02-22 13:28:59 UTC (rev 10084) @@ -3,7 +3,7 @@ org.jboss.portal.common module-parent - 1.2.0-Beta1 + 1.2.0-SNAPSHOT ../build/pom.xml 4.0.0 Modified: modules/common/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/pom.xml 2008-02-22 13:20:01 UTC (rev 10083) +++ modules/common/trunk/pom.xml 2008-02-22 13:28:59 UTC (rev 10084) @@ -5,7 +5,7 @@ module-aggregator pom JBoss Portal Modules Common (aggregator) - 1.2.0-Beta1 + 1.2.0-SNAPSHOT = Modified: modules/common/trunk/portal/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/portal/pom.xml 2008-02-22 13:20:01 UTC (rev 10083) +++ modules/common/trunk/portal/pom.xml 2008-02-22 13:28:59 UTC (rev 10084) @@ -3,7 +3,7 @@ org.jboss.portal.common module-parent - 1.2.0-Beta1 + 1.2.0-SNAPSHOT ../build/pom.xml 4.0.0 --===============7338997490378279961==-- From portal-commits at lists.jboss.org Fri Feb 22 08:34:08 2008 Content-Type: multipart/mixed; boundary="===============6228322248058017393==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10085 - in modules: portlet/trunk and 10 other directories. Date: Fri, 22 Feb 2008 08:34:08 -0500 Message-ID: --===============6228322248058017393== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-22 08:34:08 -0500 (Fri, 22 Feb 2008) New Revision: 10085 Added: modules/portlet/trunk/.classpath modules/portlet/trunk/.project modules/web/trunk/.classpath modules/web/trunk/.settings/org.eclipse.jdt.ui.prefs Removed: modules/web/trunk/.settings/org.eclipse.jdt.core.prefs Modified: modules/common/trunk/.classpath modules/common/trunk/.project modules/portlet/trunk/ modules/portlet/trunk/bridge/ modules/portlet/trunk/controller/ modules/portlet/trunk/federation/ modules/portlet/trunk/jsr168api/ modules/portlet/trunk/management/ modules/portlet/trunk/portlet/ modules/portlet/trunk/test/ modules/web/trunk/.project modules/web/trunk/web/ Log: Fix Eclipse files Modified: modules/common/trunk/.classpath =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/.classpath 2008-02-22 13:28:59 UTC (rev 10084) +++ modules/common/trunk/.classpath 2008-02-22 13:34:08 UTC (rev 10085) @@ -4,16 +4,6 @@ - - - - - - - - - - - + Modified: modules/common/trunk/.project =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/.project 2008-02-22 13:28:59 UTC (rev 10084) +++ modules/common/trunk/.project 2008-02-22 13:34:08 UTC (rev 10085) @@ -6,6 +6,11 @@ + org.maven.ide.eclipse.maven2Builder + + + + org.eclipse.jdt.core.javabuilder @@ -13,5 +18,6 @@ org.eclipse.jdt.core.javanature + org.maven.ide.eclipse.maven2Nature Property changes on: modules/portlet/trunk ___________________________________________________________________ Name: svn:ignore - thirdparty + thirdparty target Added: modules/portlet/trunk/.classpath =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/.classpath (rev 0) +++ modules/portlet/trunk/.classpath 2008-02-22 13:34:08 UTC (rev 10085) @@ -0,0 +1,12 @@ + + + + + + + + + + + + Added: modules/portlet/trunk/.project =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/.project (rev 0) +++ modules/portlet/trunk/.project 2008-02-22 13:34:08 UTC (rev 10085) @@ -0,0 +1,23 @@ + + + module-portlet + + + + + + org.maven.ide.eclipse.maven2Builder + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + org.maven.ide.eclipse.maven2Nature + + Property changes on: modules/portlet/trunk/bridge ___________________________________________________________________ Name: svn:ignore - output + output target Property changes on: modules/portlet/trunk/controller ___________________________________________________________________ Name: svn:ignore + target Property changes on: modules/portlet/trunk/federation ___________________________________________________________________ Name: svn:ignore - output + output target Property changes on: modules/portlet/trunk/jsr168api ___________________________________________________________________ Name: svn:ignore - output + output target Property changes on: modules/portlet/trunk/management ___________________________________________________________________ Name: svn:ignore - output + output target Property changes on: modules/portlet/trunk/portlet ___________________________________________________________________ Name: svn:ignore - output + output target Property changes on: modules/portlet/trunk/test ___________________________________________________________________ Name: svn:ignore - output gen-src + output gen-src target Added: modules/web/trunk/.classpath =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/.classpath (rev 0) +++ modules/web/trunk/.classpath 2008-02-22 13:34:08 UTC (rev 10085) @@ -0,0 +1,7 @@ + + + + + + + Modified: modules/web/trunk/.project =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/.project 2008-02-22 13:28:59 UTC (rev 10084) +++ modules/web/trunk/.project 2008-02-22 13:34:08 UTC (rev 10085) @@ -6,6 +6,11 @@ + org.maven.ide.eclipse.maven2Builder + + + + org.eclipse.jdt.core.javabuilder @@ -13,5 +18,6 @@ org.eclipse.jdt.core.javanature + org.maven.ide.eclipse.maven2Nature Deleted: modules/web/trunk/.settings/org.eclipse.jdt.core.prefs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/.settings/org.eclipse.jdt.core.prefs 2008-02-22 13:28= :59 UTC (rev 10084) +++ modules/web/trunk/.settings/org.eclipse.jdt.core.prefs 2008-02-22 13:34= :08 UTC (rev 10085) @@ -1,12 +0,0 @@ -#Thu Sep 20 15:12:51 CEST 2007 -eclipse.preferences.version=3D1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=3Ddisabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=3D1.2 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=3Dpreserve -org.eclipse.jdt.core.compiler.compliance=3D1.4 -org.eclipse.jdt.core.compiler.debug.lineNumber=3Dgenerate -org.eclipse.jdt.core.compiler.debug.localVariable=3Dgenerate -org.eclipse.jdt.core.compiler.debug.sourceFile=3Dgenerate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=3Dwarning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=3Dwarning -org.eclipse.jdt.core.compiler.source=3D1.3 Added: modules/web/trunk/.settings/org.eclipse.jdt.ui.prefs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/.settings/org.eclipse.jdt.ui.prefs = (rev 0) +++ modules/web/trunk/.settings/org.eclipse.jdt.ui.prefs 2008-02-22 13:34:0= 8 UTC (rev 10085) @@ -0,0 +1,3 @@ +#Fri Feb 22 14:30:40 CET 2008 +eclipse.preferences.version=3D1 +internal.default.compliance=3Ddefault Property changes on: modules/web/trunk/web ___________________________________________________________________ Name: svn:ignore - output + output target --===============6228322248058017393==-- From portal-commits at lists.jboss.org Fri Feb 22 08:39:45 2008 Content-Type: multipart/mixed; boundary="===============8378772430729033211==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10086 - modules/identity/trunk/build. Date: Fri, 22 Feb 2008 08:35:44 -0500 Message-ID: --===============8378772430729033211== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-22 08:35:44 -0500 (Fri, 22 Feb 2008) New Revision: 10086 Modified: modules/identity/trunk/build/pom.xml Log: JBPORTAL-1898 : Upgrade JBoss MC to the same version than ASB4 Modified: modules/identity/trunk/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/identity/trunk/build/pom.xml 2008-02-22 13:34:08 UTC (rev 10085) +++ modules/identity/trunk/build/pom.xml 2008-02-22 13:35:44 UTC (rev 10086) @@ -30,7 +30,7 @@ 1.6.5 1.2.0-SNAPSHOT 1.2.0-SNAPSHOT - 2.0.0.Beta4 + 2.0.0.Beta9 1.0.0-BUILD04 4.0.4.GA 3.2.3.GA --===============8378772430729033211==-- From portal-commits at lists.jboss.org Fri Feb 22 08:44:30 2008 Content-Type: multipart/mixed; boundary="===============5757296136824853468==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10087 - modules/web/trunk/build. Date: Fri, 22 Feb 2008 08:40:29 -0500 Message-ID: --===============5757296136824853468== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-22 08:40:29 -0500 (Fri, 22 Feb 2008) New Revision: 10087 Modified: modules/web/trunk/build/pom.xml Log: JBPORTAL-1898 : Upgrade JBoss MC to the same version than ASB4 Modified: modules/web/trunk/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/build/pom.xml 2008-02-22 13:35:44 UTC (rev 10086) +++ modules/web/trunk/build/pom.xml 2008-02-22 13:40:29 UTC (rev 10087) @@ -37,12 +37,12 @@ 3.6-beta 2.2.1.GA 1.2.0-Beta1 - 1.2.0-Beta1 + 1.2.0-SNAPSHOT 1.2.14 1.1.1 3.0.1 2.1.1 - 2.0.0.Beta4 + 2.0.0.Beta9 0.9-portal 3.8.1 2.7.1 --===============5757296136824853468==-- From portal-commits at lists.jboss.org Fri Feb 22 09:53:59 2008 Content-Type: multipart/mixed; boundary="===============2566633115821573484==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10088 - in modules/portlet/trunk: bridge and 11 other directories. Date: Fri, 22 Feb 2008 09:53:58 -0500 Message-ID: --===============2566633115821573484== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-22 09:53:58 -0500 (Fri, 22 Feb 2008) New Revision: 10088 Modified: modules/portlet/trunk/bridge/pom.xml modules/portlet/trunk/build/pom.xml modules/portlet/trunk/controller/pom.xml modules/portlet/trunk/docs/pom.xml modules/portlet/trunk/docs/user-guide/pom.xml modules/portlet/trunk/federation/pom.xml modules/portlet/trunk/jsr168api/pom.xml modules/portlet/trunk/management/pom.xml modules/portlet/trunk/pom.xml modules/portlet/trunk/portlet/pom.xml modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletContainerImpl.java modules/portlet/trunk/test/pom.xml modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletControllerContextImpl.java Log: JBPORTAL-1898 : Upgrade JBoss MC to the same version than ASB4 Modified: modules/portlet/trunk/bridge/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/bridge/pom.xml 2008-02-22 13:40:29 UTC (rev 10087) +++ modules/portlet/trunk/bridge/pom.xml 2008-02-22 14:53:58 UTC (rev 10088) @@ -3,7 +3,7 @@ org.jboss.portal.portlet module-parent - 2.0-Beta1 + 2.0-SNAPSHOT ../build/pom.xml 4.0.0 Modified: modules/portlet/trunk/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/build/pom.xml 2008-02-22 13:40:29 UTC (rev 10087) +++ modules/portlet/trunk/build/pom.xml 2008-02-22 14:53:58 UTC (rev 10088) @@ -18,7 +18,7 @@ 4.0.0 org.jboss.portal.portlet module-parent - 2.0-Beta1 + 2.0-SNAPSHOT pom JBoss Portal Portlet Module JBoss Portal Portlet Module @@ -40,12 +40,12 @@ 2.2.1.GA 1.2.0-Beta1 1.2.0-SNAPSHOT - 1.2.0-Beta1 + 1.2.0-SNAPSHOT 1.2.14 1.1.1 3.0.1 2.1.1 - 2.0.0.Beta4 + 2.0.0.Beta9 0.9-portal 3.8.1 2.7.1 Modified: modules/portlet/trunk/controller/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/pom.xml 2008-02-22 13:40:29 UTC (rev 1= 0087) +++ modules/portlet/trunk/controller/pom.xml 2008-02-22 14:53:58 UTC (rev 1= 0088) @@ -3,7 +3,7 @@ org.jboss.portal.portlet module-parent - 2.0-Beta1 + 2.0-SNAPSHOT ../build/pom.xml 4.0.0 Modified: modules/portlet/trunk/docs/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/docs/pom.xml 2008-02-22 13:40:29 UTC (rev 10087) +++ modules/portlet/trunk/docs/pom.xml 2008-02-22 14:53:58 UTC (rev 10088) @@ -4,7 +4,7 @@ org.jboss.portal.portlet module-parent - 2.0-Beta1 + 2.0-SNAPSHOT ../build/pom.xml docs-aggregator Modified: modules/portlet/trunk/docs/user-guide/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/docs/user-guide/pom.xml 2008-02-22 13:40:29 UTC (= rev 10087) +++ modules/portlet/trunk/docs/user-guide/pom.xml 2008-02-22 14:53:58 UTC (= rev 10088) @@ -11,7 +11,7 @@ org.jboss.portal.portlet user-guide-${translation} - 2.0-Beta1 + 2.0-SNAPSHOT jdocbook User_Guide_(${translation}) = Modified: modules/portlet/trunk/federation/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/federation/pom.xml 2008-02-22 13:40:29 UTC (rev 1= 0087) +++ modules/portlet/trunk/federation/pom.xml 2008-02-22 14:53:58 UTC (rev 1= 0088) @@ -3,7 +3,7 @@ org.jboss.portal.portlet module-parent - 2.0-Beta1 + 2.0-SNAPSHOT ../build/pom.xml 4.0.0 Modified: modules/portlet/trunk/jsr168api/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/jsr168api/pom.xml 2008-02-22 13:40:29 UTC (rev 10= 087) +++ modules/portlet/trunk/jsr168api/pom.xml 2008-02-22 14:53:58 UTC (rev 10= 088) @@ -3,7 +3,7 @@ org.jboss.portal.portlet module-parent - 2.0-Beta1 + 2.0-SNAPSHOT ../build/pom.xml 4.0.0 Modified: modules/portlet/trunk/management/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/management/pom.xml 2008-02-22 13:40:29 UTC (rev 1= 0087) +++ modules/portlet/trunk/management/pom.xml 2008-02-22 14:53:58 UTC (rev 1= 0088) @@ -3,7 +3,7 @@ org.jboss.portal.portlet module-parent - 2.0-Beta1 + 2.0-SNAPSHOT ../build/pom.xml 4.0.0 Modified: modules/portlet/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/pom.xml 2008-02-22 13:40:29 UTC (rev 10087) +++ modules/portlet/trunk/pom.xml 2008-02-22 14:53:58 UTC (rev 10088) @@ -5,7 +5,7 @@ module-aggregator pom JBoss Portal Portlet Module Aggregator - 2.0-Beta1 + 2.0-SNAPSHOT http://labs.jboss.com/jbossportal = Modified: modules/portlet/trunk/portlet/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/pom.xml 2008-02-22 13:40:29 UTC (rev 1008= 7) +++ modules/portlet/trunk/portlet/pom.xml 2008-02-22 14:53:58 UTC (rev 1008= 8) @@ -3,7 +3,7 @@ org.jboss.portal.portlet module-parent - 2.0-Beta1 + 2.0-SNAPSHOT ../build/pom.xml 4.0.0 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletContainerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletContainerImpl.java 2008-02-22 13:40:29 UTC (rev 10087) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletContainerImpl.java 2008-02-22 14:53:58 UTC (rev 10088) @@ -328,7 +328,7 @@ if (filter.getId().equals(filterRef)) { T filterInstance =3D filter.instance(type); - if (filterInstance =3D=3D null) + if (filterInstance !=3D null) { list.add(filterInstance); } Modified: modules/portlet/trunk/test/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/pom.xml 2008-02-22 13:40:29 UTC (rev 10087) +++ modules/portlet/trunk/test/pom.xml 2008-02-22 14:53:58 UTC (rev 10088) @@ -3,7 +3,7 @@ org.jboss.portal.portlet module-parent - 2.0-Beta1 + 2.0-SNAPSHOT ../build/pom.xml 4.0.0 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContextImpl.java 2008-02-22 13:40:29 UTC (rev 1= 0087) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContextImpl.java 2008-02-22 14:53:58 UTC (rev 1= 0088) @@ -45,7 +45,7 @@ * @author Julien Viet * @version $Revision: 1.1 $ */ -public class PortletControllerContextImpl extends AbstractPortletControlle= rContext + public class PortletControllerContextImpl extends AbstractPortletContro= llerContext { = /** . */ --===============2566633115821573484==-- From portal-commits at lists.jboss.org Fri Feb 22 10:23:14 2008 Content-Type: multipart/mixed; boundary="===============0458547286903669118==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10089 - in modules/identity/trunk/identity/src/test/java/org/jboss/portal/test/identity: ldap and 1 other directory. Date: Fri, 22 Feb 2008 10:19:14 -0500 Message-ID: --===============0458547286903669118== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-22 10:19:14 -0500 (Fri, 22 Feb 2008) New Revision: 10089 Modified: modules/identity/trunk/identity/src/test/java/org/jboss/portal/test/iden= tity/IdentityTestPOJO.java modules/identity/trunk/identity/src/test/java/org/jboss/portal/test/iden= tity/ldap/LDAPTestPOJO.java Log: fixing for MC beta 9 Modified: modules/identity/trunk/identity/src/test/java/org/jboss/portal/te= st/identity/IdentityTestPOJO.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/identity/trunk/identity/src/test/java/org/jboss/portal/test/ide= ntity/IdentityTestPOJO.java 2008-02-22 14:53:58 UTC (rev 10088) +++ modules/identity/trunk/identity/src/test/java/org/jboss/portal/test/ide= ntity/IdentityTestPOJO.java 2008-02-22 15:19:14 UTC (rev 10089) @@ -29,7 +29,7 @@ import org.jboss.portal.identity.MembershipModule; import org.jboss.portal.identity.UserProfileModule; import org.jboss.unit.api.pojo.annotations.Parameter; -import org.jboss.beans.metadata.plugins.annotations.Inject; +import org.jboss.beans.metadata.api.annotations.Inject; import org.apache.log4j.Appender; import org.apache.log4j.ConsoleAppender; import org.apache.log4j.Logger; Modified: modules/identity/trunk/identity/src/test/java/org/jboss/portal/te= st/identity/ldap/LDAPTestPOJO.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/identity/trunk/identity/src/test/java/org/jboss/portal/test/ide= ntity/ldap/LDAPTestPOJO.java 2008-02-22 14:53:58 UTC (rev 10088) +++ modules/identity/trunk/identity/src/test/java/org/jboss/portal/test/ide= ntity/ldap/LDAPTestPOJO.java 2008-02-22 15:19:14 UTC (rev 10089) @@ -22,7 +22,6 @@ *************************************************************************= *****/ package org.jboss.portal.test.identity.ldap; = -import org.jboss.beans.metadata.plugins.annotations.Inject; import org.jboss.portal.test.framework.embedded.DSConfig; import org.jboss.portal.test.identity.IdentityTestPOJO; import org.jboss.portal.identity.IdentityConfiguration; @@ -30,6 +29,7 @@ import org.jboss.unit.api.pojo.annotations.Parameter; import org.jboss.unit.api.pojo.annotations.Create; import org.jboss.unit.api.pojo.annotations.Destroy; +import org.jboss.beans.metadata.api.annotations.Inject; import org.opends.server.tools.LDAPModify; = import javax.naming.Binding; --===============0458547286903669118==-- From portal-commits at lists.jboss.org Fri Feb 22 11:28:23 2008 Content-Type: multipart/mixed; boundary="===============4641930497949520793==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10090 - in branches/JBoss_Portal_Branch_2_7: core and 22 other directories. Date: Fri, 22 Feb 2008 11:28:22 -0500 Message-ID: --===============4641930497949520793== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-22 11:28:22 -0500 (Fri, 22 Feb 2008) New Revision: 10090 Removed: branches/JBoss_Portal_Branch_2_7/portlet-server/src/main/org/jboss/porta= l/portlet/tck/ branches/JBoss_Portal_Branch_2_7/portlet-server/src/main/org/jboss/porta= l/portlet/test/ Modified: branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml branches/JBoss_Portal_Branch_2_7/core-cms/.classpath branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core= /cms/CMSObjectCommandFactoryService.java branches/JBoss_Portal_Branch_2_7/core-identity/.classpath branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal= /core/identity/services/impl/IdentityCommandFactoryService.java branches/JBoss_Portal_Branch_2_7/core-samples/.classpath branches/JBoss_Portal_Branch_2_7/core-search/src/main/org/jboss/portal/c= ore/search/service/SearchResultCommandFactoryService.java branches/JBoss_Portal_Branch_2_7/core/.classpath branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/asp= ects/controller/PageCustomizerInterceptor.java branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/asp= ects/controller/node/EventBroadcasterInterceptor.java branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/asp= ects/portlet/HeaderInterceptor.java branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/con= troller/portlet/ControllerResponseFactory.java branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/con= troller/portlet/PortletInvocationFactory.java branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/dep= loyment/jboss/PortletAppDeployment.java branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/imp= l/api/node/AbstractPortalNodeURL.java branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/imp= l/model/content/generic/InternalGenericContentProvider.java branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/mod= el/instance/InstanceSecurityInterceptor.java branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/mod= el/instance/command/action/InvokePortletInstanceActionCommand.java branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/mod= el/portal/command/action/InvokePortletWindowActionCommand.java branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/c= omponent/portlet/JSFInvocation.java branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/c= omponent/portlet/JSFRenderContext.java branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/c= omponent/portlet/PortletActionEvent.java branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/c= omponent/portlet/PortletRenderEvent.java branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/c= omponent/portlet/UIPortlet.java branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsr= p/framework/support/TestPortletInvocationContext.java branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsr= p/v1/consumer/MarkupTestCase.java branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/con= sumer/ActionContextRequestContext.java branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/con= sumer/ActionHandler.java branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/con= sumer/RenderHandler.java branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/con= sumer/RequestPrecursor.java branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/con= sumer/WSRPConsumerImpl.java branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/pro= ducer/ActionRequestProcessor.java branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/pro= ducer/MarkupHandler.java branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/pro= ducer/WSRPActionContext.java branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/pro= ducer/WSRPRequestContext.java Log: Started to move to the new API. Build is *broken* it is expected Modified: branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml 2008-02-22 = 15:19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml 2008-02-22 = 16:28:22 UTC (rev 10090) @@ -47,10 +47,10 @@ are pushed to the http://repository.jboss.com site. --> = - - + + - + @@ -120,6 +120,7 @@ + = = Modified: branches/JBoss_Portal_Branch_2_7/core/.classpath =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/core/.classpath 2008-02-22 15:19:14 UT= C (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/core/.classpath 2008-02-22 16:28:22 UT= C (rev 10090) @@ -44,7 +44,7 @@ - + @@ -55,6 +55,7 @@ - + + Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/c= ore/aspects/controller/PageCustomizerInterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/as= pects/controller/PageCustomizerInterceptor.java 2008-02-22 15:19:14 UTC (re= v 10089) +++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/as= pects/controller/PageCustomizerInterceptor.java 2008-02-22 16:28:22 UTC (re= v 10090) @@ -53,7 +53,7 @@ import org.jboss.portal.core.model.portal.command.view.ViewPortalCommand; import org.jboss.portal.core.theme.PageRendition; import org.jboss.portal.identity.User; -import org.jboss.portal.portlet.PortletParametersStateString; +import org.jboss.portal.portlet.ParametersStateString; import org.jboss.portal.security.PortalSecurityException; import org.jboss.portal.security.spi.auth.PortalAuthorizationManager; import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactor= y; @@ -235,7 +235,7 @@ if (isDashboard) { // Edit page - PortletParametersStateString navState =3D new PortletParame= tersStateString(); + ParametersStateString navState =3D ParametersStateString.cr= eate(); navState.setValue("editPageSelect", pageName); InvokePortletInstanceRenderCommand command =3D new InvokePo= rtletInstanceRenderCommand("DashboardConfigPortletInstance", navState); rd.setAttribute("org.jboss.portal.header.EDIT_DASHBOARD_URL= ", new PortalURLImpl(command, controllerCtx, null, null)); Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/c= ore/aspects/controller/node/EventBroadcasterInterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/as= pects/controller/node/EventBroadcasterInterceptor.java 2008-02-22 15:19:14 = UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/as= pects/controller/node/EventBroadcasterInterceptor.java 2008-02-22 16:28:22 = UTC (rev 10090) @@ -35,6 +35,7 @@ import org.jboss.portal.api.node.event.WindowRenderEvent; import org.jboss.portal.common.invocation.InvocationException; import org.jboss.portal.common.util.LazyMap; +import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.core.controller.CommandRedirectionException; import org.jboss.portal.core.controller.ControllerCommand; import org.jboss.portal.core.controller.ControllerInterceptor; @@ -50,8 +51,7 @@ import org.jboss.portal.core.model.portal.command.render.RenderWindowComma= nd; import org.jboss.portal.core.model.portal.navstate.WindowNavigationalState; import org.jboss.portal.core.navstate.NavigationalStateKey; -import org.jboss.portal.portlet.PortletParameters; -import org.jboss.portal.portlet.PortletParametersStateString; +import org.jboss.portal.portlet.ParametersStateString; import org.jboss.portal.portlet.StateString; = import java.util.Map; @@ -146,10 +146,10 @@ Map params =3D wae.getParameters(); = // - PortletParameters interactionParams; + ParameterMap interactionParams; if (params instanceof ActionParameterMap) { - interactionParams =3D (PortletParameters)((ActionParameterM= ap)params).createDelegate(); + interactionParams =3D (ParameterMap)((ActionParameterMap)pa= rams).createDelegate(); } else { @@ -164,7 +164,7 @@ mode, windowState, null, - new PortletParametersStateString(interactionParams), + ParametersStateString.create(interactionParams), null); } } @@ -174,8 +174,8 @@ = // Map params =3D wne.getParameters(); - PortletParameters navigationalParams =3D asParameters(params); - StateString state =3D navigationalParams !=3D null ? new Portl= etParametersStateString(navigationalParams) : null; + ParameterMap navigationalParams =3D asParameters(params); + StateString state =3D navigationalParams !=3D null ? Parameter= sStateString.create(navigationalParams) : null; = // return new InvokePortletWindowRenderCommand(nodeRef, mode, win= dowState, state); @@ -205,13 +205,13 @@ InvokePortletWindowActionCommand iwac =3D (InvokePortletWindow= ActionCommand)wc; = // Get form parameters - PortletParameters formParameters =3D iwac.getFormParameters(); + ParameterMap formParameters =3D iwac.getFormParameters(); = // Get interaction parameters - PortletParameters interactionParameters =3D null; - if (iwac.getInteractionState() instanceof PortletParametersSta= teString) + ParameterMap interactionParameters =3D null; + if (iwac.getInteractionState() instanceof ParametersStateStrin= g) { - interactionParameters =3D ((PortletParametersStateString)iw= ac.getInteractionState()).getParameters(); + interactionParameters =3D ((ParametersStateString)iwac.getI= nteractionState()).getParameters(); } = // Build a map that represents the parameters of the action @@ -235,7 +235,7 @@ } else { - actionParameters =3D new PortletParameters(); + actionParameters =3D new ParameterMap(); } } = @@ -257,9 +257,9 @@ = // StateString navigationalState =3D iwrc.getNavigationalState(); - if (navigationalState instanceof PortletParametersStateString) + if (navigationalState instanceof ParametersStateString) { - Map params =3D ((PortletParametersStateString)navigationalS= tate).getParameters(); + Map params =3D ((ParametersStateString)navigationalState).g= etParameters(); event.setParameters(params); } = @@ -280,9 +280,9 @@ event.setWindowState(navstate.getWindowState()); = StateString parametersState =3D navstate.getContentState(); - if (parametersState instanceof PortletParametersStateString) + if (parametersState instanceof ParametersStateString) { - Map params =3D ((PortletParametersStateString)parameters= State).getParameters(); + Map params =3D ((ParametersStateString)parametersState).= getParameters(); event.setParameters(params); } } @@ -304,21 +304,21 @@ * @param map * @return */ - private PortletParameters asParameters(Map map) + private ParameterMap asParameters(Map map) { if (map =3D=3D null) { return null; } - else if (map instanceof PortletParameters) + else if (map instanceof ParameterMap) { - return (PortletParameters)map; + return (ParameterMap)map; } else { try { - return new PortletParameters(map); + return new ParameterMap(map); } catch (IllegalArgumentException e) { @@ -336,15 +336,15 @@ private static class ActionParameterMap extends LazyMap { /** . */ - private PortletParameters formParams; + private ParameterMap formParams; = /** . */ - private PortletParameters interactionParams; + private ParameterMap interactionParams; = /** . */ - private PortletParameters params; + private ParameterMap params; = - public ActionParameterMap(PortletParameters interactionParams, Portl= etParameters formParams) + public ActionParameterMap(ParameterMap interactionParams, ParameterM= ap formParams) { this.formParams =3D formParams; this.interactionParams =3D interactionParams; @@ -355,7 +355,7 @@ { if (params =3D=3D null) { - params =3D new PortletParameters(interactionParams); + params =3D new ParameterMap(interactionParams); params.append(formParams); } return params; Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/c= ore/aspects/portlet/HeaderInterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/as= pects/portlet/HeaderInterceptor.java 2008-02-22 15:19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/as= pects/portlet/HeaderInterceptor.java 2008-02-22 16:28:22 UTC (rev 10090) @@ -58,6 +58,7 @@ StringWriter buffer =3D null; = // Get existing header which may be null + = String headerChars =3D fragment.getHeader(); = // Add declaratively injected header content here (get it via the= component) Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/c= ore/controller/portlet/ControllerResponseFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/co= ntroller/portlet/ControllerResponseFactory.java 2008-02-22 15:19:14 UTC (re= v 10089) +++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/co= ntroller/portlet/ControllerResponseFactory.java 2008-02-22 16:28:22 UTC (re= v 10090) @@ -37,8 +37,7 @@ import org.jboss.portal.portlet.NoSuchPortletException; import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.invocation.response.RenderResponse; -import org.jboss.portal.portlet.spi.ActionContext; +import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStat= eResponse; = /** * @author Julien Viet @@ -59,11 +58,11 @@ } } = - public static ControllerResponse createActionResponse(PortalObjectId ta= rgetId, ActionContext actionContext, PortletInvocationResponse response) + public static ControllerResponse createActionResponse(PortalObjectId ta= rgetId, RequestContext reqContext, PortletInvocationResponse response) { - if (response instanceof RenderResponse) + if (response instanceof UpdateNavigationalStateResponse) { - RenderResponse renderResult =3D (RenderResponse)response; + UpdateNavigationalStateResponse renderResult =3D (UpdateNavigationa= lStateResponse)response; = // Mode mode =3D renderResult.getMode(); @@ -90,9 +89,9 @@ = public static ControllerResponse createActionResponse(String instanceId= , PortletInvocationResponse response) { - if (response instanceof org.jboss.portal.portlet.invocation.response= .RenderResponse) + if (response instanceof UpdateNavigationalStateResponse) { - RenderResponse renderResult =3D (RenderResponse)response; + UpdateNavigationalStateResponse renderResult =3D (UpdateNavigationa= lStateResponse)response; = // return new PortletInstanceActionResponse(instanceId, null, null, = renderResult.getNavigationalState()); Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/c= ore/controller/portlet/PortletInvocationFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/co= ntroller/portlet/PortletInvocationFactory.java 2008-02-22 15:19:14 UTC (rev= 10089) +++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/co= ntroller/portlet/PortletInvocationFactory.java 2008-02-22 16:28:22 UTC (rev= 10090) @@ -34,7 +34,6 @@ import org.jboss.portal.core.model.portal.command.action.InvokePortletWind= owActionCommand; import org.jboss.portal.core.model.portal.command.action.InvokePortletWind= owRenderCommand; import org.jboss.portal.portlet.ActionURL; -import org.jboss.portal.portlet.PortletParameters; import org.jboss.portal.portlet.PortletURL; import org.jboss.portal.portlet.RenderURL; import org.jboss.portal.portlet.StateString; @@ -78,7 +77,7 @@ WindowState windowState, StateString navigationalState, StateString interactionState, - PortletParameters form, + ParameterMap form, Window window, Portal portal) { @@ -93,7 +92,7 @@ WindowState windowState, StateString navigationalState, StateString interactionState, - PortletParameters form, + ParameterMap form, PortletContextFactory cf, InvokePortletCommandFactory cpc) { Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/c= ore/deployment/jboss/PortletAppDeployment.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/de= ployment/jboss/PortletAppDeployment.java 2008-02-22 15:19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/de= ployment/jboss/PortletAppDeployment.java 2008-02-22 16:28:22 UTC (rev 10090) @@ -51,7 +51,6 @@ import org.jboss.portal.portlet.InvalidPortletIdException; import org.jboss.portal.portlet.NoSuchPortletException; import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.impl.jsr168.metadata.PreferenceMetaData; import org.jboss.portal.portlet.state.PropertyChange; import org.jboss.portal.portlet.state.PropertyMap; import org.jboss.portal.security.RoleSecurityBinding; Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/c= ore/impl/api/node/AbstractPortalNodeURL.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/im= pl/api/node/AbstractPortalNodeURL.java 2008-02-22 15:19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/im= pl/api/node/AbstractPortalNodeURL.java 2008-02-22 16:28:22 UTC (rev 10090) @@ -25,7 +25,7 @@ import org.jboss.portal.api.node.PortalNodeURL; import org.jboss.portal.core.controller.ControllerContext; import org.jboss.portal.core.model.portal.PortalObjectId; -import org.jboss.portal.portlet.PortletParametersStateString; +import org.jboss.portal.portlet.ParametersStateString; import org.jboss.portal.server.request.URLContext; = /** @@ -42,7 +42,7 @@ protected ControllerContext controllerContext; = /** . */ - protected PortletParametersStateString parameters; + protected ParametersStateString parameters; = /** . */ protected Boolean wantSecure; @@ -61,7 +61,7 @@ this.id =3D id; this.controllerContext =3D controllerContext; this.relative =3D true; - this.parameters =3D new PortletParametersStateString(); + this.parameters =3D ParametersStateString.create(); } = public void setParameter(String name, String value) Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/c= ore/impl/model/content/generic/InternalGenericContentProvider.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/im= pl/model/content/generic/InternalGenericContentProvider.java 2008-02-22 15:= 19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/im= pl/model/content/generic/InternalGenericContentProvider.java 2008-02-22 16:= 28:22 UTC (rev 10090) @@ -39,7 +39,7 @@ import org.jboss.portal.core.model.portal.content.WindowRendition; import org.jboss.portal.core.model.portal.content.ContentRendererContext; import org.jboss.portal.core.model.portal.navstate.WindowNavigationalState; -import org.jboss.portal.portlet.PortletParametersStateString; +import org.jboss.portal.portlet.ParametersStateString; = import java.util.Iterator; import java.util.Map; @@ -180,7 +180,7 @@ // if (navigationalState =3D=3D null) { - PortletParametersStateString state =3D new PortletParametersState= String(); + ParametersStateString state =3D ParametersStateString.create(); = // for (Iterator i =3D content.getParameterNames(); i.hasNext();) Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/c= ore/model/instance/InstanceSecurityInterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/mo= del/instance/InstanceSecurityInterceptor.java 2008-02-22 15:19:14 UTC (rev = 10089) +++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/mo= del/instance/InstanceSecurityInterceptor.java 2008-02-22 16:28:22 UTC (rev = 10090) @@ -64,7 +64,7 @@ { // Compute the security mask int mask =3D InstancePermission.VIEW_MASK; - Mode mode =3D invocation.getPortletContext().getMode(); + Mode mode =3D invocation.getMode(); if (Mode.ADMIN.equals(mode)) { mask |=3D InstancePermission.ADMIN_MASK; Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/c= ore/model/instance/command/action/InvokePortletInstanceActionCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/mo= del/instance/command/action/InvokePortletInstanceActionCommand.java 2008-02= -22 15:19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/mo= del/instance/command/action/InvokePortletInstanceActionCommand.java 2008-02= -22 16:28:22 UTC (rev 10090) @@ -24,6 +24,7 @@ = import org.jboss.portal.Mode; import org.jboss.portal.WindowState; +import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.core.controller.ControllerException; import org.jboss.portal.core.controller.ControllerResponse; import org.jboss.portal.core.controller.command.info.CommandInfo; @@ -34,7 +35,6 @@ import org.jboss.portal.core.model.instance.InvokePortletInstanceCommandFa= ctory; import org.jboss.portal.core.model.instance.command.PortletInstanceCommand; import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.PortletParameters; import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.invocation.ActionInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; @@ -50,13 +50,13 @@ private StateString interactionState; = /** The nform. */ - private PortletParameters form; + private ParameterMap form; = public InvokePortletInstanceActionCommand( String instanceId, StateString navigationalState, StateString interactionState, - PortletParameters form) + ParameterMap form) { super(instanceId, navigationalState); = @@ -70,7 +70,7 @@ return interactionState; } = - public PortletParameters getForm() + public ParameterMap getForm() { return form; } Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/c= ore/model/portal/command/action/InvokePortletWindowActionCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/mo= del/portal/command/action/InvokePortletWindowActionCommand.java 2008-02-22 = 15:19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/mo= del/portal/command/action/InvokePortletWindowActionCommand.java 2008-02-22 = 16:28:22 UTC (rev 10090) @@ -25,6 +25,7 @@ import org.jboss.logging.Logger; import org.jboss.portal.Mode; import org.jboss.portal.WindowState; +import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.core.controller.ControllerException; import org.jboss.portal.core.controller.ControllerResponse; import org.jboss.portal.core.controller.NoSuchResourceException; @@ -37,11 +38,10 @@ import org.jboss.portal.core.model.portal.PortalObjectId; import org.jboss.portal.identity.User; import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.PortletParameters; import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.spi.ActionContext; +import org.jboss.portal.portlet.spi.RequestContext; = /** * @author Julien Viet @@ -63,7 +63,7 @@ private StateString interactionState; = /** . */ - private PortletParameters formParameters; + private ParameterMap formParameters; = /** The instance. */ protected Instance instance; @@ -74,7 +74,7 @@ WindowState windowState, StateString navigationalState, StateString interactionState, - PortletParameters formParameters) + ParameterMap formParameters) throws IllegalArgumentException { super(windowId, mode, windowState); @@ -100,12 +100,12 @@ this.interactionState =3D interactionState; } = - public PortletParameters getFormParameters() + public ParameterMap getFormParameters() { return formParameters; } = - public void setFormParameters(PortletParameters formParameters) + public void setFormParameters(ParameterMap formParameters) { this.formParameters =3D formParameters; } @@ -174,7 +174,7 @@ PortletInvocationResponse response =3D instance.invoke(invocation= ); = // - return ControllerResponseFactory.createActionResponse(targetId, (= ActionContext)invocation.getContext(), response); + return ControllerResponseFactory.createActionResponse(targetId, (= RequestContext)invocation.getContext(), response); } catch (PortletInvokerException e) { Modified: branches/JBoss_Portal_Branch_2_7/core-cms/.classpath =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/core-cms/.classpath 2008-02-22 15:19:1= 4 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/core-cms/.classpath 2008-02-22 16:28:2= 2 UTC (rev 10090) @@ -27,5 +27,6 @@ + Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/port= al/core/cms/CMSObjectCommandFactoryService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/cor= e/cms/CMSObjectCommandFactoryService.java 2008-02-22 15:19:14 UTC (rev 1008= 9) +++ branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/cor= e/cms/CMSObjectCommandFactoryService.java 2008-02-22 16:28:22 UTC (rev 1009= 0) @@ -36,7 +36,7 @@ import org.jboss.portal.core.model.portal.PortalObjectId; import org.jboss.portal.core.model.portal.PortalObjectPath; import org.jboss.portal.core.model.portal.command.action.InvokePortletWind= owRenderCommand; -import org.jboss.portal.portlet.PortletParametersStateString; +import org.jboss.portal.portlet.ParametersStateString; import org.jboss.portal.server.ServerInvocation; import org.jboss.portal.server.config.ServerConfig; = @@ -154,7 +154,7 @@ else { // Set the content as a render parameter - PortletParametersStateString parameters =3D new PortletP= arametersStateString(); + ParametersStateString parameters =3D ParametersStateStri= ng.create(); parameters.setValue(CMSPortlet.RENDER_PARAMETER_PATH, pa= th); = // Perform a render URL on the target window @@ -167,7 +167,7 @@ { if (e.toString().indexOf("Access to this resource is denied") != =3D -1) { - PortletParametersStateString parameters =3D new PortletParamet= ersStateString(); + ParametersStateString parameters =3D ParametersStateString.cre= ate(); parameters.setValue("path", requestPath); return new InvokePortletWindowRenderCommand(targetWindowId, Mo= de.VIEW, null, parameters); } Modified: branches/JBoss_Portal_Branch_2_7/core-identity/.classpath =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/core-identity/.classpath 2008-02-22 15= :19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/core-identity/.classpath 2008-02-22 16= :28:22 UTC (rev 10090) @@ -48,6 +48,6 @@ - + Modified: branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss= /portal/core/identity/services/impl/IdentityCommandFactoryService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/porta= l/core/identity/services/impl/IdentityCommandFactoryService.java 2008-02-22= 15:19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/porta= l/core/identity/services/impl/IdentityCommandFactoryService.java 2008-02-22= 16:28:22 UTC (rev 10090) @@ -30,7 +30,7 @@ import org.jboss.portal.core.identity.services.metadata.CoreIdentityConfig= urationException; import org.jboss.portal.core.identity.services.workflow.ValidateEmailServi= ce; import org.jboss.portal.core.model.instance.command.action.InvokePortletIn= stanceRenderCommand; -import org.jboss.portal.portlet.PortletParametersStateString; +import org.jboss.portal.portlet.ParametersStateString; import org.jboss.portal.server.ServerInvocation; = /** @@ -58,7 +58,7 @@ public ControllerCommand doMapping(ControllerContext controllerContext,= ServerInvocation invocation, String host, String contextPath, String requestPath) { - PortletParametersStateString renderParameters =3D new PortletParameter= sStateString(); + ParametersStateString renderParameters =3D ParametersStateString.creat= e(); String operation =3D IdentityConstants.VALIDATION_FAILED; = if (requestPath !=3D null && requestPath.length() > 1) Modified: branches/JBoss_Portal_Branch_2_7/core-samples/.classpath =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/core-samples/.classpath 2008-02-22 15:= 19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/core-samples/.classpath 2008-02-22 16:= 28:22 UTC (rev 10090) @@ -14,8 +14,8 @@ - + Modified: branches/JBoss_Portal_Branch_2_7/core-search/src/main/org/jboss/p= ortal/core/search/service/SearchResultCommandFactoryService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/core-search/src/main/org/jboss/portal/= core/search/service/SearchResultCommandFactoryService.java 2008-02-22 15:19= :14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/core-search/src/main/org/jboss/portal/= core/search/service/SearchResultCommandFactoryService.java 2008-02-22 16:28= :22 UTC (rev 10090) @@ -33,7 +33,7 @@ import org.jboss.portal.core.model.portal.PortalObjectId; import org.jboss.portal.core.model.portal.PortalObjectPath; import org.jboss.portal.core.model.portal.command.action.InvokePortletWind= owRenderCommand; -import org.jboss.portal.portlet.PortletParametersStateString; +import org.jboss.portal.portlet.ParametersStateString; import org.jboss.portal.server.ServerInvocation; = /** @@ -48,7 +48,7 @@ { Map parameters =3D invocation.getServerContext().getQueryParameterMa= p(); = - PortletParametersStateString renderParameters =3D new PortletParamet= ersStateString(); + ParametersStateString renderParameters =3D ParametersStateString.cre= ate(); = String targetWindowRef =3D null; Iterator it =3D parameters.keySet().iterator(); Modified: branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/= faces/component/portlet/JSFInvocation.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/= component/portlet/JSFInvocation.java 2008-02-22 15:19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/= component/portlet/JSFInvocation.java 2008-02-22 16:28:22 UTC (rev 10090) @@ -27,10 +27,10 @@ import org.jboss.portal.common.text.FastURLEncoder; import org.jboss.portal.common.util.MarkupInfo; import org.jboss.portal.common.util.MediaType; +import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletInvoker; import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.PortletParameters; import org.jboss.portal.portlet.PortletURL; import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.bridge.JBossServletContextProvider; @@ -162,7 +162,7 @@ Portlet portlet, Mode mode, WindowState windowState, - PortletParameters navState) throws PortletInvokerException + ParameterMap navState) throws PortletInvokerException { // RenderContext renderContext =3D new JSFRenderContext( Modified: branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/= faces/component/portlet/JSFRenderContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/= component/portlet/JSFRenderContext.java 2008-02-22 15:19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/= component/portlet/JSFRenderContext.java 2008-02-22 16:28:22 UTC (rev 10090) @@ -29,8 +29,8 @@ import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResol= ver; import org.jboss.portal.common.invocation.resolver.RequestAttributeResolve= r; import org.jboss.portal.common.util.MarkupInfo; -import org.jboss.portal.portlet.PortletParameters; -import org.jboss.portal.portlet.PortletParametersStateString; +import org.jboss.portal.common.util.ParameterMap; +import org.jboss.portal.portlet.ParametersStateString; import org.jboss.portal.portlet.PortletURL; import org.jboss.portal.portlet.impl.spi.AbstractRenderContext; import org.jboss.portal.portlet.invocation.PortletInvocation; @@ -51,11 +51,11 @@ public JSFRenderContext( Mode mode, WindowState windowState, - PortletParameters navState, + ParameterMap navState, MarkupInfo markupInfo, JSFInvocation invocation) { - super(mode, windowState, navState !=3D null ? new PortletParametersS= tateString(navState) : null, markupInfo); + super(mode, windowState, navState !=3D null ? ParametersStateString.= create(navState) : null, markupInfo); = // this.invocation =3D invocation; Modified: branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/= faces/component/portlet/PortletActionEvent.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/= component/portlet/PortletActionEvent.java 2008-02-22 15:19:14 UTC (rev 1008= 9) +++ branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/= component/portlet/PortletActionEvent.java 2008-02-22 16:28:22 UTC (rev 1009= 0) @@ -24,12 +24,12 @@ = import org.jboss.portal.Mode; import org.jboss.portal.WindowState; +import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.PortletParameters; -import org.jboss.portal.portlet.PortletParametersStateString; +import org.jboss.portal.portlet.ParametersStateString; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.invocation.response.RenderResponse; +import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStat= eResponse; = import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; @@ -43,7 +43,7 @@ { = /** . */ - private final PortletParameters interactionState; + private final ParameterMap interactionState; = /** . */ private Mode mode; @@ -51,7 +51,7 @@ /** . */ private WindowState windowState; = - PortletActionEvent(UIComponent uiComponent, PortletParameters interacti= onState, Mode mode, WindowState windowState) + PortletActionEvent(UIComponent uiComponent, ParameterMap interactionSta= te, Mode mode, WindowState windowState) { super(uiComponent); = @@ -117,13 +117,13 @@ // try { - PortletInvocationResponse pir =3D invocation.action(portlet, mode= , windowState, new PortletParametersStateString(interactionState)); - if (pir instanceof RenderResponse) + PortletInvocationResponse pir =3D invocation.action(portlet, mode= , windowState, ParametersStateString.create(interactionState)); + if (pir instanceof UpdateNavigationalStateResponse) { - RenderResponse render =3D (RenderResponse)pir; + UpdateNavigationalStateResponse render =3D (UpdateNavigationalSt= ateResponse)pir; = // - uiportlet.setInternalNavState(((PortletParametersStateString)r= ender.getNavigationalState()).getParameters()); + uiportlet.setInternalNavState(((ParametersStateString)render.g= etNavigationalState()).getParameters()); = // if (render.getWindowState() !=3D null) Modified: branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/= faces/component/portlet/PortletRenderEvent.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/= component/portlet/PortletRenderEvent.java 2008-02-22 15:19:14 UTC (rev 1008= 9) +++ branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/= component/portlet/PortletRenderEvent.java 2008-02-22 16:28:22 UTC (rev 1009= 0) @@ -24,7 +24,7 @@ = import org.jboss.portal.Mode; import org.jboss.portal.WindowState; -import org.jboss.portal.portlet.PortletParameters; +import org.jboss.portal.common.util.ParameterMap; = import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; @@ -38,7 +38,7 @@ { = /** . */ - private final PortletParameters navState; + private final ParameterMap navState; = /** . */ private Mode mode; @@ -46,7 +46,7 @@ /** . */ private WindowState windowState; = - public PortletRenderEvent(UIComponent uiComponent, PortletParameters na= vState, Mode mode, WindowState windowState) + public PortletRenderEvent(UIComponent uiComponent, ParameterMap navStat= e, Mode mode, WindowState windowState) { super(uiComponent); = Modified: branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/= faces/component/portlet/UIPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/= component/portlet/UIPortlet.java 2008-02-22 15:19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/= component/portlet/UIPortlet.java 2008-02-22 16:28:22 UTC (rev 10090) @@ -24,13 +24,13 @@ = import org.jboss.portal.Mode; import org.jboss.portal.WindowState; +import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.faces.util.ActionEventDispatcher; import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletContext; import org.jboss.portal.portlet.PortletInvoker; import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.PortletParameters; -import org.jboss.portal.portlet.PortletParametersStateString; +import org.jboss.portal.portlet.ParametersStateString; import org.jboss.portal.portlet.impl.PortletRequestDecoder; import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.InsufficientPrivileges= Response; @@ -90,7 +90,7 @@ private String onClick; = /** The internal nav state. */ - private PortletParameters internalNavState; + private ParameterMap internalNavState; = /** The internal window state value. */ private WindowState internalWindowState; @@ -303,7 +303,7 @@ this.internalMode =3D mode; } = - void setInternalNavState(PortletParameters navState) + void setInternalNavState(ParameterMap navState) { ValueBinding vb =3D getValueBinding("renderParameters"); if (vb !=3D null) @@ -318,13 +318,13 @@ } } = - PortletParameters getInternalNavState() + ParameterMap getInternalNavState() { ValueBinding vb =3D getValueBinding("renderParameters"); if (vb !=3D null) { Map renderParameters =3D (Map)vb.getValue(getFacesContext()); - return PortletParameters.wrap(renderParameters); + return ParameterMap.wrap(renderParameters); } else { @@ -385,7 +385,7 @@ String opaqueValue =3D null; if (internalNavState !=3D null) { - opaqueValue =3D new PortletParametersStateString(internalNavState= ).getStringValue(); + opaqueValue =3D ParametersStateString.create(internalNavState).ge= tStringValue(); } = // @@ -412,13 +412,13 @@ = // portletId =3D (String)values[1]; - internalNavState =3D serializedNavState !=3D null ? new PortletParam= etersStateString(serializedNavState).getParameters() : null; + internalNavState =3D serializedNavState !=3D null ? ParametersStateS= tring.create(serializedNavState).getParameters() : null; portletListener =3D (MethodBinding)restoreAttachedState(faces, value= s[3]); supportedWindowStates =3D (Set)values[4]; supportedModes =3D (Set)values[5]; initialWindowState =3D (String)values[6]; initialMode =3D (String)values[7]; - internalNavState =3D (PortletParameters)values[8]; + internalNavState =3D (ParameterMap)values[8]; internalMode =3D (Mode)values[9]; onClick =3D (String)values[10]; } @@ -460,7 +460,7 @@ case PortletRequestDecoder.RENDER_TYPE: PortletRenderEvent prevent =3D new PortletRenderEvent( this, - ((PortletParametersStateString)decoder.getNavigationalSt= ate()).getParameters(), + ((ParametersStateString)decoder.getNavigationalState()).= getParameters(), mode, windowState); prevent.setPhaseId(PhaseId.INVOKE_APPLICATION); @@ -477,7 +477,7 @@ } PortletActionEvent paevent =3D new PortletActionEvent( this, - ((PortletParametersStateString)decoder.getInteractionSta= te()).getParameters(), + ((ParametersStateString)decoder.getInteractionState()).g= etParameters(), mode, windowState); paevent.setPhaseId(PhaseId.INVOKE_APPLICATION); Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/t= est/wsrp/framework/support/TestPortletInvocationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/ws= rp/framework/support/TestPortletInvocationContext.java 2008-02-22 15:19:14 = UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/ws= rp/framework/support/TestPortletInvocationContext.java 2008-02-22 16:28:22 = UTC (rev 10090) @@ -28,7 +28,7 @@ import org.jboss.portal.common.invocation.resolver.RequestAttributeResolve= r; import org.jboss.portal.common.util.MarkupInfo; import org.jboss.portal.common.util.MediaType; -import org.jboss.portal.portlet.PortletParameters; +import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.portlet.PortletURL; import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext; @@ -145,7 +145,7 @@ return null; } = - public PortletParameters getForm() + public ParameterMap getForm() { return null; } Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/t= est/wsrp/v1/consumer/MarkupTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/ws= rp/v1/consumer/MarkupTestCase.java 2008-02-22 15:19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/ws= rp/v1/consumer/MarkupTestCase.java 2008-02-22 16:28:22 UTC (rev 10090) @@ -33,7 +33,7 @@ import org.jboss.portal.portlet.invocation.response.ErrorResponse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.invocation.response.RenderResponse; +import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStat= eResponse; import org.jboss.portal.portlet.spi.WindowContext; import org.jboss.portal.test.wsrp.framework.support.BasicInstanceContext; import org.jboss.portal.test.wsrp.framework.support.BasicSecurityContext; @@ -107,8 +107,8 @@ = PortletInvocationResponse response =3D consumer.invoke(action); ExtendedAssert.assertNotNull(response); - ExtendedAssert.assertTrue("Was expecting a RenderResponse. Got: " + = response, response instanceof RenderResponse); - RenderResponse render =3D (RenderResponse)response; + ExtendedAssert.assertTrue("Was expecting a RenderResponse. Got: " + = response, response instanceof UpdateNavigationalStateResponse); + UpdateNavigationalStateResponse render =3D (UpdateNavigationalStateR= esponse)response; ExtendedAssert.assertEquals(BasicMarkupBehavior.NS, render.getNaviga= tionalState().getStringValue()); } = Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/w= srp/consumer/ActionContextRequestContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/co= nsumer/ActionContextRequestContext.java 2008-02-22 15:19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/co= nsumer/ActionContextRequestContext.java 2008-02-22 16:28:22 UTC (rev 10090) @@ -23,9 +23,9 @@ = package org.jboss.portal.wsrp.consumer; = -import org.apache.commons.fileupload.RequestContext; -import org.jboss.portal.portlet.spi.ActionContext; +import org.jboss.portal.portlet.spi.RequestContext; = +import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; = @@ -36,9 +36,9 @@ */ public class ActionContextRequestContext implements RequestContext { - private ActionContext actionContext; + private RequestContext actionContext; = - public ActionContextRequestContext(ActionContext actionContext) + public ActionContextRequestContext(RequestContext actionContext) { this.actionContext =3D actionContext; } @@ -62,4 +62,8 @@ { return actionContext.getInputStream(); } + + public BufferedReader getReader() throws IOException { + return actionContext.getReader(); + } } Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/w= srp/consumer/ActionHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/co= nsumer/ActionHandler.java 2008-02-22 15:19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/co= nsumer/ActionHandler.java 2008-02-22 16:28:22 UTC (rev 10090) @@ -27,18 +27,18 @@ import org.apache.commons.fileupload.FileItemStream; import org.apache.commons.fileupload.FileUpload; import org.apache.commons.fileupload.util.Streams; +import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.common.util.ParameterValidation; import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.PortletParameters; -import org.jboss.portal.portlet.PortletParametersStateString; +import org.jboss.portal.portlet.ParametersStateString; import org.jboss.portal.portlet.StateEvent; import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.invocation.response.ErrorResponse; import org.jboss.portal.portlet.invocation.response.HTTPRedirectionRespons= e; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.invocation.response.RenderResponse; -import org.jboss.portal.portlet.spi.ActionContext; +import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStat= eResponse; +import org.jboss.portal.portlet.spi.RequestContext; import org.jboss.portal.portlet.spi.InstanceContext; import org.jboss.portal.portlet.state.AccessMode; import org.jboss.portal.wsrp.WSRPTypeFactory; @@ -96,7 +96,7 @@ if (interactionState !=3D null) { String state =3D interactionState.getStringValue(); - if (!PortletParametersStateString.JBPNS_PREFIX.equals(state)) //= fix-me: see JBPORTAL-900 + if (!ParametersStateString.JBPNS_PREFIX.equals(state)) // fix-me= : see JBPORTAL-900 { interactionParams.setInteractionState(state); } @@ -167,7 +167,7 @@ else { // if the content is not multipart, then check for form parame= ters - PortletParameters params =3D actionContext.getForm(); + ParameterMap params =3D actionContext.getForm(); if (params !=3D null && !params.isEmpty()) { int capacity =3D params.size(); Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/w= srp/consumer/RenderHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/co= nsumer/RenderHandler.java 2008-02-22 15:19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/co= nsumer/RenderHandler.java 2008-02-22 16:28:22 UTC (rev 10090) @@ -190,7 +190,7 @@ if (rewriteURLs) { WSRPURLRewriter rewriter =3D (WSRPURLRewriter)wsrpURLRewriterLoca= l.get(); - rewriter.setContext(invocation.getPortletContext()); + rewriter.setContext(invocation.getContext()); rewriter.setSecure(invocation.getSecurityContext().isSecure()); String userId =3D invocation.getUserContext().getId(); rewriter.setAuthenticated(userId !=3D null); // is this correct? Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/w= srp/consumer/RequestPrecursor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/co= nsumer/RequestPrecursor.java 2008-02-22 15:19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/co= nsumer/RequestPrecursor.java 2008-02-22 16:28:22 UTC (rev 10090) @@ -26,8 +26,8 @@ import org.jboss.logging.Logger; import org.jboss.portal.common.util.ContentInfo; import org.jboss.portal.common.util.ParameterValidation; +import org.jboss.portal.portlet.ParametersStateString; import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.PortletParametersStateString; import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.spi.PortletInvocationContext; @@ -82,7 +82,7 @@ // create markup params UserContext userContext =3D invocation.getUserContext(); ParameterValidation.throwIllegalArgExceptionIfNull(userContext, USER= _CONTEXT); - PortletInvocationContext context =3D invocation.getPortletContext(); + PortletInvocationContext context =3D invocation.getContext(); ParameterValidation.throwIllegalArgExceptionIfNull(context, INVOCATI= ON_CONTEXT); ContentInfo streamInfo =3D context.getMarkupInfo(); ParameterValidation.throwIllegalArgExceptionIfNull(streamInfo, STREA= M_INFO); @@ -118,7 +118,7 @@ if (navigationalState !=3D null) { String state =3D navigationalState.getStringValue(); - if (!PortletParametersStateString.JBPNS_PREFIX.equals(state)) //= fix-me: see JBPORTAL-900 + if (!ParametersStateString.JBPNS_PREFIX.equals(state)) // fix-me= : see JBPORTAL-900 { markupParams.setNavigationalState(state); } Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/w= srp/consumer/WSRPConsumerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/co= nsumer/WSRPConsumerImpl.java 2008-02-22 15:19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/co= nsumer/WSRPConsumerImpl.java 2008-02-22 16:28:22 UTC (rev 10090) @@ -642,7 +642,7 @@ { // we need to supply the templates since the portlet does URL pro= cessing and either doesn't store // templates in the session or no session has been established yet - runtimeContext.setTemplates(WSRPTypeFactory.createTemplates(invoc= ation.getPortletContext())); + runtimeContext.setTemplates(WSRPTypeFactory.createTemplates(invoc= ation.getContext())); } } = Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/w= srp/producer/ActionRequestProcessor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/pr= oducer/ActionRequestProcessor.java 2008-02-22 15:19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/pr= oducer/ActionRequestProcessor.java 2008-02-22 16:28:22 UTC (rev 10090) @@ -28,7 +28,7 @@ import org.jboss.portal.portlet.invocation.ActionInvocation; import org.jboss.portal.portlet.invocation.response.HTTPRedirectionRespons= e; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.invocation.response.RenderResponse; +import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStat= eResponse; import org.jboss.portal.portlet.spi.PortalContext; import org.jboss.portal.portlet.spi.SecurityContext; import org.jboss.portal.portlet.spi.UserContext; @@ -129,9 +129,9 @@ = Object processResponse(PortletInvocationResponse response) { - if (response instanceof RenderResponse) + if (response instanceof UpdateNavigationalStateResponse) { - RenderResponse renderResult =3D (RenderResponse)response; + UpdateNavigationalStateResponse renderResult =3D (UpdateNavigationa= lStateResponse)response; UpdateResponse updateResponse =3D WSRPTypeFactory.createUpdateRes= ponse(); updateResponse.setNewMode(WSRPUtils.convertJSR168PortletModeNameT= oWSRPName(getNewStateOrNull(renderResult, true))); updateResponse.setNewWindowState(WSRPUtils.convertJSR168WindowSta= teNameToWSRPName(getNewStateOrNull(renderResult, false))); @@ -155,7 +155,7 @@ } } = - private String getNewStateOrNull(RenderResponse renderResult, boolean f= orMode) + private String getNewStateOrNull(UpdateNavigationalStateResponse render= Result, boolean forMode) { Object state =3D forMode ? renderResult.getMode() : renderResult.get= WindowState(); return state !=3D null ? state.toString() : null; Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/w= srp/producer/MarkupHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/pr= oducer/MarkupHandler.java 2008-02-22 15:19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/pr= oducer/MarkupHandler.java 2008-02-22 16:28:22 UTC (rev 10090) @@ -28,7 +28,7 @@ import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.HTTPRedirectionRespons= e; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.invocation.response.RenderResponse; +import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStat= eResponse; import org.jboss.portal.portlet.state.producer.PortletStateChangeRequiredE= xception; import org.jboss.portal.wsrp.WSRPExceptionFactory; import org.jboss.portal.wsrp.core.AccessDeniedFault; @@ -196,7 +196,7 @@ = } else - if (!(response instanceof HTTPRedirectionResponse || response instan= ceof FragmentResponse || response instanceof RenderResponse)) + if (!(response instanceof HTTPRedirectionResponse || response instan= ceof FragmentResponse || response instanceof UpdateNavigationalStateRespons= e)) { throw WSRPExceptionFactory.throwSOAPFaultException(WSRPExceptionF= actory.OPERATION_FAILED, "Unsupported result type: " + response.getClass().getName(), n= ull); Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/w= srp/producer/WSRPActionContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/pr= oducer/WSRPActionContext.java 2008-02-22 15:19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/pr= oducer/WSRPActionContext.java 2008-02-22 16:28:22 UTC (rev 10090) @@ -27,11 +27,11 @@ import org.jboss.portal.Mode; import org.jboss.portal.WindowState; import org.jboss.portal.common.util.MarkupInfo; -import org.jboss.portal.portlet.PortletParameters; +import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.spi.ActionContext; import org.jboss.portal.portlet.spi.InstanceContext; import org.jboss.portal.portlet.spi.PortalContext; +import org.jboss.portal.portlet.spi.RequestContext; import org.jboss.portal.portlet.spi.SecurityContext; import org.jboss.portal.portlet.spi.UserContext; import org.jboss.portal.portlet.spi.WindowContext; @@ -58,7 +58,7 @@ * @version $Revision$ * @since 2.4 */ -abstract class WSRPActionContext extends WSRPPortletInvocationContext impl= ements ActionContext +abstract class WSRPActionContext extends WSRPPortletInvocationContext impl= ements RequestContext { protected String characterEncoding; protected StateString interactionState; @@ -103,7 +103,7 @@ = static class WSRPSimpleActionContext extends WSRPActionContext { - private PortletParameters formParameters; + private ParameterMap formParameters; private String contentType; = protected WSRPSimpleActionContext(StateString navigationalState, @@ -140,16 +140,16 @@ params.put(paramName, new String[]{paramValue}); } } - formParameters =3D new PortletParameters(params); + formParameters =3D new ParameterMap(params); } else { - formParameters =3D new PortletParameters(); + formParameters =3D new ParameterMap(); } = } = - public PortletParameters getForm() + public ParameterMap getForm() { return formParameters; } @@ -312,9 +312,9 @@ baos.write(BOUNDARY1); } = - public PortletParameters getForm() + public ParameterMap getForm() { - return new PortletParameters(); + return new ParameterMap(); } = public String getContentType() Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/w= srp/producer/WSRPRequestContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/pr= oducer/WSRPRequestContext.java 2008-02-22 15:19:14 UTC (rev 10089) +++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/pr= oducer/WSRPRequestContext.java 2008-02-22 16:28:22 UTC (rev 10090) @@ -34,6 +34,6 @@ { public WSRPRequestContext() { - super(ServletAccess.getRequest(), ServletAccess.getResponse()); + super(ServletAccess.getRequest()); } } --===============4641930497949520793==-- From portal-commits at lists.jboss.org Fri Feb 22 18:26:35 2008 Content-Type: multipart/mixed; boundary="===============5816178444964836157==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10091 - in modules/test/trunk: build and 21 other directories. Date: Fri, 22 Feb 2008 18:26:34 -0500 Message-ID: --===============5816178444964836157== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-22 18:26:34 -0500 (Fri, 22 Feb 2008) New Revision: 10091 Added: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/Log4JWriter.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/MultiValuedPropertyMap.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/ParameterValidation.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/Tools.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/io/ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/io/IOTools.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/io/Serialization.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/io/SerializationFilter.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/io/UndeclaredIOException.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/xml/ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/xml/TooManyElementException.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/xml/XMLTools.java Modified: modules/test/trunk/build/pom.xml modules/test/trunk/docs/pom.xml modules/test/trunk/docs/user-guide/pom.xml modules/test/trunk/mc/pom.xml modules/test/trunk/pom.xml modules/test/trunk/remote/pom.xml modules/test/trunk/test/agent/pom.xml modules/test/trunk/test/core/pom.xml modules/test/trunk/test/generic/pom.xml modules/test/trunk/test/jboss/pom.xml modules/test/trunk/test/opends/pom.xml modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/em= bedded/DSConfig.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/em= bedded/DataSourceSupport.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/em= bedded/HibernateSupport.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/im= pl/generic/config/ServerConfig.java modules/test/trunk/tooling/ant/pom.xml modules/test/trunk/tooling/core/pom.xml modules/test/trunk/tooling/examples/maven2/pom.xml modules/test/trunk/tooling/maven2/pom.xml modules/test/trunk/tooling/pom.xml modules/test/trunk/unit/pom.xml Log: remove dependency to portal common and change version to 1.2.0.Beta2 Modified: modules/test/trunk/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/build/pom.xml 2008-02-22 16:28:22 UTC (rev 10090) +++ modules/test/trunk/build/pom.xml 2008-02-22 23:26:34 UTC (rev 10091) @@ -18,14 +18,13 @@ 4.0.0 org.jboss.unit module-parent - 1.2.0-SNAPSHOT + 1.2.0.Beta2 pom JBoss Portal Test Module http://www.jboss.com/products/jbossmc JBoss Portal Test Module = - 1.2.0-SNAPSHOT 2.0.0.Beta9 3.0.1 0.9-portal @@ -39,6 +38,10 @@ 3.8.1 1.2.14 3.0.12 + 4.2.0.GA + 2.2.0.GA + 4.2.0.GA + 4.2.0.GA = = @@ -128,11 +131,6 @@ = = - - org.jboss.portal.common - common-common - ${version.portal.common} - = org.jboss.microcontainer @@ -244,6 +242,27 @@ ${version.sleepycat} = + + jboss + jboss-j2ee + ${version.jboss-j2ee} + + + jboss + jboss-common-core + ${version.jboss-common-core} + + + jboss + jboss-jmx + ${version.jboss-jmx} + + + jboss + jboss-system + ${version.jboss-system} + + = Modified: modules/test/trunk/docs/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/docs/pom.xml 2008-02-22 16:28:22 UTC (rev 10090) +++ modules/test/trunk/docs/pom.xml 2008-02-22 23:26:34 UTC (rev 10091) @@ -4,13 +4,13 @@ org.jboss.unit module-parent - 1.2.0-SNAPSHOT + 1.2.0.Beta2 ../build/pom.xml docs-aggregator pom JBoss Portal Portlet Docs Aggregator - 1.2.0-SNAPSHOT + 1.2.0.Beta2 http://labs.jboss.com/jbossportal = Modified: modules/test/trunk/docs/user-guide/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/docs/user-guide/pom.xml 2008-02-22 16:28:22 UTC (rev= 10090) +++ modules/test/trunk/docs/user-guide/pom.xml 2008-02-22 23:26:34 UTC (rev= 10091) @@ -60,7 +60,7 @@ = org.jboss.unit user-guide-${translation} - 1.2.0-SNAPSHOT + 1.2.0.Beta2 jdocbook User_Guide_(${translation}) = Modified: modules/test/trunk/mc/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/mc/pom.xml 2008-02-22 16:28:22 UTC (rev 10090) +++ modules/test/trunk/mc/pom.xml 2008-02-22 23:26:34 UTC (rev 10091) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-SNAPSHOT + 1.2.0.Beta2 ../build/pom.xml 4.0.0 Modified: modules/test/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/pom.xml 2008-02-22 16:28:22 UTC (rev 10090) +++ modules/test/trunk/pom.xml 2008-02-22 23:26:34 UTC (rev 10091) @@ -5,7 +5,7 @@ module-aggregator pom JBoss Portal Modules Test - 1.2.0-SNAPSHOT + 1.2.0.Beta2 http://labs.jboss.com/jbossportal = Modified: modules/test/trunk/remote/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/remote/pom.xml 2008-02-22 16:28:22 UTC (rev 10090) +++ modules/test/trunk/remote/pom.xml 2008-02-22 23:26:34 UTC (rev 10091) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-SNAPSHOT + 1.2.0.Beta2 ../build/pom.xml 4.0.0 Modified: modules/test/trunk/test/agent/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/agent/pom.xml 2008-02-22 16:28:22 UTC (rev 1009= 0) +++ modules/test/trunk/test/agent/pom.xml 2008-02-22 23:26:34 UTC (rev 1009= 1) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-SNAPSHOT + 1.2.0.Beta2 ../../build/pom.xml 4.0.0 @@ -13,10 +13,6 @@ = - org.jboss.portal.common - common-common - - cargo core Modified: modules/test/trunk/test/core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/core/pom.xml 2008-02-22 16:28:22 UTC (rev 10090) +++ modules/test/trunk/test/core/pom.xml 2008-02-22 23:26:34 UTC (rev 10091) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-SNAPSHOT + 1.2.0.Beta2 ../../build/pom.xml 4.0.0 @@ -13,10 +13,6 @@ = - org.jboss.portal.common - common-common - - cargo core @@ -52,6 +48,26 @@ jboss.jbossas.core-libs jboss + + apache-log4j + log4j + + + jboss + jboss-j2ee + + + jboss + jboss-common-core + + + jboss + jboss-jmx + + + jboss + jboss-system + = Modified: modules/test/trunk/test/generic/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/generic/pom.xml 2008-02-22 16:28:22 UTC (rev 10= 090) +++ modules/test/trunk/test/generic/pom.xml 2008-02-22 23:26:34 UTC (rev 10= 091) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-SNAPSHOT + 1.2.0.Beta2 ../../build/pom.xml 4.0.0 @@ -13,10 +13,6 @@ = - org.jboss.portal.common - common-common - - cargo core @@ -56,6 +52,14 @@ jboss jboss-remoting + + apache-log4j + log4j + + + jboss + jboss-common-core + = @@ -76,6 +80,7 @@ = org/jboss/portal/test/framework/agent/** org/jboss/portal/test/framework/server/** + org/jboss/portal/test/framework/common/** Modified: modules/test/trunk/test/jboss/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/jboss/pom.xml 2008-02-22 16:28:22 UTC (rev 1009= 0) +++ modules/test/trunk/test/jboss/pom.xml 2008-02-22 23:26:34 UTC (rev 1009= 1) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-SNAPSHOT + 1.2.0.Beta2 ../../build/pom.xml 4.0.0 @@ -13,10 +13,6 @@ = - org.jboss.portal.common - common-common - - cargo core @@ -56,6 +52,10 @@ jboss jboss-remoting + + jboss + jboss-common-core + = Modified: modules/test/trunk/test/opends/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/opends/pom.xml 2008-02-22 16:28:22 UTC (rev 100= 90) +++ modules/test/trunk/test/opends/pom.xml 2008-02-22 23:26:34 UTC (rev 100= 91) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-SNAPSHOT + 1.2.0.Beta2 ../../build/pom.xml 4.0.0 Added: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framewor= k/common/Log4JWriter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/Log4JWriter.java (rev 0) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/Log4JWriter.java 2008-02-22 23:26:34 UTC (rev 10091) @@ -0,0 +1,86 @@ +/* +* 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.framework.common; + +import org.apache.log4j.Logger; +import org.apache.log4j.Level; + +import java.io.Writer; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 5451 $ + */ +public class Log4JWriter extends Writer +{ + + /** The open/closed status. */ + private boolean open; + + /** The logger. */ + private Logger log; + + /** The logging level. */ + private Level level; + + /** + * @throws IllegalArgumentException if log or level is null + */ + public Log4JWriter(Logger log, Level level) throws IllegalArgumentExcep= tion + { + if (log =3D=3D null) + { + throw new IllegalArgumentException("No logger provided"); + } + if (level =3D=3D null) + { + throw new IllegalArgumentException("No level provided"); + } + this.open =3D false; + this.log =3D log; + this.level =3D level; + } + + public void write(char cbuf[], int off, int len) throws IOException + { + if (open) + { + log.log(level, new String(cbuf, off, len)); + } + else + { + throw new IOException("Stream closed"); + } + } + + public void flush() throws IOException + { + } + + public void close() throws IOException + { + open =3D false; + } +} + Added: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framewor= k/common/MultiValuedPropertyMap.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/MultiValuedPropertyMap.java (rev 0) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/MultiValuedPropertyMap.java 2008-02-22 23:26:34 UTC (rev 10091) @@ -0,0 +1,44 @@ +/* +* 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.framework.common; + +import java.util.List; +import java.util.Set; + +/** + * A property map with multi valued properties. + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +public interface MultiValuedPropertyMap +{ + T getValue(String key) throws IllegalArgumentException; + List getValues(String key) throws IllegalArgumentException; + void addValue(String key, T value) throws IllegalArgumentException; + void setValue(String key, T value) throws IllegalArgumentException; + Set keySet(); + void clear(); + int size(); + void append(MultiValuedPropertyMap appended) throws IllegalArgumentE= xception; +} Added: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framewor= k/common/ParameterValidation.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/ParameterValidation.java (rev 0) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/ParameterValidation.java 2008-02-22 23:26:34 UTC (rev 10091) @@ -0,0 +1,67 @@ +/* +* 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.framework.common; + +/** + * @author Chris Laprun + * @version $Revision: 5757 $ + * @since 2.4 (May 31, 2006) + */ +public class ParameterValidation +{ + public static void throwIllegalArgExceptionIfNullOrEmpty(String valueTo= Check, String valueName, String contextName) + { + if (isNullOrEmpty(valueToCheck)) + { + throw new IllegalArgumentException((contextName !=3D null ? conte= xtName + " r" : "R") + "equires a non-null, non-empty " + valueName); + } + } + + /** @since 2.6 */ + public static boolean isNullOrEmpty(String valueToCheck) + { + return valueToCheck =3D=3D null || valueToCheck.length() =3D=3D 0; + } + + public static void throwIllegalArgExceptionIfNull(Object objectToTest, = String name) + { + if (objectToTest =3D=3D null) + { + throw new IllegalArgumentException("Must pass a non null " + name= ); + } + } + + /** @since 2.4.1 */ + public static void throwIllegalArgExceptionIfNullOrEmpty(Object[] array= , String name) + { + if (array =3D=3D null) + { + throw new IllegalArgumentException("Must pass a non-null " + name= ); + } + if (array.length =3D=3D 0) + { + throw new IllegalArgumentException("Must pass a non-empty " + nam= e); + } + } +} + Added: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framewor= k/common/Tools.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/Tools.java (rev 0) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/Tools.java 2008-02-22 23:26:34 UTC (rev 10091) @@ -0,0 +1,1023 @@ +/* +* 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.framework.common; + +import org.apache.log4j.Level; +import org.apache.log4j.Logger; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.io.Writer; +import java.lang.reflect.Array; +import java.math.BigInteger; +import java.net.URL; +import java.net.URLClassLoader; +import java.net.UnknownHostException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Enumeration; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.ResourceBundle; +import java.util.Set; +import java.util.Collections; + +/** + * @author Julien Viet + * @author Thomas Heute + * @author Bolesla= w Dawidowicz + * @author Chris Laprun + * @version $Revision: 7377 $ + */ +public class Tools +{ + + public static final int DEFAULT_BUFFER_SIZE =3D 512; + + public static final Logger log =3D Logger.getLogger(Tools.class); + + /** 16 chars long VMID. */ + public static final String VMID =3D VMID(); + + private static String VMID() + { + try + { + BigInteger bi =3D BigInteger.valueOf(0); + byte[] address =3D java.net.InetAddress.getLocalHost().getAddress= (); + for (int i =3D 0; i < 4; i++) + { + bi =3D bi.shiftLeft(8); + bi =3D bi.add(BigInteger.valueOf(address[i])); + } + bi =3D bi.shiftLeft(32); + int code =3D System.identityHashCode(new Object()); + bi =3D bi.add(BigInteger.valueOf(code)); + byte[] bytes =3D bi.toByteArray(); + StringBuffer buffer =3D new StringBuffer(); + char[] chars =3D "0123456789ABCDEF".toCharArray(); + for (int i =3D 0; i < bytes.length; i++) + { + buffer.append(chars[(bytes[i] & 0xF0) >> 4]).append(chars[byte= s[i] & 0xF]); + } + return buffer.toString(); + } + catch (UnknownHostException e) + { + e.printStackTrace(System.err); + throw new Error("Cannot create VMID"); + } + } + + public static final Enumeration EMPTY_ENUMERATION =3D new Enumeration() + { + public boolean hasMoreElements() + { + return false; + } + + public Object nextElement() + { + throw new NoSuchElementException(); + } + }; + + public static final Iterator EMPTY_ITERATOR =3D new Iterator() + { + public boolean hasNext() + { + return false; + } + + public Object next() + { + throw new NoSuchElementException(); + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + }; + + public static final ResourceBundle EMPTY_BUNDLE =3D new ResourceBundle() + { + protected Object handleGetObject(String key) + { + return null; + } + + public Enumeration getKeys() + { + return EMPTY_ENUMERATION; + } + }; + + public static Enumeration emptyEnumeration() + { + return (Enumeration)EMPTY_ENUMERATION; + } + + public static Iterator emptyIterator() + { + return (Iterator)EMPTY_ITERATOR; + } + + public static Enumeration toEnumeration(final Iterator iterat= or) + { + if (iterator =3D=3D null) + { + throw new IllegalArgumentException(); + } + return new Enumeration() + { + public boolean hasMoreElements() + { + return iterator.hasNext(); + } + + public E nextElement() + { + return iterator.next(); + } + }; + } + + public static Enumeration toEnumeration(final E[] objects) + { + if (objects =3D=3D null) + { + throw new IllegalArgumentException(); + } + return new Enumeration() + { + int index =3D 0; + + public boolean hasMoreElements() + { + return index < objects.length; + } + + public E nextElement() + { + if (index < objects.length) + { + return objects[index++]; + } + else + { + throw new NoSuchElementException(); + } + } + }; + } + + public static Enumeration toEnumeration(final E o) + { + return new Enumeration() + { + boolean hasMore =3D true; + + public boolean hasMoreElements() + { + return hasMore; + } + + public E nextElement() + { + if (hasMore) + { + hasMore =3D false; + } + else + { + throw new NoSuchElementException(); + } + return o; + } + }; + } + + public static Set toSet(Enumeration e) + { + if (e =3D=3D null) + { + throw new IllegalArgumentException(); + } + HashSet set =3D new HashSet(); + while (e.hasMoreElements()) + { + set.add(e.nextElement()); + } + return set; + } + + public static Set toSet(E... objects) + { + if (objects =3D=3D null) + { + throw new IllegalArgumentException(); + } + HashSet set =3D new HashSet(); + for (E object : objects) + { + set.add(object); + } + return set; + } + + /** + * Transforms an iterator into an unordered Set + * + * @param iterator The iterator to transform + * @return A HashSet + */ + public static Set toSet(Iterator iterator) + { + if (iterator =3D=3D null) + { + throw new IllegalArgumentException(); + } + return toSet(iterator, false); + } + + /** + * Transforms an iterator into a Set + * + * @param iterator The iterator to transform + * @param preserveOrder true if the set must respect the ordering of th= e iterator + * @return a LinkedHashSet if ordered is true, a HashSet otherwise + */ + public static Set toSet(Iterator iterator, boolean preserveOr= der) + { + if (iterator =3D=3D null) + { + throw new IllegalArgumentException(); + } + Set set; + if (preserveOrder) + { + set =3D new LinkedHashSet(); + } + else + { + set =3D new HashSet(); + } + while (iterator.hasNext()) + { + set.add(iterator.next()); + } + return set; + } + + public static List toList(Enumeration e) + { + if (e =3D=3D null) + { + throw new IllegalArgumentException(); + } + List list =3D new ArrayList(); + while (e.hasMoreElements()) + { + list.add(e.nextElement()); + } + return list; + } + + public static List toList(Iterator iterator) + { + if (iterator =3D=3D null) + { + throw new IllegalArgumentException(); + } + List list =3D new ArrayList(); + while (iterator.hasNext()) + { + list.add(iterator.next()); + } + return list; + } + + public static List toList(E... objects) + { + if (objects =3D=3D null) + { + throw new IllegalArgumentException(); + } + List list =3D new ArrayList(objects.length); + for (E object : objects) + { + list.add(object); + } + return list; + } + + /** + * Consider remove this method as it cannot be generified. + * + * @param i + * @return + */ + @Deprecated + public static Object[] toArray(Iterator i) + { + // This method cannot be generified. + return toList(i).toArray(); + } + + /** + * Returns a singleton iterator. + * + * @param o the singleton object + * @return the iterator + */ + public static Iterator iterator(final E o) + { + return new Iterator() + { + /** The status of the iterator. */ + boolean done =3D false; + + public boolean hasNext() + { + return !done; + } + + public E next() + { + if (done) + { + throw new NoSuchElementException("Already iterated"); + } + done =3D true; + return o; + } + + public void remove() + { + throw new UnsupportedOperationException("read only"); + } + }; + } + + /** + * Returns an iterator over the array elements. + * + * @param objects the array containing the objects to iterate on + * @return the iterator + * @throws IllegalArgumentException if the object array is null or the = specified range is not valid + */ + public static Iterator iterator(final E... objects) throws Illeg= alArgumentException + { + if (objects =3D=3D null) + { + throw new IllegalArgumentException("No null object array"); + } + return iterator(objects, 0, objects.length); + } + + /** + * Returns an iterator over the array elements within the specified ran= ge. The range is considered as valid + * if the from argument is greater or equals than zero, the to argument= is lesser or equals than array size + * and the from argument is lesser or equals to the to argument. + * + * @param objects the array containing the objects to iterate on + * @param from the inclusive start index + * @param to the exclusive stop index + * @return the iterator + * @throws IllegalArgumentException if the object array is null or the = specified range is not valid or if the range is not valid + */ + public static Iterator iterator(final E[] objects, final int fro= m, final int to) throws IllegalArgumentException + { + if (objects =3D=3D null) + { + throw new IllegalArgumentException("No null object array"); + } + if (from > to || from < 0 || to > objects.length) + { + throw new IllegalArgumentException("Invalid range [" + from + ","= + to + "] for array of length " + objects.length); + } + return new Iterator() + { + /** . */ + int index =3D from; + + public boolean hasNext() + { + return index < to; + } + + public E next() + { + if (index >=3D to) + { + throw new NoSuchElementException("Index is greater than the= array length"); + } + return objects[index++]; + } + + public void remove() + { + throw new UnsupportedOperationException("read only"); + } + }; + } + + public static int computeStringHash(int hash, String s) + { + char[] chars =3D s.toCharArray(); + int length =3D chars.length; + for (int i =3D 0; i < length; i++) + { + char c =3D chars[i]; + hash =3D 31 * hash + c; + } + return hash; + } + + /** + * Computes an md5 hash of a string. + * + * @param text the hashed string + * @return the string hash + * @throws NullPointerException if text is null + */ + public static byte[] md5(String text) + { + // arguments check + if (text =3D=3D null) + { + throw new NullPointerException("null text"); + } + + try + { + MessageDigest md =3D MessageDigest.getInstance("MD5"); + md.update(text.getBytes()); + return md.digest(); + } + catch (NoSuchAlgorithmException e) + { + log.error("Cannot find MD5 algorithm", e); + throw new RuntimeException("Cannot find MD5 algorithm"); + } + } + + /** + * Computes an md5 hash and returns the result as a string in hexadecim= al format. + * + * @param text the hashed string + * @return the string hash + * @throws NullPointerException if text is null + */ + public static String md5AsHexString(String text) + { + return toHexString(md5(text)); + } + + /** + * Computes a hash with specified algorighm and returns the result as a= string in hexadecimal format + * + * @param text + * @param algorithm + * @param encoding + * @return + * @throws NoSuchAlgorithmException + */ + public static String hashAndEncodeString(String text, String algorithm,= String encoding) throws NoSuchAlgorithmException + { + // arguments check + if (text =3D=3D null) + { + throw new NullPointerException("null text"); + } + if (algorithm =3D=3D null) + { + throw new NullPointerException("null algorithm"); + } + if (encoding =3D=3D null) + { + throw new NullPointerException("null encoding"); + } + + MessageDigest md =3D MessageDigest.getInstance(algorithm); + md.update(text.getBytes()); + byte[] encoded =3D md.digest(); + + if ("HEX".equalsIgnoreCase(encoding)) + { + return toHexString(encoded); + } + //TODO: add base64 support here + else + { + throw new IllegalArgumentException("Not supported encoding: " + e= ncoding); + } + + } + + + /** + * Returns a string in the hexadecimal format. + * + * @param bytes the converted bytes + * @return the hexadecimal string representing the bytes data + * @throws IllegalArgumentException if the byte array is null + */ + public static String toHexString(byte[] bytes) + { + if (bytes =3D=3D null) + { + throw new IllegalArgumentException("byte array must not be null"); + } + StringBuffer hex =3D new StringBuffer(bytes.length * 2); + for (int i =3D 0; i < bytes.length; i++) + { + hex.append(Character.forDigit((bytes[i] & 0XF0) >> 4, 16)); + hex.append(Character.forDigit((bytes[i] & 0X0F), 16)); + } + return hex.toString(); + } + + /** + * Returns a byte array converted from the hexadecimal format. + * + * @param hex the string to convert + * @return the byte array corresponding + * @throws IllegalArgumentException if the string is null or does not h= ave the good format + */ + public static byte[] fromHexString(String hex) + { + if (hex =3D=3D null) + { + throw new IllegalArgumentException("Hex string must not be null"); + } + if (hex.length() % 2 =3D=3D 1) + { + throw new IllegalArgumentException("Hex string length is not even= : " + hex.length()); + } + int index =3D 0; + byte[] bytes =3D new byte[hex.length() / 2]; + for (int i =3D 0; i < bytes.length; i++) + { + char chigh =3D hex.charAt(index++); + int high =3D Character.digit(chigh, 16); + if (high =3D=3D -1) + { + throw new IllegalArgumentException("Hex string contains a bad = char : " + chigh); + } + char clow =3D hex.charAt(index++); + int low =3D Character.digit(clow, 16); + if (low =3D=3D -1) + { + throw new IllegalArgumentException("Hex string contains a bad = char : " + clow); + } + byte value =3D (byte)((high << 4) + low); + bytes[i] =3D value; + } + return bytes; + } + + /** + * + */ + public static String generateTemporaryHash(String value, long time) + { + if (value =3D=3D null) + { + throw new IllegalArgumentException("id must not be null"); + } + + Calendar calendar =3D Calendar.getInstance(); + calendar.setTimeInMillis(time); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + return md5AsHexString(value + calendar.getTimeInMillis()); + } + + /** + * + */ + public static boolean confirmTemporaryHash(String hash, String value, l= ong time) + { + if (hash =3D=3D null) + { + return false; + } + if (value =3D=3D null) + { + throw new IllegalArgumentException("value must not be null"); + } + + Calendar calendar =3D Calendar.getInstance(); + calendar.setTimeInMillis(time); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + String expected =3D md5AsHexString(value + calendar.getTimeInMillis(= )); + if (expected.equals(hash)) + { + return true; + } + calendar.add(Calendar.HOUR_OF_DAY, -1); + expected =3D md5AsHexString(value + calendar.getTimeInMillis()); + return expected.equals(hash); + } + + public static String getShortNameOf(Class clazz) + { + return clazz.getSimpleName(); + } + + public static String getPackageOf(Class clazz) + { + String name =3D clazz.getName(); + int index =3D name.lastIndexOf('.'); + if (index !=3D -1) + { + name =3D name.substring(0, index); + } + else + { + name =3D ""; + } + return name; + } + + public static String buildClassLoaderInfo(ClassLoader loader) + { + if (loader =3D=3D null) + { + throw new IllegalArgumentException("no loader"); + } + StringBuffer buffer =3D new StringBuffer(); + buffer.append("ClassLoader[Name=3D").append(loader.getClass().getNam= e()); + buffer.append(",HashCode=3D").append(loader.hashCode()); + buffer.append(",IdentityHashCode=3D").append(System.identityHashCode= (loader)); + if (loader instanceof URLClassLoader) + { + URLClassLoader urlLoader =3D (URLClassLoader)loader; + URL[] urls =3D urlLoader.getURLs(); + for (int i =3D 0; i < urls.length; i++) + { + URL url =3D urls[i]; + buffer.append(",URL(").append(i).append(")=3D").append(url); + } + } + try + { + Class uclClass =3D Thread.currentThread().getContextClassLoader()= .loadClass("org.jboss.mx.loading.UnifiedClassLoader"); + Class loaderClass =3D loader.getClass(); + if (uclClass.isAssignableFrom(loaderClass)) + { + URL url =3D (URL)loaderClass.getMethod("getURL", new Class[0])= .invoke(loader, new Object[0]); + buffer.append(",GetURL=3D").append(url); + } + } + catch (Exception e) + { + log.error("Cannot get UCL infos", e); + } + buffer.append("]"); + return buffer.toString(); + } + + public static String dumpClassLoaderHierarchyInfo(ClassLoader loader) + { + StringWriter writer =3D new StringWriter(); + dumpClassLoaderHierarchyInfo(writer, loader); + return writer.toString(); + } + + public static void dumpClassLoaderHierarchyInfo(Writer writer, ClassLoa= der loader) + { + if (writer =3D=3D null) + { + throw new IllegalArgumentException("no writer"); + } + if (loader =3D=3D null) + { + throw new IllegalArgumentException("no loader"); + } + + // + PrintWriter pw =3D null; + if (writer instanceof PrintWriter) + { + pw =3D (PrintWriter)writer; + } + else + { + pw =3D new PrintWriter(writer); + } + + pw.println(""); + while (loader !=3D null) + { + pw.println(buildClassLoaderInfo(loader)); + loader =3D loader.getParent(); + } + pw.print(""); + pw.flush(); + } + + public static void dumpClassLoaderHierarchyInfo(Logger log, ClassLoader= loader) + { + Writer writer =3D new Log4JWriter(log, Level.DEBUG); + dumpClassLoaderHierarchyInfo(writer, loader); + } + + public static void dumpClassLoaderHierarchyInfo(Logger log, Level level= , ClassLoader loader) + { + Writer writer =3D new Log4JWriter(log, level); + dumpClassLoaderHierarchyInfo(writer, loader); + } + + /** + * Replace occurence in a string. + * + * @param string the source string + * @param pattern the replaced pattern + * @param replacement the replacement text + * @return the new string + */ + public static String replace(String string, String pattern, String repl= acement) + { + StringBuffer buffer =3D new StringBuffer(string.length()); + int previous =3D 0; + int current =3D string.indexOf(pattern); + while (current !=3D -1) + { + buffer.append(string.substring(previous, current)); + buffer.append(replacement); + previous =3D current + pattern.length(); + current =3D string.indexOf(pattern, previous); + } + buffer.append(string.substring(previous)); + return buffer.toString(); + } + + /** + * Append an object to an array of objects. The original array is not m= odified. The returned array + * will be of the same component type of the provided array and its fir= st n elements where n is the size + * of the provided array will be the elements of the provided array. Th= e last element of the array will be + * the provided object to append. + * + * @param array the array to augment + * @param o the object to append + * @return a new array + * @throws IllegalArgumentException if the array is null + * @throws ClassCastException if the appended object class prevents it = from being added to the array + */ + public static E[] appendTo(E[] array, E o) throws IllegalArgumentEx= ception, ClassCastException + { + if (array =3D=3D null) + { + throw new IllegalArgumentException(); + } + + // + Class componentType =3D array.getClass().getComponentType(); + if (o !=3D null && !componentType.isAssignableFrom(o.getClass())) + { + throw new ClassCastException("Object with class " + o.getClass().= getName() + " cannot be casted to class " + componentType.getName()); + } + + // + E[] copy =3D (E[])Array.newInstance(componentType, array.length + 1); + System.arraycopy(array, 0, copy, 0, array.length); + copy[array.length] =3D o; + + // + return copy; + } + + /** + * Return true if + *
          + *
        • o1 is null and o2 is nullo1 is not null and the invocation of equals(Object o) on o1 wit o2 as argument returns true
        • + *
        + * + * @param o1 the first argument + * @param o2 the second argument + * @return if arguments are equals according to the semantic defined by= the method contract + */ + public static boolean safeEquals(Object o1, Object o2) + { + if (o1 =3D=3D null) + { + return o2 =3D=3D null; + } + else + { + return o1.equals(o2); + } + } + + public static String replaceAllInstancesOfBoundedString(String initial,= String prefix, String suffix, String replacement) + { + return replaceBoundedString(initial, prefix, suffix, replacement, tr= ue, false); + } + + /** + * Todo : define what "bounded" means. + * + * @param initial + * @param prefix + * @param suffix + * @param replacement + * @param replaceIfBoundedStringEmpty + * @param keepBoundaries + * @return + */ + public static String replaceBoundedString(String initial, String prefix= , String suffix, String replacement, + boolean replaceIfBoundedStrin= gEmpty, boolean keepBoundaries) + { + if (initial =3D=3D null || initial.length() =3D=3D 0) + { + return initial; + } + + ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(prefix, "p= refix", "Tools.replaceBoundedString"); + ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(suffix, "s= uffix", "Tools.replaceBoundedString"); + ParameterValidation.throwIllegalArgExceptionIfNull(replacement, "rep= lacement"); + + StringBuffer tmp =3D new StringBuffer(initial); + int prefixIndex =3D tmp.indexOf(prefix); + int suffixLength =3D suffix.length(); + int prefixLength =3D prefix.length(); + + while (prefixIndex !=3D -1) + { + int suffixIndex =3D tmp.indexOf(suffix, prefixIndex); + + if (suffixIndex !=3D -1) + { + // we don't care about empty bounded strings or prefix and suf= fix don't delimit an empty String =3D> replace! + if (replaceIfBoundedStringEmpty || suffixIndex !=3D prefixInde= x + prefixLength) + { + if (keepBoundaries) + { + tmp.delete(prefixIndex + prefixLength, suffixIndex); + tmp.insert(prefixIndex + prefixLength, replacement); + } + else + { + tmp.delete(prefixIndex, suffixIndex + suffixLength); + tmp.insert(prefixIndex, replacement); + } + } + } + + prefixIndex =3D tmp.indexOf(prefix, prefixIndex + prefixLength); + } + + return tmp.toString(); + } + + /** + * Determines if value is contained in array. + * + * todo: correct this method contract in order to make it more reusable= , it looks like for now like a method + * which has a contract convenient only for some kind of callers. + * + * 1/ null value should be accepted (or the method should be called isC= ontainedInButNotForNullValue ?) + * 2/ null array should not be accepted (or the method should be called= isContainedInExceptIfThePassedArrayIsNull ?) + * + * @param value + * @param array + * @return + * @since 2.4.2 + */ + public static boolean isContainedIn(Object value, Object[] array) + { + if (value =3D=3D null) + { + return false; + } + + // + if (array !=3D null) + { + for (Object anArray : array) + { + if (value.equals(anArray)) + { + return true; + } + } + } + return false; + } + + /** + * Attempt to cast the value argument to the provided type argument. If= the value argument type is assignable + * to the provided type, the value is returned, otherwise if it is not = or the value is null, null is returned. + * + * todo: Move that to common package. + * + * @param value the value to cast + * @param type the type to downcast + * @return the casted value or null + */ + public static T safeCast(Object value, Class type) + { + if (value =3D=3D null) + { + return null; + } + else + { + if (type.isAssignableFrom(value.getClass())) + { + return type.cast(value); + } + else + { + return null; + } + } + } + + public static MultiValuedPropertyMap emptyMultiValuedPropertyMap= () + { + return new MultiValuedPropertyMap() + { + public T getValue(String key) throws IllegalArgumentException + { + if (key =3D=3D null) + { + throw new IllegalArgumentException("Key cannot be null"); + } + return null; + } + + public List getValues(String key) throws IllegalArgumentExcept= ion + { + if (key =3D=3D null) + { + throw new IllegalArgumentException("Key cannot be null"); + } + return null; + } + + public void addValue(String key, T value) throws IllegalArgumentE= xception + { + throw new UnsupportedOperationException(); + } + + public void setValue(String key, T value) throws IllegalArgumentE= xception + { + throw new UnsupportedOperationException(); + } + + public Set keySet() + { + return Collections.emptySet(); + } + + public int size() + { + return 0; + } + + public void clear() + { + throw new UnsupportedOperationException(); + } + + public void append(MultiValuedPropertyMap appended) throws Ill= egalArgumentException + { + throw new UnsupportedOperationException(); + } + }; + } + +} \ No newline at end of file Added: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framewor= k/common/io/IOTools.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/io/IOTools.java (rev 0) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/io/IOTools.java 2008-02-22 23:26:34 UTC (rev 10091) @@ -0,0 +1,497 @@ +/* +* 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.framework.common.io; + +import org.jboss.portal.test.framework.common.Tools; +import org.apache.log4j.Logger; + +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.lang.reflect.InvocationTargetException; +import java.io.OutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.Reader; +import java.io.ByteArrayOutputStream; +import java.io.Writer; +import java.io.Serializable; +import java.io.ObjectOutputStream; +import java.io.ByteArrayInputStream; +import java.io.ObjectInputStream; +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.DataOutputStream; +import java.util.Map; + +/** + * IO tools. + * + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class IOTools +{ + + /** The logger. */ + public static final Logger log =3D Logger.getLogger(IOTools.class); + + /** . */ + private static final Object[] EMPTY_ARGS =3D new Object[0]; + + /** . */ + private static final Class[] EMPTY_PARAMETER_TYPES =3D new Class[0]; + + /** + *

        Attempt to close an object. Null argument value is authorized and= no operation will be performed in that + * use case.

        + * + *

        It will try to obtain a close() method by reflection= and it + * will be invoked only if the method is public and not static. If the = method is called, any Error + * or RuntimeException will be rethrown, any other kind of= throwable will not be rethrown in any form.

        + * + * @param closable the object to close + */ + public static void safeClose(Object closable) + { + if (closable !=3D null) + { + try + { + Method m =3D closable.getClass().getMethod("close", EMPTY_PARA= METER_TYPES); + if (Modifier.isStatic(m.getModifiers())) + { + log.warn("close() method on closable object is static"); + return; + } + m.invoke(closable, EMPTY_ARGS); + } + catch (NoSuchMethodException e) + { + log.warn("The closable object does not have a close() method",= e); + } + catch (IllegalAccessException e) + { + log.warn("Cannot access close() method on closable object", e); + } + catch (InvocationTargetException e) + { + Throwable t =3D e.getCause(); + + // + if (t instanceof RuntimeException) + { + log.error("The close() method threw a runtime exception", t= ); + throw (RuntimeException)t; + } + else if (t instanceof Error) + { + log.error("The close() method threw an error", t); + throw (Error)t; + } + else if (t instanceof Exception) + { + log.error("The close() method threw an exception", t); + } + else + { + log.error("The close() method threw an unexpected throwable= ", t); + } + } + } + } + + /** + *

        Attempt to close an OutputStream. Null argument valu= e is authorized and no operation will be performed in that + * use case.

        + * + * @param out the stream to close + */ + public static void safeClose(OutputStream out) + { + if (out !=3D null) + { + try + { + out.close(); + } + catch (IOException e) + { + log.error("Error while closing outstream", e); + } + } + } + + /** + *

        Attempt to close an InputStream. Null argument value= is authorized and no operation will be performed in that + * use case.

        + * + * @param in the stream to close + */ + public static void safeClose(InputStream in) + { + if (in !=3D null) + { + try + { + in.close(); + } + catch (IOException e) + { + log.error("Error while closing inputstream", e); + } + } + } + + /** + *

        Attempt to close an Reader. Null argument value is a= uthorized and no operation will be performed in that + * use case.

        + * + * @param reader the stream to close + */ + public static void safeClose(Reader reader) + { + if (reader !=3D null) + { + try + { + reader.close(); + } + catch (IOException e) + { + log.error("Error while closing reader", e); + } + } + } + + /** + *

        Attempt to close an Writer. Null argument value is a= uthorized and no operation will be performed in that + * use case.

        + * + * @param writer the stream to close + */ + public static void safeClose(Writer writer) + { + if (writer !=3D null) + { + try + { + writer.close(); + } + catch (IOException e) + { + log.error("Error while closing writer", e); + } + } + } + + /** + * @see #getBytes(java.io.InputStream, int) + * @param in the input stream + * @return the bytes read from the stream + * @throws java.io.IOException + * @throws IllegalArgumentException if the input stream is null + */ + public static byte[] getBytes(InputStream in) throws IOException, Illeg= alArgumentException + { + return getBytes(in, Tools.DEFAULT_BUFFER_SIZE); + } + + /** + * Get the bytes from the provided input stream. No attempt will be mad= e to close the stream. + * + * @param in the input stream + * @param bufferSize the buffer size used to copy the bytes + * @return the bytes read from the stream + * @throws java.io.IOException + * @throws IllegalArgumentException if the input stream is null or the = buffer size < 1 + */ + public static byte[] getBytes(InputStream in, int bufferSize) throws IO= Exception, IllegalArgumentException + { + ByteArrayOutputStream out =3D new ByteArrayOutputStream(); + copy(in, out, bufferSize); + return out.toByteArray(); + } + + /** + * @see #copy(java.io.InputStream, java.io.OutputStream, int) + * @param in the incoming stream + * @param out the outcoming stream + * @throws IllegalArgumentException if an argument is null + */ + public static void copy(InputStream in, OutputStream out) throws IOExce= ption + { + copy(in, out, Tools.DEFAULT_BUFFER_SIZE); + } + + /** + * Pipe an incoming stream in an outcoming stream until no bytes is ava= ilable from the input stream. + * No attempts will be made to close the streams. + * + * @param in the incoming stream + * @param out the outcoming stream + * @param bufferSize the buffer size + * @throws IllegalArgumentException if bufferSize < 1 or an argument is= null + */ + public static void copy(InputStream in, OutputStream out, int bufferSiz= e) throws IOException + { + // arguments check + if (in =3D=3D null) + { + throw new IllegalArgumentException("null in"); + } + if (out =3D=3D null) + { + throw new IllegalArgumentException("null out"); + } + if (bufferSize < 1) + { + throw new IllegalArgumentException("Buffer size is too small"); + } + + // do the job + byte[] buffer =3D new byte[bufferSize]; + while (true) + { + int i =3D in.read(buffer); + if (i =3D=3D 0) + { + continue; + } + if (i =3D=3D -1) + { + break; + } + out.write(buffer, 0, i); + } + } + + /** + * Pipe an input stream in an output stream. + * + * @param reader the incoming reader + * @param writer the outcoming writer + * @throws IllegalArgumentException if an argument is null + */ + public static void copy(Reader reader, Writer writer) throws IOException + { + copy(reader, writer, Tools.DEFAULT_BUFFER_SIZE); + } + + /** + * Pipe an incoming stream in an outcoming stream. + * + * @param reader the incoming reader + * @param writer the outcoming writer + * @param bufferSize the buffer size + * @throws IllegalArgumentException if bufferSize < 1 or an argument is= null + */ + public static void copy(Reader reader, Writer writer, int bufferSize) t= hrows IOException + { + // arguments check + if (reader =3D=3D null) + { + throw new IllegalArgumentException("null in"); + } + if (writer =3D=3D null) + { + throw new IllegalArgumentException("null out"); + } + if (bufferSize < 1) + { + throw new IllegalArgumentException("Buffer size is too small"); + } + + // do the job + char[] buffer =3D new char[bufferSize]; + while (true) + { + int i =3D reader.read(buffer); + if (i =3D=3D 0) + { + continue; + } + if (i =3D=3D -1) + { + break; + } + writer.write(buffer, 0, i); + } + } + + /** + * Clone an object implementing the Serializable interface. + * + * @param serializable + * @return + * @throws IllegalArgumentException if the serializable object is null + * @throws IOException + */ + public static S clone(S serializable) throws I= llegalArgumentException, IOException + { + if (serializable =3D=3D null) + { + throw new IllegalArgumentException("Cannot clone null"); + } + try + { + return (S)unserialize(serialize(serializable)); + } + catch (ClassNotFoundException e) + { + throw new Error("Got a class not found exception for a class that= was used", e); + } + } + + public static byte[] serialize(Serializable serializable) throws Illega= lArgumentException, IOException + { + if (serializable =3D=3D null) + { + throw new IllegalArgumentException("No null serializable accepted= "); + } + ByteArrayOutputStream baos =3D new ByteArrayOutputStream(); + ObjectOutputStream oos =3D new ObjectOutputStream(baos); + oos.writeObject(serializable); + oos.close(); + return baos.toByteArray(); + } + + public static Serializable unserialize(byte[] bytes) throws IllegalArgu= mentException, IOException, ClassNotFoundException + { + if (bytes =3D=3D null) + { + throw new IllegalArgumentException("No null serializable accepted= "); + } + ByteArrayInputStream bais =3D new ByteArrayInputStream(bytes); + ObjectInputStream ois =3D new ObjectInputStream(bais); + return (Serializable)ois.readObject(); + } + + public static byte[] serialize(Serialization serialization, T t) + { + return serialize(serialization, SerializationFilter.TRIVIAL, t); + } + + public static byte[] serialize(Serialization serialization, Seri= alizationFilter filter, T t) + { + if (serialization =3D=3D null) + { + throw new IllegalArgumentException(); + } + if (t =3D=3D null) + { + throw new IllegalArgumentException("No null object to serialize"); + } + try + { + ByteArrayOutputStream baos =3D new ByteArrayOutputStream(); + filter.serialize(serialization, t, baos); + return baos.toByteArray(); + } + catch (IOException e) + { + throw new UndeclaredIOException(e); + } + } + + public static T unserialize(Serialization serialization, byte[] = bytes) + { + return unserialize(serialization, SerializationFilter.TRIVIAL, bytes= ); + } + + public static T unserialize(Serialization serialization, Seriali= zationFilter filter, byte[] bytes) + { + if (serialization =3D=3D null) + { + throw new IllegalArgumentException(); + } + if (bytes =3D=3D null) + { + throw new IllegalArgumentException("No null bytes to unserialize"= ); + } + try + { + ByteArrayInputStream bais =3D new ByteArrayInputStream(bytes); + return filter.unserialize(serialization, bais); + } + catch (IOException e) + { + throw new UndeclaredIOException(e); + } + } + + /** + * Check that the provided input stream is buffered. If the argument is= already an instance of BufferedInputStream + * no operation will be performed, otherwise a instance of Buffer= edInputStream will be created and returned. + * + * If the provided argument is null, the null value is returned. + * + * @param in the stream + * @return a buffered wrapper + */ + public static BufferedInputStream safeBufferedWrapper(InputStream in) + { + if (in !=3D null) + { + if (in instanceof BufferedInputStream) + { + return (BufferedInputStream)in; + } + else + { + return new BufferedInputStream(in); + } + } + else + { + return null; + } + } + + /** + * Check that the provided output stream is buffered. If the argument i= s already an instance of BufferedOutputStream + * no operation will be performed, otherwise a instance of Buffer= edOutputStream will be created and returned. + * + * If the provided argument is null, the null value is returned. + * + * @param out the stream + * @return a buffered wrapper + */ + public static BufferedOutputStream safeBufferedWrapper(OutputStream out) + { + if (out !=3D null) + { + if (out instanceof BufferedOutputStream) + { + return (BufferedOutputStream)out; + } + else + { + return new BufferedOutputStream(out); + } + } + else + { + return null; + } + } +} Added: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framewor= k/common/io/Serialization.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/io/Serialization.java (rev 0) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/io/Serialization.java 2008-02-22 23:26:34 UTC (rev 10091) @@ -0,0 +1,121 @@ +/* +* 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.framework.common.io; + +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.DataInputStream; +import java.io.OutputStream; +import java.io.InputStream; +import java.util.Map; +import java.util.HashMap; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public interface Serialization +{ + + Serialization> PARAMETER_MAP =3D new Serializatio= n>() + { + public void serialize(Map map, OutputStream out) t= hrows IOException, IllegalArgumentException + { + if (map =3D=3D null) + { + throw new IllegalArgumentException("No null map allowed"); + } + + // + DataOutputStream data =3D out instanceof DataOutputStream ? (Data= OutputStream)out : new DataOutputStream(out); + + // + data.writeInt(map.size()); + + // + for (Map.Entry entry : map.entrySet()) + { + String name =3D (String)entry.getKey(); + data.writeUTF(name); + + // + String[] values =3D (String[])entry.getValue(); + if (values =3D=3D null) + { + throw new IllegalArgumentException("No null values are allo= wed in the map"); + } + + // + int length =3D values.length; + data.writeInt(length); + + // + for (String value : values) + { + if (value =3D=3D null) + { + throw new IllegalArgumentException("No null value in the= String[] are allowed in the map"); + } + data.writeUTF(value); + } + } + + // + data.flush(); + } + + public Map unserialize(InputStream in) throws IOEx= ception + { + if (in =3D=3D null) + { + throw new IllegalArgumentException("No null input stream"); + } + + // + DataInputStream data =3D in instanceof DataInputStream ? (DataInp= utStream)in : new DataInputStream(in); + + // + int size =3D data.readInt(); + Map tmp =3D new HashMap(size); + while (size-- > 0) + { + String name =3D data.readUTF(); + int length =3D data.readInt(); + String[] values =3D new String[length]; + for (int i =3D 0;i < length;i++) + { + values[i] =3D data.readUTF(); + } + tmp.put(name, values); + } + + // + return tmp; + } + }; + + public abstract void serialize(T t, OutputStream out) throws IOExceptio= n, IllegalArgumentException; + + public abstract T unserialize(InputStream in) throws IOException, Illeg= alArgumentException; + +} Added: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framewor= k/common/io/SerializationFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/io/SerializationFilter.java (rev 0) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/io/SerializationFilter.java 2008-02-22 23:26:34 UTC (rev 10091) @@ -0,0 +1,77 @@ +/* +* 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.framework.common.io; + +import java.io.OutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.zip.GZIPOutputStream; +import java.util.zip.GZIPInputStream; + +/** + * Filters a stream for serialize/unserialize operations. + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +public interface SerializationFilter +{ + + SerializationFilter TRIVIAL =3D new SerializationFilter() + { + public void serialize(Serialization serialization, T t, Outpu= tStream out) throws IllegalArgumentException, IOException + { + serialization.serialize(t, out); + } + + public T unserialize(Serialization serialization, InputStream= in) throws IllegalArgumentException, IOException + { + return serialization.unserialize(in); + } + }; + + /** + * Use GZIP streams. + */ + SerializationFilter COMPRESSOR =3D new SerializationFilter() + { + public void serialize(Serialization serialization, T t, Outpu= tStream out) throws IllegalArgumentException, IOException + { + GZIPOutputStream zos =3D new GZIPOutputStream(out); + serialization.serialize(t, zos); + zos.finish(); + } + + public T unserialize(Serialization serialization, InputStream= in) throws IllegalArgumentException, IOException + { + GZIPInputStream zis =3D new GZIPInputStream(in); + return serialization.unserialize(zis); + } + }; + + void serialize(Serialization serialization, T t, OutputStream ou= t) throws IllegalArgumentException, IOException; + + T unserialize(Serialization serialization, InputStream in) throw= s IllegalArgumentException, IOException; + +} + Added: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framewor= k/common/io/UndeclaredIOException.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/io/UndeclaredIOException.java (rev 0) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/io/UndeclaredIOException.java 2008-02-22 23:26:34 UTC (rev 10091) @@ -0,0 +1,45 @@ +/* +* 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.framework.common.io; + +import java.io.IOException; +import java.lang.reflect.UndeclaredThrowableException; + +/** + * Avoid a method to declare an IOException in its signature when it is no= t necessary. + * + * @author Julien Viet + * @version $Revision: 7228 $ + */ +public class UndeclaredIOException extends UndeclaredThrowableException +{ + public UndeclaredIOException(IOException undeclaredIOException) + { + super(undeclaredIOException); + } + + public UndeclaredIOException(IOException undeclaredIOException, String = s) + { + super(undeclaredIOException, s); + } +} \ No newline at end of file Added: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framewor= k/common/xml/TooManyElementException.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/xml/TooManyElementException.java (rev 0) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/xml/TooManyElementException.java 2008-02-22 23:26:34 UTC (rev 10091) @@ -0,0 +1,52 @@ +/* +* 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.framework.common.xml; + +/** + * @author Julien Viet + * @version $Revision: 7380 $ + */ +public class TooManyElementException extends RuntimeException +{ + /** The serialVersionUID */ + private static final long serialVersionUID =3D -2381186243988987102L; + + public TooManyElementException() + { + } + + public TooManyElementException(String message) + { + super(message); + } + + public TooManyElementException(String message, Throwable cause) + { + super(message, cause); + } + + public TooManyElementException(Throwable cause) + { + super(cause); + } +} \ No newline at end of file Added: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framewor= k/common/xml/XMLTools.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/xml/XMLTools.java (rev 0) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/xml/XMLTools.java 2008-02-22 23:26:34 UTC (rev 10091) @@ -0,0 +1,469 @@ +/* +* 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.framework.common.xml; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.Text; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Result; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Properties; +import java.util.NoSuchElementException; + +/** + * Utilities for dealing with XML. + * + * @author Martin Holzner + * @author Julien Viet + * @version $Revision: 7686 $ + */ +public class XMLTools +{ + + /** Namespace URI for XML lang. */ + public static final String XML_LANG_NAMESPACE_URI =3D "http://www.w3.or= g/XML/1998/namespace"; + + /** Document builder factory. */ + private static final DocumentBuilderFactory buildFactory =3D DocumentBu= ilderFactory.newInstance(); + + /** Transformer factory. */ + private static final TransformerFactory transformerFactory =3D Transfor= merFactory.newInstance(); + + /** Default output format which is : no xml declaration, no document ty= pe, indent. */ + private static Properties DEFAULT_FORMAT =3D createFormat(true, false, = true, "utf-8"); + + /** . */ + public static final String PARAM_YES =3D "yes"; + + /** . */ + public static final String PARAM_NO =3D "no"; + + /** . */ + public static final String ATTRIB_OMIT_XML_DECLARATION =3D "omit-xml-de= claration"; + + /** . */ + public static final String ATTRIB_CDATA_SECTION_ELEMENTS =3D "cdata-sec= tion-elements"; + + /** . */ + public static final String ATTRIB_METHOD =3D "method"; + + /** . */ + public static final String ATTRIB_INDENT =3D "indent"; + + /** . */ + public static final String ATTRIB_HREF =3D "href"; + + /** . */ + public static final String DIRECTIVE_IMPORT =3D "xsl:import"; + + /** . */ + public static final String DIRECTIVE_INCLUDE =3D "xsl:include"; + + /** . */ + public static final boolean DEFAULT_NAMESPACE_AWARE =3D true; + + /** . */ + public static final boolean DEFAULT_VALIDATION =3D false; + + /** prevent instantiation */ + private XMLTools() + { + } + + /** Return the builder factory. */ + public static DocumentBuilderFactory getDocumentBuilderFactory() + { + return buildFactory; + } + + /** + * + */ + private static Properties createFormat(boolean omitXMLDeclaration, bool= ean standalone, boolean indented, String encoding) + { + Properties format =3D new Properties(); + format.setProperty(OutputKeys.OMIT_XML_DECLARATION, omitXMLDeclarati= on ? "yes" : "no"); + format.setProperty(OutputKeys.STANDALONE, standalone ? "yes" : "no"); + format.setProperty(OutputKeys.INDENT, indented ? "yes" : "no"); + format.setProperty(OutputKeys.ENCODING, encoding); + return format; + } + + /** + * + */ + public static String toString(Document doc, boolean omitXMLDeclaration,= boolean standalone, boolean indented, String encoding) throws TransformerE= xception + { + Properties format =3D createFormat(omitXMLDeclaration, standalone, i= ndented, encoding); + return toString(doc, format); + } + + /** + * Serialize the document with the default format : - No XML declaratio= n - Indented - Encoding is UTF-8 + * + * @see #toString(Document,Properties) + */ + public static String toString(Document doc) throws TransformerException + { + return toString(doc, DEFAULT_FORMAT); + } + + /** @see #toString(Document) */ + public static String toString(Element element) throws ParserConfigurati= onException, TransformerException + { + return toString(element, DEFAULT_FORMAT); + } + + /** Converts an element to a String representation. */ + private static String toString(Element element, Properties properties) = throws ParserConfigurationException, TransformerException + { + Document doc =3D buildFactory.newDocumentBuilder().newDocument(); + element =3D (Element)doc.importNode(element, true); + doc.appendChild(element); + return toString(doc, properties); + } + + /** Converts an document to a String representation. */ + private static String toString(Document doc, Properties format) throws = TransformerException + { + Transformer transformer =3D transformerFactory.newTransformer(); + transformer.setOutputProperties(format); + StringWriter writer =3D new StringWriter(); + Source source =3D new DOMSource(doc); + Result result =3D new StreamResult(writer); + transformer.transform(source, result); + return writer.toString(); + } + + /** Parse a string into a document. */ + public static Document toDocument(String text) throws ParserConfigurati= onException, SAXException, IOException + { + DocumentBuilder builder =3D buildFactory.newDocumentBuilder(); + StringReader reader =3D new StringReader(text); + InputSource source =3D new InputSource(); + source.setCharacterStream(reader); + return builder.parse(source); + } + + /** Parse a string into an element. */ + public static Element toElement(String text) throws ParserConfiguration= Exception, SAXException, IOException + { + Document doc =3D toDocument(text); + return doc.getDocumentElement(); + } + + public static Document toDocument(Element element) throws ParserConfigu= rationException, SAXException, IOException + { + if (element =3D=3D null) + { + throw new IllegalArgumentException(); + } + + // + Document doc =3D buildFactory.newDocumentBuilder().newDocument(); + element =3D (Element)doc.importNode(element, true); + doc.appendChild(element); + return doc; + } + + /** + * Perform trimming by default + * + * @param element + * @return + * @throws IllegalArgumentException + * @see #asString(org.w3c.dom.Element,boolean) + */ + public static String asString(Element element) throws IllegalArgumentEx= ception + { + return asString(element, true); + } + + /** + * Get the element's content as a string. + * + * @param element the container + * @param trim true if text should be trimmed before returning result + * @throws IllegalArgumentException if the element content is mixed or = null + */ + public static String asString(Element element, boolean trim) throws Ill= egalArgumentException + { + if (element =3D=3D null) + { + throw new IllegalArgumentException("No null element allowed"); + } + + // + StringBuffer buffer =3D new StringBuffer(); + NodeList children =3D element.getChildNodes(); + for (int i =3D 0; i < children.getLength(); i++) + { + Node child =3D children.item(i); + switch (child.getNodeType()) + { + case Node.CDATA_SECTION_NODE: + case Node.TEXT_NODE: + buffer.append(((Text)child).getData()); + break; + case Node.ELEMENT_NODE: + throw new IllegalArgumentException("Mixed content not allow= ed"); + default: + break; + } + } + String result =3D buffer.toString(); + if (trim) + { + result =3D result.trim(); + } + return result; + } + + /** + * Return the optional unique child of an element. + * + * @param element the parent element + * @param strict true if the element must be present + * @return the child element or null if it does not exist and strict is= false + * @throws IllegalArgumentException if an argument is null + * @throws java.util.NoSuchElementException if strict is true and the= element is not present + * @throws TooManyElementException if more than one element is found + */ + public static Element getUniqueChild(Element element, boolean strict) t= hrows IllegalArgumentException, + NoSuchElementException, TooManyElementException + { + if (element =3D=3D null) + { + throw new IllegalArgumentException("No element specified"); + } + Element childElt =3D null; + NodeList list =3D element.getChildNodes(); + for (int i =3D 0; i < list.getLength(); i++) + { + Node childNode =3D list.item(i); + if (childNode instanceof Element) + { + if (childElt =3D=3D null) + { + childElt =3D (Element)childNode; + } + else + { + throw new TooManyElementException("More than one child elem= ent for element " + element.getNodeName()); + } + } + } + if (strict && childElt =3D=3D null) + { + throw new NoSuchElementException("No child element for element " = + element.getNodeName()); + } + return childElt; + } + + /** + * Return an optional child of an element with the specified name. + * + * @param element the parent element + * @param name the child name + * @param strict if the child must be present + * @return the child element or null if it does not exist and strict is= set to false + * @throws IllegalArgumentException if an argument is null + * @throws NoSuchElementException if strict is true and the element i= s not present + * @throws TooManyElementException if more than one element is found + */ + public static Element getUniqueChild(Element element, String name, bool= ean strict) throws IllegalArgumentException, + NoSuchElementException, TooManyElementException + { + return getUniqueChild(element, null, name, strict); + } + + /** + * Return an optional child of an element with the specified name and t= he optionally specified namespace uri. + * + * @param element the parent element + * @param name the child name + * @param uri the child uri + * @param strict if the child must be present + * @return the child element or null if it does not exist and strict is= set to false + * @throws IllegalArgumentException if an argument is null + * @throws NoSuchElementException if strict is true and the element i= s not present + * @throws TooManyElementException if more than one element is found + */ + public static Element getUniqueChild(Element element, String uri, Strin= g name, boolean strict) throws IllegalArgumentException, + NoSuchElementException, TooManyElementException + { + List list =3D getChildren(element, uri, name); + switch (list.size()) + { + case 0: + if (strict) + { + throw new NoSuchElementException("Missing child " + name + = " of element " + element.getNodeName()); + } + else + { + return null; + } + case 1: + return (Element)list.get(0); + default: + throw new TooManyElementException("Too many children for eleme= nt " + element.getNodeName()); + } + } + + /** + * Return an iterator for all the children of the given element having = the specified name. + * + * @param element the parent element + * @param name the child names + * @return an iterator for the designated elements + * @throws IllegalArgumentException if the element is null or the name = is null + */ + public static Iterator getChildrenIterator(Element element, St= ring name) throws IllegalArgumentException + { + return getChildren(element, name).iterator(); + } + + /** + * Return an iterator for all the children of the given element having = the specified name and the optionally + * specified namesspace uri. + * + * @param element the parent element + * @param uri the children uri + * @param name the children name + * @return an iterator for the designated elements + * @throws IllegalArgumentException if the element is null or the name = is null + */ + public static Iterator getChildrenIterator(Element element, St= ring uri, String name) throws IllegalArgumentException + { + return getChildren(element, uri, name).iterator(); + } + + /** + * Return all the children of the given element having the specified na= me. The collection object can be modified. + * + * @param element the parent element + * @param name the child names + * @return a list of elements + * @throws IllegalArgumentException if the element is null or the name = is null + */ + public static List getChildren(Element element, String name) t= hrows IllegalArgumentException + { + return getChildren(element, null, name); + } + + /** + * Return all the children of the given element having the specified na= me and the optionally specified namespace URI. + * The collection object can be modified. + * + * @param element the parent element + * @param uri the children uri + * @param name the children name + * @return a list of elements + * @throws IllegalArgumentException if the element is null or the name = is null + */ + public static List getChildren(Element element, String uri, St= ring name) throws IllegalArgumentException + { + if (element =3D=3D null) + { + throw new IllegalArgumentException("No element found"); + } + if (name =3D=3D null) + { + throw new IllegalArgumentException("No name specified"); + } + ArrayList result =3D new ArrayList(); + NodeList list =3D element.getChildNodes(); + for (int i =3D 0; i < list.getLength(); i++) + { + Node node =3D list.item(i); + if (node.getNodeType() =3D=3D Node.ELEMENT_NODE) + { + Element childElt =3D (Element)node; + + // + if (uri =3D=3D null) + { + if (childElt.getTagName().equals(name)) + { + result.add(childElt); + } + } + else if (uri.equals(childElt.getNamespaceURI())) + { + if (childElt.getLocalName().equals(name)) + { + result.add(childElt); + } + } + } + } + return result; + } + + public static Properties loadXMLProperties(Element propertiesElt) + { + if (propertiesElt =3D=3D null) + { + throw new IllegalArgumentException(); + } + Properties props =3D new Properties(); + for (Element entryElt : getChildren(propertiesElt, "entry")) + { + String key =3D entryElt.getAttribute("key"); + String value =3D asString(entryElt); + props.put(key, value); + } + return props; + } + + public static Properties loadXMLProperties(Document doc) + { + if (doc =3D=3D null) + { + throw new IllegalArgumentException(); + } + return loadXMLProperties(doc.getDocumentElement()); + } + +} \ No newline at end of file Modified: modules/test/trunk/test/src/main/java/org/jboss/portal/test/frame= work/embedded/DSConfig.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/e= mbedded/DSConfig.java 2008-02-22 16:28:22 UTC (rev 10090) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/e= mbedded/DSConfig.java 2008-02-22 23:26:34 UTC (rev 10091) @@ -23,10 +23,10 @@ = package org.jboss.portal.test.framework.embedded; = -import org.jboss.portal.common.xml.XMLTools; -import org.jboss.portal.common.io.IOTools; import org.w3c.dom.Document; import org.w3c.dom.Element; +import org.jboss.portal.test.framework.common.xml.XMLTools; +import org.jboss.portal.test.framework.common.io.IOTools; = import java.io.InputStream; import java.net.URL; Modified: modules/test/trunk/test/src/main/java/org/jboss/portal/test/frame= work/embedded/DataSourceSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/e= mbedded/DataSourceSupport.java 2008-02-22 16:28:22 UTC (rev 10090) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/e= mbedded/DataSourceSupport.java 2008-02-22 23:26:34 UTC (rev 10091) @@ -23,10 +23,10 @@ = package org.jboss.portal.test.framework.embedded; = -import org.jboss.portal.common.xml.XMLTools; -import org.jboss.portal.common.io.IOTools; import org.jboss.resource.adapter.jdbc.local.LocalTxDataSource; import org.jboss.resource.connectionmanager.CachedConnectionManagerReferen= ce; +import org.jboss.portal.test.framework.common.xml.XMLTools; +import org.jboss.portal.test.framework.common.io.IOTools; import org.w3c.dom.Document; import org.w3c.dom.Element; = Modified: modules/test/trunk/test/src/main/java/org/jboss/portal/test/frame= work/embedded/HibernateSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/e= mbedded/HibernateSupport.java 2008-02-22 16:28:22 UTC (rev 10090) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/e= mbedded/HibernateSupport.java 2008-02-22 23:26:34 UTC (rev 10091) @@ -31,8 +31,8 @@ import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Settings; import org.hibernate.tool.hbm2ddl.SchemaExport; -import org.jboss.portal.common.xml.XMLTools; -import org.jboss.portal.common.io.IOTools; +import org.jboss.portal.test.framework.common.xml.XMLTools; +import org.jboss.portal.test.framework.common.io.IOTools; import org.w3c.dom.Element; import org.w3c.dom.Document; import org.jboss.logging.Logger; Modified: modules/test/trunk/test/src/main/java/org/jboss/portal/test/frame= work/impl/generic/config/ServerConfig.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/i= mpl/generic/config/ServerConfig.java 2008-02-22 16:28:22 UTC (rev 10090) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/i= mpl/generic/config/ServerConfig.java 2008-02-22 23:26:34 UTC (rev 10091) @@ -24,8 +24,8 @@ = import org.w3c.dom.Element; import org.w3c.dom.Document; -import org.jboss.portal.common.xml.XMLTools; -import org.jboss.portal.common.io.IOTools; +import org.jboss.portal.test.framework.common.io.IOTools; +import org.jboss.portal.test.framework.common.xml.XMLTools; = import java.net.URL; import java.util.Iterator; Modified: modules/test/trunk/tooling/ant/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/tooling/ant/pom.xml 2008-02-22 16:28:22 UTC (rev 100= 90) +++ modules/test/trunk/tooling/ant/pom.xml 2008-02-22 23:26:34 UTC (rev 100= 91) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-SNAPSHOT + 1.2.0.Beta2 ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/tooling/core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/tooling/core/pom.xml 2008-02-22 16:28:22 UTC (rev 10= 090) +++ modules/test/trunk/tooling/core/pom.xml 2008-02-22 23:26:34 UTC (rev 10= 091) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-SNAPSHOT + 1.2.0.Beta2 ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/tooling/examples/maven2/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/tooling/examples/maven2/pom.xml 2008-02-22 16:28:22 = UTC (rev 10090) +++ modules/test/trunk/tooling/examples/maven2/pom.xml 2008-02-22 23:26:34 = UTC (rev 10091) @@ -11,7 +11,7 @@ org.jboss.unit jboss-unit - 1.2.0-SNAPSHOT + 1.2.0.Beta2 = @@ -39,7 +39,7 @@ org.jboss.unit jboss-unit-tooling-maven2 - 1.2.0-SNAPSHOT + 1.2.0.Beta2 test Modified: modules/test/trunk/tooling/maven2/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/tooling/maven2/pom.xml 2008-02-22 16:28:22 UTC (rev = 10090) +++ modules/test/trunk/tooling/maven2/pom.xml 2008-02-22 23:26:34 UTC (rev = 10091) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-SNAPSHOT + 1.2.0.Beta2 ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/tooling/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/tooling/pom.xml 2008-02-22 16:28:22 UTC (rev 10090) +++ modules/test/trunk/tooling/pom.xml 2008-02-22 23:26:34 UTC (rev 10091) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-SNAPSHOT + 1.2.0.Beta2 ../build/pom.xml 4.0.0 @@ -11,7 +11,7 @@ jboss-unit-tooling-aggregator pom JBoss Unit Tooling (aggregator) - 1.2.0-SNAPSHOT + 1.2.0.Beta2 core ant Modified: modules/test/trunk/unit/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/unit/pom.xml 2008-02-22 16:28:22 UTC (rev 10090) +++ modules/test/trunk/unit/pom.xml 2008-02-22 23:26:34 UTC (rev 10091) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0-SNAPSHOT + 1.2.0.Beta2 ../build/pom.xml 4.0.0 @@ -17,7 +17,7 @@ junit - + = --===============5816178444964836157==-- From portal-commits at lists.jboss.org Fri Feb 22 18:32:08 2008 Content-Type: multipart/mixed; boundary="===============9143714680749783494==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10092 - modules/test/tags. Date: Fri, 22 Feb 2008 18:32:08 -0500 Message-ID: --===============9143714680749783494== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-22 18:32:08 -0500 (Fri, 22 Feb 2008) New Revision: 10092 Added: modules/test/tags/JBOSS_UNIT_1_2_0_BETA2/ Log: tagging jboss unit 1.2.Beta2 Copied: modules/test/tags/JBOSS_UNIT_1_2_0_BETA2 (from rev 10091, modules/t= est) --===============9143714680749783494==-- From portal-commits at lists.jboss.org Fri Feb 22 18:35:22 2008 Content-Type: multipart/mixed; boundary="===============1728435554834066972==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10093 - modules/test/tags. Date: Fri, 22 Feb 2008 18:35:21 -0500 Message-ID: --===============1728435554834066972== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-22 18:35:21 -0500 (Fri, 22 Feb 2008) New Revision: 10093 Added: modules/test/tags/JBOSS_UNIT_1_2_0_BETA1/ Log: tagging jboss unit 1.2.Beta1 Copied: modules/test/tags/JBOSS_UNIT_1_2_0_BETA1 (from rev 9886, modules/te= st) --===============1728435554834066972==-- From portal-commits at lists.jboss.org Fri Feb 22 19:17:21 2008 Content-Type: multipart/mixed; boundary="===============3201510116174800596==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10094 - in modules/test/trunk: build and 18 other directories. Date: Fri, 22 Feb 2008 19:17:20 -0500 Message-ID: --===============3201510116174800596== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-22 19:17:20 -0500 (Fri, 22 Feb 2008) New Revision: 10094 Added: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/xml/NoSuchElementException.java Removed: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/Log4JWriter.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/MultiValuedPropertyMap.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/ParameterValidation.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/Tools.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/io/Serialization.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/io/SerializationFilter.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/io/UndeclaredIOException.java Modified: modules/test/trunk/build/pom.xml modules/test/trunk/docs/pom.xml modules/test/trunk/docs/user-guide/pom.xml modules/test/trunk/mc/pom.xml modules/test/trunk/pom.xml modules/test/trunk/remote/pom.xml modules/test/trunk/test/agent/pom.xml modules/test/trunk/test/core/pom.xml modules/test/trunk/test/generic/pom.xml modules/test/trunk/test/jboss/pom.xml modules/test/trunk/test/opends/pom.xml modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/io/IOTools.java modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/co= mmon/xml/XMLTools.java modules/test/trunk/tooling/ant/pom.xml modules/test/trunk/tooling/core/pom.xml modules/test/trunk/tooling/examples/maven2/pom.xml modules/test/trunk/tooling/maven2/pom.xml modules/test/trunk/tooling/pom.xml modules/test/trunk/unit/pom.xml Log: back to 1.2.0.SNAPSHOT + trim down forked utils Modified: modules/test/trunk/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/build/pom.xml 2008-02-22 23:35:21 UTC (rev 10093) +++ modules/test/trunk/build/pom.xml 2008-02-23 00:17:20 UTC (rev 10094) @@ -18,7 +18,7 @@ 4.0.0 org.jboss.unit module-parent - 1.2.0.Beta2 + 1.2.0.SNAPSHOT pom JBoss Portal Test Module http://www.jboss.com/products/jbossmc Modified: modules/test/trunk/docs/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/docs/pom.xml 2008-02-22 23:35:21 UTC (rev 10093) +++ modules/test/trunk/docs/pom.xml 2008-02-23 00:17:20 UTC (rev 10094) @@ -4,13 +4,13 @@ org.jboss.unit module-parent - 1.2.0.Beta2 + 1.2.0.SNAPSHOT ../build/pom.xml docs-aggregator pom JBoss Portal Portlet Docs Aggregator - 1.2.0.Beta2 + 1.2.0.SNAPSHOT http://labs.jboss.com/jbossportal = Modified: modules/test/trunk/docs/user-guide/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/docs/user-guide/pom.xml 2008-02-22 23:35:21 UTC (rev= 10093) +++ modules/test/trunk/docs/user-guide/pom.xml 2008-02-23 00:17:20 UTC (rev= 10094) @@ -60,7 +60,7 @@ = org.jboss.unit user-guide-${translation} - 1.2.0.Beta2 + 1.2.0.SNAPSHOT jdocbook User_Guide_(${translation}) = Modified: modules/test/trunk/mc/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/mc/pom.xml 2008-02-22 23:35:21 UTC (rev 10093) +++ modules/test/trunk/mc/pom.xml 2008-02-23 00:17:20 UTC (rev 10094) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0.Beta2 + 1.2.0.SNAPSHOT ../build/pom.xml 4.0.0 Modified: modules/test/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/pom.xml 2008-02-22 23:35:21 UTC (rev 10093) +++ modules/test/trunk/pom.xml 2008-02-23 00:17:20 UTC (rev 10094) @@ -5,7 +5,7 @@ module-aggregator pom JBoss Portal Modules Test - 1.2.0.Beta2 + 1.2.0.SNAPSHOT http://labs.jboss.com/jbossportal = Modified: modules/test/trunk/remote/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/remote/pom.xml 2008-02-22 23:35:21 UTC (rev 10093) +++ modules/test/trunk/remote/pom.xml 2008-02-23 00:17:20 UTC (rev 10094) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0.Beta2 + 1.2.0.SNAPSHOT ../build/pom.xml 4.0.0 Modified: modules/test/trunk/test/agent/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/agent/pom.xml 2008-02-22 23:35:21 UTC (rev 1009= 3) +++ modules/test/trunk/test/agent/pom.xml 2008-02-23 00:17:20 UTC (rev 1009= 4) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0.Beta2 + 1.2.0.SNAPSHOT ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/test/core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/core/pom.xml 2008-02-22 23:35:21 UTC (rev 10093) +++ modules/test/trunk/test/core/pom.xml 2008-02-23 00:17:20 UTC (rev 10094) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0.Beta2 + 1.2.0.SNAPSHOT ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/test/generic/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/generic/pom.xml 2008-02-22 23:35:21 UTC (rev 10= 093) +++ modules/test/trunk/test/generic/pom.xml 2008-02-23 00:17:20 UTC (rev 10= 094) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0.Beta2 + 1.2.0.SNAPSHOT ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/test/jboss/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/jboss/pom.xml 2008-02-22 23:35:21 UTC (rev 1009= 3) +++ modules/test/trunk/test/jboss/pom.xml 2008-02-23 00:17:20 UTC (rev 1009= 4) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0.Beta2 + 1.2.0.SNAPSHOT ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/test/opends/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/opends/pom.xml 2008-02-22 23:35:21 UTC (rev 100= 93) +++ modules/test/trunk/test/opends/pom.xml 2008-02-23 00:17:20 UTC (rev 100= 94) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0.Beta2 + 1.2.0.SNAPSHOT ../../build/pom.xml 4.0.0 Deleted: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framew= ork/common/Log4JWriter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/Log4JWriter.java 2008-02-22 23:35:21 UTC (rev 10093) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/Log4JWriter.java 2008-02-23 00:17:20 UTC (rev 10094) @@ -1,86 +0,0 @@ -/* -* 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.framework.common; - -import org.apache.log4j.Logger; -import org.apache.log4j.Level; - -import java.io.Writer; -import java.io.IOException; - -/** - * @author Julien Viet - * @version $Revision: 5451 $ - */ -public class Log4JWriter extends Writer -{ - - /** The open/closed status. */ - private boolean open; - - /** The logger. */ - private Logger log; - - /** The logging level. */ - private Level level; - - /** - * @throws IllegalArgumentException if log or level is null - */ - public Log4JWriter(Logger log, Level level) throws IllegalArgumentExcep= tion - { - if (log =3D=3D null) - { - throw new IllegalArgumentException("No logger provided"); - } - if (level =3D=3D null) - { - throw new IllegalArgumentException("No level provided"); - } - this.open =3D false; - this.log =3D log; - this.level =3D level; - } - - public void write(char cbuf[], int off, int len) throws IOException - { - if (open) - { - log.log(level, new String(cbuf, off, len)); - } - else - { - throw new IOException("Stream closed"); - } - } - - public void flush() throws IOException - { - } - - public void close() throws IOException - { - open =3D false; - } -} - Deleted: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framew= ork/common/MultiValuedPropertyMap.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/MultiValuedPropertyMap.java 2008-02-22 23:35:21 UTC (rev 10093) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/MultiValuedPropertyMap.java 2008-02-23 00:17:20 UTC (rev 10094) @@ -1,44 +0,0 @@ -/* -* 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.framework.common; - -import java.util.List; -import java.util.Set; - -/** - * A property map with multi valued properties. - * - * @author Julien Viet - * @version $Revision: 630 $ - */ -public interface MultiValuedPropertyMap -{ - T getValue(String key) throws IllegalArgumentException; - List getValues(String key) throws IllegalArgumentException; - void addValue(String key, T value) throws IllegalArgumentException; - void setValue(String key, T value) throws IllegalArgumentException; - Set keySet(); - void clear(); - int size(); - void append(MultiValuedPropertyMap appended) throws IllegalArgumentE= xception; -} Deleted: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framew= ork/common/ParameterValidation.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/ParameterValidation.java 2008-02-22 23:35:21 UTC (rev 10093) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/ParameterValidation.java 2008-02-23 00:17:20 UTC (rev 10094) @@ -1,67 +0,0 @@ -/* -* 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.framework.common; - -/** - * @author Chris Laprun - * @version $Revision: 5757 $ - * @since 2.4 (May 31, 2006) - */ -public class ParameterValidation -{ - public static void throwIllegalArgExceptionIfNullOrEmpty(String valueTo= Check, String valueName, String contextName) - { - if (isNullOrEmpty(valueToCheck)) - { - throw new IllegalArgumentException((contextName !=3D null ? conte= xtName + " r" : "R") + "equires a non-null, non-empty " + valueName); - } - } - - /** @since 2.6 */ - public static boolean isNullOrEmpty(String valueToCheck) - { - return valueToCheck =3D=3D null || valueToCheck.length() =3D=3D 0; - } - - public static void throwIllegalArgExceptionIfNull(Object objectToTest, = String name) - { - if (objectToTest =3D=3D null) - { - throw new IllegalArgumentException("Must pass a non null " + name= ); - } - } - - /** @since 2.4.1 */ - public static void throwIllegalArgExceptionIfNullOrEmpty(Object[] array= , String name) - { - if (array =3D=3D null) - { - throw new IllegalArgumentException("Must pass a non-null " + name= ); - } - if (array.length =3D=3D 0) - { - throw new IllegalArgumentException("Must pass a non-empty " + nam= e); - } - } -} - Deleted: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framew= ork/common/Tools.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/Tools.java 2008-02-22 23:35:21 UTC (rev 10093) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/Tools.java 2008-02-23 00:17:20 UTC (rev 10094) @@ -1,1023 +0,0 @@ -/* -* 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.framework.common; - -import org.apache.log4j.Level; -import org.apache.log4j.Logger; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.io.Writer; -import java.lang.reflect.Array; -import java.math.BigInteger; -import java.net.URL; -import java.net.URLClassLoader; -import java.net.UnknownHostException; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Enumeration; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.NoSuchElementException; -import java.util.ResourceBundle; -import java.util.Set; -import java.util.Collections; - -/** - * @author Julien Viet - * @author Thomas Heute - * @author Bolesla= w Dawidowicz - * @author Chris Laprun - * @version $Revision: 7377 $ - */ -public class Tools -{ - - public static final int DEFAULT_BUFFER_SIZE =3D 512; - - public static final Logger log =3D Logger.getLogger(Tools.class); - - /** 16 chars long VMID. */ - public static final String VMID =3D VMID(); - - private static String VMID() - { - try - { - BigInteger bi =3D BigInteger.valueOf(0); - byte[] address =3D java.net.InetAddress.getLocalHost().getAddress= (); - for (int i =3D 0; i < 4; i++) - { - bi =3D bi.shiftLeft(8); - bi =3D bi.add(BigInteger.valueOf(address[i])); - } - bi =3D bi.shiftLeft(32); - int code =3D System.identityHashCode(new Object()); - bi =3D bi.add(BigInteger.valueOf(code)); - byte[] bytes =3D bi.toByteArray(); - StringBuffer buffer =3D new StringBuffer(); - char[] chars =3D "0123456789ABCDEF".toCharArray(); - for (int i =3D 0; i < bytes.length; i++) - { - buffer.append(chars[(bytes[i] & 0xF0) >> 4]).append(chars[byte= s[i] & 0xF]); - } - return buffer.toString(); - } - catch (UnknownHostException e) - { - e.printStackTrace(System.err); - throw new Error("Cannot create VMID"); - } - } - - public static final Enumeration EMPTY_ENUMERATION =3D new Enumeration() - { - public boolean hasMoreElements() - { - return false; - } - - public Object nextElement() - { - throw new NoSuchElementException(); - } - }; - - public static final Iterator EMPTY_ITERATOR =3D new Iterator() - { - public boolean hasNext() - { - return false; - } - - public Object next() - { - throw new NoSuchElementException(); - } - - public void remove() - { - throw new UnsupportedOperationException(); - } - }; - - public static final ResourceBundle EMPTY_BUNDLE =3D new ResourceBundle() - { - protected Object handleGetObject(String key) - { - return null; - } - - public Enumeration getKeys() - { - return EMPTY_ENUMERATION; - } - }; - - public static Enumeration emptyEnumeration() - { - return (Enumeration)EMPTY_ENUMERATION; - } - - public static Iterator emptyIterator() - { - return (Iterator)EMPTY_ITERATOR; - } - - public static Enumeration toEnumeration(final Iterator iterat= or) - { - if (iterator =3D=3D null) - { - throw new IllegalArgumentException(); - } - return new Enumeration() - { - public boolean hasMoreElements() - { - return iterator.hasNext(); - } - - public E nextElement() - { - return iterator.next(); - } - }; - } - - public static Enumeration toEnumeration(final E[] objects) - { - if (objects =3D=3D null) - { - throw new IllegalArgumentException(); - } - return new Enumeration() - { - int index =3D 0; - - public boolean hasMoreElements() - { - return index < objects.length; - } - - public E nextElement() - { - if (index < objects.length) - { - return objects[index++]; - } - else - { - throw new NoSuchElementException(); - } - } - }; - } - - public static Enumeration toEnumeration(final E o) - { - return new Enumeration() - { - boolean hasMore =3D true; - - public boolean hasMoreElements() - { - return hasMore; - } - - public E nextElement() - { - if (hasMore) - { - hasMore =3D false; - } - else - { - throw new NoSuchElementException(); - } - return o; - } - }; - } - - public static Set toSet(Enumeration e) - { - if (e =3D=3D null) - { - throw new IllegalArgumentException(); - } - HashSet set =3D new HashSet(); - while (e.hasMoreElements()) - { - set.add(e.nextElement()); - } - return set; - } - - public static Set toSet(E... objects) - { - if (objects =3D=3D null) - { - throw new IllegalArgumentException(); - } - HashSet set =3D new HashSet(); - for (E object : objects) - { - set.add(object); - } - return set; - } - - /** - * Transforms an iterator into an unordered Set - * - * @param iterator The iterator to transform - * @return A HashSet - */ - public static Set toSet(Iterator iterator) - { - if (iterator =3D=3D null) - { - throw new IllegalArgumentException(); - } - return toSet(iterator, false); - } - - /** - * Transforms an iterator into a Set - * - * @param iterator The iterator to transform - * @param preserveOrder true if the set must respect the ordering of th= e iterator - * @return a LinkedHashSet if ordered is true, a HashSet otherwise - */ - public static Set toSet(Iterator iterator, boolean preserveOr= der) - { - if (iterator =3D=3D null) - { - throw new IllegalArgumentException(); - } - Set set; - if (preserveOrder) - { - set =3D new LinkedHashSet(); - } - else - { - set =3D new HashSet(); - } - while (iterator.hasNext()) - { - set.add(iterator.next()); - } - return set; - } - - public static List toList(Enumeration e) - { - if (e =3D=3D null) - { - throw new IllegalArgumentException(); - } - List list =3D new ArrayList(); - while (e.hasMoreElements()) - { - list.add(e.nextElement()); - } - return list; - } - - public static List toList(Iterator iterator) - { - if (iterator =3D=3D null) - { - throw new IllegalArgumentException(); - } - List list =3D new ArrayList(); - while (iterator.hasNext()) - { - list.add(iterator.next()); - } - return list; - } - - public static List toList(E... objects) - { - if (objects =3D=3D null) - { - throw new IllegalArgumentException(); - } - List list =3D new ArrayList(objects.length); - for (E object : objects) - { - list.add(object); - } - return list; - } - - /** - * Consider remove this method as it cannot be generified. - * - * @param i - * @return - */ - @Deprecated - public static Object[] toArray(Iterator i) - { - // This method cannot be generified. - return toList(i).toArray(); - } - - /** - * Returns a singleton iterator. - * - * @param o the singleton object - * @return the iterator - */ - public static Iterator iterator(final E o) - { - return new Iterator() - { - /** The status of the iterator. */ - boolean done =3D false; - - public boolean hasNext() - { - return !done; - } - - public E next() - { - if (done) - { - throw new NoSuchElementException("Already iterated"); - } - done =3D true; - return o; - } - - public void remove() - { - throw new UnsupportedOperationException("read only"); - } - }; - } - - /** - * Returns an iterator over the array elements. - * - * @param objects the array containing the objects to iterate on - * @return the iterator - * @throws IllegalArgumentException if the object array is null or the = specified range is not valid - */ - public static Iterator iterator(final E... objects) throws Illeg= alArgumentException - { - if (objects =3D=3D null) - { - throw new IllegalArgumentException("No null object array"); - } - return iterator(objects, 0, objects.length); - } - - /** - * Returns an iterator over the array elements within the specified ran= ge. The range is considered as valid - * if the from argument is greater or equals than zero, the to argument= is lesser or equals than array size - * and the from argument is lesser or equals to the to argument. - * - * @param objects the array containing the objects to iterate on - * @param from the inclusive start index - * @param to the exclusive stop index - * @return the iterator - * @throws IllegalArgumentException if the object array is null or the = specified range is not valid or if the range is not valid - */ - public static Iterator iterator(final E[] objects, final int fro= m, final int to) throws IllegalArgumentException - { - if (objects =3D=3D null) - { - throw new IllegalArgumentException("No null object array"); - } - if (from > to || from < 0 || to > objects.length) - { - throw new IllegalArgumentException("Invalid range [" + from + ","= + to + "] for array of length " + objects.length); - } - return new Iterator() - { - /** . */ - int index =3D from; - - public boolean hasNext() - { - return index < to; - } - - public E next() - { - if (index >=3D to) - { - throw new NoSuchElementException("Index is greater than the= array length"); - } - return objects[index++]; - } - - public void remove() - { - throw new UnsupportedOperationException("read only"); - } - }; - } - - public static int computeStringHash(int hash, String s) - { - char[] chars =3D s.toCharArray(); - int length =3D chars.length; - for (int i =3D 0; i < length; i++) - { - char c =3D chars[i]; - hash =3D 31 * hash + c; - } - return hash; - } - - /** - * Computes an md5 hash of a string. - * - * @param text the hashed string - * @return the string hash - * @throws NullPointerException if text is null - */ - public static byte[] md5(String text) - { - // arguments check - if (text =3D=3D null) - { - throw new NullPointerException("null text"); - } - - try - { - MessageDigest md =3D MessageDigest.getInstance("MD5"); - md.update(text.getBytes()); - return md.digest(); - } - catch (NoSuchAlgorithmException e) - { - log.error("Cannot find MD5 algorithm", e); - throw new RuntimeException("Cannot find MD5 algorithm"); - } - } - - /** - * Computes an md5 hash and returns the result as a string in hexadecim= al format. - * - * @param text the hashed string - * @return the string hash - * @throws NullPointerException if text is null - */ - public static String md5AsHexString(String text) - { - return toHexString(md5(text)); - } - - /** - * Computes a hash with specified algorighm and returns the result as a= string in hexadecimal format - * - * @param text - * @param algorithm - * @param encoding - * @return - * @throws NoSuchAlgorithmException - */ - public static String hashAndEncodeString(String text, String algorithm,= String encoding) throws NoSuchAlgorithmException - { - // arguments check - if (text =3D=3D null) - { - throw new NullPointerException("null text"); - } - if (algorithm =3D=3D null) - { - throw new NullPointerException("null algorithm"); - } - if (encoding =3D=3D null) - { - throw new NullPointerException("null encoding"); - } - - MessageDigest md =3D MessageDigest.getInstance(algorithm); - md.update(text.getBytes()); - byte[] encoded =3D md.digest(); - - if ("HEX".equalsIgnoreCase(encoding)) - { - return toHexString(encoded); - } - //TODO: add base64 support here - else - { - throw new IllegalArgumentException("Not supported encoding: " + e= ncoding); - } - - } - - - /** - * Returns a string in the hexadecimal format. - * - * @param bytes the converted bytes - * @return the hexadecimal string representing the bytes data - * @throws IllegalArgumentException if the byte array is null - */ - public static String toHexString(byte[] bytes) - { - if (bytes =3D=3D null) - { - throw new IllegalArgumentException("byte array must not be null"); - } - StringBuffer hex =3D new StringBuffer(bytes.length * 2); - for (int i =3D 0; i < bytes.length; i++) - { - hex.append(Character.forDigit((bytes[i] & 0XF0) >> 4, 16)); - hex.append(Character.forDigit((bytes[i] & 0X0F), 16)); - } - return hex.toString(); - } - - /** - * Returns a byte array converted from the hexadecimal format. - * - * @param hex the string to convert - * @return the byte array corresponding - * @throws IllegalArgumentException if the string is null or does not h= ave the good format - */ - public static byte[] fromHexString(String hex) - { - if (hex =3D=3D null) - { - throw new IllegalArgumentException("Hex string must not be null"); - } - if (hex.length() % 2 =3D=3D 1) - { - throw new IllegalArgumentException("Hex string length is not even= : " + hex.length()); - } - int index =3D 0; - byte[] bytes =3D new byte[hex.length() / 2]; - for (int i =3D 0; i < bytes.length; i++) - { - char chigh =3D hex.charAt(index++); - int high =3D Character.digit(chigh, 16); - if (high =3D=3D -1) - { - throw new IllegalArgumentException("Hex string contains a bad = char : " + chigh); - } - char clow =3D hex.charAt(index++); - int low =3D Character.digit(clow, 16); - if (low =3D=3D -1) - { - throw new IllegalArgumentException("Hex string contains a bad = char : " + clow); - } - byte value =3D (byte)((high << 4) + low); - bytes[i] =3D value; - } - return bytes; - } - - /** - * - */ - public static String generateTemporaryHash(String value, long time) - { - if (value =3D=3D null) - { - throw new IllegalArgumentException("id must not be null"); - } - - Calendar calendar =3D Calendar.getInstance(); - calendar.setTimeInMillis(time); - calendar.set(Calendar.MINUTE, 0); - calendar.set(Calendar.SECOND, 0); - calendar.set(Calendar.MILLISECOND, 0); - return md5AsHexString(value + calendar.getTimeInMillis()); - } - - /** - * - */ - public static boolean confirmTemporaryHash(String hash, String value, l= ong time) - { - if (hash =3D=3D null) - { - return false; - } - if (value =3D=3D null) - { - throw new IllegalArgumentException("value must not be null"); - } - - Calendar calendar =3D Calendar.getInstance(); - calendar.setTimeInMillis(time); - calendar.set(Calendar.MINUTE, 0); - calendar.set(Calendar.SECOND, 0); - calendar.set(Calendar.MILLISECOND, 0); - String expected =3D md5AsHexString(value + calendar.getTimeInMillis(= )); - if (expected.equals(hash)) - { - return true; - } - calendar.add(Calendar.HOUR_OF_DAY, -1); - expected =3D md5AsHexString(value + calendar.getTimeInMillis()); - return expected.equals(hash); - } - - public static String getShortNameOf(Class clazz) - { - return clazz.getSimpleName(); - } - - public static String getPackageOf(Class clazz) - { - String name =3D clazz.getName(); - int index =3D name.lastIndexOf('.'); - if (index !=3D -1) - { - name =3D name.substring(0, index); - } - else - { - name =3D ""; - } - return name; - } - - public static String buildClassLoaderInfo(ClassLoader loader) - { - if (loader =3D=3D null) - { - throw new IllegalArgumentException("no loader"); - } - StringBuffer buffer =3D new StringBuffer(); - buffer.append("ClassLoader[Name=3D").append(loader.getClass().getNam= e()); - buffer.append(",HashCode=3D").append(loader.hashCode()); - buffer.append(",IdentityHashCode=3D").append(System.identityHashCode= (loader)); - if (loader instanceof URLClassLoader) - { - URLClassLoader urlLoader =3D (URLClassLoader)loader; - URL[] urls =3D urlLoader.getURLs(); - for (int i =3D 0; i < urls.length; i++) - { - URL url =3D urls[i]; - buffer.append(",URL(").append(i).append(")=3D").append(url); - } - } - try - { - Class uclClass =3D Thread.currentThread().getContextClassLoader()= .loadClass("org.jboss.mx.loading.UnifiedClassLoader"); - Class loaderClass =3D loader.getClass(); - if (uclClass.isAssignableFrom(loaderClass)) - { - URL url =3D (URL)loaderClass.getMethod("getURL", new Class[0])= .invoke(loader, new Object[0]); - buffer.append(",GetURL=3D").append(url); - } - } - catch (Exception e) - { - log.error("Cannot get UCL infos", e); - } - buffer.append("]"); - return buffer.toString(); - } - - public static String dumpClassLoaderHierarchyInfo(ClassLoader loader) - { - StringWriter writer =3D new StringWriter(); - dumpClassLoaderHierarchyInfo(writer, loader); - return writer.toString(); - } - - public static void dumpClassLoaderHierarchyInfo(Writer writer, ClassLoa= der loader) - { - if (writer =3D=3D null) - { - throw new IllegalArgumentException("no writer"); - } - if (loader =3D=3D null) - { - throw new IllegalArgumentException("no loader"); - } - - // - PrintWriter pw =3D null; - if (writer instanceof PrintWriter) - { - pw =3D (PrintWriter)writer; - } - else - { - pw =3D new PrintWriter(writer); - } - - pw.println(""); - while (loader !=3D null) - { - pw.println(buildClassLoaderInfo(loader)); - loader =3D loader.getParent(); - } - pw.print(""); - pw.flush(); - } - - public static void dumpClassLoaderHierarchyInfo(Logger log, ClassLoader= loader) - { - Writer writer =3D new Log4JWriter(log, Level.DEBUG); - dumpClassLoaderHierarchyInfo(writer, loader); - } - - public static void dumpClassLoaderHierarchyInfo(Logger log, Level level= , ClassLoader loader) - { - Writer writer =3D new Log4JWriter(log, level); - dumpClassLoaderHierarchyInfo(writer, loader); - } - - /** - * Replace occurence in a string. - * - * @param string the source string - * @param pattern the replaced pattern - * @param replacement the replacement text - * @return the new string - */ - public static String replace(String string, String pattern, String repl= acement) - { - StringBuffer buffer =3D new StringBuffer(string.length()); - int previous =3D 0; - int current =3D string.indexOf(pattern); - while (current !=3D -1) - { - buffer.append(string.substring(previous, current)); - buffer.append(replacement); - previous =3D current + pattern.length(); - current =3D string.indexOf(pattern, previous); - } - buffer.append(string.substring(previous)); - return buffer.toString(); - } - - /** - * Append an object to an array of objects. The original array is not m= odified. The returned array - * will be of the same component type of the provided array and its fir= st n elements where n is the size - * of the provided array will be the elements of the provided array. Th= e last element of the array will be - * the provided object to append. - * - * @param array the array to augment - * @param o the object to append - * @return a new array - * @throws IllegalArgumentException if the array is null - * @throws ClassCastException if the appended object class prevents it = from being added to the array - */ - public static E[] appendTo(E[] array, E o) throws IllegalArgumentEx= ception, ClassCastException - { - if (array =3D=3D null) - { - throw new IllegalArgumentException(); - } - - // - Class componentType =3D array.getClass().getComponentType(); - if (o !=3D null && !componentType.isAssignableFrom(o.getClass())) - { - throw new ClassCastException("Object with class " + o.getClass().= getName() + " cannot be casted to class " + componentType.getName()); - } - - // - E[] copy =3D (E[])Array.newInstance(componentType, array.length + 1); - System.arraycopy(array, 0, copy, 0, array.length); - copy[array.length] =3D o; - - // - return copy; - } - - /** - * Return true if - *
          - *
        • o1 is null and o2 is nullo1 is not null and the invocation of equals(Object o) on o1 wit o2 as argument returns true
        • - *
        - * - * @param o1 the first argument - * @param o2 the second argument - * @return if arguments are equals according to the semantic defined by= the method contract - */ - public static boolean safeEquals(Object o1, Object o2) - { - if (o1 =3D=3D null) - { - return o2 =3D=3D null; - } - else - { - return o1.equals(o2); - } - } - - public static String replaceAllInstancesOfBoundedString(String initial,= String prefix, String suffix, String replacement) - { - return replaceBoundedString(initial, prefix, suffix, replacement, tr= ue, false); - } - - /** - * Todo : define what "bounded" means. - * - * @param initial - * @param prefix - * @param suffix - * @param replacement - * @param replaceIfBoundedStringEmpty - * @param keepBoundaries - * @return - */ - public static String replaceBoundedString(String initial, String prefix= , String suffix, String replacement, - boolean replaceIfBoundedStrin= gEmpty, boolean keepBoundaries) - { - if (initial =3D=3D null || initial.length() =3D=3D 0) - { - return initial; - } - - ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(prefix, "p= refix", "Tools.replaceBoundedString"); - ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(suffix, "s= uffix", "Tools.replaceBoundedString"); - ParameterValidation.throwIllegalArgExceptionIfNull(replacement, "rep= lacement"); - - StringBuffer tmp =3D new StringBuffer(initial); - int prefixIndex =3D tmp.indexOf(prefix); - int suffixLength =3D suffix.length(); - int prefixLength =3D prefix.length(); - - while (prefixIndex !=3D -1) - { - int suffixIndex =3D tmp.indexOf(suffix, prefixIndex); - - if (suffixIndex !=3D -1) - { - // we don't care about empty bounded strings or prefix and suf= fix don't delimit an empty String =3D> replace! - if (replaceIfBoundedStringEmpty || suffixIndex !=3D prefixInde= x + prefixLength) - { - if (keepBoundaries) - { - tmp.delete(prefixIndex + prefixLength, suffixIndex); - tmp.insert(prefixIndex + prefixLength, replacement); - } - else - { - tmp.delete(prefixIndex, suffixIndex + suffixLength); - tmp.insert(prefixIndex, replacement); - } - } - } - - prefixIndex =3D tmp.indexOf(prefix, prefixIndex + prefixLength); - } - - return tmp.toString(); - } - - /** - * Determines if value is contained in array. - * - * todo: correct this method contract in order to make it more reusable= , it looks like for now like a method - * which has a contract convenient only for some kind of callers. - * - * 1/ null value should be accepted (or the method should be called isC= ontainedInButNotForNullValue ?) - * 2/ null array should not be accepted (or the method should be called= isContainedInExceptIfThePassedArrayIsNull ?) - * - * @param value - * @param array - * @return - * @since 2.4.2 - */ - public static boolean isContainedIn(Object value, Object[] array) - { - if (value =3D=3D null) - { - return false; - } - - // - if (array !=3D null) - { - for (Object anArray : array) - { - if (value.equals(anArray)) - { - return true; - } - } - } - return false; - } - - /** - * Attempt to cast the value argument to the provided type argument. If= the value argument type is assignable - * to the provided type, the value is returned, otherwise if it is not = or the value is null, null is returned. - * - * todo: Move that to common package. - * - * @param value the value to cast - * @param type the type to downcast - * @return the casted value or null - */ - public static T safeCast(Object value, Class type) - { - if (value =3D=3D null) - { - return null; - } - else - { - if (type.isAssignableFrom(value.getClass())) - { - return type.cast(value); - } - else - { - return null; - } - } - } - - public static MultiValuedPropertyMap emptyMultiValuedPropertyMap= () - { - return new MultiValuedPropertyMap() - { - public T getValue(String key) throws IllegalArgumentException - { - if (key =3D=3D null) - { - throw new IllegalArgumentException("Key cannot be null"); - } - return null; - } - - public List getValues(String key) throws IllegalArgumentExcept= ion - { - if (key =3D=3D null) - { - throw new IllegalArgumentException("Key cannot be null"); - } - return null; - } - - public void addValue(String key, T value) throws IllegalArgumentE= xception - { - throw new UnsupportedOperationException(); - } - - public void setValue(String key, T value) throws IllegalArgumentE= xception - { - throw new UnsupportedOperationException(); - } - - public Set keySet() - { - return Collections.emptySet(); - } - - public int size() - { - return 0; - } - - public void clear() - { - throw new UnsupportedOperationException(); - } - - public void append(MultiValuedPropertyMap appended) throws Ill= egalArgumentException - { - throw new UnsupportedOperationException(); - } - }; - } - -} \ No newline at end of file Modified: modules/test/trunk/test/src/main/java/org/jboss/portal/test/frame= work/common/io/IOTools.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/io/IOTools.java 2008-02-22 23:35:21 UTC (rev 10093) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/io/IOTools.java 2008-02-23 00:17:20 UTC (rev 10094) @@ -22,7 +22,6 @@ = package org.jboss.portal.test.framework.common.io; = -import org.jboss.portal.test.framework.common.Tools; import org.apache.log4j.Logger; = import java.lang.reflect.Method; @@ -32,16 +31,9 @@ import java.io.IOException; import java.io.InputStream; import java.io.Reader; -import java.io.ByteArrayOutputStream; import java.io.Writer; -import java.io.Serializable; -import java.io.ObjectOutputStream; -import java.io.ByteArrayInputStream; -import java.io.ObjectInputStream; -import java.io.BufferedInputStream; import java.io.BufferedOutputStream; -import java.io.DataOutputStream; -import java.util.Map; +import java.io.BufferedInputStream; = /** * IO tools. @@ -53,7 +45,7 @@ { = /** The logger. */ - public static final Logger log =3D Logger.getLogger(IOTools.class); + private static final Logger log =3D Logger.getLogger(IOTools.class); = /** . */ private static final Object[] EMPTY_ARGS =3D new Object[0]; @@ -205,241 +197,6 @@ } = /** - * @see #getBytes(java.io.InputStream, int) - * @param in the input stream - * @return the bytes read from the stream - * @throws java.io.IOException - * @throws IllegalArgumentException if the input stream is null - */ - public static byte[] getBytes(InputStream in) throws IOException, Illeg= alArgumentException - { - return getBytes(in, Tools.DEFAULT_BUFFER_SIZE); - } - - /** - * Get the bytes from the provided input stream. No attempt will be mad= e to close the stream. - * - * @param in the input stream - * @param bufferSize the buffer size used to copy the bytes - * @return the bytes read from the stream - * @throws java.io.IOException - * @throws IllegalArgumentException if the input stream is null or the = buffer size < 1 - */ - public static byte[] getBytes(InputStream in, int bufferSize) throws IO= Exception, IllegalArgumentException - { - ByteArrayOutputStream out =3D new ByteArrayOutputStream(); - copy(in, out, bufferSize); - return out.toByteArray(); - } - - /** - * @see #copy(java.io.InputStream, java.io.OutputStream, int) - * @param in the incoming stream - * @param out the outcoming stream - * @throws IllegalArgumentException if an argument is null - */ - public static void copy(InputStream in, OutputStream out) throws IOExce= ption - { - copy(in, out, Tools.DEFAULT_BUFFER_SIZE); - } - - /** - * Pipe an incoming stream in an outcoming stream until no bytes is ava= ilable from the input stream. - * No attempts will be made to close the streams. - * - * @param in the incoming stream - * @param out the outcoming stream - * @param bufferSize the buffer size - * @throws IllegalArgumentException if bufferSize < 1 or an argument is= null - */ - public static void copy(InputStream in, OutputStream out, int bufferSiz= e) throws IOException - { - // arguments check - if (in =3D=3D null) - { - throw new IllegalArgumentException("null in"); - } - if (out =3D=3D null) - { - throw new IllegalArgumentException("null out"); - } - if (bufferSize < 1) - { - throw new IllegalArgumentException("Buffer size is too small"); - } - - // do the job - byte[] buffer =3D new byte[bufferSize]; - while (true) - { - int i =3D in.read(buffer); - if (i =3D=3D 0) - { - continue; - } - if (i =3D=3D -1) - { - break; - } - out.write(buffer, 0, i); - } - } - - /** - * Pipe an input stream in an output stream. - * - * @param reader the incoming reader - * @param writer the outcoming writer - * @throws IllegalArgumentException if an argument is null - */ - public static void copy(Reader reader, Writer writer) throws IOException - { - copy(reader, writer, Tools.DEFAULT_BUFFER_SIZE); - } - - /** - * Pipe an incoming stream in an outcoming stream. - * - * @param reader the incoming reader - * @param writer the outcoming writer - * @param bufferSize the buffer size - * @throws IllegalArgumentException if bufferSize < 1 or an argument is= null - */ - public static void copy(Reader reader, Writer writer, int bufferSize) t= hrows IOException - { - // arguments check - if (reader =3D=3D null) - { - throw new IllegalArgumentException("null in"); - } - if (writer =3D=3D null) - { - throw new IllegalArgumentException("null out"); - } - if (bufferSize < 1) - { - throw new IllegalArgumentException("Buffer size is too small"); - } - - // do the job - char[] buffer =3D new char[bufferSize]; - while (true) - { - int i =3D reader.read(buffer); - if (i =3D=3D 0) - { - continue; - } - if (i =3D=3D -1) - { - break; - } - writer.write(buffer, 0, i); - } - } - - /** - * Clone an object implementing the Serializable interface. - * - * @param serializable - * @return - * @throws IllegalArgumentException if the serializable object is null - * @throws IOException - */ - public static S clone(S serializable) throws I= llegalArgumentException, IOException - { - if (serializable =3D=3D null) - { - throw new IllegalArgumentException("Cannot clone null"); - } - try - { - return (S)unserialize(serialize(serializable)); - } - catch (ClassNotFoundException e) - { - throw new Error("Got a class not found exception for a class that= was used", e); - } - } - - public static byte[] serialize(Serializable serializable) throws Illega= lArgumentException, IOException - { - if (serializable =3D=3D null) - { - throw new IllegalArgumentException("No null serializable accepted= "); - } - ByteArrayOutputStream baos =3D new ByteArrayOutputStream(); - ObjectOutputStream oos =3D new ObjectOutputStream(baos); - oos.writeObject(serializable); - oos.close(); - return baos.toByteArray(); - } - - public static Serializable unserialize(byte[] bytes) throws IllegalArgu= mentException, IOException, ClassNotFoundException - { - if (bytes =3D=3D null) - { - throw new IllegalArgumentException("No null serializable accepted= "); - } - ByteArrayInputStream bais =3D new ByteArrayInputStream(bytes); - ObjectInputStream ois =3D new ObjectInputStream(bais); - return (Serializable)ois.readObject(); - } - - public static byte[] serialize(Serialization serialization, T t) - { - return serialize(serialization, SerializationFilter.TRIVIAL, t); - } - - public static byte[] serialize(Serialization serialization, Seri= alizationFilter filter, T t) - { - if (serialization =3D=3D null) - { - throw new IllegalArgumentException(); - } - if (t =3D=3D null) - { - throw new IllegalArgumentException("No null object to serialize"); - } - try - { - ByteArrayOutputStream baos =3D new ByteArrayOutputStream(); - filter.serialize(serialization, t, baos); - return baos.toByteArray(); - } - catch (IOException e) - { - throw new UndeclaredIOException(e); - } - } - - public static T unserialize(Serialization serialization, byte[] = bytes) - { - return unserialize(serialization, SerializationFilter.TRIVIAL, bytes= ); - } - - public static T unserialize(Serialization serialization, Seriali= zationFilter filter, byte[] bytes) - { - if (serialization =3D=3D null) - { - throw new IllegalArgumentException(); - } - if (bytes =3D=3D null) - { - throw new IllegalArgumentException("No null bytes to unserialize"= ); - } - try - { - ByteArrayInputStream bais =3D new ByteArrayInputStream(bytes); - return filter.unserialize(serialization, bais); - } - catch (IOException e) - { - throw new UndeclaredIOException(e); - } - } - - /** * Check that the provided input stream is buffered. If the argument is= already an instance of BufferedInputStream * no operation will be performed, otherwise a instance of Buffer= edInputStream will be created and returned. * Deleted: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framew= ork/common/io/Serialization.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/io/Serialization.java 2008-02-22 23:35:21 UTC (rev 10093) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/io/Serialization.java 2008-02-23 00:17:20 UTC (rev 10094) @@ -1,121 +0,0 @@ -/* -* 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.framework.common.io; - -import java.io.DataOutputStream; -import java.io.IOException; -import java.io.DataInputStream; -import java.io.OutputStream; -import java.io.InputStream; -import java.util.Map; -import java.util.HashMap; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public interface Serialization -{ - - Serialization> PARAMETER_MAP =3D new Serializatio= n>() - { - public void serialize(Map map, OutputStream out) t= hrows IOException, IllegalArgumentException - { - if (map =3D=3D null) - { - throw new IllegalArgumentException("No null map allowed"); - } - - // - DataOutputStream data =3D out instanceof DataOutputStream ? (Data= OutputStream)out : new DataOutputStream(out); - - // - data.writeInt(map.size()); - - // - for (Map.Entry entry : map.entrySet()) - { - String name =3D (String)entry.getKey(); - data.writeUTF(name); - - // - String[] values =3D (String[])entry.getValue(); - if (values =3D=3D null) - { - throw new IllegalArgumentException("No null values are allo= wed in the map"); - } - - // - int length =3D values.length; - data.writeInt(length); - - // - for (String value : values) - { - if (value =3D=3D null) - { - throw new IllegalArgumentException("No null value in the= String[] are allowed in the map"); - } - data.writeUTF(value); - } - } - - // - data.flush(); - } - - public Map unserialize(InputStream in) throws IOEx= ception - { - if (in =3D=3D null) - { - throw new IllegalArgumentException("No null input stream"); - } - - // - DataInputStream data =3D in instanceof DataInputStream ? (DataInp= utStream)in : new DataInputStream(in); - - // - int size =3D data.readInt(); - Map tmp =3D new HashMap(size); - while (size-- > 0) - { - String name =3D data.readUTF(); - int length =3D data.readInt(); - String[] values =3D new String[length]; - for (int i =3D 0;i < length;i++) - { - values[i] =3D data.readUTF(); - } - tmp.put(name, values); - } - - // - return tmp; - } - }; - - public abstract void serialize(T t, OutputStream out) throws IOExceptio= n, IllegalArgumentException; - - public abstract T unserialize(InputStream in) throws IOException, Illeg= alArgumentException; - -} Deleted: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framew= ork/common/io/SerializationFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/io/SerializationFilter.java 2008-02-22 23:35:21 UTC (rev 10093) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/io/SerializationFilter.java 2008-02-23 00:17:20 UTC (rev 10094) @@ -1,77 +0,0 @@ -/* -* 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.framework.common.io; - -import java.io.OutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.zip.GZIPOutputStream; -import java.util.zip.GZIPInputStream; - -/** - * Filters a stream for serialize/unserialize operations. - * - * @author Julien Viet - * @version $Revision: 630 $ - */ -public interface SerializationFilter -{ - - SerializationFilter TRIVIAL =3D new SerializationFilter() - { - public void serialize(Serialization serialization, T t, Outpu= tStream out) throws IllegalArgumentException, IOException - { - serialization.serialize(t, out); - } - - public T unserialize(Serialization serialization, InputStream= in) throws IllegalArgumentException, IOException - { - return serialization.unserialize(in); - } - }; - - /** - * Use GZIP streams. - */ - SerializationFilter COMPRESSOR =3D new SerializationFilter() - { - public void serialize(Serialization serialization, T t, Outpu= tStream out) throws IllegalArgumentException, IOException - { - GZIPOutputStream zos =3D new GZIPOutputStream(out); - serialization.serialize(t, zos); - zos.finish(); - } - - public T unserialize(Serialization serialization, InputStream= in) throws IllegalArgumentException, IOException - { - GZIPInputStream zis =3D new GZIPInputStream(in); - return serialization.unserialize(zis); - } - }; - - void serialize(Serialization serialization, T t, OutputStream ou= t) throws IllegalArgumentException, IOException; - - T unserialize(Serialization serialization, InputStream in) throw= s IllegalArgumentException, IOException; - -} - Deleted: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framew= ork/common/io/UndeclaredIOException.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/io/UndeclaredIOException.java 2008-02-22 23:35:21 UTC (rev 10093) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/io/UndeclaredIOException.java 2008-02-23 00:17:20 UTC (rev 10094) @@ -1,45 +0,0 @@ -/* -* 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.framework.common.io; - -import java.io.IOException; -import java.lang.reflect.UndeclaredThrowableException; - -/** - * Avoid a method to declare an IOException in its signature when it is no= t necessary. - * - * @author Julien Viet - * @version $Revision: 7228 $ - */ -public class UndeclaredIOException extends UndeclaredThrowableException -{ - public UndeclaredIOException(IOException undeclaredIOException) - { - super(undeclaredIOException); - } - - public UndeclaredIOException(IOException undeclaredIOException, String = s) - { - super(undeclaredIOException, s); - } -} \ No newline at end of file Added: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framewor= k/common/xml/NoSuchElementException.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/xml/NoSuchElementException.java (rev 0) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/xml/NoSuchElementException.java 2008-02-23 00:17:20 UTC (rev 10094) @@ -0,0 +1,49 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.test.framework.common.xml; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class NoSuchElementException extends RuntimeException +{ + public NoSuchElementException() + { + } + + public NoSuchElementException(String message) + { + super(message); + } + + public NoSuchElementException(String message, Throwable cause) + { + super(message, cause); + } + + public NoSuchElementException(Throwable cause) + { + super(cause); + } +} Modified: modules/test/trunk/test/src/main/java/org/jboss/portal/test/frame= work/common/xml/XMLTools.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/xml/XMLTools.java 2008-02-22 23:35:21 UTC (rev 10093) +++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/c= ommon/xml/XMLTools.java 2008-02-23 00:17:20 UTC (rev 10094) @@ -48,7 +48,6 @@ import java.util.Iterator; import java.util.List; import java.util.Properties; -import java.util.NoSuchElementException; = /** * Utilities for dealing with XML. Modified: modules/test/trunk/tooling/ant/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/tooling/ant/pom.xml 2008-02-22 23:35:21 UTC (rev 100= 93) +++ modules/test/trunk/tooling/ant/pom.xml 2008-02-23 00:17:20 UTC (rev 100= 94) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0.Beta2 + 1.2.0.SNAPSHOT ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/tooling/core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/tooling/core/pom.xml 2008-02-22 23:35:21 UTC (rev 10= 093) +++ modules/test/trunk/tooling/core/pom.xml 2008-02-23 00:17:20 UTC (rev 10= 094) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0.Beta2 + 1.2.0.SNAPSHOT ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/tooling/examples/maven2/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/tooling/examples/maven2/pom.xml 2008-02-22 23:35:21 = UTC (rev 10093) +++ modules/test/trunk/tooling/examples/maven2/pom.xml 2008-02-23 00:17:20 = UTC (rev 10094) @@ -11,7 +11,7 @@ org.jboss.unit jboss-unit - 1.2.0.Beta2 + 1.2.0.SNAPSHOT
        = @@ -39,7 +39,7 @@ org.jboss.unit jboss-unit-tooling-maven2 - 1.2.0.Beta2 + 1.2.0.SNAPSHOT test Modified: modules/test/trunk/tooling/maven2/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/tooling/maven2/pom.xml 2008-02-22 23:35:21 UTC (rev = 10093) +++ modules/test/trunk/tooling/maven2/pom.xml 2008-02-23 00:17:20 UTC (rev = 10094) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0.Beta2 + 1.2.0.SNAPSHOT ../../build/pom.xml 4.0.0 Modified: modules/test/trunk/tooling/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/tooling/pom.xml 2008-02-22 23:35:21 UTC (rev 10093) +++ modules/test/trunk/tooling/pom.xml 2008-02-23 00:17:20 UTC (rev 10094) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0.Beta2 + 1.2.0.SNAPSHOT ../build/pom.xml 4.0.0 @@ -11,7 +11,7 @@ jboss-unit-tooling-aggregator pom JBoss Unit Tooling (aggregator) - 1.2.0.Beta2 + 1.2.0.SNAPSHOT core ant Modified: modules/test/trunk/unit/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/unit/pom.xml 2008-02-22 23:35:21 UTC (rev 10093) +++ modules/test/trunk/unit/pom.xml 2008-02-23 00:17:20 UTC (rev 10094) @@ -3,7 +3,7 @@ org.jboss.unit module-parent - 1.2.0.Beta2 + 1.2.0.SNAPSHOT ../build/pom.xml 4.0.0 --===============3201510116174800596==-- From portal-commits at lists.jboss.org Sun Feb 24 11:53:48 2008 Content-Type: multipart/mixed; boundary="===============5473253454557527247==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10095 - in modules/common/trunk: common and 3 other directories. Date: Sun, 24 Feb 2008 11:53:47 -0500 Message-ID: --===============5473253454557527247== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-24 11:53:47 -0500 (Sun, 24 Feb 2008) New Revision: 10095 Modified: modules/common/trunk/build/pom.xml modules/common/trunk/common/pom.xml modules/common/trunk/common/src/main/java/org/jboss/portal/common/i18n/C= achingLocaleFormat.java modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/V= alveTestCase.java modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/i= o/IOToolsTestCase.java Log: JBPORTAL-1923 : Replace oswego by java.util.concurrent Modified: modules/common/trunk/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/build/pom.xml 2008-02-23 00:17:20 UTC (rev 10094) +++ modules/common/trunk/build/pom.xml 2008-02-24 16:53:47 UTC (rev 10095) @@ -15,12 +15,10 @@ = 1.1 - 1.3.4 2.4 4.2.0.GA 4.2.0.GA 4.2.0.GA - 2.1.0.GA 2.2.0.GA 1.2.14 3.0.1 @@ -71,12 +69,6 @@ = - oswego-concurrent - concurrent - ${version.concurrent} - - - javax.activation activation ${version.activation} @@ -119,12 +111,6 @@ = - jboss - jboss-backport-concurrent - ${version.jboss-backport-concurrent} - - - javax.servlet servlet-api ${version.javax.servlet} Modified: modules/common/trunk/common/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/pom.xml 2008-02-23 00:17:20 UTC (rev 10094) +++ modules/common/trunk/common/pom.xml 2008-02-24 16:53:47 UTC (rev 10095) @@ -19,11 +19,6 @@ = - oswego-concurrent - concurrent - - - javax.activation activation @@ -59,11 +54,6 @@ = - jboss - jboss-backport-concurrent - - - javax.servlet servlet-api Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common= /i18n/CachingLocaleFormat.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/src/main/java/org/jboss/portal/common/i18n/= CachingLocaleFormat.java 2008-02-23 00:17:20 UTC (rev 10094) +++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/i18n/= CachingLocaleFormat.java 2008-02-24 16:53:47 UTC (rev 10095) @@ -22,12 +22,12 @@ *************************************************************************= *****/ package org.jboss.portal.common.i18n; = -import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap; import org.jboss.portal.common.util.ConversionException; import org.jboss.portal.common.text.CharWriter; = import java.io.IOException; import java.util.Locale; +import java.util.concurrent.ConcurrentHashMap; = /** * @author Julien Viet @@ -40,10 +40,10 @@ private final LocaleFormat delegate; = /** . */ - private final ConcurrentHashMap localeCache; + private final ConcurrentHashMap localeCache; = /** . */ - private final ConcurrentHashMap stringCache; + private final ConcurrentHashMap stringCache; = /** * @param delegate the delegate when the cache value has not been found @@ -56,13 +56,13 @@ throw new IllegalArgumentException("No null delegate is possible"= ); } this.delegate =3D delegate; - this.localeCache =3D new ConcurrentHashMap(); - this.stringCache =3D new ConcurrentHashMap(); + this.localeCache =3D new ConcurrentHashMap(); + this.stringCache =3D new ConcurrentHashMap(); } = public Locale getLocale(String value) throws ConversionException { - Locale locale =3D (Locale)localeCache.get(value); + Locale locale =3D localeCache.get(value); = // if (locale !=3D null) @@ -81,7 +81,7 @@ = public String toString(Locale locale) throws ConversionException { - String string =3D (String)stringCache.get(locale); + String string =3D stringCache.get(locale); = // if (string !=3D null) Modified: modules/common/trunk/common/src/test/java/org/jboss/portal/test/c= ommon/ValveTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/= ValveTestCase.java 2008-02-23 00:17:20 UTC (rev 10094) +++ modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/= ValveTestCase.java 2008-02-24 16:53:47 UTC (rev 10095) @@ -23,13 +23,13 @@ package org.jboss.portal.test.common; = import java.io.PrintStream; +import java.util.concurrent.CyclicBarrier; +import java.util.concurrent.BrokenBarrierException; = import junit.framework.TestCase; = import org.jboss.portal.common.concurrent.Valve; = -import EDU.oswego.cs.dl.util.concurrent.CyclicBarrier; - /** * @author Julien Viet * @version $Revision: 5451 $ @@ -135,11 +135,15 @@ assertTrue(valve.beforeInvocation()); = // The valve is enterred - barrier.barrier(); + barrier.await(); = // Wait - barrier.barrier(); + barrier.await(); } + catch (BrokenBarrierException e) + { + fail("" + e.getMessage()); + } catch (InterruptedException ignore) { } @@ -149,8 +153,12 @@ try { // Tell the other thread we have finished - barrier.barrier(); + barrier.await(); } + catch (BrokenBarrierException e) + { + fail("" + e.getMessage()); + } catch (InterruptedException ignore) { } @@ -163,7 +171,7 @@ thread.start(); = // Wait until the thread called beforeInvocation - barrier.barrier(); + barrier.await(); = // Attemtp to close assertFalse(valve.closing(100)); @@ -172,10 +180,10 @@ assertEquals(Valve.CLOSING, valve.getState()); = // Ask the invoker thread to finish - barrier.barrier(); + barrier.await(); = // Wait until invocation is finished - barrier.barrier(); + barrier.await(); = // Close, no thread are inside valve.closing(); Modified: modules/common/trunk/common/src/test/java/org/jboss/portal/test/c= ommon/io/IOToolsTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/= io/IOToolsTestCase.java 2008-02-23 00:17:20 UTC (rev 10094) +++ modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/= io/IOToolsTestCase.java 2008-02-24 16:53:47 UTC (rev 10095) @@ -36,9 +36,8 @@ import java.io.CharArrayWriter; import java.io.CharArrayReader; import java.util.Random; +import java.util.concurrent.atomic.AtomicBoolean; = -import EDU.oswego.cs.dl.util.concurrent.SynchronizedBoolean; - /** * todo: *
          @@ -215,7 +214,7 @@ public void testOutputStreamSafeClose() { IOTools.safeClose((OutputStream)null); - final SynchronizedBoolean called =3D new SynchronizedBoolean(false); + final AtomicBoolean called =3D new AtomicBoolean(false); IOTools.safeClose(new AbstractOutputStream() { public void close() throws IOException @@ -275,7 +274,7 @@ public void testInputStreamSafeClose() { IOTools.safeClose((InputStream)null); - final SynchronizedBoolean called =3D new SynchronizedBoolean(false); + final AtomicBoolean called =3D new AtomicBoolean(false); IOTools.safeClose(new AbstractInputStream() { public void close() throws IOException @@ -336,7 +335,7 @@ public void testReaderSafeClose() { IOTools.safeClose((Reader)null); - final SynchronizedBoolean called =3D new SynchronizedBoolean(false); + final AtomicBoolean called =3D new AtomicBoolean(false); IOTools.safeClose(new AbstractReader() { public void close() throws IOException @@ -397,7 +396,7 @@ public void testWriterSafeClose() { IOTools.safeClose((Writer)null); - final SynchronizedBoolean called =3D new SynchronizedBoolean(false); + final AtomicBoolean called =3D new AtomicBoolean(false); IOTools.safeClose(new AbstractWriter() { public void close() throws IOException @@ -479,7 +478,7 @@ } = // - final SynchronizedBoolean closeCalled1 =3D new SynchronizedBoolean(f= alse); + final AtomicBoolean closeCalled1 =3D new AtomicBoolean(false); final IOException ioException1 =3D new IOException(); try { @@ -503,7 +502,7 @@ } = // - final SynchronizedBoolean closeCalled2 =3D new SynchronizedBoolean(f= alse); + final AtomicBoolean closeCalled2 =3D new AtomicBoolean(false); IOTools.copy(new AbstractInputStream() { public int read() throws IOException @@ -519,7 +518,7 @@ = // final IOException ioException2 =3D new IOException(); - final SynchronizedBoolean closeCalled3 =3D new SynchronizedBoolean(f= alse); + final AtomicBoolean closeCalled3 =3D new AtomicBoolean(false); try { IOTools.copy(new ByteArrayInputStream(new byte[1]), new AbstractO= utputStream() @@ -541,7 +540,7 @@ } = // - final SynchronizedBoolean closeCalled4 =3D new SynchronizedBoolean(f= alse); + final AtomicBoolean closeCalled4 =3D new AtomicBoolean(false); IOTools.copy(new ByteArrayInputStream(new byte[1]), new AbstractOutp= utStream() { public void close() throws IOException @@ -581,7 +580,7 @@ } = // - final SynchronizedBoolean closeCalled1 =3D new SynchronizedBoolean(f= alse); + final AtomicBoolean closeCalled1 =3D new AtomicBoolean(false); final IOException ioException1 =3D new IOException(); try { @@ -605,7 +604,7 @@ } = // - final SynchronizedBoolean closeCalled2 =3D new SynchronizedBoolean(f= alse); + final AtomicBoolean closeCalled2 =3D new AtomicBoolean(false); IOTools.copy(new AbstractReader() { public int read(char cbuf[], int off, int len) throws IOException @@ -621,7 +620,7 @@ = // final IOException ioException2 =3D new IOException(); - final SynchronizedBoolean closeCalled3 =3D new SynchronizedBoolean(f= alse); + final AtomicBoolean closeCalled3 =3D new AtomicBoolean(false); try { IOTools.copy(new CharArrayReader(new char[1]), new AbstractWriter= () @@ -643,7 +642,7 @@ } = // - final SynchronizedBoolean closeCalled4 =3D new SynchronizedBoolean(f= alse); + final AtomicBoolean closeCalled4 =3D new AtomicBoolean(false); IOTools.copy(new CharArrayReader(new char[1]), new AbstractWriter() { public void close() throws IOException --===============5473253454557527247==-- From portal-commits at lists.jboss.org Sun Feb 24 12:22:52 2008 Content-Type: multipart/mixed; boundary="===============4326613887832091069==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10096 - modules/common/trunk/common/src/main/java/org/jboss/portal/common/junit. Date: Sun, 24 Feb 2008 12:22:52 -0500 Message-ID: --===============4326613887832091069== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-24 12:22:51 -0500 (Sun, 24 Feb 2008) New Revision: 10096 Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common/junit/= ExtendedAssert.java Log: better log of byte array comparison failure Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common= /junit/ExtendedAssert.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/common/trunk/common/src/main/java/org/jboss/portal/common/junit= /ExtendedAssert.java 2008-02-24 16:53:47 UTC (rev 10095) +++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/junit= /ExtendedAssert.java 2008-02-24 17:22:51 UTC (rev 10096) @@ -81,9 +81,35 @@ { return; } - fail(format(message, expected, actual)); + + // + fail(format(message, toString(expected), toString(actual))); } = + private static String toString(byte[] expected) + { + StringBuffer expectedBuffer =3D new StringBuffer("["); + + // + for (byte expectedByte : expected) + { + expectedBuffer.append(expectedByte).append(','); + } + + // + if (expectedBuffer.length() =3D=3D 1) + { + expectedBuffer.append(']'); + } + else + { + expectedBuffer.setCharAt(expectedBuffer.length(), ']'); + } + + // + return expectedBuffer.toString(); + } + private static String format(String message, Object expected, Object ac= tual) { String formatted =3D ""; --===============4326613887832091069==-- From portal-commits at lists.jboss.org Sun Feb 24 12:54:03 2008 Content-Type: multipart/mixed; boundary="===============7229952718508679596==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10097 - in modules/web/trunk: web and 1 other directory. Date: Sun, 24 Feb 2008 12:54:01 -0500 Message-ID: --===============7229952718508679596== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-24 12:54:00 -0500 (Sun, 24 Feb 2008) New Revision: 10097 Modified: modules/web/trunk/build/pom.xml modules/web/trunk/web/pom.xml Log: - update to use JBoss Unit 1.2 Beta 2 - trim down pom to remove dependencies resolved transitively Modified: modules/web/trunk/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/build/pom.xml 2008-02-24 17:22:51 UTC (rev 10096) +++ modules/web/trunk/build/pom.xml 2008-02-24 17:54:00 UTC (rev 10097) @@ -25,27 +25,19 @@ JBoss Portal Web Module = - 1.0.2 1.3.4 2.4 5.5.12 - 2.2.1.GA 2.0.3.GA - 2.0.0.Beta6 - 2.0.0.CR1 - 2.0.0.CR3 - 3.6-beta 2.2.1.GA 1.2.0-Beta1 - 1.2.0-SNAPSHOT + 1.2.0.Beta2 1.2.14 1.1.1 3.0.1 - 2.1.1 2.0.0.Beta9 0.9-portal 3.8.1 - 2.7.1 1.7.0 = @@ -98,11 +90,6 @@ ${version.jboss.portal.common} - org.jboss - javassist - ${version.javassist} - - sun-servlet servlet-api ${version.sun.servlet} @@ -154,22 +141,7 @@ ${version.jboss.unit} - trove - trove - ${version.trove} - - - apache-xerces - resolver - ${version.xerces} - - jboss - jbossxb - ${version.jbossxb} - - - jboss jboss-logging-jdk ${version.jboss-logging} @@ -184,11 +156,6 @@ ${version.jboss-remoting} - org.jboss - jboss-vfs - ${version.jboss-vfs} - - org.jboss.microcontainer jboss-aop-mc-int ${version.jboss.microcontainer} @@ -269,46 +236,6 @@ ${version.jboss.microcontainer} - org.jboss.aop - jboss-aop - ${version.jboss.aop} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - commons-logging commons-logging ${version.apache.commons-logging} Modified: modules/web/trunk/web/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/web/pom.xml 2008-02-24 17:22:51 UTC (rev 10096) +++ modules/web/trunk/web/pom.xml 2008-02-24 17:54:00 UTC (rev 10097) @@ -44,11 +44,6 @@ test - org.jboss - javassist - test - - org.jboss.unit jboss-unit test @@ -79,22 +74,7 @@ test - trove - trove - test - - - apache-xerces - resolver - test - - jboss - jbossxb - test - - - jboss jboss-logging-jdk test @@ -108,11 +88,6 @@ jboss-remoting - org.jboss - jboss-vfs - test - - org.jboss.microcontainer jboss-aop-mc-int test @@ -193,46 +168,6 @@ test - org.jboss.aop - jboss-aop - test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - commons-logging commons-logging test @@ -248,16 +183,6 @@ war test - - - - - - - - - - = @@ -325,19 +250,12 @@ - - - - - - - - + --===============7229952718508679596==-- From portal-commits at lists.jboss.org Sun Feb 24 13:29:53 2008 Content-Type: multipart/mixed; boundary="===============1131525748804158073==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10098 - in modules/portlet/trunk: controller and 1 other directories. Date: Sun, 24 Feb 2008 13:29:52 -0500 Message-ID: --===============1131525748804158073== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-24 13:29:52 -0500 (Sun, 24 Feb 2008) New Revision: 10098 Modified: modules/portlet/trunk/build/pom.xml modules/portlet/trunk/controller/pom.xml modules/portlet/trunk/test/pom.xml Log: - remove unnecessary dependencies Modified: modules/portlet/trunk/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/build/pom.xml 2008-02-24 17:54:00 UTC (rev 10097) +++ modules/portlet/trunk/build/pom.xml 2008-02-24 18:29:52 UTC (rev 10098) @@ -26,17 +26,12 @@ 1.0.3 1.1.2 - 1.0.2 1.3.4 2.5 2.1 5.5.12 - 2.2.1.GA 2.0.3.GA - 2.0.0.Beta6 - 2.0.0.beta1 2.0.0.CR5 - 3.6-beta 2.2.1.GA 1.2.0-Beta1 1.2.0-SNAPSHOT @@ -44,11 +39,9 @@ 1.2.14 1.1.1 3.0.1 - 2.1.1 2.0.0.Beta9 0.9-portal 3.8.1 - 2.7.1 1.7.0 2.1.4 2.0-Draft32 @@ -151,11 +144,6 @@ ${version.sun-jaxb} = - - - - - org.jboss.portal.common common-common @@ -177,11 +165,6 @@ ${version.jboss.portal.web} - org.jboss - javassist - ${version.javassist} - - javax.servlet servlet-api ${version.javax.servlet} @@ -191,11 +174,6 @@ jsp-api ${version.javax.servlet.jsp} - - - - - = concurrent @@ -238,16 +216,6 @@ ${version.jboss.unit} - trove - trove - ${version.trove} - - - apache-xerces - resolver - ${version.xerces} - - org.jboss jbossxb ${version.jbossxb} @@ -268,11 +236,6 @@ ${version.jboss-remoting} - org.jboss - jboss-vfs - ${version.jboss-vfs} - - org.jboss.microcontainer jboss-aop-mc-int ${version.jboss.microcontainer} @@ -353,46 +316,6 @@ ${version.jboss.microcontainer} - org.jboss.aop - jboss-aop - ${version.jboss.aop} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - commons-logging commons-logging ${version.apache.commons-logging} Modified: modules/portlet/trunk/controller/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/pom.xml 2008-02-24 17:54:00 UTC (rev 1= 0097) +++ modules/portlet/trunk/controller/pom.xml 2008-02-24 18:29:52 UTC (rev 1= 0098) @@ -37,163 +37,6 @@ = - = Modified: modules/portlet/trunk/portlet/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/pom.xml 2008-02-25 05:13:33 UTC (rev 1010= 3) +++ modules/portlet/trunk/portlet/pom.xml 2008-02-25 09:35:22 UTC (rev 1010= 4) @@ -40,14 +40,6 @@ jaxb-api = - - - - - - - - org.jboss.unit @@ -56,8 +48,123 @@ = + + + + + + default + + true + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + testCompile + + + + + + org/jboss/portal/unit/reports/* + + + + + + + + + apt + + + + org.apache.myfaces.tobago + maven-apt-plugin + + + package + + org.jboss.portal.unit.reports.TestCase= APF + true + 1.5 + true + true + + + testExecute + + + + + + + + + sun.jdk + tools + 1.5.0 + system + ${java.home}/../lib/tools.jar + + + + + + + apt-mac + + + + org.apache.myfaces.tobago + maven-apt-plugin + + + package + + org.jboss.portal.unit.reports.TestCase= APF + true + 1.5 + true + true + + + testExecute + + + + + + + + + + + + + + + + + + + + + + + + + + + + org.apache.maven.plugins maven-jar-plugin Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/re= ports/ResultProducingListener.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/repor= ts/ResultProducingListener.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/repor= ts/ResultProducingListener.java 2008-02-25 09:35:22 UTC (rev 10104) @@ -0,0 +1,107 @@ +/* +* 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.unit.reports; + +import com.sun.mirror.apt.RoundCompleteListener; +import com.sun.mirror.apt.RoundCompleteEvent; + +import java.io.File; +import java.io.Writer; +import java.io.FileWriter; +import java.util.Set; +import java.util.Map; +import java.util.Collections; +import java.util.SortedSet; +import java.util.List; +import java.util.LinkedList; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +public class ResultProducingListener implements RoundCompleteListener +{ + public static String jsr168File =3D "./target/apt-jsr168-testcases.csv"; + + public static int jsr168Max =3D 179; + + public static String jsr286File =3D "./target/apt-jsr286-testcases.csv"; + + public static int jsr286Max =3D 350; + + public void roundComplete(RoundCompleteEvent event) + { + if (event.getRoundState().finalRound()) + { + System.out.println("#END"); + + + try + { + if (!TestCaseAnnotationProcessor.jsr168Assertions.keySet().isE= mpty()) + { + print(TestCaseAnnotationProcessor.jsr168Assertions, jsr168F= ile, "JSR168_", jsr168Max); + } + + if (!TestCaseAnnotationProcessor.jsr286Assertions.keySet().isE= mpty()) + { + print(TestCaseAnnotationProcessor.jsr286Assertions, jsr286F= ile, "JSR286_", jsr286Max); + } + } + catch (Exception e) + { + e.printStackTrace(); //To change body of catch statement use = File | Settings | File Templates. + } + + + } + } + + private void print(Map> map, String fileName, Strin= g pre, int max) throws Exception + { + + File f =3D new File(fileName); + = + Writer writer =3D new FileWriter(f, false); + = + for (int i =3D 1; i <=3D max; i++) + { + String assertion =3D pre + i; + + writer.write(assertion + ",\n"); + + Set testCases =3D map.get(assertion); + + if (testCases !=3D null) + { + for (String testCase : testCases) + { + writer.write(" ," + testCase + "\n"); + } + } + } + + writer.close(); + + } +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/re= ports/TestCaseAPF.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/repor= ts/TestCaseAPF.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/repor= ts/TestCaseAPF.java 2008-02-25 09:35:22 UTC (rev 10104) @@ -0,0 +1,68 @@ +/* +* 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.unit.reports; + +import com.sun.mirror.apt.AnnotationProcessorFactory; +import com.sun.mirror.apt.AnnotationProcessor; +import com.sun.mirror.apt.AnnotationProcessorEnvironment; +import com.sun.mirror.apt.AnnotationProcessors; +import com.sun.mirror.declaration.AnnotationTypeDeclaration; + +import java.util.Collection; +import java.util.Set; +import java.util.Collections; +import java.io.File; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +public class TestCaseAPF implements AnnotationProcessorFactory +{ + public Collection supportedOptions() + { + return Collections.emptyList(); + } + + public Collection supportedAnnotationTypes() + { + return Collections.singletonList("org.jboss.portal.unit.annotations.= TestCase"); + } + + public AnnotationProcessor getProcessorFor(Set annotationTypeDeclarations, AnnotationProcessorEnvironment annotationPro= cessorEnvironment) + { + AnnotationProcessor result; + if(annotationTypeDeclarations.isEmpty()) { + result =3D AnnotationProcessors.NO_OP; + } + else { + // Next Step - implement this class: + result =3D new TestCaseAnnotationProcessor(annotationProcessorEnv= ironment); + annotationProcessorEnvironment.addListener(new ResultProducingLis= tener()); + } + return result; + + } + + +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/re= ports/TestCaseAnnotationProcessor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/repor= ts/TestCaseAnnotationProcessor.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/repor= ts/TestCaseAnnotationProcessor.java 2008-02-25 09:35:22 UTC (rev 10104) @@ -0,0 +1,173 @@ +/* +* 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.unit.reports; + +import com.sun.mirror.apt.AnnotationProcessor; +import com.sun.mirror.apt.AnnotationProcessorEnvironment; +import com.sun.mirror.declaration.AnnotationTypeDeclaration; +import com.sun.mirror.declaration.Declaration; +import com.sun.mirror.declaration.AnnotationMirror; +import com.sun.mirror.declaration.AnnotationTypeElementDeclaration; +import com.sun.mirror.declaration.AnnotationValue; +import com.sun.mirror.declaration.EnumConstantDeclaration; +import com.sun.mirror.util.SourcePosition; +import com.sun.tools.apt.mirror.declaration.AnnotationValueImpl; + +import java.util.Collection; +import java.util.Map; +import java.util.List; +import java.util.Iterator; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.io.File; +import java.io.OutputStream; +import java.io.FileOutputStream; +import java.io.PrintStream; +import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; + +import org.jboss.portal.unit.Assertion; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +public class TestCaseAnnotationProcessor implements AnnotationProcessor +{ + + private AnnotationProcessorEnvironment environment; + + private AnnotationTypeDeclaration testCaseDeclaration; + + + + public static String jsr168Pre =3D "org.jboss.portal.test.portlet.jsr16= 8"; + + public static String jsr286Pre =3D "org.jboss.portal.test.portlet.jsr28= 6"; + + public static String jsr168AssertionPre =3D "JSR168"; + + public static String jsr286AssertionPre =3D "JSR286"; + + + public static Map> jsr168Assertions =3D new HashMap= >(); + + public static Map> jsr286Assertions =3D new HashMap= >(); + + //private int counter; + + public TestCaseAnnotationProcessor(AnnotationProcessorEnvironment env) { + + environment =3D env; + testCaseDeclaration =3D (AnnotationTypeDeclaration) environment + .getTypeDeclaration("org.jboss.portal.unit.annotations.TestCase"); + } + + public void process() + { + Collection declarations =3D environment + .getDeclarationsAnnotatedWith(testCaseDeclaration); + for (Declaration declaration : declarations) { + processAnnotations(declaration); + } + } + + private void processAnnotations(Declaration declaration) { + // Get all of the annotation usage for this declaration. + // the annotation mirror is a reflection of what is in the source. + + Collection annotations =3D declaration + .getAnnotationMirrors(); + // iterate over the mirrors. + for (AnnotationMirror mirror : annotations) { + // if the mirror in this iteration is for our note declaration= ... + + System.out.println("#Annotation processing... " + mirror.getAn= notationType().getDeclaration().toString()); + + if(mirror.getAnnotationType().getDeclaration().equals( + testCaseDeclaration)) { + + + // print out the goodies. + Map valu= es =3D mirror + .getElementValues(); + + for (Map.Entry entry : values + .entrySet()) { + + Collection annotationValues =3D (Collec= tion)entry.getValue().getValue(); + + for (AnnotationValue value : annotationValues) + { + + String tck =3D value.toString(); + + String[] parts =3D tck.split("\\."); + + tck =3D parts[parts.length - 1]; + + Map> am =3D null; + + if (tck.startsWith(jsr168AssertionPre)) + { + am =3D jsr168Assertions; + } + else if (tck.startsWith(jsr286AssertionPre)) + { + am =3D jsr286Assertions; + } + else + { + continue; + } + + + addAssertion(am, tck, declaration.toString()); + + System.out.println("#TCK: " + tck ); + = + } + } + } + } + + + } + + private void addAssertion(Map> map, String assertio= n, String testCase) + { + if (map.get(assertion) !=3D null) + { + Set set =3D map.get(assertion); + set.add(testCase); + } + else + { + Set set =3D new HashSet(); + set.add(testCase); + map.put(assertion, set); + } + } +} --===============0633891754472213605==-- From portal-commits at lists.jboss.org Mon Feb 25 05:16:12 2008 Content-Type: multipart/mixed; boundary="===============3691583906734666613==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10105 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/metadata/factory. Date: Mon, 25 Feb 2008 05:16:10 -0500 Message-ID: --===============3691583906734666613== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: emuckenhuber Date: 2008-02-25 05:16:10 -0500 (Mon, 25 Feb 2008) New Revision: 10105 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/m= etadata/factory/PortletApplicationModelFactory.java Log: fix IOBE Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/metadata/factory/PortletApplicationModelFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= metadata/factory/PortletApplicationModelFactory.java 2008-02-25 09:35:22 UT= C (rev 10104) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= metadata/factory/PortletApplicationModelFactory.java 2008-02-25 10:16:10 UT= C (rev 10105) @@ -752,7 +752,8 @@ } else if ("lifecycle".equals(localName)) { - String lifeCycle =3D value.substring(0, value.length() - "_PHA= SE".length()); + int end =3D value.length() - "_PHASE".length(); + String lifeCycle =3D value.substring(0, end > 0 ? end : 0); try { md.addLifecycle(LifeCyclePhase.valueOf(lifeCycle)); --===============3691583906734666613==-- From portal-commits at lists.jboss.org Mon Feb 25 07:34:33 2008 Content-Type: multipart/mixed; boundary="===============3615568026020846655==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10106 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api and 14 other directories. Date: Mon, 25 Feb 2008 07:32:25 -0500 Message-ID: --===============3615568026020846655== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-25 07:32:25 -0500 (Mon, 25 Feb 2008) New Revision: 10106 Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/URL= Format.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/api/portleturl/ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/api/portleturl/EscapeXMLTestCase.java modules/portlet/trunk/test/src/test/resources/jsr286/api/portleturl-war/ modules/portlet/trunk/test/src/test/resources/jsr286/api/portleturl-war/= WEB-INF/ modules/portlet/trunk/test/src/test/resources/jsr286/api/portleturl-war/= WEB-INF/portlet.xml modules/portlet/trunk/test/src/test/resources/jsr286/api/portleturl-war/= WEB-INF/web.xml Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/BaseURLImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/spi/AbstractPortletInvocationContext.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi= /PortletInvocationContext.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/sup= port/spi/PortletInvocationContextSupport.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/Assert= ion.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletURLRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestPortletInvocationContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletURLTag.java modules/portlet/trunk/test/src/test/build.xml modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml Log: - support URL streaming in PortletInvocationContext - introduced URLFormat to gather all the options for formatting an URL - test case for XML escaping in BaseURL.write(...) method Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /URLFormat.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/UR= LFormat.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/UR= LFormat.java 2008-02-25 12:32:25 UTC (rev 10106) @@ -0,0 +1,73 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet; + +/** + * Defines how a container URL should be formatted when rendered. = + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class URLFormat +{ + + /** . */ + private final Boolean wantSecure; + + /** . */ + private final Boolean wantAuthenticated; + + /** . */ + private final Boolean wantRelative; + + /** . */ + private final Boolean wantEscapeXML; + + public URLFormat(Boolean wantSecure, Boolean wantAuthenticated, Boolean= wantRelative, Boolean wantEscapeXML) + { + this.wantSecure =3D wantSecure; + this.wantAuthenticated =3D wantAuthenticated; + this.wantRelative =3D wantRelative; + this.wantEscapeXML =3D wantEscapeXML; + } + + public Boolean getWantSecure() + { + return wantSecure; + } + + public Boolean getWantAuthenticated() + { + return wantAuthenticated; + } + + public Boolean getWantRelative() + { + return wantRelative; + } + + public Boolean getWantEscapeXML() + { + return wantEscapeXML; + } +} Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/BaseURLImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/BaseURLImpl.java 2008-02-25 10:16:10 UTC (rev 10105) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/BaseURLImpl.java 2008-02-25 12:32:25 UTC (rev 10106) @@ -25,8 +25,7 @@ import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.spi.PortletInvocationContext; import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl; -import org.jboss.portal.common.io.WriterCharWriter; -import org.jboss.portal.common.text.EntityEncoder; +import org.jboss.portal.portlet.URLFormat; = import javax.portlet.BaseURL; import javax.portlet.PortletSecurityException; @@ -43,13 +42,36 @@ { = /** . */ + private static final URLFormat[][] FORMATS =3D { + { + new URLFormat(null, null, true, null), + new URLFormat(false, null, true, null), + new URLFormat(true, null, true, null) + }, + { + new URLFormat(null, null, true, true), + new URLFormat(false, null, true, true), + new URLFormat(true, null, true, true) + } + }; + + /** . */ + private static final int SECURE_NOT_DETERMINED =3D 0; + + /** . */ + private static final int NOT_SECURE =3D 1; + + /** . */ + private static final int SECURE =3D 2; + + /** . */ protected final PortletInvocation inv; = /** . */ protected final PortletRequestImpl preq; = /** . */ - protected Boolean secure; + protected int secure; = /** . */ protected final boolean filterable; @@ -62,6 +84,7 @@ this.inv =3D invocation; this.preq =3D preq; this.filterable =3D filterable; + this.secure=3D SECURE_NOT_DETERMINED; } = protected BaseURLImpl(BaseURLImpl original) @@ -69,6 +92,7 @@ this.inv =3D original.inv; this.preq =3D original.preq; this.filterable =3D false; + this.secure=3D SECURE_NOT_DETERMINED; } = /** @throws IllegalArgumentException if the name is null */ @@ -92,7 +116,7 @@ = public void setSecure(boolean secure) throws PortletSecurityException { - this.secure =3D Boolean.valueOf(secure); + this.secure =3D secure ? SECURE : NOT_SECURE; } = public Map getParameterMap() @@ -101,23 +125,6 @@ return url.getParameters(); } = - public void write(Writer writer) throws IOException - { - writer.write(toString()); - } - - public void write(Writer writer, boolean b) throws IOException - { - if (b) - { - EntityEncoder.FULL.encode(toString(), new WriterCharWriter(writer= )); - } - else - { - EntityEncoder.BASIC.encode(toString(), new WriterCharWriter(write= r)); = - } - } - public void addProperty(String s, String s1) { if (s =3D=3D null) @@ -139,7 +146,7 @@ //TODO: } = - public String toString() + private InternalContainerURL blah() { PortletURLGenerationListener listener =3D ((PortletApplicationImpl)p= req.container.getPortletApplication()).getListener(PortletURLGenerationList= ener.class); = @@ -158,10 +165,43 @@ } = // + return url; + } + + public String toString() + { + InternalContainerURL url =3D blah(); + + // + URLFormat format =3D FORMATS[0][secure]; + + // PortletInvocationContext responseContext =3D inv.getContext(); - return responseContext.renderURL(url, secure, null, true); + + // + return responseContext.renderURL(url, format); } = + public void write(Writer writer) throws IOException + { + write(writer, false); + } + + public void write(Writer writer, boolean b) throws IOException + { + InternalContainerURL url =3D blah(); + + // + URLFormat format =3D FORMATS[b ? 1 : 0][secure]; + + // + PortletInvocationContext responseContext =3D inv.getContext(); + + // + responseContext.renderURL(writer, url, format); + } + + protected abstract void filter(PortletURLGenerationListener listener); = protected abstract BaseURLImpl createClone(); Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/spi/AbstractPortletInvocationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/spi/AbstractPortletInvocationContext.java 2008-02-25 10:16:10 UTC (rev 1= 0105) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/spi/AbstractPortletInvocationContext.java 2008-02-25 12:32:25 UTC (rev 1= 0106) @@ -25,9 +25,13 @@ import org.jboss.portal.common.invocation.AbstractInvocationContext; import org.jboss.portal.common.util.MarkupInfo; import org.jboss.portal.portlet.spi.PortletInvocationContext; +import org.jboss.portal.portlet.ContainerURL; +import org.jboss.portal.portlet.URLFormat; = import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.io.Writer; +import java.io.IOException; = /** * An abstract implementation that relies on the a request and response pr= ovided by the client (i.e the portal). @@ -84,4 +88,18 @@ { return markupInfo; } + + /** + * Delegates the URL rendendition to the method {@link #renderURL(org.j= boss.portal.portlet.ContainerURL,org.jboss.portal.portlet.URLFormat)} and + * then invoke the {@link java.io.Writer#write(String)} method with the= returned result. + * + * @see org.jboss.portal.portlet.spi.PortletInvocationContext#renderURL= (org.jboss.portal.portlet.ContainerURL, org.jboss.portal.portlet.URLFormat) + */ + public void renderURL(Writer writer, ContainerURL containerURL, URLForm= at format) throws IOException + { + String renderedURL =3D renderURL(containerURL, format); + + // + writer.write(renderedURL); + } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/spi/PortletInvocationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sp= i/PortletInvocationContext.java 2008-02-25 10:16:10 UTC (rev 10105) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sp= i/PortletInvocationContext.java 2008-02-25 12:32:25 UTC (rev 10106) @@ -29,7 +29,11 @@ import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.ContainerURL; +import org.jboss.portal.portlet.URLFormat; = +import java.io.IOException; +import java.io.Writer; + /** * Contract that defines what input/services the caller of a portlet conta= iner must provide. * @@ -67,10 +71,18 @@ * Renders a container URL. * * @param containerURL the portlet url - * @param wantSecure if the url should be secure - * @param wantAuthenticated if the url should be authenticated - * @param relative if the url should be relative + * @param format the url format * @return the rendered url */ - String renderURL(ContainerURL containerURL, Boolean wantSecure, Boolean= wantAuthenticated, boolean relative); + String renderURL(ContainerURL containerURL, URLFormat format); + + /** + * Renders a container URL. + * + * @param writer the writer + * @param containerURL the portlet url + * @param format the url format + * @throws IOException any IOException thrown by the writer + */ + void renderURL(Writer writer, ContainerURL containerURL, URLFormat form= at) throws IOException; } Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/port= let/support/spi/PortletInvocationContextSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/su= pport/spi/PortletInvocationContextSupport.java 2008-02-25 10:16:10 UTC (rev= 10105) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/su= pport/spi/PortletInvocationContextSupport.java 2008-02-25 12:32:25 UTC (rev= 10106) @@ -22,15 +22,15 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.support.spi; = -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; import org.jboss.portal.common.invocation.AbstractInvocationContext; import org.jboss.portal.common.util.MarkupInfo; -import org.jboss.portal.common.util.ParameterMap; -import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.ContainerURL; +import org.jboss.portal.portlet.URLFormat; import org.jboss.portal.portlet.spi.PortletInvocationContext; = +import java.io.Writer; +import java.io.IOException; + /** * @author Julien Viet * @version $Revision: 5064 $ @@ -48,8 +48,13 @@ throw new UnsupportedOperationException(); } = - public String renderURL(ContainerURL containerURL, Boolean wantSecure, = Boolean wantAuthenticated, boolean relative) + public String renderURL(ContainerURL containerURL, URLFormat format) { throw new UnsupportedOperationException(); } + + public void renderURL(Writer writer, ContainerURL containerURL, URLForm= at format) throws IOException + { + throw new UnsupportedOperationException(); + } } Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/api/portleturl/EscapeXMLTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/api/portleturl/EscapeXMLTestCase.java (re= v 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/api/portleturl/EscapeXMLTestCase.java 2008-02-25 12:32:25 UTC (re= v 10106) @@ -0,0 +1,126 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.test.portlet.jsr286.api.portleturl; + +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.Assertion; +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; + +import static org.jboss.unit.api.Assert.*; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.PortletURL; +import java.io.IOException; +import java.io.Writer; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)TestCase(Assertion.API_BASE_URL_1) +public class EscapeXMLTestCase +{ + + public EscapeXMLTestCase(PortletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + response.setContentType("text/html"); + Writer writer =3D response.getWriter(); + + // + PortletURL url =3D response.createRenderURL(); + + // + url.setParameter("foo", "bar"); + + // + writer.write("@BEFORE_ESCAPED@"); + url.write(writer, true); + writer.write("@AFTER_ESCAPED@"); + + // + writer.write("@BEFORE_NON_ESCAPED@"); + url.write(writer, false); + writer.write("@AFTER_NON_ESCAPED@"); + + // + return new InvokeGetResponse(response.createRenderURL().toStri= ng()); + } + }); + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + byte[] content =3D context.getResponseBody(); + String text =3D new String(content, "UTF-8"); + + // + String escapedURL =3D getURL(text, "ESCAPED"); + for (int pos =3D escapedURL.indexOf('&'); pos !=3D -1; pos =3D= escapedURL.indexOf('&', pos + 1)) + { + String s =3D escapedURL.substring(pos, pos + "&".length= ()); + assertEquals("&", s); + } + + String nonEscapedURL =3D getURL(text, "NON_ESCAPED"); + for (int pos =3D nonEscapedURL.indexOf('&'); pos !=3D -1; pos = =3D nonEscapedURL.indexOf('&', pos + 1)) + { + int end =3D Math.min(pos + "&".length(), nonEscapedURL.= length()); = + String s =3D nonEscapedURL.substring(pos, end); + String comparison =3D "&".substring(0, end - pos); + assertNotEquals(comparison, s); + } + + // + return new EndTestResponse(); + } + }); + + + } + + private String getURL(String text, String type) + { + int from =3D text.indexOf("@BEFORE_" + type + "@"); + assertNotEquals(-1, from); + + // + int to =3D text.indexOf("@AFTER_" + type + "@"); + assertNotEquals(-1, to); + + // + return text.substring(from + ("@BEFORE_" + type + "@").length(), to); + } +} Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit= /Assertion.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/Asser= tion.java 2008-02-25 10:16:10 UTC (rev 10105) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/Asser= tion.java 2008-02-25 12:32:25 UTC (rev 10106) @@ -22,6 +22,9 @@ *************************************************************************= *****/ package org.jboss.portal.unit; = +import javax.portlet.PortletURL; +import javax.portlet.BaseURL; + /** * Define TCK assertions. * @@ -431,346 +434,346 @@ JSR168_1000(new TCK(1000), "todo ???"), = // PLT.2 Overview - JSR286_1(new TCK(1), Status.specUntestable(""), "PLT.2.5", "Portlet V2.= 0 containers must support deploying JSR 168 portlets and the JSR 168 deploy= ment descriptor"), + JSR286_1(new TCK(1, "PLT.2.5"), Status.specUntestable(""), "Portlet V2.= 0 containers must support deploying JSR 168 portlets and the JSR 168 deploy= ment descriptor"), = = // PLT.5 The Portlet Interface and Additional Life - JSR286_2(new TCK(2), Status.specUntestable(""), "PLT.5.1", "For a portl= et, not hosted in a distributed environment " + + JSR286_2(new TCK(2, "PLT.5.1"), Status.specUntestable(""), "For a portl= et, not hosted in a distributed environment " + "(the default), the portlet container must instantiate and use only = one portlet object per portlet definition"), - JSR286_3(new TCK(3), Status.specUntestable(""), "PLT.5.1", "In the case= where a portlet is deployed as part of a" + + JSR286_3(new TCK(3, "PLT.5.1"), Status.specUntestable(""), "In the case= where a portlet is deployed as part of a" + " portlet application marked as distributable, in the web.xml deploy= ment descriptor, a portlet container may " + "instantiate only one portlet object per portlet definition -in the = deployment descriptor- per virtual machine (VM)."), - JSR286_4(new TCK(4), "PLT.5.2.1", "The portlet container must load the = portlet class using the same ClassLoader " + + JSR286_4(new TCK(4, "PLT.5.2.1"), "The portlet container must load the = portlet class using the same ClassLoader " + "the servlet container uses for the web application part of the port= let application."), - JSR286_5(new TCK(5), "PLT.5.2.2", "After the portlet object is instanti= ated, the portlet container must initialize " + + JSR286_5(new TCK(5, "PLT.5.2.2"), "After the portlet object is instanti= ated, the portlet container must initialize " + "the portlet before invoking it to handle requests."), - JSR286_6(new TCK(6), "PLT.5.2.2.1", "During initialization, the portlet= object may throw an UnavailableException " + + JSR286_6(new TCK(6, "PLT.5.2.2.1"), "During initialization, the portlet= object may throw an UnavailableException " + "or a PortletException. In this case, the portlet container must not= place the portlet object into active " + "service and it must release the portlet object."), - JSR286_7(new TCK(7), "PLT.5.2.2.1", "The destroy method must not be cal= led because the initialization is considered " + + JSR286_7(new TCK(7, "PLT.5.2.2.1"), "The destroy method must not be cal= led because the initialization is considered " + "unsuccessful."), - JSR286_8(new TCK(8), "PLT.5.2.2.1", "The portlet container may reattemp= t to instantiate and initialize the portlets " + + JSR286_8(new TCK(8, "PLT.5.2.2.1"), "The portlet container may reattemp= t to instantiate and initialize the portlets " + "at any time after a failure. The exception to this rule is when an = UnavailableException indicates a minimum time " + "of unavailability. When this happens the portlet container must wai= t for 30 the specified time to pass before " + "creating and initializing a new portlet object."), - JSR286_9(new TCK(9), "PLT.5.2.2.1", "A RuntimeException thrown during i= nitialization must be handled as a " + + JSR286_9(new TCK(9, "PLT.5.2.2.1"), "A RuntimeException thrown during i= nitialization must be handled as a " + "PortletException."), - JSR286_10(new TCK(10), Status.specUntestable(""), "PLT.5.2.3", "Once th= e destroy method is called on a portlet " + + JSR286_10(new TCK(10, "PLT.5.2.3"), Status.specUntestable(""), "Once th= e destroy method is called on a portlet " + "object, the portlet container must not route any requests to that p= ortlet object."), - JSR286_11(new TCK(11), Status.specUntestable(""), "PLT.5.2.3", "If the = portlet container needs to enable the " + + JSR286_11(new TCK(11, "PLT.5.2.3"), Status.specUntestable(""), "If the = portlet container needs to enable the " + "portlet again, it must do so with a new portlet object, which is a = new instance of the portlet=E2=80=99s class."), - JSR286_12(new TCK(12), Status.specUntestable(""), "PLT.5.2.3", "If the = portlet object throws a RuntimeException " + + JSR286_12(new TCK(12, "PLT.5.2.3"), Status.specUntestable(""), "If the = portlet object throws a RuntimeException " + "within the execution of the destroy method the portlet container mu= st consider the portlet object successfully " + "destroyed."), - JSR286_13(new TCK(13), Status.specUntestable(""), "PLT.5.2.3", "After t= he destroy method completes, the portlet " + + JSR286_13(new TCK(13, "PLT.5.2.3"), Status.specUntestable(""), "After t= he destroy method completes, the portlet " + "container must release the portlet object so that it is eligible fo= r garbage collection."), - JSR286_14(new TCK(14), "PLT.5.4", "If the client request is triggered b= y an action URL, the portal/portlet-container " + + JSR286_14(new TCK(14, "PLT.5.4"), "If the client request is triggered b= y an action URL, the portal/portlet-container " + "must first trigger the action request by invoking the processAction= method of the targeted portlet."), - JSR286_15(new TCK(15), "PLT.5.4", "The portal/portlet-container must wa= it until the action request finishes. Then, " + + JSR286_15(new TCK(15, "PLT.5.4"), "The portal/portlet-container must wa= it until the action request finishes. Then, " + "the portal/portlet-container should call the processEvent methods o= f the event receiving portlets and after the " + "event processing is finished must trigger the render request by inv= oking the render method for all the portlets " + "in the portal page with the possible exception of portlets for whic= h their content is being cached."), - JSR286_16(new TCK(16), "PLT.5.4", "If the client request is triggered b= y a render URL, the portal/portlet-container " + + JSR286_16(new TCK(16, "PLT.5.4"), "If the client request is triggered b= y a render URL, the portal/portlet-container " + "must invoke the render method for all the portlets in the portal pa= ge with the possible exception of portlets " + "for which their content is being cached."), - JSR286_17(new TCK(17), "PLT.5.4", "If the client request is triggered b= y a resource URL, the portal/portlet-container " + + JSR286_17(new TCK(17, "PLT.5.4"), "If the client request is triggered b= y a resource URL, the portal/portlet-container " + "must invoke the serveResource method of the target portlet with the= possible exception of content that has a " + "valid cache entry."), - JSR286_18(new TCK(18), "PLT.5.4.1", "If the portlet issues a redirectio= n, when the processAction method concludes, " + + JSR286_18(new TCK(18, "PLT.5.4.1"), "If the portlet issues a redirectio= n, when the processAction method concludes, " + "the portal/portlet-container must send the redirection back to the = user agent"), - JSR286_19(new TCK(19), "PLT.5.4.5.4", "If no matching annotated method = is found GenericPortlet will dispatch to " + + JSR286_19(new TCK(19, "PLT.5.4.5.4"), "If no matching annotated method = is found GenericPortlet will dispatch to " + "the following methods: doView for handling VIEW requests"), - JSR286_20(new TCK(20), "PLT.5.4.5.4", "If no matching annotated method = is found GenericPortlet will dispatch to " + + JSR286_20(new TCK(20, "PLT.5.4.5.4"), "If no matching annotated method = is found GenericPortlet will dispatch to " + "the following methods: doEdit for handling EDIT requests"), - JSR286_21(new TCK(21), "PLT.5.4.5.4", "If no matching annotated method = is found GenericPortlet will dispatch to " + + JSR286_21(new TCK(21, "PLT.5.4.5.4"), "If no matching annotated method = is found GenericPortlet will dispatch to " + "the following methods: doHelp for handling HELP requests"), - JSR286_22(new TCK(22), "PLT.5.4.5.4", "If the window state of the portl= et (see PLT.9 Window States Chapter) is " + + JSR286_22(new TCK(22, "PLT.5.4.5.4"), "If the window state of the portl= et (see PLT.9 Window States Chapter) is " + "MINIMIZED, the render method of the GenericPortlet does not invoke = any of the portlet mode rendering methods"), - JSR286_23(new TCK(23), "PLT.5.4.7", "If a portlet throws an exception i= n the processAction or processEvent method, " + + JSR286_23(new TCK(23, "PLT.5.4.7"), "If a portlet throws an exception i= n the processAction or processEvent method, " + "all operations on the ActionResponse must be ignored including set = events."), - JSR286_24(new TCK(24), Status.specUntestable(""), "PLT.5.4.7", "If a pe= rmanent unavailability is indicated by the " + + JSR286_24(new TCK(24, "PLT.5.4.7"), Status.specUntestable(""), "If a pe= rmanent unavailability is indicated by the " + "UnavailableException, the portlet container must remove the portlet= from service immediately, call the portlet=E2=80=99s " + "destroy method, and release the portlet object"), - JSR286_25(new TCK(25), "PLT.5.4.7", "A RuntimeException thrown during t= he request handling must be handled as a " + + JSR286_25(new TCK(25, "PLT.5.4.7"), "A RuntimeException thrown during t= he request handling must be handled as a " + "PortletException."), = // PLT.6 Portlet Config - JSR286_26(new TCK(26), "PLT.6.2", "If the root resource bundle does not= contain the resources for these values and " + + JSR286_26(new TCK(26, "PLT.6.2"), "If the root resource bundle does not= contain the resources for these values and " + "the values are defined inline, the portlet container must add the i= nline values as resources of the root " + "resource bundle."), - JSR286_27(new TCK(27), "PLT.6.2", "If the portlet definition does not d= efine a resource bundle and the information" + + JSR286_27(new TCK(27, "PLT.6.2"), "If the portlet definition does not d= efine a resource bundle and the information" + " is defined inline in the deployment descriptor, the portlet contai= ner must create a ResourceBundle and populate" + " it, with the inline values, using the keys defined in the PLT.25.1= 0 Resource Bundles Section."), - JSR286_28(new TCK(28), "PLT.6.3", "The getDefaultNamespace method of th= e PortletConfig interface returns the " + + JSR286_28(new TCK(28, "PLT.6.3"), "The getDefaultNamespace method of th= e PortletConfig interface returns the " + "default namespace for events and public render parameters set in th= e portlet deployment descriptor with " + "the default-namespace element, or the XML default namespace XMLCons= tants.NULL_NS_URI if no default namespace" + " is provided in the portlet deployment descriptor."), - JSR286_29(new TCK(29), "PLT.6.4", "The getPublicRenderParameterNames me= thod of the PortletConfig interface returns" + + JSR286_29(new TCK(29, "PLT.6.4"), "The getPublicRenderParameterNames me= thod of the PortletConfig interface returns" + " the public render parameter names found in the portlet definition = in the deployment descriptor with the " + "supported-public-render-parameter element or an empty enumeration i= f no public render parameters are defined" + " for the current portlet definition."), - JSR286_30(new TCK(30), "PLT.6.5", "The getPublishingEventQNames method = of the PortletConfig interface returns the" + + JSR286_30(new TCK(30, "PLT.6.5"), "The getPublishingEventQNames method = of the PortletConfig interface returns the" + " publishing event QNames found in the portlet definition in the dep= loyment descriptor with the " + "supported-publishing-event element or an empty enumeration if no pu= blishing events are defined for the " + "current portlet definition."), - JSR286_31(new TCK(31), "PLT.6.5", "If the event was defined using the n= ame element instead of the qname element " + + JSR286_31(new TCK(31, "PLT.6.5"), "If the event was defined using the n= ame element instead of the qname element " + "the defined default namespace must be added as namespace for the re= turned QName."), - JSR286_32(new TCK(32), "PLT.6.6", "The getProcessingEventQNames method = of the PortletConfig interface returns " + + JSR286_32(new TCK(32, "PLT.6.6"), "The getProcessingEventQNames method = of the PortletConfig interface returns " + "the processing event QNames found in the portlet definition in the = deployment descriptor with the " + "supported-processing-event element or an empty enumeration if no pr= ocessing events are defined for the current" + " portlet definition."), - JSR286_33(new TCK(33), "PLT.6.6", "If the event was defined using the n= ame element instead of the qname element the" + + JSR286_33(new TCK(33, "PLT.6.6"), "If the event was defined using the n= ame element instead of the qname element the" + " defined default namespace must be added as namespace for the retur= ned Qname."), - JSR286_34(new TCK(34), "PLT.6.7", "The getSupportedLocales method of th= e PortletConfig interface returns the " + + JSR286_34(new TCK(34, "PLT.6.7"), "The getSupportedLocales method of th= e PortletConfig interface returns the " + "supported locales found in the portlet definition in the deployment= descriptor with the supported-locale " + "element or an empty enumeration if no supported locales are defined= for the current portlet definition."), = // PLT,7 Portlet URLs = - JSR286_35(new TCK(35), "PLT.7.1", "The portal/portlet-container must no= t invoke the processAction method of the " + + JSR286_35(new TCK(35, "PLT.7.1"), "The portal/portlet-container must no= t invoke the processAction method of the " + "targeted portlet of a render URL."), - JSR286_36(new TCK(36), "PLT.7.1", "The portal/portlet-container must en= sure that all the parameters set when " + + JSR286_36(new TCK(36, "PLT.7.1"), "The portal/portlet-container must en= sure that all the parameters set when " + "constructing the render URL become render parameters of the subsequ= ent render requests for the portlet."), - JSR286_37(new TCK(37), "PLT.7.1.1", "A call to any of the setParameter = methods must replace any parameter with " + + JSR286_37(new TCK(37, "PLT.7.1.1"), "A call to any of the setParameter = methods must replace any parameter with " + "the same name previously set."), - JSR286_38(new TCK(38), "PLT.7.1.1", "All the parameters a portlet adds = to a BaseURL object must be made available " + + JSR286_38(new TCK(38, "PLT.7.1.1"), "All the parameters a portlet adds = to a BaseURL object must be made available " + "to the portlet as request parameters."), - JSR286_39(new TCK(39), "PLT.7.1.1", "The portlet-container must =E2=80= =9Cx-www-form-urlencoded=E2=80=9D encode parameter names and " + + JSR286_39(new TCK(39, "PLT.7.1.1"), "The portlet-container must =E2=80= =9Cx-www-form-urlencoded=E2=80=9D encode parameter names and " + "values added to a BaseURL object."), - JSR286_40(new TCK(40), "PLT.7.1.1", "If a portal/portlet-container enco= des additional information as parameters, it " + + JSR286_40(new TCK(40, "PLT.7.1.1"), "If a portal/portlet-container enco= des additional information as parameters, it " + "must namespace them properly to avoid collisions with the parameter= s set and used by the portlet."), - JSR286_41(new TCK(41), "PLT.7.1.2", "A portlet cannot create a portlet = URL using a portlet mode that is not defined " + + JSR286_41(new TCK(41, "PLT.7.1.2"), "A portlet cannot create a portlet = URL using a portlet mode that is not defined " + "as supported by the portlet or that the user it is not allowed to u= se. The setPortletMode methods must throw a " + "PortletModeException in that situation."), - JSR286_42(new TCK(42), "PLT.7.1.2", "The change of portlet mode must be= effective for the request triggered by the " + + JSR286_42(new TCK(42, "PLT.7.1.2"), "The change of portlet mode must be= effective for the request triggered by the " + "portlet URL."), - JSR286_43(new TCK(43), "PLT.7.1.2", "If the portlet mode is not set for= a URL, it must have the portlet mode of the " + + JSR286_43(new TCK(43, "PLT.7.1.2"), "If the portlet mode is not set for= a URL, it must have the portlet mode of the " + "current request as default."), - JSR286_44(new TCK(45), "PLT.7.1.2", "A portlet cannot create a portlet = URL using a window state that is not supported " + + JSR286_44(new TCK(45, "PLT.7.1.2"), "A portlet cannot create a portlet = URL using a window state that is not supported " + "by the portlet container. The setWindowState method must throw a Wi= ndowStateException if that is the case."), - JSR286_45(new TCK(44), "PLT.7.1.2", "If the window state is not set for= a URL, it must have the window state of the " + + JSR286_45(new TCK(44, "PLT.7.1.2"), "If the window state is not set for= a URL, it must have the window state of the " + "current request as default."), - JSR286_46(new TCK(46), "PLT.7.1.3", "If setSecure is called with true, = the transport for the request triggered with " + + JSR286_46(new TCK(46, "PLT.7.1.3"), "If setSecure is called with true, = the transport for the request triggered with " + "this URL must be secure (i.e. HTTPS)."), - JSR286_47(new TCK(47), "PLT.7.2.1", "If the portlet application has spe= cified one or more PortletURLGenerationListener " + + JSR286_47(new TCK(47, "PLT.7.2.1"), "If the portlet application has spe= cified one or more PortletURLGenerationListener " + "classes in the portlet deployment descriptor the portlet container = must call: the method filterActionURL method for " + "all action URLs before executing the write or toString method of th= ese action URLs"), - JSR286_48(new TCK(48), "PLT.7.2.1", "If the portlet application has spe= cified one or more PortletURLGenerationListener " + + JSR286_48(new TCK(48, "PLT.7.2.1"), "If the portlet application has spe= cified one or more PortletURLGenerationListener " + "classes in the portlet deployment descriptor the portlet container = must call: the method filterRenderURL method " + "for all render URLs before executing the write or toString method o= f these render URLs"), - JSR286_49(new TCK(49), "PLT.7.2.1", "If the portlet application has spe= cified one or more PortletURLGenerationListener " + + JSR286_49(new TCK(49, "PLT.7.2.1"), "If the portlet application has spe= cified one or more PortletURLGenerationListener " + "classes in the portlet deployment descriptor the portlet container = must call: the method filterResourceURL method " + "for all resource URLs before executing the write or toString method= of these resource URLs"), - JSR286_50(new TCK(50), "PLT.7.2.1", "The portlet container must provide= the PortletURL or ResourceURL to generate to " + + JSR286_50(new TCK(50, "PLT.7.2.1"), "The portlet container must provide= the PortletURL or ResourceURL to generate to " + "the filter methods and execute the write or toString method on the = updated PortletURL or ResourceURL that is the " + "outcome of the filter method call."), - JSR286_51(new TCK(51), "PLT.7.2.2", "If more than one listener is regis= tered the portlet container must chain the " + + JSR286_51(new TCK(51, "PLT.7.2.2"), "If more than one listener is regis= tered the portlet container must chain the " + "listeners in the order of how they appear in the deployment descrip= tor."), = // PLT.8 Portlet Modes = - JSR286_52(new TCK(52), "PLT.8.5", "If no matching annotated method is f= ound GenericPortlet will dispatch to the " + + JSR286_52(new TCK(52, "PLT.8.5"), "If no matching annotated method is f= ound GenericPortlet will dispatch to the " + "doView, doEdit or doHelp method depending on the portlet mode indic= ated in the request using the doDispatch " + "method or throws a PortletException if the mode is not VIEW, EDIT, = or HELP."), - JSR286_53(new TCK(53), "PLT.8.6", "As all portlets must support the VIE= W portlet mode, VIEW does not have to be " + + JSR286_53(new TCK(53, "PLT.8.6"), "As all portlets must support the VIE= W portlet mode, VIEW does not have to be " + "indicated."), - JSR286_54(new TCK(54), "PLT.8.6", "The portlet must not be invoked in a= portlet mode that has not been declared " + + JSR286_54(new TCK(54, "PLT.8.6"), "The portlet must not be invoked in a= portlet mode that has not been declared " + "as supported for a given markup type."), - JSR286_55(new TCK(55), Status.specUntestable(""), "PLT.8.6", "The portl= et container must ignore all references to " + + JSR286_55(new TCK(55, "PLT.8.6"), Status.specUntestable(""), "The portl= et container must ignore all references to " + "custom portlet modes that are not supported by the portal implement= ation, or that have no mapping to portlet " + "modes supported by the portal."), = // PLT.9 Window States = - JSR286_56(new TCK(56), "PLT.9.4", "If a custom window state defined in = the deployment descriptor is not mapped to " + + JSR286_56(new TCK(56, "PLT.9.4"), "If a custom window state defined in = the deployment descriptor is not mapped to " + "a custom window state provided by the portal, portlets must not be = invoked in that window state."), - JSR286_57(new TCK(57), "PLT.9.5", "As all portlets must at least suppor= t the pre-defined window states NORMAL, " + + JSR286_57(new TCK(57, "PLT.9.5"), "As all portlets must at least suppor= t the pre-defined window states NORMAL, " + "MAXIMIZED, MINIMIZED, these window states do not have to be indicat= ed."), - JSR286_58(new TCK(58), Status.specUntestable(""), "PLT.9.5", "The portl= et container must ignore all references " + + JSR286_58(new TCK(58, "PLT.9.5"), Status.specUntestable(""), "The portl= et container must ignore all references " + "to custom window states that are not supported by the portal implem= entation, or that have no mapping to window " + "states supported by the portal"), = // PLT.10 Portlet Context = - JSR286_59(new TCK(59), Status.specUntestable(""), "PLT.10.1", "There is= one instance of the PortletContext interface " + + JSR286_59(new TCK(59, "PLT.10.1"), Status.specUntestable(""), "There is= one instance of the PortletContext interface " + "associated with each portlet application deployed into a portlet co= ntainer."), - JSR286_60(new TCK(60), Status.specUntestable(""), "PLT.10.1", "In cases= where the container is distributed over many " + + JSR286_60(new TCK(60, "PLT.10.1"), Status.specUntestable(""), "In cases= where the container is distributed over many " + "virtual machines, a portlet application will have an instance of th= e PortletContext interface for each VM."), - JSR286_61(new TCK(61), "PLT.10.3", "The initialization parameters acces= sible through the PortletContext must be the " + + JSR286_61(new TCK(61, "PLT.10.3"), "The initialization parameters acces= sible through the PortletContext must be the " + "same that are accessible through the ServletContext of the portlet = application."), - JSR286_62(new TCK(62), "PLT.10.3", "A direct consequence of this is tha= t data stored in the ServletContext by " + + JSR286_62(new TCK(62, "PLT.10.3"), "A direct consequence of this is tha= t data stored in the ServletContext by " + "servlets or JSPs is accessible to portlets through the PortletConte= xt and vice versa."), - JSR286_63(new TCK(63), "PLT.10.3", "The PortletContext must offer acces= s to the same set of resources the " + + JSR286_63(new TCK(63, "PLT.10.3"), "The PortletContext must offer acces= s to the same set of resources the " + "ServletContext exposes."), - JSR286_64(new TCK(64), "PLT.10.3", "It must be accessible as a context = attribute using the same constant " + + JSR286_64(new TCK(64, "PLT.10.3"), "It must be accessible as a context = attribute using the same constant " + "defined in the Servlet Specification SVR 3 Servlet Context Chapter,= javax.servlet.context.tempdir."), - JSR286_65(new TCK(64), "PLT.10.3", "The portlet context must follow the= same behavior and functionality that " + + JSR286_65(new TCK(64, "PLT.10.3"), "The portlet context must follow the= same behavior and functionality that " + "the servlet context has for virtual hosting and reloading considera= tions. (see Servlet Specification SVR 3 " + "Servlet Context Chapter)"), - JSR286_66(new TCK(66), "PLT.10.4.4", "For such use cases the Java Portl= et Specification provides the action-scoped " + + JSR286_66(new TCK(66, "PLT.10.4.4"), "For such use cases the Java Portl= et Specification provides the action-scoped " + "request attributes as container runtime option with the intent to p= rovide portlets with these request attributes " + "until a new action occurs. This container runtime option must be su= pported by portlet containers."), = // PLT.11 Portlet Requests = - JSR286_67(new TCK(67), JSR168_48, "PLT.11.1.1", "If a portlet receives = a request from a client request targeted to the " + + JSR286_67(new TCK(67, "PLT.11.1.1"), JSR168_48, "If a portlet receives = a request from a client request targeted to the " + "portlet itself, the parameters must be the string parameters encode= d in the URL (added when creating the " + "PortletURL) and the string parameters sent by the client to the por= tlet as part of the client request."), - JSR286_68(new TCK(68), JSR168_49, "PLT.11.1.1", "The parameters the req= uest object returns must be \"x-www-formurlencoded\" " + + JSR286_68(new TCK(68, "PLT.11.1.1"), JSR168_49, "The parameters the req= uest object returns must be \"x-www-formurlencoded\" " + "decoded."), - JSR286_69(new TCK(69), JSR168_55, "PLT.11.1.1", "The value returned fro= m the getParameter method must be the first value in " + + JSR286_69(new TCK(69, "PLT.11.1.1"), JSR168_55, "The value returned fro= m the getParameter method must be the first value in " + "the array of String objects returned by getParameterValues"), - JSR286_70(new TCK(70), JSR168_56, "PLT.11.1.1", "If there is a single p= arameter value associated with a parameter name the " + + JSR286_70(new TCK(70, "PLT.11.1.1"), JSR168_56, "If there is a single p= arameter value associated with a parameter name the " + "method must return is an array of size one containing the parameter= value."), - JSR286_71(new TCK(71), "PLT.11.1.1", "The getParameterMap method must r= eturn an unmodifiable Map object."), - JSR286_72(new TCK(72), "PLT.11.1.1", "If the request does not have any = parameters, the getParameterMap must return " + + JSR286_71(new TCK(71, "PLT.11.1.1"), "The getParameterMap method must r= eturn an unmodifiable Map object."), + JSR286_72(new TCK(72, "PLT.11.1.1"), "If the request does not have any = parameters, the getParameterMap must return " + "an empty Map object"), - JSR286_73(new TCK(73), "PLT.11.1.1", "Parameters set on the portlet URL= and the post body are aggregated into the " + + JSR286_73(new TCK(73, "PLT.11.1.1"), "Parameters set on the portlet URL= and the post body are aggregated into the " + "request parameter set. Portlet URL parameters are presented before = post body data."), - JSR286_74(new TCK(74), "PLT.11.1.1.2", "The portlet-container must not = propagate parameters received in an action " + + JSR286_74(new TCK(74, "PLT.11.1.1.2"), "The portlet-container must not = propagate parameters received in an action " + "or event request to subsequent render requests of the portlet."), - JSR286_75(new TCK(75), "PLT.11.1.1.2", "The portlet-container must not = propagate parameters received in an action " + + JSR286_75(new TCK(75, "PLT.11.1.1.2"), "The portlet-container must not = propagate parameters received in an action " + "to subsequent event requests of the portlet."), - JSR286_76(new TCK(76), "PLT.11.1.1.2", "The set render parameters must = be provided to the processEvent and render " + + JSR286_76(new TCK(76, "PLT.11.1.1.2"), "The set render parameters must = be provided to the processEvent and render " + "calls of at least the current client request."), - JSR286_77(new TCK(77), "PLT.11.1.1.3", "If a portlet receives a render = request following an action or event " + + JSR286_77(new TCK(77, "PLT.11.1.1.3"), "If a portlet receives a render = request following an action or event " + "request as part of the same client request, the parameters received= with render request must be the render " + "parameters set during the action or event request."), - JSR286_78(new TCK(78), "PLT.11.1.1.3", "If a portlet receives a render = request that is the result of invoking " + + JSR286_78(new TCK(78, "PLT.11.1.1.3"), "If a portlet receives a render = request that is the result of invoking " + "a render URL targeting this portlet the render parameters received = with the render request must be the " + "parameters set on the render URL if these were not changed by the p= ortlet as a result of an container event " + "received for this render URL."), - JSR286_79(new TCK(79), "PLT.11.1.1.3", "Commonly, portals provide contr= ols to change the portlet mode and the " + + JSR286_79(new TCK(79, "PLT.11.1.1.3"), "Commonly, portals provide contr= ols to change the portlet mode and the " + "window state of portlets. The URLs these controls use are generated= by the portal. Client requests triggered " + "by those URLs must be treated as render URLs and the existing rende= r parameters must be preserved."), - JSR286_80(new TCK(80), "PLT.11.1.1.3", "A portlet must not see any para= meter targeted to other portlets."), - JSR286_81(new TCK(81), Status.specUntestable(""), "PLT.11.1.2", "The su= pportedpublic-render-parameter element must " + + JSR286_80(new TCK(80, "PLT.11.1.1.3"), "A portlet must not see any para= meter targeted to other portlets."), + JSR286_81(new TCK(81, "PLT.11.1.2"), Status.specUntestable(""), "The su= pportedpublic-render-parameter element must " + "reference the identifier " + "of a public render parameter defined in the portlet application sec= tion in a public-render-parameter element"), - JSR286_82(new TCK(82), "PLT.11.1.2", "The portlet container must only s= end those public render parameters to a " + + JSR286_82(new TCK(82, "PLT.11.1.2"), "The portlet container must only s= end those public render parameters to a " + "portlet which the portlet has defined support for using supported-p= ublic-render-parameter element in the " + "portlet.xml."), - JSR286_83(new TCK(83), "PLT.11.1.2", "The portlet container must only s= hare those render parameters of a portlet " + + JSR286_83(new TCK(83, "PLT.11.1.2"), "The portlet container must only s= hare those render parameters of a portlet " + "which the portlet has declared as supported public render parameter= s using supported-public-render-parameter " + "element in the portlet.xml"), - JSR286_84(new TCK(84), "PLT.11.1.2", "If the portlet was the target of = a render URL and this render URL has set " + + JSR286_84(new TCK(84, "PLT.11.1.2"), "If the portlet was the target of = a render URL and this render URL has set " + "a specific public render parameter the portlet must receive at leas= t this render parameter"), - JSR286_85(new TCK(85), "PLT.11.1.2", "If a action or resource parameter= has the same name as a public render " + + JSR286_85(new TCK(85, "PLT.11.1.2"), "If a action or resource parameter= has the same name as a public render " + "parameter the public render parameter values must be the last entri= es in the parameter value array."), - JSR286_86(new TCK(86), "PLT.11.1.2", "Portlets can access a merged set = of public and private parameters via the " + + JSR286_86(new TCK(86, "PLT.11.1.2"), "Portlets can access a merged set = of public and private parameters via the " + "getParameter methods on the PortletRequest or separated as maps of = private parameters via the " + "getPrivateParameterMap method and public parameters via the getPubl= icParameterMap method."), - JSR286_87(new TCK(87), JSR168_57, Status.specUntestable(""), "PLT.11.1.= 3", "Extra parameters used by the portal/portlet-container must be invisibl= e " + + JSR286_87(new TCK(87, "PLT.11.1.3"), JSR168_57, Status.specUntestable("= "), "Extra parameters used by the portal/portlet-container must be invisibl= e " + "to the portlets receiving the request."), - JSR286_88(new TCK(88), "PLT.11.1.4.1", "The portlet can access a map wi= th user information attributes via the " + + JSR286_88(new TCK(88, "PLT.11.1.4.1"), "The portlet can access a map wi= th user information attributes via the " + "request attribute PortletRequest.USER_INFO."), - JSR286_89(new TCK(89), "PLT.11.1.4.2", "The PortletRequest.CCPP_PROFILE= request attribute must return a " + + JSR286_89(new TCK(89, "PLT.11.1.4.2"), "The PortletRequest.CCPP_PROFILE= request attribute must return a " + "javax.ccpp.Profile based on the current portlet request."), - JSR286_90(new TCK(90), "PLT.11.1.4.4", "The LIFECYCLE_PHASE request att= ribute of the PortletRequest interface " + + JSR286_90(new TCK(90, "PLT.11.1.4.4"), "The LIFECYCLE_PHASE request att= ribute of the PortletRequest interface " + "allows a portlet to determine the current lifecycle phase of this r= equest. This attribute value must be " + "ACTION_PHASE if the current request is of type ActionRequest, EVENT= _PHASE if the current request is of type " + "EventRequest, RENDER_PHASE if the current request is of type Render= Request, and RESOURCE_SERVING_PHASE if the " + "current request is of type ResourceRequest."), - JSR286_91(new TCK(91), JSR168_58, "PLT.11.1.6", "If the portlet applica= tion is rooted at the base of the web server URL " + + JSR286_91(new TCK(91, "PLT.11.1.6"), JSR168_58, "If the portlet applica= tion is rooted at the base of the web server URL " + "namespace (also known as \"default\" context), this path must be an= empty string."), - JSR286_92(new TCK(92), JSR168_59, "PLT.11.1.6", "Otherwise, it must be = the path the portlet application is rooted to, the " + + JSR286_92(new TCK(92, "PLT.11.1.6"), JSR168_59, "Otherwise, it must be = the path the portlet application is rooted to, the " + "path must start with a '/' and it must not end with a '/' character= ."), - JSR286_93(new TCK(93), JSR168_60, "PLT.11.1.7", "If the user is not aut= henticated the getAuthType method must return null. "), - JSR286_94(new TCK(94), JSR168_61, "PLT.11.1.8", "The first element of t= he enumeration must be the same content type returned " + + JSR286_93(new TCK(93, "PLT.11.1.7"), JSR168_60, "If the user is not aut= henticated the getAuthType method must return null. "), + JSR286_94(new TCK(94, "PLT.11.1.8"), JSR168_61, "The first element of t= he enumeration must be the same content type returned " + "by the getResponseContentType method."), - JSR286_95(new TCK(95), "PLT.11.1.8", "If the getResponseContentType or = getResponseContentTypes methods are exposed " + + JSR286_95(new TCK(95, "PLT.11.1.8"), "If the getResponseContentType or = getResponseContentTypes methods are exposed " + "via an ActionRequest, EventRequest, or RenderRequest the following = additional restrictions apply: The content " + "type must only includes the MIME type, not the character set."), - JSR286_96(new TCK(96), "PLT.11.1.8", "If the getResponseContentType or = getResponseContentTypes methods are " + + JSR286_96(new TCK(96, "PLT.11.1.8"), "If the getResponseContentType or = getResponseContentTypes methods are " + "exposed via an ActionRequest, EventRequest, or RenderRequest the fo= llowing additional restrictions apply: " + "The getResponseContentTypes method must return only the content typ= es supported by the current portlet mode " + "of the portlet."), - JSR286_97(new TCK(97), "PLT.11.1.12", "The portlet window ID retrieved = with the getWindowID method must be the " + + JSR286_97(new TCK(97, "PLT.11.1.12"), "The portlet window ID retrieved = with the getWindowID method must be the " + "same as the one that is used by the portlet container for scoping t= he portlet-scope session attributes."), - JSR286_98(new TCK(98), JSR168_63, "PLT.11.2.1", "Only one of the two me= thods, getPortletInputStream or getReader, can be " + + JSR286_98(new TCK(98, "PLT.11.2.1"), JSR168_63, "Only one of the two me= thods, getPortletInputStream or getReader, can be " + "used during an action request. If the input stream is obtained, a c= all to the getReader must throw an " + "IllegalStateException. Similarly, if the reader is obtained, a call= to the getPortletInputStream must throw " + "an IllegalStateException."), - JSR286_99(new TCK(99), "PLT.11.2.1", "If the user request HTTP POST dat= a is of type " + + JSR286_99(new TCK(99, "PLT.11.2.1"), "If the user request HTTP POST dat= a is of type " + "application/x-www-form-urlencoded, this data has been already proce= ssed by the portal/portlet-container and " + "is available as request parameters. The getPortletInputStream and g= etReader methods must throw an " + "IllegalStateException if called."), = // PLT.12 Portlet Responses = - JSR286_100(new TCK(100), "PLT.12.1.3", "The getNamespace method must pr= ovide the portlet with a mechanism that " + + JSR286_100(new TCK(100, "PLT.12.1.3"), "The getNamespace method must pr= ovide the portlet with a mechanism that " + "ensures the uniqueness of the returned string in the whole portal p= age"), - JSR286_101(new TCK(101), "PLT.12.1.3", "The getNamespace method must re= turn the same value for the lifetime of " + + JSR286_101(new TCK(101, "PLT.12.1.3"), "The getNamespace method must re= turn the same value for the lifetime of " + "the portlet window."), - JSR286_102(new TCK(102), "PLT.12.1.3", "The getNamespace method must re= turn a valid identifier as defined in the " + + JSR286_102(new TCK(102, "PLT.12.1.3"), "The getNamespace method must re= turn a valid identifier as defined in the " + "3.8 Identifier Section of the Java Language Specification Second Ed= ition."), - JSR286_103(new TCK(103), "PLT.12.2.1", "A call to any of the setRenderP= arameter methods must replace any " + + JSR286_103(new TCK(103, "PLT.12.2.1"), "A call to any of the setRenderP= arameter methods must replace any " + "parameter with the same name previously set."), - JSR286_104(new TCK(104), "PLT.12.2.2", "If a portlet attempts to set a = portlet mode that it is not allowed to switch " + + JSR286_104(new TCK(104, "PLT.12.2.2"), "If a portlet attempts to set a = portlet mode that it is not allowed to switch " + "to, a PortletModeException must be thrown."), - JSR286_105(new TCK(105), "PLT.12.2.2", "If a portlet attempts to set a = window state that it is not allowed to switch " + + JSR286_105(new TCK(105, "PLT.12.2.2"), "If a portlet attempts to set a = window state that it is not allowed to switch " + "to, a WindowStateException must be thrown."), - JSR286_106(new TCK(106), "PLT.12.3.1", "The sendRedirect(String locatio= n) method instructs the portal/portlet-container " + + JSR286_106(new TCK(106, "PLT.12.3.1"), "The sendRedirect(String locatio= n) method instructs the portal/portlet-container " + "to set the appropriate headers and content body to redirect the use= r to a different URL. A fully qualified URL " + "or a full path URL must be specified. If a relative path URL is giv= en, an IllegalArgumentException must be thrown."), - JSR286_107(new TCK(107), "PLT.12.3.1", "If the sendRedirect(String loca= tion) method is called after the setPortletMode, " + + JSR286_107(new TCK(107, "PLT.12.3.1"), "If the sendRedirect(String loca= tion) method is called after the setPortletMode, " + "setWindowState, setRenderParameter or setRenderParameters methods o= f the ActionResponse interface, an " + "IllegalStateException must be thrown and the redirection must not b= e executed."), - JSR286_108(new TCK(108), "PLT.12.3.1", "If a relative path URL is given= , an IllegalArgumentException must be thrown."), - JSR286_109(new TCK(109), "PLT.12.3.1", "The portlet container must atta= ch a render URL with the currently set " + + JSR286_108(new TCK(108, "PLT.12.3.1"), "If a relative path URL is given= , an IllegalArgumentException must be thrown."), + JSR286_109(new TCK(109, "PLT.12.3.1"), "The portlet container must atta= ch a render URL with the currently set " + "portlet mode, window state and render parameters on the ActionRespo= nse and the current public render parameters."), - JSR286_110(new TCK(110), "PLT.12.3.1", "The attached URL must be availa= ble as query parameter value under the " + + JSR286_110(new TCK(110, "PLT.12.3.1"), "The attached URL must be availa= ble as query parameter value under the " + "key provided with the renderUrlParamName parameter."), - JSR286_111(new TCK(111), "PLT.12.3.1", "New values for portlet mode, wi= ndow state, private or public render " + + JSR286_111(new TCK(111, "PLT.12.3.1"), "New values for portlet mode, wi= ndow state, private or public render " + "parameters must be encoded in the attached render URLcxi,"), - JSR286_112(new TCK(112), "PLT.12.3.1", "For the render response the set= ContentType method must throw an " + + JSR286_112(new TCK(112, "PLT.12.3.1"), "For the render response the set= ContentType method must throw an " + "IllegalArgumentException if the content type set does not match (in= cluding wildcard matching) any of the " + "content types returned by the getResponseContentType method of the = PortletRequest objectcxii."), - JSR286_113(new TCK(113), "PLT.12.3.1", "If the portlet has set a conten= t type, the getContentType method must " + + JSR286_113(new TCK(113, "PLT.12.3.1"), "If the portlet has set a conten= t type, the getContentType method must " + "return it. Otherwise, the getContentType method must return null."), - JSR286_114(new TCK(114), "PLT.12.5.2", "A portlet may generate its cont= ent by writing to the OutputStream or to " + + JSR286_114(new TCK(114, "PLT.12.5.2"), "A portlet may generate its cont= ent by writing to the OutputStream or to " + "the Writer of the MimeResponse object. A portlet must use only one = of these objects. The portlet container must " + "throw an IllegalStateException if a portlet attempts to use both."), - JSR286_115(new TCK(115), "PLT.12.5.5", "The getBufferSize method return= s the size of the underlying buffer being " + + JSR286_115(new TCK(115, "PLT.12.5.5"), "The getBufferSize method return= s the size of the underlying buffer being " + "used. If no buffering is being used, this method must return the in= t value of 0 (zero)."), - JSR286_116(new TCK(116), "PLT.12.5.5", "The portlet can request a prefe= rred buffer size by using the setBufferSize " + + JSR286_116(new TCK(116, "PLT.12.5.5"), "The portlet can request a prefe= rred buffer size by using the setBufferSize " + "method. The buffer assigned is not required to be the size requeste= d by the portlet, but must be at least as " + "large as the size requested."), - JSR286_117(new TCK(117), "PLT.12.5.5", "The reset method clears data in= the buffer when the response is not " + + JSR286_117(new TCK(117, "PLT.12.5.5"), "The reset method clears data in= the buffer when the response is not " + "committed. Properties set by the portlet prior to the reset call mu= st be cleared as well."), - JSR286_118(new TCK(118), "PLT.12.5.5", "If the response is committed an= d the reset or resetBuffer method is called, " + + JSR286_118(new TCK(118, "PLT.12.5.5"), "If the response is committed an= d the reset or resetBuffer method is called, " + "an IllegalStateException must be thrown."), - JSR286_119(new TCK(119), "PLT.12.5.5", "The response and its associated= buffer must be unchanged."), - JSR286_120(new TCK(120), "PLT.12.5.5", "When using a buffer, the contai= ner must immediately flush the contents of " + + JSR286_119(new TCK(119, "PLT.12.5.5"), "The response and its associated= buffer must be unchanged."), + JSR286_120(new TCK(120, "PLT.12.5.5"), "When using a buffer, the contai= ner must immediately flush the contents of " + "a filled buffer to the portal application."), - JSR286_121(new TCK(121), Status.specUntestable(""), "PLT.12.6.1", "The = setTitle method must be called before the " + + JSR286_121(new TCK(121, "PLT.12.6.1"), Status.specUntestable(""), "The = setTitle method must be called before the " + "output of the portlet has been committed, if called after it should= be ignored."), = = // PLT.13 Resource Serving = - JSR286_122(new TCK(122), "PLT.13.1.4", "The portlet must be able to get= the HTTP method with which this request " + + JSR286_122(new TCK(122, "PLT.13.1.4"), "The portlet must be able to get= the HTTP method with which this request " + "was made, for example, GET, POST, or PUT, via the getMethod call on= the ResourceRequest."), - JSR286_123(new TCK(123), "PLT.13.1.5", "The portlet must be able to get= the resource ID that was set on the resource " + + JSR286_123(new TCK(123, "PLT.13.1.5"), "The portlet must be able to get= the resource ID that was set on the resource " + "URL with the setResourceID method via the getResourceID method from= the resource request."), - JSR286_124(new TCK(124), "PLT.13.1.5", "If no resource ID was set on th= e resource URL the getResourceID method must " + + JSR286_124(new TCK(124, "PLT.13.1.5"), "If no resource ID was set on th= e resource URL the getResourceID method must " + "return null."), - JSR286_125(new TCK(125), "PLT.13.1.6", "When an end user invokes such a= resource URL the portlet container must " + + JSR286_125(new TCK(125, "PLT.13.1.6"), "When an end user invokes such a= resource URL the portlet container must " + "call the serveResource method of the portlet or return a valid cach= ed result for this resource URL"), - JSR286_126(new TCK(126), "PLT.13.1.6", "The portlet container must not = call the processAction or processEvent " + + JSR286_126(new TCK(126, "PLT.13.1.6"), "The portlet container must not = call the processAction or processEvent " + "method."), - JSR286_127(new TCK(127), "PLT.13.1.6", "ResourceURLs cannot change the = current portlet mode, window state or " + + JSR286_127(new TCK(127, "PLT.13.1.6"), "ResourceURLs cannot change the = current portlet mode, window state or " + "render parameters"), - JSR286_128(new TCK(128), "PLT.13.1.6", "If a parameter is set that has = the same name as a render parameter that " + + JSR286_128(new TCK(128, "PLT.13.1.6"), "If a parameter is set that has = the same name as a render parameter that " + "this resource URL contains, the render parameter values must be the= last entries in the parameter value array."), - JSR286_129(new TCK(129), "PLT.13.1.7", "If portlet URLs are included in= the markup, portals / portlet containers " + + JSR286_129(new TCK(129, "PLT.13.1.7"), "If portlet URLs are included in= the markup, portals / portlet containers " + "must create correct portlet URLs for all text-based markup types."), - JSR286_130(new TCK(130), "PLT.13.1.7", "Setting a cachability different= from FULL must result in an " + + JSR286_130(new TCK(130, "PLT.13.1.7"), "Setting a cachability different= from FULL must result in an " + "IllegalStateException"), - JSR286_131(new TCK(131), "PLT.13.1.7", "Attempts to create URLs that ar= e not of type FULL or are not resource " + + JSR286_131(new TCK(131, "PLT.13.1.7"), "Attempts to create URLs that ar= e not of type FULL or are not resource " + "URLs in the current or a downstream response must result in\n" + "an IllegalStateException"), - JSR286_132(new TCK(132), "PLT.13.1.7", "Creating other URLs, e.g. resou= rce URLs of type PAGE or action or render " + + JSR286_132(new TCK(132, "PLT.13.1.7"), "Creating other URLs, e.g. resou= rce URLs of type PAGE or action or render " + "URLs, must result in an IllegalStateException"), = = @@ -780,448 +783,448 @@ = // PLT.15 Coordination between portlets = - JSR286_133(new TCK(133), "PLT.15.2.2", "The event must always have a na= me and may optionally have a value."), - JSR286_134(new TCK(134), "PLT.15.2.2", "If the event has a value it mus= t be based on the type defined in the " + + JSR286_133(new TCK(133, "PLT.15.2.2"), "The event must always have a na= me and may optionally have a value."), + JSR286_134(new TCK(134, "PLT.15.2.2"), "If the event has a value it mus= t be based on the type defined in the " + "deployment descriptor." ), - JSR286_135(new TCK(135), "PLT.15.2.3", "The portlet can publish events = via the StateAwareResponse.setEvent " + + JSR286_135(new TCK(135, "PLT.15.2.3"), "The portlet can publish events = via the StateAwareResponse.setEvent " + "method."), - JSR286_136(new TCK(136), "PLT.15.2.3", "It is also valid to call StateA= wareResponse.setEvent multiple times " + + JSR286_136(new TCK(136, "PLT.15.2.3"), "It is also valid to call StateA= wareResponse.setEvent multiple times " + "in the current processAction or processEvent method." ), - JSR286_137(new TCK(137), "PLT.15.2.3", "If only the local part is speci= fied the namespace must be the default " + + JSR286_137(new TCK(137, "PLT.15.2.3"), "If only the local part is speci= fied the namespace must be the default " + "namespace defined in the portlet deployment descriptor with the def= ault namespace element."), - JSR286_138(new TCK(138), "PLT.15.2.3", "If no such element is provided = in the portlet deployment descriptor the " + + JSR286_138(new TCK(138, "PLT.15.2.3"), "If no such element is provided = in the portlet deployment descriptor the " + "XML default namespace javax.xml.XMLConstants.NULL_NS_URI must be as= sumed."), - JSR286_139(new TCK(139), "PLT.15.2.3", "Otherwise the setEvent method o= n the StateAwareResponse must throw a " + + JSR286_139(new TCK(139, "PLT.15.2.3"), "Otherwise the setEvent method o= n the StateAwareResponse must throw a " + "java.lang.IllegalArgumentException."), - JSR286_140(new TCK(140), "PLT.15.2.4.1", "The event definition must con= tain an event name."), - JSR286_141(new TCK(141), "PLT.15.2.4.1", "The portlet container must us= e the event name entry in the portlet " + + JSR286_140(new TCK(140, "PLT.15.2.4.1"), "The event definition must con= tain an event name."), + JSR286_141(new TCK(141, "PLT.15.2.4.1"), "The portlet container must us= e the event name entry in the portlet " + "deployment descriptor as event name when submitting an event to the= portlet."), - JSR286_142(new TCK(142), "PLT.15.2.4", "The portlet can send events whi= ch are not declared in the portlet " + + JSR286_142(new TCK(142, "PLT.15.2.4"), "The portlet can send events whi= ch are not declared in the portlet " + "deployment descriptor at runtime using the setEvent method on eithe= r the ActionResponse or EventResponse."), - JSR286_143(new TCK(143), "PLT.15.2.5", "Events are valid only in the cu= rrent client request and the portlet " + + JSR286_143(new TCK(143, "PLT.15.2.5"), "Events are valid only in the cu= rrent client request and the portlet " + "container must therefore deliver all events within the current clie= nt request."), - JSR286_144(new TCK(144), "PLT.15.2.5", "Event distribution must be seri= alized for a specific portlet window per " + + JSR286_144(new TCK(144, "PLT.15.2.5"), "Event distribution must be seri= alized for a specific portlet window per " + "client request so that at any given time a portlet window is only p= rocessing one event in the processEvent " + "method for the current client request."), - JSR286_145(new TCK(145), "PLT.15.2.5", "Portlet event processing may oc= cur after the processing of the action, " + + JSR286_145(new TCK(145, "PLT.15.2.5"), "Portlet event processing may oc= cur after the processing of the action, " + "if the portlet was target of an action URL, and must be finished be= fore the render phase."), - JSR286_146(new TCK(146), "PLT.15.2.6", "If a portlet throws an exceptio= n in the processEvent method, all operations" + + JSR286_146(new TCK(146, "PLT.15.2.6"), "If a portlet throws an exceptio= n in the processEvent method, all operations" + " on the EventResponse must be ignored."), - JSR286_147(new TCK(147), "PLT.15.2.6", "If a permanent unavailability i= s indicated by the UnavailableException," + + JSR286_147(new TCK(147, "PLT.15.2.6"), "If a permanent unavailability i= s indicated by the UnavailableException," + " the portlet container must remove the portlet from service immedia= tely, call the portlet=E2=80=99s destroy method," + " and release the portlet object."), = // PLT.17 Portlet Preferences = - JSR286_148(new TCK(148), "PLT.17.1", "Preferences attributes can be set= to null"), - JSR286_149(new TCK(149), "PLT.17.1", "Preferences values must not be mo= dified if the values in the Map are altered"), - JSR286_150(new TCK(150), "PLT.17.1", "The reset method must reset a pre= ference attribute to its default value. " + + JSR286_148(new TCK(148, "PLT.17.1"), "Preferences attributes can be set= to null"), + JSR286_149(new TCK(149, "PLT.17.1"), "Preferences values must not be mo= dified if the values in the Map are altered"), + JSR286_150(new TCK(150, "PLT.17.1"), "The reset method must reset a pre= ference attribute to its default value. " + "If there is no default value, the preference attribute must be dele= ted."), - JSR286_151(new TCK(151), "PLT.17.1", "If a preference attribute is read= only, the setValue, setValues and reset " + + JSR286_151(new TCK(151, "PLT.17.1"), "If a preference attribute is read= only, the setValue, setValues and reset " + "methods must throw a ReadOnlyException when the portlet is in any o= f the standard modes."), - JSR286_152(new TCK(152), "PLT.17.1", "The store method must persist all= the changes made to the PortletPreferences " + + JSR286_152(new TCK(152, "PLT.17.1"), "The store method must persist all= the changes made to the PortletPreferences " + "object in the persistent store."), - JSR286_153(new TCK(153), "PLT.17.1", "The store method must be conducte= d as an atomic transaction regardless of how " + + JSR286_153(new TCK(153, "PLT.17.1"), "The store method must be conducte= d as an atomic transaction regardless of how " + "many preference attributes have been modified."), - JSR286_154(new TCK(154), "PLT.17.1", "All changes made to PortletPrefer= ences object not followed by a call to the " + + JSR286_154(new TCK(154, "PLT.17.1"), "All changes made to PortletPrefer= ences object not followed by a call to the " + "store method must be discarded when the portlet finishes the proces= sAction, processEvent, or serveResource method."), - JSR286_155(new TCK(155), "PLT.17.1", "If the store method is invoked wi= thin the scope of a render method invocation, " + + JSR286_155(new TCK(155, "PLT.17.1"), "If the store method is invoked wi= thin the scope of a render method invocation, " + "it must throw an IllegalStateException."), - JSR286_156(new TCK(156), "PLT.17.1", "The PortletPreferences object mus= t reflect the current values of the " + + JSR286_156(new TCK(156, "PLT.17.1"), "The PortletPreferences object mus= t reflect the current values of the " + "persistent store when the portlet container invokes the processActi= on, processEvent, render and serveResource " + "methods of the portlet."), - JSR286_157(new TCK(157), "PLT.17.3", "If a preference attribute definit= ion does not contain the read-only element " + + JSR286_157(new TCK(157, "PLT.17.3"), "If a preference attribute definit= ion does not contain the read-only element " + "set to true, the preference attribute is modifiable when the portle= t is processing an action request in any " + "of the standard portlet modes (VIEW, EDIT or HELP)."), - JSR286_158(new TCK(158), "PLT.17.3", "Portlets are not restricted to us= e preference attributes defined in the " + + JSR286_158(new TCK(158, "PLT.17.3"), "Portlets are not restricted to us= e preference attributes defined in the " + "deployment descriptor. They can programmatically add preference att= ributes using names not defined in the " + "deployment descriptor. These preferences attributes must be treated= as modifiable attributes."), - JSR286_159(new TCK(159), "PLT.17.4", "When a validator is associated wi= th the preferences of a portlet definition, " + + JSR286_159(new TCK(159, "PLT.17.4"), "When a validator is associated wi= th the preferences of a portlet definition, " + "the store method of the PortletPreferences implementation must invo= ke the validate method of the validator " + "before writing the changes to the persistent store."), - JSR286_160(new TCK(160), "PLT.17.4", "If a ValidatorException is thrown= , the portlet container must cancel the " + + JSR286_160(new TCK(160, "PLT.17.4"), "If a ValidatorException is thrown= , the portlet container must cancel the " + "store operation and it must propagate the exception to the portlet.= "), - JSR286_161(new TCK(161), "PLT.17.4", "If the validation is successful, = the store operation must be completed"), + JSR286_161(new TCK(161, "PLT.17.4"), "If the validation is successful, = the store operation must be completed"), = = // PLT.18 Sessions = - JSR286_162(new TCK(162), "PLT.18.1", "For portlets within the same port= let application, a portlet container must " + + JSR286_162(new TCK(162, "PLT.18.1"), "For portlets within the same port= let application, a portlet container must " + "ensure that every portlet request generated as result of a group of= requests originated from the portal to " + "complete a single client request receive or acquire the same sessio= n."), - JSR286_163(new TCK(163), "PLT.18.1", "In addition, if within these port= let requests more than one portlet creates " + + JSR286_163(new TCK(163, "PLT.18.1"), "In addition, if within these port= let requests more than one portlet creates " + "a session, the session object must be the same for all the portlets= in the same portlet application"), - JSR286_164(new TCK(164), "PLT.18.2", "PortletSession objects must be sc= oped at the portlet application context level."), - JSR286_165(new TCK(165), "PLT.18.2", "The portlet container must not sh= are the PortletSession object or the " + + JSR286_164(new TCK(164, "PLT.18.2"), "PortletSession objects must be sc= oped at the portlet application context level."), + JSR286_165(new TCK(165, "PLT.18.2"), "The portlet container must not sh= are the PortletSession object or the " + "attributes stored in it among different portlet applications or amo= ng different user sessions."), - JSR286_166(new TCK(166), "PLT.18.3", "Any object stored in the session = using the APPLICATION_SCOPE is available " + + JSR286_166(new TCK(166, "PLT.18.3"), "Any object stored in the session = using the APPLICATION_SCOPE is available " + "to any other portlet that belongs to the same portlet application a= nd that handles a request identified as " + "being a part of the same session."), - JSR286_167(new TCK(167), "PLT.18.3", "Objects stored in the session usi= ng the PORTLET_SCOPE must be available to " + + JSR286_167(new TCK(167, "PLT.18.3"), "Objects stored in the session usi= ng the PORTLET_SCOPE must be available to " + "the portlet during requests for the same portlet window that the ob= jects where stored from."), - JSR286_168(new TCK(168), "PLT.18.3", "The object must be stored in the = APPLICATION_SCOPE with the following " + + JSR286_168(new TCK(168, "PLT.18.3"), "The object must be stored in the = APPLICATION_SCOPE with the following " + "fabricated attribute name =E2=80=98javax.portlet.p.?=E2=80=99. is a unique identification for the " + "portlet window (assigned by the portal/portlet-container) that must= be equal to the ID returned by the PortletRequest.getWindowID() method and= not contain a =E2=80=98?=E2=80=99 character."), - JSR286_169(new TCK(169), "PLT.18.4", "The container must ensure that al= l attributes placed in the PortletSession " + + JSR286_169(new TCK(169, "PLT.18.4"), "The container must ensure that al= l attributes placed in the PortletSession " + "are also available in the HttpSession of the portlet application. A= direct consequence of this is that data " + "stored in the HttpSession by servlets or JSPs of the Portlet Applic= ation is accessible to portlets through " + "the PortletSession in the portlet application scope."), - JSR286_170(new TCK(170), "PLT.18.4", "Conversely, data stored by portle= ts in the PortletSession in the portlet " + + JSR286_170(new TCK(170, "PLT.18.4"), "Conversely, data stored by portle= ts in the PortletSession in the portlet " + "application scope is accessible to servlets and JSPs through the Ht= tpSession."), - JSR286_171(new TCK(171), "PLT.18.4", "If the HttpSession object is inva= lidated, the PortletSession object must " + + JSR286_171(new TCK(171, "PLT.18.4"), "If the HttpSession object is inva= lidated, the PortletSession object must " + "also be invalidated by the portlet container."), - JSR286_172(new TCK(172), "PLT.18.4", "If the PortletSession object is i= nvalidated by a portlet, the portlet " + + JSR286_172(new TCK(172, "PLT.18.4"), "If the PortletSession object is i= nvalidated by a portlet, the portlet " + "container must invalidate the associated HttpSession object."), - JSR286_173(new TCK(173), "PLT.18.4.1", "The getAttribute, setAttribute,= removeAttribute and getAttributeNames " + + JSR286_173(new TCK(173, "PLT.18.4.1"), "The getAttribute, setAttribute,= removeAttribute and getAttributeNames " + "methods of the PortletSession interface must provide the same funct= ionality as the methods of the HttpSession " + "interface with identical names adhering to the following rules: The= attribute names must be the same if " + "APPLICATION_SCOPE scope is used."), - JSR286_174(new TCK(174), "PLT.18.4.1", "The getAttribute, setAttribute,= removeAttribute and getAttributeNames " + + JSR286_174(new TCK(174, "PLT.18.4.1"), "The getAttribute, setAttribute,= removeAttribute and getAttributeNames " + "methods of the PortletSession interface must provide the same funct= ionality as the methods of the HttpSession " + "interface with identical names adhering to the following rules: The= attribute name has to conform with the " + "specified prefixing if PORTLET_SCOPE is used."), - JSR286_175(new TCK(175), "PLT.18.4.1", "The getAttribute, setAttribute,= removeAttribute and getAttributeNames " + + JSR286_175(new TCK(175, "PLT.18.4.1"), "The getAttribute, setAttribute,= removeAttribute and getAttributeNames " + "methods of the PortletSession interface must provide the same funct= ionality as the methods of the HttpSession " + "interface with identical names adhering to the following rules: The= variant of these methods that does not " + "receive a scope must be treated as PORTLET_SCOPE."), - JSR286_176(new TCK(176), "PLT.18.9(servlet spec)", "These consideration= s include Threading Issues, Distributed " + + JSR286_176(new TCK(176, "PLT.18.9(servlet spec)"), "These consideration= s include Threading Issues, Distributed " + "Environments and Client Semantics."), = = = // PLT.19 Dispatching Requests to Servlets and JSPs = - JSR286_177(new TCK(177), "PLT.19.1", "The getRequestDispatcher method t= akes a String argument describing a path " + + JSR286_177(new TCK(177, "PLT.19.1"), "The getRequestDispatcher method t= akes a String argument describing a path " + "within the scope of the PortletContext of a portlet application. Th= is path must begin with a =E2=80=98/=E2=80=99 and it is " + "relative to the PortletContext root."), - JSR286_178(new TCK(178), "PLT.19.1", "If no resource can be resolved ba= sed on the given path or name the methods " + + JSR286_178(new TCK(178, "PLT.19.1"), "If no resource can be resolved ba= sed on the given path or name the methods " + "must return null."), - JSR286_179(new TCK(179), "PLT.19.1.1", "The parameters associated with = a PortletRequestDispatcher are scoped to " + + JSR286_179(new TCK(179, "PLT.19.1.1"), "The parameters associated with = a PortletRequestDispatcher are scoped to " + "apply only for the duration of the include call."), - JSR286_180(new TCK(180), "PLT.19.2", "The parameters to these methods m= ust be the request and response arguments " + + JSR286_180(new TCK(180, "PLT.19.2"), "The parameters to these methods m= ust be the request and response arguments " + "that were passed in via the corresponding lifecycle method (e.g. pr= ocessAction, processEvent, serveResource, " + "render) , or the request and response arguments must be instances o= f the corresponding subclasses of the request " + "and response wrapper classes that were introduced for version 2.0 o= f the specification."), - JSR286_181(new TCK(181), "PLT.19.2", "The portlet container must ensure= that the servlet or JSP called through a" + + JSR286_181(new TCK(181, "PLT.19.2"), "The portlet container must ensure= that the servlet or JSP called through a" + " PortletRequestDispatcher is called in the same thread as the Portl= etRequestDispatcher include invocation"), - JSR286_182(new TCK(182), "PLT.19.3", "Servlets and JSPs included from p= ortlets in the render method must be handled " + + JSR286_182(new TCK(182, "PLT.19.3"), "Servlets and JSPs included from p= ortlets in the render method must be handled " + "as HTTP GET requests."), - JSR286_183(new TCK(183), "PLT.19.3.1", "Except for servlets obtained by= using the getNamedDispatcher method, a " + + JSR286_183(new TCK(183, "PLT.19.3.1"), "Except for servlets obtained by= using the getNamedDispatcher method, a " + "servlet or JSP being used from within an include call has access to= the path used to obtain the " + "PortletRequestDispatcher. The following request attributes must be = set: javax.servlet.include.request_uri, " + "javax.servlet.include.context_path, javax.servlet.include.servlet_p= ath, javax.servlet.include.path_info, " + "javax.servlet.include.query_string"), - JSR286_184(new TCK(184), "PLT.19.3.2", "These attributes must be the sa= me Portlet API objects accessible to the " + + JSR286_184(new TCK(184, "PLT.19.3.2"), "These attributes must be the sa= me Portlet API objects accessible to the " + "portlet doing the include call."), = // PLT.19.3.3 Request and Response Objects for Included Servlets/JSPs f= rom within the Action and Event processing Methods - JSR286_185(new TCK(185), "PLT.19.3.3", "The following methods of the Ht= tpServletRequest must return null: " + + JSR286_185(new TCK(185, "PLT.19.3.3"), "The following methods of the Ht= tpServletRequest must return null: " + "getRemoteAddr, getRemoteHost, getRealPath, getLocalAddress, getLoca= lName, and getRequestURL."), - JSR286_186(new TCK(186), "PLT.19.3.3", "The following methods of the Ht= tpServletRequest must return =E2=80=980=E2=80=99: " + + JSR286_186(new TCK(186, "PLT.19.3.3"), "The following methods of the Ht= tpServletRequest must return =E2=80=980=E2=80=99: " + "getRemotePort and getLocalPort."), - JSR286_187(new TCK(187), "PLT.19.3.3", "The following methods of the Ht= tpServletRequest must return the path " + + JSR286_187(new TCK(187, "PLT.19.3.3"), "The following methods of the Ht= tpServletRequest must return the path " + "and query string information used to obtain the PortletRequestDispa= tcher object: getPathInfo, " + "getPathTranslated, getQueryString, getRequestURI and getServletPath= ."), - JSR286_188(new TCK(188), "PLT.19.3.3", "The following methods of the Ht= tpServletRequest must be equivalent " + + JSR286_188(new TCK(188, "PLT.19.3.3"), "The following methods of the Ht= tpServletRequest must be equivalent " + "to the methods of the PortletRequest of similar name: getScheme, ge= tServerName, getServerPort, getAttribute, " + "getAttributeNames, setAttribute, removeAttribute, getLocale, getLoc= ales, isSecure, getAuthType,\n" + "getContextPath, getRemoteUser, getUserPrincipal, getRequestedSessio= nId, isRequestedSessionIdValid, getCookies."), - JSR286_189(new TCK(189), "PLT.19.3.3", "The following methods of the Ht= tpServletRequest must be equivalent to " + + JSR286_189(new TCK(189, "PLT.19.3.3"), "The following methods of the Ht= tpServletRequest must be equivalent to " + "the methods of the PortletRequest of similar name with the provisio= n defined in PLT.19.1.1 Query Strings " + "in Request Dispatcher Paths Section: getParameter, getParameterName= s, getParameterValues and getParameterMap."), - JSR286_190(new TCK(190), "PLT.19.3.3", "In case of an include from proc= essAction, the following methods of the " + + JSR286_190(new TCK(190, "PLT.19.3.3"), "In case of an include from proc= essAction, the following methods of the " + "HttpServletRequest must be based on the corresponding methods of th= e\n" + "ActionRequest: getCharacterEncoding, setCharacterEncoding, getConte= ntType, getInputStream, getContentLength, " + "getMethod and getReader."), - JSR286_191(new TCK(191), "PLT.19.3.3", "In case of an include from proc= essEvent, the following methods of the " + + JSR286_191(new TCK(191, "PLT.19.3.3"), "In case of an include from proc= essEvent, the following methods of the " + "HttpServletRequest must do no operations and/or return null: getCha= racterEncoding, setCharacterEncoding, " + "getContentType, getInputStream and getReader"), - JSR286_192(new TCK(192), "PLT.19.3.3", "The getContentLength method of = the HttpServletRequest must return 0."), - JSR286_193(new TCK(193), "PLT.19.3.3", "The getMethod method of the HTT= PServletRequest must be based on the " + + JSR286_192(new TCK(192, "PLT.19.3.3"), "The getContentLength method of = the HttpServletRequest must return 0."), + JSR286_193(new TCK(193, "PLT.19.3.3"), "The getMethod method of the HTT= PServletRequest must be based on the " + "corresponding method of the EventRequest, which must provide the na= me of the HTTP method with which the " + "original action request was made."), - JSR286_194(new TCK(194), "PLT.19.3.3", "The following methods of the Ht= tpServletRequest must be based on the " + + JSR286_194(new TCK(194, "PLT.19.3.3"), "The following methods of the Ht= tpServletRequest must be based on the " + "properties provided by the getProperties method of the PortletReque= st interface: getHeader, getHeaders, " + "getHeaderNames, getDateHeader and getIntHeader."), - JSR286_195(new TCK(195), "PLT.19.3.3", "The following methods of the Ht= tpServletRequest must provide the " + + JSR286_195(new TCK(195, "PLT.19.3.3"), "The following methods of the Ht= tpServletRequest must provide the " + "functionality defined by the Servlet Specification: getRequestDispa= tcher, isUserInRole, getSession, " + "isRequestedSessionIdFromCookie, isRequestedSessionIdFromURL and isR= equestedSessionIdFromUrl."), - JSR286_196(new TCK(196), "PLT.19.3.3", "The getProtocol method of the H= ttpServletRequest must always return " + + JSR286_196(new TCK(196, "PLT.19.3.3"), "The getProtocol method of the H= ttpServletRequest must always return " + "=E2=80=98HTTP/1.1=E2=80=99.The getProtocol method of the HttpServle= tRequest must always return =E2=80=98HTTP/1.1=E2=80=99."), - JSR286_197(new TCK(197), "PLT.19.3.3", "The following methods of the Ht= tpServletResponse must return null: " + + JSR286_197(new TCK(197, "PLT.19.3.3"), "The following methods of the Ht= tpServletResponse must return null: " + "encodeRedirectURL, encodeRedirectUrl, getCharacterEncoding, getCont= entType, getLocale, resetBuffer, reset."), - JSR286_198(new TCK(198), "PLT.19.3.3", "The following method of the Htt= pServletResponse must return 0: getBufferSize."), - JSR286_199(new TCK(199), "PLT.19.3.3", "The following methods of the Ht= tpServletResponse must return an " + + JSR286_198(new TCK(198, "PLT.19.3.3"), "The following method of the Htt= pServletResponse must return 0: getBufferSize."), + JSR286_199(new TCK(199, "PLT.19.3.3"), "The following methods of the Ht= tpServletResponse must return an " + "outputstream / writer that ignores any output written to it: getOut= putStream and getWriter."), - JSR286_200(new TCK(200), "PLT.19.3.3", "The following methods of the Ht= tpServletResponse must be equivalent " + + JSR286_200(new TCK(200, "PLT.19.3.3"), "The following methods of the Ht= tpServletResponse must be equivalent " + "to the methods of the ActionResponse/EventResponse of similar name:= encodeURL and encodeUrl."), - JSR286_201(new TCK(201), Status.specUntestable("impl"), "PLT.19.3.3", "= The following methods of the HttpServletResponse must perform no " + + JSR286_201(new TCK(201, "PLT.19.3.3"), Status.specUntestable("impl"), "= The following methods of the HttpServletResponse must perform no " + "operations: setContentType, setCharacterEncoding, setContentLength,= setLocale, addCookie, sendError, " + "sendRedirect, setDateHeader, addDateHeader, setHeader, addHeader, s= etIntHeader, addIntHeader, setStatus,\n" + "setBufferSize and flushBuffer."), - JSR286_202(new TCK(202), "PLT.19.3.3", "The containsHeader method of th= e HttpServletResponse must return false."), - JSR286_203(new TCK(203), "PLT.19.3.3", "The isCommitted method of the H= ttpServletResponse must return true."), + JSR286_202(new TCK(202, "PLT.19.3.3"), "The containsHeader method of th= e HttpServletResponse must return false."), + JSR286_203(new TCK(203, "PLT.19.3.3"), "The isCommitted method of the H= ttpServletResponse must return true."), = // PLT.19.3.4 Request and Response Objects for Included Servlets/JSPs f= rom within the Render Method - JSR286_204(new TCK(204), "PLT.19.3.4", "The following methods of the Ht= tpServletRequest must return null: " + + JSR286_204(new TCK(204, "PLT.19.3.4"), "The following methods of the Ht= tpServletRequest must return null: " + "getRemoteAddr, getRemoteHost, getLocalAddress, getLocalName, getRea= lPath, and getRequestURL."), - JSR286_205(new TCK(205), "PLT.19.3.4", "The following methods of the Ht= tpServletRequest must return =E2=80=980=E2=80=99: " + + JSR286_205(new TCK(205, "PLT.19.3.4"), "The following methods of the Ht= tpServletRequest must return =E2=80=980=E2=80=99: " + "getRemotePort and getLocalPort."), - JSR286_206(new TCK(206), "PLT.19.3.4", "The following methods of the Ht= tpServletRequest must return the " + + JSR286_206(new TCK(206, "PLT.19.3.4"), "The following methods of the Ht= tpServletRequest must return the " + "path and query string information used to obtain the PortletRequest= Dispatcher object: getPathInfo, " + "getPathTranslated, getQueryString, getRequestURI and getServletPath= ."), - JSR286_207(new TCK(207), "PLT.19.3.4", "The following methods of the Ht= tpServletRequest must be equivalent " + + JSR286_207(new TCK(207, "PLT.19.3.4"), "The following methods of the Ht= tpServletRequest must be equivalent " + "to the methods of the PortletRequest of similar name: getScheme, ge= tServerName, getServerPort, getAttribute, " + "getAttributeNames, setAttribute, removeAttribute, getLocale, getLoc= ales, isSecure, getAuthType, getContextPath, " + "getRemoteUser, getUserPrincipal, getRequestedSessionId, isRequested= SessionIdValid, getCookies."), - JSR286_208(new TCK(208), "PLT.19.3.4", "The following methods of the Ht= tpServletRequest must be equivalent to " + + JSR286_208(new TCK(208, "PLT.19.3.4"), "The following methods of the Ht= tpServletRequest must be equivalent to " + "the methods of the PortletRequest of similar name with the provisio= n defined in PLT.18.1.1 Query Strings in " + "Request Dispatcher Paths Section: getParameter, getParameterNames, = getParameterValues and getParameterMap."), - JSR286_209(new TCK(209), "PLT.19.3.4", "The following methods of the Ht= tpServletRequest must do no operations " + + JSR286_209(new TCK(209, "PLT.19.3.4"), "The following methods of the Ht= tpServletRequest must do no operations " + "and return null: getCharacterEncoding, setCharacterEncoding, getCon= tentType, getInputStream and getReader."), - JSR286_210(new TCK(210), "PLT.19.3.4", "The getContentLength method of = the HttpServletRequest must return 0"), - JSR286_211(new TCK(211), "PLT.19.3.4", "The following methods of the Ht= tpServletRequest must be based on the " + + JSR286_210(new TCK(210, "PLT.19.3.4"), "The getContentLength method of = the HttpServletRequest must return 0"), + JSR286_211(new TCK(211, "PLT.19.3.4"), "The following methods of the Ht= tpServletRequest must be based on the " + "properties provided by the getProperties method of the PortletReque= st interface: getHeader, getHeaders, " + "getHeaderNames, getDateHeader and getIntHeader."), - JSR286_212(new TCK(212), "PLT.19.3.4", "The following methods of the Ht= tpServletRequest must provide the " + + JSR286_212(new TCK(212, "PLT.19.3.4"), "The following methods of the Ht= tpServletRequest must provide the " + "functionality defined by the Servlet Specification: getRequestDispa= tcher, isUserInRole, getSession, " + "isRequestedSessionIdFromCookie, isRequestedSessionIdFromURL and isR= equestedSessionIdFromUrl."), - JSR286_213(new TCK(213), "PLT.19.3.4", "The getMethod method of the Htt= pServletRequest must always return =E2=80=98GET=E2=80=99."), - JSR286_214(new TCK(214), "PLT.19.3.4", "The getProtocol method of the H= ttpServletRequest must always return =E2=80=98HTTP/1.1=E2=80=99."), - JSR286_215(new TCK(215), "PLT.19.3.4", "The following methods of the Ht= tpServletResponse must return null: " + + JSR286_213(new TCK(213, "PLT.19.3.4"), "The getMethod method of the Htt= pServletRequest must always return =E2=80=98GET=E2=80=99."), + JSR286_214(new TCK(214, "PLT.19.3.4"), "The getProtocol method of the H= ttpServletRequest must always return =E2=80=98HTTP/1.1=E2=80=99."), + JSR286_215(new TCK(215, "PLT.19.3.4"), "The following methods of the Ht= tpServletResponse must return null: " + "encodeRedirectURL and encodeRedirectUrl."), - JSR286_216(new TCK(216), "PLT.19.3.4", "The following methods of the Ht= tpServletResponse must be equivalent " + + JSR286_216(new TCK(216, "PLT.19.3.4"), "The following methods of the Ht= tpServletResponse must be equivalent " + "to the methods of the RenderResponse of similar name: getCharacterE= ncoding, setBufferSize, flushBuffer, " + "resetBuffer, reset, getBufferSize, isCommitted, getOutputStream, ge= tWriter, encodeURL and encodeUrl."), - JSR286_217(new TCK(217), Status.specUntestable("impl"), "PLT.19.3.4", "= The following methods of the HttpServletResponse must perform no " + + JSR286_217(new TCK(217, "PLT.19.3.4"), Status.specUntestable("impl"), "= The following methods of the HttpServletResponse must perform no " + "operations: setContentType, setContentLength, setLocale, addCookie,= sendError, sendRedirect, setDateHeader, " + "addDateHeader, setHeader, addHeader, setIntHeader, addIntHeader and= setStatus."), - JSR286_218(new TCK(218), "PLT.19.3.4", "The containsHeader method of th= e HttpServletResponse must return false."), - JSR286_219(new TCK(219), "PLT.19.3.4", "The getLocale method of the Htt= pServletResponse must be based on the " + + JSR286_218(new TCK(218, "PLT.19.3.4"), "The containsHeader method of th= e HttpServletResponse must return false."), + JSR286_219(new TCK(219, "PLT.19.3.4"), "The getLocale method of the Htt= pServletResponse must be based on the " + "getLocale method of the RenderResponse."), = // PLT.19.3.5 Request and Response Objects for Included Servlets/JSPs f= rom within the ServeResource Method - JSR286_220(new TCK(220), "PLT.19.3.5", "The following methods of the Ht= tpServletRequest must return null: " + + JSR286_220(new TCK(220, "PLT.19.3.5"), "The following methods of the Ht= tpServletRequest must return null: " + "getRemoteAddr, getRemoteHost, getLocalAddress, getLocalName, getRea= lPath, and getRequestURL."), - JSR286_221(new TCK(221), "PLT.19.3.5", "The following methods of the Ht= tpServletRequest must return =E2=80=980=E2=80=99:" + + JSR286_221(new TCK(221, "PLT.19.3.5"), "The following methods of the Ht= tpServletRequest must return =E2=80=980=E2=80=99:" + " getRemotePort and getLocalPort."), - JSR286_222(new TCK(222), "PLT.19.3.5", "The following methods of the Ht= tpServletRequest must return the " + + JSR286_222(new TCK(222, "PLT.19.3.5"), "The following methods of the Ht= tpServletRequest must return the " + "path and query string information used to obtain the PortletRequest= Dispatcher object: getPathInfo, " + "getPathTranslated, getQueryString, getRequestURI and getServletPath= ."), - JSR286_223(new TCK(223), "PLT.19.3.5", "The following methods of the Ht= tpServletRequest must be equivalent " + + JSR286_223(new TCK(223, "PLT.19.3.5"), "The following methods of the Ht= tpServletRequest must be equivalent " + "to the methods of the PortletRequest of similar name: getScheme, ge= tServerName, getServerPort, getAttribute, " + "getAttributeNames, setAttribute, removeAttribute, getLocale, getLoc= ales, isSecure, getAuthType,\n" + "getContextPath, getRemoteUser, getUserPrincipal, getRequestedSessio= nId, isRequestedSessionIdValid, getCookies."), - JSR286_224(new TCK(224), "PLT.19.3.5", "The following methods of the Ht= tpServletRequest must be equivalent to " + + JSR286_224(new TCK(224, "PLT.19.3.5"), "The following methods of the Ht= tpServletRequest must be equivalent to " + "the methods of the ResourceRequest of similar name: getCharacterEnc= oding, setCharacterEncoding, getContentType, " + "getMethod, getContentLength and getReader."), - JSR286_225(new TCK(225), "PLT.19.3.5", "The following methods of the Ht= tpServletRequest must be equivalent to " + + JSR286_225(new TCK(225, "PLT.19.3.5"), "The following methods of the Ht= tpServletRequest must be equivalent to " + "the methods of the PortletRequest of similar name with the provisio= n defined in PLT.18.1.1 Query Strings in " + "Request Dispatcher Paths Section: getParameter, getParameterNames, = getParameterValues and getParameterMap."), - JSR286_226(new TCK(226), "PLT.19.3.5", "The following methods of the Ht= tpServletRequest must be based on the " + + JSR286_226(new TCK(226, "PLT.19.3.5"), "The following methods of the Ht= tpServletRequest must be based on the " + "properties provided by the getProperties method of the PortletReque= st interface: getHeader, getHeaders, " + "getHeaderNames, getDateHeader and getIntHeader."), - JSR286_227(new TCK(227), "PLT.19.3.5", "The following methods of the Ht= tpServletRequest must provide the " + + JSR286_227(new TCK(227, "PLT.19.3.5"), "The following methods of the Ht= tpServletRequest must provide the " + "functionality defined by the Servlet Specification: getRequestDispa= tcher, isUserInRole, getSession, " + "isRequestedSessionIdFromCookie, isRequestedSessionIdFromURL and isR= equestedSessionIdFromUrl."), - JSR286_228(new TCK(228), "PLT.19.3.5", "The getProtocol method of the H= ttpServletRequest must always return =E2=80=98HTTP/1.1=E2=80=99."), - JSR286_229(new TCK(229), "PLT.19.3.5", "The following methods of the Ht= tpServletResponse must return null: " + + JSR286_228(new TCK(228, "PLT.19.3.5"), "The getProtocol method of the H= ttpServletRequest must always return =E2=80=98HTTP/1.1=E2=80=99."), + JSR286_229(new TCK(229, "PLT.19.3.5"), "The following methods of the Ht= tpServletResponse must return null: " + "encodeRedirectURL and encodeRedirectUrl."), - JSR286_230(new TCK(230), "PLT.19.3.5", "The following methods of the Ht= tpServletResponse must be equivalent " + + JSR286_230(new TCK(230, "PLT.19.3.5"), "The following methods of the Ht= tpServletResponse must be equivalent " + "to the methods of the ResourceResponse of similar name: getCharacte= rEncoding, setBufferSize, flushBuffer, " + "resetBuffer, reset, getBufferSize, isCommitted, getOutputStream, ge= tWriter, getLocale, encodeURL and encodeUrl."), - JSR286_231(new TCK(231), Status.specUntestable("impl"), "PLT.19.3.5", "= The following methods of the HttpServletResponse must perform no " + + JSR286_231(new TCK(231, "PLT.19.3.5"), Status.specUntestable("impl"), "= The following methods of the HttpServletResponse must perform no " + "operations: sendError, sendRedirect, addCookie, setDateHeader, addD= ateHeader, setHeader, addHeader, " + "setIntHeader, addIntHeader, setContentLength, setCharacterEncoding,= setContentType, setLocale and setStatus."), - JSR286_232(new TCK(232), "PLT.19.3.5", "The containsHeader method of th= e HttpServletResponse must return false."), + JSR286_232(new TCK(232, "PLT.19.3.5"), "The containsHeader method of th= e HttpServletResponse must return false."), = // - JSR286_233(new TCK(233), "PLT.19.3.7", "If the servlet or JSP that is t= he target of a request dispatcher throws a " + + JSR286_233(new TCK(233, "PLT.19.3.7"), "If the servlet or JSP that is t= he target of a request dispatcher throws a " + "runtime exception or a checked exception of type IOException, it mu= st be propagated to the calling portlet."), - JSR286_234(new TCK(234), "PLT.19.3.7", "All other exceptions, including= a ServletException, must be wrapped with a" + + JSR286_234(new TCK(234, "PLT.19.3.7"), "All other exceptions, including= a ServletException, must be wrapped with a" + " PortletException. The root cause of the exception must be set to t= he original exception before being propagated."), - JSR286_235(new TCK(235), "PLT.19.3.8", "Thus the portlet acts as starti= ng point of the include chain and the " + + JSR286_235(new TCK(235, "PLT.19.3.8"), "Thus the portlet acts as starti= ng point of the include chain and the " + "included / forwarded servlet must get the path and query string inf= ormation used to obtain the " + "PortletRequestDispatcher object."), - JSR286_236(new TCK(236), "PLT.19.4", "If output data exists in the resp= onse buffer that has not been committed, " + + JSR286_236(new TCK(236, "PLT.19.4"), "If output data exists in the resp= onse buffer that has not been committed, " + "the content must be cleared before the target servlet=E2=80=99s ser= vice method is called."), - JSR286_237(new TCK(237), "PLT.19.4", "If the response has been committe= d, an IllegalStateException must be thrown."), - JSR286_238(new TCK(238), "PLT.19.4", "Before the forward method of the = RequestDispatcher interface returns, the " + + JSR286_237(new TCK(237, "PLT.19.4"), "If the response has been committe= d, an IllegalStateException must be thrown."), + JSR286_238(new TCK(238, "PLT.19.4"), "Before the forward method of the = RequestDispatcher interface returns, the " + "response content must be sent and committed, and closed by the port= let container."), - JSR286_239(new TCK(239), "PLT.19.4.2", "The following request attribute= s must be set: " + + JSR286_239(new TCK(239, "PLT.19.4.2"), "The following request attribute= s must be set: " + "javax.servlet.forward.request_uri, javax.servlet.forward.context_pa= th, javax.servlet.forward.servlet_path, " + "javax.servlet.forward.path_info, javax.servlet.forward.query_string= "), - JSR286_240(new TCK(240), "PLT.19.4.2", "The values of these attributes = must be equal to the return values of the " + + JSR286_240(new TCK(240, "PLT.19.4.2"), "The values of these attributes = must be equal to the return values of the " + "HttpServletRequest methods getRequestURI, getContextPath, getServle= tPath, getPathInfo, getQueryString " + "respectively, invoked on the request object passed to the first ser= vlet object in the forward call chain."), - JSR286_241(new TCK(241), "PLT.19.4.2", "These attributes are accessible= from the forwarded servlet via the " + + JSR286_241(new TCK(241, "PLT.19.4.2"), "These attributes are accessible= from the forwarded servlet via the " + "getAttribute method on the request object. Note that these attribut= es must always reflect the information " + "in the target of the first forward servlet in the situation that mu= ltiple forwards and subsequent includes " + "are called."), - JSR286_242(new TCK(242), "PLT.19.4.2", "If the forwarded servlet was ob= tained by using the getNamedDispatcher" + + JSR286_242(new TCK(242, "PLT.19.4.2"), "If the forwarded servlet was ob= tained by using the getNamedDispatcher" + " method, these attributes must not be set."), = // PLT.19.4.3 Request and Response Objects for Forwarded Servlets/JSPs = from within the Action and Event processing Methods - JSR286_243(new TCK(243), "PLT.19.4.3", "The following methods of the Ht= tpServletRequest must return null: " + + JSR286_243(new TCK(243, "PLT.19.4.3"), "The following methods of the Ht= tpServletRequest must return null: " + "getRemoteAddr, getRemoteHost, getLocalAddress, getLocalName, getRea= lPath, and getRequestURL."), - JSR286_244(new TCK(244), "PLT.19.4.3", "The following methods of the Ht= tpServletRequest must return =E2=80=980=E2=80=99: " + + JSR286_244(new TCK(244, "PLT.19.4.3"), "The following methods of the Ht= tpServletRequest must return =E2=80=980=E2=80=99: " + "getRemotePort and getLocalPort."), - JSR286_245(new TCK(245), "PLT.19.4.3", "The following methods of the Ht= tpServletRequest must return the path " + + JSR286_245(new TCK(245, "PLT.19.4.3"), "The following methods of the Ht= tpServletRequest must return the path " + "and query string information used to obtain the PortletRequestDispa= tcher object: getPathInfo, getPathTranslated, " + "getQueryString, getRequestURI and getServletPath."), - JSR286_246(new TCK(246), "PLT.19.4.3", "The following methods of the Ht= tpServletRequest must be equivalent to " + + JSR286_246(new TCK(246, "PLT.19.4.3"), "The following methods of the Ht= tpServletRequest must be equivalent to " + "the methods of the PortletRequest of similar name: getScheme, getSe= rverName, getServerPort, getAttribute, " + "getAttributeNames, setAttribute, removeAttribute, getLocale, getLoc= ales, isSecure, getAuthType, getContextPath, " + "getRemoteUser, getUserPrincipal, getRequestedSessionId, isRequested= SessionIdValid, getCookies."), - JSR286_247(new TCK(247), "PLT.19.4.3", "The following methods of the Ht= tpServletRequest must be equivalent to the " + + JSR286_247(new TCK(247, "PLT.19.4.3"), "The following methods of the Ht= tpServletRequest must be equivalent to the " + "methods of the PortletRequest of similar name with the provision de= fined in PLT.18.1.1 Query Strings in Request " + "Dispatcher Paths Section: getParameter, getParameterNames, getParam= eterValues and getParameterMap."), - JSR286_248(new TCK(248), "PLT.19.4.3", "In case of a forward from proce= ssAction, the following methods of the " + + JSR286_248(new TCK(248, "PLT.19.4.3"), "In case of a forward from proce= ssAction, the following methods of the " + "HttpServletRequest must be based on the corresponding methods of th= e\n" + "ActionRequest: getCharacterEncoding, setCharacterEncoding, getConte= ntType, getInputStream, getContentLength, " + "getMethod and getReader."), - JSR286_249(new TCK(249), "PLT.19.4.3", "In case of a forward from proce= ssEvent, the following methods of the " + + JSR286_249(new TCK(249, "PLT.19.4.3"), "In case of a forward from proce= ssEvent, the following methods of the " + "HttpServletRequest must do no operations and/or return null: getCha= racterEncoding, setCharacterEncoding, " + "getContentType, getInputStream and getReader."), - JSR286_250(new TCK(250), "PLT.19.4.3", "The getContentLength method of = the HttpServletRequest must return 0."), - JSR286_251(new TCK(251), "PLT.19.4.3", "The getMethod method of the Htt= pServletRequest must be based on the " + + JSR286_250(new TCK(250, "PLT.19.4.3"), "The getContentLength method of = the HttpServletRequest must return 0."), + JSR286_251(new TCK(251, "PLT.19.4.3"), "The getMethod method of the Htt= pServletRequest must be based on the " + "corresponding method of the ActionRequest triggering this event."), - JSR286_252(new TCK(252), "PLT.19.4.3", "The following methods of the Ht= tpServletRequest must be based on the " + + JSR286_252(new TCK(252, "PLT.19.4.3"), "The following methods of the Ht= tpServletRequest must be based on the " + "properties provided by the getProperties method of the PortletReque= st interface: getHeader, getHeaders, " + "getHeaderNames, getDateHeader and getIntHeader."), - JSR286_253(new TCK(253), "PLT.19.4.3", "The following methods of the Ht= tpServletRequest must provide the " + + JSR286_253(new TCK(253, "PLT.19.4.3"), "The following methods of the Ht= tpServletRequest must provide the " + "functionality defined by the Servlet Specification: getRequestDispa= tcher, isUserInRole, getSession, " + "isRequestedSessionIdFromCookie, isRequestedSessionIdFromURL and isR= equestedSessionIdFromUrl."), - JSR286_254(new TCK(254), "PLT.19.4.3", "The getProtocol method of the H= ttpServletRequest must always return " + + JSR286_254(new TCK(254, "PLT.19.4.3"), "The getProtocol method of the H= ttpServletRequest must always return " + "=E2=80=98HTTP/1.1=E2=80=99."), - JSR286_255(new TCK(255), "PLT.19.4.3", "The following methods of the Ht= tpServletResponse must return null: " + + JSR286_255(new TCK(255, "PLT.19.4.3"), "The following methods of the Ht= tpServletResponse must return null: " + "encodeRedirectURL, encodeRedirectUrl, getCharacterEncoding, getCont= entType, getLocale, and getBufferSize."), - JSR286_256(new TCK(256), "PLT.19.4.3", "The following methods of the Ht= tpServletResponse must return an " + + JSR286_256(new TCK(256, "PLT.19.4.3"), "The following methods of the Ht= tpServletResponse must return an " + "outputstream / writer that ignores any output written to it: getOut= putStream and getWriter."), - JSR286_257(new TCK(257), "PLT.19.4.3", "The following methods of the Ht= tpServletResponse must be equivalent " + + JSR286_257(new TCK(257, "PLT.19.4.3"), "The following methods of the Ht= tpServletResponse must be equivalent " + "to the methods of the ActionResponse/EventResponse of similar name:= encodeURL and encodeUrl."), - JSR286_258(new TCK(258), Status.specUntestable("imp"), "PLT.19.4.3", "T= he following methods of the HttpServletResponse must perform no " + + JSR286_258(new TCK(258, "PLT.19.4.3"), Status.specUntestable("imp"), "T= he following methods of the HttpServletResponse must perform no " + "operations: resetBuffer, reset, setContentType, setContentLength,\n= " + "setCharacterEncoding, setLocale, sendError, setDateHeader, addDateH= eader, setHeader, addHeader, setIntHeader, " + "addIntHeader, setStatus, setBufferSize and flushBuffer."), - JSR286_259(new TCK(259), Status.specUntestable("impl"), "PLT.19.4.3", "= The addCookie method of the HttpServletResponse must be based on " + + JSR286_259(new TCK(259, "PLT.19.4.3"), Status.specUntestable("impl"), "= The addCookie method of the HttpServletResponse must be based on " + "addProperty method of the ActionResponse/EventResponse interface."), - JSR286_260(new TCK(260), "PLT.19.4.3", "The containsHeader method of th= e HttpServletResponse must return false."), - JSR286_261(new TCK(261), "PLT.19.4.3", "The isCommitted method of the H= ttpServletResponse must return false."), + JSR286_260(new TCK(260, "PLT.19.4.3"), "The containsHeader method of th= e HttpServletResponse must return false."), + JSR286_261(new TCK(261, "PLT.19.4.3"), "The isCommitted method of the H= ttpServletResponse must return false."), = // PLT.19.4.4 Request and Response Objects for Forwarded Servlets/JSPs = from within the Render Method - JSR286_262(new TCK(262), "PLT.19.4.4", "The following methods of the Ht= tpServletRequest must return null: " + + JSR286_262(new TCK(262, "PLT.19.4.4"), "The following methods of the Ht= tpServletRequest must return null: " + "getRemoteAddr, getRemoteHost, getLocalAddress, getLocalName, getRea= lPath, and getRequestURL."), - JSR286_263(new TCK(263), "PLT.19.4.4", "The following methods of the Ht= tpServletRequest must return =E2=80=980=E2=80=99: " + + JSR286_263(new TCK(263, "PLT.19.4.4"), "The following methods of the Ht= tpServletRequest must return =E2=80=980=E2=80=99: " + "getRemotePort and getLocalPort."), - JSR286_264(new TCK(264), "PLT.19.4.4", "The following methods of the Ht= tpServletRequest must return the " + + JSR286_264(new TCK(264, "PLT.19.4.4"), "The following methods of the Ht= tpServletRequest must return the " + "path and query string information used to obtain the PortletRequest= Dispatcher object: getPathInfo, " + "getPathTranslated, getQueryString, getRequestURI and getServletPath= ."), - JSR286_265(new TCK(265), "PLT.19.4.4", "The following methods of the Ht= tpServletRequest must be equivalent " + + JSR286_265(new TCK(265, "PLT.19.4.4"), "The following methods of the Ht= tpServletRequest must be equivalent " + "to the methods of the PortletRequest of similar name: getScheme, ge= tServerName, getServerPort, getAttribute, " + "getAttributeNames, setAttribute, removeAttribute, getLocale, getLoc= ales, isSecure, getAuthType, " + "getContextPath, getRemoteUser, getUserPrincipal, getRequestedSessio= nId, isRequestedSessionIdValid, getCookies."), - JSR286_266(new TCK(266), "PLT.19.4.4", "The following methods of the Ht= tpServletRequest must be equivalent " + + JSR286_266(new TCK(266, "PLT.19.4.4"), "The following methods of the Ht= tpServletRequest must be equivalent " + "to the methods of the PortletRequest of similar name with the provi= sion defined in PLT.18.1.1 Query Strings " + "in Request Dispatcher Paths Section: getParameter, getParameterName= s, getParameterValues and getParameterMap."), - JSR286_267(new TCK(267), "PLT.19.4.4", "The following methods of the Ht= tpServletRequest must do no operations " + + JSR286_267(new TCK(267, "PLT.19.4.4"), "The following methods of the Ht= tpServletRequest must do no operations " + "and return null: getCharacterEncoding, setCharacterEncoding, getCon= tentType, getInputStream and getReader."), - JSR286_268(new TCK(268), "PLT.19.4.4", "The getContentLength method of = the HttpServletRequest must return 0."), - JSR286_269(new TCK(269), "PLT.19.4.4", "The following methods of the Ht= tpServletRequest must be based on the " + + JSR286_268(new TCK(268, "PLT.19.4.4"), "The getContentLength method of = the HttpServletRequest must return 0."), + JSR286_269(new TCK(269, "PLT.19.4.4"), "The following methods of the Ht= tpServletRequest must be based on the " + "properties provided by the getProperties method of the PortletReque= st interface: getHeader, getHeaders, " + "getHeaderNames, getDateHeader and getIntHeader."), - JSR286_270(new TCK(270), "PLT.19.4.4", "The following methods of the Ht= tpServletRequest must provide the " + + JSR286_270(new TCK(270, "PLT.19.4.4"), "The following methods of the Ht= tpServletRequest must provide the " + "functionality defined by the Servlet Specification: getRequestDispa= tcher, isUserInRole, getSession, " + "isRequestedSessionIdFromCookie, isRequestedSessionIdFromURL and isR= equestedSessionIdFromUrl."), - JSR286_271(new TCK(271), "PLT.19.4.4", "The getMethod method of the Htt= pServletRequest must always return =E2=80=98GET=E2=80=99."), - JSR286_272(new TCK(272), "PLT.19.4.4", "The getProtocol method of the H= ttpServletRequest must always return =E2=80=98HTTP/1.1=E2=80=99."), - JSR286_273(new TCK(273), "PLT.19.4.4", "The following methods of the Ht= tpServletResponse must return null: " + + JSR286_271(new TCK(271, "PLT.19.4.4"), "The getMethod method of the Htt= pServletRequest must always return =E2=80=98GET=E2=80=99."), + JSR286_272(new TCK(272, "PLT.19.4.4"), "The getProtocol method of the H= ttpServletRequest must always return =E2=80=98HTTP/1.1=E2=80=99."), + JSR286_273(new TCK(273, "PLT.19.4.4"), "The following methods of the Ht= tpServletResponse must return null: " + "encodeRedirectURL and encodeRedirectUrl."), - JSR286_274(new TCK(274), "PLT.19.4.4", "The following methods of the Ht= tpServletResponse must be equivalent " + + JSR286_274(new TCK(274, "PLT.19.4.4"), "The following methods of the Ht= tpServletResponse must be equivalent " + "to the methods of the RenderResponse of similar name: getCharacterE= ncoding, setBufferSize, flushBuffer, " + "resetBuffer, reset, getBufferSize, getLocale, isCommitted, getOutpu= tStream, getWriter, setContentType, " + "encodeURL and encodeUrl."), - JSR286_275(new TCK(275), Status.specUntestable("impl"), "PLT.19.4.4", "= The following methods of the HttpServletResponse must perform no " + + JSR286_275(new TCK(275, "PLT.19.4.4"), Status.specUntestable("impl"), "= The following methods of the HttpServletResponse must perform no " + "operations: setContentLength, setLocale, sendError, sendRedirect, a= nd setStatus."), - JSR286_276(new TCK(276), Status.specUntestable("impl"), "PLT.19.4.4", "= The containsHeader method of the HttpServletResponse must return false."), - JSR286_277(new TCK(277), "PLT.19.4.4", "The following methods of the Ht= tpServletResponse must be based on " + + JSR286_276(new TCK(276, "PLT.19.4.4"), Status.specUntestable("impl"), "= The containsHeader method of the HttpServletResponse must return false."), + JSR286_277(new TCK(277, "PLT.19.4.4"), "The following methods of the Ht= tpServletResponse must be based on " + "the properties provided by the setProperties/addProperties method o= f the RenderResponse interface: addCookie, " + "setDateHeader, addDateHeader, setHeader, addHeader, setIntHeader, a= ddIntHeader."), = // PLT.19.4.5 Request and Response Objects for Forwarded Servlets/JSPs = from within the ServeResource Method - JSR286_278(new TCK(278), "PLT.19.4.5", "The following methods of the Ht= tpServletRequest must return null: " + + JSR286_278(new TCK(278, "PLT.19.4.5"), "The following methods of the Ht= tpServletRequest must return null: " + "getRemoteAddr, getRemoteHost, getLocalAddress, getLocalName, getRea= lPath, and getRequestURL."), - JSR286_279(new TCK(279), "PLT.19.4.5", "The following methods of the Ht= tpServletRequest must return =E2=80=980=E2=80=99: " + + JSR286_279(new TCK(279, "PLT.19.4.5"), "The following methods of the Ht= tpServletRequest must return =E2=80=980=E2=80=99: " + "getRemotePort and getLocalPort."), - JSR286_280(new TCK(280), "PLT.19.4.5", "The following methods of the Ht= tpServletRequest must return the " + + JSR286_280(new TCK(280, "PLT.19.4.5"), "The following methods of the Ht= tpServletRequest must return the " + "path and query string information used to obtain the PortletRequest= Dispatcher object: getPathInfo, " + "getPathTranslated, getQueryString, getRequestURI and getServletPath= ."), - JSR286_281(new TCK(281), "PLT.19.4.5", "The following methods of the Ht= tpServletRequest must be equivalent " + + JSR286_281(new TCK(281, "PLT.19.4.5"), "The following methods of the Ht= tpServletRequest must be equivalent " + "to the methods of the PortletRequest of similar name: getScheme, ge= tServerName, getServerPort, getAttribute, " + "getAttributeNames, setAttribute, removeAttribute, getLocale, getLoc= ales, isSecure, getAuthType, \n" + "getContextPath, getRemoteUser, getUserPrincipal, getRequestedSessio= nId, isRequestedSessionIdValid, getCookies."), - JSR286_282(new TCK(282), "PLT.19.4.5", "The following methods of the Ht= tpServletRequest must be equivalent to " + + JSR286_282(new TCK(282, "PLT.19.4.5"), "The following methods of the Ht= tpServletRequest must be equivalent to " + "the methods of the ResourceRequest of similar name: getCharacterEnc= oding, setCharacterEncoding, getContentType, getMethod and getReader."), - JSR286_283(new TCK(283), "PLT.19.4.5", "The following methods of the Ht= tpServletRequest must be equivalent to " + + JSR286_283(new TCK(283, "PLT.19.4.5"), "The following methods of the Ht= tpServletRequest must be equivalent to " + "the methods of the PortletRequest of similar name with the provisio= n defined in PLT.18.1.1 Query Strings " + "in Request Dispatcher Paths Section: getParameter, getParameterName= s, getParameterValues and getParameterMap."), - JSR286_284(new TCK(284), "PLT.19.4.5", "The following methods of the Ht= tpServletRequest must be based on the " + + JSR286_284(new TCK(284, "PLT.19.4.5"), "The following methods of the Ht= tpServletRequest must be based on the " + "properties provided by the getProperties method of the PortletReque= st interface: getHeader, getHeaders, " + "getHeaderNames, getDateHeader and getIntHeader."), - JSR286_285(new TCK(285), "PLT.19.4.5", "The following methods of the Ht= tpServletRequest must provide the " + + JSR286_285(new TCK(285, "PLT.19.4.5"), "The following methods of the Ht= tpServletRequest must provide the " + "functionality defined by the Servlet Specification: getRequestDispa= tcher, isUserInRole, getSession, " + "isRequestedSessionIdFromCookie, isRequestedSessionIdFromURL and isR= equestedSessionIdFromUrl."), - JSR286_286(new TCK(286), "PLT.19.4.5", "The getProtocol method of the H= ttpServletRequest must always return =E2=80=98HTTP/1.1=E2=80=99."), - JSR286_287(new TCK(287), "PLT.19.4.5", "The following methods of the Ht= tpServletResponse must return null: " + + JSR286_286(new TCK(286, "PLT.19.4.5"), "The getProtocol method of the H= ttpServletRequest must always return =E2=80=98HTTP/1.1=E2=80=99."), + JSR286_287(new TCK(287, "PLT.19.4.5"), "The following methods of the Ht= tpServletResponse must return null: " + "encodeRedirectURL and encodeRedirectUrl."), - JSR286_288(new TCK(288), "PLT.19.4.5", "The following methods of the Ht= tpServletResponse must be equivalent " + + JSR286_288(new TCK(288, "PLT.19.4.5"), "The following methods of the Ht= tpServletResponse must be equivalent " + "to the methods of the ResourceResponse of similar name: getCharacte= rEncoding, setContentType, setBufferSize, " + "flushBuffer, resetBuffer, reset, getBufferSize, isCommitted, getOut= putStream, getWriter, getLocale, encodeURL " + "and encodeUrl."), - JSR286_289(new TCK(289), Status.specUntestable("impl"), "PLT.19.4.5", "= The following methods of the HttpServletResponse must perform no operations= : " + + JSR286_289(new TCK(289, "PLT.19.4.5"), Status.specUntestable("impl"), "= The following methods of the HttpServletResponse must perform no operations= : " + "sendError, sendRedirect."), - JSR286_290(new TCK(290), Status.specUntestable("impl"), "PLT.19.4.5", "= The containsHeader method of the HttpServletResponse must return false."), + JSR286_290(new TCK(290, "PLT.19.4.5"), Status.specUntestable("impl"), "= The containsHeader method of the HttpServletResponse must return false."), = // - JSR286_291(new TCK(291), "PLT.19.5", "Since the Java Servlet Specificat= ion V2.4 you can specify servlet filters " + + JSR286_291(new TCK(291, "PLT.19.5"), "Since the Java Servlet Specificat= ion V2.4 you can specify servlet filters " + "for request dispatcher include calls. Portlet containers must suppo= rt this capability for included servlets " + "via the PortletRequestDispatcher."), = = // PLT.20 Portlet Filter = - JSR286_292(new TCK(292), "PLT.20.2.1", "After deployment of the portlet= application, and before a request causes " + + JSR286_292(new TCK(292, "PLT.20.2.1"), "After deployment of the portlet= application, and before a request causes " + "the portlet container to access a portlet, the portlet container mu= st locate the list of portlet filters that " + "must be applied to the portlet as described below."), - JSR286_293(new TCK(293), "PLT.20.2.1", "The portlet container must ensu= re that it has instantiated a filter of the " + + JSR286_293(new TCK(293, "PLT.20.2.1"), "The portlet container must ensu= re that it has instantiated a filter of the " + "appropriate class for each filter in the list, and called its init(= FilterConfig config) method"), - JSR286_294(new TCK(294), "PLT.20.2.1", "Depending on the target method = of doFilter call the PortletRequest and " + + JSR286_294(new TCK(294, "PLT.20.2.1"), "Depending on the target method = of doFilter call the PortletRequest and " + "PortletResponse must be instances of the following interfaces: Acti= onRequest and ActionResponse for " + "processAction calls, EventRequest and EventResponse for processEven= t calls, RenderRequest and RenderResponse " + "for render calls, ResourceRequest and ResourceResponse for serveRes= ource calls"), - JSR286_295(new TCK(295), "PLT.20.2.1", "Before a filter instance can be= removed from service by the portlet " + + JSR286_295(new TCK(295, "PLT.20.2.1"), "Before a filter instance can be= removed from service by the portlet " + "container, the portlet container must first call the destroy method= on the filter to enable the filter to " + "release any resources and perform other cleanup operations."), - JSR286_296(new TCK(296), "PLT.20.2.2", "When a filter invokes the doFil= ter method on the portlet container=E2=80=99s " + + JSR286_296(new TCK(296, "PLT.20.2.2"), "When a filter invokes the doFil= ter method on the portlet container=E2=80=99s " + "filter chain implementation, the container must ensure that the req= uest and\n" + "response object that it passes to the next component in the filter = chain, or to the target portlet if the " + "filter was the last in the chain, is the same object that was passe= d into the doFilter method by the calling " + "filter or one of the above mentioned wrappers."), - JSR286_297(new TCK(297), "PLT.20.2.4", "The portlet container must inst= antiate exactly one instance of the Java " + + JSR286_297(new TCK(297, "PLT.20.2.4"), "The portlet container must inst= antiate exactly one instance of the Java " + "class defining the filter per filter declaration in the deployment = descriptor."), - JSR286_298(new TCK(298), "PLT.20.2.4", "Filters can be associated with = groups of portlets using the =E2=80=98*=E2=80=99 character as " + + JSR286_298(new TCK(298, "PLT.20.2.4"), "Filters can be associated with = groups of portlets using the =E2=80=98*=E2=80=99 character as " + "a wildcard at the end of a string to indicate that the filter must = be applied to any portlet whose name starts " + "with the characters before the =E2=80=9C*=E2=80=9D character."), - JSR286_299(new TCK(299), "PLT.20.2.4", "The portlet container is free t= o add additional filters at any place in this " + + JSR286_299(new TCK(299, "PLT.20.2.4"), "The portlet container is free t= o add additional filters at any place in this " + "filter chain, but must not remove filters matching a specific portl= et."), - JSR286_300(new TCK(300), "PLT.20.2.5", "A portlet filter can be applied= to different lifecycle method calls: " + + JSR286_300(new TCK(300, "PLT.20.2.5"), "A portlet filter can be applied= to different lifecycle method calls: " + "processAction, processEvent, render, serveResource"), - JSR286_301(new TCK(301), "PLT.20.2.5", "Thus the filter must define the= lifecycle method for which the filter " + + JSR286_301(new TCK(301, "PLT.20.2.5"), "Thus the filter must define the= lifecycle method for which the filter " + "is written in the element of the element."), = // PLT.21 User Information = - JSR286_302(new TCK(302), Status.specUntestable("impl"), "PLT.21.2", "If= the request is done in the context of " + + JSR286_302(new TCK(302, "PLT.21.2"), Status.specUntestable("impl"), "If= the request is done in the context of " + "an un-authenticated user, calls to the getAttribute method of the r= equest using the USER_INFO constant must " + "return null."), = @@ -1232,30 +1235,30 @@ = // PLT.23 Portlet Applications = - JSR286_303(new TCK(303), Status.specUntestable(""), "PLT.23.2", "The po= rtlet container must enforce a one to one " + + JSR286_303(new TCK(303, "PLT.23.2"), Status.specUntestable(""), "The po= rtlet container must enforce a one to one " + "correspondence between a portlet application and a PortletContext."= ), - JSR286_304(new TCK(304), Status.specUntestable(""), "PLT.23.2", "If the= application is a distributed application, " + + JSR286_304(new TCK(304, "PLT.23.2"), Status.specUntestable(""), "If the= application is a distributed application, " + "the portlet container must create an instance per VM."), - JSR286_305(new TCK(305), Status.specUntestable(""), "PLT.23.5", "The po= rtlet container must use the same classloader " + + JSR286_305(new TCK(305, "PLT.23.5"), Status.specUntestable(""), "The po= rtlet container must use the same classloader " + "the servlet container uses for the web application resources for lo= ading the portlets and related resources " + "within the portlet application."), - JSR286_306(new TCK(306), "PLT.23.5(servlet spec)", "The portlet contain= er must ensure that requirements defined " + + JSR286_306(new TCK(306, "PLT.23.5(servlet spec)"), "The portlet contain= er must ensure that requirements defined " + "in the Servlet Specification SRV.9.7.1 and SRV.9.7.2 Sections are f= ulfilled."), = = // PLT.24 Security = = - JSR286_307(new TCK(307), "PLT.24.2", "The values that the Portlet API g= etRemoteUser and getUserPrincipal methods " + + JSR286_307(new TCK(307, "PLT.24.2"), "The values that the Portlet API g= etRemoteUser and getUserPrincipal methods " + "return the same values returned by the equivalent methods of the se= rvlet response object."), - JSR286_308(new TCK(308), "PLT.24.3", "The container uses the mapping of= security-role-ref to security-role when " + + JSR286_308(new TCK(308, "PLT.24.3"), "The container uses the mapping of= security-role-ref to security-role when " + "determining the return value of the call."), - JSR286_309(new TCK(309), "PLT.24.3", "If the security-role-ref element = does not define a role-link element, the " + + JSR286_309(new TCK(309, "PLT.24.3"), "If the security-role-ref element = does not define a role-link element, the " + "container must default to checking the role-name element argument a= gainst the list of securityrole elements " + "defined in the web.xml deployment descriptor of the portlet applica= tion."), - JSR286_310(new TCK(310), "PLT.24.4", "When it is specified, the contain= er must propagate the security identity of " + + JSR286_310(new TCK(310, "PLT.24.4"), "When it is specified, the contain= er must propagate the security identity of " + "the caller to the EJB layer in terms of the security role name defi= ned in the run-as element."), - JSR286_311(new TCK(311), "PLT.24.4", "The security role name must be on= e of the security role names defined for the " + + JSR286_311(new TCK(311, "PLT.24.4"), "The security role name must be on= e of the security role names defined for the " + "web.xml deployment descriptor."), = = @@ -1265,94 +1268,99 @@ // PLT.26 Portlet Tag Library = = - JSR286_312(new TCK(312), "PLT.26.1", "The portlet-container must provid= e an implementation of the portlet tag library"), - JSR286_313(new TCK(313), "PLT.26.1", "The defineObjects tag must define= the following variables in the JSP page: " + + JSR286_312(new TCK(312, "PLT.26.1"), "The portlet-container must provid= e an implementation of the portlet tag library"), + JSR286_313(new TCK(313, "PLT.26.1"), "The defineObjects tag must define= the following variables in the JSP page: " + "[REF TO THE SPEC]"), - JSR286_314(new TCK(314), Status.specUntestable(""), "PLT.26.2", "The de= fineObjects tag must not define any " + + JSR286_314(new TCK(314, "PLT.26.2"), Status.specUntestable(""), "The de= fineObjects tag must not define any " + "attribute and it must not contain any body content"), - JSR286_315(new TCK(315), "PLT.26.2", "The portlet actionURL tag creates= a URL that must point to the current " + + JSR286_315(new TCK(315, "PLT.26.2"), "The portlet actionURL tag creates= a URL that must point to the current " + "portlet and must trigger an action request with the supplied parame= ters"), - JSR286_316(new TCK(316), "PLT.26.2", "If the specified window state is = illegal for the current request, a" + + JSR286_316(new TCK(316, "PLT.26.2"), "If the specified window state is = illegal for the current request, a" + " JspException must be thrown."), - JSR286_317(new TCK(317), "PLT.26.2", "If a window state is notset for a= URL, it should stay the same as the " + + JSR286_317(new TCK(317, "PLT.26.2"), "If a window state is notset for a= URL, it should stay the same as the " + "window state of the current request."), - JSR286_318(new TCK(318), "PLT.26.2", "portletMode (Type: String, non-re= quired) =E2=80=93 indicates the portlet mode " + + JSR286_318(new TCK(318, "PLT.26.2"), "portletMode (Type: String, non-re= quired) =E2=80=93 indicates the portlet mode " + "that the portlet must have when this link is executed, if no error = condition ocurred"), - JSR286_319(new TCK(319), "PLT.26.2", "If the specified portlet mode is = illegal for the current request, a " + + JSR286_319(new TCK(319, "PLT.26.2"), "If the specified portlet mode is = illegal for the current request, a " + "JspException must be thrown."), - JSR286_320(new TCK(320), "PLT.26.2", "If a portlet mode is not set for = a URL, it must stay the same as the mode of " + + JSR286_320(new TCK(320, "PLT.26.2"), "If a portlet mode is not set for = a URL, it must stay the same as the mode of " + "the current request."), - JSR286_321(new TCK(321), "PLT.26.2", "If the result is exported as a JS= P scoped variable, defined via the var " + + JSR286_321(new TCK(321, "PLT.26.2"), "If the result is exported as a JS= P scoped variable, defined via the var " + "attributes, nothing is written to the current JspWriter."), - JSR286_322(new TCK(322), "PLT.26.2", "If the given variable name alread= y exists in the scope of the page or it " + + JSR286_322(new TCK(322, "PLT.26.2"), "If the given variable name alread= y exists in the scope of the page or it " + "is used within an iteration loop, the new value overwrites the old = one."), - JSR286_323(new TCK(323), Status.specUntestable(""), "PLT.26.2", "If the= specified security setting is not supported " + + JSR286_323(new TCK(323, "PLT.26.2"), Status.specUntestable(""), "If the= specified security setting is not supported " + "by the run-time environment, a JspException must be thrown"), - JSR286_324(new TCK(324), Status.specUntestable(""), "PLT.26.2", "copyCu= rrentRenderParameters (Type: boolean, " + + JSR286_324(new TCK(324, "PLT.26.2"), Status.specUntestable(""), "copyCu= rrentRenderParameters (Type: boolean, " + "non-required) =E2=80=93 if set to true requests that the private re= nder parameters of the portlet of the current " + "request must be attached to this URL."), - JSR286_325(new TCK(325), Status.specUntestable(""), "PLT.26.2", "If add= itional tags are specified " + + JSR286_325(new TCK(325, "PLT.26.2"), Status.specUntestable(""), "If add= itional tags are specified " + "parameters with the same name as an existing render parameter will = get merged and the value defined in " + "additional tags must be pre-pended."), - JSR286_326(new TCK(326), Status.specUntestable(""), "PLT.26.2", "escape= Xml (Type: boolean, non-required) =E2=80=93 " + + JSR286_326(new TCK(326, "PLT.26.2"), Status.specUntestable(""), "escape= Xml (Type: boolean, non-required) =E2=80=93 " + "determines whether characters <,>,&,=E2=80=99,=E2=80=9D in the resu= lting output should be converted to their corresponding " + "character entity codes (=E2=80=98<=E2=80=99 gets converted to =E2= =80=98<=E2=80=99, =E2=80=98>=E2=80=99 gets converted to =E2=80=98>=E2= =80=99 =E2=80=98&=E2=80=99 gets converted to " + "=E2=80=98&=E2=80=99, =E2=80=98=E2=80=98=E2=80=99 gets converted= to =E2=80=98'=E2=80=99, =E2=80=98=E2=80=9D=E2=80=99 gets converted to= =E2=80=98"=E2=80=99)."), - JSR286_327(new TCK(327), "PLT.26.3", "The portlet renderURL tag creates= a URL that must point to the current " + + JSR286_327(new TCK(327, "PLT.26.3"), "The portlet renderURL tag creates= a URL that must point to the current " + "portlet and must trigger a render request with the supplied paramet= ers."), - JSR286_328(new TCK(328), "PLT.26.3", "If the specified window state is = illegal for the current request, a " + + JSR286_328(new TCK(328, "PLT.26.3"), "If the specified window state is = illegal for the current request, a " + "JspException must be thrown."), - JSR286_329(new TCK(329), "PLT.26.3", "If a window state is not set for = a URL, it should stay the same as the " + + JSR286_329(new TCK(329, "PLT.26.3"), "If a window state is not set for = a URL, it should stay the same as the " + "window state of the current request."), - JSR286_330(new TCK(330), "PLT.26.3", "portletMode (Type: String, non-re= quired) =E2=80=93 indicates the portlet mode that " + + JSR286_330(new TCK(330, "PLT.26.3"), "portletMode (Type: String, non-re= quired) =E2=80=93 indicates the portlet mode that " + "the portlet must have when this link is executed, if not error cond= ition ocurred."), - JSR286_331(new TCK(331), "PLT.26.3", "If the specified portlet mode is = illegal for the current request, a " + + JSR286_331(new TCK(331, "PLT.26.3"), "If the specified portlet mode is = illegal for the current request, a " + "JspException must be thrown."), - JSR286_332(new TCK(332), "PLT.26.3", "If a portlet mode is not set for = a URL, it must stay the same as the " + + JSR286_332(new TCK(332, "PLT.26.3"), "If a portlet mode is not set for = a URL, it must stay the same as the " + "mode of the current request."), - JSR286_333(new TCK(333), "PLT.26.3", "If the result is exported as a JS= P scoped variable, defined via the var " + + JSR286_333(new TCK(333, "PLT.26.3"), "If the result is exported as a JS= P scoped variable, defined via the var " + "attributes, nothing is written to the current JspWriter."), - JSR286_334(new TCK(334), "PLT.26.3", "If the given variable name alread= y exists in the scope of the page or it " + + JSR286_334(new TCK(334, "PLT.26.3"), "If the given variable name alread= y exists in the scope of the page or it " + "is used within an iteration loop, the new value overwrites the old = one"), - JSR286_335(new TCK(335), Status.specUntestable(""), "PLT.26.3", "If the= security is not set for a URL, it must " + + JSR286_335(new TCK(335, "PLT.26.3"), Status.specUntestable(""), "If the= security is not set for a URL, it must " + "stay the same as the security setting of the current request."), - JSR286_336(new TCK(336), Status.specUntestable(""), "PLT.26.3", "copyCu= rrentRenderParameters (Type: boolean, " + + JSR286_336(new TCK(336, "PLT.26.3"), Status.specUntestable(""), "copyCu= rrentRenderParameters (Type: boolean, " + "non-required) =E2=80=93 if set to true requests that the private re= nder parameters of the portlet of the current " + "request must attached to this URL."), - JSR286_337(new TCK(337), Status.specUntestable(""), "PLT.26.3", "If add= itional tags are specified " + + JSR286_337(new TCK(337, "PLT.26.3"), Status.specUntestable(""), "If add= itional tags are specified " + "parameters with the same name as an existing render parameter will = get merged and the value defined in " + "additional tags must be pre-pended."), - JSR286_338(new TCK(338), Status.specUntestable(""), "PLT.26.3", "escape= Xml (Type: boolean, non-required) =E2=80=93 " + + JSR286_338(new TCK(338, "PLT.26.3"), Status.specUntestable(""), "escape= Xml (Type: boolean, non-required) =E2=80=93 " + "deterrmines whether characters <,>,&,=E2=80=99,=E2=80=9D in the res= ulting output should be converted to their corresponding " + "character entity codes (=E2=80=98<=E2=80=99 gets converted to =E2= =80=98<=E2=80=99, =E2=80=98>=E2=80=99 gets converted to =E2=80=98>=E2= =80=99 =E2=80=98&=E2=80=99 gets converted to " + "=E2=80=98&=E2=80=99, =E2=80=98=E2=80=98=E2=80=99 gets converted= to =E2=80=98'=E2=80=99, =E2=80=98=E2=80=9D=E2=80=99 gets converted to= =E2=80=98"=E2=80=99)."), - JSR286_339(new TCK(339), "PLT.26.4", "The portlet resourceURL tag creat= es a URL that must point to the current " + + JSR286_339(new TCK(339, "PLT.26.4"), "The portlet resourceURL tag creat= es a URL that must point to the current " + "portlet and must trigger a serveResource request with the supplied = parameters"), - JSR286_340(new TCK(340), "PLT.26.4", "The resourceURL must preserve the= current portlet mode, window state and " + + JSR286_340(new TCK(340, "PLT.26.4"), "The resourceURL must preserve the= current portlet mode, window state and " + "render parameters."), - JSR286_341(new TCK(341), "PLT.26.4", "If such a parameter has the same = name as a render parameter in this URL, " + + JSR286_341(new TCK(341, "PLT.26.4"), "If such a parameter has the same = name as a render parameter in this URL, " + "the render parameter value must be the last value in the attribute = value array."), - JSR286_342(new TCK(342), "PLT.26.4", "If the result is exported as a JS= P scoped variable, defined via the var " + + JSR286_342(new TCK(342, "PLT.26.4"), "If the result is exported as a JS= P scoped variable, defined via the var " + "attributes, nothing is written to the current JspWriter"), - JSR286_343(new TCK(343), "PLT.26.4", "If the given variable name alread= y exists in the scope of the page or it " + + JSR286_343(new TCK(343, "PLT.26.4"), "If the given variable name alread= y exists in the scope of the page or it " + "is used within an iteration loop, the new value overwrites the old = one."), - JSR286_344(new TCK(344), Status.specUntestable(""), "PLT.26.4", "If the= security is not set for a URL, it must " + + JSR286_344(new TCK(344, "PLT.26.4"), Status.specUntestable(""), "If the= security is not set for a URL, it must " + "stay the same as the security setting of the current request."), - JSR286_345(new TCK(345), Status.specUntestable(""), "PLT.26.4", "escape= Xml (Type: boolean, non-required) =E2=80=93 " + + JSR286_345(new TCK(345, "PLT.26.4"), Status.specUntestable(""), "escape= Xml (Type: boolean, non-required) =E2=80=93 " + "determines whether characters <,>,&,=E2=80=99,=E2=80=9D in the resu= lting output should be converted to their corresponding " + "character entity codes (=E2=80=98<=E2=80=99 gets converted to =E2= =80=98<=E2=80=99, =E2=80=98>=E2=80=99 gets converted to =E2=80=98>=E2= =80=99 =E2=80=98&=E2=80=99 gets converted to " + "=E2=80=98&=E2=80=99, =E2=80=98=E2=80=98=E2=80=99 gets converted= to =E2=80=98'=E2=80=99, =E2=80=98=E2=80=9D=E2=80=99 gets converted to= =E2=80=98"=E2=80=99)."), - JSR286_346(new TCK(346), "PLT.26.5", "This tag produces a unique value = for the current portlet and must match " + + JSR286_346(new TCK(346, "PLT.26.5"), "This tag produces a unique value = for the current portlet and must match " + "the value of PortletResponse.getNamespace method."), - JSR286_347(new TCK(347), "PLT.26.6", "This tag defines a parameter that= may be added to an actionURL, renderURL " + + JSR286_347(new TCK(347, "PLT.26.6"), "This tag defines a parameter that= may be added to an actionURL, renderURL " + "or resourceURL."), - JSR286_348(new TCK(348), Status.specUntestable(""), "PLT.26.6", "The pa= ram tag must not contain any body content."), - JSR286_349(new TCK(349), "PLT.26.6", "If the param tag has an empty val= ue the specified parameter name must be " + + JSR286_348(new TCK(348, "PLT.26.6"), Status.specUntestable(""), "The pa= ram tag must not contain any body content."), + JSR286_349(new TCK(349, "PLT.26.6"), "If the param tag has an empty val= ue the specified parameter name must be " + "removed from the URL."), - JSR286_350(new TCK(350), "PLT.26.6", "If the same name of a parameter o= ccurs more than once within an actionURL, " + + JSR286_350(new TCK(350, "PLT.26.6"), "If the same name of a parameter o= ccurs more than once within an actionURL, " + "renderURL or resourceURL the values must be delivered as parameter = value array with the values in the order " + - "of the declaration within the URL tag.") - = + "of the declaration within the URL tag."), + + // ********************************************************************= ********************************************** + + API_BASE_URL_1(new API(BaseURL.class), "parameter escapeXML"), + API_BASE_URL_2(new API(BaseURL.class), "write methods throws an IOExcep= tion is propagated to caller") + ; = /** @@ -1364,17 +1372,27 @@ } = /** - * A reference to a JSR 168 TCK test. + * A reference to a JSR TCK test. */ public static class TCK extends Ref { = /** . */ - private int index; + private final int index; = + /** . */ + private final String section; + + public TCK(int index, String section) + { + this.index =3D index; + this.section =3D section; + } + public TCK(int index) { this.index =3D index; + this.section =3D null; } = public int getIndex() @@ -1382,12 +1400,39 @@ return index; } = + public String getSection() + { + return section; + } + public String toString() { - return "TCK[" + index + "]"; + return "TCK[index=3D" + index + ",section=3D" + section + "]"; } } = + public static class API extends Ref + { + + /** . */ + private Class clazz; + + public API(Class clazz) + { + this.clazz =3D clazz; + } + + public Class getClazz() + { + return clazz; + } + + public String toString() + { + return "API[" + clazz.getSimpleName() + "]"; + } + } + /** * The status of an assertion. */ @@ -1522,9 +1567,6 @@ private final String description; = /** . */ - private final String section; - - /** . */ private Status status; = /** . */ @@ -1535,38 +1577,23 @@ this(ref, new Active(), description); } = - Assertion(Ref ref, String section, String description) + Assertion(Ref ref, Assertion assertion, String description) { - this(ref, new Active(), description, section); + this(ref, assertion, new Active(), description); } = - Assertion(Ref ref, Assertion assertion, String section, String descript= ion) - { - this(ref, assertion, new Active(), description, section); - } - Assertion(Ref ref, Status status, String description) { this.ref =3D ref; this.description =3D description; - this.section =3D null; this.status =3D status; } = - Assertion(Ref ref, Status status, String section, String description) + Assertion(Ref ref, Assertion assertion, Status status, String descripti= on) { this.ref =3D ref; this.description =3D description; - this.section =3D section; this.status =3D status; - } - - Assertion(Ref ref, Assertion assertion, Status status, String section, = String description) - { - this.ref =3D ref; - this.description =3D description; - this.section =3D section; - this.status =3D status; this.assertion =3D assertion; } = @@ -1587,11 +1614,6 @@ return status; } = - public String getSection() - { - return section; - } - public Assertion getAssertion() { return assertion; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletURLRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-25 10:16:10 UTC (rev 10105) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-25 12:32:25 UTC (rev 10106) @@ -29,6 +29,7 @@ import org.jboss.portal.common.text.FastURLEncoder; import org.jboss.portal.common.util.Base64; import org.jboss.portal.portlet.ContainerURL; +import org.jboss.portal.portlet.URLFormat; import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.PageNavigationalStateSeri= alization; import org.jboss.portal.portlet.controller.state.StateControllerContext; @@ -76,7 +77,7 @@ this.serialization =3D new PageNavigationalStateSerialization(stateC= ontext); } = - private String renderURL(Map parameters, Boolean wantSe= cure, Boolean wantAuthenticated, boolean relative) + private String renderURL(Map parameters, URLFormat form= at) { CharBuffer buffer =3D new CharBuffer(); buffer.append(clientReq.getScheme()); @@ -94,12 +95,15 @@ } = // + String parameterSeparator =3D format.getWantEscapeXML() =3D=3D Boole= an.TRUE ? "&" : "&"; + + // boolean first =3D true; for (Map.Entry entry : parameters.entrySet()) { String name =3D entry.getKey(); String value =3D entry.getValue(); - buffer.append(first ? '?' : '&'); + buffer.append(first ? "?" : parameterSeparator); buffer.append(name, FastURLEncoder.getUTF8Instance()); buffer.append('=3D'); buffer.append(value, FastURLEncoder.getUTF8Instance()); @@ -111,7 +115,7 @@ return clientResp.encodeURL(url); } = - public String renderURL(Boolean wantSecure, Boolean wantAuthenticated, = boolean relative) + public String renderURL(URLFormat format) { String pageState =3D null; if (pageNS !=3D null) @@ -132,10 +136,10 @@ } = // - return renderURL(parameters, wantSecure, wantAuthenticated, relative= ); + return renderURL(parameters, format); } = - public String renderURL(String windowId, ContainerURL containerURL, Boo= lean wantSecure, Boolean wantAuthenticated, boolean relative) + public String renderURL(String windowId, ContainerURL containerURL, URL= Format format) { ControllerRequestParameterMapFactory factory =3D new ControllerReque= stParameterMapFactory(stateContext); = @@ -146,6 +150,6 @@ parameters.put(TYPE, PORTLET_TYPE); = // - return renderURL(parameters, wantSecure, wantAuthenticated, relative= ); + return renderURL(parameters, format); } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/TestPortletInvocationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvocationContext.java 2008-02-25 10:16:10 UTC (rev 1= 0105) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvocationContext.java 2008-02-25 12:32:25 UTC (rev 1= 0106) @@ -27,7 +27,7 @@ import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResol= ver; import org.jboss.portal.common.util.MarkupInfo; import org.jboss.portal.portlet.ContainerURL; -import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; +import org.jboss.portal.portlet.URLFormat; import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.StateControllerContext; import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext; @@ -102,8 +102,8 @@ return clientResponse; } = - public String renderURL(ContainerURL containerURL, Boolean wantSecure, = Boolean wantAuthenticated, boolean relative) + public String renderURL(ContainerURL containerURL, URLFormat format) { - return urlRenderer.renderURL(windowId, containerURL, wantSecure, wan= tAuthenticated, relative); + return urlRenderer.renderURL(windowId, containerURL, format); } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-25 10:16:10 UTC (rev 10105) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-25 12:32:25 UTC (rev 10106) @@ -26,6 +26,7 @@ import org.jboss.portal.portlet.test.URLParameterConstants; import org.jboss.portal.portlet.PortletInvoker; import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.URLFormat; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.ErrorResponse; @@ -142,7 +143,7 @@ context.getClientResponse()); = // - String url =3D renderer.renderURL(null, null, true); + String url =3D renderer.renderURL(new URLFormat(null, null,= true, null)); = // resp.sendRedirect(url); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-25 10:16:10 UTC (rev 10105) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-25 12:32:25 UTC (rev 10106) @@ -30,6 +30,7 @@ import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; import org.jboss.portal.portlet.RenderURL; import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.URLFormat; = import javax.servlet.jsp.JspException; import javax.servlet.jsp.JspWriter; @@ -130,7 +131,7 @@ try { JspWriter out =3D pageContext.getOut(); - String renderedURL =3D renderer.renderURL(portletTag.result.getWi= ndowDef().getWindowId(), url, null, null, true); + String renderedURL =3D renderer.renderURL(portletTag.result.getWi= ndowDef().getWindowId(), url, new URLFormat(null, null, true, null)); out.write(renderedURL); } catch (IOException e) Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-25 10:16:10 UTC (= rev 10105) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-25 12:32:25 UTC (= rev 10106) @@ -371,6 +371,7 @@ + Added: modules/portlet/trunk/test/src/test/resources/jsr286/api/portleturl-= war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/api/portleturl-war= /WEB-INF/portlet.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr286/api/portleturl-war= /WEB-INF/portlet.xml 2008-02-25 12:32:25 UTC (rev 10106) @@ -0,0 +1,38 @@ + + + + + + + UniversalTestPortletA + org.jboss.portal.test.portlet.framework.UTP1 + + text/html + + + + Added: modules/portlet/trunk/test/src/test/resources/jsr286/api/portleturl-= war/WEB-INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/api/portleturl-war= /WEB-INF/web.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr286/api/portleturl-war= /WEB-INF/web.xml 2008-02-25 12:32:25 UTC (rev 10106) @@ -0,0 +1,32 @@ + + + + + + + org.jboss.portal.unit.PortletTestSuite + + Modified: modules/portlet/trunk/test/src/test/resources/test/remote-jboss-u= nit.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xm= l 2008-02-25 10:16:10 UTC (rev 10105) +++ modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xm= l 2008-02-25 12:32:25 UTC (rev 10106) @@ -197,6 +197,10 @@ + + + + = --===============3615568026020846655==-- From portal-commits at lists.jboss.org Mon Feb 25 08:41:19 2008 Content-Type: multipart/mixed; boundary="===============2581279222001077130==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10107 - modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/api/portleturl. Date: Mon, 25 Feb 2008 08:41:19 -0500 Message-ID: --===============2581279222001077130== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-25 08:41:19 -0500 (Mon, 25 Feb 2008) New Revision: 10107 Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/api/portleturl/URLWriteThrowsIOExceptionTestCase.java Log: added test case for a writer than throws IOException in baseURL.write() Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/api/portleturl/URLWriteThrowsIOExceptionTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/api/portleturl/URLWriteThrowsIOExceptionTestCase.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/api/portleturl/URLWriteThrowsIOExceptionTestCase.java 2008-02-25 = 13:41:19 UTC (rev 10107) @@ -0,0 +1,87 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.test.portlet.jsr286.api.portleturl; + +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.Assertion; +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import static org.jboss.unit.api.Assert.*; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.BaseURL; +import java.io.IOException; +import java.io.Writer; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)TestCase(Assertion.API_BASE_URL_2) +public class URLWriteThrowsIOExceptionTestCase +{ + public URLWriteThrowsIOExceptionTestCase(PortletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + BaseURL url =3D response.createRenderURL(); + + // + try + { + url.write(new Writer() + { + public void write(char cbuf[], int off, int len) throws = IOException + { + throw new IOException(); + } + + public void flush() throws IOException + { + } + + public void close() throws IOException + { + } + }); + fail("Was expecting an IOException to be thrown"); + } + catch (IOException ignore) + { + } + + // + return new EndTestResponse(); + } + }); + } +} --===============2581279222001077130==-- From portal-commits at lists.jboss.org Mon Feb 25 12:14:57 2008 Content-Type: multipart/mixed; boundary="===============7215662084152705054==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10108 - branches/JBoss_Portal_Branch_2_6/build. Date: Mon, 25 Feb 2008 12:14:57 -0500 Message-ID: --===============7215662084152705054== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-25 12:14:57 -0500 (Mon, 25 Feb 2008) New Revision: 10108 Modified: branches/JBoss_Portal_Branch_2_6/build/distrib.xml Log: Include all files in the bundle version except minimal and all. Modified: branches/JBoss_Portal_Branch_2_6/build/distrib.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_6/build/distrib.xml 2008-02-25 13:41:19 = UTC (rev 10107) +++ branches/JBoss_Portal_Branch_2_6/build/distrib.xml 2008-02-25 17:14:57 = UTC (rev 10108) @@ -318,11 +318,9 @@ - - - - - + + + --===============7215662084152705054==-- From portal-commits at lists.jboss.org Mon Feb 25 12:18:06 2008 Content-Type: multipart/mixed; boundary="===============2410790449865353596==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10109 - branches/JBoss_Portal_Branch_2_7/build. Date: Mon, 25 Feb 2008 12:18:05 -0500 Message-ID: --===============2410790449865353596== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-25 12:18:05 -0500 (Mon, 25 Feb 2008) New Revision: 10109 Modified: branches/JBoss_Portal_Branch_2_7/build/distrib.xml Log: Exclude serverl/all and server/minimal in the bundle, include everything el= se Modified: branches/JBoss_Portal_Branch_2_7/build/distrib.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/build/distrib.xml 2008-02-25 17:14:57 = UTC (rev 10108) +++ branches/JBoss_Portal_Branch_2_7/build/distrib.xml 2008-02-25 17:18:05 = UTC (rev 10109) @@ -318,11 +318,9 @@ - - - - - + + + --===============2410790449865353596==-- From portal-commits at lists.jboss.org Mon Feb 25 17:53:37 2008 Content-Type: multipart/mixed; boundary="===============2523570426315800833==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10110 - modules/web/trunk/web. Date: Mon, 25 Feb 2008 17:53:37 -0500 Message-ID: --===============2523570426315800833== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mwringe Date: 2008-02-25 17:53:37 -0500 (Mon, 25 Feb 2008) New Revision: 10110 Modified: modules/web/trunk/web/pom.xml Log: Fix dependency issue when run under maven 2.0.8 Modified: modules/web/trunk/web/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/web/pom.xml 2008-02-25 17:18:05 UTC (rev 10109) +++ modules/web/trunk/web/pom.xml 2008-02-25 22:53:37 UTC (rev 10110) @@ -21,6 +21,12 @@ org.jboss.portal.common common-common + + + org.codehaus.cargo + cargo-core-uberjar + + sun-servlet --===============2523570426315800833==-- From portal-commits at lists.jboss.org Mon Feb 25 18:12:46 2008 Content-Type: multipart/mixed; boundary="===============2272452729690881742==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10111 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/container and 12 other directories. Date: Mon, 25 Feb 2008 18:12:41 -0500 Message-ID: --===============2272452729690881742== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-25 18:12:41 -0500 (Mon, 25 Feb 2008) New Revision: 10111 Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/portletinterface/ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/portletinterface/UnavailablePortletTestCase.java modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletinterfac= e-war/ modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletinterfac= e-war/WEB-INF/ modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletinterfac= e-war/WEB-INF/portlet.xml modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletinterfac= e-war/WEB-INF/web.xml Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/asp= ects/portlet/ValveInterceptor.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/PortletApplicationContext.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/PortletContainerContext.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/con= tainer/PortletFilterContext.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletContainerImpl.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/con= tainer/PortletApplicationContextSupport.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/con= tainer/PortletContainerContextSupport.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/con= tainer/PortletFilterContextSupport.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/base/A= bstractUniversalTestPortlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletApplicationContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletApplicationDeployment.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletContainerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletFilterContextImpl.java modules/portlet/trunk/test/src/test/build.xml modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/j= boss-beans.xml modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml Log: - fixed the valve interceptor - added test case for valve interceptor unavailability Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/aspects/portlet/ValveInterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/as= pects/portlet/ValveInterceptor.java 2008-02-25 22:53:37 UTC (rev 10110) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/as= pects/portlet/ValveInterceptor.java 2008-02-25 23:12:41 UTC (rev 10111) @@ -23,13 +23,15 @@ package org.jboss.portal.portlet.aspects.portlet; = import org.jboss.portal.common.invocation.InvocationException; -import org.jboss.portal.portlet.container.PortletContainer; +import org.jboss.portal.common.concurrent.Valve; import org.jboss.portal.portlet.container.PortletContainerInvoker; import org.jboss.portal.portlet.container.PortletContainerContext; +import org.jboss.portal.portlet.container.managed.PortletApplicationRegist= ry; import org.jboss.portal.portlet.invocation.PortletInterceptor; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.UnavailableResponse; +import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl; = /** * This aspect has two responsabilities :
          • continue the reque= st only if the portlet container valve is @@ -44,26 +46,57 @@ public class ValveInterceptor extends PortletInterceptor { = + /** . */ + private PortletApplicationRegistry registry; + + public PortletApplicationRegistry getPortletApplicationRegistry() + { + return registry; + } + + public void setPortletApplicationRegistry(PortletApplicationRegistry po= rtletApplicationRegistry) + { + this.registry =3D portletApplicationRegistry; + } + protected Object invoke(PortletInvocation invocation) throws Exception,= InvocationException { - PortletInvocationResponse response =3D (PortletInvocationResponse)in= vocation.invokeNext(); + PortletContainerImpl container =3D (PortletContainerImpl)invocation.= getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PO= RTLET_CONTAINER); = - // Stop the container if necessary - if (response instanceof UnavailableResponse) + // + Valve valve =3D container.getValve(); + + if (valve.beforeInvocation()) { - // This call will wait until all the current threads have exited = the component valve. - // Perhaps this should be done asynchronously as it may lead to a= long delay ? - // It could be made parametrizable too, so the deployer can choos= e what mode is preferable - PortletContainer container =3D (PortletContainer)invocation.getAt= tribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET= _CONTAINER); + PortletInvocationResponse response; = - // Get the context - PortletContainerContext context =3D container.getContext(); + try + { + response =3D (PortletInvocationResponse)invocation.invokeNext(= ); + } + finally + { + // Release the valve + valve.afterInvocation(); + } = - // Invoke stop -// context.invokeStop(); + // Stop the container if necessary + if (response instanceof UnavailableResponse) + { + PortletContainerContext containerContext =3D container.getCont= ext(); + + // This call will wait until all the current threads have exit= ed the component valve. + // Perhaps this should be done asynchronously as it may lead t= o a long delay ? + // It could be made parametrizable as a runtime option too, so= the deployer can choose what mode is preferable + containerContext.managedStop(); + } + + // + return response; } - - // - return response; + else + { + return new UnavailableResponse(); + } } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/PortletApplicationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletApplicationContext.java 2008-02-25 22:53:37 UTC (rev 10110) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletApplicationContext.java 2008-02-25 23:12:41 UTC (rev 10111) @@ -54,4 +54,14 @@ * @return the classloader */ ClassLoader getClassLoader(); + + /** + * Attempt to start the portlet application. + */ + void managedStart(); + + /** + * Stop the portlet application. + */ + void managedStop(); } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/PortletContainerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletContainerContext.java 2008-02-25 22:53:37 UTC (rev 10110) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletContainerContext.java 2008-02-25 23:12:41 UTC (rev 10111) @@ -28,4 +28,13 @@ */ public interface PortletContainerContext { + /** + * Attempt to start the portlet container. + */ + void managedStart(); + + /** + * Stop the portlet container. + */ + void managedStop(); } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/container/PortletFilterContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletFilterContext.java 2008-02-25 22:53:37 UTC (rev 10110) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/co= ntainer/PortletFilterContext.java 2008-02-25 23:12:41 UTC (rev 10111) @@ -28,4 +28,13 @@ */ public interface PortletFilterContext { + /** + * Attempt to start the portlet filter. + */ + void managedStart(); + + /** + * Stop the portlet filter. + */ + void managedStop(); } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletContainerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletContainerImpl.java 2008-02-25 22:53:37 UTC (rev 10110) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletContainerImpl.java 2008-02-25 23:12:41 UTC (rev 10111) @@ -80,7 +80,6 @@ import javax.portlet.filter.FilterChain; import javax.portlet.filter.FilterConfig; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Set; import java.util.List; @@ -200,11 +199,6 @@ filters.remove((PortletFilterImpl)filter); } = - public boolean isStarted() - { - return valve.getState() =3D=3D Valve.OPEN; - } - public void start() throws PortletInitializationException { // Set class name @@ -340,7 +334,7 @@ = public void stop() { - // if the portlet is not started, we shouldn't be trying to stop it.= .. + // If the portlet is not started, we shouldn't be trying to stop it.= .. if (started) { // Wait at most 60 seconds before all invocations are done @@ -457,28 +451,7 @@ = public PortletInvocationResponse dispatch(PortletInvocation invocation)= throws PortletInvokerException, InvocationException { - if (valve.beforeInvocation()) - { - try - { - return invokeDispatch(invocation); - } - finally - { - // Release the valve - valve.afterInvocation(); - } - } - else - { - return new UnavailableResponse(); - } - } - - private PortletInvocationResponse invokeDispatch(PortletInvocation invo= cation) throws PortletInvokerException, InvocationException - { HttpServletRequest dreq =3D invocation.getDispatchedRequest(); - HttpServletResponse dresp =3D invocation.getDispatchedResponse(); = // PortletRequestImpl req; Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/port= let/container/PortletApplicationContextSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletApplicationContextSupport.java 2008-02-25 22:53:37 UTC (rev = 10110) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletApplicationContextSupport.java 2008-02-25 23:12:41 UTC (rev = 10111) @@ -44,4 +44,14 @@ { throw new UnsupportedOperationException(); } + + public void managedStart() + { + throw new UnsupportedOperationException(); + } + + public void managedStop() + { + throw new UnsupportedOperationException(); + } } Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/port= let/container/PortletContainerContextSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletContainerContextSupport.java 2008-02-25 22:53:37 UTC (rev 10= 110) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletContainerContextSupport.java 2008-02-25 23:12:41 UTC (rev 10= 111) @@ -28,4 +28,13 @@ */ public class PortletContainerContextSupport implements PortletContainerCon= text { + public void managedStart() + { + throw new UnsupportedOperationException(); + } + + public void managedStop() + { + throw new UnsupportedOperationException(); + } } Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/port= let/container/PortletFilterContextSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletFilterContextSupport.java 2008-02-25 22:53:37 UTC (rev 10110) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/co= ntainer/PortletFilterContextSupport.java 2008-02-25 23:12:41 UTC (rev 10111) @@ -28,4 +28,13 @@ */ public class PortletFilterContextSupport implements PortletFilterContext { + public void managedStart() + { + throw new UnsupportedOperationException(); + } + + public void managedStop() + { + throw new UnsupportedOperationException(); + } } Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/ext/portletinterface/UnavailablePortletTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/portletinterface/UnavailablePortletTestCase.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/portletinterface/UnavailablePortletTestCase.java 2008-02-25 2= 3:12:41 UTC (rev 10111) @@ -0,0 +1,96 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.test.portlet.jsr286.ext.portletinterface; + +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.base.AbstractUniversalTestPortlet; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.portal.test.portlet.framework.UTP2; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; + +import static org.jboss.unit.api.Assert.*; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.UnavailableException; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)TestCase +public class UnavailablePortletTestCase +{ + + /** . */ + private AbstractUniversalTestPortlet utp1; + + public UnavailablePortletTestCase(PortletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse runWithRuntimeException(Portlet portlet,= RenderRequest request, RenderResponse response, PortletTestContext context= ) throws PortletException, IOException + { + utp1 =3D (AbstractUniversalTestPortlet)portlet; + + // + throw new UnavailableException("blah"); + } + }); + seq.bindAction(0, UTP2.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + return new InvokeGetResponse(response.createRenderURL().toStri= ng()); + } + }); + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + fail("Should not be called"); + + // + return null; + } + }); + seq.bindAction(1, UTP2.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + assertEquals(AbstractUniversalTestPortlet.RuntimeStatus.STOPPE= D, utp1.getRuntimeStatus()); + = + // + return new EndTestResponse(); + } + }); + } +} Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit= /base/AbstractUniversalTestPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/base/= AbstractUniversalTestPortlet.java 2008-02-25 22:53:37 UTC (rev 10110) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/base/= AbstractUniversalTestPortlet.java 2008-02-25 23:12:41 UTC (rev 10111) @@ -77,6 +77,16 @@ return className; } = + /** + * The runtime status of a portlet. + */ + public static enum RuntimeStatus + { + INSTANTIATED, + STARTED, + STOPPED + } + /** . */ private final Logger log =3D createLogger(); = @@ -95,14 +105,19 @@ /** To keep PortletConfig for some tests*-. */ private PortletConfig config; = + /** Indicate the status of the portlet. */ + private RuntimeStatus runtimeStatus; + /** Construct a test portlet with a test id computed with the method getComponentId(). */ public AbstractUniversalTestPortlet() { + runtimeStatus =3D RuntimeStatus.INSTANTIATED; } = public void init(PortletConfig config) throws PortletException { this.config =3D config; + this.runtimeStatus =3D RuntimeStatus.STARTED; } = /** @@ -376,8 +391,14 @@ = public void destroy() { + this.runtimeStatus =3D RuntimeStatus.STOPPED; } = + public RuntimeStatus getRuntimeStatus() + { + return runtimeStatus; + } + /** * Returns SequenceRegistry which should be injected into ServletContex= t Returns null if there is no SequenceRegistry * in context Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortletApplicationContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationContextImpl.java 2008-02-25 22:53:37 UTC (rev 10110) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationContextImpl.java 2008-02-25 23:12:41 UTC (rev 10111) @@ -23,6 +23,7 @@ package org.jboss.portal.portlet.test; = import org.jboss.portal.portlet.container.PortletApplicationContext; +import org.jboss.portal.portlet.container.managed.ManagedPortletApplicatio= n; import org.jboss.portal.web.WebApp; = import javax.servlet.ServletContext; @@ -37,6 +38,8 @@ /** . */ private final WebApp webApp; = + ManagedPortletApplication managedPortletApplication; + public PortletApplicationContextImpl(WebApp webApp) { this.webApp =3D webApp; @@ -56,4 +59,14 @@ { return webApp.getClassLoader(); } + + public void managedStart() + { + managedPortletApplication.managedStart(); + } + + public void managedStop() + { + managedPortletApplication.managedStop(); + } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortletApplicationDeployment.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployment.java 2008-02-25 22:53:37 UTC (rev 10110) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployment.java 2008-02-25 23:12:41 UTC (rev 10111) @@ -38,9 +38,6 @@ import org.jboss.portal.portlet.container.object.PortletApplicationObject; import org.jboss.portal.portlet.container.object.PortletContainerObject; import org.jboss.portal.portlet.container.object.PortletFilterObject; -import org.jboss.portal.portlet.container.PortletApplicationContext; -import org.jboss.portal.portlet.container.PortletContainerContext; -import org.jboss.portal.portlet.container.PortletFilterContext; import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= ntListener; import org.jboss.portal.web.WebApp; = @@ -94,7 +91,7 @@ = // PortletApplicationObject portletApplicationObject =3D new PortletApp= licationImpl(builder.getApplication()); - PortletApplicationContext portletApplicationContext =3D new PortletA= pplicationContextImpl(webApp); + PortletApplicationContextImpl portletApplicationContext =3D new Port= letApplicationContextImpl(webApp); = = // @@ -103,25 +100,34 @@ portletApplicationContext, portletApplicationObject); = + // Needed for the managed callbacks + portletApplicationContext.managedPortletApplication =3D portletAppli= cationLifeCycle; + // for (ContainerFilterInfo filterInfo : builder.getApplication().getFi= lters().values()) { PortletFilterObject portletFilterObject =3D new PortletFilterImpl= (filterInfo); - PortletFilterContext portletFilterContext =3D new PortletFilterCo= ntextImpl(); + PortletFilterContextImpl portletFilterContext =3D new PortletFilt= erContextImpl(); = // - portletApplicationLifeCycle.addPortletFilter(portletFilterContext= , portletFilterObject); + PortletFilterLifeCycle portletFilterLifeCycle =3D portletApplicat= ionLifeCycle.addPortletFilter(portletFilterContext, portletFilterObject); + + // Needed for the managed callbacks + portletFilterContext.managedPortletFilter =3D portletFilterLifeCy= cle; } = // for (ContainerPortletInfo containerInfo : builder.getPortlets()) { PortletContainerObject portletContainerObject =3D new PortletCont= ainerImpl(containerInfo); - PortletContainerContext portletContainerContext =3D new PortletCo= ntainerContextImpl(); + PortletContainerContextImpl portletContainerContext =3D new Portl= etContainerContextImpl(); = // PortletContainerLifeCycle portletContainerLifeCycle =3D portletAp= plicationLifeCycle.addPortletContainer(portletContainerContext, portletCont= ainerObject); = + // Needed for the managed callbacks + portletContainerContext.managedPortletContainer =3D portletContai= nerLifeCycle; + // Now create deps for (String filterRef : containerInfo.getFilterRefs()) { Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortletContainerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletContainerContextImpl.java 2008-02-25 22:53:37 UTC (rev 10110) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletContainerContextImpl.java 2008-02-25 23:12:41 UTC (rev 10111) @@ -23,6 +23,7 @@ package org.jboss.portal.portlet.test; = import org.jboss.portal.portlet.container.PortletContainerContext; +import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; = /** * @author Julien Viet @@ -30,4 +31,17 @@ */ public class PortletContainerContextImpl implements PortletContainerContext { + + /** . */ + ManagedPortletContainer managedPortletContainer; + + public void managedStart() + { + managedPortletContainer.managedStart(); + } + + public void managedStop() + { + managedPortletContainer.managedStop(); + } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortletFilterContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletFilterContextImpl.java 2008-02-25 22:53:37 UTC (rev 10110) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletFilterContextImpl.java 2008-02-25 23:12:41 UTC (rev 10111) @@ -23,6 +23,7 @@ package org.jboss.portal.portlet.test; = import org.jboss.portal.portlet.container.PortletFilterContext; +import org.jboss.portal.portlet.container.managed.ManagedPortletFilter; = /** * @author Julien Viet @@ -30,4 +31,16 @@ */ public class PortletFilterContextImpl implements PortletFilterContext { + + ManagedPortletFilter managedPortletFilter; + + public void managedStart() + { + managedPortletFilter.managedStart(); + } + + public void managedStop() + { + managedPortletFilter.managedStop(); + } } Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-25 22:53:37 UTC (= rev 10110) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-25 23:12:41 UTC (= rev 10111) @@ -377,6 +377,7 @@ + = Added: modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletinte= rface-war/WEB-INF/portlet.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletinterfa= ce-war/WEB-INF/portlet.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletinterfa= ce-war/WEB-INF/portlet.xml 2008-02-25 23:12:41 UTC (rev 10111) @@ -0,0 +1,46 @@ + + + + + + + UniversalTestPortletA + org.jboss.portal.test.portlet.framework.UTP1 + + text/html + + + + + UniversalTestPortletB + org.jboss.portal.test.portlet.framework.UTP2 + + text/html + + + + Added: modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletinte= rface-war/WEB-INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletinterfa= ce-war/WEB-INF/web.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletinterfa= ce-war/WEB-INF/web.xml 2008-02-25 23:12:41 UTC (rev 10111) @@ -0,0 +1,32 @@ + + + + + + + org.jboss.portal.unit.PortletTestSuite + + Modified: modules/portlet/trunk/test/src/test/resources/portlet-test-war/WE= B-INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/= jboss-beans.xml 2008-02-25 22:53:37 UTC (rev 10110) +++ modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/= jboss-beans.xml 2008-02-25 23:12:41 UTC (rev 10111) @@ -35,6 +35,7 @@ = + PortletApplicationRegistry @@ -70,7 +71,9 @@ = - + + + Modified: modules/portlet/trunk/test/src/test/resources/test/remote-jboss-u= nit.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xm= l 2008-02-25 22:53:37 UTC (rev 10110) +++ modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xm= l 2008-02-25 23:12:41 UTC (rev 10111) @@ -223,6 +223,10 @@ + + + + = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + = + + + + + + + + + + + + + Added: modules/portlet/trunk/test/src/test/resources/jboss-4.2/portlet-tck-= war/WEB-INF/context.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jboss-4.2/portlet-tck-war= /WEB-INF/context.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jboss-4.2/portlet-tck-war= /WEB-INF/context.xml 2008-02-25 23:32:26 UTC (rev 10112) @@ -0,0 +1,2 @@ + + \ No newline at end of file Added: modules/portlet/trunk/test/src/test/resources/jboss-4.2/portlet-tck-= war/WEB-INF/jboss-web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jboss-4.2/portlet-tck-war= /WEB-INF/jboss-web.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jboss-4.2/portlet-tck-war= /WEB-INF/jboss-web.xml 2008-02-25 23:32:26 UTC (rev 10112) @@ -0,0 +1,31 @@ + + + + + + test:loader=3Dportlet + + \ No newline at end of file Added: modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-IN= F/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/j= boss-beans.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/j= boss-beans.xml 2008-02-25 23:32:26 UTC (rev 10112) @@ -0,0 +1,118 @@ + + + + + + + + + socket://localhost:5400 + + org.jboss.unit.remote.driver.RemoteTestDriver + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + Added: modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-IN= F/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/w= eb.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/w= eb.xml 2008-02-25 23:32:26 UTC (rev 10112) @@ -0,0 +1,45 @@ + + + + + + + org.jboss.portal.common.mc.bootstrap.WebBootstrap + + + ContainerServlet + org.jboss.portal.web.impl.tomcat.TC6ContainerServlet<= /servlet-class> + 0 + + + PortalServlet + org.jboss.portal.portlet.test.tck.TCKServlet + + + PortalServlet + /* + + Added: modules/portlet/trunk/test/src/test/resources/tomcat-6.0/portlet-tck= -war/META-INF/context.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/tomcat-6.0/portlet-tck-wa= r/META-INF/context.xml (rev 0) +++ modules/portlet/trunk/test/src/test/resources/tomcat-6.0/portlet-tck-wa= r/META-INF/context.xml 2008-02-25 23:32:26 UTC (rev 10112) @@ -0,0 +1,2 @@ + + --===============2985379031463222326==-- From portal-commits at lists.jboss.org Mon Feb 25 18:59:04 2008 Content-Type: multipart/mixed; boundary="===============5301282577810321924==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10113 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Mon, 25 Feb 2008 18:59:04 -0500 Message-ID: --===============5301282577810321924== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-25 18:59:04 -0500 (Mon, 25 Feb 2008) New Revision: 10113 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescr= iptors.xml Log: 6.1.2. The JBoss Portlet Instance DTD minor revisions/corrections Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/x= mldescriptors.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-25 23:32:26 UTC (rev 10112) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-25 23:59:04 UTC (rev 10113) @@ -332,7 +332,8 @@ ]]> +]]> @@ -379,11 +380,11 @@ ]]> +]]> - The <preferences> element configu= res the instance with a specific set of preferences. + The <preferences> element configu= res the instance with a set of preferences. @@ -392,7 +393,7 @@ - The <preference> element configur= es one preference which is part of a set of preferences, which is defined u= sing the <preferences> element. + The <preference> element configur= es one preference, which is part of a set of preferences. Use the <preferences> element to define a set of pref= erences. --===============3314380944496091578== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-25 19:00:22 -0500 (Mon, 25 Feb 2008) New Revision: 10114 Modified: modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/jb= oss-beans.xml Log: update jboss-beans that is stale Modified: modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB= -INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/j= boss-beans.xml 2008-02-25 23:59:04 UTC (rev 10113) +++ modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/j= boss-beans.xml 2008-02-26 00:00:22 UTC (rev 10114) @@ -35,6 +35,7 @@ = + PortletApplicationRegistry @@ -70,7 +71,9 @@ = - + + + --===============3314380944496091578==-- From portal-commits at lists.jboss.org Mon Feb 25 19:52:14 2008 Content-Type: multipart/mixed; boundary="===============7296853329637658659==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10115 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Mon, 25 Feb 2008 19:52:14 -0500 Message-ID: --===============7296853329637658659== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-25 19:52:13 -0500 (Mon, 25 Feb 2008) New Revision: 10115 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescr= iptors.xml Log: 6.1.2. The JBoss Portlet Instance DTD last revisions for this section Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-26 00:00:22 UTC (rev 10114) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-26 00:52:13 UTC (rev 10115) @@ -427,7 +427,7 @@ - Instructs the portal to overwrite or keep this object if it already exis= ts. Accepted values are overwrite and keep. The overwrite value will destroy the existing object and create a new one based on= the content of the deployment. The keep o= ption will maintain the existing object deployment, or create a new one if = it does not exist. + Instructs the portal to overwrite or keep this object if it already exis= ts. Accepted values are overwrite and keep. The overwrite option will destroy the existing object and create a new one based o= n the content of the deployment. The keep = option will maintain the existing object deployment, or create a new one if= it does not exist. Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/x= mldescriptors.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-26 00:00:22 UTC (rev 10114) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-26 00:52:13 UTC (rev 10115) @@ -327,7 +327,7 @@ - The <if-exists> element is used t= o define the action to take if an instance with the same name already exist= s. Accepted values are overwrite and keep. The overwrite value will destroy the existing object and create a new one based on = the content of the deployment. The keep op= tion will maintain the existing object deployment, or create a new one if i= t does not exist. + The <if-exists> element is used t= o define the action to take if an instance with the same name already exist= s. Accepted values are overwrite and keep. The overwrite option will destroy the existing object and create a new one based on= the content of the deployment. The keep o= ption will maintain the existing object deployment, or create a new one if = it does not exist. @@ -376,7 +376,7 @@ - The reference to the portlet, which is the portlet name. The <portlet-ref> value must match the <portlet-name> give in the WEB-INF/por= tlet.xml file. + The reference to the portlet, which is the name of the portlet. The <portlet-ref> value must match the <portlet-name> give in the WEB-= INF/portlet.xml file. - If present. the <unchecked> eleme= nt is used to define that anyone can view the instance. + If present, the <unchecked> eleme= nt is used to define that anyone can view the instance. - The <role-name> element is used t= o define a role that this security constraint will apply to. The following = example only allows users that are part of the EXAMPLEROLE<= /computeroutput> role, to access the instance: + The <role-name> element is used t= o define a role that the security constraint will apply to. The following e= xample only allows users that are part of the EXAMPLEROLE role, to access the instance: --===============5244811917610799972== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-25 21:47:19 -0500 (Mon, 25 Feb 2008) New Revision: 10116 Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/AbstractRendererContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/RendererContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/RendererContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/t= ck/TCKPageNavigationalStateSerialization.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/t= ck/TCKPortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/t= ck/TCKRendererContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/t= ck/TCKStateControllerContext.java Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/t= ck/TCKPageRenderer.java Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/impl/request/ControllerRequestFactory.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/impl/request/ControllerRequestParameterMapFactory.java modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/= controller/PortletControllerContextSupport.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortalServlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/AbstractMarkupRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/AbstractPortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/ErrorResponseRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PageRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletControllerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletURLRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/RedirectResponseRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/Renderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestPortletInvocationContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PagePortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletURLTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/t= ck/TCKPageNavigationalState.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/t= ck/TCKServlet.java modules/portlet/trunk/test/src/test/build.xml Log: improve TCK stuff Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/impl/request/ControllerRequestFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/request/ControllerRequestFactory.java 2008-02-26 00:52:13 = UTC (rev 10115) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/request/ControllerRequestFactory.java 2008-02-26 02:47:19 = UTC (rev 10116) @@ -22,8 +22,6 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.controller.impl.request; = -import org.jboss.portal.portlet.controller.state.StateControllerContext; -import org.jboss.portal.portlet.controller.state.PageNavigationalStateSeri= alization; import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; import org.jboss.portal.portlet.controller.request.ControllerRequest; @@ -55,15 +53,11 @@ { = /** . */ - private final StateControllerContext stateControllerContext; + private final Serialization serialization; = - /** . */ - private final PageNavigationalStateSerialization serialization; - - public ControllerRequestFactory(StateControllerContext stateControllerC= ontext) + public ControllerRequestFactory(Serialization se= rialization) { - this.stateControllerContext =3D stateControllerContext; - this.serialization =3D new PageNavigationalStateSerialization(stateC= ontrollerContext); + this.serialization =3D serialization; } = public ControllerRequest createRequest(WebRequest req) Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/impl/request/ControllerRequestParameterMapFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/request/ControllerRequestParameterMapFactory.java 2008-02-= 26 00:52:13 UTC (rev 10115) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/request/ControllerRequestParameterMapFactory.java 2008-02-= 26 02:47:19 UTC (rev 10116) @@ -22,8 +22,6 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.controller.impl.request; = -import org.jboss.portal.portlet.controller.state.StateControllerContext; -import org.jboss.portal.portlet.controller.state.PageNavigationalStateSeri= alization; import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.ContainerURL; import org.jboss.portal.portlet.ActionURL; @@ -48,15 +46,11 @@ { = /** . */ - private final StateControllerContext stateControllerContext; + private final Serialization serialization; = - /** . */ - private final PageNavigationalStateSerialization serialization; - - public ControllerRequestParameterMapFactory(StateControllerContext stat= eControllerContext) + public ControllerRequestParameterMapFactory(Serialization serialization) { - this.stateControllerContext =3D stateControllerContext; - this.serialization =3D new PageNavigationalStateSerialization(stateC= ontrollerContext); + this.serialization =3D serialization; } = public Map blah(PageNavigationalState pageNS, String wi= ndowId, ContainerURL containerURL) Modified: modules/portlet/trunk/controller/src/test/java/org/jboss/portal/p= ortlet/controller/PortletControllerContextSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet= /controller/PortletControllerContextSupport.java 2008-02-26 00:52:13 UTC (r= ev 10115) +++ modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet= /controller/PortletControllerContextSupport.java 2008-02-26 02:47:19 UTC (r= ev 10116) @@ -33,16 +33,12 @@ import org.jboss.portal.portlet.invocation.ResourceInvocation; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.NoSuchPortletException; import org.jboss.portal.portlet.PortletContext; -import org.jboss.portal.portlet.support.info.PortletInfoSupport; import org.jboss.portal.portlet.support.PortletInvokerSupport; import org.jboss.portal.portlet.support.PortletSupport; = import javax.servlet.http.Cookie; import java.util.List; -import java.util.Map; -import java.util.HashMap; = /** * @author Julien Viet Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortalServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortalServlet.java 2008-02-26 00:52:13 UTC (rev 10115) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortalServlet.java 2008-02-26 02:47:19 UTC (rev 10116) @@ -31,6 +31,8 @@ import org.jboss.portal.portlet.test.controller.PageRenderer; import org.jboss.portal.portlet.test.controller.PortletControllerContextIm= pl; import org.jboss.portal.portlet.test.controller.Renderer; +import org.jboss.portal.portlet.test.controller.AbstractRendererContext; +import org.jboss.portal.portlet.test.controller.RendererContextImpl; import org.jboss.portal.web.WebRequest; = import javax.servlet.ServletException; @@ -83,7 +85,7 @@ if (URLParameterConstants.PORTLET_TYPE.equals(type)) { WebRequest wr =3D new WebRequest(req); - ControllerRequestFactory factory =3D new ControllerRequestFactory= (context.getStateControllerContext()); + ControllerRequestFactory factory =3D new ControllerRequestFactory= (context.getPageNavigationalStateSerialization()); ControllerRequest request =3D factory.createRequest(wr); = // @@ -93,7 +95,7 @@ Renderer renderer =3D ControllerResponseRendererFactory.getRender= er(response); = // - renderer.render(context); + renderer.render(new RendererContextImpl(context)); } else { @@ -101,7 +103,7 @@ PageRenderer renderer =3D new PageRenderer(new ResponseProperties= (), context.getStateControllerContext().createPageState(false)); = // - renderer.render(context); + renderer.render(new RendererContextImpl(context)); } } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/AbstractMarkupRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractMarkupRenderer.java 2008-02-26 00:52:13 UTC (rev 10115) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractMarkupRenderer.java 2008-02-26 02:47:19 UTC (rev 10116) @@ -47,7 +47,7 @@ this.properties =3D properties; } = - public void render(PortletControllerContextImpl context) throws IOExcep= tion + public void render(RendererContext context) throws IOException { prepareRendering(context); HttpServletResponse resp =3D context.getClientResponse(); @@ -85,7 +85,7 @@ } } = - protected void prepareRendering(PortletControllerContextImpl context) + protected void prepareRendering(RendererContext context) { // default behavior does nothing } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/AbstractPortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-26 00:52:13 UTC (r= ev 10115) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-26 02:47:19 UTC (r= ev 10116) @@ -25,10 +25,12 @@ = import org.jboss.portal.common.util.MarkupInfo; import org.jboss.portal.common.util.MediaType; +import org.jboss.portal.common.io.Serialization; import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.controller.PortletControllerContext; import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.PageNavigationalStateSeri= alization; import org.jboss.portal.portlet.impl.spi.AbstractClientContext; import org.jboss.portal.portlet.impl.spi.AbstractRequestContext; import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; @@ -113,6 +115,8 @@ = protected abstract PortletInvocationResponse invoke(PortletInvocation i= nvocation) throws PortletInvokerException; = + protected abstract Serialization getPageNavigati= onalStateSerialization(); + public PortletInvocationResponse invoke(ActionInvocation actionInvocati= on) throws PortletInvokerException { = @@ -182,6 +186,6 @@ = public PortletInvocationContext createPortletInvocationContext(String w= indowId, PageNavigationalState pageState) { - return new TestPortletInvocationContext(getStateControllerContext(),= req, resp, windowId, pageState, MARKUP_INFO); + return new TestPortletInvocationContext(getPageNavigationalStateSeri= alization(), req, resp, windowId, pageState, MARKUP_INFO); } } \ No newline at end of file Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/controller/AbstractRendererContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractRendererContext.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractRendererContext.java 2008-02-26 02:47:19 UTC (rev 10116) @@ -0,0 +1,67 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.controller; + +import org.jboss.portal.portlet.controller.PortletControllerContext; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.RenderInvocation; +import org.jboss.portal.portlet.PortletInvokerException; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public abstract class AbstractRendererContext implements RendererContext +{ + + /** . */ + private final AbstractPortletControllerContext portletControllerContext; + + public AbstractRendererContext(AbstractPortletControllerContext portlet= ControllerContext) + { + this.portletControllerContext =3D portletControllerContext; + } + + public HttpServletRequest getClientRequest() + { + return portletControllerContext.getClientRequest(); + } + + public HttpServletResponse getClientResponse() + { + return portletControllerContext.getClientResponse(); + } + + public PortletControllerContext getPortletControllerContext() + { + return portletControllerContext; + } + + public PortletInvocationResponse render(RenderInvocation render) throws= PortletInvokerException + { + return portletControllerContext.invoke(render); + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/ErrorResponseRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ErrorResponseRenderer.java 2008-02-26 00:52:13 UTC (rev 10115) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ErrorResponseRenderer.java 2008-02-26 02:47:19 UTC (rev 10116) @@ -46,7 +46,7 @@ this.response =3D response; } = - public void render(PortletControllerContextImpl context) throws IOExcep= tion + public void render(RendererContext context) throws IOException { if (response.getCause() !=3D null) { Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PageRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PageRenderer.java 2008-02-26 00:52:13 UTC (rev 10115) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PageRenderer.java 2008-02-26 02:47:19 UTC (rev 10116) @@ -44,7 +44,6 @@ import org.jboss.portal.portlet.invocation.response.ResponseProperties; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.controller.PortletControllerContext; import org.w3c.dom.Element; = import javax.servlet.http.HttpServletRequest; @@ -125,7 +124,7 @@ writer.print(""); } = - protected void prepareRendering(PortletControllerContextImpl context) + protected void prepareRendering(RendererContext context) { = // What we collect during the different renders @@ -134,90 +133,88 @@ ResponseProperties renderProperties =3D new ResponseProperties(); = // - try - { - Collection portlets =3D ((PortletControllerContextImpl)c= ontext).getPortlets(); + Collection portlets =3D context.getPortlets(); = - int capacity =3D portlets.size(); - fragments =3D new ArrayList(capacity); - errors =3D new ArrayList(capacity); + int capacity =3D portlets.size(); + fragments =3D new ArrayList(capacity); + errors =3D new ArrayList(capacity); = - for (Portlet portlet : portlets) - { - WindowNavigationalState windowNS =3D pageState.getWindowNaviga= tionalState(portlet.getContext().getId()); + for (Portlet portlet : portlets) + { + WindowNavigationalState windowNS =3D pageState.getWindowNavigatio= nalState(portlet.getContext().getId()); = - // - Mode mode =3D Mode.VIEW; - WindowState windowState =3D WindowState.NORMAL; - StateString portletNS =3D null; + // + Mode mode =3D Mode.VIEW; + WindowState windowState =3D WindowState.NORMAL; + StateString portletNS =3D null; = - // - if (windowNS !=3D null) + // + if (windowNS !=3D null) + { + if (windowNS.getMode() !=3D null) { - if (windowNS.getMode() !=3D null) - { - mode =3D windowNS.getMode(); - } - if (windowNS.getWindowState() !=3D null) - { - windowState =3D windowNS.getWindowState(); - } - if (windowNS.getPortletNavigationalState() !=3D null) - { - portletNS =3D windowNS.getPortletNavigationalState(); - } + mode =3D windowNS.getMode(); } + if (windowNS.getWindowState() !=3D null) + { + windowState =3D windowNS.getWindowState(); + } + if (windowNS.getPortletNavigationalState() !=3D null) + { + portletNS =3D windowNS.getPortletNavigationalState(); + } + } = - // - ParameterMap publicNS =3D pageState.getPublicNavigationalState= (portlet.getContext().getId()); + // + ParameterMap publicNS =3D pageState.getPublicNavigationalState(po= rtlet.getContext().getId()); = - RenderInvocation render =3D createRenderInvocation(context, pr= operties, pageState, portlet, windowNS, mode, windowState, portletNS, publi= cNS); + RenderInvocation render =3D createRenderInvocation(context, prope= rties, pageState, portlet, windowNS, mode, windowState, portletNS, publicNS= ); = - // - try + // + try + { + PortletInvocationResponse response =3D context.render(render); + + if (response instanceof FragmentResponse) { - PortletInvocationResponse response =3D ((PortletControllerC= ontextImpl)context).invoke(render); + FragmentResponse fragment =3D (FragmentResponse)response; = - if (response instanceof FragmentResponse) - { - FragmentResponse fragment =3D (FragmentResponse)response; + // + fragments.add(fragment); = - // - fragments.add(fragment); - - // - ResponseProperties fragmentProperties =3D fragment.getPr= operties(); - if (fragmentProperties !=3D null) - { - renderProperties.append(fragmentProperties); - } - } - else if (response instanceof ErrorResponse) + // + ResponseProperties fragmentProperties =3D fragment.getPrope= rties(); + if (fragmentProperties !=3D null) { - ErrorResponse error =3D (ErrorResponse)response; - errors.add(error); + renderProperties.append(fragmentProperties); } - } - catch (PortletInvokerException e) + else if (response instanceof ErrorResponse) { - e.printStackTrace(); + ErrorResponse error =3D (ErrorResponse)response; + errors.add(error); } } + catch (PortletInvokerException e) + { + e.printStackTrace(); + } } - catch (PortletInvokerException e) - { - // todo - e.printStackTrace(); - } = // Now we combine the render properties with the page properties properties.append(renderProperties); } = protected RenderInvocation createRenderInvocation( - PortletControllerContextImpl context, ResponseProperties pagePropert= ies, PageNavigationalState pageNS, Portlet portlet, - WindowNavigationalState windowNS, Mode mode, WindowState windowState= , StateString portletNS, ParameterMap publicNS) + RendererContext context, + ResponseProperties pageProperties, + PageNavigationalState pageNS, + Portlet portlet, + WindowNavigationalState windowNS, + Mode mode, + WindowState windowState, + StateString portletNS, + ParameterMap publicNS) { HttpServletRequest req =3D context.getClientRequest(); HttpServletResponse resp =3D context.getClientResponse(); @@ -225,7 +222,7 @@ // TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), false); = - PortletInvocationContext renderContext =3D context.createPortletInvo= cationContext(portlet.getContext().getId(), pageNS); + PortletInvocationContext renderContext =3D context.getPortletControl= lerContext().createPortletInvocationContext(portlet.getContext().getId(), p= ageNS); = // RenderInvocation render =3D new RenderInvocation(renderContext); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContextImpl.java 2008-02-26 00:52:13 UTC (rev 1= 0115) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContextImpl.java 2008-02-26 02:47:19 UTC (rev 1= 0116) @@ -31,9 +31,12 @@ import org.jboss.portal.portlet.controller.impl.event.EventControllerConte= xtImpl; import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; import org.jboss.portal.portlet.controller.state.StateControllerContext; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.PageNavigationalStateSeri= alization; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.web.IllegalRequestException; +import org.jboss.portal.common.io.Serialization; = import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; @@ -57,6 +60,9 @@ /** . */ private final StateControllerContext stateControllerContext; = + /** . */ + private final Serialization serialization; + public PortletControllerContextImpl(HttpServletRequest req, HttpServlet= Response resp, ServletContext servletContext) throws IllegalRequestException, IOException, ClassNotFoundException { @@ -66,6 +72,7 @@ this.invoker =3D (PortletInvoker)servletContext.getAttribute("Consum= erPortletInvoker"); this.eventControllerContext =3D new EventControllerContextImpl(invok= er); this.stateControllerContext =3D new StateControllerContextImpl(this); + this.serialization =3D new PageNavigationalStateSerialization(stateC= ontrollerContext); } = protected Portlet getPortlet(String windowId) throws PortletInvokerExce= ption @@ -93,4 +100,8 @@ return invoker.getPortlets(); } = + public Serialization getPageNavigationalStateSer= ialization() + { + return serialization; + } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletURLRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-26 00:52:13 UTC (rev 10115) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-26 02:47:19 UTC (rev 10116) @@ -25,14 +25,13 @@ = import org.jboss.portal.common.io.IOTools; import org.jboss.portal.common.io.SerializationFilter; +import org.jboss.portal.common.io.Serialization; import org.jboss.portal.common.text.CharBuffer; import org.jboss.portal.common.text.FastURLEncoder; import org.jboss.portal.common.util.Base64; import org.jboss.portal.portlet.ContainerURL; import org.jboss.portal.portlet.URLFormat; import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.controller.state.PageNavigationalStateSeri= alization; -import org.jboss.portal.portlet.controller.state.StateControllerContext; import org.jboss.portal.portlet.controller.impl.request.ControllerRequestP= arameterNames; import org.jboss.portal.portlet.controller.impl.request.ControllerRequestP= arameterMapFactory; import static org.jboss.portal.portlet.test.URLParameterConstants.*; @@ -50,12 +49,9 @@ { = /** . */ - final StateControllerContext stateContext; + final Serialization serialization; = /** . */ - final PageNavigationalStateSerialization serialization; - - /** . */ final HttpServletRequest clientReq; = /** . */ @@ -65,16 +61,15 @@ final PageNavigationalState pageNS; = public PortletURLRenderer( - StateControllerContext stateContext, PageNavigationalState pageNS, HttpServletRequest clientReq, - HttpServletResponse clientResp) + HttpServletResponse clientResp, + Serialization serialization) { - this.stateContext =3D stateContext; this.pageNS =3D pageNS; this.clientReq =3D clientReq; this.clientResp =3D clientResp; - this.serialization =3D new PageNavigationalStateSerialization(stateC= ontext); + this.serialization =3D serialization; } = private String renderURL(Map parameters, URLFormat form= at) @@ -141,7 +136,7 @@ = public String renderURL(String windowId, ContainerURL containerURL, URL= Format format) { - ControllerRequestParameterMapFactory factory =3D new ControllerReque= stParameterMapFactory(stateContext); + ControllerRequestParameterMapFactory factory =3D new ControllerReque= stParameterMapFactory(serialization); = // Map parameters =3D factory.blah(pageNS, windowId, co= ntainerURL); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/RedirectResponseRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/RedirectResponseRenderer.java 2008-02-26 00:52:13 UTC (rev 10115) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/RedirectResponseRenderer.java 2008-02-26 02:47:19 UTC (rev 10116) @@ -42,7 +42,7 @@ this.response =3D response; } = - public void render(PortletControllerContextImpl context) throws IOExcep= tion + public void render(RendererContext context) throws IOException { context.getClientResponse().sendRedirect(response.getLocation()); } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/Renderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/Renderer.java 2008-02-26 00:52:13 UTC (rev 10115) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/Renderer.java 2008-02-26 02:47:19 UTC (rev 10116) @@ -33,5 +33,5 @@ */ public interface Renderer { - void render(PortletControllerContextImpl context) throws IOException; + void render(RendererContext context) throws IOException; } Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/controller/RendererContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/RendererContext.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/RendererContext.java 2008-02-26 02:47:19 UTC (rev 10116) @@ -0,0 +1,52 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.controller; + +import org.jboss.portal.portlet.controller.PortletControllerContext; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.RenderInvocation; + +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpServletRequest; +import java.util.Collection; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public interface RendererContext +{ + + HttpServletRequest getClientRequest(); + + HttpServletResponse getClientResponse(); + + PortletControllerContext getPortletControllerContext(); + + Collection getPortlets(); + + PortletInvocationResponse render(RenderInvocation render) throws Portle= tInvokerException; + +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/controller/RendererContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/RendererContextImpl.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/RendererContextImpl.java 2008-02-26 02:47:19 UTC (rev 10116) @@ -0,0 +1,52 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.controller; + +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletInvokerException; + +import java.util.Collection; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class RendererContextImpl extends AbstractRendererContext +{ + + /** . */ + private final Collection portlets; + + public RendererContextImpl(PortletControllerContextImpl portletControll= erContext) throws PortletInvokerException + { + super(portletControllerContext); + + // + this.portlets =3D portletControllerContext.getPortlets(); + } + + public Collection getPortlets() + { + return portlets; + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/TestPortletInvocationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvocationContext.java 2008-02-26 00:52:13 UTC (rev 1= 0115) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvocationContext.java 2008-02-26 02:47:19 UTC (rev 1= 0116) @@ -26,10 +26,10 @@ import org.jboss.portal.common.invocation.resolver.MapAttributeResolver; import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResol= ver; import org.jboss.portal.common.util.MarkupInfo; +import org.jboss.portal.common.io.Serialization; import org.jboss.portal.portlet.ContainerURL; import org.jboss.portal.portlet.URLFormat; import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.controller.state.StateControllerContext; import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext; import org.jboss.portal.portlet.invocation.PortletInvocation; = @@ -44,25 +44,19 @@ { = /** . */ - private final StateControllerContext stateContext; - - /** . */ private final PortletURLRenderer urlRenderer; = /** . */ private final String windowId; = /** . */ - private final PageNavigationalState pageState; - - /** . */ private final HttpServletRequest clientRequest; = /** . */ private final HttpServletResponse clientResponse; = public TestPortletInvocationContext( - StateControllerContext stateContext, + Serialization serialization, HttpServletRequest clientRequest, HttpServletResponse clientResponse, String windowId, @@ -72,12 +66,10 @@ super(markupInfo); = // - this.stateContext =3D stateContext; this.clientRequest =3D clientRequest; this.clientResponse =3D clientResponse; this.windowId =3D windowId; - this.pageState =3D pageState; - this.urlRenderer =3D new PortletURLRenderer(stateContext, pageState,= clientRequest, clientResponse); + this.urlRenderer =3D new PortletURLRenderer(pageState, clientRequest= , clientResponse, serialization); = // addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttribut= eResolver(clientRequest)); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-26 00:52:13 UTC (rev 10115) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-26 02:47:19 UTC (rev 10116) @@ -35,7 +35,6 @@ import org.jboss.portal.portlet.controller.impl.request.ControllerRequestF= actory; import org.jboss.portal.portlet.controller.request.ControllerRequest; import org.jboss.portal.portlet.controller.impl.request.ControllerRequestP= arameterNames; -import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; import org.jboss.portal.portlet.controller.response.ControllerResponse; import org.jboss.portal.portlet.controller.response.PageUpdateResponse; import org.jboss.portal.portlet.controller.response.ResourceResponse; @@ -114,7 +113,7 @@ if (URLParameterConstants.PORTLET_TYPE.equals(type)) { WebRequest wr =3D new WebRequest(req); - ControllerRequestFactory factory =3D new ControllerRequestFactory= (context.getStateControllerContext()); + ControllerRequestFactory factory =3D new ControllerRequestFactory= (context.getPageNavigationalStateSerialization()); ControllerRequest request =3D factory.createRequest(wr); = ControllerResponse controllerResponse; @@ -137,10 +136,10 @@ { // PortletURLRenderer renderer =3D new PortletURLRenderer( - (StateControllerContextImpl)context.getStateControllerCo= ntext(), pageUpdate.getPageState(), context.getClientRequest(), - context.getClientResponse()); + context.getClientResponse(), + context.getPageNavigationalStateSerialization()); = // String url =3D renderer.renderURL(new URLFormat(null, null,= true, null)); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PagePortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-26 00:52:13 UTC (rev 10115) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-26 02:47:19 UTC (rev 10116) @@ -28,11 +28,14 @@ import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.controller.event.EventControllerContext; import org.jboss.portal.portlet.controller.state.StateControllerContext; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.PageNavigationalStateSeri= alization; import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.test.controller.AbstractPortletControllerC= ontext; import org.jboss.portal.web.IllegalRequestException; +import org.jboss.portal.common.io.Serialization; = import javax.servlet.ServletContext; import javax.servlet.ServletException; @@ -56,6 +59,9 @@ private final StateControllerContext stateControllerContext; = /** . */ + private final Serialization serialization; + + /** . */ private final PortalPrepareResponse prepareResponse; = /** . */ @@ -91,6 +97,7 @@ this.prepareResponse =3D prepareResponse; this.stateControllerContext =3D new StateControllerContextImpl(this); this.eventControllerContext =3D new PageEventControllerContext(this,= prepareResponse); + this.serialization =3D new PageNavigationalStateSerialization(stateC= ontrollerContext); } = public Portlet findPortlet(String applicationName, String portletName) @@ -121,6 +128,11 @@ return stateControllerContext; } = + public Serialization getPageNavigationalStateSer= ialization() + { + return serialization; + } + private static class Key { = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-26 00:52:13 UTC (rev 10115) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-26 02:47:19 UTC (rev 10116) @@ -27,7 +27,6 @@ import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; import org.jboss.portal.portlet.test.jsp.PagePortletControllerContext; import org.jboss.portal.portlet.test.controller.PortletURLRenderer; -import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; import org.jboss.portal.portlet.RenderURL; import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.URLFormat; @@ -95,10 +94,10 @@ } = PortletURLRenderer renderer =3D new PortletURLRenderer( - context.getStateControllerContext(), renderResponse.getPageState(), context.getClientRequest(), - context.getClientResponse()); + context.getClientResponse(), + context.getPageNavigationalStateSerialization()); = final WindowState ws =3D windowState; final Mode md =3D mode; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/tck/TCKPageNavigationalState.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKPageNavigationalState.java 2008-02-26 00:52:13 UTC (rev 10115) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKPageNavigationalState.java 2008-02-26 02:47:19 UTC (rev 10116) @@ -24,39 +24,79 @@ = import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; -import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; -import org.jboss.portal.portlet.controller.impl.state.PageNavigationalStat= eImpl; -import org.jboss.portal.portlet.info.PortletInfo; -import org.jboss.portal.portlet.info.ParameterInfo; -import org.jboss.portal.portlet.info.NavigationInfo; -import org.jboss.portal.portlet.Portlet; import org.jboss.portal.common.util.ParameterMap; = import javax.xml.namespace.QName; -import java.io.Serializable; import java.util.Map; +import java.util.Set; import java.util.HashMap; -import java.util.Set; -import java.util.List; -import java.util.Collection; = /** * @author Boleslaw Dawidowicz * @version : 0.1 $ */ -public class TCKPageNavigationalState extends PageNavigationalStateImpl +public class TCKPageNavigationalState implements PageNavigationalState { = - Collection involvedPortlets; + /** . */ + final PageNavigationalState defaultState; = - public TCKPageNavigationalState(StateControllerContextImpl context, boo= lean modifiable, Collection involvedPortlets) + /** . */ + final Set involvedPortlets; + + public TCKPageNavigationalState(PageNavigationalState defaultState, Set= involvedPortlets) { - super(context, modifiable); + this.defaultState =3D defaultState; this.involvedPortlets =3D involvedPortlets; } = - public Collection getInvolvedPortlets() + public Set getInvolvedPortlets() { return involvedPortlets; } + + public Set getWindowIds() + { + return defaultState.getWindowIds(); + } + + public WindowNavigationalState getWindowNavigationalState(String window= Id) throws IllegalArgumentException + { + return defaultState.getWindowNavigationalState(windowId); + } + + public void setWindowNavigationalState(String windowId, WindowNavigatio= nalState windowState) throws IllegalArgumentException, IllegalStateException + { + defaultState.setWindowNavigationalState(windowId, windowState); + } + + public ParameterMap getPublicNavigationalState(String windowId) throws = IllegalArgumentException + { + return defaultState.getPublicNavigationalState(windowId); + } + + public Set getPublicNames() + { + return defaultState.getPublicNames(); + } + + public void setPublicNavigationalState(String windowId, Map update) throws IllegalArgumentException, IllegalStateException + { + defaultState.setPublicNavigationalState(windowId, update); + } + + public String[] getPublicNavigationalState(QName name) throws IllegalAr= gumentException + { + return defaultState.getPublicNavigationalState(name); + } + + public void setPublicNavigationalState(QName name, String[] value) thro= ws IllegalArgumentException, IllegalStateException + { + defaultState.setPublicNavigationalState(name, value); + } + + public void removePublicNavigationalState(QName name) throws IllegalArg= umentException, IllegalStateException + { + defaultState.removePublicNavigationalState(name); + } } Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/tck/TCKPageNavigationalStateSerialization.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKPageNavigationalStateSerialization.java (rev= 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKPageNavigationalStateSerialization.java 2008-02-26 02:47:19 UTC (rev= 10116) @@ -0,0 +1,93 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.tck; + +import org.jboss.portal.portlet.controller.state.PageNavigationalStateSeri= alization; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.common.io.Serialization; + +import java.io.OutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.DataOutputStream; +import java.io.DataInputStream; +import java.util.Set; +import java.util.HashSet; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class TCKPageNavigationalStateSerialization implements Serializatio= n +{ + + /** . */ + private final PageNavigationalStateSerialization defaultSerialization; + + public TCKPageNavigationalStateSerialization(TCKStateControllerContext = context) + { + this.defaultSerialization =3D new PageNavigationalStateSerialization= (context.defaultStateControllerContext); + } + + public void serialize(PageNavigationalState pageNavigationalState, Outp= utStream out) throws IOException, IllegalArgumentException + { + TCKPageNavigationalState tckPageNavigationalState =3D (TCKPageNaviga= tionalState)pageNavigationalState; + + // + DataOutputStream data =3D out instanceof DataOutputStream ? (DataOut= putStream)out : new DataOutputStream(out); + + // + defaultSerialization.serialize(tckPageNavigationalState.defaultState= , out); + + // + data.writeInt(tckPageNavigationalState.involvedPortlets.size()); + for (String involvedPortlet : tckPageNavigationalState.involvedPortl= ets) + { + data.writeUTF(involvedPortlet); + } + + // Need a flush + data.flush(); + } + + public PageNavigationalState unserialize(InputStream in) throws IOExcep= tion, IllegalArgumentException + { + // + DataInputStream data =3D in instanceof DataInputStream ? (DataInputS= tream)in : new DataInputStream(in); + + // + PageNavigationalState defaultState =3D defaultSerialization.unserial= ize(in); + + // + int size =3D data.readInt(); + Set involvedPortlets =3D new HashSet(size); + while (size-- > 0) + { + String involvedPortlet =3D data.readUTF(); + involvedPortlets.add(involvedPortlet); + } + + // + return new TCKPageNavigationalState(defaultState, involvedPortlets); + } +} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/tck/TCKPageRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKPageRenderer.java 2008-02-26 00:52:13 UTC (rev 10115) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKPageRenderer.java 2008-02-26 02:47:19 UTC (rev 10116) @@ -1,146 +0,0 @@ -/* -* 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.portlet.test.tck; - -import org.jboss.portal.portlet.test.controller.PageRenderer; -import org.jboss.portal.portlet.test.controller.PortletControllerContextIm= pl; -import org.jboss.portal.portlet.invocation.response.ResponseProperties; -import org.jboss.portal.portlet.invocation.response.FragmentResponse; -import org.jboss.portal.portlet.invocation.response.ErrorResponse; -import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.invocation.RenderInvocation; -import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.controller.state.WindowNavigationalState; -import org.jboss.portal.portlet.Portlet; -import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.Mode; -import org.jboss.portal.WindowState; -import org.jboss.portal.common.util.ParameterMap; - -import java.util.Collection; -import java.util.ArrayList; - -/** - * @author Boleslaw Dawidowicz - * @version : 0.1 $ - */ -public class TCKPageRenderer extends PageRenderer -{ - TCKPageNavigationalState tckPageState; - - public TCKPageRenderer(ResponseProperties properties, TCKPageNavigation= alState pageState) - { - super(properties, pageState); - tckPageState =3D pageState; - } - - protected void prepareRendering(PortletControllerContextImpl context) - { - // What we collect during the different renders - // we don't reuse the render properties argument since we want to av= oid that - // a portlet rendition affects another rendition of a portlet on the= same page - ResponseProperties renderProperties =3D new ResponseProperties(); - - // - try - { - Collection portlets =3D tckPageState.getInvolvedPortlets= (); - - int capacity =3D portlets.size(); - fragments =3D new ArrayList(capacity); - errors =3D new ArrayList(capacity); - - for (Portlet portlet : portlets) - { - WindowNavigationalState windowNS =3D pageState.getWindowNaviga= tionalState(portlet.getContext().getId()); - - // - Mode mode =3D Mode.VIEW; - WindowState windowState =3D WindowState.NORMAL; - StateString portletNS =3D null; - - // - if (windowNS !=3D null) - { - if (windowNS.getMode() !=3D null) - { - mode =3D windowNS.getMode(); - } - if (windowNS.getWindowState() !=3D null) - { - windowState =3D windowNS.getWindowState(); - } - if (windowNS.getPortletNavigationalState() !=3D null) - { - portletNS =3D windowNS.getPortletNavigationalState(); - } - } - - // - ParameterMap publicNS =3D pageState.getPublicNavigationalState= (portlet.getContext().getId()); - - RenderInvocation render =3D createRenderInvocation(context, pr= operties, pageState, portlet, windowNS, mode, windowState, portletNS, publi= cNS); - - // - try - { - PortletInvocationResponse response =3D context.invoke(rende= r); - - if (response instanceof FragmentResponse) - { - FragmentResponse fragment =3D (FragmentResponse)response; - - // - fragments.add(fragment); - - // - ResponseProperties fragmentProperties =3D fragment.getPr= operties(); - if (fragmentProperties !=3D null) - { - renderProperties.append(fragmentProperties); - } - } - else if (response instanceof ErrorResponse) - { - ErrorResponse error =3D (ErrorResponse)response; - errors.add(error); - } - - } - catch (PortletInvokerException e) - { - e.printStackTrace(); - } - } - } - catch (Exception e) - { - // todo - e.printStackTrace(); - } - - // Now we combine the render properties with the page properties - properties.append(renderProperties); - } -} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/tck/TCKPortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKPortletControllerContext.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKPortletControllerContext.java 2008-02-26 02:47:19 UTC (rev 10116) @@ -0,0 +1,109 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.tck; + +import org.jboss.portal.portlet.test.controller.AbstractPortletControllerC= ontext; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.PortletInvoker; +import org.jboss.portal.portlet.PortletContext; +import org.jboss.portal.portlet.controller.event.EventControllerContext; +import org.jboss.portal.portlet.controller.state.StateControllerContext; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; +import org.jboss.portal.portlet.controller.impl.event.EventControllerConte= xtImpl; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.web.IllegalRequestException; +import org.jboss.portal.common.io.Serialization; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.ServletContext; +import java.io.IOException; +import java.util.Map; +import java.util.Set; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class TCKPortletControllerContext extends AbstractPortletController= Context +{ + + /** . */ + private final PortletInvoker invoker; + + /** . */ + private final TCKStateControllerContext stateControllerContext; + + /** . */ + private final EventControllerContext eventControllerContext; + + /** . */ + private final Serialization serialization; + + public TCKPortletControllerContext( + HttpServletRequest req, + HttpServletResponse resp, + ServletContext servletContext) throws IllegalRequestException, IOExc= eption + { + super(req, resp); + + // + this.invoker =3D (PortletInvoker)servletContext.getAttribute("Consum= erPortletInvoker"); + this.stateControllerContext =3D new TCKStateControllerContext(new St= ateControllerContextImpl(this)); + this.eventControllerContext =3D new EventControllerContextImpl(invok= er); + this.serialization =3D new TCKPageNavigationalStateSerialization(sta= teControllerContext); + } + + public Set getPortlets() throws PortletInvokerException + { + return invoker.getPortlets(); + } + + protected Portlet getPortlet(String windowId) throws PortletInvokerExce= ption + { + return invoker.getPortlet(PortletContext.createPortletContext(window= Id)); + } + + protected PortletInvocationResponse invoke(PortletInvocation invocation= ) throws PortletInvokerException + { + return invoker.invoke(invocation); + } + + protected Serialization getPageNavigationalState= Serialization() + { + return serialization; + } + + public EventControllerContext getEventControllerContext() + { + return eventControllerContext; + } + + public StateControllerContext getStateControllerContext() + { + return stateControllerContext; + } +} Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/tck/TCKRendererContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKRendererContext.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKRendererContext.java 2008-02-26 02:47:19 UTC (rev 10116) @@ -0,0 +1,64 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.tck; + +import org.jboss.portal.portlet.test.controller.AbstractRendererContext; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletInvokerException; + +import java.util.Collection; +import java.util.ArrayList; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class TCKRendererContext extends AbstractRendererContext +{ + + /** . */ + private final Collection involvedPortlets; + + public TCKRendererContext( + TCKPortletControllerContext portletControllerContext, + TCKPageNavigationalState pageState) throws PortletInvokerException + { + super(portletControllerContext); + + // + Collection involvedPortlets =3D new ArrayList(); + for (String involvedPortletId : pageState.getInvolvedPortlets()) + { + Portlet involvedPortlet =3D portletControllerContext.getPortlet(i= nvolvedPortletId); + involvedPortlets.add(involvedPortlet); + } + + // + this.involvedPortlets =3D involvedPortlets; + } + + public Collection getPortlets() + { + return involvedPortlets; + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/tck/TCKServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKServlet.java 2008-02-26 00:52:13 UTC (rev 10115) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKServlet.java 2008-02-26 02:47:19 UTC (rev 10116) @@ -22,16 +22,15 @@ = package org.jboss.portal.portlet.test.tck; = -import org.jboss.portal.portlet.test.controller.PortletControllerContextIm= pl; import org.jboss.portal.portlet.test.controller.Renderer; import org.jboss.portal.portlet.test.controller.ControllerResponseRenderer= Factory; import org.jboss.portal.portlet.test.controller.PageRenderer; +import org.jboss.portal.portlet.test.controller.AbstractRendererContext; import org.jboss.portal.portlet.test.URLParameterConstants; import org.jboss.portal.portlet.controller.PortletController; import org.jboss.portal.portlet.controller.response.ControllerResponse; import org.jboss.portal.portlet.controller.request.ControllerRequest; import org.jboss.portal.portlet.controller.impl.request.ControllerRequestF= actory; -import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; import org.jboss.portal.portlet.invocation.response.ResponseProperties; import org.jboss.portal.portlet.Portlet; import org.jboss.portal.web.WebRequest; @@ -43,9 +42,7 @@ import java.io.IOException; import java.util.Collection; import java.util.Set; -import java.util.HashSet; -import java.util.List; -import java.util.LinkedList; +import java.util.LinkedHashSet; = /** * @author Boleslaw Dawidowicz @@ -82,20 +79,24 @@ = protected void _service(HttpServletRequest req, HttpServletResponse res= p) throws Exception { - PortletControllerContextImpl context =3D new PortletControllerContex= tImpl(req, resp, getServletContext()); + TCKPortletControllerContext context =3D new TCKPortletControllerCont= ext(req, resp, getServletContext()); = // PortletController controller =3D new PortletController(); = + // String type =3D req.getParameter(URLParameterConstants.TYPE); = // if (URLParameterConstants.PORTLET_TYPE.equals(type)) { WebRequest wr =3D new WebRequest(req); - ControllerRequestFactory factory =3D new ControllerRequestFactory= (context.getStateControllerContext()); + ControllerRequestFactory factory =3D new ControllerRequestFactory= (context.getPageNavigationalStateSerialization()); ControllerRequest request =3D factory.createRequest(wr); = + // We must have one!!! + TCKPageNavigationalState tckPageState =3D (TCKPageNavigationalSta= te)request.getPageState(); + // ControllerResponse response =3D controller.process(context, reque= st); = @@ -103,32 +104,26 @@ Renderer renderer =3D ControllerResponseRendererFactory.getRender= er(response); = // - renderer.render(context); + renderer.render(new TCKRendererContext(context, tckPageState)); } else { - String[] tckParamers =3D req.getParameterValues(TCK_PORTLET_NAME); - Collection portlets =3D context.getPortlets(); - - List involvedPortlets =3D new LinkedList(); - - for (int i =3D 0; i < tckParamers.length; i++) + Set involvedPortlets =3D new LinkedHashSet(); + for (String tckParamer : tckParamers) { - String tckParamer =3D tckParamers[i]; - String[] parts =3D tckParamer.split("/"); - String portletAppName =3D parts[0]; String portletName =3D parts[1]; = + // for (Portlet portlet : portlets) { if (portlet.getInfo().getApplicationName().equals(portletAp= pName) - && portlet.getInfo().getName().equals(portletName)) + && portlet.getInfo().getName().equals(portletName)) { - involvedPortlets.add(portlet); + involvedPortlets.add(portlet.getContext().getId()); } } } @@ -138,12 +133,13 @@ throw new IllegalStateException("Portlets requested by TCK wer= e not found"); } = - TCKPageNavigationalState tckPageState =3D new TCKPageNavigational= State((StateControllerContextImpl)context.getStateControllerContext(), fals= e, involvedPortlets); + TCKPageNavigationalState tckPageState =3D new TCKPageNavigational= State(context.getStateControllerContext().createPageState(false), involvedP= ortlets); = - PageRenderer renderer =3D new TCKPageRenderer(new ResponsePropert= ies(), tckPageState); + // + PageRenderer renderer =3D new PageRenderer(new ResponseProperties= (), tckPageState); = // - renderer.render(context); + renderer.render(new TCKRendererContext(context, tckPageState)); } } } Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/te= st/tck/TCKStateControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKStateControllerContext.java (rev 0) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKStateControllerContext.java 2008-02-26 02:47:19 UTC (rev 10116) @@ -0,0 +1,58 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.test.tck; + +import org.jboss.portal.portlet.controller.state.StateControllerContext; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; + +import java.util.HashSet; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class TCKStateControllerContext implements StateControllerContext +{ + + final StateControllerContext defaultStateControllerContext; + + public TCKStateControllerContext(StateControllerContext defaultStateCon= trollerContext) + { + this.defaultStateControllerContext =3D defaultStateControllerContext; + } + + public PageNavigationalState clonePageState(PageNavigationalState pageS= tate, boolean modifiable) + { + TCKPageNavigationalState tckPageState =3D (TCKPageNavigationalState)= pageState; + + // + return new TCKPageNavigationalState( + defaultStateControllerContext.clonePageState(tckPageState.default= State, modifiable), + new HashSet(tckPageState.involvedPortlets)); + } + + public PageNavigationalState createPageState(boolean modifiable) + { + return new TCKPageNavigationalState(defaultStateControllerContext.cr= eatePageState(modifiable), new HashSet()); + } +} Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-26 00:52:13 UTC (= rev 10115) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-26 02:47:19 UTC (= rev 10116) @@ -754,7 +754,6 @@ - = = @@ -772,7 +771,8 @@ - + + = @@ -780,13 +780,7 @@ = = - = - - - - - = --===============5244811917610799972==-- From portal-commits at lists.jboss.org Mon Feb 25 22:41:51 2008 Content-Type: multipart/mixed; boundary="===============2512920228163678526==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10117 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Mon, 25 Feb 2008 22:41:51 -0500 Message-ID: --===============2512920228163678526== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-25 22:41:50 -0500 (Mon, 25 Feb 2008) New Revision: 10117 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescr= iptors.xml Log: 6.1.3. The JBoss Portal Object DTD replacing itemizedlist with variablelist Note: large section commented out so as not to break the nightly build Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/x= mldescriptors.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-26 02:47:19 UTC (rev 10116) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-26 03:41:50 UTC (rev 10117) @@ -302,7 +302,7 @@ The JBoss Portlet Instance DTD - The following items refer to elements found in the JBoss Portlet Instan= ce DTD, $JBOSS_HOME/server/configuration/deploy/jboss-portal.sar/= dtd/portlet-instances_version_number.dtd: + The following items refer to elements found in the JBoss Portlet Instan= ce DTD, $JBOSS_HOME/server/configuration/deploy/jboss-portal.sar/dtd/portlet-instances_version_numbe= r.dtd: @@ -487,7 +487,7 @@ - If present, the <unchecked> eleme= nt is used to define that anyone can view the instance. + If present, the <unchecked> eleme= nt is used to define that anyone can view this instance. - The <role-name> element is used t= o define a role that the security constraint will apply to. The following e= xample only allows users that are part of the EXAMPLEROLE role, to access the instance: + The <role-name> element is used t= o define a role that the security constraint will apply to. The following e= xample only allows users that are part of the EXAMPLEROLE role to access this instance: - Portal Object DTD + The JBoss Portal Object DTD - + The following items refer to elements found in the JBoss Portal Object = DTD, $JBOSS_HOME/server/configuration/= deploy/jboss-portal.sar/dtd/portal-object_version_number.dtd: + + + + ]]> + - -Element ]]> - - - -Element ]]> - + The <deployments> element is a co= ntainer for the <deployment> element. + + + +]]> + + + + The <deployment> element is a gen= eric container for portal object elements. The <parent-r= ef> child gives the name of the parent object that the = current object will use as parent. The optional <if-exis= ts> element defines the behavior when a portal object w= hich an identical name is already child of the parent element. The default = behavior of the <if-exists> element = is to keep the existing object and not create a new object. The last elemen= t is the portal object itself. + + + The following is an example of the <deployment> and <parent-ref> elem= ents: + + + default ... - - -All portal objects have a common configuration which can be : - -1/ a listener : specifies the id of a listener is the listener registry. A= listener -object is able to listen portal events which apply to the portal node hier= archy. - -2/ properties : a set of generic properties owned by the portal object. So= me -properties can drive the behavior of the object. - -3/ security-constraint : defines security configuration of the portal obje= ct.]]> - - -Element ]]> - the root having an empty path - -default the object with the name default under th= e root -having the path (default) - -default.default the object with the path (default= ,default)]]> - - -Element ]]> - - - -Element ]]> - - - -Element ]]> - - - -Element ]]> - - - -Element ]]> - - - -Element ]]> -]]> + + + + All portal objects have a common configuration which can include: + + + + + + a listener: specifies the id of a listener is the listener registry. = A listener object is able to listen portal events which apply to the portal= node hierarchy. + + + + properties : a set of generic properties owned by the portal ob= ject. Some properties can drive the behavior of the object. + + + + security-constraint : defines security configuration of the por= tal object. + + + + + +]]> + + + + Contains a reference to the parent object. The naming convention for nam= ing object is to concatenate the names of the path to the object and separa= te the names by a dot. If the path is empty then the empty string must be u= sed. The <parent-ref> element tells = the portal where the portlet should appear. + + + The following is an example of the root having an empty path: + + + +<parent-ref/> + + + + The following specifies that the portlet will appear on the default page: + + + +<parent-ref>default</parent-ref> + + + + The following specifies that the portlet will apear in the portal instan= ce named default, and on the page named default: + + + +<parent-ref>default.default</parent-ref> + + + +]]> + + + + The <if-exists> element is used t= o define the action to take if an instance with the same name already exist= s. Accepted values are overwrite and keep. The overwrite option will destroy the existing object and create a new one based on= the content of the deployment. The keep o= ption will maintain the existing object deployment, or create a new one if = it does not exist. + + + +]]> + + + + A portal object of type context. A context type represent a node in the = tree which does not have a visual representation. It can exist only under t= he root. A context can only have children with the portal type. + + +]]> + + + + The context name value. + + +]]> + + + + A portal object of type portal. A portal type represents a virtual porta= l and can have children of type page. In addition of the common portal obje= ct elements it support also the declaration of the modes and the window sta= tes it supports. If no declaration of modes or window states is done then t= he default value will be respectively (view,edit,help) and (normal,minimize= d,maximized). + + +]]> + + + + The portal name value. + + +]]> + + + + The supported modes of a portal. + + + The following is an example of the <supported-mode>= ; element: + + + view edit help -]]> - - -Element ]]> - - - -Element ]]> -]]> + + + + +]]> + + + + A portlet mode value. + + + +]]> + + + + The supported window states of a portal. The following is an example of = the <supported-window-states> elemen= t: + + + normal minimized maximized -]]> - - +]]> + + + + + + + JBoss App DTD --===============2512920228163678526==-- From portal-commits at lists.jboss.org Tue Feb 26 07:05:03 2008 Content-Type: multipart/mixed; boundary="===============5559230149929601147==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10118 - in modules/portlet/trunk/portlet/src: main/java/org/jboss/portal/portlet/impl/jsr168/api and 5 other directories. Date: Tue, 26 Feb 2008 07:05:03 -0500 Message-ID: --===============5559230149929601147== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-26 07:05:03 -0500 (Tue, 26 Feb 2008) New Revision: 10118 Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/portletresponses/SetContentTypeAfterStreamIsObtainedTestCase.j= ava Removed: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr168/tck/portletresponses/SetContentTypeBeforeOutputStreamOrWriterTestC= ase.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/DispatchedHttpServletResponse.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/MimeResponseImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/RenderResponseImpl.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/dispatcher/FiltersTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/dispatcher/IncludeFromRenderObjectsTestCase.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/action= s/PortletResourceTestAction.java Log: JBPORTAL-1900 : setContentType is now optional in JSR 286 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/DispatchedHttpServletResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/DispatchedHttpServletResponse.java 2008-02-26 03:41:50 UTC (rev 1= 0117) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/DispatchedHttpServletResponse.java 2008-02-26 12:05:03 UTC (rev 1= 0118) @@ -87,11 +87,6 @@ = // Must perform no operations = - public final void setContentType(String s) - { - //TODO: forward from render should use RenderResponse.setContentType= () - } - public final void setContentLength(int i) { } @@ -164,6 +159,8 @@ = // Defined by subclasses = + public abstract void setContentType(String contentType); + public abstract String getCharacterEncoding(); = public abstract Locale getLocale(); @@ -276,6 +273,10 @@ { } = + public void setContentType(String contentType) + { + } + // Must return true for include and false for forward = public boolean isCommitted() @@ -381,6 +382,11 @@ { return mresp.getContentType(); } + + public void setContentType(String contentType) + { + mresp.setContentType(contentType); + } } } = Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/MimeResponseImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/MimeResponseImpl.java 2008-02-26 03:41:50 UTC (rev 10117) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/MimeResponseImpl.java 2008-02-26 12:05:03 UTC (rev 10118) @@ -28,23 +28,16 @@ import org.jboss.portal.portlet.invocation.response.RevalidateMarkupRespon= se; import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.info.CacheInfo; -import org.jboss.portal.portlet.info.CapabilitiesInfo; -import org.jboss.portal.portlet.info.ModeInfo; import org.jboss.portal.portlet.cache.CacheScope; -import org.jboss.portal.common.util.MediaType; -import org.jboss.portal.common.util.ContentInfo; -import org.jboss.portal.Mode; = import javax.portlet.MimeResponse; import javax.portlet.PortletURL; import javax.portlet.ResourceURL; import javax.portlet.CacheControl; -import javax.activation.MimeTypeParseException; import java.io.PrintWriter; import java.io.IOException; import java.io.OutputStream; import java.util.Locale; -import java.util.Set; = /** * @author Julien Viet @@ -62,6 +55,9 @@ /** The cache control. */ protected CacheControlImpl cacheControl; = + /** . */ + private boolean contentTypeSet; + public MimeResponseImpl(PortletInvocation invocation, PortletRequestImp= l preq) { super(invocation, preq); @@ -85,6 +81,7 @@ // 0 means no buffering - we say no buffering this.bufferSize =3D 0; this.fragment =3D fragment; + this.contentTypeSet =3D false; } = public PortletInvocationResponse getResponse() @@ -105,70 +102,37 @@ = public String getContentType() { - return fragment.getContentType(); + return contentTypeSet ? fragment.getContentType() : null; } = public void setContentType(String contentType) { - try + if (fragment.getContentType() =3D=3D null) { - // Remove the unused appended charset first - int index =3D contentType.indexOf(';'); - if (index !=3D -1) - { - contentType =3D contentType.substring(0, index); - } - - // Find the content type among the media type we know - MediaType requestedMediaType =3D MediaType.parseMimeType(contentT= ype); - - // Get the response media type -// ContentInfo info =3D invocation.getContext().getMarkupInfo(); -// MediaType responseMediaType =3D info.getContentType(); - - // Check if the requested media type is allowed as a subtype of t= he main response -// if (!responseMediaType.isAllowedSubType(requestedMediaType)) -// { -// throw new IllegalArgumentException("Content type not accepte= d"); -// } - - // - Mode currentMode =3D preq.invocation.getMode(); - - PortletInfo info =3D preq.container.getInfo(); - CapabilitiesInfo capabilities =3D info.getCapabilities(); - Set compatibleModes =3D capabilities.getModes(contentTy= pe); - for (ModeInfo modeInfo : compatibleModes) - { - if (currentMode.equals(modeInfo.getMode())) - { - // Set the content type - fragment.setContentType(contentType); - - // - return; - } - } - - // - throw new IllegalArgumentException("Mime type " + contentType + "= not accepted as content type"); - + fragment.setContentType(contentType); + contentTypeSet =3D true; } - catch (MimeTypeParseException e) - { - IllegalArgumentException ex =3D new IllegalArgumentException("Con= tent type not accepted"); - ex.initCause(e); - throw ex; - } } = public PrintWriter getWriter() throws IOException { + if (fragment.getContentType() =3D=3D null) + { + fragment.setContentType(preq.getResponseContentType()); + } + + // return fragment.getWriter(); } = public OutputStream getPortletOutputStream() throws IOException { + if (fragment.getContentType() =3D=3D null) + { + fragment.setContentType(preq.getResponseContentType()); + } + + // return fragment.getOutputStream(); } = Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/RenderResponseImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/RenderResponseImpl.java 2008-02-26 03:41:50 UTC (rev 10117) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/RenderResponseImpl.java 2008-02-26 12:05:03 UTC (rev 10118) @@ -25,10 +25,15 @@ import org.jboss.portal.portlet.invocation.RenderInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; +import org.jboss.portal.portlet.info.PortletInfo; +import org.jboss.portal.portlet.info.CapabilitiesInfo; +import org.jboss.portal.portlet.info.ModeInfo; import org.jboss.portal.Mode; +import org.jboss.portal.common.util.MediaType; = import javax.portlet.RenderResponse; import javax.portlet.PortletMode; +import javax.activation.MimeTypeParseException; import java.util.Collection; import java.util.Set; import java.util.LinkedHashSet; @@ -87,6 +92,60 @@ } } = + public void setContentType(String contentType) + { + try + { + // Remove the unused appended charset first + int index =3D contentType.indexOf(';'); + if (index !=3D -1) + { + contentType =3D contentType.substring(0, index); + } + + // Find the content type among the media type we know + MediaType requestedMediaType =3D MediaType.parseMimeType(contentT= ype); + + // Get the response media type +// ContentInfo info =3D invocation.getContext().getMarkupInfo(); +// MediaType responseMediaType =3D info.getContentType(); + + // Check if the requested media type is allowed as a subtype of t= he main response +// if (!responseMediaType.isAllowedSubType(requestedMediaType)) +// { +// throw new IllegalArgumentException("Content type not accepte= d"); +// } + + // + Mode currentMode =3D preq.invocation.getMode(); + + PortletInfo info =3D preq.container.getInfo(); + CapabilitiesInfo capabilities =3D info.getCapabilities(); + Set compatibleModes =3D capabilities.getModes(contentTy= pe); + for (ModeInfo modeInfo : compatibleModes) + { + if (currentMode.equals(modeInfo.getMode())) + { + // Set the content type + super.setContentType(contentType); + + // + return; + } + } + + // + throw new IllegalArgumentException("Mime type " + contentType + "= not accepted as content type"); + + } + catch (MimeTypeParseException e) + { + IllegalArgumentException ex =3D new IllegalArgumentException("Con= tent type not accepted"); + ex.initCause(e); + throw ex; + } + } + public PortletInvocationResponse getResponse() { PortletInvocationResponse response =3D super.getResponse(); Deleted: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/= portlet/jsr168/tck/portletresponses/SetContentTypeBeforeOutputStreamOrWrite= rTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/tck/portletresponses/SetContentTypeBeforeOutputStreamOrWriterTest= Case.java 2008-02-26 03:41:50 UTC (rev 10117) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/tck/portletresponses/SetContentTypeBeforeOutputStreamOrWriterTest= Case.java 2008-02-26 12:05:03 UTC (rev 10118) @@ -1,85 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet.jsr168.tck.portletresponses; - -import org.jboss.portal.unit.PortletTestCase; -import org.jboss.portal.unit.PortletTestContext; -import org.jboss.portal.unit.actions.PortletRenderTestAction; -import org.jboss.portal.test.portlet.framework.UTP1; -import org.jboss.portal.unit.annotations.TestCase; -import org.jboss.portal.unit.Assertion; -import org.jboss.portal.unit.PortletTestContext; -import org.jboss.unit.driver.DriverResponse; -import org.jboss.unit.driver.response.EndTestResponse; -import static org.jboss.unit.api.Assert.fail; -import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; - -import javax.portlet.Portlet; -import javax.portlet.RenderRequest; -import javax.portlet.RenderResponse; -import java.io.IOException; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -(a)TestCase({Assertion.JSR168_77}) -public class SetContentTypeBeforeOutputStreamOrWriterTestCase -{ - public SetContentTypeBeforeOutputStreamOrWriterTestCase(PortletTestCase= seq) - { - seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() - { - protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException - { - try - { - response.getWriter(); - fail(); - } - catch (IllegalStateException e) - { - //expected as no content type was set - } - return new InvokeGetResponse(response.createRenderURL().toStri= ng()); - } - }); - - seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() - { - protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException - { - try - { - response.getPortletOutputStream(); - fail(); - } - catch (IllegalStateException e) - { - //expected as no content type was set - } - return new EndTestResponse(); - } - }); - } -} Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/ext/dispatcher/FiltersTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/dispatcher/FiltersTestCase.java 2008-02-26 03:41:50 UTC (rev = 10117) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/dispatcher/FiltersTestCase.java 2008-02-26 12:05:03 UTC (rev = 10118) @@ -33,6 +33,7 @@ import org.jboss.unit.driver.response.EndTestResponse; import static org.jboss.unit.api.Assert.assertNotNull; import static org.jboss.unit.api.Assert.assertEquals; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; = import javax.portlet.Portlet; import javax.portlet.RenderRequest; @@ -62,21 +63,42 @@ assertEquals(Tools.toSet("INCLUDE_URL_PATTERN_FILTER", "INCLUD= E_NAMED_FILTER"), ServletFilter.ids); = // - prd =3D request.getPortletSession().getPortletContext().getNam= edDispatcher("NoopServlet"); + return new InvokeGetResponse(response.createRenderURL().toStri= ng()); + } + }); + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + PortletRequestDispatcher prd =3D request.getPortletSession().g= etPortletContext().getNamedDispatcher("NoopServlet"); assertNotNull(prd); ServletFilter.ids.clear(); prd.include(request, response); assertEquals(Collections.singleton("INCLUDE_NAMED_FILTER"), Se= rvletFilter.ids); = // - prd =3D request.getPortletSession().getPortletContext().getReq= uestDispatcher("/noop"); + return new InvokeGetResponse(response.createRenderURL().toStri= ng()); + } + }); + seq.bindAction(2, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + PortletRequestDispatcher prd =3D request.getPortletSession().g= etPortletContext().getRequestDispatcher("/noop"); assertNotNull(prd); ServletFilter.ids.clear(); prd.forward(request, response); assertEquals(Tools.toSet("FORWARD_URL_PATTERN_FILTER", "FORWAR= D_NAMED_FILTER"), ServletFilter.ids); = // - prd =3D request.getPortletSession().getPortletContext().getNam= edDispatcher("NoopServlet"); + return new InvokeGetResponse(response.createRenderURL().toStri= ng()); + } + }); + seq.bindAction(3, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws IOException= , PortletException + { + PortletRequestDispatcher prd =3D request.getPortletSession().g= etPortletContext().getNamedDispatcher("NoopServlet"); assertNotNull(prd); ServletFilter.ids.clear(); prd.forward(request, response); Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/ext/portletresponses/SetContentTypeAfterStreamIsObtainedTestCa= se.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/portletresponses/SetContentTypeAfterStreamIsObtainedTestCase.= java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/portletresponses/SetContentTypeAfterStreamIsObtainedTestCase.= java 2008-02-26 12:05:03 UTC (rev 10118) @@ -0,0 +1,121 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.test.portlet.jsr286.ext.portletresponses; + +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.unit.actions.PortletResourceTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import static org.jboss.unit.api.Assert.*; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import java.io.IOException; + +/** + * Not setting the content type before getting a stream will use the conte= nt type defined + * by the portlet request response content type. + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)TestCase +public class SetContentTypeAfterStreamIsObtainedTestCase +{ + public SetContentTypeAfterStreamIsObtainedTestCase(PortletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + response.getWriter(); + + // + response.setContentType("text/html"); + + // + assertNull(response.getContentType()); + + // + return new InvokeGetResponse(response.createRenderURL().toStri= ng()); + } + }); + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + response.getPortletOutputStream(); + + // + response.setContentType("text/html"); + + // + assertNull(response.getContentType()); + + // + return new InvokeGetResponse(response.createResourceURL().toSt= ring()); + } + }); + seq.bindAction(2, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + { + protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException + { + response.getWriter(); + + // + response.setContentType("text/html"); + + // + assertNull(response.getContentType()); + + // + return new InvokeGetResponse(response.createResourceURL().toSt= ring()); + } + }); + seq.bindAction(3, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + { + protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException + { + response.getPortletOutputStream(); + + // + response.setContentType("text/html"); + + // + assertNull(response.getContentType()); + + // + return new EndTestResponse(); + } + }); + } +} Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/dispatcher/IncludeFromRenderObjectsTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/dispatcher/IncludeFromRenderObjectsTestCase.java 2008-02-26 0= 3:41:50 UTC (rev 10117) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/dispatcher/IncludeFromRenderObjectsTestCase.java 2008-02-26 1= 2:05:03 UTC (rev 10118) @@ -131,7 +131,6 @@ = //SPEC:117 //Those should do nothing - some of the getters will be checke= d later - response.setContentType("lolo"); response.setContentLength(22); response.setLocale(Locale.TRADITIONAL_CHINESE); response.addCookie(new Cookie("lolo", "bobo")); Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit= /actions/PortletResourceTestAction.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/actio= ns/PortletResourceTestAction.java 2008-02-26 03:41:50 UTC (rev 10117) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/actio= ns/PortletResourceTestAction.java 2008-02-26 12:05:03 UTC (rev 10118) @@ -93,11 +93,38 @@ } finally { - if (sendResponse && response.getContentType() =3D=3D null) + if (sendResponse) { - response.setContentType("text/html"); - Writer writer =3D response.getWriter(); - IOTools.safeClose(writer); + if (response.getContentType() =3D=3D null) + { + response.setContentType("text/html"); + } + + // + boolean gotWriter =3D false; + try + { + Writer writer =3D response.getWriter(); + gotWriter =3D true; + IOTools.safeClose(writer); + } + catch (IllegalStateException ignore) + { + } + if (!gotWriter) + { + try + { + OutputStream out =3D response.getPortletOutputStream(); + IOTools.safeClose(out); + } + catch (IllegalStateException ignore) + { + } + catch (IOException ignore) + { + } + } } } } --===============5559230149929601147==-- From portal-commits at lists.jboss.org Tue Feb 26 08:54:40 2008 Content-Type: multipart/mixed; boundary="===============8838949218686195729==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10119 - branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/instance. Date: Tue, 26 Feb 2008 08:54:30 -0500 Message-ID: --===============8838949218686195729== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-26 08:54:30 -0500 (Tue, 26 Feb 2008) New Revision: 10119 Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/imp= l/model/instance/InstanceContextImpl.java Log: API change Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/c= ore/impl/model/instance/InstanceContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/im= pl/model/instance/InstanceContextImpl.java 2008-02-26 12:05:03 UTC (rev 101= 18) +++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/im= pl/model/instance/InstanceContextImpl.java 2008-02-26 13:54:30 UTC (rev 101= 19) @@ -80,12 +80,12 @@ = public void onStateEvent(StateEvent event) { - StateEvent.StateEventType type =3D event.getType(); - if (StateEvent.PORTLET_CLONED_EVENT.equals(type)) + StateEvent.Type type =3D event.getType(); + if (StateEvent.Type.PORTLET_CLONED_EVENT.equals(type)) { clonedContext =3D event.getPortletContext(); } - else if (StateEvent.PORTLET_MODIFIED_EVENT.equals(type)) + else if (StateEvent.Type.PORTLET_MODIFIED_EVENT.equals(type)) { modifiedContext =3D event.getPortletContext(); } --===============8838949218686195729==-- From portal-commits at lists.jboss.org Tue Feb 26 13:19:26 2008 Content-Type: multipart/mixed; boundary="===============6511175033825438978==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10120 - in modules/portlet/trunk/portlet/src: test/java/org/jboss/portal/test/portlet/jsr168/api/portletpreferences and 1 other directory. Date: Tue, 26 Feb 2008 13:15:26 -0500 Message-ID: --===============6511175033825438978== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-26 13:15:26 -0500 (Tue, 26 Feb 2008) New Revision: 10120 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletPreferencesImpl.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr168/api/portletpreferences/ZeroLengthArrayValueTestCase.java Log: change wrong interpretation of the spec when a prefs has no values Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/PortletPreferencesImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletPreferencesImpl.java 2008-02-26 13:54:30 UTC (rev 1011= 9) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletPreferencesImpl.java 2008-02-26 18:15:26 UTC (rev 1012= 0) @@ -198,13 +198,21 @@ throw new IllegalArgumentException("key must not be null"); } Value value =3D getValue(key); - if (value !=3D null) +// if (value !=3D null) +// { +// return value.asStringArray(); +// } +// else +// { +// return def; +// } + if (value =3D=3D null || value.isEmpty()) { - return value.asStringArray(); + return def; } else { - return def; + return value.asStringArray(); } } = Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr168/api/portletpreferences/ZeroLengthArrayValueTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/api/portletpreferences/ZeroLengthArrayValueTestCase.java 2008-02-= 26 13:54:30 UTC (rev 10119) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/api/portletpreferences/ZeroLengthArrayValueTestCase.java 2008-02-= 26 18:15:26 UTC (rev 10120) @@ -62,7 +62,7 @@ // With the default value coming from the portlet.xml descript= or String value =3D prefs.getValue("empty", "other"); assertEquals("other", value); - assertEquals(new String[0], prefs.getValues("empty", new Strin= g[]{"other"})); + assertEquals(new String[]{"other"}, prefs.getValues("empty", n= ew String[]{"other"})); = // PortletURL url =3D response.createActionURL(); @@ -82,14 +82,14 @@ // Set the value to the empty array and check we get the other= value prefs.setValues("dynamic", new String[0]); assertEquals("other", prefs.getValue("dynamic", "other")); - assertEquals(new String[0], prefs.getValues("dynamic", new Str= ing[]{"other"})); + assertEquals(new String[]{"other"}, prefs.getValues("dynamic",= new String[]{"other"})); = // Commit change prefs.store(); = // Check we still have the other value assertEquals("other", prefs.getValue("dynamic", "other")); - assertEquals(new String[0], prefs.getValues("dynamic", new Str= ing[]{"other"})); + assertEquals(new String[]{"other"}, prefs.getValues("dynamic",= new String[]{"other"})); } }); seq.bindAction(1, UTP2.RENDER_JOIN_POINT, new PortletRenderTestActio= n() @@ -100,7 +100,7 @@ = // Check we still have the other value assertEquals("other", prefs.getValue("dynamic", "other")); - assertEquals(new String[0], prefs.getValues("dynamic", new Str= ing[]{"other"})); + assertEquals(new String[]{"other"}, prefs.getValues("dynamic",= new String[]{"other"})); = // return new EndTestResponse(); --===============6511175033825438978==-- From portal-commits at lists.jboss.org Tue Feb 26 14:59:19 2008 Content-Type: multipart/mixed; boundary="===============3565940658323750913==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10121 - modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168. Date: Tue, 26 Feb 2008 14:59:18 -0500 Message-ID: --===============3565940658323750913== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-26 14:59:17 -0500 (Tue, 26 Feb 2008) New Revision: 10121 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/DispatchedHttpServletResponse.java Log: make dispatched http servlet response not use impl of portlet API in order = to work with wrappers Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/DispatchedHttpServletResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/DispatchedHttpServletResponse.java 2008-02-26 18:15:26 UTC (rev 1= 0120) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/DispatchedHttpServletResponse.java 2008-02-26 19:59:17 UTC (rev 1= 0121) @@ -26,6 +26,7 @@ import org.jboss.portal.portlet.impl.jsr168.api.StateAwareResponseImpl; = import javax.portlet.PortletResponse; +import javax.portlet.MimeResponse; import javax.servlet.ServletOutputStream; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletResponse; @@ -186,15 +187,9 @@ public static final class StateAware extends DispatchedHttpServletRespo= nse { = - /** . */ - private final StateAwareResponseImpl saresp; - public StateAware(DispatchedHttpServletRequest req, StateAwareRespon= seImpl saresp, HttpServletResponse dresp) { super(req, saresp, dresp); - - // - this.saresp =3D saresp; } = // Must return null @@ -289,7 +284,7 @@ { = /** . */ - private final MimeResponseImpl mresp; + private final MimeResponse mresp; = /** . */ private ServletOutputStream sos; --===============3565940658323750913==-- From portal-commits at lists.jboss.org Tue Feb 26 15:03:02 2008 Content-Type: multipart/mixed; boundary="===============6157601768563449225==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10122 - modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168. Date: Tue, 26 Feb 2008 15:03:02 -0500 Message-ID: --===============6157601768563449225== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-26 15:03:02 -0500 (Tue, 26 Feb 2008) New Revision: 10122 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/DispatchedHttpServletRequest.java Log: make final 2 methods (just in case of) Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/DispatchedHttpServletRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/DispatchedHttpServletRequest.java 2008-02-26 19:59:17 UTC (rev 10= 121) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/DispatchedHttpServletRequest.java 2008-02-26 20:03:02 UTC (rev 10= 122) @@ -515,13 +515,13 @@ = // ****** = - public void setRequest(ServletRequest servletRequest) + public final void setRequest(ServletRequest servletRequest) { // That's a trick dreq.setRequest(servletRequest); } = - public ServletRequest getRequest() + public final ServletRequest getRequest() { // That's a trick return dreq.getRequest(); --===============6157601768563449225==-- From portal-commits at lists.jboss.org Tue Feb 26 18:13:43 2008 Content-Type: multipart/mixed; boundary="===============0255542116882510536==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10123 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Tue, 26 Feb 2008 18:13:42 -0500 Message-ID: --===============0255542116882510536== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-26 18:13:42 -0500 (Tue, 26 Feb 2008) New Revision: 10123 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescr= iptors.xml Log: 6.1.3. The JBoss Portal Object DTD revising lists, replacing itemizedlists with variablelists Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/x= mldescriptors.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-26 20:03:02 UTC (rev 10122) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-26 23:13:42 UTC (rev 10123) @@ -614,7 +614,7 @@ ]]> +]]> @@ -622,7 +622,7 @@ ]]> @@ -660,7 +660,7 @@ ]]> +]]> @@ -669,7 +669,7 @@ ]]> +]]> @@ -682,60 +682,110 @@ minimized maximized ]]> - + + + +]]> + + + + A window state value. + - - - - +]]> + + + + +]]> + + + + The <policy-permission> element i= s used to secure a specific portal page based on a user's role. + + +]]> + + + + The <role-name> element is used t= o define a role that this security constraint will apply to. + + + Example>:Access to this portal page is limited to the defined role. + + + +<role-name>SOMEROLE</role-name> + + + +]]> + + + + The unchecked element is used to define (if present) that anyone can vie= w this portal page. + + +]]> + + + + The action-name element is used to define the access rights given to the= role defined. Possible value is: view - Users can view the page. + + + + + + = JBoss App DTD --===============0255542116882510536==-- From portal-commits at lists.jboss.org Tue Feb 26 18:29:15 2008 Content-Type: multipart/mixed; boundary="===============0095910505380556332==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10124 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api and 3 other directories. Date: Tue, 26 Feb 2008 18:28:54 -0500 Message-ID: --===============0095910505380556332== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-26 18:28:54 -0500 (Tue, 26 Feb 2008) New Revision: 10124 Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/dispatcher/IncludeMarkupFileTestCase.java modules/portlet/trunk/test/src/test/resources/jsr286/ext/dispatcher-war/= file.html Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/DispatchedHttpServletRequest.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/DispatchtedRequestDispatcher.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletRequestDispatcherImpl.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/dispatcher/FiltersTestCase.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/ResourceRenderer.java Log: - reimplement request dispatching to use include (since it's the only way t= o get the proper required informations) - added a test case for request dispatch to a file Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/DispatchedHttpServletRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/DispatchedHttpServletRequest.java 2008-02-26 23:13:42 UTC (rev 10= 123) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/DispatchedHttpServletRequest.java 2008-02-26 23:28:54 UTC (rev 10= 124) @@ -22,9 +22,9 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.impl.jsr168; = -import org.jboss.portal.common.http.QueryStringParser; import org.jboss.portal.common.util.Tools; import org.jboss.portal.common.util.ParameterMap; +import org.jboss.portal.common.http.QueryStringParser; import org.jboss.portal.portlet.impl.jsr168.api.PortletRequestImpl; = import javax.servlet.RequestDispatcher; @@ -46,7 +46,6 @@ import java.util.Enumeration; import java.util.Locale; import java.util.Map; -import java.util.HashMap; import java.util.LinkedList; import java.util.Set; import java.util.HashSet; @@ -121,10 +120,10 @@ private final int sessionScope; = /** . */ - private final LinkedList> containerAttributesStack; + private final LinkedList dispatches; = /** . */ - private final String[] infos; + private String[] infos; = /** . */ private final ServletContext servletContext; @@ -154,15 +153,25 @@ this.preq =3D preq; this.dreq =3D dreq; this.servletContext =3D servletContext; - this.containerAttributesStack =3D new LinkedList= >(); + this.dispatches =3D new LinkedList(); this.sessionScope =3D sessionScope; = // Push dispatch - this.infos =3D pushDispatch(dispatch); + /*this.infos =3D*/ pushDispatch(dispatch); = // - String[] containerKeys =3D dispatchType =3D=3D DispatchType.INCLUDE = ? INCLUDE_KEYS : FORWARD_KEYS; - String queryString =3D containerAttributesStack.getLast().get(contai= nerKeys[QUERY_STRING]); + String queryString =3D null; + String path =3D dispatch.getPath(); + if (path !=3D null) + { + int index =3D path.indexOf('?'); + if (index > -1) + { + queryString =3D path.substring(index + 1); + } + } + + // Map parameters; if (queryString !=3D null && queryString.length() > 0) { @@ -178,6 +187,7 @@ = // this.parameters =3D parameters; + this.infos =3D null; } = // Must return null @@ -226,11 +236,6 @@ = // Must return the path and query string information used to obtain the= PortletRequestDispatcher object = - public final String getPathInfo() - { - return infos[PATH_INFO]; - } - public final String getPathTranslated() { String pathInfo =3D getPathInfo(); @@ -239,19 +244,52 @@ return pathInfo =3D=3D null ? null : servletContext.getRealPath(path= Info); } = + public final String getPathInfo() + { + if (infos !=3D null) + { + return infos[PATH_INFO]; + } + else + { + return (String)preq.getAttribute(INCLUDE_KEYS[PATH_INFO]); + } + } + public final String getQueryString() { - return infos[QUERY_STRING]; + if (infos !=3D null) + { + return infos[QUERY_STRING]; + } + else + { + return (String)preq.getAttribute(INCLUDE_KEYS[QUERY_STRING]); + } } = public final String getRequestURI() { - return infos[REQUEST_URI]; + if (infos !=3D null) + { + return infos[REQUEST_URI]; + } + else + { + return (String)preq.getAttribute(INCLUDE_KEYS[REQUEST_URI]); + } } = public final String getServletPath() { - return infos[SERVLET_PATH]; + if (infos !=3D null) + { + return infos[SERVLET_PATH]; + } + else + { + return (String)preq.getAttribute(INCLUDE_KEYS[SERVLET_PATH]); + } } = // Must be equivalent to the method of the PortletRequest @@ -275,15 +313,55 @@ { if (s !=3D null) { - Map containerAttributes =3D containerAttributesSt= ack.getLast(); +// Map containerAttributes =3D containerAttributes= Stack.getLast(); = // - if (containerAttributes.containsKey(s)) +// if (containerAttributes.containsKey(s)) +// { +// return containerAttributes.get(s); +// } + + if (dispatches.getLast().getType() =3D=3D DispatchType.INCLUDE) { - return containerAttributes.get(s); + for (String key : INCLUDE_KEYS) + { + if (key.equals(s)) + { + return preq.getAttribute(key); + } + } } + else + { + for (int i =3D 0;i < FORWARD_KEYS.length;i++) + { + if (FORWARD_KEYS[i].equals(s)) + { + if (infos !=3D null) + { + return infos[i]; + } + else + { + return preq.getAttribute(INCLUDE_KEYS[i]); + } + } + } + } = // + String[] containerKeys =3D dispatches.getLast().getType() =3D=3D = DispatchType.FORWARD ? FORWARD_KEYS : INCLUDE_KEYS; + + // + for (int i =3D 0;i < containerKeys.length;i++) + { + if (containerKeys[i].equals(s)) + { + return preq.getAttribute(INCLUDE_KEYS[i]); + } + } + + // if (ALL_CONTAINER_ATTRIBUTES.contains(s)) { return null; @@ -306,9 +384,18 @@ names.removeAll(ALL_CONTAINER_ATTRIBUTES); = // - names.addAll(containerAttributesStack.getLast().keySet()); + String[] containerKeys =3D dispatches.getLast().getType() =3D=3D Dis= patchType.FORWARD ? FORWARD_KEYS : INCLUDE_KEYS; = // + for (String containerKey : containerKeys) + { + if (getAttribute(containerKey) !=3D null) + { + names.add(containerKey); + } + } + + // return Collections.enumeration(names); } = @@ -521,150 +608,170 @@ dreq.setRequest(servletRequest); } = - public final ServletRequest getRequest() + public ServletRequest getRequest() { // That's a trick return dreq.getRequest(); } = - String[] pushDispatch(Dispatch dispatch) + void pushDispatch(Dispatch dispatch) { - String path =3D dispatch.getPath(); + dispatches.addLast(dispatch); = - // - String[] infos; - if (path !=3D null) + // We need to backup + if (dispatches.size() =3D=3D 2) { - infos =3D build(path); - - // - if (dispatch.getType() =3D=3D DispatchType.INCLUDE) + String[] infos =3D new String[INCLUDE_KEYS.length]; + for (int i =3D 0;i < INCLUDE_KEYS.length;i++) { - Map containerAttributes =3D new HashMap(); - for (int i =3D 0;i < infos.length;i++) - { - String value =3D infos[i]; - if (value !=3D null) - { - containerAttributes.put(INCLUDE_KEYS[i], value); - } - } - containerAttributesStack.addLast(containerAttributes); + infos[i] =3D (String)preq.getAttribute(INCLUDE_KEYS[i]); } - else - { - if (containerAttributesStack.size() =3D=3D 0) - { - Map containerAttributes =3D new HashMap(); - for (int i =3D 0;i < infos.length;i++) - { - String value =3D infos[i]; - if (value !=3D null) - { - containerAttributes.put(FORWARD_KEYS[i], value); - } - } - containerAttributesStack.addLast(containerAttributes); - } - else - { - Map containerAttributes =3D new HashMap(); - for (int i =3D 0;i < this.infos.length;i++) - { - String value =3D this.infos[i]; - if (value !=3D null) - { - containerAttributes.put(FORWARD_KEYS[i], value); - } - } - containerAttributesStack.addLast(containerAttributes); - } - } + this.infos =3D infos; } - else - { - infos =3D new String[5]; = - // - Map containerAttributes =3D Collections.emptyMap(= ); - containerAttributesStack.addLast(containerAttributes); - } = - // - return infos; +// String path =3D dispatch.getPath(); +// +// // +// String[] infos; +// if (path !=3D null) +// { +// infos =3D build(path); +// +// // +// if (dispatch.getType() =3D=3D DispatchType.INCLUDE) +// { +// Map containerAttributes =3D new HashMap(); +// for (int i =3D 0;i < infos.length;i++) +// { +// String value =3D infos[i]; +// if (value !=3D null) +// { +// containerAttributes.put(INCLUDE_KEYS[i], value); +// } +// } +// containerAttributesStack.addLast(containerAttributes); +// } +// else +// { +// if (containerAttributesStack.size() =3D=3D 0) +// { +// Map containerAttributes =3D new HashMap(); +// for (int i =3D 0;i < infos.length;i++) +// { +// String value =3D infos[i]; +// if (value !=3D null) +// { +// containerAttributes.put(FORWARD_KEYS[i], value); +// } +// } +// containerAttributesStack.addLast(containerAttributes); +// } +// else +// { +// Map containerAttributes =3D new HashMap(); +// for (int i =3D 0;i < this.infos.length;i++) +// { +// String value =3D this.infos[i]; +// if (value !=3D null) +// { +// containerAttributes.put(FORWARD_KEYS[i], value); +// } +// } +// containerAttributesStack.addLast(containerAttributes); +// } +// } +// } +// else +// { +// infos =3D new String[5]; +// +// // +// Map containerAttributes =3D Collections.emptyMa= p(); +// containerAttributesStack.addLast(containerAttributes); +// } +// +// // +// return infos; } = - private String[] build(String path) +// private String[] build(String path) +// { +// if (path =3D=3D null) +// { +// throw new IllegalArgumentException(); +// } +// +// // +// String servletPath; +// String pathInfo; +// String queryString; +// int endOfServletPath =3D path.indexOf('/', 1); +// if (endOfServletPath =3D=3D -1) +// { +// endOfServletPath =3D path.indexOf('?', 1); +// if (endOfServletPath =3D=3D -1) +// { +// servletPath =3D path; +// pathInfo =3D ""; +// queryString =3D ""; +// } +// else +// { +// servletPath =3D path.substring(0, endOfServletPath); +// pathInfo =3D null; +// queryString =3D path.substring(endOfServletPath + 1); +// } +// } +// else +// { +// servletPath =3D path.substring(0, endOfServletPath); +// int endOfPathInfo =3D path.indexOf('?', endOfServletPath + 1); +// if (endOfPathInfo =3D=3D -1) +// { +// pathInfo =3D path.substring(endOfServletPath); +// queryString =3D ""; +// } +// else +// { +// pathInfo =3D path.substring(endOfServletPath, endOfPathInfo); +// queryString =3D path.substring(endOfPathInfo + 1); +// } +// } +// +// // +// String[] infos =3D new String[5]; +// +// // +// StringBuffer requestURI =3D new StringBuffer(preq.getContextPath()= ); +// requestURI.append(servletPath); +// if (pathInfo !=3D null) +// { +// requestURI.append(pathInfo); +// infos[PATH_INFO] =3D pathInfo; +// } +// +// // +// infos[SERVLET_PATH] =3D servletPath; +// infos[QUERY_STRING] =3D queryString; +// infos[REQUEST_URI] =3D requestURI.toString(); +// infos[CONTEXT_PATH] =3D preq.getContextPath(); +// +// // +// return infos; +// } + + void popDispatch() { - if (path =3D=3D null) + if (dispatches.size() =3D=3D 2) { - throw new IllegalArgumentException(); + infos =3D null; // We could remove that as it's not going to chan= ge, but for now... } = // - String servletPath; - String pathInfo; - String queryString; - int endOfServletPath =3D path.indexOf('/', 1); - if (endOfServletPath =3D=3D -1) - { - endOfServletPath =3D path.indexOf('?', 1); - if (endOfServletPath =3D=3D -1) - { - servletPath =3D path; - pathInfo =3D ""; - queryString =3D ""; - } - else - { - servletPath =3D path.substring(0, endOfServletPath); - pathInfo =3D null; - queryString =3D path.substring(endOfServletPath + 1); - } - } - else - { - servletPath =3D path.substring(0, endOfServletPath); - int endOfPathInfo =3D path.indexOf('?', endOfServletPath + 1); - if (endOfPathInfo =3D=3D -1) - { - pathInfo =3D path.substring(endOfServletPath); - queryString =3D ""; - } - else - { - pathInfo =3D path.substring(endOfServletPath, endOfPathInfo); - queryString =3D path.substring(endOfPathInfo + 1); - } - } - - // - String[] infos =3D new String[5]; - - // - StringBuffer requestURI =3D new StringBuffer(preq.getContextPath()); - requestURI.append(servletPath); - if (pathInfo !=3D null) - { - requestURI.append(pathInfo); - infos[PATH_INFO] =3D pathInfo; - } - - // - infos[SERVLET_PATH] =3D servletPath; - infos[QUERY_STRING] =3D queryString; - infos[REQUEST_URI] =3D requestURI.toString(); - infos[CONTEXT_PATH] =3D preq.getContextPath(); - - // - return infos; + dispatches.removeLast(); } = - void popDispatch() - { - containerAttributesStack.removeLast(); - } - /** * Returns the an implementation of javax.servlet.http.HttpSessio= n that wraps this * portlet session and use the specified scope for manipulating attribu= tes. This session is used Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/DispatchtedRequestDispatcher.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/DispatchtedRequestDispatcher.java 2008-02-26 23:13:42 UTC (rev 10= 123) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/DispatchtedRequestDispatcher.java 2008-02-26 23:28:54 UTC (rev 10= 124) @@ -75,7 +75,7 @@ dreq.pushDispatch(new Dispatch(DispatchType.FORWARD, path)); try { - realDispatcher.forward(req, resp); + realDispatcher.include(req, resp); } finally { Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/PortletRequestDispatcherImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletRequestDispatcherImpl.java 2008-02-26 23:13:42 UTC (re= v 10123) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletRequestDispatcherImpl.java 2008-02-26 23:28:54 UTC (re= v 10124) @@ -38,6 +38,7 @@ import javax.portlet.ActionRequest; import javax.portlet.EventRequest; import javax.portlet.ResourceRequest; +import javax.portlet.MimeResponse; import javax.portlet.filter.PortletRequestWrapper; import javax.portlet.filter.PortletResponseWrapper; import javax.servlet.RequestDispatcher; @@ -140,7 +141,24 @@ dispatcher.include(direq, diresp); break; case FORWARD: - dispatcher.forward(direq, diresp); + + if (resp instanceof MimeResponse) + { + if (((MimeResponse)resp).isCommitted()) + { + throw new IllegalStateException(); + } + ((MimeResponse)resp).resetBuffer(); + } + + dispatcher.include(direq, diresp); + + // For now here + if (resp instanceof MimeResponse) + { + ((MimeResponse)resp).flushBuffer(); + } + break; } } Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/ext/dispatcher/FiltersTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/dispatcher/FiltersTestCase.java 2008-02-26 23:13:42 UTC (rev = 10123) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/dispatcher/FiltersTestCase.java 2008-02-26 23:28:54 UTC (rev = 10124) @@ -25,7 +25,6 @@ import org.jboss.portal.unit.PortletTestCase; import org.jboss.portal.unit.PortletTestContext; import org.jboss.portal.unit.actions.PortletRenderTestAction; -import org.jboss.portal.test.portlet.framework.UTP2; import org.jboss.portal.test.portlet.framework.UTP1; import org.jboss.portal.common.util.Tools; import org.jboss.portal.unit.annotations.TestCase; @@ -88,7 +87,7 @@ assertNotNull(prd); ServletFilter.ids.clear(); prd.forward(request, response); - assertEquals(Tools.toSet("FORWARD_URL_PATTERN_FILTER", "FORWAR= D_NAMED_FILTER"), ServletFilter.ids); + assertEquals(Tools.toSet("INCLUDE_URL_PATTERN_FILTER", "INCLUD= E_NAMED_FILTER"), ServletFilter.ids); = // return new InvokeGetResponse(response.createRenderURL().toStri= ng()); @@ -102,7 +101,7 @@ assertNotNull(prd); ServletFilter.ids.clear(); prd.forward(request, response); - assertEquals(Collections.singleton("FORWARD_NAMED_FILTER"), Se= rvletFilter.ids); + assertEquals(Collections.singleton("INCLUDE_NAMED_FILTER"), Se= rvletFilter.ids); = // return new EndTestResponse(); Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/ext/dispatcher/IncludeMarkupFileTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/dispatcher/IncludeMarkupFileTestCase.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/dispatcher/IncludeMarkupFileTestCase.java 2008-02-26 23:28:54= UTC (rev 10124) @@ -0,0 +1,77 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.test.portlet.jsr286.ext.dispatcher; + +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.base.AbstractUniversalTestPortlet; +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import static org.jboss.unit.api.Assert.*; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.PortletRequestDispatcher; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)TestCase +public class IncludeMarkupFileTestCase +{ + public IncludeMarkupFileTestCase(PortletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + PortletRequestDispatcher dispatcher =3D assertNotNull(((Abstra= ctUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher("/= file.html")); + dispatcher.include(request, response); + + // + return new InvokeGetResponse(response.createRenderURL().toStri= ng()); + } + }); + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + String body =3D new String(context.getResponseBody(), "UTF-8"); + + // + assertTrue("Expected " + body + " to contain @DISPATCHED_MARKU= P@ token", body.contains("@DISPATCHED_MARKUP@")); + = + // + return new EndTestResponse(); + } + }); + } +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/ResourceRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ResourceRenderer.java 2008-02-26 23:13:42 UTC (rev 10123) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ResourceRenderer.java 2008-02-26 23:28:54 UTC (rev 10124) @@ -51,20 +51,28 @@ = protected void renderContent(HttpServletResponse resp) throws IOExcepti= on { + String contentType =3D fragment.getContentType(); + if (contentType !=3D null) + { + resp.setContentType(contentType); + } + // if (fragment.getType() =3D=3D FragmentResponse.TYPE_EMPTY) { - resp.setStatus(HttpServletResponse.SC_NO_CONTENT); +// resp.setStatus(HttpServletResponse.SC_NO_CONTENT); + ServletOutputStream out =3D null; + try + { + out =3D resp.getOutputStream(); + } + finally + { + IOTools.safeClose(out); + } } else { - String contentType =3D fragment.getContentType(); - if (contentType !=3D null) - { - resp.setContentType(contentType); - } - - // if (fragment.getType() =3D=3D FragmentResponse.TYPE_BYTES) { ServletOutputStream out =3D null; Added: modules/portlet/trunk/test/src/test/resources/jsr286/ext/dispatcher-= war/file.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/jsr286/ext/dispatcher-war= /file.html (rev 0) +++ modules/portlet/trunk/test/src/test/resources/jsr286/ext/dispatcher-war= /file.html 2008-02-26 23:28:54 UTC (rev 10124) @@ -0,0 +1 @@ +(a)DISPATCHED_MARKUP@ \ No newline at end of file --===============0095910505380556332==-- From portal-commits at lists.jboss.org Tue Feb 26 18:46:38 2008 Content-Type: multipart/mixed; boundary="===============3749429161101244721==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10125 - modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/dispatcher. Date: Tue, 26 Feb 2008 18:46:38 -0500 Message-ID: --===============3749429161101244721== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-26 18:46:38 -0500 (Tue, 26 Feb 2008) New Revision: 10125 Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/ext/dispatcher/IncludeMarkupFileTestCase.java Log: extend file serving test case to resource phase Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/ext/dispatcher/IncludeMarkupFileTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/dispatcher/IncludeMarkupFileTestCase.java 2008-02-26 23:28:54= UTC (rev 10124) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/ext/dispatcher/IncludeMarkupFileTestCase.java 2008-02-26 23:46:38= UTC (rev 10125) @@ -27,6 +27,7 @@ import org.jboss.portal.unit.base.AbstractUniversalTestPortlet; import org.jboss.portal.unit.annotations.TestCase; import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.unit.actions.PortletResourceTestAction; import org.jboss.portal.test.portlet.framework.UTP1; import org.jboss.unit.driver.DriverResponse; import org.jboss.unit.driver.response.EndTestResponse; @@ -38,6 +39,8 @@ import javax.portlet.RenderResponse; import javax.portlet.PortletException; import javax.portlet.PortletRequestDispatcher; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; import java.io.IOException; = /** @@ -70,6 +73,30 @@ assertTrue("Expected " + body + " to contain @DISPATCHED_MARKU= P@ token", body.contains("@DISPATCHED_MARKUP@")); = // + return new InvokeGetResponse(response.createResourceURL().toSt= ring()); + } + }); + seq.bindAction(2, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + { + protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException + { + PortletRequestDispatcher dispatcher =3D assertNotNull(((Abstra= ctUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher("/= file.html")); + dispatcher.include(request, response); + + // + return new InvokeGetResponse(response.createResourceURL().toSt= ring()); + } + }); + seq.bindAction(3, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestA= ction() + { + protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException + { + String body =3D new String(context.getResponseBody(), "UTF-8"); + + // + assertTrue("Expected " + body + " to contain @DISPATCHED_MARKU= P@ token", body.contains("@DISPATCHED_MARKUP@")); + + // return new EndTestResponse(); } }); --===============3749429161101244721==-- From portal-commits at lists.jboss.org Tue Feb 26 18:53:20 2008 Content-Type: multipart/mixed; boundary="===============3426250218680603989==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10126 - in modules/portlet/trunk/portlet/src: test/java/org/jboss/portal/unit and 1 other directory. Date: Tue, 26 Feb 2008 18:53:20 -0500 Message-ID: --===============3426250218680603989== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-26 18:53:20 -0500 (Tue, 26 Feb 2008) New Revision: 10126 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletContextImpl.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/TestCo= ntants.java Log: update major version returned by PortletContext and update test case accord= ingly Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/PortletContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletContextImpl.java 2008-02-26 23:46:38 UTC (rev 10125) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletContextImpl.java 2008-02-26 23:53:20 UTC (rev 10126) @@ -106,7 +106,7 @@ = public int getMajorVersion() { - return 1; + return 2; } = public int getMinorVersion() Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit= /TestContants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/TestC= ontants.java 2008-02-26 23:46:38 UTC (rev 10125) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/TestC= ontants.java 2008-02-26 23:53:20 UTC (rev 10126) @@ -38,6 +38,6 @@ public static final int MINOR_VERSION =3D 0; = /** int for PortletContext.getMajorVersion(). */ - public static final int MAJOR_VERSION =3D 1; + public static final int MAJOR_VERSION =3D 2; = } --===============3426250218680603989==-- From portal-commits at lists.jboss.org Tue Feb 26 19:53:36 2008 Content-Type: multipart/mixed; boundary="===============7638162195952652324==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10127 - in modules/portlet/trunk/portlet/src: test/java/org/jboss/portal/test/portlet/jsr286/tck/portletrequests and 1 other directory. Date: Tue, 26 Feb 2008 19:53:35 -0500 Message-ID: --===============7638162195952652324== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-26 19:53:35 -0500 (Tue, 26 Feb 2008) New Revision: 10127 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletContainerImpl.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portletrequests/LifeCyclePhaseRequestAttributeTestCase.java Log: fix wrong resource serving life cycle phase request attribute and update te= st case accordingly Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletContainerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletContainerImpl.java 2008-02-26 23:53:20 UTC (rev 10126) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletContainerImpl.java 2008-02-27 00:53:35 UTC (rev 10127) @@ -72,6 +72,7 @@ import javax.portlet.RenderResponse; import javax.portlet.ResourceRequest; import javax.portlet.ResourceResponse; +import javax.portlet.PortletRequest; import javax.portlet.filter.PortletFilter; import javax.portlet.filter.ActionFilter; import javax.portlet.filter.EventFilter; @@ -462,28 +463,28 @@ { req =3D new ActionRequestImpl(this, (ActionInvocation)invocation); resp =3D new ActionResponseImpl((ActionInvocation)invocation, req= ); - phase =3D "ACTION_PHASE"; + phase =3D PortletRequest.ACTION_PHASE; chain =3D new FilterChainImpl(actionFilterList, Act= ionFilter.class); } else if (invocation instanceof RenderInvocation) { req =3D new RenderRequestImpl(this, (RenderInvocation)invocation); resp =3D new RenderResponseImpl((RenderInvocation)invocation, req= ); - phase =3D "RENDER_PHASE"; + phase =3D PortletRequest.RENDER_PHASE; chain =3D new FilterChainImpl(renderFilterList, Ren= derFilter.class); } else if (invocation instanceof EventInvocation) { req =3D new EventRequestImpl(this, (EventInvocation)invocation); resp =3D new EventResponseImpl((EventInvocation)invocation, req); - phase =3D "EVENT_PHASE"; + phase =3D PortletRequest.EVENT_PHASE; chain =3D new FilterChainImpl(eventFilterList, Event= Filter.class); } else if (invocation instanceof ResourceInvocation) { req =3D new ResourceRequestImpl(this, (ResourceInvocation)invocat= ion); resp =3D new ResourceResponseImpl((ResourceInvocation)invocation,= req); - phase =3D "RESOURCE_SERVING_PHASE"; + phase =3D PortletRequest.RESOURCE_PHASE; chain =3D new FilterChainImpl(resourceFilterList,= ResourceFilter.class); } else Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/portletrequests/LifeCyclePhaseRequestAttributeTestCase.= java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletrequests/LifeCyclePhaseRequestAttributeTestCase.java 2= 008-02-26 23:53:20 UTC (rev 10126) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletrequests/LifeCyclePhaseRequestAttributeTestCase.java 2= 008-02-27 00:53:35 UTC (rev 10127) @@ -70,7 +70,7 @@ { protected void run(Portlet portlet, ActionRequest request, Action= Response response, PortletTestContext context) throws PortletException, IOE= xception { - assertEquals("ACTION_PHASE", request.getAttribute(PortletReque= st.LIFECYCLE_PHASE)); + assertEquals(PortletRequest.ACTION_PHASE, request.getAttribute= (PortletRequest.LIFECYCLE_PHASE)); = // response.setEvent("Event", null); @@ -80,14 +80,14 @@ { protected void run(Portlet portlet, EventRequest request, EventRe= sponse response, PortletTestContext context) throws PortletException, IOExc= eption { - assertEquals("EVENT_PHASE", request.getAttribute(PortletReques= t.LIFECYCLE_PHASE)); + assertEquals(PortletRequest.RENDER_PHASE, request.getAttribute= (PortletRequest.LIFECYCLE_PHASE)); } }); seq.bindAction(1, UTP6.RENDER_JOIN_POINT, new PortletRenderTestActio= n() { protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException { - assertEquals("RENDER_PHASE", request.getAttribute(PortletReque= st.LIFECYCLE_PHASE)); + assertEquals(PortletRequest.RENDER_PHASE, request.getAttribute= (PortletRequest.LIFECYCLE_PHASE)); = // return new InvokeGetResponse(response.createResourceURL().toSt= ring()); @@ -97,7 +97,7 @@ { protected DriverResponse run(Portlet portlet, ResourceRequest req= uest, ResourceResponse response, PortletTestContext context) throws Portlet= Exception, IOException { - assertEquals("RESOURCE_SERVING_PHASE", request.getAttribute(Po= rtletRequest.LIFECYCLE_PHASE)); + assertEquals(PortletRequest.RESOURCE_PHASE, request.getAttribu= te(PortletRequest.LIFECYCLE_PHASE)); = // return new EndTestResponse(); --===============7638162195952652324==-- From portal-commits at lists.jboss.org Tue Feb 26 20:12:26 2008 Content-Type: multipart/mixed; boundary="===============6459370398221117871==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10128 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck. Date: Tue, 26 Feb 2008 20:12:26 -0500 Message-ID: --===============6459370398221117871== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-26 20:12:26 -0500 (Tue, 26 Feb 2008) New Revision: 10128 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/t= ck/TCKRendererContext.java Log: if no page state exist then the list of portlets is empty Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/tck/TCKRendererContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKRendererContext.java 2008-02-27 00:53:35 UTC (rev 10127) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKRendererContext.java 2008-02-27 01:12:26 UTC (rev 10128) @@ -47,10 +47,15 @@ = // Collection involvedPortlets =3D new ArrayList(); - for (String involvedPortletId : pageState.getInvolvedPortlets()) + + // Page state could be null for some requests + if (pageState !=3D null) { - Portlet involvedPortlet =3D portletControllerContext.getPortlet(i= nvolvedPortletId); - involvedPortlets.add(involvedPortlet); + for (String involvedPortletId : pageState.getInvolvedPortlets()) + { + Portlet involvedPortlet =3D portletControllerContext.getPortle= t(involvedPortletId); + involvedPortlets.add(involvedPortlet); + } } = // --===============6459370398221117871==-- From portal-commits at lists.jboss.org Tue Feb 26 20:49:30 2008 Content-Type: multipart/mixed; boundary="===============8555470198047610524==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10129 - in modules/portlet/trunk: test/src/main/java/org/jboss/portal/portlet/test and 2 other directories. Date: Tue, 26 Feb 2008 20:49:30 -0500 Message-ID: --===============8555470198047610524== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-26 20:49:30 -0500 (Tue, 26 Feb 2008) New Revision: 10129 Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portletrequests/LifeCyclePhaseRequestAttributeTestCase.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortalServlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/AbstractMarkupRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/ControllerResponseRendererFactory.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/ResourceRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/t= ck/TCKServlet.java Log: - added configuration of the renderer for accomodating portal servlet and T= CK servlet Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr286/tck/portletrequests/LifeCyclePhaseRequestAttributeTestCase.= java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletrequests/LifeCyclePhaseRequestAttributeTestCase.java 2= 008-02-27 01:12:26 UTC (rev 10128) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletrequests/LifeCyclePhaseRequestAttributeTestCase.java 2= 008-02-27 01:49:30 UTC (rev 10129) @@ -80,7 +80,7 @@ { protected void run(Portlet portlet, EventRequest request, EventRe= sponse response, PortletTestContext context) throws PortletException, IOExc= eption { - assertEquals(PortletRequest.RENDER_PHASE, request.getAttribute= (PortletRequest.LIFECYCLE_PHASE)); + assertEquals(PortletRequest.EVENT_PHASE, request.getAttribute(= PortletRequest.LIFECYCLE_PHASE)); } }); seq.bindAction(1, UTP6.RENDER_JOIN_POINT, new PortletRenderTestActio= n() Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortalServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortalServlet.java 2008-02-27 01:12:26 UTC (rev 10128) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortalServlet.java 2008-02-27 01:49:30 UTC (rev 10129) @@ -92,9 +92,16 @@ ControllerResponse response =3D controller.process(context, reque= st); = // - Renderer renderer =3D ControllerResponseRendererFactory.getRender= er(response); + ControllerResponseRendererFactory rendererFactory =3D new Control= lerResponseRendererFactory( + true, + true, + context.getStateControllerContext(), + request.getPageState()); = // + Renderer renderer =3D rendererFactory.getRenderer(response); + + // renderer.render(new RendererContextImpl(context)); } else Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/AbstractMarkupRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractMarkupRenderer.java 2008-02-27 01:12:26 UTC (rev 10128) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractMarkupRenderer.java 2008-02-27 01:49:30 UTC (rev 10129) @@ -24,7 +24,6 @@ package org.jboss.portal.portlet.test.controller; = import org.jboss.portal.common.util.MultiValuedPropertyMap; -import org.jboss.portal.portlet.controller.PortletControllerContext; import org.jboss.portal.portlet.invocation.response.ResponseProperties; = import javax.servlet.http.Cookie; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/ControllerResponseRendererFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ControllerResponseRendererFactory.java 2008-02-27 01:12:26 UTC (= rev 10128) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ControllerResponseRendererFactory.java 2008-02-27 01:49:30 UTC (= rev 10129) @@ -27,10 +27,13 @@ import org.jboss.portal.portlet.controller.response.PageUpdateResponse; import org.jboss.portal.portlet.controller.response.PortletResponse; import org.jboss.portal.portlet.controller.response.ResourceResponse; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.StateControllerContext; import org.jboss.portal.portlet.invocation.response.ErrorResponse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.HTTPRedirectionRespons= e; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.response.ResponseProperties; = /** * @author Julien Viet @@ -38,8 +41,33 @@ */ public class ControllerResponseRendererFactory { - public static Renderer getRenderer(ControllerResponse response) + + /** . */ + private boolean sendNoContentResponseOnEmptyResource; + + /** . */ + private boolean sendErrorOnProcessActionError; + + /** The page navigational state if there is one in the request. */ + private PageNavigationalState requestPageState; + + /** . */ + private StateControllerContext stateControllerContext; + + public ControllerResponseRendererFactory( + boolean sendNoContentResponseOnEmptyResource, + boolean sendErrorOnProcessActionError, + StateControllerContext stateControllerContext, + PageNavigationalState requestPageState) { + this.sendNoContentResponseOnEmptyResource =3D sendNoContentResponseO= nEmptyResource; + this.sendErrorOnProcessActionError =3D sendErrorOnProcessActionError; + this.stateControllerContext =3D stateControllerContext; + this.requestPageState =3D requestPageState; + } + + public Renderer getRenderer(ControllerResponse response) + { if (response instanceof PageUpdateResponse) { PageUpdateResponse pageUpdate =3D (PageUpdateResponse)response; @@ -58,7 +86,7 @@ // if (resourceResponse.response instanceof FragmentResponse) { - return new ResourceRenderer((FragmentResponse)resourceResponse= .response); + return new ResourceRenderer((FragmentResponse)resourceResponse= .response, sendNoContentResponseOnEmptyResource); } else { @@ -70,7 +98,7 @@ throw new IllegalArgumentException("Unknown response type: " + respo= nse); } = - private static Renderer getRenderer(PortletInvocationResponse response) + private Renderer getRenderer(PortletInvocationResponse response) { if (response instanceof HTTPRedirectionResponse) { @@ -78,7 +106,14 @@ } else if (response instanceof ErrorResponse) { - return new ErrorResponseRenderer((ErrorResponse)response); + if (sendErrorOnProcessActionError) + { + return new ErrorResponseRenderer((ErrorResponse)response); + } + else + { + return new PageRenderer(new ResponseProperties(), requestPageS= tate !=3D null ? requestPageState : stateControllerContext.createPageState(= false)); + } } = // Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/ResourceRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ResourceRenderer.java 2008-02-27 01:12:26 UTC (rev 10128) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ResourceRenderer.java 2008-02-27 01:49:30 UTC (rev 10129) @@ -41,38 +41,55 @@ /** . */ private FragmentResponse fragment; = - public ResourceRenderer(FragmentResponse response) + /** . */ + private boolean sendNoContentResponseOnEmptyResource; + + public ResourceRenderer(FragmentResponse response, boolean sendNoConten= tResponseOnEmptyResource) { super(response.getProperties()); = // + this.sendNoContentResponseOnEmptyResource =3D sendNoContentResponseO= nEmptyResource; this.fragment =3D response; } = protected void renderContent(HttpServletResponse resp) throws IOExcepti= on { - String contentType =3D fragment.getContentType(); - if (contentType !=3D null) - { - resp.setContentType(contentType); - } - - // if (fragment.getType() =3D=3D FragmentResponse.TYPE_EMPTY) { -// resp.setStatus(HttpServletResponse.SC_NO_CONTENT); - ServletOutputStream out =3D null; - try + if (sendNoContentResponseOnEmptyResource) { - out =3D resp.getOutputStream(); + resp.setStatus(HttpServletResponse.SC_NO_CONTENT); } - finally + else { - IOTools.safeClose(out); + String contentType =3D fragment.getContentType(); + if (contentType !=3D null) + { + resp.setContentType(contentType); + } + + // + ServletOutputStream out =3D null; + try + { + out =3D resp.getOutputStream(); + } + finally + { + IOTools.safeClose(out); + } } } else { + String contentType =3D fragment.getContentType(); + if (contentType !=3D null) + { + resp.setContentType(contentType); + } + + // if (fragment.getType() =3D=3D FragmentResponse.TYPE_BYTES) { ServletOutputStream out =3D null; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/tck/TCKServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKServlet.java 2008-02-27 01:12:26 UTC (rev 10128) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKServlet.java 2008-02-27 01:49:30 UTC (rev 10129) @@ -25,7 +25,6 @@ import org.jboss.portal.portlet.test.controller.Renderer; import org.jboss.portal.portlet.test.controller.ControllerResponseRenderer= Factory; import org.jboss.portal.portlet.test.controller.PageRenderer; -import org.jboss.portal.portlet.test.controller.AbstractRendererContext; import org.jboss.portal.portlet.test.URLParameterConstants; import org.jboss.portal.portlet.controller.PortletController; import org.jboss.portal.portlet.controller.response.ControllerResponse; @@ -51,6 +50,7 @@ public class TCKServlet extends HttpServlet { = + /** . */ public static String TCK_PORTLET_NAME =3D "portletName"; = protected void service(HttpServletRequest req, HttpServletResponse resp= ) throws ServletException, IOException @@ -101,9 +101,16 @@ ControllerResponse response =3D controller.process(context, reque= st); = // - Renderer renderer =3D ControllerResponseRendererFactory.getRender= er(response); + ControllerResponseRendererFactory rendererFactory =3D new Control= lerResponseRendererFactory( + false, + false, + context.getStateControllerContext(), + request.getPageState()); = // + Renderer renderer =3D rendererFactory.getRenderer(response); + + // renderer.render(new TCKRendererContext(context, tckPageState)); } else --===============8555470198047610524==-- From portal-commits at lists.jboss.org Tue Feb 26 21:01:48 2008 Content-Type: multipart/mixed; boundary="===============3257180688586098570==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10130 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Tue, 26 Feb 2008 21:01:48 -0500 Message-ID: --===============3257180688586098570== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-26 21:01:47 -0500 (Tue, 26 Feb 2008) New Revision: 10130 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescr= iptors.xml Log: 6.1.3. The JBoss Portal Object DTD revising elements names to make them consistent with portal-object_2_6.dtd Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/x= mldescriptors.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-27 01:49:30 UTC (rev 10129) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-27 02:01:47 UTC (rev 10130) @@ -524,7 +524,7 @@ ]]> +]]> @@ -606,7 +606,8 @@ ]]> +]]> @@ -620,13 +621,14 @@ The context name value. + + +]]> + + -]]> - - - A portal object of type portal. A portal type represents a virtual porta= l and can have children of type page. In addition of the common portal obje= ct elements it support also the declaration of the modes and the window sta= tes it supports. If no declaration of modes or window states is done then t= he default value will be respectively (view,edit,help) and (normal,minimize= d,maximized). @@ -695,7 +697,8 @@ ]]> +]]> @@ -712,7 +715,8 @@ ]]> +]]> @@ -884,40 +888,37 @@ - The <policy-permission> element i= s used to secure a specific portal page based on a user's role. + The <policy-permission> element i= s used to secure a specific portlet instance based on a user's role. ]]> - - - The <role-name> element is used t= o define a role that this security constraint will apply to. - - - Example>:Access to this portal page is limited to the defined role. - - - -<role-name>SOMEROLE</role-name> - - - + + + The <action-name> element is us= ed to define the access rights given to the role defined. The accepted valu= e is view, which allows users to view the = page. + + ]]> - - - The unchecked element is used to define (if present) that anyone can vie= w this portal page. - - + + + If present, the <unchecked> e= lement is used to define that anyone can view this instance. + + ]]> - - - The action-name element is used to define the access rights given to the= role defined. Possible value is: view - Users can view the page. - + + + The <role-name> element is used= to define a role that the security constraint will apply to. The following= example only allows users that are part of the EXAMPLEROLE= role to access this instance: + + +EXAMPLEROLE]]> + + --===============3257180688586098570==-- From portal-commits at lists.jboss.org Tue Feb 26 23:03:44 2008 Content-Type: multipart/mixed; boundary="===============6254551777857573699==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10131 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Tue, 26 Feb 2008 23:03:43 -0500 Message-ID: --===============6254551777857573699== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-26 23:03:42 -0500 (Tue, 26 Feb 2008) New Revision: 10131 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescr= iptors.xml Log: - revising 6.1.3. The JBoss Portal Object DTD - 5. Portlet Primer making modes consistent, eg s/VIEW/view Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-27 02:01:47 UTC (rev 10130) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-27 04:03:42 UTC (rev 10131) @@ -47,17 +47,17 @@ - VIEW - generates markup reflecting the current state of the port= let. + view - generates markup reflect= ing the current state of the portlet. - EDIT - allows a user to customize the behavior of the portlet. + edit - allows a user to customi= ze the behavior of the portlet. - HELP - provides information to the user as to how to use the por= tlet. + help - provides information to = the user as to how to use the portlet. @@ -73,17 +73,17 @@ - NORMAL - a portlet shares this page with other portlets. + normal - a portlet shares this = page with other portlets. - MINIMIZED -a portlet may show very little information, or none a= t all. + minimized -a portlet may show v= ery little information, or none at all. - MAXIMIZED - a portlet may be the only portlet displayed on this = page. + maximized - a portlet may be th= e only portlet displayed on this page. @@ -215,7 +215,7 @@ throws PortletException, IOException, UnavailableException - As we extend from GenericPortlet, and are only int= erested in supporting the VIEW mode, only the d= oView method needs to be implemented, and the GenericPor= tlet render implemention calls our implementat= ion when the VIEW mode is requested. + As we extend from GenericPortlet, and are only int= erested in supporting the view mode, only the d= oView method needs to be implemented, and the GenericPor= tlet render implemention calls our implementat= ion when the view mode is requested. @@ -282,7 +282,7 @@ org.jboss.portlet.hello.HelloWorldPortlet text/html - VIEW + view HelloWorld Portlet @@ -312,12 +312,12 @@ text/html - VIEW + view ]]> The <supports> element allows you= to declare all of the markup types that your portlet supports in the render method. This is accomplished via the - <mime-type> element, which is req= uired for every portlet. The declared MIME types must match the capability = of the portlet. As well, it allows you to pair which modes and window state= s are supported for each markup type. All portlets must support the VIEW po= rtlet mode, so this does not have to be declared. Use the &= lt;mime-type> element to define which markup type your = portlet supports, which in this example, is text/html. This section tells the portal that it will only output text an= d HTML, and that it only supports the VIEW= mode. + <mime-type> element, which is req= uired for every portlet. The declared MIME types must match the capability = of the portlet. As well, it allows you to pair which modes and window state= s are supported for each markup type. All portlets must support the view portlet mode, so this does not have to be de= clared. Use the <mime-type> element = to define which markup type your portlet supports, which in this example, i= s text/html. This section tells the portal= that it will only output text and HTML, and that it only supports the view mode. @@ -475,7 +475,7 @@ = - JBoss Portal 2.6 introduces the notion of content= type, which is a generic mechanism to + JBoss Portal 2.6 introduces the notion of content= -type, which is a generic mechanism to specify what content will be displayed by a given portlet w= indow. The window section of the previous example, HelloWorldPortlet/WEB-INF/hello= world-object.xml, can be re-written to take advantage of the new= content framework. The following is an example deployment descriptor that = uses the new content framework: @@ -1052,7 +1052,7 @@ text/html - VIEW + view HelloWorld JSF Portlet @@ -1087,12 +1087,12 @@ text/html - VIEW + view ]]> The <supports> element all= ows you to declare all of the markup types that your portlet supports in th= e render method. This is accomplished via the - <mime-type> element, which= is required for every portlet. The declared MIME types must match the capa= bility of the portlet. As well, it allows you to pair which modes and windo= w states are supported for each markup type. All portlets must support the = VIEW portlet mode, so this does not have to be declared. Use the <mime-type> element to define which markup typ= e your portlet supports, which in this example, is text/htm= l. This section tells the portal that it will only output = text and HTML, and that it only supports the VIEW mode. + <mime-type> element, which= is required for every portlet. The declared MIME types must match the capa= bility of the portlet. As well, it allows you to pair which modes and windo= w states are supported for each markup type. All portlets must support the = view portlet mode, so this does not have t= o be declared. Use the <mime-type> e= lement to define which markup type your portlet supports, which in this exa= mple, is text/html. This section tells the= portal that it will only output text and HTML, and that it only supports t= he view mode. @@ -1374,7 +1374,7 @@ text/html - VIEW + view HelloWorld JSF Portlet @@ -1409,12 +1409,12 @@ text/html - VIEW + view ]]> The <supports> element all= ows you to declare all of the markup types that your portlet supports in th= e render method. This is accomplished via the - <mime-type> element, which= is required for every portlet. The declared MIME types must match the capa= bility of the portlet. As well, it allows you to pair which modes and windo= w states are supported for each markup type. All portlets must support the = VIEW portlet mode, so this does not have to be declared. Use the <mime-type> element to define which markup typ= e your portlet supports, which in this example, is text/htm= l. This section tells the portal that it will only output = text and HTML, and that it only supports the VIEW mode. + <mime-type> element, which= is required for every portlet. The declared MIME types must match the capa= bility of the portlet. As well, it allows you to pair which modes and windo= w states are supported for each markup type. All portlets must support the = view portlet mode, so this does not have t= o be declared. Use the <mime-type> e= lement to define which markup type your portlet supports, which in this exa= mple, is text/html. This section tells the= portal that it will only output text and HTML, and that it only supports t= he view mode. Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/x= mldescriptors.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-27 02:01:47 UTC (rev 10130) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-27 04:03:42 UTC (rev 10131) @@ -528,7 +528,7 @@ - The <deployment> element is a gen= eric container for portal object elements. The <parent-r= ef> child gives the name of the parent object that the = current object will use as parent. The optional <if-exis= ts> element defines the behavior when a portal object w= hich an identical name is already child of the parent element. The default = behavior of the <if-exists> element = is to keep the existing object and not create a new object. The last elemen= t is the portal object itself. + The <deployment> element is a gen= eric container for portal object elements. The <parent-r= ef> child element gives the name of the parent object t= hat the current object will use as parent. The optional <= ;if-exists> element defines the behavior when a portal = object with an identical name is already a child of the parent element. The= default behavior of the <if-exists>= element is to keep the existing object, and not to create a new object. Th= e last element is the portal object itself. The following is an example of the <deployment> and <parent-ref> elem= ents: @@ -550,15 +550,17 @@ - a listener: specifies the id of a listener is the listener registry. = A listener object is able to listen portal events which apply to the portal= node hierarchy. + a listener: specifies the ID of a listener in the listener registry. = A listener object is able to listen to portal events, which apply to the po= rtal node hierarchy. - properties : a set of generic properties owned by the portal ob= ject. Some properties can drive the behavior of the object. + + properties: a set of generic properties owned by the portal object. C= ertain properties drive the behavior of the object. - security-constraint : defines security configuration of the por= tal object. + + security-constraint: defines the security configuration of the portal= object. @@ -569,7 +571,7 @@ - Contains a reference to the parent object. The naming convention for nam= ing object is to concatenate the names of the path to the object and separa= te the names by a dot. If the path is empty then the empty string must be u= sed. The <parent-ref> element tells = the portal where the portlet should appear. + Contains a reference to the parent object. The naming convention for nam= ing object is to concatenate the names of the path to the object, and separ= ate the names by a period. If the path is empty, then the empty string must= be used. The <parent-ref> element t= ells the portal where the portlet should appear. The following is an example of the root having an empty path: @@ -580,7 +582,7 @@ - The following specifies that the portlet will appear on the default page: + The following specifies that the portlet will appear in the portal insta= nce named default: @@ -611,7 +613,7 @@ - A portal object of type context. A context type represent a node in the = tree which does not have a visual representation. It can exist only under t= he root. A context can only have children with the portal type. + The context type of a portal object. A context type represent a node in = a tree, which does not have a visual representation. It only exists under r= oot. A context can only have children with the portal type. ]]> - - A portal object of type portal. A portal type represents a virtual porta= l and can have children of type page. In addition of the common portal obje= ct elements it support also the declaration of the modes and the window sta= tes it supports. If no declaration of modes or window states is done then t= he default value will be respectively (view,edit,help) and (normal,minimize= d,maximized). + = + A portal object with the type portal. A portal type= represents a virtual portal, and can only have children that use the type = page. In addition to the common portal object elements= , it also supports the declaration of the modes and the window states that = it supports. If there are no declarations of modes or window states, the de= fault value will be view, = edit, help, and normal, minimized,= maximized respectively. - The portal name value. + The portal name. - The supported modes of a portal. + The supported modes of the portal. Accepted values are v= iew, edit, and help. The following is an example of the <supported-mode>= ; element: @@ -666,7 +668,7 @@ - A portlet mode value. + The portlet mode value. @@ -675,7 +677,7 @@ - The supported window states of a portal. The following is an example of = the <supported-window-states> elemen= t: + Use the <supported-window-states>= element to define the supported window states for the portal. Accepted val= ues are normal, minimized<= /computeroutput>, and maximized. The follo= wing is an example of the <supported-window-states> element: - A window state value. + Use the <window-state> element to= define a window state. @@ -702,7 +704,7 @@ - A portal object of type page. A page type represents a page which can ha= ve children of type page and window. The children windows are the windows o= f the page and the children pages are the subpages of this page. + A portal object with the type page. A page type rep= resents a page, and can only have children that use the type page= and window. The children windows are the w= indows of the page, and the children pages are the sub-pages of this page. - A portal object of type window. A window type represents a window. Besid= e the common properties a window has a content and belong to a region on th= e page. + A portal object with the type window. A window type= represents a window. Beside the common properties, a window has content an= d belongs to a region on the page. - The instance-ref or content tags are used to define the content of the w= indow. The usage of the content tag is generic and can be used to describe = any kind of content. The instance-ref is a shortcut to define a content typ= e of portlet which points to a portlet instance. + The <instance-ref> and <content> elements are used to define the cont= ent of the window. The <content> ele= ment is generic, and is used to describe any kind of content. The <instance-ref> element is a shortcut to defin= e the content-type of portlet which points to a portlet instance. The region and height defines how the window is placed in the page. --===============6254551777857573699==-- From portal-commits at lists.jboss.org Wed Feb 27 00:51:20 2008 Content-Type: multipart/mixed; boundary="===============3574050639496222903==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10132 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Wed, 27 Feb 2008 00:51:20 -0500 Message-ID: --===============3574050639496222903== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-27 00:51:19 -0500 (Wed, 27 Feb 2008) New Revision: 10132 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescr= iptors.xml Log: 6.1.3. The JBoss Portal Object DTD minor revisions/periodic backup Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/x= mldescriptors.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-27 04:03:42 UTC (rev 10131) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-27 05:51:19 UTC (rev 10132) @@ -528,7 +528,7 @@ - The <deployment> element is a gen= eric container for portal object elements. The <parent-r= ef> child element gives the name of the parent object t= hat the current object will use as parent. The optional <= ;if-exists> element defines the behavior when a portal = object with an identical name is already a child of the parent element. The= default behavior of the <if-exists>= element is to keep the existing object, and not to create a new object. Th= e last element is the portal object itself. + The <deployment> element is a gen= eric container for portal object elements. The <parent-r= ef> child element gives the name of the parent object t= hat the current object will use as parent. The optional <= ;if-exists> element is used to define the action to tak= e if an instance with the same name already exists. The default behavior of= the <if-exists> element is to keep = the existing object, and not to create a new object. The following is an example of the <deployment> and <parent-ref> elem= ents: @@ -555,12 +555,12 @@ - properties: a set of generic properties owned by the portal object. C= ertain properties drive the behavior of the object. + properties: a set of generic properties owned by the portal object. C= ertain properties drive the behavior of the portal object. - security-constraint: defines the security configuration of the portal= object. + security-constraint: defines the security configuration for the porta= l object. @@ -571,7 +571,7 @@ - Contains a reference to the parent object. The naming convention for nam= ing object is to concatenate the names of the path to the object, and separ= ate the names by a period. If the path is empty, then the empty string must= be used. The <parent-ref> element t= ells the portal where the portlet should appear. + The <parent-ref> element contains= a reference to the parent object. The naming convention for naming objects= is to concatenate the names of the path to the object, and separate the na= mes by a period. If the path is empty, then the empty string must be used. = The <parent-ref> element tells the p= ortal where the portlet should appear. The syntax for the &= lt;parent-ref> element is = portal-instance.portal-page. The following is an example of the root having an empty path: @@ -613,7 +613,7 @@ - The context type of a portal object. A context type represent a node in = a tree, which does not have a visual representation. It only exists under r= oot. A context can only have children with the portal type. + The context type of the portal object. A context type represent a node i= n a tree, which does not have a visual representation, and only exists unde= r root. A context can only have children with the portal type. - Use the <supported-window-states>= element to define the supported window states for the portal. Accepted val= ues are normal, minimized<= /computeroutput>, and maximized. The follo= wing is an example of the <supported-window-states> element: + Use the <supported-window-states>= element to define the supported window states for the portal. Accepted val= ues are normal, minimized<= /computeroutput>, and maximized. The follo= wing is an example of the <supported-window-states> and <window-state> e= lements: - A portal object with the type page. A page type rep= resents a page, and can only have children that use the type page= and window. The children windows are the w= indows of the page, and the children pages are the sub-pages of this page. + A portal object with the type page. A page type rep= resents a page, and can only have children that use the type page= and window. The children windows are the w= indows of the page, and the children pages are the subpages of this page. - Define the content of the window as a reference to a portlet instance. T= he value is the id of the instance. + Define the content of the window as a reference to a portlet instance. T= he value is the ID of the instance. The following is an example of the <instance-ref><= /computeroutput> element: --===============3574050639496222903==-- From portal-commits at lists.jboss.org Wed Feb 27 01:45:25 2008 Content-Type: multipart/mixed; boundary="===============6375313082000800145==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10133 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Wed, 27 Feb 2008 01:45:24 -0500 Message-ID: --===============6375313082000800145== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-27 01:45:24 -0500 (Wed, 27 Feb 2008) New Revision: 10133 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescr= iptors.xml Log: 6.1.3. The JBoss Portal Object DTD minor revisions... Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/x= mldescriptors.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-27 05:51:19 UTC (rev 10132) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldesc= riptors.xml 2008-02-27 06:45:24 UTC (rev 10133) @@ -86,7 +86,7 @@ Use the <remotable> element to co= nfigure the default behavior of portlets with respect to WSRP exposure: if = no value is given, the value is either the value globally defined at the po= rtlet application level, or false. Accepte= d values are true and fals= e. = - You can configure specific settings for the portlet container for each p= ortlet defined in the WEB-INF/portlet.xml file. Use th= e <service> element to inject servic= es into the portlet context of applications. + You can configure specific settings of the portlet container for each po= rtlet defined in the WEB-INF/portlet.xml file. Use the= <service> element to inject service= s into the portlet context of applications. @@ -96,7 +96,7 @@ - Additional configuration for the portlet. The <portle= t-name> element defines the portlet name. It must match= a portlet defined in the WEB-INF/portlet.xml file for= that application. + Additional configuration of the portlet. The <portlet= -name> element defines the portlet name. It must match = a portlet defined in the WEB-INF/portlet.xml file for = that application. Use the <remotable> element to co= nfigure the default behavior of portlets with respect to WSRP exposure: if = no value is given, the value is either the value globally defined at the po= rtlet application level, or false. @@ -613,7 +613,7 @@ - The context type of the portal object. A context type represent a node i= n a tree, which does not have a visual representation, and only exists unde= r root. A context can only have children with the portal type. + The context type of the portal object. A context type represent a node i= n a tree, which does not have a visual representation, and only exists unde= r the root. A context can only have children that use the portal<= /emphasis> type. - The context name value. + The context name. @@ -631,7 +631,7 @@ = - A portal object with the type portal. A portal type= represents a virtual portal, and can only have children that use the type = page. In addition to the common portal object elements= , it also supports the declaration of the modes and the window states that = it supports. If there are no declarations of modes or window states, the de= fault value will be view, = edit, help, and normal, minimized,= maximized respectively. + A portal object that uses the portal type. A portal= type represents a virtual portal, and can only have children that use the = page type. In addition to the common portal object ele= ments, it also allows you to declare modes and window states that are suppo= rted. - The supported modes of the portal. Accepted values are v= iew, edit, and help. + The <supported-modes> elements de= fines the supported modes of the portal. Accepted values are view, edit, and help. - The following is an example of the <supported-mode>= ; element: + The following is an example of the <supported-mode>= ; and <mode> elemen= ts: - The portlet mode value. + The portlet mode value. If there are no declarations of modes or window = states, the default values will be view, <= computeroutput>edit, help= , and normal, minimized, maximized respectively. @@ -677,7 +677,7 @@ - Use the <supported-window-states>= element to define the supported window states for the portal. Accepted val= ues are normal, minimized<= /computeroutput>, and maximized. The follo= wing is an example of the <supported-window-states> and <window-state> e= lements: + Use the <supported-window-states>= element to define the supported window states of the portal. The following= is an example of the <supported-window-states> and <window-state> eleme= nts: - Use the <window-state> element to= define a window state. + Use the <window-state> element to= define a window states. Accepted values are normal, minimized, and = maximized. @@ -704,7 +704,7 @@ - A portal object with the type page. A page type rep= resents a page, and can only have children that use the type page= and window. The children windows are the w= indows of the page, and the children pages are the subpages of this page. + A portal object with the type page. A page type rep= resents a page, and can only have children that use the types pag= e and window. The children windows are the = windows of the page, and the children pages are the subpages of this page. - The page name value. + The page name. @@ -722,15 +722,12 @@ - A portal object with the type window. A window type= represents a window. Beside the common properties, a window has content an= d belongs to a region on the page. + A portal object with the type window. A window type= represents a window. Besides the common properties, a window has content a= nd belongs to a region on the page. - The <instance-ref> and <content> elements are used to define the cont= ent of the window. The <content> ele= ment is generic, and is used to describe any kind of content. The <instance-ref> element is a shortcut to defin= e the content-type of portlet which points to a portlet instance. + The <instance-ref> and <content> elements are used to define the cont= ent of the window. The <content> ele= ment is generic, and is used to describe any kind of content. The <instance-ref> element is a shortcut to defin= e the content-type of the portlet, which points to a portlet instance. The = <instance-ref> value must much an <instance-id> value in the W= EB-INF/portlet-instances.xml file. - The region and height defines how the window is placed in the page. - - ]]> --===============6375313082000800145==-- From portal-commits at lists.jboss.org Wed Feb 27 04:35:21 2008 Content-Type: multipart/mixed; boundary="===============7394279268350259996==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10134 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/taglib and 5 other directories. Date: Wed, 27 Feb 2008 04:35:21 -0500 Message-ID: --===============7394279268350259996== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-27 04:35:20 -0500 (Wed, 27 Feb 2008) New Revision: 10134 Added: modules/portlet/trunk/portlet/src/main/resources/META-INF/ modules/portlet/trunk/portlet/src/main/resources/META-INF/portlet.tld modules/portlet/trunk/portlet/src/main/resources/META-INF/portlet_2_0.tld modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portleturl/PortletURLModeTestCase.java Removed: modules/portlet/trunk/portlet/src/main/resources/org/ Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/StateAwareResponseImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/taglib/GenerateURLTag.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr286/taglib/ActionURL286Tag.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr286/taglib/GenerateURL286Tag.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr286/taglib/RenderURL286Tag.java modules/portlet/trunk/test/src/test/build.xml Log: - package taglib tlds in portlet jar - fix state propagation after action - fix taglib parameters - make setting JBOSS_4_2_1_HOME and TOMCAT_6_0_HOME not nessesary when -Dma= ven.test.skip=3Dtrue is present Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/StateAwareResponseImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/StateAwareResponseImpl.java 2008-02-27 06:45:24 UTC (rev 1013= 3) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/StateAwareResponseImpl.java 2008-02-27 09:35:20 UTC (rev 1013= 4) @@ -358,10 +358,10 @@ protected PortletParameterMap navigationalState =3D new PortletParam= eterMap(preq.navigationInfo); = /** The new window state requested. */ - protected org.jboss.portal.WindowState windowState; + protected org.jboss.portal.WindowState windowState =3D new org.jboss= .portal.WindowState(preq.getWindowState().toString()); = /** The new mode requested. */ - protected Mode mode; + protected Mode mode =3D new Mode(preq.getPortletMode().toString()); = protected PortletInvocationResponse getResponse() { Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/taglib/GenerateURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/taglib/GenerateURLTag.java 2008-02-27 06:45:24 UTC (rev 10133) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/taglib/GenerateURLTag.java 2008-02-27 09:35:20 UTC (rev 10134) @@ -141,7 +141,7 @@ * * @return Returns the parameters. */ - private Map getURLParameters() + protected Map getURLParameters() { Map urlParameters =3D new HashMap(parameters.size()); = Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr286/taglib/ActionURL286Tag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/ActionURL286Tag.java 2008-02-27 06:45:24 UTC (rev 10133) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/ActionURL286Tag.java 2008-02-27 09:35:20 UTC (rev 10134) @@ -73,6 +73,8 @@ = setCopyCurrentRenderParameters(newPortletURL); = + removeTagParametersWithEmptyValue(newPortletURL); + setName(newPortletURL); = return newPortletURL; Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr286/taglib/GenerateURL286Tag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/GenerateURL286Tag.java 2008-02-27 06:45:24 UTC (rev 10133) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/GenerateURL286Tag.java 2008-02-27 09:35:20 UTC (rev 10134) @@ -34,6 +34,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Enumeration; +import java.util.LinkedList; +import java.util.Arrays; import java.io.StringWriter; = /** @@ -75,10 +77,62 @@ //default is false if (copyCurrentRenderParameters !=3D null && copyCurrentRenderParame= ters.equalsIgnoreCase("true")) { - portletURL.setParameters(getPortletRequest().getPrivateParameterM= ap()); + // Parameters values specified in tag need to be pre-pended = + + Map parameters =3D portletURL.getParameterMap(); + + Map privateParams =3D getPortletRequest().getPr= ivateParameterMap(); + + for(String name : privateParams.keySet()) + { + + if (!parameters.containsKey(name)) + { + parameters.put(name, privateParams.get(name)); + } + else + { + String[] val1 =3D parameters.get(name); + String[] val2 =3D privateParams.get(name); + String[] newVal =3D new String[val1.length + val2.length]; + + for (int i =3D 0; i < val1.length; i++) + { + newVal[i] =3D val1[i]; + } + for (int i =3D 0; i < val2.length; i++) + { + newVal[val1.length + i] =3D val2[i]; + } + parameters.put(name, newVal); + } + } + + portletURL.setParameters(parameters); } } = + protected void removeTagParametersWithEmptyValue(PortletURL portletURL) + { + // Introduced in jsr 286 - the empty param tag value removes the par= ameter + + Map parameters =3D portletURL.getParameterMap(); + + Map tagParams =3D getURLParameters(); + + for (String name : tagParams.keySet()) + { + String[] values =3D tagParams.get(name); + if (values.length > 0 && values[values.length - 1].equals("")) + { + parameters.remove(name); + } + } + + portletURL.setParameters(parameters); + + } + protected boolean isEscapeXml() { = Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr286/taglib/RenderURL286Tag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/RenderURL286Tag.java 2008-02-27 06:45:24 UTC (rev 10133) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr286/taglib/RenderURL286Tag.java 2008-02-27 09:35:20 UTC (rev 10134) @@ -54,6 +54,8 @@ = setCopyCurrentRenderParameters(newPortletURL); = + removeTagParametersWithEmptyValue(newPortletURL); + return newPortletURL; } } Copied: modules/portlet/trunk/portlet/src/main/resources/META-INF/portlet.t= ld (from rev 10119, modules/portlet/trunk/portlet/src/main/resources/org/jb= oss/portal/portlet/portlet.tld) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/resources/META-INF/portlet.tld = (rev 0) +++ modules/portlet/trunk/portlet/src/main/resources/META-INF/portlet.tld 2= 008-02-27 09:35:20 UTC (rev 10134) @@ -0,0 +1,106 @@ + + + + + + 1.0 + 1.2 + portlet + + http://java.sun.com/portlet + + + + param + org.jboss.portal.portlet.impl.jsr168.taglib.URLParameterT= ag + empty + + + name + true + true + + + + value + true + true + + + + + + + renderURL + org.jboss.portal.portlet.impl.jsr168.taglib.RenderURLTag<= /tag-class> + org.jboss.portal.portlet.impl.jsr168.taglib.GenerateURLTa= gTEI + JSP + + + portletMode + true + + + + secure + true + + + + var + true + + + + windowState + true + + + + + + + defineObjects + org.jboss.portal.portlet.impl.jsr168.taglib.DefineObjects= Tag + org.jboss.portal.portlet.impl.jsr168.taglib.DefineObjects= TagTEI + empty + + + + + actionURL + org.jboss.portal.portlet.impl.jsr168.taglib.ActionURLTag<= /tag-class> + org.jboss.portal.portlet.impl.jsr168.taglib.GenerateURLTa= gTEI + JSP + + + portletMode + true + + + + secure + true + + + + var + true + + + + windowState + true + + + + + + + namespace + org.jboss.portal.portlet.impl.jsr168.taglib.NamespaceTag<= /tag-class> + empty + + + + Copied: modules/portlet/trunk/portlet/src/main/resources/META-INF/portlet_2= _0.tld (from rev 10119, modules/portlet/trunk/portlet/src/main/resources/or= g/jboss/portal/portlet/portlet_2_0.tld) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/resources/META-INF/portlet_2_0.t= ld (rev 0) +++ modules/portlet/trunk/portlet/src/main/resources/META-INF/portlet_2_0.t= ld 2008-02-27 09:35:20 UTC (rev 10134) @@ -0,0 +1,188 @@ + + + + + Portlet 2.0 Tag Library + Portlet 2.0 Tags + 2.0 + portlet + http://java.sun.com/portlet_2_0 + + + + param + org.jboss.portal.portlet.impl.jsr286.taglib.URLParameter2= 86Tag + empty + + + name + true + true + + + + value + true + true + + + + + + + property + org.jboss.portal.portlet.impl.jsr286.taglib.URLProperty28= 6Tag + empty + + + name + true + true + + + + value + true + true + + + + + + + renderURL + org.jboss.portal.portlet.impl.jsr286.taglib.RenderURL286T= ag + org.jboss.portal.portlet.impl.jsr286.taglib.GenerateURL28= 6TagTEI + JSP + + + portletMode + true + + + + secure + true + + + + var + true + + + + windowState + true + + + + escapeXml + true + + + + copyCurrentRenderParameters + true + + + + + + + defineObjects + org.jboss.portal.portlet.impl.jsr286.taglib.DefineObjects= 286Tag + org.jboss.portal.portlet.impl.jsr286.taglib.DefineObjects= 286TagTEI + empty + + + + + actionURL + org.jboss.portal.portlet.impl.jsr286.taglib.ActionURL286T= ag + org.jboss.portal.portlet.impl.jsr286.taglib.GenerateURL28= 6TagTEI + JSP + + + portletMode + true + + + + secure + true + + + + var + true + + + + windowState + true + + + + escapeXml + true + + + + copyCurrentRenderParameters + true + + + + name + true + + + + + + + + resourceURL + org.jboss.portal.portlet.impl.jsr286.taglib.ResourceURL28= 6Tag + org.jboss.portal.portlet.impl.jsr286.taglib.ResourceURL28= 6TagTEI + JSP + + + secure + true + + + + var + true + + + + escapeXml + true + + + + cacheability + true + + + + id + true + + + + + + + namespace + org.jboss.portal.portlet.impl.jsr286.taglib.Namespace286T= ag + empty + + + + Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/portleturl/PortletURLModeTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/PortletURLModeTestCase.java = (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portleturl/PortletURLModeTestCase.java 2008-02-27 09:35:20 UT= C (rev 10134) @@ -0,0 +1,100 @@ +/* +* 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.portlet.jsr286.tck.portleturl; + +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.unit.actions.PortletActionTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import org.jboss.unit.remote.driver.handler.http.response.InvokeGetRespons= e; +import static org.jboss.unit.api.Assert.assertEquals; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletURL; +import javax.portlet.PortletMode; +import javax.portlet.PortletModeException; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; + +/** + * @author Boleslaw Dawidowicz + * @version : 0.1 $ + */ +(a)TestCase +public class PortletURLModeTestCase +{ + private int actionCount =3D 0; + + public PortletURLModeTestCase(PortletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) + { + PortletURL url =3D response.createActionURL(); + + //set some render parameters to test + try + { + url.setPortletMode(PortletMode.EDIT); + } + catch (PortletModeException e) + { + throw new IllegalStateException("Edit mode in test not supp= orted"); + } + + return new InvokeGetResponse(url.toString()); + } + }); + + seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestActio= n() + { + protected void run(Portlet portlet, ActionRequest request, Action= Response response, PortletTestContext context) + { + assertEquals(request.getPortletMode(), PortletMode.EDIT); + actionCount++; + } + }); + + seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) + { + + assertEquals(request.getPortletMode(), PortletMode.EDIT); + assertEquals(1, actionCount); + + return new EndTestResponse(); + } + }); + + + } +} + Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-27 06:45:24 UTC (= rev 10133) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-27 09:35:20 UTC (= rev 10134) @@ -1,8 +1,12 @@ = - + + + = + + @@ -302,11 +306,11 @@ = @@ -505,6 +509,7 @@ + @@ -712,11 +717,12 @@ = + = = - + = = @@ -771,7 +777,7 @@ - + = @@ -781,6 +787,73 @@ = = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + = --===============7394279268350259996==-- From portal-commits at lists.jboss.org Wed Feb 27 05:26:27 2008 Content-Type: multipart/mixed; boundary="===============6840696631666084323==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10135 - modules/portlet/trunk/test/src/test. Date: Wed, 27 Feb 2008 05:26:27 -0500 Message-ID: --===============6840696631666084323== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-27 05:26:26 -0500 (Wed, 27 Feb 2008) New Revision: 10135 Modified: modules/portlet/trunk/test/src/test/build.xml Log: make portlet api jar be addded to tck portal Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-27 09:35:20 UTC (= rev 10134) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-27 10:26:26 UTC (= rev 10135) @@ -777,7 +777,7 @@ - + = @@ -844,7 +844,7 @@ - + = --===============6840696631666084323==-- From portal-commits at lists.jboss.org Wed Feb 27 05:54:19 2008 Content-Type: multipart/mixed; boundary="===============0643400887220069583==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10136 - in modules/portlet/trunk/portlet/src: test/java/org/jboss/portal/test/portlet/jsr168/ext/session and 1 other directory. Date: Wed, 27 Feb 2008 05:54:18 -0500 Message-ID: --===============0643400887220069583== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-27 05:54:18 -0500 (Wed, 27 Feb 2008) New Revision: 10136 Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr168/ext/session/PortletScopedAttributesAreApplicationScopedAttributesT= estCase.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/PortletSessionImpl.java Log: - fix a bug in portlet session and add test case for it Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/PortletSessionImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletSessionImpl.java 2008-02-27 10:26:26 UTC (rev 10135) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/PortletSessionImpl.java 2008-02-27 10:54:18 UTC (rev 10136) @@ -83,49 +83,50 @@ = public Enumeration getAttributeNames(int scope) { - final boolean app =3D scope =3D=3D APPLICATION_SCOPE; - return new Enumeration() + if (scope =3D=3D APPLICATION_SCOPE) { - private Enumeration e; - private String next; - + return (Enumeration)session.getAttributeNames(); + } + else + { + return new Enumeration() { - e =3D session.getAttributeNames(); - next =3D null; - next(); - } + private Enumeration e; + private String next; = - public boolean hasMoreElements() - { - return next !=3D null; - } + { + e =3D session.getAttributeNames(); + next =3D null; + next(); + } = - public String nextElement() - { - String result =3D next; - next =3D null; - next(); - return result; - } + public boolean hasMoreElements() + { + return next !=3D null; + } = - private void next() - { - while (e.hasMoreElements()) + public String nextElement() { - String attribute =3D (String)e.nextElement(); - if (app && !attribute.startsWith("javax.portlet.")) + String result =3D next; + next =3D null; + next(); + return result; + } + + private void next() + { + while (e.hasMoreElements()) { - next =3D attribute; - break; + String attribute =3D (String)e.nextElement(); + if (attribute.startsWith(prefix)) + { + next =3D attribute.substring(prefix.length()); + break; + } } - else if (!app && attribute.startsWith(prefix)) - { - next =3D attribute.substring(prefix.length()); - break; - } } - } - }; + }; + } } = public long getCreationTime() Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr168/ext/session/PortletScopedAttributesAreApplicationScopedAttribu= tesTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/ext/session/PortletScopedAttributesAreApplicationScopedAttributes= TestCase.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/ext/session/PortletScopedAttributesAreApplicationScopedAttributes= TestCase.java 2008-02-27 10:54:18 UTC (rev 10136) @@ -0,0 +1,72 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.test.portlet.jsr168.ext.session; + +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import static org.jboss.unit.api.Assert.*; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.PortletSession; +import javax.portlet.PortletSessionUtil; +import java.io.IOException; +import java.util.Enumeration; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)TestCase +public class PortletScopedAttributesAreApplicationScopedAttributesTestCase +{ + + public PortletScopedAttributesAreApplicationScopedAttributesTestCase(Po= rtletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + PortletSession session =3D request.getPortletSession(); + session.setAttribute("foo", "bar"); + Enumeration e =3D session.getAttributeNames(PortletSession.APP= LICATION_SCOPE); + assertNotNull(e); + assertTrue(e.hasMoreElements()); + String scopedFoo =3D (String)e.nextElement(); + assertNotNull(scopedFoo); + assertEquals("foo", PortletSessionUtil.decodeAttributeName(sco= pedFoo)); + assertEquals(PortletSession.PORTLET_SCOPE, PortletSessionUtil.= decodeScope(scopedFoo)); + Object bar =3D session.getAttribute(scopedFoo, PortletSession.= APPLICATION_SCOPE); + assertEquals("bar", bar); + return new EndTestResponse(); + } + }); + } +} --===============0643400887220069583==-- From portal-commits at lists.jboss.org Wed Feb 27 11:39:54 2008 Content-Type: multipart/mixed; boundary="===============2998173680027913638==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10137 - branches/JBoss_Portal_Branch_2_7/server/src/main/org/jboss/portal/server. Date: Wed, 27 Feb 2008 11:39:53 -0500 Message-ID: --===============2998173680027913638== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-27 11:39:53 -0500 (Wed, 27 Feb 2008) New Revision: 10137 Modified: branches/JBoss_Portal_Branch_2_7/server/src/main/org/jboss/portal/server= /PortalConstants.java Log: Feel like commiting something Modified: branches/JBoss_Portal_Branch_2_7/server/src/main/org/jboss/portal= /server/PortalConstants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/server/src/main/org/jboss/portal/serve= r/PortalConstants.java 2008-02-27 10:54:18 UTC (rev 10136) +++ branches/JBoss_Portal_Branch_2_7/server/src/main/org/jboss/portal/serve= r/PortalConstants.java 2008-02-27 16:39:53 UTC (rev 10137) @@ -36,7 +36,7 @@ { = /** Current version. */ - public static final Version VERSION =3D new Version("JBoss Portal", 2, = 6, 5, new Version.Qualifier(Version.Qualifier.Prefix.SNAPSHOT), "Ninja"); + public static final Version VERSION =3D new Version("JBoss Portal", 2, = 7, 0, new Version.Qualifier(Version.Qualifier.Prefix.SNAPSHOT), "Community"= ); = /** The default portal name. */ public static final String DEFAULT_PORTAL_NAME =3D "default"; --===============2998173680027913638==-- From portal-commits at lists.jboss.org Wed Feb 27 15:42:51 2008 Content-Type: multipart/mixed; boundary="===============1299821202526840502==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10138 - in modules/portlet/trunk/portlet/src/test/java/org/jboss/portal: unit and 1 other directory. Date: Wed, 27 Feb 2008 15:42:50 -0500 Message-ID: --===============1299821202526840502== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-27 15:42:50 -0500 (Wed, 27 Feb 2008) New Revision: 10138 Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/TestCo= nstants.java Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr168/api/portletcontext/VersionTestCase.java Log: - Renamed TestContants to TestConstants. Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/jsr168/api/portletcontext/VersionTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/api/portletcontext/VersionTestCase.java 2008-02-27 16:39:53 UTC (= rev 10137) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr168/api/portletcontext/VersionTestCase.java 2008-02-27 20:42:50 UTC (= rev 10138) @@ -22,18 +22,16 @@ *************************************************************************= *****/ package org.jboss.portal.test.portlet.jsr168.api.portletcontext; = +import org.jboss.portal.test.portlet.framework.UTP1; import org.jboss.portal.unit.PortletTestCase; import org.jboss.portal.unit.PortletTestContext; -import org.jboss.portal.unit.TestContants; -import org.jboss.portal.unit.base.AbstractUniversalTestPortlet; +import org.jboss.portal.unit.TestConstants; import org.jboss.portal.unit.actions.PortletRenderTestAction; -import org.jboss.portal.test.portlet.framework.UTP1; import org.jboss.portal.unit.annotations.TestCase; -import org.jboss.portal.unit.TestContants; -import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.base.AbstractUniversalTestPortlet; +import static org.jboss.unit.api.Assert.assertEquals; import org.jboss.unit.driver.DriverResponse; import org.jboss.unit.driver.response.EndTestResponse; -import static org.jboss.unit.api.Assert.assertEquals; = import javax.portlet.Portlet; import javax.portlet.RenderRequest; @@ -54,8 +52,8 @@ { AbstractUniversalTestPortlet aport =3D (AbstractUniversalTestP= ortlet)portlet; = - assertEquals(TestContants.MINOR_VERSION, aport.getPortletConte= xt().getMinorVersion()); - assertEquals(TestContants.MAJOR_VERSION, aport.getPortletConte= xt().getMajorVersion()); + assertEquals(TestConstants.MINOR_VERSION, aport.getPortletCont= ext().getMinorVersion()); + assertEquals(TestConstants.MAJOR_VERSION, aport.getPortletCont= ext().getMajorVersion()); return new EndTestResponse(); } }); Copied: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/T= estConstants.java (from rev 10137, modules/portlet/trunk/portlet/src/test/j= ava/org/jboss/portal/unit/TestContants.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/TestC= onstants.java (rev 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/TestC= onstants.java 2008-02-27 20:42:50 UTC (rev 10138) @@ -0,0 +1,43 @@ +/*************************************************************************= ***** + * 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.unit; + +/** + * Constants for test asserts + * + * @author Boleslaw Daw= idowicz + * @version $Revision: 5510 $ + */ +public final class TestConstants +{ + + /** String from PortletContext.getServerInfo(). */ + public static final String SERVER_INVO =3D "JBossPortal/1.0"; + + /** int for PortletContext.getMinorVersion(). */ + public static final int MINOR_VERSION =3D 0; + + /** int for PortletContext.getMajorVersion(). */ + public static final int MAJOR_VERSION =3D 2; + +} Property changes on: modules/portlet/trunk/portlet/src/test/java/org/jboss/= portal/unit/TestConstants.java ___________________________________________________________________ Name: svn:executable + = --===============1299821202526840502==-- From portal-commits at lists.jboss.org Wed Feb 27 17:06:46 2008 Content-Type: multipart/mixed; boundary="===============6236031826799346034==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10139 - in modules/portlet/trunk: controller/src/main/java/org/jboss/portal/portlet/controller/event and 6 other directories. Date: Wed, 27 Feb 2008 17:06:45 -0500 Message-ID: --===============6236031826799346034== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-27 17:06:45 -0500 (Wed, 27 Feb 2008) New Revision: 10139 Added: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/EventPhaseSessionImpl.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/event/EventPhaseSession.java Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/PortletController.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/PortletRequestHandler.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/event/EventControllerContext.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/impl/event/EventControllerContextImpl.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/response/PageUpdateResponse.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/response/PortletResponse.java modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/= controller/EventControllerContextSupport.java modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/= controller/PortletControllerContextSupport.java modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/= controller/PortletControllerTestCase.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortalServlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PageEventControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/t= ck/TCKRendererContext.java Log: JBPORTAL-1926 : Portlet event loop detection Added: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/port= let/controller/EventPhaseSessionImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/EventPhaseSessionImpl.java (rev 0) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/EventPhaseSessionImpl.java 2008-02-27 22:06:45 UTC (rev 10139) @@ -0,0 +1,103 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.controller; + +import org.jboss.portal.portlet.controller.event.EventPhaseSession; +import org.jboss.portal.portlet.controller.event.Event; +import org.apache.log4j.Logger; + +import java.util.Iterator; +import java.util.LinkedList; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +class EventPhaseSessionImpl implements EventPhaseSession +{ + + /** . */ + private final Logger log; + + /** . */ + LinkedList producedEventHistory; + + /** . */ + LinkedList consumedEventHistory; + + /** . */ + LinkedList producedEvents; + + /** . */ + LinkedList toConsumeEvents; + + /** . */ + boolean interruped; + + EventPhaseSessionImpl(Logger log) + { + this.log =3D log; + this.producedEventHistory =3D new LinkedList(); + this.consumedEventHistory =3D new LinkedList(); + this.producedEvents =3D new LinkedList(); + this.toConsumeEvents =3D new LinkedList(); + this.interruped =3D false; + } + + public Iterator browseProducedEventHistory() + { + return this.producedEventHistory.iterator(); + } + + + public Iterator browseConsumedEventHistory() + { + return this.consumedEventHistory.iterator(); + } + + public void queueEvent(Event event) + { + if (interruped) + { + throw new IllegalStateException("The event phase is interruped"); + } + if (event =3D=3D null) + { + throw new IllegalArgumentException("No null event accepted"); + } + + // + log.trace("Queued event " + event + " in the session"); + + // + this.toConsumeEvents.addLast(event); + } + + public void interrupt() + { + log.trace("Event delivery interruped"); + + // + this.interruped =3D true; + } +} Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/PortletController.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/PortletController.java 2008-02-27 20:42:50 UTC (rev 10138) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/PortletController.java 2008-02-27 22:06:45 UTC (rev 10139) @@ -30,8 +30,12 @@ import org.jboss.portal.portlet.controller.response.ControllerResponse; = /** - * The portlet controller which handles the page state management and the = interactions between the action phase and the - * event phase. It really only does that and not more. + *

            The portlet controller which handles the page state management and t= he interactions between the action phase and the + * event phase. It really only does that and not more.

            + * + *

            The event distribution is based on a fifo policy.

            + * + * *

            * 1/ introduce EventRequest so the portal can send events directly to a p= ortlet *

            @@ -51,10 +55,18 @@ /** . */ private boolean distributeNonProduceableEvents; = + /** . */ + private int producedEventThreshold; + + /** . */ + private int consumedEventThreshold; + public PortletController() { distributeNonConsumableEvents =3D true; distributeNonProduceableEvents =3D true; + producedEventThreshold =3D 32; + consumedEventThreshold =3D 64; } = /** @@ -91,6 +103,40 @@ this.distributeNonProduceableEvents =3D distributeNonProduceableEven= ts; } = + /** + * The option configures the maximum number of events that can be produ= ced during one interaction. + * A negative value means that there is no limit to the number of event= s that can be produced + * during one interaction. + * + * @return the maximum number of produced events + */ + public int getProducedEventThreshold() + { + return producedEventThreshold; + } + + public void setProducedEventThreshold(int producedEventThreshold) + { + this.producedEventThreshold =3D producedEventThreshold; + } + + /** + * The option configures the maximum number of events that can be consu= med during one interaction. + * A negative value means that there is no limit to the number of event= s that can be consumed + * during one interaction. + * + * @return the maximum number of consumed events + */ + public int getConsumedEventThreshold() + { + return consumedEventThreshold; + } + + public void setConsumedEventThreshold(int consumedEventThreshold) + { + this.consumedEventThreshold =3D consumedEventThreshold; + } + public ControllerResponse process(PortletControllerContext controllerCo= ntext, ControllerRequest controllerRequest) throws PortletInvokerException { if (controllerContext =3D=3D null) Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/PortletRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/PortletRequestHandler.java 2008-02-27 20:42:50 UTC (rev 10138) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/PortletRequestHandler.java 2008-02-27 22:06:45 UTC (rev 10139) @@ -49,7 +49,6 @@ import org.jboss.portal.portlet.spi.PortletInvocationContext; = import javax.servlet.http.Cookie; -import java.util.LinkedList; import java.util.List; import java.util.Map; = @@ -106,100 +105,140 @@ EventControllerContext eventCC =3D context.getEventControllerCont= ext(); UpdateNavigationalStateResponse stateResponse =3D (UpdateNavigati= onalStateResponse)response; = - // Create event list and feed it with the events that may have be= en produced - LinkedList srcEventQueue =3D new LinkedList(); + // + EventPhaseSessionImpl session =3D new EventPhaseSessionImpl(log); + + // Feed session it with the events that may have been produced for (UpdateNavigationalStateResponse.Event portletEvent : stateRe= sponse.getEvents()) { - Event producedEvent =3D new Event(portletEvent.getName(), port= letEvent.getPayload(), portletRequest.getWindowId()); - srcEventQueue.add(producedEvent); + session.producedEvents.add(new Event(portletEvent.getName(), p= ortletEvent.getPayload(), portletRequest.getWindowId())); } = + // + int eventDistributionStatus =3D PortletResponse.DISTRIBUTION_DONE; + // Deliver events - while (srcEventQueue.size() > 0) + while (session.producedEvents.size() > 0) { - Event srcEvent =3D srcEventQueue.removeFirst(); + Event producedEvent =3D session.producedEvents.removeFirst(); = // - String srcId =3D srcEvent.getWindowId(); + String producerId =3D producedEvent.getWindowId(); + PortletInfo producerPortletInfo =3D context.getPortletInfo(pro= ducerId); = // - PortletInfo srcPortletInfo =3D context.getPortletInfo(srcId); - - // - if (srcPortletInfo =3D=3D null) + if (producerPortletInfo =3D=3D null) { - log.trace("Cannot deliver event " + srcEvent +" because the= source does not have portlet info"); - - // + log.trace("Cannot deliver event " + producedEvent +" becaus= e the producer does not have portlet info"); continue; } = // if (!controller.getDistributeNonProduceableEvents()) { - if (!srcPortletInfo.getEventing().getProducedEvents().conta= insKey(srcEvent.getName())) + if (!producerPortletInfo.getEventing().getProducedEvents().= containsKey(producedEvent.getName())) { - log.trace("Cannot deliver event " + srcEvent +" because = the source of the event does not produce the event name"); - - // + log.trace("Cannot deliver event " + producedEvent +" bec= ause the producer of the event does not produce the event name"); continue; } } = - // - List dstEvents =3D eventCC.getConsumedEvents(srcEvent); + // Apply produced event quota if necessary + int producedEventThreshold =3D controller.getProducedEventThre= shold(); + if (producedEventThreshold >=3D 0) + { + if (session.producedEventHistory.size() + 1 > producedEvent= Threshold) + { + log.trace("Event distribution interrupted because the ma= ximum number of produced event is reached"); + eventDistributionStatus =3D PortletResponse.PRODUCED_EVE= NT_FLOODED; + break; + } + } = + // Give control to the event context + try + { + eventCC.handleEvent(session, producedEvent); + } + catch (Exception e) + { + log.trace("Cannot deliver produced event " + producedEvent = + " because the event controller context " + + "threw a runtime exception", e); + continue; + } + + // Perform flow control + if (session.interruped) + { + log.trace("Event distribution interrupted by controller con= text"); + eventDistributionStatus =3D PortletResponse.INTERRUPTED; + break; + } + // - for (Event dstEvent : dstEvents) + while (session.toConsumeEvents.size() > 0) { - String dstId =3D dstEvent.getWindowId(); + Event toConsumeEvent =3D session.toConsumeEvents.removeFirs= t(); = // - PortletInfo dstPortletInfo =3D context.getPortletInfo(dstId= ); + String consumedId =3D toConsumeEvent.getWindowId(); = + // + PortletInfo consumerPortletInfo =3D context.getPortletInfo(= consumedId); = // - if (dstPortletInfo =3D=3D null) + if (consumerPortletInfo =3D=3D null) { if (log.isTraceEnabled()) { - log.trace("Cannot deliver event " + srcEvent +" becau= se the target of the event does not have a portlet info"); + log.trace("Cannot deliver event " + producedEvent +" = because the consumer of the event does not have a portlet info"); } - - // continue; } = // if (!controller.getDistributeNonConsumableEvents()) { - if (!dstPortletInfo.getEventing().getConsumedEvents().co= ntainsKey(dstEvent.getName())) + if (!consumerPortletInfo.getEventing().getConsumedEvents= ().containsKey(toConsumeEvent.getName())) { if (log.isTraceEnabled()) { - log.trace("Cannot deliver event " + srcEvent +" be= cause the target of the event does not accept the event name"); + log.trace("Cannot deliver event " + producedEvent = +" because the consumer of the event does not accept the event name"); } - - // continue; } } = + // Apply consumed event quota if necessary + int consumedEventThreshold =3D controller.getConsumedEventT= hreshold(); + if (consumedEventThreshold >=3D 0) + { + if (session.consumedEventHistory.size() + 1 > consumedEv= entThreshold) + { + log.trace("Event distribution interrupted because the= maximum number of consumed event is reached"); + eventDistributionStatus =3D PortletResponse.CONSUMED_= EVENT_FLOODED; + break; + } + } + // - PortletInvocationResponse eventResponse =3D deliverEvent(co= ntext, dstEvent, pageState, requestProperties.getCookies()); + PortletInvocationResponse eventResponse =3D deliverEvent(co= ntext, toConsumeEvent, pageState, requestProperties.getCookies()); = + // Now it is consumed we add it to the history + session.consumedEventHistory.addFirst(toConsumeEvent); + // if (eventResponse instanceof UpdateNavigationalStateRespons= e) { UpdateNavigationalStateResponse eventStateResponse =3D (= UpdateNavigationalStateResponse)eventResponse; = // Update ns - updateNavigationalState(context, dstEvent.getWindowId(),= eventStateResponse, pageState); + updateNavigationalState(context, toConsumeEvent.getWindo= wId(), eventStateResponse, pageState); = // Add events to source event queue for (UpdateNavigationalStateResponse.Event portletEvent = : eventStateResponse.getEvents()) { - srcEventQueue.add(new Event(portletEvent.getName(), p= ortletEvent.getPayload(), dstEvent.getWindowId())); + session.producedEvents.add(new Event(portletEvent.get= Name(), portletEvent.getPayload(), toConsumeEvent.getWindowId())); } = // @@ -218,14 +257,17 @@ // Do something here !!!! } } + + // We archive the consumed event in the history + session.producedEventHistory.addFirst(producedEvent); } = // - return new PageUpdateResponse(updateResponse, requestProperties, = pageState); + return new PageUpdateResponse(updateResponse, requestProperties, = pageState, eventDistributionStatus); } else { - return new PortletResponse(response); + return new PortletResponse(response, PortletResponse.DISTRIBUTION= _DONE); } } = Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/event/EventControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/event/EventControllerContext.java 2008-02-27 20:42:50 UTC (rev = 10138) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/event/EventControllerContext.java 2008-02-27 22:06:45 UTC (rev = 10139) @@ -22,8 +22,6 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.controller.event; = -import java.util.List; - /** * @author Julien Viet * @version $Revision: 630 $ @@ -32,11 +30,22 @@ { = /** - * Obtain a list of consumed event for a produced event. + *

            Give control to the context when an event is produced. The session + * argument gives to the context the capability to queue events in resp= onse + * of the produced event or to interrupt the session. It has also access + * to the full history of distributed events in order to provide advanc= ed + * implementation of event cycle detection.

            * + *

            During the invocation of this method, any runtime exception throw= n will signal + * a failure and the produced event will be discarded although the event + * distribution will continue.

            + * + *

            During the invocation of this method, any error thrown will be pr= opagated + * to the portlet controller invoker.

            + * + * @param session the session * @param producedEvent the produced event - * @return the list of event to be consumed */ - List getConsumedEvents(Event producedEvent); + void handleEvent(EventPhaseSession session, Event producedEvent); = } Added: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/port= let/controller/event/EventPhaseSession.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/event/EventPhaseSession.java (rev 0) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/event/EventPhaseSession.java 2008-02-27 22:06:45 UTC (rev 10139) @@ -0,0 +1,64 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.controller.event; + +import java.util.Iterator; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public interface EventPhaseSession +{ + + /** + * Returns an iterator for browsing the history of the produced events. + * The iterator returns the produced events from the most recent to the= oldest. + * + * @return all the events produced during the session + */ + Iterator browseProducedEventHistory(); + + /** + * Returns an iterator for browsing the history of the consumed events. + * The iterator returns the consumed events from the most recent to the= oldest. + * + * @return all the events consumed during the session + */ + Iterator browseConsumedEventHistory(); + + /** + * Queue an event for consumption. The queue is a FIFO queue. + * + * @param event an event + * @throws IllegalArgumentException if the event is null + * @throws IllegalStateException if the event phase is interrupted + */ + void queueEvent(Event event) throws IllegalArgumentException, IllegalSt= ateException; + + /** + * Stop processing of all events and returns from the controller. + */ + void interrupt(); + +} Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/impl/event/EventControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/event/EventControllerContextImpl.java 2008-02-27 20:42:50 = UTC (rev 10138) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/event/EventControllerContextImpl.java 2008-02-27 22:06:45 = UTC (rev 10139) @@ -27,12 +27,9 @@ import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.controller.event.Event; import org.jboss.portal.portlet.controller.event.EventControllerContext; +import org.jboss.portal.portlet.controller.event.EventPhaseSession; import org.jboss.portal.portlet.info.PortletInfo; = -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - /** * @author Julien Viet * @version $Revision: 630 $ @@ -48,28 +45,24 @@ this.invoker =3D invoker; } = - public List getConsumedEvents(Event producedEvent) + public void handleEvent(EventPhaseSession session, Event producedEvent) { try { - ArrayList consumedEvents =3D new ArrayList(); for (Portlet portlet : invoker.getPortlets()) { PortletInfo portletInfo =3D portlet.getInfo(); if (portletInfo.getEventing().getConsumedEvents().containsKey(= producedEvent.getName())) { Event consumedEvent =3D new Event(producedEvent.getName(), = producedEvent.getPayload(), portlet.getContext().getId()); - consumedEvents.add(consumedEvent); + session.queueEvent(consumedEvent); } } - return consumedEvents; } catch (PortletInvokerException e) { System.out.println("e =3D " + e); - - // - return Collections.emptyList(); + session.interrupt(); } } } Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/response/PageUpdateResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/response/PageUpdateResponse.java 2008-02-27 20:42:50 UTC (rev 1= 0138) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/response/PageUpdateResponse.java 2008-02-27 22:06:45 UTC (rev 1= 0139) @@ -42,9 +42,10 @@ public PageUpdateResponse( UpdateNavigationalStateResponse update, ResponseProperties properties, - PageNavigationalState pageState) + PageNavigationalState pageState, + int eventCycleStatus) { - super(update); + super(update, eventCycleStatus); = // this.properties =3D properties; Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/response/PortletResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/response/PortletResponse.java 2008-02-27 20:42:50 UTC (rev 1013= 8) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/response/PortletResponse.java 2008-02-27 22:06:45 UTC (rev 1013= 9) @@ -31,11 +31,32 @@ public class PortletResponse extends ControllerResponse { = + /** The event distribution was properly done. */ + public static final int DISTRIBUTION_DONE =3D 0; + + /** The event distribution lead to a cycle. */ + public static final int INTERRUPTED =3D 1; + + /** The event distribution did flood. */ + public static final int PRODUCED_EVENT_FLOODED =3D 2; + + /** The event distribution did flood. */ + public static final int CONSUMED_EVENT_FLOODED =3D 3; + /** . */ public final PortletInvocationResponse response; = - public PortletResponse(PortletInvocationResponse response) + /** . */ + private final int eventDistributionStatus; + + public PortletResponse(PortletInvocationResponse response, int eventDis= tributionStatus) { this.response =3D response; + this.eventDistributionStatus =3D eventDistributionStatus; } + + public int getEventDistributionStatus() + { + return eventDistributionStatus; + } } Modified: modules/portlet/trunk/controller/src/test/java/org/jboss/portal/p= ortlet/controller/EventControllerContextSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet= /controller/EventControllerContextSupport.java 2008-02-27 20:42:50 UTC (rev= 10138) +++ modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet= /controller/EventControllerContextSupport.java 2008-02-27 22:06:45 UTC (rev= 10139) @@ -24,12 +24,12 @@ = import org.jboss.portal.portlet.controller.event.EventControllerContext; import org.jboss.portal.portlet.controller.event.Event; +import org.jboss.portal.portlet.controller.event.EventPhaseSession; = import javax.xml.namespace.QName; import java.util.List; import java.util.Map; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; = /** @@ -42,22 +42,18 @@ /** . */ private final Map> wires =3D new HashMap>(); = - public List getConsumedEvents(Event producedEvent) + public void handleEvent(EventPhaseSession session, Event producedEvent) { List dsts =3D wires.get(new Point(producedEvent.getName(), pr= oducedEvent.getWindowId())); = // - List consumedEvents =3D new ArrayList(); if (dsts !=3D null) { for (Point dst : dsts) { - consumedEvents.add(new Event(dst.name, producedEvent.getPayloa= d(), dst.windowId)); + session.queueEvent(new Event(dst.name, producedEvent.getPayloa= d(), dst.windowId)); } } - - // - return Collections.unmodifiableList(consumedEvents); } = public void createWire(QName srcName, String srcWindowId, QName dstName= , String dstWindowId) Modified: modules/portlet/trunk/controller/src/test/java/org/jboss/portal/p= ortlet/controller/PortletControllerContextSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet= /controller/PortletControllerContextSupport.java 2008-02-27 20:42:50 UTC (r= ev 10138) +++ modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet= /controller/PortletControllerContextSupport.java 2008-02-27 22:06:45 UTC (r= ev 10139) @@ -27,6 +27,7 @@ import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.StateControllerContext; import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; +import org.jboss.portal.portlet.controller.event.EventControllerContext; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.ActionInvocation; import org.jboss.portal.portlet.invocation.EventInvocation; @@ -51,7 +52,7 @@ private final StateControllerContext stateControllerContext =3D new Sta= teControllerContextImpl(this); = /** . */ - private final EventControllerContextSupport eventControllerContext =3D = new EventControllerContextSupport(); + private EventControllerContext eventControllerContext; = /** . */ private final PortletInvokerSupport invoker =3D new PortletInvokerSuppo= rt(); @@ -116,11 +117,16 @@ return invoke((PortletInvocation)resourceInvocation); } = - public EventControllerContextSupport getEventControllerContext() + public EventControllerContext getEventControllerContext() { return eventControllerContext; } = + public void setEventControllerContext(EventControllerContext eventContr= ollerContext) + { + this.eventControllerContext =3D eventControllerContext; + } + public StateControllerContext getStateControllerContext() { return stateControllerContext; Modified: modules/portlet/trunk/controller/src/test/java/org/jboss/portal/p= ortlet/controller/PortletControllerTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet= /controller/PortletControllerTestCase.java 2008-02-27 20:42:50 UTC (rev 101= 38) +++ modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet= /controller/PortletControllerTestCase.java 2008-02-27 22:06:45 UTC (rev 101= 39) @@ -28,6 +28,10 @@ import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.response.ControllerResponse; import org.jboss.portal.portlet.controller.response.PageUpdateResponse; +import org.jboss.portal.portlet.controller.response.PortletResponse; +import org.jboss.portal.portlet.controller.event.EventControllerContext; +import org.jboss.portal.portlet.controller.event.EventPhaseSession; +import org.jboss.portal.portlet.controller.event.Event; import org.jboss.portal.portlet.OpaqueStateString; import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.support.PortletSupport; @@ -40,6 +44,7 @@ import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.common.util.Tools; import org.jboss.unit.api.pojo.annotations.Test; +import org.jboss.unit.api.pojo.annotations.Create; import static org.jboss.unit.api.Assert.*; = import javax.xml.namespace.QName; @@ -60,8 +65,17 @@ PortletControllerContextSupport context =3D new PortletControllerContex= tSupport(); = /** . */ + EventControllerContextSupport eventControllerContext =3D new EventContr= ollerContextSupport(); + + /** . */ PortletInvokerSupport invoker =3D context.getInvoker(); = + @Create + public void create() + { + context.setEventControllerContext(eventControllerContext); + } + @Test public void testActionReturnsUpdateNavigationalState() throws PortletIn= vokerException { @@ -139,11 +153,11 @@ PortletSupport barPortlet =3D invoker.addPortlet("bar"); = // - EventProducerAction eventProducer =3D new EventProducerAction(srcNam= e); + EventProducerActionHandler eventProducerHandler =3D new EventProduce= rActionHandler(srcName); NoOpEventProcessor eventConsumer =3D new NoOpEventProcessor(); = // Create wire - context.getEventControllerContext().createWire(srcName, "foo", dstNa= me, "bar"); + eventControllerContext.createWire(srcName, "foo", dstName, "bar"); = // ControllerRequest request =3D new PortletActionRequest( @@ -157,7 +171,7 @@ // controller.setDistributeNonProduceableEvents(true); controller.setDistributeNonConsumableEvents(true); - fooPortlet.addHandler(eventProducer); + fooPortlet.addHandler(eventProducerHandler); barPortlet.addHandler(eventConsumer); controller.process(context, request); fooPortlet.assertInvocationCountIs(1); @@ -166,7 +180,7 @@ // controller.setDistributeNonProduceableEvents(true); controller.setDistributeNonConsumableEvents(false); - fooPortlet.addHandler(eventProducer); + fooPortlet.addHandler(eventProducerHandler); controller.process(context, request); fooPortlet.assertInvocationCountIs(2); barPortlet.assertInvocationCountIs(1); @@ -177,7 +191,7 @@ // controller.setDistributeNonProduceableEvents(true); controller.setDistributeNonConsumableEvents(true); - fooPortlet.addHandler(eventProducer); + fooPortlet.addHandler(eventProducerHandler); barPortlet.addHandler(eventConsumer); controller.process(context, request); fooPortlet.assertInvocationCountIs(3); @@ -186,7 +200,7 @@ // controller.setDistributeNonProduceableEvents(true); controller.setDistributeNonConsumableEvents(false); - fooPortlet.addHandler(eventProducer); + fooPortlet.addHandler(eventProducerHandler); barPortlet.addHandler(eventConsumer); controller.process(context, request); fooPortlet.assertInvocationCountIs(4); @@ -195,7 +209,7 @@ // controller.setDistributeNonProduceableEvents(false); controller.setDistributeNonConsumableEvents(true); - fooPortlet.addHandler(eventProducer); + fooPortlet.addHandler(eventProducerHandler); controller.process(context, request); fooPortlet.assertInvocationCountIs(5); barPortlet.assertInvocationCountIs(3); @@ -203,7 +217,7 @@ // controller.setDistributeNonProduceableEvents(false); controller.setDistributeNonConsumableEvents(false); - fooPortlet.addHandler(eventProducer); + fooPortlet.addHandler(eventProducerHandler); controller.process(context, request); fooPortlet.assertInvocationCountIs(6); barPortlet.assertInvocationCountIs(3); @@ -214,7 +228,7 @@ // controller.setDistributeNonProduceableEvents(false); controller.setDistributeNonConsumableEvents(true); - fooPortlet.addHandler(eventProducer); + fooPortlet.addHandler(eventProducerHandler); barPortlet.addHandler(eventConsumer); controller.process(context, request); fooPortlet.assertInvocationCountIs(7); @@ -223,20 +237,157 @@ // controller.setDistributeNonProduceableEvents(false); controller.setDistributeNonConsumableEvents(false); - fooPortlet.addHandler(eventProducer); + fooPortlet.addHandler(eventProducerHandler); barPortlet.addHandler(eventConsumer); controller.process(context, request); fooPortlet.assertInvocationCountIs(8); barPortlet.assertInvocationCountIs(5); } = - private static class EventProducerAction extends PortletSupport.ActionH= andler + @Test + public void testEventFloodDetection() throws PortletInvokerException { + QName srcName =3D new QName("juu", "foo"); = + // + PortletSupport fooPortlet =3D invoker.addPortlet("foo"); + + // Create wire + eventControllerContext.createWire(srcName, "foo", srcName, "foo"); + + ControllerRequest request =3D new PortletActionRequest( + "foo", + new OpaqueStateString(""), + new ParameterMap(), + new WindowNavigationalState(), + context.getStateControllerContext().createPageState(false) + ); + + EventProducerActionHandler eventProducerActionHandler =3D new EventP= roducerActionHandler(srcName); + EventProducerEventHandler eventProducerEventHandler =3D new EventPro= ducerEventHandler(srcName); + + // + controller.setConsumedEventThreshold(10); + controller.setProducedEventThreshold(1); + fooPortlet.addHandler(eventProducerActionHandler); + fooPortlet.addHandler(eventProducerEventHandler); + ControllerResponse response =3D controller.process(context, request); + PageUpdateResponse updateResponse =3D assertInstanceOf(response, Pag= eUpdateResponse.class); + assertEquals(PortletResponse.PRODUCED_EVENT_FLOODED, updateResponse.= getEventDistributionStatus()); + + // + controller.setConsumedEventThreshold(1); + controller.setProducedEventThreshold(10); + fooPortlet.addHandler(eventProducerActionHandler); + fooPortlet.addHandler(eventProducerEventHandler); + response =3D controller.process(context, request); + updateResponse =3D assertInstanceOf(response, PageUpdateResponse.cla= ss); + assertEquals(PortletResponse.CONSUMED_EVENT_FLOODED, updateResponse.= getEventDistributionStatus()); + } + + @Test + public void testEventFloodInterruption() throws PortletInvokerException + { + QName srcName =3D new QName("juu", "foo"); + + // + PortletSupport fooPortlet =3D invoker.addPortlet("foo"); + + // Create wire + eventControllerContext.createWire(srcName, "foo", srcName, "foo"); + + ControllerRequest request =3D new PortletActionRequest( + "foo", + new OpaqueStateString(""), + new ParameterMap(), + new WindowNavigationalState(), + context.getStateControllerContext().createPageState(false) + ); + + // + EventProducerActionHandler eventProducerActionHandler =3D new EventP= roducerActionHandler(srcName); + + // + controller.setConsumedEventThreshold(10); + controller.setProducedEventThreshold(10); + context.setEventControllerContext(new EventControllerContext() + { + public void handleEvent(EventPhaseSession session, Event produced= Event) + { + session.interrupt(); + } + }); + fooPortlet.addHandler(eventProducerActionHandler); + ControllerResponse response =3D controller.process(context, request); + PageUpdateResponse updateResponse =3D assertInstanceOf(response, Pag= eUpdateResponse.class); + assertEquals(PortletResponse.INTERRUPTED, updateResponse.getEventDis= tributionStatus()); + } + + @Test + public void testEventControllerContextFails() throws PortletInvokerExce= ption + { + QName srcName =3D new QName("juu", "foo"); + + // + PortletSupport fooPortlet =3D invoker.addPortlet("foo"); + + // Create wire + eventControllerContext.createWire(srcName, "foo", srcName, "foo"); + + ControllerRequest request =3D new PortletActionRequest( + "foo", + new OpaqueStateString(""), + new ParameterMap(), + new WindowNavigationalState(), + context.getStateControllerContext().createPageState(false) + ); + + // + EventProducerActionHandler eventProducerActionHandler =3D new EventP= roducerActionHandler(srcName); + + // + controller.setConsumedEventThreshold(10); + controller.setProducedEventThreshold(10); + context.setEventControllerContext(new EventControllerContext() + { + public void handleEvent(EventPhaseSession session, Event produced= Event) + { + throw new RuntimeException(); + } + }); + fooPortlet.addHandler(eventProducerActionHandler); + ControllerResponse response =3D controller.process(context, request); + PageUpdateResponse updateResponse =3D assertInstanceOf(response, Pag= eUpdateResponse.class); + assertEquals(PortletResponse.DISTRIBUTION_DONE, updateResponse.getEv= entDistributionStatus()); + + // + final Error error =3D new Error(); + context.setEventControllerContext(new EventControllerContext() + { + public void handleEvent(EventPhaseSession session, Event produced= Event) + { + throw error; + } + }); + fooPortlet.addHandler(eventProducerActionHandler); + try + { + controller.process(context, request); + fail(); + } + catch (Error ignore) + { + assertSame(error, ignore); + } + } + + private static class EventProducerActionHandler extends PortletSupport.= ActionHandler + { + /** . */ private final QName name; = - private EventProducerAction(QName name) + private EventProducerActionHandler(QName name) { this.name =3D name; } @@ -249,6 +400,25 @@ } } = + private static class EventProducerEventHandler extends PortletSupport.E= ventHandler + { + + /** . */ + private final QName name; + + private EventProducerEventHandler(QName name) + { + this.name =3D name; + } + + protected PortletInvocationResponse invoke(EventInvocation action) t= hrows PortletInvokerException + { + UpdateNavigationalStateResponse update =3D new UpdateNavigational= StateResponse(); + update.queueEvent(new UpdateNavigationalStateResponse.Event(name,= null)); + return update; + } + } + private static class NoOpEventProcessor extends PortletSupport.EventHan= dler { = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortalServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortalServlet.java 2008-02-27 20:42:50 UTC (rev 10138) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortalServlet.java 2008-02-27 22:06:45 UTC (rev 10139) @@ -31,7 +31,6 @@ import org.jboss.portal.portlet.test.controller.PageRenderer; import org.jboss.portal.portlet.test.controller.PortletControllerContextIm= pl; import org.jboss.portal.portlet.test.controller.Renderer; -import org.jboss.portal.portlet.test.controller.AbstractRendererContext; import org.jboss.portal.portlet.test.controller.RendererContextImpl; import org.jboss.portal.web.WebRequest; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PageEventControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PageEventControllerContext.java 2008-02-27 20:42:50 UTC (rev 10138) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PageEventControllerContext.java 2008-02-27 22:06:45 UTC (rev 10139) @@ -24,6 +24,7 @@ = import org.jboss.portal.portlet.controller.event.EventControllerContext; import org.jboss.portal.portlet.controller.event.Event; +import org.jboss.portal.portlet.controller.event.EventPhaseSession; import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.info.PortletInfo; @@ -55,11 +56,8 @@ this.prepareResponse =3D prepareResponse; } = - public List getConsumedEvents(Event producedEvent) + public void handleEvent(EventPhaseSession session, Event producedEvent) { - ArrayList consumedEvents =3D new ArrayList(); - - // for (String windowId : prepareResponse.getWindowIds()) { try @@ -74,18 +72,17 @@ // if (portletInfo.getEventing().getConsumedEvents().containsK= ey(producedEvent.getName())) { - Event consumedEvent =3D new Event(producedEvent.getName(= ), producedEvent.getPayload(), windowId); - consumedEvents.add(consumedEvent); + session.queueEvent(new Event(producedEvent.getName(), pr= oducedEvent.getPayload(), windowId)); } } } catch (PortletInvokerException e) { e.printStackTrace(); + + // + session.interrupt(); } } - - // - return consumedEvents; } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/tck/TCKRendererContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKRendererContext.java 2008-02-27 20:42:50 UTC (rev 10138) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKRendererContext.java 2008-02-27 22:06:45 UTC (rev 10139) @@ -25,6 +25,7 @@ import org.jboss.portal.portlet.test.controller.AbstractRendererContext; import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.NoSuchPortletException; = import java.util.Collection; import java.util.ArrayList; @@ -53,8 +54,18 @@ { for (String involvedPortletId : pageState.getInvolvedPortlets()) { - Portlet involvedPortlet =3D portletControllerContext.getPortle= t(involvedPortletId); - involvedPortlets.add(involvedPortlet); + try + { + Portlet involvedPortlet =3D portletControllerContext.getPor= tlet(involvedPortletId); + involvedPortlets.add(involvedPortlet); + } + catch (NoSuchPortletException e) + { + // It happen when a portlet becomes unavailable and + // therefore is removed from the available portlet + // in that case it should not prevent the other portlets to= be + // rendered + } } } = --===============6236031826799346034==-- From portal-commits at lists.jboss.org Wed Feb 27 17:56:58 2008 Content-Type: multipart/mixed; boundary="===============7092488605667632238==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10140 - in modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit: reports and 1 other directory. Date: Wed, 27 Feb 2008 17:56:58 -0500 Message-ID: --===============7092488605667632238== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-27 17:56:58 -0500 (Wed, 27 Feb 2008) New Revision: 10140 Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/Assert= ion.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/report= s/ResultProducingListener.java Log: Improve a bit dummy test coverage reporting Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit= /Assertion.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/Asser= tion.java 2008-02-27 22:06:45 UTC (rev 10139) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/Asser= tion.java 2008-02-27 22:56:58 UTC (rev 10140) @@ -771,7 +771,7 @@ JSR286_130(new TCK(130, "PLT.13.1.7"), "Setting a cachability different= from FULL must result in an " + "IllegalStateException"), JSR286_131(new TCK(131, "PLT.13.1.7"), "Attempts to create URLs that ar= e not of type FULL or are not resource " + - "URLs in the current or a downstream response must result in\n" + + "URLs in the current or a downstream response must result in" + "an IllegalStateException"), JSR286_132(new TCK(132, "PLT.13.1.7"), "Creating other URLs, e.g. resou= rce URLs of type PAGE or action or render " + "URLs, must result in an IllegalStateException"), @@ -927,13 +927,13 @@ "getPathTranslated, getQueryString, getRequestURI and getServletPath= ."), JSR286_188(new TCK(188, "PLT.19.3.3"), "The following methods of the Ht= tpServletRequest must be equivalent " + "to the methods of the PortletRequest of similar name: getScheme, ge= tServerName, getServerPort, getAttribute, " + - "getAttributeNames, setAttribute, removeAttribute, getLocale, getLoc= ales, isSecure, getAuthType,\n" + + "getAttributeNames, setAttribute, removeAttribute, getLocale, getLoc= ales, isSecure, getAuthType," + "getContextPath, getRemoteUser, getUserPrincipal, getRequestedSessio= nId, isRequestedSessionIdValid, getCookies."), JSR286_189(new TCK(189, "PLT.19.3.3"), "The following methods of the Ht= tpServletRequest must be equivalent to " + "the methods of the PortletRequest of similar name with the provisio= n defined in PLT.19.1.1 Query Strings " + "in Request Dispatcher Paths Section: getParameter, getParameterName= s, getParameterValues and getParameterMap."), JSR286_190(new TCK(190, "PLT.19.3.3"), "In case of an include from proc= essAction, the following methods of the " + - "HttpServletRequest must be based on the corresponding methods of th= e\n" + + "HttpServletRequest must be based on the corresponding methods of th= e" + "ActionRequest: getCharacterEncoding, setCharacterEncoding, getConte= ntType, getInputStream, getContentLength, " + "getMethod and getReader."), JSR286_191(new TCK(191, "PLT.19.3.3"), "In case of an include from proc= essEvent, the following methods of the " + @@ -960,7 +960,7 @@ "to the methods of the ActionResponse/EventResponse of similar name:= encodeURL and encodeUrl."), JSR286_201(new TCK(201, "PLT.19.3.3"), Status.specUntestable("impl"), "= The following methods of the HttpServletResponse must perform no " + "operations: setContentType, setCharacterEncoding, setContentLength,= setLocale, addCookie, sendError, " + - "sendRedirect, setDateHeader, addDateHeader, setHeader, addHeader, s= etIntHeader, addIntHeader, setStatus,\n" + + "sendRedirect, setDateHeader, addDateHeader, setHeader, addHeader, s= etIntHeader, addIntHeader, setStatus," + "setBufferSize and flushBuffer."), JSR286_202(new TCK(202, "PLT.19.3.3"), "The containsHeader method of th= e HttpServletResponse must return false."), JSR286_203(new TCK(203, "PLT.19.3.3"), "The isCommitted method of the H= ttpServletResponse must return true."), @@ -1013,7 +1013,7 @@ "getPathTranslated, getQueryString, getRequestURI and getServletPath= ."), JSR286_223(new TCK(223, "PLT.19.3.5"), "The following methods of the Ht= tpServletRequest must be equivalent " + "to the methods of the PortletRequest of similar name: getScheme, ge= tServerName, getServerPort, getAttribute, " + - "getAttributeNames, setAttribute, removeAttribute, getLocale, getLoc= ales, isSecure, getAuthType,\n" + + "getAttributeNames, setAttribute, removeAttribute, getLocale, getLoc= ales, isSecure, getAuthType," + "getContextPath, getRemoteUser, getUserPrincipal, getRequestedSessio= nId, isRequestedSessionIdValid, getCookies."), JSR286_224(new TCK(224, "PLT.19.3.5"), "The following methods of the Ht= tpServletRequest must be equivalent to " + "the methods of the ResourceRequest of similar name: getCharacterEnc= oding, setCharacterEncoding, getContentType, " + @@ -1080,7 +1080,7 @@ "methods of the PortletRequest of similar name with the provision de= fined in PLT.18.1.1 Query Strings in Request " + "Dispatcher Paths Section: getParameter, getParameterNames, getParam= eterValues and getParameterMap."), JSR286_248(new TCK(248, "PLT.19.4.3"), "In case of a forward from proce= ssAction, the following methods of the " + - "HttpServletRequest must be based on the corresponding methods of th= e\n" + + "HttpServletRequest must be based on the corresponding methods of th= e" + "ActionRequest: getCharacterEncoding, setCharacterEncoding, getConte= ntType, getInputStream, getContentLength, " + "getMethod and getReader."), JSR286_249(new TCK(249, "PLT.19.4.3"), "In case of a forward from proce= ssEvent, the following methods of the " + @@ -1104,7 +1104,7 @@ JSR286_257(new TCK(257, "PLT.19.4.3"), "The following methods of the Ht= tpServletResponse must be equivalent " + "to the methods of the ActionResponse/EventResponse of similar name:= encodeURL and encodeUrl."), JSR286_258(new TCK(258, "PLT.19.4.3"), Status.specUntestable("imp"), "T= he following methods of the HttpServletResponse must perform no " + - "operations: resetBuffer, reset, setContentType, setContentLength,\n= " + + "operations: resetBuffer, reset, setContentType, setContentLength," + "setCharacterEncoding, setLocale, sendError, setDateHeader, addDateH= eader, setHeader, addHeader, setIntHeader, " + "addIntHeader, setStatus, setBufferSize and flushBuffer."), JSR286_259(new TCK(259, "PLT.19.4.3"), Status.specUntestable("impl"), "= The addCookie method of the HttpServletResponse must be based on " + @@ -1161,7 +1161,7 @@ "getPathTranslated, getQueryString, getRequestURI and getServletPath= ."), JSR286_281(new TCK(281, "PLT.19.4.5"), "The following methods of the Ht= tpServletRequest must be equivalent " + "to the methods of the PortletRequest of similar name: getScheme, ge= tServerName, getServerPort, getAttribute, " + - "getAttributeNames, setAttribute, removeAttribute, getLocale, getLoc= ales, isSecure, getAuthType, \n" + + "getAttributeNames, setAttribute, removeAttribute, getLocale, getLoc= ales, isSecure, getAuthType, " + "getContextPath, getRemoteUser, getUserPrincipal, getRequestedSessio= nId, isRequestedSessionIdValid, getCookies."), JSR286_282(new TCK(282, "PLT.19.4.5"), "The following methods of the Ht= tpServletRequest must be equivalent to " + "the methods of the ResourceRequest of similar name: getCharacterEnc= oding, setCharacterEncoding, getContentType, getMethod and getReader."), @@ -1206,7 +1206,7 @@ "container, the portlet container must first call the destroy method= on the filter to enable the filter to " + "release any resources and perform other cleanup operations."), JSR286_296(new TCK(296, "PLT.20.2.2"), "When a filter invokes the doFil= ter method on the portlet container=E2=80=99s " + - "filter chain implementation, the container must ensure that the req= uest and\n" + + "filter chain implementation, the container must ensure that the req= uest and " + "response object that it passes to the next component in the filter = chain, or to the target portlet if the " + "filter was the last in the chain, is the same object that was passe= d into the doFilter method by the calling " + "filter or one of the above mentioned wrappers."), Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit= /reports/ResultProducingListener.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/repor= ts/ResultProducingListener.java 2008-02-27 22:06:45 UTC (rev 10139) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/repor= ts/ResultProducingListener.java 2008-02-27 22:56:58 UTC (rev 10140) @@ -22,18 +22,15 @@ = package org.jboss.portal.unit.reports; = +import com.sun.mirror.apt.RoundCompleteEvent; import com.sun.mirror.apt.RoundCompleteListener; -import com.sun.mirror.apt.RoundCompleteEvent; +import org.jboss.portal.unit.Assertion; = import java.io.File; +import java.io.FileWriter; import java.io.Writer; -import java.io.FileWriter; +import java.util.Map; import java.util.Set; -import java.util.Map; -import java.util.Collections; -import java.util.SortedSet; -import java.util.List; -import java.util.LinkedList; = /** * @author Boleslaw Dawidowicz @@ -86,12 +83,16 @@ = for (int i =3D 1; i <=3D max; i++) { - String assertion =3D pre + i; + String assertionName =3D pre + i; = - writer.write(assertion + ",\n"); + Set testCases =3D map.get(assertionName); = - Set testCases =3D map.get(assertion); + Assertion assertion =3D getAssertion(assertionName); = + String description =3D assertion !=3D null ? assertion.getDescrip= tion().replaceAll(",", " ").trim() : ""; + + writer.write(assertionName + ", " + description + '\n'); + if (testCases !=3D null) { for (String testCase : testCases) @@ -99,9 +100,32 @@ writer.write(" ," + testCase + "\n"); } } + + writer.write(" ,\n"); } = writer.close(); + } = + + private Assertion getAssertion(String name) + { + if (name =3D=3D null) + { + throw new IllegalArgumentException("name cannot be null"); + } + + Assertion[] assertions =3D Assertion.class.getEnumConstants(); + + for (Assertion assertion : assertions) + { + if (assertion.name().equals(name)) + { + return assertion; + } + } + + + return null; } } --===============7092488605667632238==-- From portal-commits at lists.jboss.org Wed Feb 27 18:06:44 2008 Content-Type: multipart/mixed; boundary="===============1248276064686381749==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10141 - in modules/portlet/trunk: portlet and 8 other directories. Date: Wed, 27 Feb 2008 18:06:44 -0500 Message-ID: --===============1248276064686381749== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-27 18:06:44 -0500 (Wed, 27 Feb 2008) New Revision: 10141 Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/asp= ects/portlet/CCPPInterceptor.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/jsr286/tck/portletrequests/CCPPTestCase.java Modified: modules/portlet/trunk/build/pom.xml modules/portlet/trunk/portlet/pom.xml modules/portlet/trunk/test/pom.xml modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestPortletInvocationContext.java modules/portlet/trunk/test/src/test/build.xml modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/jb= oss-beans.xml modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/j= boss-beans.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= jboss-beans.xml Log: implement simple cc/pp attribute Modified: modules/portlet/trunk/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/build/pom.xml 2008-02-27 22:56:58 UTC (rev 10140) +++ modules/portlet/trunk/build/pom.xml 2008-02-27 23:06:44 UTC (rev 10141) @@ -45,6 +45,7 @@ 1.7.0 2.1.4 2.0-Draft32 + 1.0 = @@ -174,6 +175,11 @@ jsp-api ${version.javax.servlet.jsp} + + javax.ccpp + ccpp + ${version.ccpp-api} + = concurrent Modified: modules/portlet/trunk/portlet/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/pom.xml 2008-02-27 22:56:58 UTC (rev 1014= 0) +++ modules/portlet/trunk/portlet/pom.xml 2008-02-27 23:06:44 UTC (rev 1014= 1) @@ -39,6 +39,10 @@ sun-jaxb jaxb-api + + javax.ccpp + ccpp + = Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /aspects/portlet/CCPPInterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/as= pects/portlet/CCPPInterceptor.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/as= pects/portlet/CCPPInterceptor.java 2008-02-27 23:06:44 UTC (rev 10141) @@ -0,0 +1,122 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.aspects.portlet; + +import org.jboss.portal.portlet.invocation.PortletInterceptor; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.common.invocation.InvocationException; + +import javax.ccpp.Profile; +import javax.ccpp.Attribute; +import javax.ccpp.Component; +import javax.ccpp.ProfileDescription; +import javax.ccpp.AttributeDescription; +import javax.ccpp.ComponentDescription; +import java.util.Set; +import java.util.Collections; + +/** + * A simple implementation of CC/PP feature of JSR286. + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class CCPPInterceptor extends PortletInterceptor +{ + protected Object invoke(PortletInvocation invocation) throws Exception,= InvocationException + { + try + { + invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, "javax.p= ortlet.ccpp", SIMPLE_PROFILE); + + // + return invocation.invokeNext(); + } + finally + { + invocation.removeAttribute(PortletInvocation.REQUEST_SCOPE, "java= x.portlet.ccpp"); + } + } + + /** + * A simple implementation of a profile. + */ + private static final Profile SIMPLE_PROFILE =3D new Profile() + { + public Attribute getAttribute(String s) + { + return null; + } + + public Set getAttributes() + { + return Collections.emptySet(); + } + + public Component getComponent(String s) + { + return null; + } + + public Set getComponents() + { + return Collections.emptySet(); + } + + public ProfileDescription getDescription() + { + return SIMPLE_PROFILE_DESCRPTION; + } + }; + + /** + * A simple implementation of a profile description. + */ + private static final ProfileDescription SIMPLE_PROFILE_DESCRPTION =3D n= ew ProfileDescription() + { + public AttributeDescription getAttributeDescription(String s) + { + return null; + } + + public Set getAttributeDescriptions() + { + return Collections.emptySet(); + } + + public ComponentDescription getComponentDescription(String s) + { + return null; + } + + public Set getComponentDescriptions() + { + return Collections.emptySet(); + } + + public String getURI() + { + return null; + } + }; +} Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/po= rtlet/jsr286/tck/portletrequests/CCPPTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletrequests/CCPPTestCase.java (re= v 0) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/jsr286/tck/portletrequests/CCPPTestCase.java 2008-02-27 23:06:44 UTC (re= v 10141) @@ -0,0 +1,62 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.test.portlet.jsr286.tck.portletrequests; + +import org.jboss.portal.unit.annotations.TestCase; +import org.jboss.portal.unit.Assertion; +import org.jboss.portal.unit.PortletTestCase; +import org.jboss.portal.unit.PortletTestContext; +import org.jboss.portal.unit.actions.PortletRenderTestAction; +import org.jboss.portal.test.portlet.framework.UTP1; +import org.jboss.unit.driver.DriverResponse; +import org.jboss.unit.driver.response.EndTestResponse; +import static org.jboss.unit.api.Assert.*; + +import javax.portlet.Portlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.PortletRequest; +import javax.ccpp.Profile; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +(a)TestCase(Assertion.JSR286_89) +public class CCPPTestCase +{ + public CCPPTestCase(PortletTestCase seq) + { + seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestActio= n() + { + protected DriverResponse run(Portlet portlet, RenderRequest reque= st, RenderResponse response, PortletTestContext context) throws PortletExce= ption, IOException + { + Profile profile =3D (Profile)request.getAttribute(PortletReque= st.CCPP_PROFILE); + assertNotNull(profile); + return new EndTestResponse(); + } + }); + } +} Modified: modules/portlet/trunk/test/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/pom.xml 2008-02-27 22:56:58 UTC (rev 10140) +++ modules/portlet/trunk/test/pom.xml 2008-02-27 23:06:44 UTC (rev 10141) @@ -160,6 +160,10 @@ web-web jar + + javax.ccpp + ccpp + + + = @@ -614,6 +615,7 @@ + = @@ -703,6 +705,7 @@ + @@ -778,6 +781,7 @@ + = @@ -845,6 +849,7 @@ + = Modified: modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB= -INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/j= boss-beans.xml 2008-02-27 22:56:58 UTC (rev 10140) +++ modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/j= boss-beans.xml 2008-02-27 23:06:44 UTC (rev 10141) @@ -80,6 +80,7 @@ + @@ -88,6 +89,7 @@ + Modified: modules/portlet/trunk/test/src/test/resources/portlet-test-war/WE= B-INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/= jboss-beans.xml 2008-02-27 22:56:58 UTC (rev 10140) +++ modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/= jboss-beans.xml 2008-02-27 23:06:44 UTC (rev 10141) @@ -80,6 +80,7 @@ + @@ -88,6 +89,7 @@ + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-beans.xml 2008-02-27 22:56:58 UTC (rev 10140) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-beans.xml 2008-02-27 23:06:44 UTC (rev 10141) @@ -65,6 +65,7 @@ + @@ -73,6 +74,7 @@ + --===============1248276064686381749==-- From portal-commits at lists.jboss.org Wed Feb 27 18:27:12 2008 Content-Type: multipart/mixed; boundary="===============5586331475469049630==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10142 - modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/response. Date: Wed, 27 Feb 2008 18:27:11 -0500 Message-ID: --===============5586331475469049630== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-27 18:27:11 -0500 (Wed, 27 Feb 2008) New Revision: 10142 Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/response/PortletResponse.java Log: update javadoc Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/response/PortletResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/response/PortletResponse.java 2008-02-27 23:06:44 UTC (rev 1014= 1) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/response/PortletResponse.java 2008-02-27 23:27:11 UTC (rev 1014= 2) @@ -34,13 +34,13 @@ /** The event distribution was properly done. */ public static final int DISTRIBUTION_DONE =3D 0; = - /** The event distribution lead to a cycle. */ + /** The event distribution was interruped by the event controller conte= xt. */ public static final int INTERRUPTED =3D 1; = - /** The event distribution did flood. */ + /** The event distribution did flood with produced events. */ public static final int PRODUCED_EVENT_FLOODED =3D 2; = - /** The event distribution did flood. */ + /** The event distribution did flood with consumed events. */ public static final int CONSUMED_EVENT_FLOODED =3D 3; = /** . */ --===============5586331475469049630==-- From portal-commits at lists.jboss.org Wed Feb 27 18:33:14 2008 Content-Type: multipart/mixed; boundary="===============8168071180874929067==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10143 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/invocation and 1 other directories. Date: Wed, 27 Feb 2008 18:33:14 -0500 Message-ID: --===============8168071180874929067== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-27 18:33:14 -0500 (Wed, 27 Feb 2008) New Revision: 10143 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/MimeResponseImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/inv= ocation/PortletInvocation.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestPortletInvocationContext.java Log: remove legacy request/response properties in PortletInvocation Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/MimeResponseImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/MimeResponseImpl.java 2008-02-27 23:27:11 UTC (rev 10142) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/MimeResponseImpl.java 2008-02-27 23:33:14 UTC (rev 10143) @@ -186,7 +186,9 @@ resetBuffer(); = // And properties - invocation.getContext().getAttributeResolver(PortletInvocation.RESPO= NSE_PROPERTIES_SCOPE).getKeys().clear(); + getProperties().getTransportHeaders().clear(); + getProperties().getMarkupHeaders().clear(); + getProperties().getCookies().clear(); } = public boolean isCommitted() Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/invocation/PortletInvocation.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/PortletInvocation.java 2008-02-27 23:27:11 UTC (rev 10142) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/PortletInvocation.java 2008-02-27 23:33:14 UTC (rev 10143) @@ -60,12 +60,6 @@ /** The request scope. */ public static final Scope INVOCATION_SCOPE =3D Scope.INVOCATION_SCOPE; = - /** The request properties . */ - public static final Scope REQUEST_PROPERTIES_SCOPE =3D new Scope("reque= st_properties"); - - /** The response properties. */ - public static final Scope RESPONSE_PROPERTIES_SCOPE =3D new Scope("resp= onse_properties"); - /** . */ protected StateString navigationalState; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/TestPortletInvocationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvocationContext.java 2008-02-27 23:27:11 UTC (rev 1= 0142) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvocationContext.java 2008-02-27 23:33:14 UTC (rev 1= 0143) @@ -75,8 +75,6 @@ // addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttribut= eResolver(clientRequest)); addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeReso= lver()); - addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, new MapAttri= buteResolver()); - addResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, new MapAttr= ibuteResolver()); addResolver(PortletInvocation.REQUEST_SCOPE, new RequestAttributeRes= olver(clientRequest)); } = --===============8168071180874929067==-- From portal-commits at lists.jboss.org Wed Feb 27 18:49:05 2008 Content-Type: multipart/mixed; boundary="===============1977226778493149491==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10144 - in modules/portlet/trunk: test/src/main/java/org/jboss/portal/portlet/test/controller and 1 other directories. Date: Wed, 27 Feb 2008 18:49:05 -0500 Message-ID: --===============1977226778493149491== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-27 18:49:05 -0500 (Wed, 27 Feb 2008) New Revision: 10144 Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/response/PortletResponse.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/response/ResourceResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/ControllerResponseRendererFactory.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java Log: encapsulate public fields Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/response/PortletResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/response/PortletResponse.java 2008-02-27 23:33:14 UTC (rev 1014= 3) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/response/PortletResponse.java 2008-02-27 23:49:05 UTC (rev 1014= 4) @@ -44,7 +44,7 @@ public static final int CONSUMED_EVENT_FLOODED =3D 3; = /** . */ - public final PortletInvocationResponse response; + private final PortletInvocationResponse response; = /** . */ private final int eventDistributionStatus; @@ -59,4 +59,9 @@ { return eventDistributionStatus; } + + public PortletInvocationResponse getResponse() + { + return response; + } } Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/response/ResourceResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/response/ResourceResponse.java 2008-02-27 23:33:14 UTC (rev 101= 43) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/response/ResourceResponse.java 2008-02-27 23:49:05 UTC (rev 101= 44) @@ -33,10 +33,15 @@ { = /** . */ - public PortletInvocationResponse response; + private final PortletInvocationResponse response; = public ResourceResponse(PortletInvocationResponse response) { this.response =3D response; } + + public PortletInvocationResponse getResponse() + { + return response; + } } \ No newline at end of file Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/ControllerResponseRendererFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ControllerResponseRendererFactory.java 2008-02-27 23:33:14 UTC (= rev 10143) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ControllerResponseRendererFactory.java 2008-02-27 23:49:05 UTC (= rev 10144) @@ -77,20 +77,20 @@ } else if (response instanceof PortletResponse) { - return getRenderer(((PortletResponse)response).response); + return getRenderer(((PortletResponse)response).getResponse()); } else if (response instanceof ResourceResponse) { ResourceResponse resourceResponse =3D (ResourceResponse)response; = // - if (resourceResponse.response instanceof FragmentResponse) + if (resourceResponse.getResponse() instanceof FragmentResponse) { - return new ResourceRenderer((FragmentResponse)resourceResponse= .response, sendNoContentResponseOnEmptyResource); + return new ResourceRenderer((FragmentResponse)resourceResponse= .getResponse(), sendNoContentResponseOnEmptyResource); } else { - return getRenderer(((PortletResponse)response).response); + return getRenderer(((PortletResponse)response).getResponse()); } } = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-27 23:33:14 UTC (rev 10143) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-27 23:49:05 UTC (rev 10144) @@ -158,7 +158,7 @@ else if (controllerResponse instanceof ResourceResponse) { ResourceResponse resourceResponse =3D (ResourceResponse)contro= llerResponse; - PortletInvocationResponse pir =3D resourceResponse.response; + PortletInvocationResponse pir =3D resourceResponse.getResponse= (); = // if (pir instanceof FragmentResponse) @@ -218,7 +218,7 @@ else if (controllerResponse instanceof PortletResponse) { PortletResponse portletResponse =3D (PortletResponse)controlle= rResponse; - PortletInvocationResponse pir =3D portletResponse.response; + PortletInvocationResponse pir =3D portletResponse.getResponse(= ); = // if (pir instanceof ErrorResponse) --===============1977226778493149491==-- From portal-commits at lists.jboss.org Wed Feb 27 19:05:50 2008 Content-Type: multipart/mixed; boundary="===============7731089535671852769==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10145 - in modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller: impl/request and 1 other directories. Date: Wed, 27 Feb 2008 19:05:50 -0500 Message-ID: --===============7731089535671852769== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-27 19:05:49 -0500 (Wed, 27 Feb 2008) New Revision: 10145 Removed: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/request/FullScopedCacheablePortletResourceRequest.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/request/PageScopedFullPortletResourceRequest.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/request/PortletScopedPortletResourceRequest.java Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/PortletResourceRequestHandler.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/impl/request/ControllerRequestFactory.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/request/PortletResourceRequest.java Log: refactor the inheritence logic of the PortletResourceRequest : use a Scope = delegate object instead of having the scope behavior in PortletResourceReq= uest subclasses Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/PortletResourceRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/PortletResourceRequestHandler.java 2008-02-27 23:49:05 UTC (rev= 10144) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/PortletResourceRequestHandler.java 2008-02-28 00:05:49 UTC (rev= 10145) @@ -32,9 +32,7 @@ import org.jboss.portal.portlet.cache.CacheLevel; import org.jboss.portal.portlet.invocation.ResourceInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.controller.request.PageScopedFullPortletRe= sourceRequest; import org.jboss.portal.portlet.controller.request.PortletResourceRequest; -import org.jboss.portal.portlet.controller.request.PortletScopedPortletRes= ourceRequest; import org.jboss.portal.portlet.controller.response.ControllerResponse; import org.jboss.portal.portlet.controller.response.ResourceResponse; import org.jboss.portal.portlet.controller.state.PageNavigationalState; @@ -67,19 +65,21 @@ StateString portletNS =3D null; CacheLevel cacheability; = + PortletResourceRequest.Scope scope =3D portletResourceRequest.getSco= pe(); + // - if (portletResourceRequest instanceof PortletScopedPortletResourceRe= quest) + if (scope instanceof PortletResourceRequest.PortletScope) { - PortletScopedPortletResourceRequest portletScopedRequest =3D (Por= tletScopedPortletResourceRequest)portletResourceRequest; - mode =3D portletScopedRequest.getWindowNavigationalState().getMod= e(); - windowState =3D portletScopedRequest.getWindowNavigationalState()= .getWindowState(); - portletNS =3D portletScopedRequest.getWindowNavigationalState().g= etPortletNavigationalState(); + PortletResourceRequest.PortletScope portletScope =3D (PortletReso= urceRequest.PortletScope)scope; + mode =3D portletScope.getWindowNavigationalState().getMode(); + windowState =3D portletScope.getWindowNavigationalState().getWind= owState(); + portletNS =3D portletScope.getWindowNavigationalState().getPortle= tNavigationalState(); = // - if (portletResourceRequest instanceof PageScopedFullPortletResour= ceRequest) + if (scope instanceof PortletResourceRequest.PageScope) { - PageScopedFullPortletResourceRequest pageScopedRequest =3D (Pa= geScopedFullPortletResourceRequest)portletResourceRequest; - pageState =3D pageScopedRequest.getPageState(); + PortletResourceRequest.PageScope pageScope =3D (PortletResourc= eRequest.PageScope)scope; + pageState =3D pageScope.getPageState(); cacheability =3D CacheLevel.PAGE; = // Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/impl/request/ControllerRequestFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/request/ControllerRequestFactory.java 2008-02-27 23:49:05 = UTC (rev 10144) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/request/ControllerRequestFactory.java 2008-02-28 00:05:49 = UTC (rev 10145) @@ -25,11 +25,9 @@ import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; import org.jboss.portal.portlet.controller.request.ControllerRequest; -import org.jboss.portal.portlet.controller.request.FullScopedCacheablePort= letResourceRequest; -import org.jboss.portal.portlet.controller.request.PortletScopedPortletRes= ourceRequest; -import org.jboss.portal.portlet.controller.request.PageScopedFullPortletRe= sourceRequest; import org.jboss.portal.portlet.controller.request.PortletActionRequest; import org.jboss.portal.portlet.controller.request.PortletRenderRequest; +import org.jboss.portal.portlet.controller.request.PortletResourceRequest; import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.ParametersStateString; import org.jboss.portal.portlet.cache.CacheLevel; @@ -119,32 +117,29 @@ CacheLevel resourceCacheLevel =3D CacheLevel.valueOf(req.getParam= eter(ControllerRequestParameterNames.RESOURCE_CACHEABILITY)); = // + PortletResourceRequest.Scope scope; switch (resourceCacheLevel) { case FULL: - return new FullScopedCacheablePortletResourceRequest( - windowId, - resourceId, - resourceState, - formParameters); + scope =3D new PortletResourceRequest.FullScope(); + break; case PORTLET: - return new PortletScopedPortletResourceRequest( - windowId, - resourceId, - resourceState, - formParameters, - windowNavigationalState); + scope =3D new PortletResourceRequest.PortletScope(windowNav= igationalState); + break; case PAGE: - return new PageScopedFullPortletResourceRequest( - windowId, - resourceId, - resourceState, - formParameters, - pageState, - windowNavigationalState); + scope =3D new PortletResourceRequest.PageScope(windowNaviga= tionalState, pageState); + break; default: throw new AssertionError(); } + + // + return new PortletResourceRequest( + windowId, + resourceId, + resourceState, + formParameters, + scope); } else { Deleted: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/po= rtlet/controller/request/FullScopedCacheablePortletResourceRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/request/FullScopedCacheablePortletResourceRequest.java 2008-02-= 27 23:49:05 UTC (rev 10144) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/request/FullScopedCacheablePortletResourceRequest.java 2008-02-= 28 00:05:49 UTC (rev 10145) @@ -1,43 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.controller.request; - -import org.jboss.portal.common.util.ParameterMap; -import org.jboss.portal.portlet.StateString; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class FullScopedCacheablePortletResourceRequest extends PortletReso= urceRequest -{ - - public FullScopedCacheablePortletResourceRequest( - String windowId, - String resourceId, - StateString resourceState, - ParameterMap bodyParameters) - { - super(windowId, resourceId, resourceState, bodyParameters); - } -} Deleted: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/po= rtlet/controller/request/PageScopedFullPortletResourceRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/request/PageScopedFullPortletResourceRequest.java 2008-02-27 23= :49:05 UTC (rev 10144) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/request/PageScopedFullPortletResourceRequest.java 2008-02-28 00= :05:49 UTC (rev 10145) @@ -1,59 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.controller.request; - -import org.jboss.portal.common.util.ParameterMap; -import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.controller.PortletControllerContext; -import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.controller.state.WindowNavigationalState; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class PageScopedFullPortletResourceRequest extends PortletScopedPor= tletResourceRequest -{ - - /** . */ - private final PageNavigationalState pageState; - - public PageScopedFullPortletResourceRequest( - String windowId, - String resourceId, - StateString resourceState, - ParameterMap bodyParameters, - PageNavigationalState pageState, - WindowNavigationalState windowNavigationalState) - { - super(windowId, resourceId, resourceState, bodyParameters, windowNav= igationalState); - - // - this.pageState =3D pageState; - } - - public PageNavigationalState getPageState() - { - return pageState; - } -} Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/request/PortletResourceRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/request/PortletResourceRequest.java 2008-02-27 23:49:05 UTC (re= v 10144) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/request/PortletResourceRequest.java 2008-02-28 00:05:49 UTC (re= v 10145) @@ -24,6 +24,8 @@ = import org.jboss.portal.common.util.ParameterMap; import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.cache.CacheLevel; = import java.util.HashMap; @@ -37,16 +39,6 @@ { = /** . */ - private static final Map cacheability =3D new HashMa= p(); - - static - { - cacheability.put(FullScopedCacheablePortletResourceRequest.class, Ca= cheLevel.FULL); - cacheability.put(PortletScopedPortletResourceRequest.class, CacheLev= el.PORTLET); - cacheability.put(PageScopedFullPortletResourceRequest.class, CacheLe= vel.PAGE); - } - - /** . */ private final String resourceId; = /** . */ @@ -55,12 +47,15 @@ /** . */ private final ParameterMap bodyParameters; = - PortletResourceRequest( + /** . */ + private final Scope scope; + + public PortletResourceRequest( String windowId, String resourceId, StateString resourceState, - ParameterMap bodyParameters - ) + ParameterMap bodyParameters, + Scope scope) { super(windowId); = @@ -68,13 +63,19 @@ this.resourceId =3D resourceId; this.resourceState =3D resourceState; this.bodyParameters =3D bodyParameters; + this.scope =3D scope; } = - public CacheLevel getCacheabilityType() + public Scope getScope() { - return cacheability.get(getClass()); + return scope; } = + public CacheLevel getCacheability() + { + return scope.getCacheability(); + } + public String getResourceId() { return resourceId; @@ -89,4 +90,66 @@ { return bodyParameters; } + + public abstract static class Scope + { + + public abstract CacheLevel getCacheability(); + + } + + public static class FullScope extends Scope + { + public CacheLevel getCacheability() + { + return CacheLevel.FULL; + } + } + + public static class PortletScope extends FullScope + { + + /** . */ + private final WindowNavigationalState windowNavigationalState; + + public PortletScope(WindowNavigationalState windowNavigationalState) + { + this.windowNavigationalState =3D windowNavigationalState; + } + + public WindowNavigationalState getWindowNavigationalState() + { + return windowNavigationalState; + } + + public CacheLevel getCacheability() + { + return CacheLevel.PORTLET; + } + } + + public static class PageScope extends PortletScope + { + + /** . */ + private final PageNavigationalState pageState; + + public PageScope(WindowNavigationalState windowNavigationalState, Pa= geNavigationalState pageState) + { + super(windowNavigationalState); + + // + this.pageState =3D pageState; + } + + public PageNavigationalState getPageState() + { + return pageState; + } + + public CacheLevel getCacheability() + { + return CacheLevel.PAGE; + } + } } Deleted: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/po= rtlet/controller/request/PortletScopedPortletResourceRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/request/PortletScopedPortletResourceRequest.java 2008-02-27 23:= 49:05 UTC (rev 10144) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/request/PortletScopedPortletResourceRequest.java 2008-02-28 00:= 05:49 UTC (rev 10145) @@ -1,57 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.controller.request; - -import org.jboss.portal.common.util.ParameterMap; -import org.jboss.portal.portlet.StateString; -import org.jboss.portal.portlet.controller.PortletControllerContext; -import org.jboss.portal.portlet.controller.state.WindowNavigationalState; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class PortletScopedPortletResourceRequest extends FullScopedCacheab= lePortletResourceRequest -{ - - /** . */ - private final WindowNavigationalState windowNavigationalState; - - public PortletScopedPortletResourceRequest( - String windowId, - String resourceId, - StateString resourceState, - ParameterMap bodyParameters, - WindowNavigationalState windowNavigationalState) - { - super(windowId, resourceId, resourceState, bodyParameters); - - // - this.windowNavigationalState =3D windowNavigationalState; - } - - public WindowNavigationalState getWindowNavigationalState() - { - return windowNavigationalState; - } -} --===============7731089535671852769==-- From portal-commits at lists.jboss.org Wed Feb 27 19:17:08 2008 Content-Type: multipart/mixed; boundary="===============5924705434139815564==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10146 - in modules/portlet/trunk: controller/src/main/java/org/jboss/portal/portlet/controller/impl/request and 11 other directories. Date: Wed, 27 Feb 2008 19:17:07 -0500 Message-ID: --===============5924705434139815564== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-27 19:17:07 -0500 (Wed, 27 Feb 2008) New Revision: 10146 Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/PortletControllerContext.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/PortletRequestHandler.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/PortletResourceRequestHandler.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/impl/request/ControllerRequestFactory.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/impl/request/ControllerRequestParameterMapFactory.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/impl/request/ControllerRequestParameterNames.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/impl/state/StateControllerContextImpl.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/request/ControllerRequest.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/request/PortletActionRequest.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/request/PortletEventRequest.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/request/PortletRenderRequest.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/request/PortletRequest.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/request/PortletResourceRequest.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/response/PageUpdateResponse.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/state/PageNavigationalStateSerialization.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/state/StateControllerContext.java modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/= controller/PortletControllerContextSupport.java modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/= controller/PortletControllerTestCase.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortalServlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/AbstractPortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/ControllerResponseRendererFactory.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PageRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletURLRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestPortletInvocationContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalRenderResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletMarkupTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletURLTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/t= ck/TCKRendererContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/t= ck/TCKServlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/t= ck/TCKStateControllerContext.java modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/contro= ller/StateControllerContextTestCase.java Log: rename pageState to pageNavigationalState because this is what it really is Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/PortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/PortletControllerContext.java 2008-02-28 00:05:49 UTC (rev 1014= 5) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/PortletControllerContext.java 2008-02-28 00:17:07 UTC (rev 1014= 6) @@ -60,10 +60,10 @@ * Create a portlet invocation context for the specified window id. * * @param windowId the window id - * @param pageState + * @param pageNavigationalState * @return */ - PortletInvocationContext createPortletInvocationContext(String windowId= , PageNavigationalState pageState); + PortletInvocationContext createPortletInvocationContext(String windowId= , PageNavigationalState pageNavigationalState); = PortletInvocationResponse invoke( ActionInvocation actionInvocation) th= rows PortletInvokerException; = Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/PortletRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/PortletRequestHandler.java 2008-02-28 00:05:49 UTC (rev 10145) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/PortletRequestHandler.java 2008-02-28 00:17:07 UTC (rev 10146) @@ -74,14 +74,14 @@ // The page navigational state we will operate on during the request // Either we have nothing in the request so we create a new one // Or we have one but we copy it as we should not modify the input s= tate provided - PageNavigationalState pageState =3D portletRequest.getPageState(); - if (pageState =3D=3D null) + PageNavigationalState pageNavigationalState =3D portletRequest.getPa= geNavigationalState(); + if (pageNavigationalState =3D=3D null) { - pageState =3D stateContext.createPageState(true); + pageNavigationalState =3D stateContext.createPageNavigationalStat= e(true); } else { - pageState =3D stateContext.clonePageState(pageState, true); + pageNavigationalState =3D stateContext.clonePageNavigationalState= (pageNavigationalState, true); } = // @@ -92,7 +92,7 @@ { // Update portlet NS UpdateNavigationalStateResponse updateResponse =3D (UpdateNavigat= ionalStateResponse)response; - updateNavigationalState(context, portletRequest.getWindowId(), up= dateResponse, pageState); + updateNavigationalState(context, portletRequest.getWindowId(), up= dateResponse, pageNavigationalState); = // ResponseProperties update =3D updateResponse.getProperties(); @@ -222,7 +222,7 @@ } = // - PortletInvocationResponse eventResponse =3D deliverEvent(co= ntext, toConsumeEvent, pageState, requestProperties.getCookies()); + PortletInvocationResponse eventResponse =3D deliverEvent(co= ntext, toConsumeEvent, pageNavigationalState, requestProperties.getCookies(= )); = // Now it is consumed we add it to the history session.consumedEventHistory.addFirst(toConsumeEvent); @@ -233,7 +233,7 @@ UpdateNavigationalStateResponse eventStateResponse =3D (= UpdateNavigationalStateResponse)eventResponse; = // Update ns - updateNavigationalState(context, toConsumeEvent.getWindo= wId(), eventStateResponse, pageState); + updateNavigationalState(context, toConsumeEvent.getWindo= wId(), eventStateResponse, pageNavigationalState); = // Add events to source event queue for (UpdateNavigationalStateResponse.Event portletEvent = : eventStateResponse.getEvents()) @@ -263,7 +263,7 @@ } = // - return new PageUpdateResponse(updateResponse, requestProperties, = pageState, eventDistributionStatus); + return new PageUpdateResponse(updateResponse, requestProperties, = pageNavigationalState, eventDistributionStatus); } else { @@ -292,7 +292,7 @@ PortletActionRequest portletActionRequest =3D (PortletActionReque= st)portletRequest; = // - PageNavigationalState pageState =3D portletActionRequest.getPageS= tate(); + PageNavigationalState pageNavigationalState =3D portletActionRequ= est.getPageNavigationalState(); = // Mode mode =3D portletActionRequest.getWindowNavigationalState().g= etMode(); @@ -310,12 +310,12 @@ = // ParameterMap publicNS =3D null; - if (pageState !=3D null) + if (pageNavigationalState !=3D null) { - publicNS =3D pageState.getPublicNavigationalState(portletReque= st.getWindowId()); + publicNS =3D pageNavigationalState.getPublicNavigationalState(= portletRequest.getWindowId()); } = - PortletInvocationContext portletInvocationContext =3D context.cre= atePortletInvocationContext(portletRequest.getWindowId(), pageState); + PortletInvocationContext portletInvocationContext =3D context.cre= atePortletInvocationContext(portletRequest.getWindowId(), pageNavigationalS= tate); ActionInvocation actionInvocation =3D new ActionInvocation(portle= tInvocationContext); = // @@ -332,10 +332,10 @@ } = private PortletInvocationResponse deliverEvent(PortletControllerContext= context, Event event, - PageNavigationalState pa= geState, List requestCookies) + PageNavigationalState pa= geNavigationalState, List requestCookies) throws PortletInvokerException { - WindowNavigationalState windowNS =3D pageState.getWindowNavigational= State(event.getWindowId()); + WindowNavigationalState windowNS =3D pageNavigationalState.getWindow= NavigationalState(event.getWindowId()); = // if (windowNS =3D=3D null) @@ -344,10 +344,10 @@ } = // - ParameterMap publicNS =3D pageState.getPublicNavigationalState(event= .getWindowId()); + ParameterMap publicNS =3D pageNavigationalState.getPublicNavigationa= lState(event.getWindowId()); = // - PortletInvocationContext portletInvocationContext =3D context.create= PortletInvocationContext(event.getWindowId(), pageState); + PortletInvocationContext portletInvocationContext =3D context.create= PortletInvocationContext(event.getWindowId(), pageNavigationalState); EventInvocation eventInvocation =3D new EventInvocation(portletInvoc= ationContext); = // @@ -366,10 +366,10 @@ PortletControllerContext context, String windowId, UpdateNavigationalStateResponse update, - PageNavigationalState pageState) + PageNavigationalState pageNavigationalState) throws PortletInvokerException { - WindowNavigationalState windowNS =3D pageState.getWindowNavigational= State(windowId); + WindowNavigationalState windowNS =3D pageNavigationalState.getWindow= NavigationalState(windowId); = // if (windowNS =3D=3D null) @@ -394,13 +394,13 @@ portletNS =3D update.getNavigationalState(); } windowNS =3D new WindowNavigationalState(portletNS, mode, windowStat= e); - pageState.setWindowNavigationalState(windowId, windowNS); + pageNavigationalState.setWindowNavigationalState(windowId, windowNS); = // Now update shared state scoped at page Map publicNS =3D update.getPublicNavigationalState= Updates(); if (publicNS !=3D null) { - pageState.setPublicNavigationalState(windowId, publicNS); + pageNavigationalState.setPublicNavigationalState(windowId, public= NS); } } } Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/PortletResourceRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/PortletResourceRequestHandler.java 2008-02-28 00:05:49 UTC (rev= 10145) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/PortletResourceRequestHandler.java 2008-02-28 00:17:07 UTC (rev= 10146) @@ -60,7 +60,7 @@ // Mode mode =3D null; WindowState windowState =3D null; - PageNavigationalState pageState =3D null; + PageNavigationalState pageNavigationalState =3D null; ParameterMap publicNS =3D null; StateString portletNS =3D null; CacheLevel cacheability; @@ -79,13 +79,13 @@ if (scope instanceof PortletResourceRequest.PageScope) { PortletResourceRequest.PageScope pageScope =3D (PortletResourc= eRequest.PageScope)scope; - pageState =3D pageScope.getPageState(); + pageNavigationalState =3D pageScope.getPageNavigationalState(); cacheability =3D CacheLevel.PAGE; = // - if (pageState !=3D null) + if (pageNavigationalState !=3D null) { - publicNS =3D pageState.getPublicNavigationalState(portletRe= sourceRequest.getWindowId()); + publicNS =3D pageNavigationalState.getPublicNavigationalSta= te(portletResourceRequest.getWindowId()); } } else @@ -109,7 +109,7 @@ } = // - PortletInvocationContext portletInvocationContext =3D context.create= PortletInvocationContext(portletResourceRequest.getWindowId(), pageState); + PortletInvocationContext portletInvocationContext =3D context.create= PortletInvocationContext(portletResourceRequest.getWindowId(), pageNavigati= onalState); ResourceInvocation resourceInvocation =3D new ResourceInvocation(por= tletInvocationContext); = // Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/impl/request/ControllerRequestFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/request/ControllerRequestFactory.java 2008-02-28 00:05:49 = UTC (rev 10145) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/request/ControllerRequestFactory.java 2008-02-28 00:17:07 = UTC (rev 10146) @@ -63,12 +63,12 @@ = // The nav state provided with the request // Unmarshall portal navigational state if it is provided - PageNavigationalState pageState =3D null; - String context =3D req.getParameter(ControllerRequestParameterNames.= PAGE_STATE); + PageNavigationalState pageNavigationalState =3D null; + String context =3D req.getParameter(ControllerRequestParameterNames.= PAGE_NAVIGATIONAL_STATE); if (context !=3D null) { byte[] bytes =3D Base64.decode(context, true); - pageState =3D IOTools.unserialize(serialization, SerializationFil= ter.COMPRESSOR, bytes); + pageNavigationalState =3D IOTools.unserialize(serialization, Seri= alizationFilter.COMPRESSOR, bytes); } = // Get the window id @@ -127,7 +127,7 @@ scope =3D new PortletResourceRequest.PortletScope(windowNav= igationalState); break; case PAGE: - scope =3D new PortletResourceRequest.PageScope(windowNaviga= tionalState, pageState); + scope =3D new PortletResourceRequest.PageScope(windowNaviga= tionalState, pageNavigationalState); break; default: throw new AssertionError(); @@ -160,7 +160,7 @@ interactionState, formParameters, windowNavigationalState, - pageState); + pageNavigationalState); } else { @@ -172,7 +172,7 @@ windowId, windowNavigationalState, publicNavigationalStateChanges, - pageState); + pageNavigationalState); } } } Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/impl/request/ControllerRequestParameterMapFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/request/ControllerRequestParameterMapFactory.java 2008-02-= 28 00:05:49 UTC (rev 10145) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/request/ControllerRequestParameterMapFactory.java 2008-02-= 28 00:17:07 UTC (rev 10146) @@ -82,11 +82,11 @@ = = // - String pageState =3D null; + String pageNavigationalState =3D null; if (pageNS !=3D null) { byte[] bytes =3D IOTools.serialize(serialization, SerializationFi= lter.COMPRESSOR, pageNS); - pageState =3D Base64.encodeBytes(bytes, true); + pageNavigationalState =3D Base64.encodeBytes(bytes, true); } = // @@ -106,9 +106,9 @@ } = // - if (pageState !=3D null) + if (pageNavigationalState !=3D null) { - parameters.put(ControllerRequestParameterNames.PAGE_STATE, pag= eState); + parameters.put(ControllerRequestParameterNames.PAGE_NAVIGATION= AL_STATE, pageNavigationalState); } = // @@ -183,9 +183,9 @@ parameters.put(ControllerRequestParameterNames.WINDOW_STATE= , resourceURL.getWindowState().toString()); } = - if (cacheability =3D=3D CacheLevel.PAGE && pageState !=3D null) + if (cacheability =3D=3D CacheLevel.PAGE && pageNavigationalSta= te !=3D null) { - parameters.put(ControllerRequestParameterNames.PAGE_STATE, = pageState); + parameters.put(ControllerRequestParameterNames.PAGE_NAVIGAT= IONAL_STATE, pageNavigationalState); } } } Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/impl/request/ControllerRequestParameterNames.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/request/ControllerRequestParameterNames.java 2008-02-28 00= :05:49 UTC (rev 10145) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/request/ControllerRequestParameterNames.java 2008-02-28 00= :17:07 UTC (rev 10146) @@ -46,7 +46,7 @@ /** The portlet interaction state for lifecycle of type ACTION_LI= FECYCLE. */ public static final String INTERACTION_STATE =3D "interactionstate"; /** The page state for any kind of lifecycle. */ - public static final String PAGE_STATE =3D "pagestate"; + public static final String PAGE_NAVIGATIONAL_STATE =3D "pageNavigationa= lState"; /** The public navigational state changes of a portlet for lifecycle of= type RENDER_LIFECYCLE. */ public static final String PUBLIC_NAVIGATIONAL_STATE_CHANGES =3D "publi= cnavigationalstatechanges"; /** The resource id for lifecycle of type RESOURCE_LIFECYCLE. */ Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/impl/state/StateControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/state/StateControllerContextImpl.java 2008-02-28 00:05:49 = UTC (rev 10145) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/state/StateControllerContextImpl.java 2008-02-28 00:17:07 = UTC (rev 10146) @@ -48,12 +48,12 @@ this.portletControllerContext =3D portletControllerContext; } = - public PageNavigationalState clonePageState(PageNavigationalState pageS= tate, boolean modifiable) + public PageNavigationalState clonePageNavigationalState(PageNavigationa= lState pageNavigationalState, boolean modifiable) { - return new PageNavigationalStateImpl((PageNavigationalStateImpl)page= State, modifiable); + return new PageNavigationalStateImpl((PageNavigationalStateImpl)page= NavigationalState, modifiable); } = - public PageNavigationalState createPageState(boolean modifiable) + public PageNavigationalState createPageNavigationalState(boolean modifi= able) { return new PageNavigationalStateImpl(this, modifiable); } Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/request/ControllerRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/request/ControllerRequest.java 2008-02-28 00:05:49 UTC (rev 101= 45) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/request/ControllerRequest.java 2008-02-28 00:17:07 UTC (rev 101= 46) @@ -36,11 +36,11 @@ } = /** - * Returns the page state or null if that kind of request cannot have o= ne. + * Returns the page navigational state or null if that kind of request = cannot have one. * * @return the page state */ - public PageNavigationalState getPageState() + public PageNavigationalState getPageNavigationalState() { return null; } Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/request/PortletActionRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/request/PortletActionRequest.java 2008-02-28 00:05:49 UTC (rev = 10145) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/request/PortletActionRequest.java 2008-02-28 00:17:07 UTC (rev = 10146) @@ -45,9 +45,9 @@ StateString interactionState, ParameterMap bodyParameters, WindowNavigationalState windowNavigationalState, - PageNavigationalState pageState) + PageNavigationalState pageNavigationalState) { - super(windowId, windowNavigationalState, pageState); + super(windowId, windowNavigationalState, pageNavigationalState); = // this.interactionState =3D interactionState; Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/request/PortletEventRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/request/PortletEventRequest.java 2008-02-28 00:05:49 UTC (rev 1= 0145) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/request/PortletEventRequest.java 2008-02-28 00:17:07 UTC (rev 1= 0146) @@ -47,11 +47,11 @@ public PortletEventRequest( String windowId, WindowNavigationalState windowNavigationalState, - PageNavigationalState pageState, + PageNavigationalState pageNavigationalState, QName name, Serializable payload) { - super(windowId, windowNavigationalState, pageState); + super(windowId, windowNavigationalState, pageNavigationalState); = // this.name =3D name; Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/request/PortletRenderRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/request/PortletRenderRequest.java 2008-02-28 00:05:49 UTC (rev = 10145) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/request/PortletRenderRequest.java 2008-02-28 00:17:07 UTC (rev = 10146) @@ -42,9 +42,9 @@ String windowId, WindowNavigationalState windowNavigationalState, Map publicNavigationalStateChanges, - PageNavigationalState pageState) + PageNavigationalState pageNavigationalState) { - super(windowId, windowNavigationalState, pageState); + super(windowId, windowNavigationalState, pageNavigationalState); = // this.publicNavigationalStateChanges =3D publicNavigationalStateChang= es; Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/request/PortletRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/request/PortletRequest.java 2008-02-28 00:05:49 UTC (rev 10145) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/request/PortletRequest.java 2008-02-28 00:17:07 UTC (rev 10146) @@ -22,7 +22,6 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.controller.request; = -import org.jboss.portal.portlet.controller.PortletControllerContext; import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; = @@ -34,7 +33,7 @@ { = /** . */ - private final PageNavigationalState pageState; + private final PageNavigationalState pageNavigationalState; = /** . */ private final WindowNavigationalState windowNavigationalState; @@ -42,18 +41,18 @@ PortletRequest( String windowId, WindowNavigationalState windowNavigationalState, - PageNavigationalState pageState) + PageNavigationalState pageNavigationalState) { super(windowId); = // this.windowNavigationalState =3D windowNavigationalState; - this.pageState =3D pageState; + this.pageNavigationalState =3D pageNavigationalState; } = - public PageNavigationalState getPageState() + public PageNavigationalState getPageNavigationalState() { - return pageState; + return pageNavigationalState; } = public WindowNavigationalState getWindowNavigationalState() Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/request/PortletResourceRequest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/request/PortletResourceRequest.java 2008-02-28 00:05:49 UTC (re= v 10145) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/request/PortletResourceRequest.java 2008-02-28 00:17:07 UTC (re= v 10146) @@ -28,9 +28,6 @@ import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.cache.CacheLevel; = -import java.util.HashMap; -import java.util.Map; - /** * @author Julien Viet * @version $Revision: 630 $ @@ -132,19 +129,19 @@ { = /** . */ - private final PageNavigationalState pageState; + private final PageNavigationalState pageNavigationalState; = - public PageScope(WindowNavigationalState windowNavigationalState, Pa= geNavigationalState pageState) + public PageScope(WindowNavigationalState windowNavigationalState, Pa= geNavigationalState pageNavigationalState) { super(windowNavigationalState); = // - this.pageState =3D pageState; + this.pageNavigationalState =3D pageNavigationalState; } = - public PageNavigationalState getPageState() + public PageNavigationalState getPageNavigationalState() { - return pageState; + return pageNavigationalState; } = public CacheLevel getCacheability() Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/response/PageUpdateResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/response/PageUpdateResponse.java 2008-02-28 00:05:49 UTC (rev 1= 0145) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/response/PageUpdateResponse.java 2008-02-28 00:17:07 UTC (rev 1= 0146) @@ -37,19 +37,19 @@ private ResponseProperties properties; = /** . */ - private PageNavigationalState pageState; + private PageNavigationalState pageNavigationalState; = public PageUpdateResponse( UpdateNavigationalStateResponse update, ResponseProperties properties, - PageNavigationalState pageState, + PageNavigationalState pageNavigationalState, int eventCycleStatus) { super(update, eventCycleStatus); = // this.properties =3D properties; - this.pageState =3D pageState; + this.pageNavigationalState =3D pageNavigationalState; } = public ResponseProperties getProperties() @@ -57,8 +57,8 @@ return properties; } = - public PageNavigationalState getPageState() + public PageNavigationalState getPageNavigationalState() { - return pageState; + return pageNavigationalState; } } Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/state/PageNavigationalStateSerialization.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/state/PageNavigationalStateSerialization.java 2008-02-28 00:05:= 49 UTC (rev 10145) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/state/PageNavigationalStateSerialization.java 2008-02-28 00:17:= 07 UTC (rev 10146) @@ -87,16 +87,16 @@ this.context =3D context; } = - public void serialize(PageNavigationalState pageState, OutputStream out= ) throws IOException, IllegalArgumentException + public void serialize(PageNavigationalState pageNavigationalState, Outp= utStream out) throws IOException, IllegalArgumentException { DataOutputStream data =3D out instanceof DataOutputStream ? (DataOut= putStream)out : new DataOutputStream(out); = // - data.writeInt(pageState.getWindowIds().size()); - for (String windowId : pageState.getWindowIds()) + data.writeInt(pageNavigationalState.getWindowIds().size()); + for (String windowId : pageNavigationalState.getWindowIds()) { data.writeUTF(windowId); - WindowNavigationalState windowNS =3D pageState.getWindowNavigatio= nalState(windowId); + WindowNavigationalState windowNS =3D pageNavigationalState.getWin= dowNavigationalState(windowId); byte header =3D 0; int decision =3D 0; if (windowNS.getPortletNavigationalState() !=3D null) @@ -146,13 +146,13 @@ } = // - Set publicNames =3D pageState.getPublicNames(); + Set publicNames =3D pageNavigationalState.getPublicNames(); data.writeInt(publicNames.size()); - for (QName name : pageState.getPublicNames()) + for (QName name : pageNavigationalState.getPublicNames()) { data.writeUTF(name.getNamespaceURI()); data.writeUTF(name.getLocalPart()); - String[] values =3D pageState.getPublicNavigationalState(name); + String[] values =3D pageNavigationalState.getPublicNavigationalSt= ate(name); int length =3D values.length; data.writeInt(length); for (String value : values) @@ -171,7 +171,7 @@ DataInputStream data =3D in instanceof DataInputStream ? (DataInputS= tream)in : new DataInputStream(in); = // - PageNavigationalState pageNS =3D context.createPageState(true); + PageNavigationalState pageNS =3D context.createPageNavigationalState= (true); = // int size =3D data.readInt(); Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/state/StateControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/state/StateControllerContext.java 2008-02-28 00:05:49 UTC (rev = 10145) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/state/StateControllerContext.java 2008-02-28 00:17:07 UTC (rev = 10146) @@ -34,11 +34,10 @@ /** * Clone an existing page state object. * - * @param pageState the page state to clone - * @param modifiable set the modifiable status - * @return the page state clone + * @param pageNavigationalState + *@param modifiable set the modifiable status @return the page state cl= one */ - PageNavigationalState clonePageState(PageNavigationalState pageState, b= oolean modifiable); + PageNavigationalState clonePageNavigationalState(PageNavigationalState = pageNavigationalState, boolean modifiable); = /** * Create a new page state object. @@ -46,6 +45,6 @@ * @param modifiable set the modifiable status * @return the new page state */ - PageNavigationalState createPageState(boolean modifiable); + PageNavigationalState createPageNavigationalState(boolean modifiable); = } Modified: modules/portlet/trunk/controller/src/test/java/org/jboss/portal/p= ortlet/controller/PortletControllerContextSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet= /controller/PortletControllerContextSupport.java 2008-02-28 00:05:49 UTC (r= ev 10145) +++ modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet= /controller/PortletControllerContextSupport.java 2008-02-28 00:17:07 UTC (r= ev 10146) @@ -77,7 +77,7 @@ } = // - public PortletInvocationContext createPortletInvocationContext(String w= indowId, PageNavigationalState pageState) + public PortletInvocationContext createPortletInvocationContext(String w= indowId, PageNavigationalState pageNavigationalState) { if (windowId =3D=3D null) { @@ -85,7 +85,7 @@ } = // - return new PortletInvocationContextSupport(windowId, pageState); + return new PortletInvocationContextSupport(windowId, pageNavigationa= lState); } = private PortletInvocationResponse invoke(PortletInvocation invocation) = throws PortletInvokerException Modified: modules/portlet/trunk/controller/src/test/java/org/jboss/portal/p= ortlet/controller/PortletControllerTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet= /controller/PortletControllerTestCase.java 2008-02-28 00:05:49 UTC (rev 101= 45) +++ modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet= /controller/PortletControllerTestCase.java 2008-02-28 00:17:07 UTC (rev 101= 46) @@ -93,14 +93,14 @@ new OpaqueStateString(""), new ParameterMap(), new WindowNavigationalState(), - context.getStateControllerContext().createPageState(false) + context.getStateControllerContext().createPageNavigationalState(f= alse) ); = ControllerResponse response =3D controller.process(context, request); = PageUpdateResponse pageUpdate =3D assertInstanceOf(response, PageUpd= ateResponse.class); = - PageNavigationalState pageNS =3D assertNotNull(pageUpdate.getPageSta= te()); + PageNavigationalState pageNS =3D assertNotNull(pageUpdate.getPageNav= igationalState()); = assertEquals(Tools.toSet("foo"), pageNS.getWindowIds()); = @@ -127,7 +127,7 @@ new OpaqueStateString(""), new ParameterMap(), new WindowNavigationalState(), - context.getStateControllerContext().createPageState(false) + context.getStateControllerContext().createPageNavigationalState(f= alse) ); = try @@ -165,7 +165,7 @@ new OpaqueStateString(""), new ParameterMap(), new WindowNavigationalState(), - context.getStateControllerContext().createPageState(false) + context.getStateControllerContext().createPageNavigationalState(f= alse) ); = // @@ -260,7 +260,7 @@ new OpaqueStateString(""), new ParameterMap(), new WindowNavigationalState(), - context.getStateControllerContext().createPageState(false) + context.getStateControllerContext().createPageNavigationalState(f= alse) ); = EventProducerActionHandler eventProducerActionHandler =3D new EventP= roducerActionHandler(srcName); @@ -301,7 +301,7 @@ new OpaqueStateString(""), new ParameterMap(), new WindowNavigationalState(), - context.getStateControllerContext().createPageState(false) + context.getStateControllerContext().createPageNavigationalState(f= alse) ); = // @@ -339,7 +339,7 @@ new OpaqueStateString(""), new ParameterMap(), new WindowNavigationalState(), - context.getStateControllerContext().createPageState(false) + context.getStateControllerContext().createPageNavigationalState(f= alse) ); = // Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortalServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortalServlet.java 2008-02-28 00:05:49 UTC (rev 10145) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortalServlet.java 2008-02-28 00:17:07 UTC (rev 10146) @@ -95,7 +95,7 @@ true, true, context.getStateControllerContext(), - request.getPageState()); + request.getPageNavigationalState()); = // Renderer renderer =3D rendererFactory.getRenderer(response); @@ -106,7 +106,7 @@ else { = - PageRenderer renderer =3D new PageRenderer(new ResponseProperties= (), context.getStateControllerContext().createPageState(false)); + PageRenderer renderer =3D new PageRenderer(new ResponseProperties= (), context.getStateControllerContext().createPageNavigationalState(false)); = // renderer.render(new RendererContextImpl(context)); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/AbstractPortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-28 00:05:49 UTC (r= ev 10145) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-28 00:17:07 UTC (r= ev 10146) @@ -184,8 +184,8 @@ return invoke((PortletInvocation)resourceInvocation); } = - public PortletInvocationContext createPortletInvocationContext(String w= indowId, PageNavigationalState pageState) + public PortletInvocationContext createPortletInvocationContext(String w= indowId, PageNavigationalState pageNavigationalState) { - return new TestPortletInvocationContext(getPageNavigationalStateSeri= alization(), req, resp, windowId, pageState, MARKUP_INFO); + return new TestPortletInvocationContext(getPageNavigationalStateSeri= alization(), req, resp, windowId, pageNavigationalState, MARKUP_INFO); } } \ No newline at end of file Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/ControllerResponseRendererFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ControllerResponseRendererFactory.java 2008-02-28 00:05:49 UTC (= rev 10145) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ControllerResponseRendererFactory.java 2008-02-28 00:17:07 UTC (= rev 10146) @@ -49,7 +49,7 @@ private boolean sendErrorOnProcessActionError; = /** The page navigational state if there is one in the request. */ - private PageNavigationalState requestPageState; + private PageNavigationalState requestPageNavigationalState; = /** . */ private StateControllerContext stateControllerContext; @@ -58,12 +58,12 @@ boolean sendNoContentResponseOnEmptyResource, boolean sendErrorOnProcessActionError, StateControllerContext stateControllerContext, - PageNavigationalState requestPageState) + PageNavigationalState requestPageNavigationalState) { this.sendNoContentResponseOnEmptyResource =3D sendNoContentResponseO= nEmptyResource; this.sendErrorOnProcessActionError =3D sendErrorOnProcessActionError; this.stateControllerContext =3D stateControllerContext; - this.requestPageState =3D requestPageState; + this.requestPageNavigationalState =3D requestPageNavigationalState; } = public Renderer getRenderer(ControllerResponse response) @@ -73,7 +73,7 @@ PageUpdateResponse pageUpdate =3D (PageUpdateResponse)response; = // - return new PageRenderer(pageUpdate.getProperties(), pageUpdate.ge= tPageState()); + return new PageRenderer(pageUpdate.getProperties(), pageUpdate.ge= tPageNavigationalState()); } else if (response instanceof PortletResponse) { @@ -112,7 +112,7 @@ } else { - return new PageRenderer(new ResponseProperties(), requestPageS= tate !=3D null ? requestPageState : stateControllerContext.createPageState(= false)); + return new PageRenderer(new ResponseProperties(), requestPageN= avigationalState !=3D null ? requestPageNavigationalState : stateController= Context.createPageNavigationalState(false)); } } = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PageRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PageRenderer.java 2008-02-28 00:05:49 UTC (rev 10145) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PageRenderer.java 2008-02-28 00:17:07 UTC (rev 10146) @@ -64,14 +64,14 @@ protected FragmentRenderer fragmentRenderer =3D new SimpleFragmentRende= rer(); protected List fragments; protected List errors; - protected PageNavigationalState pageState; + protected PageNavigationalState pageNavigationalState; = - public PageRenderer(ResponseProperties properties, PageNavigationalStat= e pageState) + public PageRenderer(ResponseProperties properties, PageNavigationalStat= e pageNavigationalState) { super(properties); = // - this.pageState =3D pageState; + this.pageNavigationalState =3D pageNavigationalState; } = public void setFragmentRenderer(FragmentRenderer fragmentRenderer) @@ -141,7 +141,7 @@ = for (Portlet portlet : portlets) { - WindowNavigationalState windowNS =3D pageState.getWindowNavigatio= nalState(portlet.getContext().getId()); + WindowNavigationalState windowNS =3D pageNavigationalState.getWin= dowNavigationalState(portlet.getContext().getId()); = // Mode mode =3D Mode.VIEW; @@ -166,9 +166,9 @@ } = // - ParameterMap publicNS =3D pageState.getPublicNavigationalState(po= rtlet.getContext().getId()); + ParameterMap publicNS =3D pageNavigationalState.getPublicNavigati= onalState(portlet.getContext().getId()); = - RenderInvocation render =3D createRenderInvocation(context, prope= rties, pageState, portlet, windowNS, mode, windowState, portletNS, publicNS= ); + RenderInvocation render =3D createRenderInvocation(context, prope= rties, pageNavigationalState, portlet, windowNS, mode, windowState, portlet= NS, publicNS); = // try Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletURLRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-28 00:05:49 UTC (rev 10145) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-28 00:17:07 UTC (rev 10146) @@ -112,18 +112,18 @@ = public String renderURL(URLFormat format) { - String pageState =3D null; + String pageNavigationalState =3D null; if (pageNS !=3D null) { byte[] bytes =3D IOTools.serialize(serialization, SerializationFi= lter.COMPRESSOR, pageNS); - pageState =3D Base64.encodeBytes(bytes, true); + pageNavigationalState =3D Base64.encodeBytes(bytes, true); } = // Map parameters; - if (pageState !=3D null) + if (pageNavigationalState !=3D null) { - parameters =3D Collections.singletonMap(ControllerRequestParamete= rNames.PAGE_STATE, pageState); + parameters =3D Collections.singletonMap(ControllerRequestParamete= rNames.PAGE_NAVIGATIONAL_STATE, pageNavigationalState); } else { Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/TestPortletInvocationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvocationContext.java 2008-02-28 00:05:49 UTC (rev 1= 0145) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvocationContext.java 2008-02-28 00:17:07 UTC (rev 1= 0146) @@ -61,7 +61,7 @@ HttpServletRequest clientRequest, HttpServletResponse clientResponse, String windowId, - PageNavigationalState pageState, + PageNavigationalState pageNavigationalState, MarkupInfo markupInfo) { super(markupInfo); @@ -70,7 +70,7 @@ this.clientRequest =3D clientRequest; this.clientResponse =3D clientResponse; this.windowId =3D windowId; - this.urlRenderer =3D new PortletURLRenderer(pageState, clientRequest= , clientResponse, serialization); + this.urlRenderer =3D new PortletURLRenderer(pageNavigationalState, c= lientRequest, clientResponse, serialization); = // addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttribut= eResolver(clientRequest)); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-28 00:05:49 UTC (rev 10145) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-28 00:17:07 UTC (rev 10146) @@ -109,7 +109,7 @@ = // Process only portlet type // The request decoded if not null - PageNavigationalState pageState =3D null; + PageNavigationalState pageNavigationalState =3D null; if (URLParameterConstants.PORTLET_TYPE.equals(type)) { WebRequest wr =3D new WebRequest(req); @@ -136,7 +136,7 @@ { // PortletURLRenderer renderer =3D new PortletURLRenderer( - pageUpdate.getPageState(), + pageUpdate.getPageNavigationalState(), context.getClientRequest(), context.getClientResponse(), context.getPageNavigationalStateSerialization()); @@ -152,7 +152,7 @@ } else { - pageState =3D pageUpdate.getPageState(); + pageNavigationalState =3D pageUpdate.getPageNavigationalSta= te(); } } else if (controllerResponse instanceof ResourceResponse) @@ -250,17 +250,17 @@ PageNavigationalStateSerialization serialization =3D new PageNavi= gationalStateSerialization(context.getStateControllerContext()); // The nav state provided with the request // Unmarshall portal navigational state if it is provided - pageState =3D null; - String blah =3D req.getParameter(ControllerRequestParameterNames.= PAGE_STATE); + pageNavigationalState =3D null; + String blah =3D req.getParameter(ControllerRequestParameterNames.= PAGE_NAVIGATIONAL_STATE); if (blah !=3D null) { byte[] bytes =3D Base64.decode(blah, true); - pageState =3D IOTools.unserialize(serialization, Serialization= Filter.COMPRESSOR, bytes); + pageNavigationalState =3D IOTools.unserialize(serialization, S= erializationFilter.COMPRESSOR, bytes); } } = // - PortalRenderResponse renderResponse =3D new PortalRenderResponse(req= , resp, context, pageState, prepareResponse); + PortalRenderResponse renderResponse =3D new PortalRenderResponse(req= , resp, context, pageNavigationalState, prepareResponse); = // chain.doFilter(req, renderResponse); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PortalRenderResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalRenderResponse.java 2008-02-28 00:05:49 UTC (rev 10145) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalRenderResponse.java 2008-02-28 00:17:07 UTC (rev 10146) @@ -57,7 +57,7 @@ { = /** . */ - private PageNavigationalState pageState; + private PageNavigationalState pageNavigationalState; = /** . */ private PagePortletControllerContext portletControllerContext; @@ -69,7 +69,7 @@ HttpServletRequest request, HttpServletResponse response, PagePortletControllerContext portletControllerContext, - PageNavigationalState pageState, + PageNavigationalState pageNavigationalState, PortalPrepareResponse prepareResponse) throws PortletInvokerException { super(request, response); @@ -78,17 +78,17 @@ Set pageParameterNames =3D prepareResponse.getPageParameterNa= mes(); if (pageParameterNames.size() > 0) { - if (pageState =3D=3D null) + if (pageNavigationalState =3D=3D null) { - pageState =3D portletControllerContext.getStateControllerConte= xt().createPageState(true); + pageNavigationalState =3D portletControllerContext.getStateCon= trollerContext().createPageNavigationalState(true); } for (QName parameterName : pageParameterNames) { PageParameterDef parameterDef =3D prepareResponse.getPageParam= eterDef(parameterName); - boolean update =3D parameterDef.isFrozen() ? true : pageState.= getPublicNavigationalState(parameterName) =3D=3D null; + boolean update =3D parameterDef.isFrozen() ? true : pageNaviga= tionalState.getPublicNavigationalState(parameterName) =3D=3D null; if (update) { - pageState.setPublicNavigationalState(parameterName, new Str= ing[]{parameterDef.getValue()}); + pageNavigationalState.setPublicNavigationalState(parameterN= ame, new String[]{parameterDef.getValue()}); } } } @@ -96,7 +96,7 @@ // this.portletControllerContext =3D portletControllerContext; this.windowResults =3D new HashMap(); - this.pageState =3D pageState; + this.pageNavigationalState =3D pageNavigationalState; = // render(prepareResponse); @@ -107,9 +107,9 @@ * * @return the page state */ - public PageNavigationalState getPageState() + public PageNavigationalState getPageNavigationalState() { - return pageState; + return pageNavigationalState; } = public Set getWindowIds() @@ -130,16 +130,16 @@ private PortletInvocationResponse render(Portlet portlet, String window= Id) throws PortletInvokerException { WindowNavigationalState windowNS =3D null; - if (pageState !=3D null) + if (pageNavigationalState !=3D null) { - windowNS =3D pageState.getWindowNavigationalState(windowId); + windowNS =3D pageNavigationalState.getWindowNavigationalState(win= dowId); } = // ParameterMap publicNS =3D null; - if (pageState !=3D null) + if (pageNavigationalState !=3D null) { - publicNS =3D pageState.getPublicNavigationalState(windowId); + publicNS =3D pageNavigationalState.getPublicNavigationalState(win= dowId); } = // @@ -165,7 +165,7 @@ } = // - PortletInvocationContext renderContext =3D portletControllerContext.= createPortletInvocationContext(windowId, pageState); + PortletInvocationContext renderContext =3D portletControllerContext.= createPortletInvocationContext(windowId, pageNavigationalState); RenderInvocation render =3D new RenderInvocation(renderContext); render.setClientContext(new AbstractClientContext(portletControllerC= ontext.getClientRequest())); render.setServerContext(new AbstractServerContext(portletControllerC= ontext.getClientRequest(), portletControllerContext.getClientResponse())); @@ -229,11 +229,11 @@ = public String getMaximizedWindowId() { - if (pageState !=3D null) + if (pageNavigationalState !=3D null) { - for (String windowId : pageState.getWindowIds()) + for (String windowId : pageNavigationalState.getWindowIds()) { - WindowNavigationalState windowNS =3D pageState.getWindowNaviga= tionalState(windowId); + WindowNavigationalState windowNS =3D pageNavigationalState.get= WindowNavigationalState(windowId); if (WindowState.MAXIMIZED.equals(windowNS.getWindowState())) { return windowId; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletMarkupTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletMarkupTag.java 2008-02-28 00:05:49 UTC (rev 10145) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletMarkupTag.java 2008-02-28 00:17:07 UTC (rev 10146) @@ -53,9 +53,9 @@ { FragmentResponse fragment =3D (FragmentResponse)portletResp; WindowNavigationalState windowNS =3D null; - if (renderResponse.getPageState() !=3D null) + if (renderResponse.getPageNavigationalState() !=3D null) { - windowNS =3D renderResponse.getPageState().getWindowNavigat= ionalState(portletTag.result.getWindowDef().getWindowId()); + windowNS =3D renderResponse.getPageNavigationalState().getW= indowNavigationalState(portletTag.result.getWindowDef().getWindowId()); } if (windowNS =3D=3D null || !windowNS.getWindowState().equals(= WindowState.MINIMIZED)) { Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-28 00:05:49 UTC (rev 10145) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-28 00:17:07 UTC (rev 10146) @@ -94,7 +94,7 @@ } = PortletURLRenderer renderer =3D new PortletURLRenderer( - renderResponse.getPageState(), + renderResponse.getPageNavigationalState(), context.getClientRequest(), context.getClientResponse(), context.getPageNavigationalStateSerialization()); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/tck/TCKRendererContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKRendererContext.java 2008-02-28 00:05:49 UTC (rev 10145) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKRendererContext.java 2008-02-28 00:17:07 UTC (rev 10146) @@ -42,7 +42,7 @@ = public TCKRendererContext( TCKPortletControllerContext portletControllerContext, - TCKPageNavigationalState pageState) throws PortletInvokerException + TCKPageNavigationalState tckPageNavigationalState) throws PortletInv= okerException { super(portletControllerContext); = @@ -50,9 +50,9 @@ Collection involvedPortlets =3D new ArrayList(); = // Page state could be null for some requests - if (pageState !=3D null) + if (tckPageNavigationalState !=3D null) { - for (String involvedPortletId : pageState.getInvolvedPortlets()) + for (String involvedPortletId : tckPageNavigationalState.getInvol= vedPortlets()) { try { Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/tck/TCKServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKServlet.java 2008-02-28 00:05:49 UTC (rev 10145) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKServlet.java 2008-02-28 00:17:07 UTC (rev 10146) @@ -95,7 +95,7 @@ ControllerRequest request =3D factory.createRequest(wr); = // We must have one!!! - TCKPageNavigationalState tckPageState =3D (TCKPageNavigationalSta= te)request.getPageState(); + TCKPageNavigationalState tckPageNavigationalState =3D (TCKPageNav= igationalState)request.getPageNavigationalState(); = // ControllerResponse response =3D controller.process(context, reque= st); @@ -105,13 +105,13 @@ false, false, context.getStateControllerContext(), - request.getPageState()); + request.getPageNavigationalState()); = // Renderer renderer =3D rendererFactory.getRenderer(response); = // - renderer.render(new TCKRendererContext(context, tckPageState)); + renderer.render(new TCKRendererContext(context, tckPageNavigation= alState)); } else { @@ -140,13 +140,13 @@ throw new IllegalStateException("Portlets requested by TCK wer= e not found"); } = - TCKPageNavigationalState tckPageState =3D new TCKPageNavigational= State(context.getStateControllerContext().createPageState(false), involvedP= ortlets); + TCKPageNavigationalState tckPageNavigationalState =3D new TCKPage= NavigationalState(context.getStateControllerContext().createPageNavigationa= lState(false), involvedPortlets); = // - PageRenderer renderer =3D new PageRenderer(new ResponseProperties= (), tckPageState); + PageRenderer renderer =3D new PageRenderer(new ResponseProperties= (), tckPageNavigationalState); = // - renderer.render(new TCKRendererContext(context, tckPageState)); + renderer.render(new TCKRendererContext(context, tckPageNavigation= alState)); } } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/tck/TCKStateControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKStateControllerContext.java 2008-02-28 00:05:49 UTC (rev 10145) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKStateControllerContext.java 2008-02-28 00:17:07 UTC (rev 10146) @@ -41,18 +41,18 @@ this.defaultStateControllerContext =3D defaultStateControllerContext; } = - public PageNavigationalState clonePageState(PageNavigationalState pageS= tate, boolean modifiable) + public PageNavigationalState clonePageNavigationalState(PageNavigationa= lState pageNavigationalState, boolean modifiable) { - TCKPageNavigationalState tckPageState =3D (TCKPageNavigationalState)= pageState; + TCKPageNavigationalState tckPageNavigationalState =3D (TCKPageNaviga= tionalState)pageNavigationalState; = // return new TCKPageNavigationalState( - defaultStateControllerContext.clonePageState(tckPageState.default= State, modifiable), - new HashSet(tckPageState.involvedPortlets)); + defaultStateControllerContext.clonePageNavigationalState(tckPageN= avigationalState.defaultState, modifiable), + new HashSet(tckPageNavigationalState.involvedPortlets)); } = - public PageNavigationalState createPageState(boolean modifiable) + public PageNavigationalState createPageNavigationalState(boolean modifi= able) { - return new TCKPageNavigationalState(defaultStateControllerContext.cr= eatePageState(modifiable), new HashSet()); + return new TCKPageNavigationalState(defaultStateControllerContext.cr= eatePageNavigationalState(modifiable), new HashSet()); } } Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet= /controller/StateControllerContextTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/contr= oller/StateControllerContextTestCase.java 2008-02-28 00:05:49 UTC (rev 1014= 5) +++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/contr= oller/StateControllerContextTestCase.java 2008-02-28 00:17:07 UTC (rev 1014= 6) @@ -63,7 +63,7 @@ @Test public void testMarshalling1() { - PageNavigationalState pageNS =3D cc.createPageState(true); + PageNavigationalState pageNS =3D cc.createPageNavigationalState(true= ); assertMarshallable(pageNS); } = @@ -90,7 +90,7 @@ = private void test(StateString portletNavigationalState, Mode mode, Wind= owState windowState) { - PageNavigationalState pageNS =3D cc.createPageState(true); + PageNavigationalState pageNS =3D cc.createPageNavigationalState(true= ); pageNS.setWindowNavigationalState("foo", new WindowNavigationalState= (portletNavigationalState, mode, windowState)); assertMarshallable(pageNS); } @@ -127,7 +127,7 @@ throw new NotYetImplemented(); } = - public PortletInvocationContext createPortletInvocationContext(Strin= g windowId, PageNavigationalState pageState) + public PortletInvocationContext createPortletInvocationContext(Strin= g windowId, PageNavigationalState pageNavigationalState) { throw new NotYetImplemented(); } --===============5924705434139815564==-- From portal-commits at lists.jboss.org Wed Feb 27 19:18:59 2008 Content-Type: multipart/mixed; boundary="===============4725781181798269617==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10147 - modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/request. Date: Wed, 27 Feb 2008 19:18:59 -0500 Message-ID: --===============4725781181798269617== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-27 19:18:59 -0500 (Wed, 27 Feb 2008) New Revision: 10147 Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/impl/request/ControllerRequestParameterNames.java Log: minor upate to controller request parameter names Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/impl/request/ControllerRequestParameterNames.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/request/ControllerRequestParameterNames.java 2008-02-28 00= :17:07 UTC (rev 10146) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/request/ControllerRequestParameterNames.java 2008-02-28 00= :18:59 UTC (rev 10147) @@ -32,31 +32,44 @@ * The life cycle type of the invocation. The values accepted are ACTION_LIFECYCLE, * RENDER_LIFECYCLE and RESOURCE_LIFECYCLE. */ - public static final String LIFECYCLE_PHASE =3D "lifecycle"; + public static final String LIFECYCLE_PHASE =3D "phase"; + /** The window id. */ public static final String WINDOW_ID =3D "windowid"; + /** The portlet mode. */ public static final String MODE =3D "mode"; + /** The window state. */ public static final String WINDOW_STATE =3D "windowstate"; + /** The portlet navigational state for any type of lifecycle. */ public static final String NAVIGATIONAL_STATE =3D "navigationalstate"; + /** The portlet resource state for lifecycle of type RENDER_LIFEC= YCLE. */ public static final String RESOURCE_STATE =3D "resourcestate"; + /** The portlet interaction state for lifecycle of type ACTION_LI= FECYCLE. */ public static final String INTERACTION_STATE =3D "interactionstate"; + /** The page state for any kind of lifecycle. */ - public static final String PAGE_NAVIGATIONAL_STATE =3D "pageNavigationa= lState"; + public static final String PAGE_NAVIGATIONAL_STATE =3D "pagenavigationa= lstate"; + /** The public navigational state changes of a portlet for lifecycle of= type RENDER_LIFECYCLE. */ public static final String PUBLIC_NAVIGATIONAL_STATE_CHANGES =3D "publi= cnavigationalstatechanges"; + /** The resource id for lifecycle of type RESOURCE_LIFECYCLE. */ public static final String RESOURCE_ID =3D "resourceid"; - /** The resource cacheability for lifecycle of type RENDER_LIFECY= CLE. */ + + /** The resource cacheability for lifecycle of type RESOURCE_LIFE= CYCLE. */ public static final String RESOURCE_CACHEABILITY =3D "resourcecacheabil= ity"; + /** Denotes an action lifecycle operation. */ public static final String ACTION_PHASE =3D "action"; + /** Denotes a render lifecycle operation. */ public static final String RENDER_PHASE =3D "render"; + /** Denotes a resource lifecycle operation. */ public static final String RESOURCE_PHASE =3D "resource"; } --===============4725781181798269617==-- From portal-commits at lists.jboss.org Wed Feb 27 19:25:01 2008 Content-Type: multipart/mixed; boundary="===============6066676262716836163==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10148 - in modules/portlet/trunk/portlet/src: test/java/org/jboss/portal/test/portlet and 1 other directories. Date: Wed, 27 Feb 2008 19:25:00 -0500 Message-ID: --===============6066676262716836163== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-27 19:25:00 -0500 (Wed, 27 Feb 2008) New Revision: 10148 Removed: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/Pro= perties.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/PropertiesTestCase.java Modified: modules/portlet/trunk/portlet/src/test/resources/local-jboss-unit.xml Log: remove obsolete Properties class Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portl= et/Properties.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/Pr= operties.java 2008-02-28 00:18:59 UTC (rev 10147) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/Pr= operties.java 2008-02-28 00:25:00 UTC (rev 10148) @@ -1,173 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * A set of multi valued properties produced by a response. - * - * @author Julien Viet - * @version $Revision: 5448 $ - */ -public class Properties -{ - - private Map> content; - - public Properties() - { - } - - /** - * @param name the property name - * @param value the property value - * @throws IllegalArgumentException if name or value is null - */ - public void addProperty(String name, String value) - { - if (name =3D=3D null) - { - throw new IllegalArgumentException("Name cannot be null"); - } - if (value =3D=3D null) - { - throw new IllegalArgumentException("Value cannot be null"); - } - if (content =3D=3D null) - { - content =3D new HashMap>(); - } - - // - ArrayList values =3D content.get(name); - if (values =3D=3D null) - { - values =3D new ArrayList(); - content.put(name, values); - } - - // - values.add(value); - } - - /** - * @param name the property name - * @param value the property value - * @throws IllegalArgumentException if name or value is null - */ - public void setProperty(String name, String value) - { - if (name =3D=3D null) - { - throw new IllegalArgumentException("Name cannot be null"); - } - if (value =3D=3D null) - { - throw new IllegalArgumentException("Value cannot be null"); - } - if (content =3D=3D null) - { - content =3D new HashMap>(); - } - - // - ArrayList values =3D content.get(name); - if (values =3D=3D null) - { - values =3D new ArrayList(); - content.put(name, values); - } - else - { - values.clear(); - } - - // - values.add(value); - } - - /** Clear the properties. */ - public void clear() - { - if (content !=3D null) - { - content.clear(); - } - } - - public String getProperty(String name) - { - if (name =3D=3D null) - { - throw new IllegalArgumentException("Name cannot be null"); - } - if (content =3D=3D null) - { - return null; - } - - // - ArrayList values =3D content.get(name); - if (values =3D=3D null) - { - return null; - } - else - { - return values.get(0); - } - } - - /** - * @param name the property name - * @return the list of properties for the specified name or null if it = does not exist - * @throws IllegalArgumentException if name is null - */ - public List getProperties(String name) - { - if (name =3D=3D null) - { - throw new IllegalArgumentException("Name cannot be null"); - } - if (content =3D=3D null) - { - return null; - } - return content.get(name); - } - - public Set getPropertyNames() - { - if (content =3D=3D null) - { - return Collections.emptySet(); - } - return content.keySet(); - } -} Deleted: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/= portlet/PropertiesTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/PropertiesTestCase.java 2008-02-28 00:18:59 UTC (rev 10147) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/PropertiesTestCase.java 2008-02-28 00:25:00 UTC (rev 10148) @@ -1,119 +0,0 @@ -/*************************************************************************= ***** - * 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.portlet; - -import org.jboss.portal.common.util.Tools; -import org.jboss.portal.portlet.Properties; -import org.jboss.unit.api.pojo.annotations.Test; - -import static org.jboss.unit.api.Assert.*; - -/** - * @author Julien Viet - * @version $Revision: 5448 $ - */ -public class PropertiesTestCase -{ - - public PropertiesTestCase() - { - } - - @Test - public void testA() - { - Properties props =3D new Properties(); - props.setProperty("name1", "value1"); - - props.addProperty("name2", "value2"); - - props.setProperty("name3", "value3-1"); - props.addProperty("name3", "value3-2"); - - props.addProperty("name4", "value4-1"); - props.addProperty("name4", "value4-2"); - - props.setProperty("name5", "value5-1"); - props.setProperty("name5", "value5-2"); - - props.addProperty("name6", "value6-1"); - props.setProperty("name6", "value6-2"); - - assertEquals("value1", props.getProperty("name1")); - assertEquals(1, props.getProperties("name1").size()); - assertEquals("value1", props.getProperties("name1").get(0)); - - assertEquals("value2", props.getProperty("name2")); - assertEquals(1, props.getProperties("name2").size()); - assertEquals("value2", props.getProperties("name2").get(0)); - - assertEquals("value3-1", props.getProperty("name3")); - assertEquals(2, props.getProperties("name3").size()); - assertEquals("value3-1", props.getProperties("name3").get(0)); - assertEquals("value3-2", props.getProperties("name3").get(1)); - - assertEquals("value4-1", props.getProperty("name4")); - assertEquals(2, props.getProperties("name4").size()); - assertEquals("value4-1", props.getProperties("name4").get(0)); - assertEquals("value4-2", props.getProperties("name4").get(1)); - - assertEquals(1, props.getProperties("name5").size()); - assertEquals("value5-2", props.getProperties("name5").get(0)); - - assertEquals("value6-2", props.getProperty("name6")); - assertEquals(1, props.getProperties("name6").size()); - assertEquals("value6-2", props.getProperties("name6").get(0)); - - assertEquals(null, props.getProperties("not here")); - assertNull(props.getProperty("not here")); - assertEquals(Tools.toSet(new Object[]{"name1", "name2", "name3", "na= me4", "name5", "name6"}), props.getPropertyNames()); - - try - { - props.setProperty(null, "not null"); - fail("Expected IllegalArgumentException"); - } - catch (IllegalArgumentException e) - { - } - - try - { - props.setProperty("not null", null); - fail("Expected IllegalArgumentException"); - } - catch (IllegalArgumentException e) - { - } - - try - { - props.setProperty(null, null); - fail("Expected IllegalArgumentException"); - } - catch (IllegalArgumentException e) - { - } - } - -} Modified: modules/portlet/trunk/portlet/src/test/resources/local-jboss-unit= .xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/resources/local-jboss-unit.xml 2= 008-02-28 00:18:59 UTC (rev 10147) +++ modules/portlet/trunk/portlet/src/test/resources/local-jboss-unit.xml 2= 008-02-28 00:25:00 UTC (rev 10148) @@ -29,9 +29,6 @@ - - - --===============6066676262716836163==-- From portal-commits at lists.jboss.org Wed Feb 27 20:18:35 2008 Content-Type: multipart/mixed; boundary="===============8426496398722932703==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10149 - in modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet: impl/jsr168 and 2 other directories. Date: Wed, 27 Feb 2008 20:18:35 -0500 Message-ID: --===============8426496398722932703== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-27 20:18:35 -0500 (Wed, 27 Feb 2008) New Revision: 10149 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/cac= he/CacheControl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/ContentBuffer.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/CacheControlImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/MimeResponseImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/RenderResponseImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/inv= ocation/response/FragmentResponse.java Log: make FragmentResponse and CacheControl immutables Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/cache/CacheControl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/ca= che/CacheControl.java 2008-02-28 00:25:00 UTC (rev 10148) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/ca= che/CacheControl.java 2008-02-28 01:18:35 UTC (rev 10149) @@ -30,13 +30,13 @@ { = /** Number of seconds this result remains valid, a value of -1 indicate= s that it never expires. */ - private int expirationSecs; + private final int expirationSecs; = /** The cache scope for this fragment. */ - private CacheScope cacheScope; + private final CacheScope cacheScope; = /** The validation token. */ - private String validationToken; + private final String validationToken; = public CacheControl(int expirationSecs, CacheScope cacheScope, String v= alidationToken) { @@ -50,49 +50,13 @@ return expirationSecs; } = - public void setExpirationSecs(int expirationSecs) - { - this.expirationSecs =3D expirationSecs; - } - public CacheScope getCacheScope() { return cacheScope; } = - public void setCacheScope(CacheScope cacheScope) - { - this.cacheScope =3D cacheScope; - } - public String getValidationToken() { return validationToken; } - - public void setValidationToken(String validationToken) - { - this.validationToken =3D validationToken; - } - - public CacheControl unmodifiable() - { - return new CacheControl(expirationSecs, cacheScope, validationToken) - { - public void setCacheScope(CacheScope cacheScope) - { - throw new UnsupportedOperationException("Not modifiable"); - } - - public void setValidationToken(String token) - { - throw new UnsupportedOperationException("Not modifiable"); - } - - public void setExpirationSecs(int expirationSecs) - { - throw new UnsupportedOperationException("Not modifiable"); - } - }; - } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/ContentBuffer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/ContentBuffer.java 2008-02-28 00:25:00 UTC (rev 10148) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/ContentBuffer.java 2008-02-28 01:18:35 UTC (rev 10149) @@ -227,10 +227,6 @@ */ public void commit() throws IllegalStateException { -// if (contentType =3D=3D null) -// { -// throw new IllegalStateException("No content type defined"); -// } commited =3D true; } = Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/CacheControlImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/CacheControlImpl.java 2008-02-28 00:25:00 UTC (rev 10148) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/CacheControlImpl.java 2008-02-28 01:18:35 UTC (rev 10149) @@ -34,44 +34,53 @@ { = /** . */ - private org.jboss.portal.portlet.cache.CacheControl delegate; + private boolean useCachedContent; = /** . */ - private boolean useCachedContent; + private int expirationSecs; = - public CacheControlImpl(org.jboss.portal.portlet.cache.CacheControl del= egate) + /** . */ + private CacheScope cacheScope; + + /** . */ + private String validationToken; + + public CacheControlImpl(int expirationSecs, CacheScope cacheScope) { - this.delegate =3D delegate; + this.useCachedContent =3D false; + this.expirationSecs =3D expirationSecs; + this.cacheScope =3D cacheScope; + this.validationToken =3D null; } = public int getExpirationTime() { - return delegate.getExpirationSecs(); + return expirationSecs; } = public void setExpirationTime(int expirationTime) { - delegate.setExpirationSecs(expirationTime); + this.expirationSecs =3D expirationTime; } = public boolean isPublicScope() { - return delegate.getCacheScope() =3D=3D CacheScope.PUBLIC; + return cacheScope =3D=3D CacheScope.PUBLIC; } = public void setPublicScope(boolean publicScope) { - delegate.setCacheScope(publicScope ? CacheScope.PUBLIC : CacheScope.= PRIVATE); + cacheScope =3D publicScope ? CacheScope.PUBLIC : CacheScope.PRIVATE; } = public String getETag() { - return delegate.getValidationToken(); + return validationToken; } = public void setETag(String etag) { - delegate.setValidationToken(etag); + this.validationToken =3D etag; } = public boolean useCachedContent() Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/MimeResponseImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/MimeResponseImpl.java 2008-02-28 00:25:00 UTC (rev 10148) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/MimeResponseImpl.java 2008-02-28 01:18:35 UTC (rev 10149) @@ -29,6 +29,8 @@ import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.info.CacheInfo; import org.jboss.portal.portlet.cache.CacheScope; +import org.jboss.portal.portlet.impl.jsr168.ContentBuffer; +import org.jboss.portal.Mode; = import javax.portlet.MimeResponse; import javax.portlet.PortletURL; @@ -38,6 +40,7 @@ import java.io.IOException; import java.io.OutputStream; import java.util.Locale; +import java.util.Set; = /** * @author Julien Viet @@ -46,9 +49,6 @@ public abstract class MimeResponseImpl extends PortletResponseImpl impleme= nts MimeResponse { = - /** The fragment result. */ - protected FragmentResponse fragment; - /** Not really used but we need it to memorize what the client set opti= onally. */ protected int bufferSize; = @@ -58,82 +58,104 @@ /** . */ private boolean contentTypeSet; = + /** The title if any. */ + protected String responseTitle; + + /** . */ + private ContentBuffer responseContent; + + /** . */ + protected Set responseNextModes; + public MimeResponseImpl(PortletInvocation invocation, PortletRequestImp= l preq) { super(invocation, preq); = - // - FragmentResponse fragment =3D new FragmentResponse(); - // Configure expiration value PortletInfo info =3D preq.container.getInfo(); CacheInfo cacheInfo =3D info.getCache(); - org.jboss.portal.portlet.cache.CacheControl cc =3D new org.jboss.por= tal.portlet.cache.CacheControl( cacheInfo.getExpirationSecs(), CacheScope.PRIVATE, null ); = - // - fragment.setCacheControl(cc); - // 0 means no buffering - we say no buffering this.bufferSize =3D 0; - this.fragment =3D fragment; this.contentTypeSet =3D false; + this.responseContent =3D new ContentBuffer(); + this.responseTitle =3D null; + this.responseNextModes =3D null; } = public PortletInvocationResponse getResponse() { - if (cacheControl !=3D null && cacheControl.useCachedContent()) + org.jboss.portal.portlet.cache.CacheControl cc; + if (cacheControl !=3D null) { - return new RevalidateMarkupResponse(fragment.getCacheControl()); + cc =3D new org.jboss.portal.portlet.cache.CacheControl( + cacheControl.getExpirationTime(), + cacheControl.isPublicScope() ? CacheScope.PUBLIC : CacheScope.= PRIVATE, + cacheControl.getETag()); } else { - fragment.setProperties(getProperties(false)); - fragment.setAttributes(preq.attributes.getAttributeMap()); + PortletInfo info =3D preq.container.getInfo(); + CacheInfo cacheInfo =3D info.getCache(); + cc =3D new org.jboss.portal.portlet.cache.CacheControl(cacheInfo.= getExpirationSecs(), CacheScope.PRIVATE, null); + } = - // - return fragment; + // + if (cacheControl !=3D null && cacheControl.useCachedContent()) + { + return new RevalidateMarkupResponse(cc); } + else + { + return new FragmentResponse( + getProperties(false), + preq.attributes.getAttributeMap(), + responseContent, + responseTitle, + cc, + responseNextModes !=3D null ? responseNextModes : preq.support= edModes); + } } = public String getContentType() { - return contentTypeSet ? fragment.getContentType() : null; + return contentTypeSet ? responseContent.getContentType() : null; } = public void setContentType(String contentType) { - if (fragment.getContentType() =3D=3D null) + if (responseContent.getContentType() =3D=3D null) { - fragment.setContentType(contentType); + responseContent.setContentType(contentType); contentTypeSet =3D true; } } = public PrintWriter getWriter() throws IOException { - if (fragment.getContentType() =3D=3D null) + if (responseContent.getContentType() =3D=3D null) { - fragment.setContentType(preq.getResponseContentType()); + responseContent.setContentType(preq.getResponseContentType()); } = // - return fragment.getWriter(); + return responseContent.getWriter(); } = public OutputStream getPortletOutputStream() throws IOException { - if (fragment.getContentType() =3D=3D null) + if (responseContent.getContentType() =3D=3D null) { - fragment.setContentType(preq.getResponseContentType()); + responseContent.setContentType(preq.getResponseContentType()); } = // - return fragment.getOutputStream(); + return responseContent.getOutputStream(); } = public PortletURL createRenderURL() @@ -171,13 +193,13 @@ = public void flushBuffer() throws IOException { - fragment.getBuffer().commit(); + responseContent.commit(); } = public void resetBuffer() { // Clear the buffer - fragment.resetBuffer(); + responseContent.reset(); } = public void reset() @@ -193,7 +215,7 @@ = public boolean isCommitted() { - return fragment.getBuffer().isCommited(); + return responseContent.isCommited(); } = public ResourceURL createResourceURL() @@ -210,7 +232,7 @@ try { int expirationSecs =3D Integer.parseInt(value); - fragment.getCacheControl().setExpirationSecs(expirationSecs= ); + getCacheControl().setExpirationTime(expirationSecs); } catch (NumberFormatException e) { @@ -224,7 +246,7 @@ { if (value !=3D null) { - fragment.getCacheControl().setValidationToken(value); + getCacheControl().setETag(value); } } else if (MimeResponse.USE_CACHED_CONTENT.equals(key)) @@ -244,7 +266,9 @@ { if (cacheControl =3D=3D null) { - cacheControl =3D new CacheControlImpl(fragment.getCacheControl()); + PortletInfo info =3D preq.container.getInfo(); + CacheInfo cacheInfo =3D info.getCache(); + cacheControl =3D new CacheControlImpl(cacheInfo.getExpirationSecs= (), CacheScope.PRIVATE); } return cacheControl; } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/RenderResponseImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/RenderResponseImpl.java 2008-02-28 00:25:00 UTC (rev 10148) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/RenderResponseImpl.java 2008-02-28 01:18:35 UTC (rev 10149) @@ -50,25 +50,22 @@ super(invocation, preq); } = - /** . */ - private Set nextModes; - - public void setTitle(String s) + public void setTitle(String title) { - fragment.setTitle(s); + this.responseTitle =3D title; } = public void setNextPossiblePortletModes(Collection portlet= Modes) { if (portletModes !=3D null && portletModes.size() > 0) { - if (this.nextModes =3D=3D null) + if (responseNextModes =3D=3D null) { - nextModes =3D new LinkedHashSet(portletModes.size()); + responseNextModes =3D new LinkedHashSet(portletModes.siz= e()); } else { - nextModes.clear(); + responseNextModes.clear(); } = // @@ -81,7 +78,7 @@ // if (preq.supportedModes.contains(mode)) { - nextModes.add(mode); + responseNextModes.add(mode); } } else @@ -145,16 +142,4 @@ throw ex; } } - - public PortletInvocationResponse getResponse() - { - PortletInvocationResponse response =3D super.getResponse(); - if (response instanceof FragmentResponse) - { - FragmentResponse fragment =3D (FragmentResponse)response; - fragment.setNextModes(nextModes !=3D null ? nextModes : preq.supp= ortedModes); - } - return response; - } - } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/invocation/response/FragmentResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/FragmentResponse.java 2008-02-28 00:25:00 UTC (rev 10148) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/FragmentResponse.java 2008-02-28 01:18:35 UTC (rev 10149) @@ -52,31 +52,31 @@ public static final int TYPE_BYTES =3D ContentBuffer.TYPE_BYTES; = /** . */ - private ResponseProperties properties; + private final ResponseProperties properties; = /** . */ - private Map attributes; + private final Map attributes; = /** . */ - private ContentBuffer buffer; + private final ContentBuffer buffer; = /** The title if any. */ - private String title; + private final String title; = /** . */ - private CacheControl cacheControl; + private final CacheControl cacheControl; = /** . */ - private Set nextModes; + private final Set nextModes; = - public FragmentResponse() + public FragmentResponse(ResponseProperties properties, Map attributes, ContentBuffer buffer, String title, CacheControl cacheContr= ol, Set nextModes) { - this.buffer =3D new ContentBuffer(); - this.title =3D null; - this.cacheControl =3D null; - this.properties =3D null; - this.nextModes =3D null; - this.attributes =3D null; + this.properties =3D properties; + this.attributes =3D attributes; + this.buffer =3D buffer; + this.title =3D title; + this.cacheControl =3D cacheControl; + this.nextModes =3D nextModes; } = public ResponseProperties getProperties() @@ -84,31 +84,16 @@ return properties; } = - public void setProperties(ResponseProperties properties) - { - this.properties =3D properties; - } - public CacheControl getCacheControl() { return cacheControl; } = - public void setCacheControl(CacheControl cacheControl) - { - this.cacheControl =3D cacheControl; - } - public Map getAttributes() { return attributes; } = - public void setAttributes(Map attributes) - { - this.attributes =3D attributes; - } - public int getType() { return buffer.getType(); @@ -147,16 +132,6 @@ } = /** - * Set the fragment title. - * - * @param title the new title - */ - public void setTitle(String title) - { - this.title =3D title; - } - - /** * Return the content type of the generated fragment. * * @return the content type @@ -167,16 +142,6 @@ } = /** - * Set the fragment of the content type. - * - * @param contentType the content type - */ - public void setContentType(String contentType) - { - buffer.setContentType(contentType); - } - - /** * Returns the writer. * * @return the writer @@ -196,11 +161,6 @@ return buffer.getOutputStream(); } = - public void resetBuffer() - { - buffer.reset(); - } - public ContentBuffer getBuffer() { return buffer; @@ -210,9 +170,4 @@ { return nextModes; } - - public void setNextModes(Set nextModes) - { - this.nextModes =3D nextModes; - } } --===============8426496398722932703==-- From portal-commits at lists.jboss.org Thu Feb 28 05:15:39 2008 Content-Type: multipart/mixed; boundary="===============5056302065697869665==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10150 - in branches/presentation: core-presentation/src/main/org/jboss/portal/core/presentation/server and 6 other directories. Date: Thu, 28 Feb 2008 05:15:38 -0500 Message-ID: --===============5056302065697869665== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sohil.shah(a)jboss.com Date: 2008-02-28 05:15:38 -0500 (Thu, 28 Feb 2008) New Revision: 10150 Added: branches/presentation/presentation/src/main/org/jboss/portal/presentatio= n/test/portal/ branches/presentation/presentation/src/main/org/jboss/portal/presentatio= n/test/portal/MockContext.java branches/presentation/presentation/src/main/org/jboss/portal/presentatio= n/test/portal/MockInstance.java branches/presentation/presentation/src/main/org/jboss/portal/presentatio= n/test/portal/MockPage.java branches/presentation/presentation/src/main/org/jboss/portal/presentatio= n/test/portal/MockPortal.java branches/presentation/presentation/src/main/org/jboss/portal/presentatio= n/test/portal/MockPortalObject.java branches/presentation/presentation/src/main/org/jboss/portal/presentatio= n/test/portal/MockPortalServer.java branches/presentation/presentation/src/main/org/jboss/portal/presentatio= n/test/portal/MockPortlet.java branches/presentation/presentation/src/main/org/jboss/portal/presentatio= n/test/portal/MockWindow.java branches/presentation/presentation/src/main/org/jboss/portal/presentatio= n/test/portal/plugin/ branches/presentation/presentation/src/main/org/jboss/portal/presentatio= n/test/portal/plugin/MainProcessor.java branches/presentation/presentation/src/main/org/jboss/portal/presentatio= n/test/portal/plugin/PresentationServerImpl.java branches/presentation/presentation/src/main/org/jboss/portal/presentatio= n/test/portal/plugin/StructuralObjectImpl.java branches/presentation/presentation/src/main/org/jboss/portal/presentatio= n/test/portal/plugin/StructuralStateContextImpl.java branches/presentation/presentation/src/main/org/jboss/portal/presentatio= n/test/portal/plugin/StructuralStateImpl.java Modified: branches/presentation/core-presentation/build.xml branches/presentation/core-presentation/src/main/org/jboss/portal/core/p= resentation/server/MainProcessor.java branches/presentation/core-presentation/src/resources/presentation-sar/M= ETA-INF/jboss-service.xml branches/presentation/presentation/build.xml branches/presentation/presentation/src/main/org/jboss/portal/presentatio= n/test/ajax/JBossUnitSandBox.java Log: testsuite - Integrating PF with a Mock Portal Server to be used in the test= suite Modified: branches/presentation/core-presentation/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/presentation/core-presentation/build.xml 2008-02-28 01:18:35 U= TC (rev 10149) +++ branches/presentation/core-presentation/build.xml 2008-02-28 10:15:38 U= TC (rev 10150) @@ -168,6 +168,8 @@ + + Modified: branches/presentation/core-presentation/src/main/org/jboss/portal= /core/presentation/server/MainProcessor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/presentation/core-presentation/src/main/org/jboss/portal/core/= presentation/server/MainProcessor.java 2008-02-28 01:18:35 UTC (rev 10149) +++ branches/presentation/core-presentation/src/main/org/jboss/portal/core/= presentation/server/MainProcessor.java 2008-02-28 10:15:38 UTC (rev 10150) @@ -188,7 +188,7 @@ = decoder.decode(getActivation.getQueryParameters(), formParamet= ers); = - // We assume that for now + //TODO: We assume that for now UIWindow uiWindow =3D (UIWindow)presentationContext.getUIConte= xt().getObject(id); = // Modified: branches/presentation/core-presentation/src/resources/presentatio= n-sar/META-INF/jboss-service.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/presentation/core-presentation/src/resources/presentation-sar/= META-INF/jboss-service.xml 2008-02-28 01:18:35 UTC (rev 10149) +++ branches/presentation/core-presentation/src/resources/presentation-sar/= META-INF/jboss-service.xml 2008-02-28 10:15:38 UTC (rev 10150) @@ -23,7 +23,6 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~--> = - portal:service=3DController,type=3DAjax/= Presentation + = + + + portal:container=3DPortalObject + portal:container=3DPortalObject + portal:service=3DPageService + portal:commandFactory=3DDefaultPortal + portal:urlFactory=3DDelegating + portal:service=3DInterceptorStackFactory,type=3DCommand + portal:container=3DInstance + portal:service=3DPortalAuthorizationManagerFactory + portal:service=3DCustomizationManager + portal:service=3DContentProviderRegistry + portal:service=3DResponseHandler,type=3DSelector + portal:service=3DControlPolicy,type=3DPage + = + - portal:container=3DPortalObject - portal:container=3DPortalObject - portal:service=3DPageService - portal:commandFactory=3DDefaultPortal - portal:urlFactory=3DDelegating - portal:service=3DInterceptorStackFactory,type=3DCommand - portal:container=3DInstance - portal:service=3DPortalAuthorizationManagerFactory - portal:service=3DCustomizationManager - portal:service=3DContentProviderRegistry - portal:service=3DResponseHandler,type=3DSelector - portal:service=3DControlPolicy,type=3DPage + portal:service=3DProcessor = - + + = + Modified: branches/presentation/presentation/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/presentation/presentation/build.xml 2008-02-28 01:18:35 UTC (r= ev 10149) +++ branches/presentation/presentation/build.xml 2008-02-28 10:15:38 UTC (r= ev 10150) @@ -243,8 +243,7 @@ - --> - = + --> = = = @@ -257,7 +256,9 @@ - = + = + = + = @@ -327,11 +328,17 @@ = - + = + + + + + + = - + Modified: branches/presentation/presentation/src/main/org/jboss/portal/pres= entation/test/ajax/JBossUnitSandBox.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/ajax/JBossUnitSandBox.java 2008-02-28 01:18:35 UTC (rev 10149) +++ branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/ajax/JBossUnitSandBox.java 2008-02-28 10:15:38 UTC (rev 10150) @@ -23,7 +23,9 @@ package org.jboss.portal.presentation.test.ajax; = import org.jboss.unit.api.pojo.annotations.Test; +import static org.jboss.unit.api.Assert.*; = + /** * @author Sohil Shah * @@ -33,6 +35,6 @@ @Test public void test() { - System.out.println("Simple JBossUnit Test in the PresentationFramework s= uccessfully executed...."); + fail("Simple JBossUnit Test in the PresentationFramework successfully ex= ecuted...."); } } Added: branches/presentation/presentation/src/main/org/jboss/portal/present= ation/test/portal/MockContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/MockContext.java (rev 0) +++ branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/MockContext.java 2008-02-28 10:15:38 UTC (rev 10150) @@ -0,0 +1,55 @@ +/*************************************************************************= ***** + * 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.presentation.test.portal; + +import java.util.List; + +/** + * @author Sohil Shah + * + */ +public class MockContext extends MockPortalObject = +{ + /** + * = + */ + private List portals =3D null; + = + /** + * = + * @param id + */ + public MockContext(String id, List portals) + { + super(id); + this.portals =3D portals; + } + = + /** + * = + */ + public List getChildren() + { + return this.portals; + } +} Added: branches/presentation/presentation/src/main/org/jboss/portal/present= ation/test/portal/MockInstance.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/MockInstance.java (rev 0) +++ branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/MockInstance.java 2008-02-28 10:15:38 UTC (rev 10150) @@ -0,0 +1,44 @@ +/*************************************************************************= ***** + * 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.presentation.test.portal; + +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; + +/** + * @author Sohil Shah + * + */ +public class MockInstance = +{ + /** + * Invoke the instance + * + * @param invocation the invocation + */ + public PortletInvocationResponse invoke(PortletInvocation invocation) thr= ows PortletInvokerException + { + return null; + } = +} Added: branches/presentation/presentation/src/main/org/jboss/portal/present= ation/test/portal/MockPage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/MockPage.java (rev 0) +++ branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/MockPage.java 2008-02-28 10:15:38 UTC (rev 10150) @@ -0,0 +1,74 @@ +/*************************************************************************= ***** + * 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.presentation.test.portal; + +import java.util.List; + +/** + * @author Sohil Shah + * + */ +public class MockPage extends MockPortalObject = +{ + /** + * = + */ + private List windows =3D null; + = + /** + * = + * @param id + * @param windows + */ + public MockPage(String id, List windows) + { + super(id); + this.windows =3D windows; + } + + /** + * = + * @return + */ + public List getWindows() = + { + return windows; + } + + /** + * = + * @param windows + */ + public void setWindows(List windows) = + { + this.windows =3D windows; + } = + = + /** + * = + */ + public List getChildren() + { + return this.windows; + } +} Added: branches/presentation/presentation/src/main/org/jboss/portal/present= ation/test/portal/MockPortal.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/MockPortal.java (rev 0) +++ branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/MockPortal.java 2008-02-28 10:15:38 UTC (rev 10150) @@ -0,0 +1,55 @@ +/*************************************************************************= ***** + * 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.presentation.test.portal; + +import java.util.List; + +/** + * @author Sohil Shah + * + */ +public class MockPortal extends MockPortalObject = +{ + /** + * = + */ + private List pages =3D null; + = + /** + * = + * @param id + */ + public MockPortal(String id, List pages) + { + super(id); + this.pages =3D pages; + } + = + /** + * = + */ + public List getChildren() + { + return this.pages; + } +} Added: branches/presentation/presentation/src/main/org/jboss/portal/present= ation/test/portal/MockPortalObject.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/MockPortalObject.java (rev 0) +++ branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/MockPortalObject.java 2008-02-28 10:15:38 UTC (rev 10150) @@ -0,0 +1,60 @@ +/*************************************************************************= ***** + * 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.presentation.test.portal; + +import java.util.List; + +/** + * @author Sohil Shah + * + */ +public abstract class MockPortalObject = +{ + /** + * = + */ + protected String id =3D null; + = + /** + * = + * @param id + */ + public MockPortalObject(String id) + { + this.id =3D id; + } + = + /** + * = + * @return + */ + public String getId() + { + return this.id; + } + = + /** + * = + */ + public abstract List getChildren(); +} Added: branches/presentation/presentation/src/main/org/jboss/portal/present= ation/test/portal/MockPortalServer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/MockPortalServer.java (rev 0) +++ branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/MockPortalServer.java 2008-02-28 10:15:38 UTC (rev 10150) @@ -0,0 +1,136 @@ +/*************************************************************************= ***** + * 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.presentation.test.portal; + +import java.util.Map; +import java.util.List; +import java.util.HashMap; +import java.util.ArrayList; + +/** + * @author Sohil Shah + * + */ +public class MockPortalServer = +{ + /** + * = + */ + private static MockPortalServer singleton =3D null; + = + /** + * = + */ + private Map instances =3D null; + = + /** + * = + * + */ + private MockPortalServer() + { + //load up the MockPortal instances + this.instances =3D new HashMap(); + = + //Create 3 MockPortlets + MockPortlet portlet1 =3D new MockPortlet("
            Portlet 1:
            "); + MockPortlet portlet2 =3D new MockPortlet("
            Portlet 2:
            "); + MockPortlet portlet3 =3D new MockPortlet("
            Portlet 3:
            "); + = + MockWindow window1 =3D new MockWindow("default/default/window1",portlet1= ); + MockWindow window2 =3D new MockWindow("default/default/window2",portlet2= ); + MockWindow window3 =3D new MockWindow("default/default/window3",portlet3= ); + = + List windows =3D new ArrayList(); + windows.add(window1); + windows.add(window2); + windows.add(window3); + = + MockPage page1 =3D new MockPage("default/default", windows); + = + List pages =3D new ArrayList(); + pages.add(page1); + = + MockPortal mockPortal =3D new MockPortal("default", pages); + = + List portals =3D new ArrayList(); + portals.add(mockPortal); + = + MockContext mockContext =3D new MockContext("/", portals); + = + this.instances.put("/", mockContext); + this.instances.put("default", mockPortal); + this.instances.put("default/default", page1); + this.instances.put("default/default/window1", window1); + this.instances.put("default/default/window2", window2); + this.instances.put("default/default/window3", window3); + } + = + /** + * = + * @return + */ + public static MockPortalServer getInstance() + { + if(MockPortalServer.singleton =3D=3D null) + { + MockPortalServer.singleton =3D new MockPortalServer(); + } + return MockPortalServer.singleton; + } = + = + /** + * = + * @param id + * @return + */ + public MockPortalObject getPortalObject(String id) + { + MockPortalObject portalObject =3D null; + = + if(!id.equals("/") && id.startsWith("/")) + { + id =3D id.substring(1); + } + = + portalObject =3D (MockPortalObject)this.instances.get(id); + = + return portalObject; + } + = + /** + * = + * @param id + */ + public void invoke(String id, Map queryParameters) + { + String[] action =3D (String[])queryParameters.get("action"); + = + MockWindow window =3D (MockWindow)this.getPortalObject(id); + = + if(action !=3D null && action[0].equals("2")) + { + window.getPortlet().processAction(); + } + } = +} Added: branches/presentation/presentation/src/main/org/jboss/portal/present= ation/test/portal/MockPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/MockPortlet.java (rev 0) +++ branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/MockPortlet.java 2008-02-28 10:15:38 UTC (rev 10150) @@ -0,0 +1,77 @@ +/*************************************************************************= ***** + * 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.presentation.test.portal; + +/** + * @author Sohil Shah + * + */ +public class MockPortlet = +{ + /** + * = + */ + private String content =3D null; + private boolean actionActivated =3D false; + = + /** + * = + * + */ + public MockPortlet(String content) + { + this.content =3D content; + } + = + /** + * = + * + */ + public void processAction() + { + this.content +=3D ""; + this.actionActivated =3D true; + } + = + /** + * = + * + */ + public void doView() + { + if(!actionActivated) + { + this.content +=3D ""; + } + actionActivated =3D false; + } = + = + /** + * = + * @return + */ + public String getContent() + { + return this.content; + } +} Added: branches/presentation/presentation/src/main/org/jboss/portal/present= ation/test/portal/MockWindow.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/MockWindow.java (rev 0) +++ branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/MockWindow.java 2008-02-28 10:15:38 UTC (rev 10150) @@ -0,0 +1,84 @@ +/*************************************************************************= ***** + * 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.presentation.test.portal; + +import java.util.List; + +/** + * @author Sohil Shah + * + */ +public class MockWindow extends MockPortalObject +{ + /** + * = + */ + private MockPortlet portlet =3D null; + = + /** + * = + * @param id + * @param portlet + */ + public MockWindow(String id, MockPortlet portlet) + { + super(id); + this.portlet =3D portlet; + } + + /** + * = + * @return + */ + public MockPortlet getPortlet() = + { + return portlet; + } + + /** + * = + * @param portlet + */ + public void setPortlet(MockPortlet portlet) = + { + this.portlet =3D portlet; + } + = + /** + * = + */ + public List getChildren() + { + return null; + } + = + /** + * = + * @return + */ + public String getMarkup() + { + this.portlet.doView(); + return this.portlet.getContent(); + } +} Added: branches/presentation/presentation/src/main/org/jboss/portal/present= ation/test/portal/plugin/MainProcessor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/plugin/MainProcessor.java (rev 0) +++ branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/plugin/MainProcessor.java 2008-02-28 10:15:38 UTC (rev 10150) @@ -0,0 +1,122 @@ +/*************************************************************************= ***** + * 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.presentation.test.portal.plugin; + +import org.apache.log4j.Logger; + +import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.impl.PortletRequestDecoder; + +import org.jboss.portal.web.Body; + +import org.jboss.portal.server.ServerException; + +import org.jboss.portal.presentation.server.Processor; +import org.jboss.portal.presentation.server.ProcessorRequest; +import org.jboss.portal.presentation.server.ProcessorResponse; + +import org.jboss.portal.presentation.client.PresentationContext; + +import org.jboss.portal.presentation.model.StateType; +import org.jboss.portal.presentation.model.UIWindow; + +import org.jboss.portal.presentation.protocol.LinkActivation; +import org.jboss.portal.presentation.protocol.PostActivation; +import org.jboss.portal.presentation.protocol.ServerAction; +import org.jboss.portal.presentation.protocol.ServerResponse; +import org.jboss.portal.presentation.protocol.ShowUIObjectResponse; +import org.jboss.portal.presentation.protocol.ViewUIObjectAction; + +import org.jboss.portal.presentation.test.portal.MockPortalServer; + + +import java.util.Map; + +/** + * @author Sohil Shah + * + */ +public class MainProcessor implements Processor +{ + + /** . */ + private static Logger log =3D Logger.getLogger(MainProcessor.class); + + /** + * = + */ + public ProcessorResponse process(PresentationContext presentationContex= t, ProcessorRequest request) throws ServerException + { = + try + { = + = + ServerAction serverAction =3D request.getAction(); + + ServerResponse response =3D null; + + if(serverAction instanceof ViewUIObjectAction) + { + ViewUIObjectAction viewAction =3D (ViewUIObjectAction)serverAc= tion; + response =3D new ShowUIObjectResponse(viewAction.getTargetId()= ); + } + else if (serverAction instanceof LinkActivation) + { + LinkActivation getActivation =3D (LinkActivation)serverAction; + String id =3D getActivation.getTargetId(); + PortletRequestDecoder decoder =3D new PortletRequestDecoder(); + + // Get form parameters if any + Map formParameters =3D null; + if (serverAction instanceof PostActivation) + { + PostActivation post =3D (PostActivation)serverAction; + Body body =3D post.getBody(); + if (body instanceof Body.Form) + { + formParameters =3D ((Body.Form)body).getParameters(); + } + } + + decoder.decode(getActivation.getQueryParameters(), formParamet= ers); + StateString contentState =3D decoder.getNavigationalState(); + + //TODO: We assume that for now + UIWindow uiWindow =3D (UIWindow)presentationContext.getUIConte= xt().getObject(id); + = + = + //Make an invocation on the Mock Portal Server + MockPortalServer.getInstance().invoke(id, getActivation.getQue= ryParameters()); + + // It means we went through a successful action or it is a ren= der + uiWindow.setProperty(StateType.NAVIGATIONAL, "content", conten= tState); + response =3D new ShowUIObjectResponse(uiWindow.getParent().get= Id()); + } + = + return new ProcessorResponse(response); + } + catch(Exception e) + { + throw new ServerException(e); + } + } = +} Added: branches/presentation/presentation/src/main/org/jboss/portal/present= ation/test/portal/plugin/PresentationServerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/plugin/PresentationServerImpl.java (= rev 0) +++ branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/plugin/PresentationServerImpl.java 2008-02-28 10:15:38 UTC (= rev 10150) @@ -0,0 +1,122 @@ +/*************************************************************************= ***** + * 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.presentation.test.portal.plugin; + +import org.jboss.portal.presentation.client.PresentationContext; +import org.jboss.portal.presentation.server.Processor; +import org.jboss.portal.presentation.server.PresentationServer; +import org.jboss.portal.presentation.model.UIWindow; +import org.jboss.portal.presentation.model.content.WindowContent; +import org.jboss.portal.presentation.model.state.structural.StructuralStat= eContext; + +import org.jboss.portal.presentation.test.portal.MockPortalServer; +import org.jboss.portal.presentation.test.portal.MockWindow; + +/** + * @author Sohil Shah + * + */ +public class PresentationServerImpl implements PresentationServer +{ + + /** + * = + */ + private Processor processor; + = + /** + * = + */ + private StructuralStateContext structuralStateContext; + = + = + /** + * = + * + */ + public PresentationServerImpl() + { + = + } + = + /** + * = + * + */ + public void start() + { + this.structuralStateContext =3D new StructuralStateContextImpl(); + } + = + /** + * = + * + */ + public void stop() + { + = + } + = + /** + * = + */ + public StructuralStateContext getStructuralStateManager() + { + return structuralStateContext; + } + + /** + * = + * @param structuralStateContext + */ + public void setModelLoader(StructuralStateContext structuralStateContex= t) + { + this.structuralStateContext =3D structuralStateContext; + } + + /** + * = + */ + public Processor getProcessor() + { + return this.processor; + } + = + /** + * = + * @param processor + */ + public void setProcessor(Processor processor) + { + this.processor =3D processor; + } = + + /** + * = + */ + public WindowContent render(PresentationContext context, UIWindow uiwin= dow) throws Exception + { = + MockWindow window =3D (MockWindow)MockPortalServer.getInstance().getPor= talObject(uiwindow.getId()); + return new WindowContent(-1, "Blah:", window.getMarkup()); + } +} Added: branches/presentation/presentation/src/main/org/jboss/portal/present= ation/test/portal/plugin/StructuralObjectImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/plugin/StructuralObjectImpl.java (re= v 0) +++ branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/plugin/StructuralObjectImpl.java 2008-02-28 10:15:38 UTC (re= v 10150) @@ -0,0 +1,63 @@ +/*************************************************************************= ***** + * 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.presentation.test.portal.plugin; + +import org.jboss.portal.presentation.model.state.structural.StructuralObje= ct; +import org.jboss.portal.presentation.model.state.structural.StructuralStat= e; + +import org.jboss.portal.presentation.test.portal.MockPortalObject; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class StructuralObjectImpl implements StructuralObject +{ + + /** . */ + private final String id; + + /** . */ + private final StructuralStateImpl state; + + public StructuralObjectImpl(MockPortalObject portalObject) + { + this.id =3D portalObject.getId(); + this.state =3D new StructuralStateImpl(portalObject); + } + + public String getId() + { + return id; + } + + public StructuralState getState() + { + return state; + } + + public boolean compareTo(StructuralObject other) + { = + return true; + } +} Added: branches/presentation/presentation/src/main/org/jboss/portal/present= ation/test/portal/plugin/StructuralStateContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/plugin/StructuralStateContextImpl.java = (rev 0) +++ branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/test/portal/plugin/StructuralStateContextImpl.java 2008-02-28 10:15:38 U= TC (rev 10150) @@ -0,0 +1,168 @@ +/*************************************************************************= ***** + * 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.presentation.test.portal.plugin; + + +import org.jboss.portal.presentation.model.state.StateException; +import org.jboss.portal.presentation.model.state.structural.AbstractStruct= uralStateContext; +import org.jboss.portal.presentation.model.state.structural.StructuralObje= ct; +import org.jboss.portal.common.NotYetImplemented; + +import org.jboss.portal.presentation.test.portal.MockPortalServer; +import org.jboss.portal.presentation.test.portal.MockPortalObject; + +import java.util.Collection; +import java.util.List; +import java.util.ArrayList; + +/** + * @author Sohil Shah + * + */ +public class StructuralStateContextImpl extends AbstractStructuralStateCon= text +{ + /** + * = + */ + public String getRootId() + { + return "/"; + } + + /** + * The implementation only validate that an object is present. + */ + public void validate(StructuralObject object) throws IllegalArgumentExc= eption, StateException + { + = + } + + /** + * = + */ + public StructuralObject.Refresh refresh(StructuralObject object) throws= IllegalArgumentException, StateException + { + throw new NotYetImplemented(); + } + + /** + * = + */ + public StructuralObject load(String objectId) throws IllegalArgumentExc= eption + { + StructuralObject cour =3D null; + = + MockPortalObject portalObject =3D MockPortalServer.getInstance().getPor= talObject(objectId); + if(portalObject !=3D null) + { + cour =3D new StructuralObjectImpl(portalObject); + } + = + return cour; + } + + /** + * = + */ + public Collection loadChildren(StructuralObject paren= t) + { + Collection children =3D null; + = + MockPortalObject parentPortalObject =3D MockPortalServer.getInstance= ().getPortalObject(parent.getId()); + List cour =3D parentPortalObject.getChildren(); + = + if(cour !=3D null) + { + children =3D new ArrayList(); + for(int i=3D0; iJulien Viet + * @version $Revision: 630 $ + */ +public class StructuralStateImpl implements StructuralState +{ + + /** . */ + private Class type; + + /** . */ + private String name; + + /** . */ + private Map properties; + + StructuralStateImpl(MockPortalObject portalObject) + { + type =3D this.getType(portalObject); + this.name =3D portalObject.getId(); + } + + public Class getType() + { + return type; + } + + public String getName() + { + return name; + } + + public Map getProperties() + { + return properties; + } + + /** + * + * @param portalObject + * @return + */ + private Class getType(MockPortalObject portalObject) + { + Class type =3D null; + + if(portalObject instanceof MockContext) + { + type =3D UIContext.class; + } + else if(portalObject instanceof MockPortal) + { + type =3D UIPortal.class; + } + else if(portalObject instanceof MockPage) + { + type =3D UIPage.class; + } + else if(portalObject instanceof MockWindow) + { + type =3D UIWindow.class; + } + + return type; + } +} --===============5056302065697869665==-- From portal-commits at lists.jboss.org Thu Feb 28 06:57:23 2008 Content-Type: multipart/mixed; boundary="===============6742493991820796581==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10151 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api and 4 other directories. Date: Thu, 28 Feb 2008 06:57:23 -0500 Message-ID: --===============6742493991820796581== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-28 06:57:23 -0500 (Thu, 28 Feb 2008) New Revision: 10151 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/ContentBuffer.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/MimeResponseImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/inv= ocation/response/FragmentResponse.java modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portle= t/ContentBufferTestCase.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/ResourceRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/SimpleFragmentRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java Log: refactor to remove the dependency of FragmentResponse over ContentBuffer Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/ContentBuffer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/ContentBuffer.java 2008-02-28 10:15:38 UTC (rev 10150) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/ContentBuffer.java 2008-02-28 11:57:23 UTC (rev 10151) @@ -38,15 +38,6 @@ public class ContentBuffer { = - /** . */ - public static final int TYPE_EMPTY =3D 0; - - /** . */ - public static final int TYPE_CHARS =3D 1; - - /** . */ - public static final int TYPE_BYTES =3D 2; - /** The output as a bytes if any. */ private ClosableOutputStream bytes; = @@ -71,70 +62,38 @@ this.commited =3D false; } = - public int getType() - { - if (bytes =3D=3D null) - { - if (chars =3D=3D null) - { - return TYPE_EMPTY; - } - else - { - return TYPE_CHARS; - } - } - else - { - return TYPE_BYTES; - } - } - /** - * Return the content as a string. + * Return the bytes of the content held by the fragment or null. * - * @return the content - */ - public String getContent() - { - switch (getType()) - { - case TYPE_CHARS: - return getChars().toString(); - case TYPE_BYTES: - return getBytes().toString(); - } - return ""; - } - - /** - * Return the bytes of the content held by the fragment. - * * @return the bytes - * @throws IllegalArgumentException if the type is not bytes */ - public ByteArrayOutputStream getBytes() throws IllegalArgumentException + public byte[] getBytes() { if (bytes =3D=3D null) { - throw new IllegalStateException("Bytes not used"); + return null; } - return (ByteArrayOutputStream)bytes.out; + else + { + return ((ByteArrayOutputStream)bytes.out).toByteArray(); + } } = /** - * Return the chars of the content held by the fragment. + * Return the chars of the content held by the fragment or null. * * @return the chars - * @throws IllegalArgumentException if the type is not chars */ - public StringWriter getChars() throws IllegalArgumentException + public String getChars() = { if (chars =3D=3D null) { - throw new IllegalStateException("Chars not used"); + return null; } - return (StringWriter)chars.writer; + else + { + return chars.writer.toString(); + } } = /** Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/MimeResponseImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/MimeResponseImpl.java 2008-02-28 10:15:38 UTC (rev 10150) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/MimeResponseImpl.java 2008-02-28 11:57:23 UTC (rev 10151) @@ -115,7 +115,9 @@ return new FragmentResponse( getProperties(false), preq.attributes.getAttributeMap(), - responseContent, + responseContent.getContentType(), + responseContent.getBytes(), + responseContent.getChars(), responseTitle, cc, responseNextModes !=3D null ? responseNextModes : preq.support= edModes); Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/invocation/response/FragmentResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/FragmentResponse.java 2008-02-28 10:15:38 UTC (rev 10150) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/FragmentResponse.java 2008-02-28 11:57:23 UTC (rev 10151) @@ -23,13 +23,8 @@ package org.jboss.portal.portlet.invocation.response; = import org.jboss.portal.portlet.cache.CacheControl; -import org.jboss.portal.portlet.impl.jsr168.ContentBuffer; import org.jboss.portal.Mode; = -import java.io.ByteArrayOutputStream; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.io.StringWriter; import java.util.Set; import java.util.Map; = @@ -43,13 +38,13 @@ { = /** . */ - public static final int TYPE_EMPTY =3D ContentBuffer.TYPE_EMPTY; + public static final int TYPE_EMPTY =3D 0; = /** . */ - public static final int TYPE_CHARS =3D ContentBuffer.TYPE_CHARS; + public static final int TYPE_CHARS =3D 1; = /** . */ - public static final int TYPE_BYTES =3D ContentBuffer.TYPE_BYTES; + public static final int TYPE_BYTES =3D 2; = /** . */ private final ResponseProperties properties; @@ -57,9 +52,15 @@ /** . */ private final Map attributes; = + /** The result content type if any. */ + private String contentType; + /** . */ - private final ContentBuffer buffer; + private final byte[] bytes; = + /** . */ + private final String chars; + /** The title if any. */ private final String title; = @@ -69,11 +70,21 @@ /** . */ private final Set nextModes; = - public FragmentResponse(ResponseProperties properties, Map attributes, ContentBuffer buffer, String title, CacheControl cacheContr= ol, Set nextModes) + public FragmentResponse( + ResponseProperties properties, + Map attributes, + String contentType, + byte[] bytes, + String chars, + String title, + CacheControl cacheControl, + Set nextModes) { this.properties =3D properties; this.attributes =3D attributes; - this.buffer =3D buffer; + this.contentType =3D contentType; + this.bytes =3D bytes; + this.chars =3D chars; this.title =3D title; this.cacheControl =3D cacheControl; this.nextModes =3D nextModes; @@ -96,18 +107,52 @@ = public int getType() { - return buffer.getType(); + if (bytes =3D=3D null) + { + if (chars =3D=3D null) + { + return TYPE_EMPTY; + } + else + { + return TYPE_CHARS; + } + } + else + { + return TYPE_BYTES; + } } = /** + * Return the content as a string. + * + * @return the content + */ + public String getContent() + { + switch (getType()) + { + case TYPE_CHARS: + return getChars(); + case TYPE_BYTES: + return new String(bytes); + case TYPE_EMPTY: + return ""; + default: + throw new AssertionError(); + } + } + + /** * Return the bytes of the content held by the fragment. * * @return the bytes * @throws IllegalArgumentException if the type is not bytes */ - public ByteArrayOutputStream getBytes() throws IllegalArgumentException + public byte[] getBytes() throws IllegalArgumentException { - return buffer.getBytes(); + return bytes; } = /** @@ -116,9 +161,9 @@ * @return the chars * @throws IllegalArgumentException if the type is not chars */ - public StringWriter getChars() throws IllegalArgumentException + public String getChars() throws IllegalArgumentException { - return buffer.getChars(); + return chars; } = /** @@ -138,34 +183,9 @@ */ public String getContentType() { - return buffer.getContentType(); + return contentType; } = - /** - * Returns the writer. - * - * @return the writer - * @throws IllegalStateException if the output stream is already used o= r if no content type is defined - */ - public PrintWriter getWriter() throws IllegalStateException - { - return buffer.getWriter(); - } - - /** - * @return the output stream - * @throws IllegalStateException if the window writer is already used o= r if no content type is defined - */ - public OutputStream getOutputStream() throws IllegalStateException - { - return buffer.getOutputStream(); - } - - public ContentBuffer getBuffer() - { - return buffer; - } - public Set getNextModes() { return nextModes; Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test= /portlet/ContentBufferTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/ContentBufferTestCase.java 2008-02-28 10:15:38 UTC (rev 10150) +++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portl= et/ContentBufferTestCase.java 2008-02-28 11:57:23 UTC (rev 10151) @@ -25,6 +25,7 @@ import org.jboss.unit.api.pojo.annotations.Test; import org.jboss.portal.portlet.impl.jsr168.ContentBuffer; import static org.jboss.unit.api.Assert.*; +import static org.jboss.unit.api.Assert.assertEquals; = import java.io.PrintWriter; import java.io.OutputStream; @@ -46,7 +47,7 @@ PrintWriter writer =3D buffer.getWriter(); writer.print("foo"); buffer.reset(); - assertChars("", buffer.getChars().getBuffer()); + assertEquals("", buffer.getChars()); } = @Test @@ -57,7 +58,7 @@ OutputStream out =3D buffer.getOutputStream(); out.write("foo".getBytes("UTF8")); buffer.reset(); - assertEquals(new byte[0], buffer.getBytes().toByteArray()); + assertEquals(new byte[0], buffer.getBytes()); } = @Test @@ -96,7 +97,7 @@ assertNotNull(writer); writer.print("foo"); writer.close(); - assertChars("foo", buffer.getChars().getBuffer()); + assertEquals("foo", buffer.getChars()); } = @Test @@ -110,7 +111,7 @@ buffer.commit(); writer.print("bar"); writer.close(); - assertChars("foobar", buffer.getChars().getBuffer()); + assertEquals("foobar", buffer.getChars()); } = @Test @@ -123,7 +124,7 @@ assertNotNull(out); out.write("foo".getBytes("UTF8")); out.close(); - assertEquals("foo".getBytes("UTF8"), buffer.getBytes().toByteArray()= ); + assertEquals("foo".getBytes("UTF8"), buffer.getBytes()); } = @Test @@ -137,7 +138,7 @@ assertNotNull(out); out.write("bar".getBytes("UTF8")); out.close(); - assertEquals("foobar".getBytes("UTF8"), buffer.getBytes().toByteArra= y()); + assertEquals("foobar".getBytes("UTF8"), buffer.getBytes()); } = @Test @@ -183,14 +184,4 @@ out.close(); assertTrue(buffer.isCommited()); } - - private void assertChars(String s, StringBuffer sb) - { - int length =3D s.length(); - assertEquals(length, sb.length()); - char[] chars =3D new char[length]; - sb.getChars(0, length, chars, 0); - assertEquals(s, new String(chars)); - } - } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/ResourceRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ResourceRenderer.java 2008-02-28 10:15:38 UTC (rev 10150) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ResourceRenderer.java 2008-02-28 11:57:23 UTC (rev 10151) @@ -96,7 +96,7 @@ try { out =3D resp.getOutputStream(); - out.write(fragment.getBytes().toByteArray()); + out.write(fragment.getBytes()); } finally { @@ -109,7 +109,7 @@ try { writer =3D resp.getWriter(); - writer.write(fragment.getChars().toString()); + writer.write(fragment.getChars()); } finally { Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/SimpleFragmentRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/SimpleFragmentRenderer.java 2008-02-28 10:15:38 UTC (rev 10150) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/SimpleFragmentRenderer.java 2008-02-28 11:57:23 UTC (rev 10151) @@ -26,6 +26,8 @@ import org.jboss.portal.portlet.invocation.response.ErrorResponse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; = +import java.io.UnsupportedEncodingException; + /** * @author Chris Laprun * @version $Revision: 9748 $ @@ -42,11 +44,18 @@ // if (fragment.getType() =3D=3D FragmentResponse.TYPE_BYTES) { - frag =3D fragment.getBytes().toString(); + try + { + frag =3D new String(fragment.getBytes(), "UTF-8"); + } + catch (UnsupportedEncodingException e) + { + throw new Error(e); + } } else { - frag =3D fragment.getChars().toString(); + frag =3D fragment.getChars(); } = StringBuilder builder =3D new StringBuilder(frag.length() + 50); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-28 10:15:38 UTC (rev 10150) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-28 11:57:23 UTC (rev 10151) @@ -185,7 +185,7 @@ try { out =3D resp.getOutputStream(); - out.write(fragment.getBytes().toByteArray()); + out.write(fragment.getBytes()); } finally { @@ -198,7 +198,7 @@ try { writer =3D resp.getWriter(); - writer.write(fragment.getChars().toString()); + writer.write(fragment.getChars()); } finally { --===============6742493991820796581==-- From portal-commits at lists.jboss.org Thu Feb 28 07:28:42 2008 Content-Type: multipart/mixed; boundary="===============6701012723506214958==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10152 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api and 5 other directories. Date: Thu, 28 Feb 2008 07:28:42 -0500 Message-ID: --===============6701012723506214958== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-28 07:28:42 -0500 (Thu, 28 Feb 2008) New Revision: 10152 Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/inv= ocation/response/ContentResponse.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/asp= ects/portlet/ConsumerCacheInterceptor.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/MimeResponseImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/RenderResponseImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/ResourceResponseImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/inv= ocation/response/FragmentResponse.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/inv= ocation/response/cache/ContentRef.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/inv= ocation/response/cache/SoftContentRef.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/inv= ocation/response/cache/StrongContentRef.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/ControllerResponseRendererFactory.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/FragmentRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PageRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/ResourceRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/SimpleFragmentRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/HeadersTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletMarkupTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletTag.java Log: introduced ContentResponse super class of FragmentResponse that is used by = resource response Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/aspects/portlet/ConsumerCacheInterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/as= pects/portlet/ConsumerCacheInterceptor.java 2008-02-28 11:57:23 UTC (rev 10= 151) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/as= pects/portlet/ConsumerCacheInterceptor.java 2008-02-28 12:28:42 UTC (rev 10= 152) @@ -27,9 +27,9 @@ import org.jboss.portal.portlet.invocation.RenderInvocation; import org.jboss.portal.portlet.invocation.response.cache.ContentRef; import org.jboss.portal.portlet.invocation.response.cache.StrongContentRef; -import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.RevalidateMarkupRespon= se; +import org.jboss.portal.portlet.invocation.response.ContentResponse; import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.ParametersStateString; import org.jboss.portal.portlet.cache.CacheControl; @@ -144,7 +144,7 @@ } } = - FragmentResponse fragment =3D cachedEntry !=3D null ? cachedEntry= .contentRef.getContent() : null; + ContentResponse fragment =3D cachedEntry !=3D null ? cachedEntry.= contentRef.getContent() : null; = // If no valid fragment we must invoke if (fragment =3D=3D null || cachedEntry.expirationTimeMillis < Sy= stem.currentTimeMillis()) @@ -160,9 +160,9 @@ = // Try to cache any fragment result CacheControl control =3D null; - if (response instanceof FragmentResponse) + if (response instanceof ContentResponse) { - fragment =3D (FragmentResponse)response; + fragment =3D (ContentResponse)response; control =3D fragment.getCacheControl(); } else if (response instanceof RevalidateMarkupResponse) @@ -261,7 +261,7 @@ ParameterMap publicNavigationalState, WindowState windowState, Mode mode, - FragmentResponse content, + ContentResponse content, long expirationTimeMillis, String validationToken) { Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/MimeResponseImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/MimeResponseImpl.java 2008-02-28 11:57:23 UTC (rev 10151) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/MimeResponseImpl.java 2008-02-28 12:28:42 UTC (rev 10152) @@ -23,14 +23,14 @@ package org.jboss.portal.portlet.impl.jsr168.api; = import org.jboss.portal.portlet.invocation.PortletInvocation; -import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.RevalidateMarkupRespon= se; +import org.jboss.portal.portlet.invocation.response.ContentResponse; +import org.jboss.portal.portlet.invocation.response.ResponseProperties; import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.info.CacheInfo; import org.jboss.portal.portlet.cache.CacheScope; import org.jboss.portal.portlet.impl.jsr168.ContentBuffer; -import org.jboss.portal.Mode; = import javax.portlet.MimeResponse; import javax.portlet.PortletURL; @@ -40,7 +40,7 @@ import java.io.IOException; import java.io.OutputStream; import java.util.Locale; -import java.util.Set; +import java.util.Map; = /** * @author Julien Viet @@ -58,14 +58,9 @@ /** . */ private boolean contentTypeSet; = - /** The title if any. */ - protected String responseTitle; - /** . */ private ContentBuffer responseContent; = - /** . */ - protected Set responseNextModes; = public MimeResponseImpl(PortletInvocation invocation, PortletRequestImp= l preq) { @@ -84,10 +79,17 @@ this.bufferSize =3D 0; this.contentTypeSet =3D false; this.responseContent =3D new ContentBuffer(); - this.responseTitle =3D null; - this.responseNextModes =3D null; } = + protected abstract ContentResponse createMarkupResponse( + ResponseProperties properties, + Map attributeMap, + String contentType, + byte[] bytes, + String chars, + org.jboss.portal.portlet.cache.CacheControl cacheControl + ); + public PortletInvocationResponse getResponse() { org.jboss.portal.portlet.cache.CacheControl cc; @@ -112,15 +114,13 @@ } else { - return new FragmentResponse( + return createMarkupResponse( getProperties(false), preq.attributes.getAttributeMap(), responseContent.getContentType(), responseContent.getBytes(), responseContent.getChars(), - responseTitle, - cc, - responseNextModes !=3D null ? responseNextModes : preq.support= edModes); + cc); } } = Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/RenderResponseImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/RenderResponseImpl.java 2008-02-28 11:57:23 UTC (rev 10151) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/RenderResponseImpl.java 2008-02-28 12:28:42 UTC (rev 10152) @@ -23,11 +23,13 @@ package org.jboss.portal.portlet.impl.jsr168.api; = import org.jboss.portal.portlet.invocation.RenderInvocation; -import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.FragmentResponse; +import org.jboss.portal.portlet.invocation.response.ContentResponse; +import org.jboss.portal.portlet.invocation.response.ResponseProperties; import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.info.CapabilitiesInfo; import org.jboss.portal.portlet.info.ModeInfo; +import org.jboss.portal.portlet.cache.CacheControl; import org.jboss.portal.Mode; import org.jboss.portal.common.util.MediaType; = @@ -37,6 +39,7 @@ import java.util.Collection; import java.util.Set; import java.util.LinkedHashSet; +import java.util.Map; = /** * @author Julien Viet @@ -45,9 +48,19 @@ public class RenderResponseImpl extends MimeResponseImpl implements Render= Response { = + /** . */ + protected Set responseNextModes; + + /** The title if any. */ + protected String responseTitle; + public RenderResponseImpl(RenderInvocation invocation, PortletRequestIm= pl preq) { super(invocation, preq); + + // + this.responseNextModes =3D null; + this.responseTitle =3D null; } = public void setTitle(String title) @@ -142,4 +155,17 @@ throw ex; } } + + protected ContentResponse createMarkupResponse(ResponseProperties prope= rties, Map attributeMap, String contentType, byte[] bytes, = String chars, CacheControl cacheControl) + { + return new FragmentResponse( + properties, + attributeMap, + contentType, + bytes, + chars, + responseTitle, + cacheControl, + responseNextModes !=3D null ? responseNextModes : preq.supportedM= odes); + } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/ResourceResponseImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/ResourceResponseImpl.java 2008-02-28 11:57:23 UTC (rev 10151) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/ResourceResponseImpl.java 2008-02-28 12:28:42 UTC (rev 10152) @@ -23,11 +23,15 @@ package org.jboss.portal.portlet.impl.jsr168.api; = import org.jboss.portal.portlet.invocation.ResourceInvocation; +import org.jboss.portal.portlet.invocation.response.ContentResponse; +import org.jboss.portal.portlet.invocation.response.ResponseProperties; import org.jboss.portal.portlet.cache.CacheLevel; +import org.jboss.portal.portlet.cache.CacheControl; = import javax.portlet.ResourceResponse; import javax.portlet.PortletURL; import java.util.Locale; +import java.util.Map; = /** * @author Julien Viet @@ -85,4 +89,15 @@ // return super.createRenderURL(); } + + protected ContentResponse createMarkupResponse(ResponseProperties prope= rties, Map attributeMap, String contentType, byte[] bytes, = String chars, CacheControl cacheControl) + { + return new ContentResponse( + properties, + attributeMap, + contentType, + bytes, + chars, + cacheControl); + } } Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /invocation/response/ContentResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/ContentResponse.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/ContentResponse.java 2008-02-28 12:28:42 UTC (rev 10152) @@ -0,0 +1,168 @@ +/*************************************************************************= ***** + * 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.portlet.invocation.response; + +import org.jboss.portal.portlet.cache.CacheControl; +import org.jboss.portal.Mode; + +import java.util.Set; +import java.util.Map; + +/** + * Data produced. + * + * @author Julien Viet + * @version $Revision: 5602 $ + */ +public class ContentResponse extends PortletInvocationResponse +{ + + /** . */ + public static final int TYPE_EMPTY =3D 0; + + /** . */ + public static final int TYPE_CHARS =3D 1; + + /** . */ + public static final int TYPE_BYTES =3D 2; + + /** . */ + private final ResponseProperties properties; + + /** . */ + private final Map attributes; + + /** The result content type if any. */ + private String contentType; + + /** . */ + private final byte[] bytes; + + /** . */ + private final String chars; + + /** . */ + private final CacheControl cacheControl; + + public ContentResponse( + ResponseProperties properties, + Map attributes, + String contentType, + byte[] bytes, + String chars, + CacheControl cacheControl) + { + this.properties =3D properties; + this.attributes =3D attributes; + this.contentType =3D contentType; + this.bytes =3D bytes; + this.chars =3D chars; + this.cacheControl =3D cacheControl; + } + + public ResponseProperties getProperties() + { + return properties; + } + + public CacheControl getCacheControl() + { + return cacheControl; + } + + public Map getAttributes() + { + return attributes; + } + + public int getType() + { + if (bytes =3D=3D null) + { + if (chars =3D=3D null) + { + return TYPE_EMPTY; + } + else + { + return TYPE_CHARS; + } + } + else + { + return TYPE_BYTES; + } + } + + /** + * Return the content as a string. + * + * @return the content + */ + public String getContent() + { + switch (getType()) + { + case TYPE_CHARS: + return getChars(); + case TYPE_BYTES: + return new String(bytes); + case TYPE_EMPTY: + return ""; + default: + throw new AssertionError(); + } + } + + /** + * Return the bytes of the content held by the fragment. + * + * @return the bytes + * @throws IllegalArgumentException if the type is not bytes + */ + public byte[] getBytes() throws IllegalArgumentException + { + return bytes; + } + + /** + * Return the chars of the content held by the fragment. + * + * @return the chars + * @throws IllegalArgumentException if the type is not chars + */ + public String getChars() throws IllegalArgumentException + { + return chars; + } + + /** + * Return the content type of the generated fragment. + * + * @return the content type + */ + public String getContentType() + { + return contentType; + } +} \ No newline at end of file Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/invocation/response/FragmentResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/FragmentResponse.java 2008-02-28 11:57:23 UTC (rev 10151) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/FragmentResponse.java 2008-02-28 12:28:42 UTC (rev 10152) @@ -34,40 +34,13 @@ * @author Julien Viet * @version $Revision: 5602 $ */ -public class FragmentResponse extends PortletInvocationResponse +public class FragmentResponse extends ContentResponse { = - /** . */ - public static final int TYPE_EMPTY =3D 0; - - /** . */ - public static final int TYPE_CHARS =3D 1; - - /** . */ - public static final int TYPE_BYTES =3D 2; - - /** . */ - private final ResponseProperties properties; - - /** . */ - private final Map attributes; - - /** The result content type if any. */ - private String contentType; - - /** . */ - private final byte[] bytes; - - /** . */ - private final String chars; - /** The title if any. */ private final String title; = - /** . */ - private final CacheControl cacheControl; - - /** . */ + /** The next modes. */ private final Set nextModes; = public FragmentResponse( @@ -80,93 +53,14 @@ CacheControl cacheControl, Set nextModes) { - this.properties =3D properties; - this.attributes =3D attributes; - this.contentType =3D contentType; - this.bytes =3D bytes; - this.chars =3D chars; + super(properties, attributes, contentType, bytes, chars, cacheContro= l); + + // this.title =3D title; - this.cacheControl =3D cacheControl; this.nextModes =3D nextModes; } = - public ResponseProperties getProperties() - { - return properties; - } - - public CacheControl getCacheControl() - { - return cacheControl; - } - - public Map getAttributes() - { - return attributes; - } - - public int getType() - { - if (bytes =3D=3D null) - { - if (chars =3D=3D null) - { - return TYPE_EMPTY; - } - else - { - return TYPE_CHARS; - } - } - else - { - return TYPE_BYTES; - } - } - /** - * Return the content as a string. - * - * @return the content - */ - public String getContent() - { - switch (getType()) - { - case TYPE_CHARS: - return getChars(); - case TYPE_BYTES: - return new String(bytes); - case TYPE_EMPTY: - return ""; - default: - throw new AssertionError(); - } - } - - /** - * Return the bytes of the content held by the fragment. - * - * @return the bytes - * @throws IllegalArgumentException if the type is not bytes - */ - public byte[] getBytes() throws IllegalArgumentException - { - return bytes; - } - - /** - * Return the chars of the content held by the fragment. - * - * @return the chars - * @throws IllegalArgumentException if the type is not chars - */ - public String getChars() throws IllegalArgumentException - { - return chars; - } - - /** * Return the fragment title. * * @return the title. @@ -177,15 +71,10 @@ } = /** - * Return the content type of the generated fragment. + * Returns the next modes. * - * @return the content type + * @return the next modes */ - public String getContentType() - { - return contentType; - } - public Set getNextModes() { return nextModes; Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/invocation/response/cache/ContentRef.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/cache/ContentRef.java 2008-02-28 11:57:23 UTC (rev 10151) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/cache/ContentRef.java 2008-02-28 12:28:42 UTC (rev 10152) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.invocation.response.cache; = -import org.jboss.portal.portlet.invocation.response.FragmentResponse; +import org.jboss.portal.portlet.invocation.response.ContentResponse; = import java.io.Serializable; = @@ -40,5 +40,5 @@ * * @return the content */ - public abstract FragmentResponse getContent(); + public abstract ContentResponse getContent(); } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/invocation/response/cache/SoftContentRef.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/cache/SoftContentRef.java 2008-02-28 11:57:23 UTC (rev 10= 151) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/cache/SoftContentRef.java 2008-02-28 12:28:42 UTC (rev 10= 152) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.invocation.response.cache; = -import org.jboss.portal.portlet.invocation.response.FragmentResponse; +import org.jboss.portal.portlet.invocation.response.ContentResponse; = import java.lang.ref.WeakReference; = @@ -39,22 +39,22 @@ private static final long serialVersionUID =3D -8166044526732362286L; = /** The content. */ - private transient WeakReference content; + private transient WeakReference content; = /** * @param content the content * @throws IllegalArgumentException if the content is null */ - public SoftContentRef(FragmentResponse content) throws IllegalArgumentE= xception + public SoftContentRef(ContentResponse content) throws IllegalArgumentEx= ception { if (content =3D=3D null) { throw new IllegalArgumentException("Content must not be null"); } - this.content =3D new WeakReference(content); + this.content =3D new WeakReference(content); } = - public FragmentResponse getContent() + public ContentResponse getContent() { return content.get(); } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/invocation/response/cache/StrongContentRef.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/cache/StrongContentRef.java 2008-02-28 11:57:23 UTC (rev = 10151) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/cache/StrongContentRef.java 2008-02-28 12:28:42 UTC (rev = 10152) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.invocation.response.cache; = -import org.jboss.portal.portlet.invocation.response.FragmentResponse; +import org.jboss.portal.portlet.invocation.response.ContentResponse; = /** * Use strong references. @@ -37,13 +37,13 @@ private static final long serialVersionUID =3D -8194245397756941208L; = /** The content. */ - private transient FragmentResponse content; + private transient ContentResponse content; = /** * @param content the content * @throws IllegalArgumentException if the content is null */ - public StrongContentRef(FragmentResponse content) throws IllegalArgumen= tException + public StrongContentRef(ContentResponse content) throws IllegalArgument= Exception { if (content =3D=3D null) { @@ -52,7 +52,7 @@ this.content =3D content; } = - public FragmentResponse getContent() + public ContentResponse getContent() { return content; } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/ControllerResponseRendererFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ControllerResponseRendererFactory.java 2008-02-28 11:57:23 UTC (= rev 10151) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ControllerResponseRendererFactory.java 2008-02-28 12:28:42 UTC (= rev 10152) @@ -30,10 +30,10 @@ import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.StateControllerContext; import org.jboss.portal.portlet.invocation.response.ErrorResponse; -import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.HTTPRedirectionRespons= e; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.ResponseProperties; +import org.jboss.portal.portlet.invocation.response.ContentResponse; = /** * @author Julien Viet @@ -84,9 +84,9 @@ ResourceResponse resourceResponse =3D (ResourceResponse)response; = // - if (resourceResponse.getResponse() instanceof FragmentResponse) + if (resourceResponse.getResponse() instanceof ContentResponse) { - return new ResourceRenderer((FragmentResponse)resourceResponse= .getResponse(), sendNoContentResponseOnEmptyResource); + return new ResourceRenderer((ContentResponse)resourceResponse.= getResponse(), sendNoContentResponseOnEmptyResource); } else { Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/FragmentRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/FragmentRenderer.java 2008-02-28 11:57:23 UTC (rev 10151) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/FragmentRenderer.java 2008-02-28 12:28:42 UTC (rev 10152) @@ -24,7 +24,7 @@ package org.jboss.portal.portlet.test.controller; = import org.jboss.portal.portlet.invocation.response.ErrorResponse; -import org.jboss.portal.portlet.invocation.response.FragmentResponse; +import org.jboss.portal.portlet.invocation.response.ContentResponse; = /** * @author Chris Laprun @@ -32,7 +32,7 @@ */ public interface FragmentRenderer { - String renderPortlet(FragmentResponse fragment); + String renderPortlet(ContentResponse fragment); = String renderError(ErrorResponse error); } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PageRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PageRenderer.java 2008-02-28 11:57:23 UTC (rev 10151) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PageRenderer.java 2008-02-28 12:28:42 UTC (rev 10152) @@ -39,9 +39,9 @@ import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; import org.jboss.portal.portlet.invocation.RenderInvocation; import org.jboss.portal.portlet.invocation.response.ErrorResponse; -import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.response.ResponseProperties; +import org.jboss.portal.portlet.invocation.response.ContentResponse; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.w3c.dom.Element; @@ -62,7 +62,7 @@ { = protected FragmentRenderer fragmentRenderer =3D new SimpleFragmentRende= rer(); - protected List fragments; + protected List fragments; protected List errors; protected PageNavigationalState pageNavigationalState; = @@ -110,7 +110,7 @@ = = writer.print(""); - for (FragmentResponse fragment : fragments) + for (ContentResponse fragment : fragments) { writer.print(fragmentRenderer.renderPortlet(fragment)); = @@ -136,7 +136,7 @@ Collection portlets =3D context.getPortlets(); = int capacity =3D portlets.size(); - fragments =3D new ArrayList(capacity); + fragments =3D new ArrayList(capacity); errors =3D new ArrayList(capacity); = for (Portlet portlet : portlets) @@ -175,9 +175,9 @@ { PortletInvocationResponse response =3D context.render(render); = - if (response instanceof FragmentResponse) + if (response instanceof ContentResponse) { - FragmentResponse fragment =3D (FragmentResponse)response; + ContentResponse fragment =3D (ContentResponse)response; = // fragments.add(fragment); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/ResourceRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ResourceRenderer.java 2008-02-28 11:57:23 UTC (rev 10151) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/ResourceRenderer.java 2008-02-28 12:28:42 UTC (rev 10152) @@ -24,7 +24,7 @@ package org.jboss.portal.portlet.test.controller; = import org.jboss.portal.common.io.IOTools; -import org.jboss.portal.portlet.invocation.response.FragmentResponse; +import org.jboss.portal.portlet.invocation.response.ContentResponse; = import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; @@ -39,12 +39,12 @@ { = /** . */ - private FragmentResponse fragment; + private ContentResponse fragment; = /** . */ private boolean sendNoContentResponseOnEmptyResource; = - public ResourceRenderer(FragmentResponse response, boolean sendNoConten= tResponseOnEmptyResource) + public ResourceRenderer(ContentResponse response, boolean sendNoContent= ResponseOnEmptyResource) { super(response.getProperties()); = @@ -55,7 +55,7 @@ = protected void renderContent(HttpServletResponse resp) throws IOExcepti= on { - if (fragment.getType() =3D=3D FragmentResponse.TYPE_EMPTY) + if (fragment.getType() =3D=3D ContentResponse.TYPE_EMPTY) { if (sendNoContentResponseOnEmptyResource) { @@ -90,7 +90,7 @@ } = // - if (fragment.getType() =3D=3D FragmentResponse.TYPE_BYTES) + if (fragment.getType() =3D=3D ContentResponse.TYPE_BYTES) { ServletOutputStream out =3D null; try Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/SimpleFragmentRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/SimpleFragmentRenderer.java 2008-02-28 11:57:23 UTC (rev 10151) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/SimpleFragmentRenderer.java 2008-02-28 12:28:42 UTC (rev 10152) @@ -24,7 +24,7 @@ package org.jboss.portal.portlet.test.controller; = import org.jboss.portal.portlet.invocation.response.ErrorResponse; -import org.jboss.portal.portlet.invocation.response.FragmentResponse; +import org.jboss.portal.portlet.invocation.response.ContentResponse; = import java.io.UnsupportedEncodingException; = @@ -34,15 +34,15 @@ */ public class SimpleFragmentRenderer implements FragmentRenderer { - public String renderPortlet(FragmentResponse fragment) + public String renderPortlet(ContentResponse fragment) { = - if (fragment.getType() !=3D FragmentResponse.TYPE_EMPTY) + if (fragment.getType() !=3D ContentResponse.TYPE_EMPTY) { String frag; = // - if (fragment.getType() =3D=3D FragmentResponse.TYPE_BYTES) + if (fragment.getType() =3D=3D ContentResponse.TYPE_BYTES) { try { Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-28 11:57:23 UTC (rev 10151) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-28 12:28:42 UTC (rev 10152) @@ -28,8 +28,8 @@ import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.URLFormat; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.ErrorResponse; +import org.jboss.portal.portlet.invocation.response.ContentResponse; import org.jboss.portal.portlet.controller.PortletController; import org.jboss.portal.portlet.controller.request.PortletActionRequest; import org.jboss.portal.portlet.controller.impl.request.ControllerRequestF= actory; @@ -161,31 +161,31 @@ PortletInvocationResponse pir =3D resourceResponse.getResponse= (); = // - if (pir instanceof FragmentResponse) + if (pir instanceof ContentResponse) { - FragmentResponse fragment =3D (FragmentResponse)pir; + ContentResponse contentResponse =3D (ContentResponse)pir; = // - if (fragment.getType() =3D=3D FragmentResponse.TYPE_EMPTY) + if (contentResponse.getType() =3D=3D ContentResponse.TYPE_E= MPTY) { resp.setStatus(HttpServletResponse.SC_NO_CONTENT); } else { - String contentType =3D fragment.getContentType(); + String contentType =3D contentResponse.getContentType(); if (contentType !=3D null) { resp.setContentType(contentType); } = // - if (fragment.getType() =3D=3D FragmentResponse.TYPE_BYTE= S) + if (contentResponse.getType() =3D=3D ContentResponse.TYP= E_BYTES) { ServletOutputStream out =3D null; try { out =3D resp.getOutputStream(); - out.write(fragment.getBytes()); + out.write(contentResponse.getBytes()); } finally { @@ -198,7 +198,7 @@ try { writer =3D resp.getWriter(); - writer.write(fragment.getChars()); + writer.write(contentResponse.getChars()); } finally { Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/HeadersTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/HeadersTag.java 2008-02-28 11:57:23 UTC (rev 10151) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/HeadersTag.java 2008-02-28 12:28:42 UTC (rev 10152) @@ -26,8 +26,8 @@ import org.jboss.portal.portlet.test.jsp.WindowResult; import org.jboss.portal.portlet.test.jsp.PortalPrepareResponse; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.ResponseProperties; +import org.jboss.portal.portlet.invocation.response.ContentResponse; import org.jboss.portal.common.util.MultiValuedPropertyMap; import org.jboss.portal.common.xml.XMLTools; import org.w3c.dom.Element; @@ -69,9 +69,9 @@ PortletInvocationResponse response =3D result.getResponse(); = // - if (response instanceof FragmentResponse) + if (response instanceof ContentResponse) { - FragmentResponse fragmentResponse =3D (FragmentResponse)= response; + ContentResponse fragmentResponse =3D (ContentResponse)re= sponse; = // ResponseProperties properties =3D fragmentResponse.getPr= operties(); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletMarkupTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletMarkupTag.java 2008-02-28 11:57:23 UTC (rev 10151) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletMarkupTag.java 2008-02-28 12:28:42 UTC (rev 10152) @@ -24,7 +24,7 @@ = import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.invocation.response.FragmentResponse; +import org.jboss.portal.portlet.invocation.response.ContentResponse; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; import org.jboss.portal.WindowState; = @@ -49,9 +49,9 @@ = if (portletResp !=3D null) { - if (portletResp instanceof FragmentResponse) + if (portletResp instanceof ContentResponse) { - FragmentResponse fragment =3D (FragmentResponse)portletResp; + ContentResponse fragment =3D (ContentResponse)portletResp; WindowNavigationalState windowNS =3D null; if (renderResponse.getPageNavigationalState() !=3D null) { @@ -59,16 +59,16 @@ } if (windowNS =3D=3D null || !windowNS.getWindowState().equals(= WindowState.MINIMIZED)) { - if (fragment.getType() !=3D FragmentResponse.TYPE_EMPTY) + if (fragment.getType() !=3D ContentResponse.TYPE_EMPTY) { String frag; - if (fragment.getType() =3D=3D FragmentResponse.TYPE_BYTE= S) + if (fragment.getType() =3D=3D ContentResponse.TYPE_BYTES) { frag =3D fragment.getBytes().toString(); } else { - frag =3D fragment.getChars().toString(); + frag =3D fragment.getChars(); } = out.write(frag); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-28 11:57:23 UTC (rev 10151) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletTag.java 2008-02-28 12:28:42 UTC (rev 10152) @@ -28,9 +28,9 @@ import org.jboss.portal.portlet.test.jsp.WindowDef; import org.jboss.portal.portlet.test.jsp.WindowResult; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.invocation.response.FragmentResponse; import org.jboss.portal.portlet.invocation.response.ErrorResponse; import org.jboss.portal.portlet.invocation.response.UnavailableResponse; +import org.jboss.portal.portlet.invocation.response.ContentResponse; import org.jboss.portal.Mode; import org.jboss.portal.WindowState; import org.jboss.portal.common.util.Tools; @@ -278,7 +278,7 @@ PortletInvocationResponse portletResponse =3D result.getResponse(); = // - if (portletResponse instanceof FragmentResponse) + if (portletResponse instanceof ContentResponse) { this.result =3D result; // --===============6701012723506214958==-- From portal-commits at lists.jboss.org Thu Feb 28 07:34:14 2008 Content-Type: multipart/mixed; boundary="===============4592826366013884811==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10153 - in modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet: invocation/response and 1 other directory. Date: Thu, 28 Feb 2008 07:34:12 -0500 Message-ID: --===============4592826366013884811== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-28 07:34:12 -0500 (Thu, 28 Feb 2008) New Revision: 10153 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/MimeResponseImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/inv= ocation/response/ResponseProperties.java Log: added a clear() methods on ResponseProperties that clears the 3 nested obje= cts. Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/api/MimeResponseImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/MimeResponseImpl.java 2008-02-28 12:28:42 UTC (rev 10152) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/MimeResponseImpl.java 2008-02-28 12:34:12 UTC (rev 10153) @@ -210,9 +210,7 @@ resetBuffer(); = // And properties - getProperties().getTransportHeaders().clear(); - getProperties().getMarkupHeaders().clear(); - getProperties().getCookies().clear(); + getProperties().clear(); } = public boolean isCommitted() Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/invocation/response/ResponseProperties.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/ResponseProperties.java 2008-02-28 12:28:42 UTC (rev 1015= 2) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/in= vocation/response/ResponseProperties.java 2008-02-28 12:34:12 UTC (rev 1015= 3) @@ -77,4 +77,11 @@ markupHeaders.append(appended.markupHeaders); cookies.addAll(appended.cookies); } + + public void clear() + { + transportHeaders.clear(); + markupHeaders.clear(); + cookies.clear(); + } } \ No newline at end of file --===============4592826366013884811==-- From portal-commits at lists.jboss.org Thu Feb 28 07:34:48 2008 Content-Type: multipart/mixed; boundary="===============1975474389767656257==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10154 - branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/controller/portlet. Date: Thu, 28 Feb 2008 07:34:47 -0500 Message-ID: --===============1975474389767656257== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2008-02-28 07:34:47 -0500 (Thu, 28 Feb 2008) New Revision: 10154 Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/con= troller/portlet/PortletInvocationFactory.java Log: JBPORTAL-1932: Portlet Session replication failing. Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/c= ore/controller/portlet/PortletInvocationFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/co= ntroller/portlet/PortletInvocationFactory.java 2008-02-28 12:34:12 UTC (rev= 10153) +++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/co= ntroller/portlet/PortletInvocationFactory.java 2008-02-28 12:34:47 UTC (rev= 10154) @@ -162,7 +162,7 @@ return render; } = - private static class ControllerActionContext extends AbstractActionCont= ext + public static class ControllerActionContext extends AbstractActionConte= xt { private InvokePortletCommandFactory cmdFactory; private ControllerContext controllerContext; @@ -199,7 +199,7 @@ } } = - private static class ControllerRenderContext extends AbstractRenderCont= ext + public static class ControllerRenderContext extends AbstractRenderConte= xt { private InvokePortletCommandFactory cmdFactory; private ControllerContext controllerContext; --===============1975474389767656257==-- From portal-commits at lists.jboss.org Thu Feb 28 08:41:59 2008 Content-Type: multipart/mixed; boundary="===============3357436252263349424==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10155 - in modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state: producer and 1 other directory. Date: Thu, 28 Feb 2008 08:41:59 -0500 Message-ID: --===============3357436252263349424== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-28 08:41:58 -0500 (Thu, 28 Feb 2008) New Revision: 10155 Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sta= te/AbstractPropertyContext.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sta= te/AccessMode.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sta= te/producer/ProducerPortletInvoker.java Log: make AccessMode an enum type Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/state/AbstractPropertyContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/st= ate/AbstractPropertyContext.java 2008-02-28 12:34:47 UTC (rev 10154) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/st= ate/AbstractPropertyContext.java 2008-02-28 13:41:58 UTC (rev 10155) @@ -98,9 +98,8 @@ } = // - for (int i =3D 0; i < changes.length; i++) + for (PropertyChange change : changes) { - PropertyChange change =3D changes[i]; prefs.setProperty(change.getKey(), change.getValue()); } status =3D UPDATE_SUCCESSFUL; Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/state/AccessMode.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/st= ate/AccessMode.java 2008-02-28 12:34:47 UTC (rev 10154) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/st= ate/AccessMode.java 2008-02-28 13:41:58 UTC (rev 10155) @@ -28,17 +28,17 @@ * @author Julien Viet * @version $Revision: 5776 $ */ -public class AccessMode +public enum AccessMode { = /** Read only access mode. */ - public static final AccessMode READ_ONLY =3D new AccessMode("READ_ONLY"= ); + READ_ONLY("READ_ONLY"), = /** Read write access mode. */ - public static final AccessMode READ_WRITE =3D new AccessMode("READ_WRIT= E"); + READ_WRITE("READ_WRITE"), = /** Clone before write access mode. */ - public static final AccessMode CLONE_BEFORE_WRITE =3D new AccessMode("C= LONE_BEFORE_WRITE"); + CLONE_BEFORE_WRITE("CLONE_BEFORE_WRITE"); = /** The type as a string. */ private final String name; Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/state/producer/ProducerPortletInvoker.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/st= ate/producer/ProducerPortletInvoker.java 2008-02-28 12:34:47 UTC (rev 10154) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/st= ate/producer/ProducerPortletInvoker.java 2008-02-28 13:41:58 UTC (rev 10155) @@ -253,29 +253,84 @@ PropertyMap newPrefs =3D prefs.getPrefs(); = // - if (access =3D=3D AccessMode.CLONE_BEFORE_WRITE) + switch(access) { - boolean persist =3D stateManagementPolicy.persistLocally(); + case CLONE_BEFORE_WRITE: + { + boolean persist =3D stateManagementPolicy.persistLocally(); = - // Create the state - if (context.isStateful()) - { - StatefulContext statefulContext =3D (StatefulContext)contex= t; - if (persist) + // Create the state + if (context.isStateful()) { - try + StatefulContext statefulContext =3D (StatefulContext)con= text; + if (persist) { - // The state id should be ok as it was used before to= load the state - LocalContext localContext =3D (LocalContext)statefulC= ontext; - String portletStateId =3D localContext.getStateId(); - String cloneStateId =3D persistenceManager.cloneState= (portletStateId, newPrefs); + try + { + // The state id should be ok as it was used before= to load the state + LocalContext localContext =3D (LocalContext)statef= ulContext; + String portletStateId =3D localContext.getStateId(= ); + String cloneStateId =3D persistenceManager.cloneSt= ate(portletStateId, newPrefs); = + // Return the clone context + String cloneId =3D PRODUCER_CLONE_ID_PREFIX + clon= eStateId; + PortletContext clonedCtx =3D PortletContext.create= PortletContext(cloneId); + StateEvent event =3D new StateEvent(clonedCtx, Sta= teEvent.Type.PORTLET_CLONED_EVENT); + instanceCtx.onStateEvent(event); + } + catch (NoSuchStateException e) + { + throw new PortletInvokerException("Unexpected exce= ption", e); + } + catch (InvalidStateIdException e) + { + throw new PortletInvokerException("Unexpected exce= ption", e); + } + } + else + { + PortletContext clonedCtx =3D marshall(context.getPort= letId(), newPrefs); + StateEvent event =3D new StateEvent(clonedCtx, StateE= vent.Type.PORTLET_CLONED_EVENT); + instanceCtx.onStateEvent(event); + } + } + else + { + // Add the missing mutable portlet state + getPropertiesFromMetaData(portlet.getContext(), newPrefs= ); + + // + if (persist) + { + // Create the new state + String cloneStateId =3D persistenceManager.createStat= e(context.getPortletId(), newPrefs); + // Return the clone context String cloneId =3D PRODUCER_CLONE_ID_PREFIX + cloneSt= ateId; PortletContext clonedCtx =3D PortletContext.createPor= tletContext(cloneId); StateEvent event =3D new StateEvent(clonedCtx, StateE= vent.Type.PORTLET_CLONED_EVENT); instanceCtx.onStateEvent(event); } + else + { + PortletContext clonedCtx =3D marshall(context.getPort= letId(), newPrefs); + StateEvent event =3D new StateEvent(clonedCtx, StateE= vent.Type.PORTLET_CLONED_EVENT); + instanceCtx.onStateEvent(event); + } + } + } + case READ_WRITE: + { + StatefulContext statefulContext =3D (StatefulContext)contex= t; + if (statefulContext.isLocal()) + { + // Update the state + try + { + LocalContext localContext =3D (LocalContext)statefulC= ontext; + String stateId =3D localContext.getStateId(); + persistenceManager.updateState(stateId, newPrefs); + } catch (NoSuchStateException e) { throw new PortletInvokerException("Unexpected excepti= on", e); @@ -287,69 +342,17 @@ } else { - PortletContext clonedCtx =3D marshall(context.getPortlet= Id(), newPrefs); - StateEvent event =3D new StateEvent(clonedCtx, StateEven= t.Type.PORTLET_CLONED_EVENT); + PortletContext modifiedCtx =3D marshall(context.getPortl= etId(), newPrefs); + StateEvent event =3D new StateEvent(modifiedCtx, StateEv= ent.Type.PORTLET_MODIFIED_EVENT); instanceCtx.onStateEvent(event); } } - else + case READ_ONLY: { - // Add the missing mutable portlet state - getPropertiesFromMetaData(portlet.getContext(), newPrefs); - - // - if (persist) - { - // Create the new state - String cloneStateId =3D persistenceManager.createState(c= ontext.getPortletId(), newPrefs); - - // Return the clone context - String cloneId =3D PRODUCER_CLONE_ID_PREFIX + cloneState= Id; - PortletContext clonedCtx =3D PortletContext.createPortle= tContext(cloneId); - StateEvent event =3D new StateEvent(clonedCtx, StateEven= t.Type.PORTLET_CLONED_EVENT); - instanceCtx.onStateEvent(event); - } - else - { - PortletContext clonedCtx =3D marshall(context.getPortlet= Id(), newPrefs); - StateEvent event =3D new StateEvent(clonedCtx, StateEven= t.Type.PORTLET_CLONED_EVENT); - instanceCtx.onStateEvent(event); - } + throw new PortletStateChangeRequiredException("Modification= was requested for portlet with id '" + + context.getPortletId() + "' but access mode was READ O= NLY."); } } - else if (access =3D=3D AccessMode.READ_WRITE) - { - StatefulContext statefulContext =3D (StatefulContext)context; - if (statefulContext.isLocal()) - { - // Update the state - try - { - LocalContext localContext =3D (LocalContext)statefulCont= ext; - String stateId =3D localContext.getStateId(); - persistenceManager.updateState(stateId, newPrefs); - } - catch (NoSuchStateException e) - { - throw new PortletInvokerException("Unexpected exception"= , e); - } - catch (InvalidStateIdException e) - { - throw new PortletInvokerException("Unexpected exception"= , e); - } - } - else - { - PortletContext modifiedCtx =3D marshall(context.getPortletI= d(), newPrefs); - StateEvent event =3D new StateEvent(modifiedCtx, StateEvent= .Type.PORTLET_MODIFIED_EVENT); - instanceCtx.onStateEvent(event); - } - } - else if (access =3D=3D AccessMode.READ_ONLY) - { - throw new PortletStateChangeRequiredException("Modification wa= s requested for portlet with id '" - + context.getPortletId() + "' but access mode was READ ONLY= ."); - } } = // --===============3357436252263349424==-- From portal-commits at lists.jboss.org Thu Feb 28 09:45:26 2008 Content-Type: multipart/mixed; boundary="===============6669000805290633948==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10156 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/state/producer and 5 other directories. Date: Thu, 28 Feb 2008 09:45:26 -0500 Message-ID: --===============6669000805290633948== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-28 09:45:26 -0500 (Thu, 28 Feb 2008) New Revision: 10156 Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/asp= ects/portlet/PortletCustomizationInterceptor.java Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestInstanceContext.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/sta= te/producer/ProducerPortletInvoker.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/AbstractPortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PageRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalRenderResponse.java modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/jb= oss-beans.xml modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/j= boss-beans.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= jboss-beans.xml Log: replace TestInstanceContext by an interceptor placed on the consumer side. Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /aspects/portlet/PortletCustomizationInterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/as= pects/portlet/PortletCustomizationInterceptor.java = (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/as= pects/portlet/PortletCustomizationInterceptor.java 2008-02-28 14:45:26 UTC = (rev 10156) @@ -0,0 +1,136 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.aspects.portlet; + +import org.jboss.portal.portlet.invocation.PortletInterceptor; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.portlet.invocation.ActionInvocation; +import org.jboss.portal.portlet.invocation.EventInvocation; +import org.jboss.portal.portlet.spi.InstanceContext; +import org.jboss.portal.portlet.state.AccessMode; +import org.jboss.portal.portlet.StateEvent; +import org.jboss.portal.portlet.PortletContext; +import org.jboss.portal.common.invocation.InvocationException; +import org.jboss.portal.common.invocation.AttributeResolver; + +/** + *

            This interceptor takes in charge the management of portlet customiza= tion when the invocation carries + * an read only access mode. The customizations will be stored in the prin= cipal scope of the portlet + * invocation for security reasons.

            + * + *

            This interceptor must not be used in a production environment.

            + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletCustomizationInterceptor extends PortletInterceptor +{ + protected Object invoke(PortletInvocation invocation) throws Exception,= InvocationException + { + InstanceContext oldContext =3D invocation.getInstanceContext(); + if ((invocation instanceof ActionInvocation || invocation instanceof= EventInvocation) && oldContext.getAccessMode() =3D=3D AccessMode.READ_ONLY) + { + PortletContext oldTarget =3D invocation.getTarget(); + try + { + AttributeResolver resolver =3D invocation.getContext().getAttr= ibuteResolver(PortletInvocation.PRINCIPAL_SCOPE); + PortletInstanceContext newContext =3D new PortletInstanceConte= xt(resolver, oldTarget); + + // + invocation.setInstanceContext(newContext); + invocation.setTarget(newContext.getTarget()); + + // + return invocation.invokeNext(); + } + finally + { + invocation.setTarget(oldTarget); + invocation.setInstanceContext(oldContext); + } + } + else + { + return invocation.invokeNext(); + } + } + + private static class PortletInstanceContext implements InstanceContext + { + + /** . */ + private AttributeResolver resolver; + + /** . */ + private PortletContext target; + + /** . */ + private boolean useClone; + + /** . */ + private String id; + + public PortletInstanceContext( + AttributeResolver resolver, + PortletContext portletContext) + { + String id =3D portletContext.getId(); + PortletContext target =3D portletContext; + boolean useClone =3D false; + PortletContext clone =3D (PortletContext)resolver.getAttribute("c= lone." + id); + if (clone !=3D null) + { + target =3D clone; + useClone =3D true; + } + + // + this.resolver =3D resolver; + this.useClone =3D useClone; + this.target =3D target; + this.id =3D id; + } + + public PortletContext getTarget() + { + return target; + } + + public String getId() + { + return id; + } + + public AccessMode getAccessMode() + { + return useClone ? AccessMode.READ_WRITE : AccessMode.CLONE_BEFORE= _WRITE; + } + + public void onStateEvent(StateEvent event) + { + target =3D event.getPortletContext(); + useClone =3D true; + resolver.setAttribute("clone." + id, target); + } + } +} Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/state/producer/ProducerPortletInvoker.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/st= ate/producer/ProducerPortletInvoker.java 2008-02-28 13:41:58 UTC (rev 10155) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/st= ate/producer/ProducerPortletInvoker.java 2008-02-28 14:45:26 UTC (rev 10156) @@ -318,6 +318,7 @@ instanceCtx.onStateEvent(event); } } + break; } case READ_WRITE: { @@ -346,6 +347,7 @@ StateEvent event =3D new StateEvent(modifiedCtx, StateEv= ent.Type.PORTLET_MODIFIED_EVENT); instanceCtx.onStateEvent(event); } + break; } case READ_ONLY: { Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/AbstractPortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-28 13:41:58 UTC (r= ev 10155) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-28 14:45:26 UTC (r= ev 10156) @@ -37,6 +37,7 @@ import org.jboss.portal.portlet.impl.spi.AbstractServerContext; import org.jboss.portal.portlet.impl.spi.AbstractUserContext; import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; +import org.jboss.portal.portlet.impl.spi.AbstractInstanceContext; import org.jboss.portal.portlet.info.PortletInfo; import org.jboss.portal.portlet.invocation.ActionInvocation; import org.jboss.portal.portlet.invocation.EventInvocation; @@ -125,17 +126,15 @@ = Portlet portlet =3D getPortlet(windowId); = - TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), true); - actionInvocation.setClientContext(new AbstractClientContext(req)); actionInvocation.setServerContext(new AbstractServerContext(req, res= p)); - actionInvocation.setInstanceContext(instanceContext); + actionInvocation.setInstanceContext(new AbstractInstanceContext(port= let.getContext().getId())); actionInvocation.setUserContext(new AbstractUserContext(req)); actionInvocation.setWindowContext(new AbstractWindowContext(windowId= )); actionInvocation.setPortalContext(new TestPortalContext()); actionInvocation.setSecurityContext(new AbstractSecurityContext(req)= ); actionInvocation.setRequestContext(new AbstractRequestContext(req)); - actionInvocation.setTarget(instanceContext.getTarget()); + actionInvocation.setTarget(portlet.getContext()); = return invoke((PortletInvocation)actionInvocation); } @@ -147,16 +146,16 @@ = Portlet portlet =3D getPortlet(windowId); = - TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), true); +// TestInstanceContext instanceContext =3D new TestInstanceContext(re= q, portlet.getContext(), true); = eventInvocation.setClientContext(new AbstractClientContext(req, requ= estCookies)); eventInvocation.setServerContext(new AbstractServerContext(req, resp= )); - eventInvocation.setInstanceContext(instanceContext); + eventInvocation.setInstanceContext(new AbstractInstanceContext(portl= et.getContext().getId())); eventInvocation.setUserContext(new AbstractUserContext(req)); eventInvocation.setWindowContext(new AbstractWindowContext(windowId)= ); eventInvocation.setPortalContext(new TestPortalContext()); eventInvocation.setSecurityContext(new AbstractSecurityContext(req)); - eventInvocation.setTarget(instanceContext.getTarget()); + eventInvocation.setTarget(portlet.getContext()); = return invoke(eventInvocation); } @@ -168,17 +167,15 @@ = Portlet portlet =3D getPortlet(windowId); = - TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), true); - resourceInvocation.setClientContext(new AbstractClientContext(req)); resourceInvocation.setServerContext(new AbstractServerContext(req, r= esp)); - resourceInvocation.setInstanceContext(instanceContext); + resourceInvocation.setInstanceContext(new AbstractInstanceContext(po= rtlet.getContext().getId())); resourceInvocation.setUserContext(new AbstractUserContext(req)); resourceInvocation.setWindowContext(new AbstractWindowContext(window= Id)); resourceInvocation.setPortalContext(new TestPortalContext()); resourceInvocation.setSecurityContext(new AbstractSecurityContext(re= q)); resourceInvocation.setRequestContext(new AbstractRequestContext(req)= ); - resourceInvocation.setTarget(instanceContext.getTarget()); + resourceInvocation.setTarget(portlet.getContext()); = // return invoke((PortletInvocation)resourceInvocation); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PageRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PageRenderer.java 2008-02-28 13:41:58 UTC (rev 10155) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PageRenderer.java 2008-02-28 14:45:26 UTC (rev 10156) @@ -37,6 +37,7 @@ import org.jboss.portal.portlet.impl.spi.AbstractServerContext; import org.jboss.portal.portlet.impl.spi.AbstractUserContext; import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; +import org.jboss.portal.portlet.impl.spi.AbstractInstanceContext; import org.jboss.portal.portlet.invocation.RenderInvocation; import org.jboss.portal.portlet.invocation.response.ErrorResponse; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; @@ -220,20 +221,18 @@ HttpServletResponse resp =3D context.getClientResponse(); = // - TestInstanceContext instanceContext =3D new TestInstanceContext(req,= portlet.getContext(), false); - PortletInvocationContext renderContext =3D context.getPortletControl= lerContext().createPortletInvocationContext(portlet.getContext().getId(), p= ageNS); = // RenderInvocation render =3D new RenderInvocation(renderContext); render.setClientContext(new AbstractClientContext(req, pagePropertie= s.getCookies())); render.setServerContext(new AbstractServerContext(req, resp)); - render.setInstanceContext(instanceContext); + render.setInstanceContext(new AbstractInstanceContext(portlet.getCon= text().getId())); render.setUserContext(new AbstractUserContext(req)); render.setWindowContext(new AbstractWindowContext(portlet.getContext= ().getId())); render.setPortalContext(new TestPortalContext()); render.setSecurityContext(new AbstractSecurityContext(req)); - render.setTarget(instanceContext.getTarget()); + render.setTarget(portlet.getContext()); render.setMode(mode); render.setWindowState(windowState); render.setNavigationalState(portletNS); Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/TestInstanceContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestInstanceContext.java 2008-02-28 13:41:58 UTC (rev 10155) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestInstanceContext.java 2008-02-28 14:45:26 UTC (rev 10156) @@ -1,103 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ - -package org.jboss.portal.portlet.test.controller; - -import org.jboss.portal.portlet.PortletContext; -import org.jboss.portal.portlet.StateEvent; -import org.jboss.portal.portlet.spi.InstanceContext; -import org.jboss.portal.portlet.state.AccessMode; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -public class TestInstanceContext implements InstanceContext -{ - - /** . */ - private HttpServletRequest req; - - /** . */ - private boolean modifiable; - - /** . */ - private PortletContext target; - - /** . */ - private boolean useClone; - - /** . */ - private String id; - - public TestInstanceContext( - HttpServletRequest req, - PortletContext portletContext, - boolean modifiable) - { - String id =3D portletContext.getId(); - PortletContext target =3D portletContext; - boolean useClone =3D false; - HttpSession session =3D req.getSession(false); - if (session !=3D null) - { - PortletContext clone =3D (PortletContext)session.getAttribute("cl= one." + id); - if (clone !=3D null) - { - target =3D clone; - useClone =3D true; - } - } - - // - this.req =3D req; - this.useClone =3D useClone; - this.target =3D target; - this.id =3D id; - this.modifiable =3D modifiable; - } - - public PortletContext getTarget() - { - return target; - } - - public String getId() - { - return id; - } - - public AccessMode getAccessMode() - { - return modifiable ? (useClone ? AccessMode.READ_WRITE : AccessMode.C= LONE_BEFORE_WRITE) : AccessMode.READ_ONLY; - } - - public void onStateEvent(StateEvent event) - { - target =3D event.getPortletContext(); - req.getSession().setAttribute("clone." + id, target); - } -} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PortalRenderResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalRenderResponse.java 2008-02-28 13:41:58 UTC (rev 10155) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalRenderResponse.java 2008-02-28 14:45:26 UTC (rev 10156) @@ -22,9 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp; = -import org.jboss.portal.portlet.test.controller.TestInstanceContext; import org.jboss.portal.portlet.test.controller.TestPortalContext; -import org.jboss.portal.portlet.test.jsp.WindowResult; import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; @@ -37,6 +35,7 @@ import org.jboss.portal.portlet.impl.spi.AbstractUserContext; import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; +import org.jboss.portal.portlet.impl.spi.AbstractInstanceContext; import org.jboss.portal.portlet.spi.PortletInvocationContext; import org.jboss.portal.WindowState; import org.jboss.portal.Mode; @@ -169,7 +168,7 @@ RenderInvocation render =3D new RenderInvocation(renderContext); render.setClientContext(new AbstractClientContext(portletControllerC= ontext.getClientRequest())); render.setServerContext(new AbstractServerContext(portletControllerC= ontext.getClientRequest(), portletControllerContext.getClientResponse())); - render.setInstanceContext(new TestInstanceContext(portletControllerC= ontext.getClientRequest(), portlet.getContext(), false)); + render.setInstanceContext(new AbstractInstanceContext(portlet.getCon= text().getId())); render.setUserContext(new AbstractUserContext(portletControllerConte= xt.getClientRequest())); render.setWindowContext(new AbstractWindowContext(windowId)); render.setPortalContext(new TestPortalContext()); Modified: modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB= -INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/j= boss-beans.xml 2008-02-28 13:41:58 UTC (rev 10155) +++ modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/j= boss-beans.xml 2008-02-28 14:45:26 UTC (rev 10156) @@ -56,10 +56,13 @@ + + + Modified: modules/portlet/trunk/test/src/test/resources/portlet-test-war/WE= B-INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/= jboss-beans.xml 2008-02-28 13:41:58 UTC (rev 10155) +++ modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/= jboss-beans.xml 2008-02-28 14:45:26 UTC (rev 10156) @@ -56,10 +56,13 @@ + + + Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-beans.xml 2008-02-28 13:41:58 UTC (rev 10155) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-beans.xml 2008-02-28 14:45:26 UTC (rev 10156) @@ -43,10 +43,13 @@ + + + --===============6669000805290633948==-- From portal-commits at lists.jboss.org Thu Feb 28 19:27:43 2008 Content-Type: multipart/mixed; boundary="===============0385283337209406634==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10157 - in modules/portlet/trunk: controller/src/main/java/org/jboss/portal/portlet/controller/event and 3 other directories. Date: Thu, 28 Feb 2008 19:27:43 -0500 Message-ID: --===============0385283337209406634== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-28 19:27:43 -0500 (Thu, 28 Feb 2008) New Revision: 10157 Added: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/EventProduction.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/event/AbstractEventControllerContext.java Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/EventPhaseSessionImpl.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/PortletRequestHandler.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/event/Event.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/event/EventControllerContext.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/event/EventPhaseSession.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/impl/event/EventControllerContextImpl.java modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/= controller/EventControllerContextSupport.java modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/= controller/PortletControllerTestCase.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PageEventControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PagePortletControllerContext.java Log: rework a bit the event controller context Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/EventPhaseSessionImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/EventPhaseSessionImpl.java 2008-02-28 14:45:26 UTC (rev 10156) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/EventPhaseSessionImpl.java 2008-02-29 00:27:43 UTC (rev 10157) @@ -37,50 +37,52 @@ { = /** . */ - private final Logger log; + static final int READ_MODE =3D 0; = /** . */ - LinkedList producedEventHistory; + static final int READ_WRITE_MODE =3D 1; = /** . */ - LinkedList consumedEventHistory; + static final int INTERRUPTED_MODE =3D 2; = /** . */ - LinkedList producedEvents; + private final Logger log; = /** . */ + LinkedList producedEvents; + + /** . */ LinkedList toConsumeEvents; = /** . */ - boolean interruped; + int consumedEventSize; = + /** . */ + int producedEventSize; + + /** . */ + int mode; + EventPhaseSessionImpl(Logger log) { this.log =3D log; - this.producedEventHistory =3D new LinkedList(); - this.consumedEventHistory =3D new LinkedList(); - this.producedEvents =3D new LinkedList(); + this.producedEvents =3D new LinkedList(); this.toConsumeEvents =3D new LinkedList(); - this.interruped =3D false; + this.consumedEventSize =3D 0; + this.producedEventSize =3D 0; + this.mode =3D READ_MODE; } = - public Iterator browseProducedEventHistory() - { - return this.producedEventHistory.iterator(); - } - - - public Iterator browseConsumedEventHistory() - { - return this.consumedEventHistory.iterator(); - } - public void queueEvent(Event event) { - if (interruped) + if (mode =3D=3D INTERRUPTED_MODE) { - throw new IllegalStateException("The event phase is interruped"); + throw new IllegalStateException("The event phase cannot queue eve= nts because it is interruped"); } + if (mode =3D=3D READ_MODE) + { + throw new IllegalStateException("The event phase cannot queue eve= nts"); + } if (event =3D=3D null) { throw new IllegalArgumentException("No null event accepted"); @@ -95,9 +97,15 @@ = public void interrupt() { + if (mode =3D=3D READ_MODE) + { + throw new IllegalStateException("The event phase is not interrupt= able"); + } + + // log.trace("Event delivery interruped"); = // - this.interruped =3D true; + this.mode =3D INTERRUPTED_MODE; } } Added: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/port= let/controller/EventProduction.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/EventProduction.java (rev 0) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/EventProduction.java 2008-02-29 00:27:43 UTC (rev 10157) @@ -0,0 +1,55 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.controller; + +import org.jboss.portal.portlet.controller.event.Event; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +class EventProduction +{ + + /** . */ + private final Event consumedEvent; + + /** . */ + private final Event producedEvent; + + EventProduction(Event consumedEvent, Event producedEvent) + { + this.consumedEvent =3D consumedEvent; + this.producedEvent =3D producedEvent; + } + + public Event getConsumedEvent() + { + return consumedEvent; + } + + public Event getProducedEvent() + { + return producedEvent; + } +} Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/PortletRequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/PortletRequestHandler.java 2008-02-28 14:45:26 UTC (rev 10156) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/PortletRequestHandler.java 2008-02-29 00:27:43 UTC (rev 10157) @@ -111,7 +111,8 @@ // Feed session it with the events that may have been produced for (UpdateNavigationalStateResponse.Event portletEvent : stateRe= sponse.getEvents()) { - session.producedEvents.add(new Event(portletEvent.getName(), p= ortletEvent.getPayload(), portletRequest.getWindowId())); + Event producedEvent =3D new Event(portletEvent.getName(), port= letEvent.getPayload(), portletRequest.getWindowId()); + session.producedEvents.add(new EventProduction(null, producedE= vent)); } = // @@ -120,7 +121,8 @@ // Deliver events while (session.producedEvents.size() > 0) { - Event producedEvent =3D session.producedEvents.removeFirst(); + EventProduction eventProduction =3D session.producedEvents.rem= oveFirst(); + Event producedEvent =3D eventProduction.getProducedEvent(); = // String producerId =3D producedEvent.getWindowId(); @@ -147,7 +149,7 @@ int producedEventThreshold =3D controller.getProducedEventThre= shold(); if (producedEventThreshold >=3D 0) { - if (session.producedEventHistory.size() + 1 > producedEvent= Threshold) + if (session.producedEventSize + 1 > producedEventThreshold) { log.trace("Event distribution interrupted because the ma= ximum number of produced event is reached"); eventDistributionStatus =3D PortletResponse.PRODUCED_EVE= NT_FLOODED; @@ -158,7 +160,8 @@ // Give control to the event context try { - eventCC.handleEvent(session, producedEvent); + session.mode =3D EventPhaseSessionImpl.READ_WRITE_MODE; + eventCC.eventProduced(session, eventProduction.getConsumedE= vent(), producedEvent); } catch (Exception e) { @@ -168,7 +171,7 @@ } = // Perform flow control - if (session.interruped) + if (session.mode =3D=3D EventPhaseSessionImpl.INTERRUPTED_MODE) { log.trace("Event distribution interrupted by controller con= text"); eventDistributionStatus =3D PortletResponse.INTERRUPTED; @@ -185,8 +188,6 @@ = // PortletInfo consumerPortletInfo =3D context.getPortletInfo(= consumedId); - - // if (consumerPortletInfo =3D=3D null) { if (log.isTraceEnabled()) @@ -213,7 +214,7 @@ int consumedEventThreshold =3D controller.getConsumedEventT= hreshold(); if (consumedEventThreshold >=3D 0) { - if (session.consumedEventHistory.size() + 1 > consumedEv= entThreshold) + if (session.consumedEventSize + 1 > consumedEventThresho= ld) { log.trace("Event distribution interrupted because the= maximum number of consumed event is reached"); eventDistributionStatus =3D PortletResponse.CONSUMED_= EVENT_FLOODED; @@ -225,8 +226,19 @@ PortletInvocationResponse eventResponse =3D deliverEvent(co= ntext, toConsumeEvent, pageNavigationalState, requestProperties.getCookies(= )); = // Now it is consumed we add it to the history - session.consumedEventHistory.addFirst(toConsumeEvent); + session.consumedEventSize++; = + // And we make a callback + try + { + session.mode =3D EventPhaseSessionImpl.READ_MODE; + eventCC.eventConsumed(session, producedEvent, toConsumeE= vent); + } + catch (Exception e) + { + log.trace("Event consumed callback threw an exception th= at is ignored by the controller", e); + } + // if (eventResponse instanceof UpdateNavigationalStateRespons= e) { @@ -238,7 +250,8 @@ // Add events to source event queue for (UpdateNavigationalStateResponse.Event portletEvent = : eventStateResponse.getEvents()) { - session.producedEvents.add(new Event(portletEvent.get= Name(), portletEvent.getPayload(), toConsumeEvent.getWindowId())); + Event blah =3D new Event(portletEvent.getName(), port= letEvent.getPayload(), toConsumeEvent.getWindowId()); + session.producedEvents.add(new EventProduction(toCons= umeEvent, blah)); } = // @@ -259,7 +272,7 @@ } = // We archive the consumed event in the history - session.producedEventHistory.addFirst(producedEvent); + session.producedEventSize++; } = // Added: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/port= let/controller/event/AbstractEventControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/event/AbstractEventControllerContext.java = (rev 0) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/event/AbstractEventControllerContext.java 2008-02-29 00:27:43 U= TC (rev 10157) @@ -0,0 +1,40 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.controller.event; + +/** + * An implementation of the event controller context that do no ops. + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class AbstractEventControllerContext implements EventControllerCont= ext +{ + public void eventProduced(EventPhaseSession session, Event sourceEvent,= Event producedEvent) + { + } + + public void eventConsumed(EventPhaseSession session, Event sourceEvent,= Event consumedEvent) + { + } +} Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/event/Event.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/event/Event.java 2008-02-28 14:45:26 UTC (rev 10156) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/event/Event.java 2008-02-29 00:27:43 UTC (rev 10157) @@ -24,6 +24,7 @@ = import javax.xml.namespace.QName; import java.io.Serializable; +import java.util.concurrent.atomic.AtomicLong; = /** * An event associated with a portlet window. @@ -34,6 +35,8 @@ public class Event { = + private static final AtomicLong generator =3D new AtomicLong(); + /** . */ private final QName name; = @@ -43,6 +46,9 @@ /** . */ private final String windowId; = + /** . */ + private final long serialNumber =3D generator.incrementAndGet(); + public Event(QName name, Serializable payload, String windowId) { if (name =3D=3D null) @@ -73,8 +79,13 @@ return windowId; } = + public long getSerialNumber() + { + return serialNumber; + } + public String toString() { - return "Event[name=3D" + name + ",windowId=3D" + windowId + ",payloa= d=3D" + payload + "]"; + return "Event[name=3D" + name + ",windowId=3D" + windowId + ",payloa= d=3D" + payload + ",serialNumber=3D" + serialNumber + "]"; } } Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/event/EventControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/event/EventControllerContext.java 2008-02-28 14:45:26 UTC (rev = 10156) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/event/EventControllerContext.java 2008-02-29 00:27:43 UTC (rev = 10157) @@ -44,8 +44,26 @@ * to the portlet controller invoker.

            * * @param session the session + * @param sourceEvent the source event * @param producedEvent the produced event */ - void handleEvent(EventPhaseSession session, Event producedEvent); + void eventProduced(EventPhaseSession session, Event sourceEvent, Event = producedEvent); = + /** + *

            Signal to the context when an event is consumed by a portlet. The= session argument + * only provides querying capabilities and it is not possible to queue = event + * or interrupt the session.

            + * + *

            During the invocation of this method, any runtime exception throw= n will + * be ignored by the controller.

            + * + *

            During the invocation of this method, any error thrown will be pr= opagated + * to the portlet controller invoker.

            + * + * @param session the session + * @param sourceEvent the source event + * @param consumedEvent the consumed event + */ + void eventConsumed(EventPhaseSession session, Event sourceEvent, Event = consumedEvent); + } Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/event/EventPhaseSession.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/event/EventPhaseSession.java 2008-02-28 14:45:26 UTC (rev 10156) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/event/EventPhaseSession.java 2008-02-29 00:27:43 UTC (rev 10157) @@ -22,8 +22,6 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.controller.event; = -import java.util.Iterator; - /** * @author Julien Viet * @version $Revision: 630 $ @@ -32,33 +30,19 @@ { = /** - * Returns an iterator for browsing the history of the produced events. - * The iterator returns the produced events from the most recent to the= oldest. - * - * @return all the events produced during the session - */ - Iterator browseProducedEventHistory(); - - /** - * Returns an iterator for browsing the history of the consumed events. - * The iterator returns the consumed events from the most recent to the= oldest. - * - * @return all the events consumed during the session - */ - Iterator browseConsumedEventHistory(); - - /** * Queue an event for consumption. The queue is a FIFO queue. * * @param event an event * @throws IllegalArgumentException if the event is null - * @throws IllegalStateException if the event phase is interrupted + * @throws IllegalStateException if an event cannot be published */ void queueEvent(Event event) throws IllegalArgumentException, IllegalSt= ateException; = /** * Stop processing of all events and returns from the controller. + * + * @throws IllegalStateException if the session cannot be interrupted. */ - void interrupt(); + void interrupt() throws IllegalStateException; = } Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/impl/event/EventControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/event/EventControllerContextImpl.java 2008-02-28 14:45:26 = UTC (rev 10156) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/event/EventControllerContextImpl.java 2008-02-29 00:27:43 = UTC (rev 10157) @@ -45,7 +45,7 @@ this.invoker =3D invoker; } = - public void handleEvent(EventPhaseSession session, Event producedEvent) + public void eventProduced(EventPhaseSession session, Event sourceEvent,= Event producedEvent) { try { @@ -54,8 +54,8 @@ PortletInfo portletInfo =3D portlet.getInfo(); if (portletInfo.getEventing().getConsumedEvents().containsKey(= producedEvent.getName())) { - Event consumedEvent =3D new Event(producedEvent.getName(), = producedEvent.getPayload(), portlet.getContext().getId()); - session.queueEvent(consumedEvent); + Event distributedEvent =3D new Event(producedEvent.getName(= ), producedEvent.getPayload(), portlet.getContext().getId()); + session.queueEvent(distributedEvent); } } } @@ -65,4 +65,8 @@ session.interrupt(); } } + + public void eventConsumed(EventPhaseSession session, Event sourceEvent,= Event consumedEvent) + { + } } Modified: modules/portlet/trunk/controller/src/test/java/org/jboss/portal/p= ortlet/controller/EventControllerContextSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet= /controller/EventControllerContextSupport.java 2008-02-28 14:45:26 UTC (rev= 10156) +++ modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet= /controller/EventControllerContextSupport.java 2008-02-29 00:27:43 UTC (rev= 10157) @@ -42,7 +42,7 @@ /** . */ private final Map> wires =3D new HashMap>(); = - public void handleEvent(EventPhaseSession session, Event producedEvent) + public void eventProduced(EventPhaseSession session, Event sourceEvent,= Event producedEvent) { List dsts =3D wires.get(new Point(producedEvent.getName(), pr= oducedEvent.getWindowId())); = @@ -56,6 +56,10 @@ } } = + public void eventConsumed(EventPhaseSession session, Event sourceEvent,= Event consumedEvent) + { + } + public void createWire(QName srcName, String srcWindowId, QName dstName= , String dstWindowId) { Point src =3D new Point(srcName, srcWindowId); Modified: modules/portlet/trunk/controller/src/test/java/org/jboss/portal/p= ortlet/controller/PortletControllerTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet= /controller/PortletControllerTestCase.java 2008-02-28 14:45:26 UTC (rev 101= 56) +++ modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet= /controller/PortletControllerTestCase.java 2008-02-29 00:27:43 UTC (rev 101= 57) @@ -29,9 +29,9 @@ import org.jboss.portal.portlet.controller.response.ControllerResponse; import org.jboss.portal.portlet.controller.response.PageUpdateResponse; import org.jboss.portal.portlet.controller.response.PortletResponse; -import org.jboss.portal.portlet.controller.event.EventControllerContext; import org.jboss.portal.portlet.controller.event.EventPhaseSession; import org.jboss.portal.portlet.controller.event.Event; +import org.jboss.portal.portlet.controller.event.AbstractEventControllerCo= ntext; import org.jboss.portal.portlet.OpaqueStateString; import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.support.PortletSupport; @@ -310,9 +310,9 @@ // controller.setConsumedEventThreshold(10); controller.setProducedEventThreshold(10); - context.setEventControllerContext(new EventControllerContext() + context.setEventControllerContext(new AbstractEventControllerContext= () { - public void handleEvent(EventPhaseSession session, Event produced= Event) + public void eventProduced(EventPhaseSession session, Event source= Event, Event producedEvent) { session.interrupt(); } @@ -348,9 +348,9 @@ // controller.setConsumedEventThreshold(10); controller.setProducedEventThreshold(10); - context.setEventControllerContext(new EventControllerContext() + context.setEventControllerContext(new AbstractEventControllerContext= () { - public void handleEvent(EventPhaseSession session, Event produced= Event) + public void eventProduced(EventPhaseSession session, Event source= Event, Event producedEvent) { throw new RuntimeException(); } @@ -362,9 +362,9 @@ = // final Error error =3D new Error(); - context.setEventControllerContext(new EventControllerContext() + context.setEventControllerContext(new AbstractEventControllerContext= () { - public void handleEvent(EventPhaseSession session, Event produced= Event) + public void eventProduced(EventPhaseSession session, Event source= Event, Event producedEvent) { throw error; } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PageEventControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PageEventControllerContext.java 2008-02-28 14:45:26 UTC (rev 10156) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PageEventControllerContext.java 2008-02-29 00:27:43 UTC (rev 10157) @@ -29,9 +29,6 @@ import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.info.PortletInfo; = -import java.util.List; -import java.util.ArrayList; - /** * Route events according to the portlets discovered on the page. For now = it is pretty trivial. * We could leverage JSP tags to 'wire' portlets on the same page for inst= ance. @@ -56,7 +53,7 @@ this.prepareResponse =3D prepareResponse; } = - public void handleEvent(EventPhaseSession session, Event producedEvent) + public void eventProduced(EventPhaseSession session, Event sourceEvent,= Event producedEvent) { for (String windowId : prepareResponse.getWindowIds()) { @@ -72,17 +69,20 @@ // if (portletInfo.getEventing().getConsumedEvents().containsK= ey(producedEvent.getName())) { - session.queueEvent(new Event(producedEvent.getName(), pr= oducedEvent.getPayload(), windowId)); + Event distributedEvent =3D new Event(producedEvent.getNa= me(), producedEvent.getPayload(), windowId); + session.queueEvent(distributedEvent); } } } catch (PortletInvokerException e) { e.printStackTrace(); - - // session.interrupt(); } } } + + public void eventConsumed(EventPhaseSession session, Event sourceEvent,= Event consumedEvent) + { + } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PagePortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-28 14:45:26 UTC (rev 10156) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-29 00:27:43 UTC (rev 10157) @@ -26,7 +26,6 @@ import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.PortletInvoker; import org.jboss.portal.portlet.info.PortletInfo; -import org.jboss.portal.portlet.controller.event.EventControllerContext; import org.jboss.portal.portlet.controller.state.StateControllerContext; import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.PageNavigationalStateSeri= alization; @@ -53,7 +52,7 @@ { = /** . */ - private final EventControllerContext eventControllerContext; + private final PageEventControllerContext eventControllerContext; = /** . */ private final StateControllerContext stateControllerContext; @@ -118,7 +117,7 @@ return invoker.invoke(invocation); } = - public EventControllerContext getEventControllerContext() + public PageEventControllerContext getEventControllerContext() { return eventControllerContext; } --===============0385283337209406634==-- From portal-commits at lists.jboss.org Fri Feb 29 12:00:24 2008 Content-Type: multipart/mixed; boundary="===============0599730529872918953==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10158 - in modules/portlet/trunk: mc and 37 other directories. Date: Fri, 29 Feb 2008 12:00:23 -0500 Message-ID: --===============0599730529872918953== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-29 12:00:22 -0500 (Fri, 29 Feb 2008) New Revision: 10158 Added: modules/portlet/trunk/mc/ modules/portlet/trunk/mc/pom.xml modules/portlet/trunk/mc/src/ modules/portlet/trunk/mc/src/main/ modules/portlet/trunk/mc/src/main/java/ modules/portlet/trunk/mc/src/main/java/org/ modules/portlet/trunk/mc/src/main/java/org/jboss/ modules/portlet/trunk/mc/src/main/java/org/jboss/portal/ modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/ modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/ modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/Portl= etApplicationContextImpl.java modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/Portl= etApplicationDeployer.java modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/Portl= etApplicationDeployment.java modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/Portl= etContainerContextImpl.java modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/Portl= etFilterContextImpl.java modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metad= ata/ modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metad= ata/factory/ modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metad= ata/factory/LocalizedStringBuilder.java modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metad= ata/factory/PortletApplicationModelFactory.java modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metad= ata/impl/ modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metad= ata/impl/AnnotationPortletApplication10MetaData.java modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metad= ata/impl/AnnotationPortletApplication20MetaData.java modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metad= ata/impl/PortletApplicationMetaDataException.java modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metad= ata/impl/ValueTrimmingFilter.java modules/portlet/trunk/mc/src/test/ modules/portlet/trunk/mc/src/test/java/ modules/portlet/trunk/mc/src/test/java/org/ modules/portlet/trunk/mc/src/test/java/org/jboss/ modules/portlet/trunk/mc/src/test/java/org/jboss/portal/ modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/ modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/ modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metad= ata/ modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metad= ata/AbstractMetaDataTestCase.java modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metad= ata/CustomPortletModeTestEverythingTestCase.java modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metad= ata/CustomWindowStateTestEverythingTestCase.java modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metad= ata/EventTestEverythingTestCase.java modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metad= ata/FilterTestEverythingTestCase.java modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metad= ata/GeneralMetaDataTestCase.java modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metad= ata/PortletTestEverythingTestCase.java modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metad= ata/RenderParameterTestEverythingTestCase.java modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metad= ata/SecurityConstraintTestEverythingTestCase.java modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metad= ata/UserAttributeTestEverythingTestCase.java modules/portlet/trunk/mc/src/test/resources/ modules/portlet/trunk/mc/src/test/resources/local-jboss-unit.xml modules/portlet/trunk/mc/src/test/resources/metadata/ modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/ modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/p= ortlet1-fail.xml modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/p= ortlet1.xml modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/p= ortlet2.xml modules/portlet/trunk/mc/src/test/resources/metadata/customWindowState/ modules/portlet/trunk/mc/src/test/resources/metadata/customWindowState/p= ortlet1.xml modules/portlet/trunk/mc/src/test/resources/metadata/customWindowState/p= ortlet2.xml modules/portlet/trunk/mc/src/test/resources/metadata/event/ modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-event= 1.xml modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-event= 2-fail.xml modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-event= 2.xml modules/portlet/trunk/mc/src/test/resources/metadata/filter/ modules/portlet/trunk/mc/src/test/resources/metadata/filter/portlet-filt= er1.xml modules/portlet/trunk/mc/src/test/resources/metadata/filter/portlet-filt= er2.xml modules/portlet/trunk/mc/src/test/resources/metadata/general/ modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet-app= _1_0.xml modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet-app= _2_0.xml modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet1.xml modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet2-js= r286.xml modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet2.xml modules/portlet/trunk/mc/src/test/resources/metadata/portlet-app_1_0.xsd modules/portlet/trunk/mc/src/test/resources/metadata/portlet-app_2_0.xsd modules/portlet/trunk/mc/src/test/resources/metadata/portlet/ modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet1-si= mple.xml modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet1.xml modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet2-js= r286.xml modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet2.xml modules/portlet/trunk/mc/src/test/resources/metadata/renderParameter/ modules/portlet/trunk/mc/src/test/resources/metadata/renderParameter/por= tlet2.xml modules/portlet/trunk/mc/src/test/resources/metadata/security/ modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet1-f= ail1.xml modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet1-f= ail2.xml modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet1.x= ml modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet2-f= ail1.xml modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet2-f= ail2.xml modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet2.x= ml modules/portlet/trunk/mc/src/test/resources/metadata/userAttribute/ modules/portlet/trunk/mc/src/test/resources/metadata/userAttribute/portl= et1.xml modules/portlet/trunk/mc/src/test/resources/metadata/userAttribute/portl= et2.xml Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletApplicationContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletApplicationDeployer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletApplicationDeployment.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletContainerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortletFilterContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/m= etadata/ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/m= etadata/ modules/portlet/trunk/test/src/test/resources/metadata/ Modified: modules/portlet/trunk/pom.xml modules/portlet/trunk/test/pom.xml modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/T= estPortletApplicationDeployer.java modules/portlet/trunk/test/src/test/build.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/= jboss-beans.xml modules/portlet/trunk/test/src/test/resources/test/local-jboss-unit.xml Log: create a portlet-mc module for holding integration with JBoss MC Added: modules/portlet/trunk/mc/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/pom.xml (rev 0) +++ modules/portlet/trunk/mc/pom.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,58 @@ + + + org.jboss.portal.portlet + module-parent + 2.0-SNAPSHOT + ../build/pom.xml + + 4.0.0 + portlet-mc + jar + Portlet Container / JBoss MC integration + + + + org.jboss.portal.portlet + portlet-portlet + ${project.version} + + + org.jboss + jbossxb + + + org.jboss.unit + jboss-unit + + + + + + + org.jboss.unit + jboss-unit-tooling-maven2 + + + test + + execute + + + + + + + local-jboss-unit.xml + + + + target/tests/reports/xml/local + target/tests/reports/html/local + + + + + + + Added: modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/P= ortletApplicationContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/Port= letApplicationContextImpl.java (rev 0) +++ modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/Port= letApplicationContextImpl.java 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,72 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.mc; + +import org.jboss.portal.portlet.container.PortletApplicationContext; +import org.jboss.portal.portlet.container.managed.ManagedPortletApplicatio= n; +import org.jboss.portal.web.WebApp; + +import javax.servlet.ServletContext; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletApplicationContextImpl implements PortletApplicationCo= ntext +{ + + /** . */ + private final WebApp webApp; + + ManagedPortletApplication managedPortletApplication; + + public PortletApplicationContextImpl(WebApp webApp) + { + this.webApp =3D webApp; + } + + public ServletContext getServletContext() + { + return webApp.getServletContext(); + } + + public String getContextPath() + { + return webApp.getContextPath(); + } + + public ClassLoader getClassLoader() + { + return webApp.getClassLoader(); + } + + public void managedStart() + { + managedPortletApplication.managedStart(); + } + + public void managedStop() + { + managedPortletApplication.managedStop(); + } +} Added: modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/P= ortletApplicationDeployer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/Port= letApplicationDeployer.java (rev 0) +++ modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/Port= letApplicationDeployer.java 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,346 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.mc; + +import org.apache.log4j.Logger; +import org.jboss.portal.common.io.IOTools; +import org.jboss.portal.portlet.container.managed.PortletApplicationRegist= ry; +import org.jboss.portal.portlet.container.managed.ManagedPortletApplicatio= n; +import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= ntBroadcaster; +import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= ntListener; +import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= nt; +import org.jboss.portal.portlet.container.managed.ManagedObjectEvent; +import org.jboss.portal.portlet.container.managed.ManagedObject; +import org.jboss.portal.portlet.container.managed.ManagedObjectLifeCycleEv= ent; +import org.jboss.portal.portlet.container.managed.LifeCycleStatus; +import org.jboss.portal.portlet.container.PortletContainerInvoker; +import org.jboss.portal.portlet.container.PortletContainer; +import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; +import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConsta= nts.PORTLET_JSR_168_NS; +import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConsta= nts.PORTLET_JSR_286_NS; +import org.jboss.portal.portlet.impl.container.PortletApplicationLifeCycle; +import org.jboss.portal.portlet.impl.container.PortletContainerLifeCycle; +import org.jboss.portal.portlet.mc.metadata.factory.PortletApplicationMode= lFactory; +import org.jboss.portal.portlet.mc.metadata.impl.AnnotationPortletApplicat= ion10MetaData; +import org.jboss.portal.portlet.mc.metadata.impl.AnnotationPortletApplicat= ion20MetaData; +import org.jboss.portal.portlet.mc.metadata.impl.ValueTrimmingFilter; +import org.jboss.portal.web.ServletContainer; +import org.jboss.portal.web.WebApp; +import org.jboss.portal.web.WebAppEvent; +import org.jboss.portal.web.WebAppLifeCycleEvent; +import org.jboss.portal.web.WebAppListener; +import org.jboss.xb.binding.JBossXBException; +import org.jboss.xb.binding.Unmarshaller; +import org.jboss.xb.binding.UnmarshallerFactory; +import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver; +import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFa= ctory; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.HashMap; +import java.util.Map; +import java.util.Collection; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class PortletApplicationDeployer implements WebAppListener, Portlet= ApplicationRegistry +{ + + static + { + try + { + SingletonSchemaResolverFactory factory =3D SingletonSchemaResolve= rFactory.getInstance(); + DefaultSchemaResolver resolver =3D (DefaultSchemaResolver)factory= .getSchemaBindingResolver(); + + /** SchemaResolver */ + resolver.addSchemaLocation(PORTLET_JSR_168_NS, "portlet-app_1_0.x= sd"); + resolver.addSchemaLocation(PORTLET_JSR_286_NS, "portlet-app_2_0.x= sd"); + resolver.addClassBinding(PORTLET_JSR_286_NS, AnnotationPortletApp= lication20MetaData.class); + resolver.addClassBinding(PORTLET_JSR_168_NS, AnnotationPortletApp= lication10MetaData.class); + } + catch (Exception e) + { + throw new Error(e); + } + } + + /** . */ + private Logger log =3D Logger.getLogger(PortletApplicationDeployer.clas= s); + + /** . */ + private PortletApplicationRegistry registry; + + /** . */ + private ServletContainer servletContainer; + + /** . */ + private Map deploymentMap =3D new= HashMap(); + + /** . */ + private ClassLoader classLoader; + + /** . */ + private final Map applications =3D= new HashMap(); + + /** . */ + private PortletContainerInvoker portletContainerInvoker; + + /** . */ + private ManagedObjectRegistryEventBroadcaster broadcaster; + + public PortletApplicationRegistry getRegistry() + { + return registry; + } + + public void setRegistry(PortletApplicationRegistry registry) + { + this.registry =3D registry; + } + + public ServletContainer getServletContainer() + { + return servletContainer; + } + + public void setServletContainer(ServletContainer servletContainer) + { + this.servletContainer =3D servletContainer; + } + + public PortletContainerInvoker getPortletContainerInvoker() + { + return portletContainerInvoker; + } + + public void setPortletContainerInvoker(PortletContainerInvoker portletC= ontainerInvoker) + { + this.portletContainerInvoker =3D portletContainerInvoker; + } + + public void onEvent(WebAppEvent event) + { + if (event instanceof WebAppLifeCycleEvent) + { + WebAppLifeCycleEvent lifeCycleEvent =3D (WebAppLifeCycleEvent)eve= nt; + String cp =3D event.getWebApp().getContextPath(); + switch (lifeCycleEvent.getType()) + { + case WebAppLifeCycleEvent.ADDED: + log.debug("Going to install war file" + cp); + add(event.getWebApp()); + log.debug("Installed war file" + cp); + break; + case WebAppLifeCycleEvent.REMOVED: + try + { + log.debug("Going to uninstall war file" + cp); + remove(event.getWebApp()); + log.debug("Uninstalled war file" + cp); + } + catch (Throwable e) + { + log.error("Uninstalled war file " + cp + " with an error= ", e); + } + break; + } + } + } + + protected void add(WebApp webApp) + { + // + PortletApplication10MetaData metaData =3D buildPortletApplicationMet= aData(webApp); + if (metaData !=3D null) + { + ClassLoader oldCL =3D Thread.currentThread().getContextClassLoade= r(); + try + { + Thread.currentThread().setContextClassLoader(classLoader); + PortletApplicationDeployment deployment =3D new PortletApplica= tionDeployment(broadcaster, webApp, metaData); + deploymentMap.put(webApp.getContextPath(), deployment); + deployment.install(); + + // + PortletApplicationLifeCycle portletApplicationLifeCycle =3D de= ployment.getPortletApplicationLifeCycle(); + applications.put(portletApplicationLifeCycle.getId(), portletA= pplicationLifeCycle); + } + finally + { + Thread.currentThread().setContextClassLoader(oldCL); + } + } + } + + private void remove(WebApp webApp) + { + PortletApplicationDeployment deployment =3D deploymentMap.remove(web= App.getContextPath()); + if (deployment !=3D null) + { + PortletApplicationLifeCycle portletApplicationLifeCycle =3D deplo= yment.getPortletApplicationLifeCycle(); + applications.remove(portletApplicationLifeCycle.getId()); + + // + ClassLoader oldCL =3D Thread.currentThread().getContextClassLoade= r(); + try + { + Thread.currentThread().setContextClassLoader(classLoader); + deployment.uninstall(); + } + finally + { + Thread.currentThread().setContextClassLoader(oldCL); + } + } + } + + public void start() + { + broadcaster =3D new ManagedObjectRegistryEventBroadcaster(); + classLoader =3D Thread.currentThread().getContextClassLoader(); + + // + broadcaster.addListener(bridgeToInvoker); + servletContainer.addWebAppListener(this); + } + + public void stop() + { + // This should generate remove web app event and in cascade clear th= e registry + // as well as the portlet container invoker + servletContainer.removeWebAppListener(this); + + // + classLoader =3D null; + broadcaster =3D null; + } + + private PortletApplication10MetaData buildPortletApplicationMetaData(We= bApp webApp) + { + try + { + URL url =3D webApp.getServletContext().getResource("/WEB-INF/port= let.xml"); + if (url !=3D null) + { + InputStream in =3D null; + try + { + in =3D IOTools.safeBufferedWrapper(url.openStream()); + + // Validate = + Unmarshaller unmarshaller =3D UnmarshallerFactory.newInstan= ce().newUnmarshaller(); + unmarshaller.setNamespaceAware(true); + unmarshaller.setSchemaValidation(false); + unmarshaller.setValidation(false); + + // + PortletApplicationModelFactory factory =3D new PortletAppli= cationModelFactory(); + + // Unmarshal + PortletApplication10MetaData portletApplicationMD =3D (Port= letApplication10MetaData)unmarshaller.unmarshal(in, new ValueTrimmingFilter= (factory), null); + + // + return portletApplicationMD; + } + finally + { + IOTools.safeClose(in); + } + } + } + catch (IOException e) + { + log.error("Cannot read portlet.xml", e); + } + catch (JBossXBException e) + { + log.error("Cannot parse portlet.xml", e); + } + return null; + } + + public Collection getManagedPortle= tApplications() + { + return applications.values(); + } + + public ManagedPortletApplication getManagedPortletApplication(String id) + { + return applications.get(id); + } + + public void addListener(ManagedObjectRegistryEventListener listener) + { + broadcaster.addListener(listener); + } + + public void removeListener(ManagedObjectRegistryEventListener listener) + { + broadcaster.addListener(listener); + } + + /** + * Bridge managed object event to add/remove portlet container in portl= et container invoker. + */ + private final ManagedObjectRegistryEventListener bridgeToInvoker =3D ne= w ManagedObjectRegistryEventListener() + { + public void onEvent(ManagedObjectRegistryEvent event) + { + if (event instanceof ManagedObjectEvent) + { + ManagedObjectEvent managedObjectEvent =3D (ManagedObjectEvent)= event; + ManagedObject managedObject =3D managedObjectEvent.getManagedO= bject(); + + // + if (managedObject instanceof PortletContainerLifeCycle) + { + PortletContainerLifeCycle portletContainerLifeCycle =3D (Po= rtletContainerLifeCycle)managedObject; + PortletContainer portletContainer =3D portletContainerLifeC= ycle.getPortletContainer(); + + // + if (managedObjectEvent instanceof ManagedObjectLifeCycleEve= nt) + { + ManagedObjectLifeCycleEvent lifeCycleEvent =3D (ManagedO= bjectLifeCycleEvent)managedObjectEvent; + + // + LifeCycleStatus status =3D lifeCycleEvent.getStatus(); + + // + if (status =3D=3D LifeCycleStatus.STARTED) + { + portletContainerInvoker.addPortletContainer(portletCo= ntainer); + } + else + { + portletContainerInvoker.removePortletContainer(portle= tContainer); + } + } + } + } + } + }; +} Added: modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/P= ortletApplicationDeployment.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/Port= letApplicationDeployment.java (rev 0) +++ modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/Port= letApplicationDeployment.java 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,168 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.mc; + +import org.apache.log4j.Logger; +import org.jboss.portal.portlet.impl.info.ContainerInfoBuilder; +import org.jboss.portal.portlet.impl.info.ContainerInfoBuilderContext; +import org.jboss.portal.portlet.impl.info.ContainerPortletInfo; +import org.jboss.portal.portlet.impl.info.ContainerFilterInfo; +import org.jboss.portal.portlet.impl.jsr168.ContainerInfoBuilderContextImp= l; +import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl; +import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl; +import org.jboss.portal.portlet.impl.jsr168.PortletFilterImpl; +import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; +import org.jboss.portal.portlet.impl.container.PortletApplicationLifeCycle; +import org.jboss.portal.portlet.impl.container.PortletFilterLifeCycle; +import org.jboss.portal.portlet.impl.container.PortletContainerLifeCycle; +import org.jboss.portal.portlet.container.object.PortletApplicationObject; +import org.jboss.portal.portlet.container.object.PortletContainerObject; +import org.jboss.portal.portlet.container.object.PortletFilterObject; +import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= ntListener; +import org.jboss.portal.web.WebApp; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class PortletApplicationDeployment +{ + + /** . */ + private final Logger log; + + /** . */ + private final WebApp webApp; + + /** . */ + private final PortletApplication10MetaData metaData; + + /** . */ + private final ManagedObjectRegistryEventListener listener; + + /** . */ + private PortletApplicationLifeCycle portletApplicationLifeCycle; + + public PortletApplicationDeployment( + ManagedObjectRegistryEventListener listener, + WebApp webApp, + PortletApplication10MetaData metaData) + { + this.listener =3D listener; + this.webApp =3D webApp; + this.metaData =3D metaData; + this.log =3D Logger.getLogger(PortletApplicationDeployment.class + "= ." + webApp.getContextPath().replace('.', '_')); + } + + public PortletApplicationLifeCycle getPortletApplicationLifeCycle() + { + return portletApplicationLifeCycle; + } + + void install() + { + + log.debug("Starting installation"); + + // + ContainerInfoBuilderContext builderContext =3D new ContainerInfoBuil= derContextImpl(metaData, webApp); + ContainerInfoBuilder builder =3D new ContainerInfoBuilder(webApp.get= ContextPath(), metaData, builderContext); + builder.build(); + + // + PortletApplicationObject portletApplicationObject =3D new PortletApp= licationImpl(builder.getApplication()); + PortletApplicationContextImpl portletApplicationContext =3D new Port= letApplicationContextImpl(webApp); + + + // + portletApplicationLifeCycle =3D new PortletApplicationLifeCycle( + listener, + portletApplicationContext, + portletApplicationObject); + + // Needed for the managed callbacks + portletApplicationContext.managedPortletApplication =3D portletAppli= cationLifeCycle; + + // + for (ContainerFilterInfo filterInfo : builder.getApplication().getFi= lters().values()) + { + PortletFilterObject portletFilterObject =3D new PortletFilterImpl= (filterInfo); + PortletFilterContextImpl portletFilterContext =3D new PortletFilt= erContextImpl(); + + // + PortletFilterLifeCycle portletFilterLifeCycle =3D portletApplicat= ionLifeCycle.addPortletFilter(portletFilterContext, portletFilterObject); + + // Needed for the managed callbacks + portletFilterContext.managedPortletFilter =3D portletFilterLifeCy= cle; + } + + // + for (ContainerPortletInfo containerInfo : builder.getPortlets()) + { + PortletContainerObject portletContainerObject =3D new PortletCont= ainerImpl(containerInfo); + PortletContainerContextImpl portletContainerContext =3D new Portl= etContainerContextImpl(); + = + // + PortletContainerLifeCycle portletContainerLifeCycle =3D portletAp= plicationLifeCycle.addPortletContainer(portletContainerContext, portletCont= ainerObject); + + // Needed for the managed callbacks + portletContainerContext.managedPortletContainer =3D portletContai= nerLifeCycle; + + // Now create deps + for (String filterRef : containerInfo.getFilterRefs()) + { + PortletFilterLifeCycle portletFilterLifeCycle =3D portletAppli= cationLifeCycle.getManagedPortletFilter(filterRef); + + // + if (portletFilterLifeCycle !=3D null) + { + portletApplicationLifeCycle.addDependency(portletFilterLife= Cycle, portletContainerLifeCycle); + } + else + { + // todo + } + } + } + + // + portletApplicationLifeCycle.create(); + + // + portletApplicationLifeCycle.managedStart(); + + // + + } + + void uninstall() + { + log.debug("Uninstalling"); + + // + portletApplicationLifeCycle.managedStop(); + + // + log.debug("Uninstalled"); + } +} Added: modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/P= ortletContainerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/Port= letContainerContextImpl.java (rev 0) +++ modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/Port= letContainerContextImpl.java 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,47 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.mc; + +import org.jboss.portal.portlet.container.PortletContainerContext; +import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletContainerContextImpl implements PortletContainerContext +{ + + /** . */ + ManagedPortletContainer managedPortletContainer; + + public void managedStart() + { + managedPortletContainer.managedStart(); + } + + public void managedStop() + { + managedPortletContainer.managedStop(); + } +} Added: modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/P= ortletFilterContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/Port= letFilterContextImpl.java (rev 0) +++ modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/Port= letFilterContextImpl.java 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,46 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.mc; + +import org.jboss.portal.portlet.container.PortletFilterContext; +import org.jboss.portal.portlet.container.managed.ManagedPortletFilter; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletFilterContextImpl implements PortletFilterContext +{ + + ManagedPortletFilter managedPortletFilter; + + public void managedStart() + { + managedPortletFilter.managedStart(); + } + + public void managedStop() + { + managedPortletFilter.managedStop(); + } +} Added: modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/m= etadata/factory/LocalizedStringBuilder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/meta= data/factory/LocalizedStringBuilder.java (rev 0) +++ modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/meta= data/factory/LocalizedStringBuilder.java 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,89 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.mc.metadata.factory; + +import org.apache.log4j.Logger; +import org.jboss.portal.common.i18n.LocalizedString; +import org.jboss.portal.portlet.impl.metadata.adapter.LocalizedStringAdapt= er; +import org.jboss.portal.portlet.impl.metadata.common.LocalizedDescriptionM= etaData; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * @author Emanuel Muckenhuber + * @version $Revision$ + */ +public class LocalizedStringBuilder +{ + + /** The object to localized meta data. */ + private Map map =3D new LinkedHashM= ap(); + + /** The logger. */ + private static final Logger log =3D Logger.getLogger(LocalizedStringBui= lder.class); + + public void put(Object object, LocalizedDescriptionMetaData description) + { + LocalizedMetaDataContainer container =3D map.get(object); + if (container =3D=3D null) + { + container =3D new LocalizedMetaDataContainer(); + map.put(object, container); + } + container.addLocalizedDescription(description); + } + + public LocalizedString getLocalizedString(Object key) + { + try + { + return this.map.get(key) !=3D null ? this.map.get(key).getLocaliz= edString() : null; + } + catch (Exception e) + { + log.error("could not generate localized string.", e); + return null; + } + } + + private static class LocalizedMetaDataContainer + { + /** The list of localiezd meta data */ + private List list =3D new ArrayList(); + + public void addLocalizedDescription(LocalizedDescriptionMetaData des= cription) + { + this.list.add(description); + } + + public LocalizedString getLocalizedString() throws Exception + { + LocalizedStringAdapter adapter =3D new LocalizedStringAdapter(); + return adapter.unmarshal(list); + } + } +} Added: modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/m= etadata/factory/PortletApplicationModelFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/meta= data/factory/PortletApplicationModelFactory.java (r= ev 0) +++ modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/meta= data/factory/PortletApplicationModelFactory.java 2008-02-29 17:00:22 UTC (r= ev 10158) @@ -0,0 +1,850 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.mc.metadata.factory; + +import org.apache.log4j.Logger; +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; +import org.jboss.portal.common.i18n.LocalizedString; +import org.jboss.portal.portlet.LifeCyclePhase; +import org.jboss.portal.portlet.TransportGuarantee; +import org.jboss.portal.portlet.impl.metadata.CustomPortletModeMetaData; +import org.jboss.portal.portlet.impl.metadata.CustomWindowStateMetaData; +import org.jboss.portal.portlet.impl.metadata.ListenerMetaData; +import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; +import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData; +import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConsta= nts.DEFAULT_LOCALE; +import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConsta= nts.PORTLET_JSR_286_NS; +import org.jboss.portal.portlet.impl.metadata.PublicRenderParameterMetaDat= a; +import org.jboss.portal.portlet.impl.metadata.UserAttributeMetaData; +import org.jboss.portal.portlet.impl.metadata.common.ContainerRuntimeMetaD= ata; +import org.jboss.portal.portlet.impl.metadata.common.DescribableMetaData; +import org.jboss.portal.portlet.impl.metadata.common.InitParamMetaData; +import org.jboss.portal.portlet.impl.metadata.common.LocalizedDescriptionM= etaData; +import org.jboss.portal.portlet.impl.metadata.event.EventDefinitionMetaDat= a; +import org.jboss.portal.portlet.impl.metadata.event.EventDefinitionReferen= ceMetaData; +import org.jboss.portal.portlet.impl.metadata.filter.FilterMappingMetaData; +import org.jboss.portal.portlet.impl.metadata.filter.FilterMetaData; +import org.jboss.portal.portlet.impl.metadata.portlet.PortletCacheScopeEnu= m; +import org.jboss.portal.portlet.impl.metadata.portlet.PortletInfoMetaData; +import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData; +import org.jboss.portal.portlet.impl.metadata.portlet.PortletModeMetaData; +import org.jboss.portal.portlet.impl.metadata.portlet.PortletPreferenceMet= aData; +import org.jboss.portal.portlet.impl.metadata.portlet.PortletPreferencesMe= taData; +import org.jboss.portal.portlet.impl.metadata.portlet.SecurityRoleRefMetaD= ata; +import org.jboss.portal.portlet.impl.metadata.portlet.SupportedLocaleMetaD= ata; +import org.jboss.portal.portlet.impl.metadata.portlet.SupportsMetaData; +import org.jboss.portal.portlet.impl.metadata.portlet.WindowStateMetaData; +import org.jboss.portal.portlet.impl.metadata.security.PortletCollectionMe= taData; +import org.jboss.portal.portlet.impl.metadata.security.SecurityConstraintM= etaData; +import org.jboss.portal.portlet.impl.metadata.security.UserDataConstraintM= etaData; +import org.jboss.portal.portlet.mc.metadata.impl.AnnotationPortletApplicat= ion10MetaData; +import org.jboss.portal.portlet.mc.metadata.impl.AnnotationPortletApplicat= ion20MetaData; +import org.jboss.xb.binding.GenericObjectModelFactory; +import org.jboss.xb.binding.UnmarshallingContext; +import org.xml.sax.Attributes; + +import java.net.URI; +import java.net.URISyntaxException; + +/** + * @author Emanuel Muckenhuber + * @version $Revision$ + */ +public class PortletApplicationModelFactory implements GenericObjectModelF= actory +{ + + /** LocalizedDescriptionMetaData container for descriptions */ + private LocalizedStringBuilder descriptions =3D new LocalizedStringBuil= der(); + + /** LocalizedDescriptionMetaData container for displayNames */ + private LocalizedStringBuilder displayNames =3D new LocalizedStringBuil= der(); + + /** Guess what? The logger. */ + private static final Logger log =3D Logger.getLogger(PortletApplication= ModelFactory.class); + + public Object newRoot(Object root, UnmarshallingContext nav, String nsU= RI, String localName, Attributes attrs) + { + + String version =3D attrs.getValue("version"); + String id =3D attrs.getValue("id"); + + // portlet-app 2.0 or 1.0 + PortletApplication10MetaData md =3D PORTLET_JSR_286_NS.equals(nsURI) + ? new AnnotationPortletApplication20MetaData() + : new AnnotationPortletApplication10MetaData(); + + // Set portlet-app id + md.setId(id); + // Set portlet-app version + md.setVersion(version); + // return + return md; + } + + public Object completeRoot(Object root, UnmarshallingContext ctx, Strin= g nsURI, String name) + { + return root; + } + + public Object newChild(Object object, UnmarshallingContext nav, String = nsURI, String localName, Attributes attrs) + { + String id =3D attrs.getValue("id"); + if (object instanceof DescribableMetaData) + { + + if ("description".equals(localName)) + { + String locale =3D attrs.getValue("xml:lang") !=3D null ? attrs= .getValue("xml:lang") : DEFAULT_LOCALE; + LocalizedDescriptionMetaData localized =3D new LocalizedDescri= ptionMetaData(locale); + this.descriptions.put(object, localized); + return localized; + } + } + + // portlet-app + if (object instanceof PortletApplication10MetaData) + { + if ("portlet".equals(localName)) + { + return new PortletMetaData(id); + } + else if ("custom-portlet-mode".equals(localName)) + { + return new CustomPortletModeMetaData(id); + } + else if ("custom-window-state".equals(localName)) + { + return new CustomWindowStateMetaData(id); + } + else if ("user-attribute".equals(localName)) + { + return new UserAttributeMetaData(id); + } + else if ("security-constraint".equals(localName)) + { + return new SecurityConstraintMetaData(id); + } + } + + // portlet-app 2.0 + if (object instanceof PortletApplication20MetaData && PORTLET_JSR_28= 6_NS.equals(nsURI)) + { + if ("public-render-parameter".equals(localName)) + { + return new PublicRenderParameterMetaData(id); + } + else if ("event-definition".equals(localName)) + { + return new EventDefinitionMetaData(id); + } + else if ("filter".equals(localName)) + { + return new FilterMetaData(); + } + else if ("filter-mapping".equals(localName)) + { + return new FilterMappingMetaData(); + } + else if ("listener".equals(localName)) + { + return new ListenerMetaData(id); + } + else if ("container-runtime-option".equals(localName)) + { + return new ContainerRuntimeMetaData(); + } + } + + // portlet + if (object instanceof PortletMetaData) + { + if ("init-param".equals(localName)) + { + return new InitParamMetaData(id); + } + else if ("display-name".equals(localName)) + { + String locale =3D attrs.getValue("xml:lang") !=3D null ? attrs= .getValue("xml:lang") : DEFAULT_LOCALE; + LocalizedDescriptionMetaData localized =3D new LocalizedDescri= ptionMetaData(locale); + this.displayNames.put(object, localized); + return localized; + } + else if ("supports".equals(localName)) + { + return new SupportsMetaData(id); + } + else if ("supported-locale".equals(localName)) + { + return new SupportedLocaleMetaData(); + } + else if ("portlet-info".equals(localName)) + { + return new PortletInfoMetaData(id); + } + else if ("portlet-preferences".equals(localName)) + { + return new PortletPreferencesMetaData(id); + } + else if ("security-role-ref".equals(localName)) + { + return new SecurityRoleRefMetaData(id); + } + else if ("supported-processing-event".equals(localName) && PORTLE= T_JSR_286_NS.equals(nsURI)) + { + return new EventDefinitionReferenceMetaData(id); + } + else if ("supported-publishing-event".equals(localName) && PORTLE= T_JSR_286_NS.equals(nsURI)) + { + return new EventDefinitionReferenceMetaData(id); + } + else if ("container-runtime-option".equals(localName) && PORTLET_= JSR_286_NS.equals(nsURI)) + { + return new ContainerRuntimeMetaData(); + } + } + + // security-constraint + if (object instanceof SecurityConstraintMetaData) + { + if ("portlet-collection".equals(localName)) + { + return new PortletCollectionMetaData(); + } + else if ("user-data-constraint".equals(localName)) + { + return new UserDataConstraintMetaData(id); + } + else if ("display-name".equals(localName)) + { + String locale =3D attrs.getValue("xml:lang") !=3D null ? attrs= .getValue("xml:lang") : DEFAULT_LOCALE; + LocalizedDescriptionMetaData localized =3D new LocalizedDescri= ptionMetaData(locale); + this.displayNames.put(object, localized); + return localized; + } + } + + // supports + if (object instanceof SupportsMetaData) + { + if ("portlet-mode".equals(localName)) + { + return new PortletModeMetaData(); + } + else if ("window-state".equals(localName) && PORTLET_JSR_286_NS.e= quals(nsURI)) + { + return new WindowStateMetaData(); + } + } + + // preference (in portlet-preferences) + if (object instanceof PortletPreferencesMetaData) + { + if ("preference".equals(localName)) + { + return new PortletPreferenceMetaData(id); + } + } + + // filter + if (object instanceof FilterMetaData) + { + if ("init-param".equals(localName)) + { + return new InitParamMetaData(id); + } + else if ("display-name".equals(localName)) + { + String locale =3D attrs.getValue("xml:lang") !=3D null ? attrs= .getValue("xml:lang") : DEFAULT_LOCALE; + LocalizedDescriptionMetaData localized =3D new LocalizedDescri= ptionMetaData(locale); + this.displayNames.put(object, localized); + return localized; + } + } + + // listener + if (object instanceof ListenerMetaData) + { + if ("display-name".equals(localName)) + { + String locale =3D attrs.getValue("xml:lang") !=3D null ? attrs= .getValue("xml:lang") : DEFAULT_LOCALE; + LocalizedDescriptionMetaData localized =3D new LocalizedDescri= ptionMetaData(locale); + this.displayNames.put(object, localized); + return localized; + } + } + + return null; + } + + public void addChild(Object parent, Object child, UnmarshallingContext = nav, String nsURI, String localName) + { + + if (child instanceof DescribableMetaData) + { + DescribableMetaData md =3D (DescribableMetaData)child; + LocalizedString d =3D this.descriptions.getLocalizedString(md); + md.setDescription(d); + } + + // portlet app + if (parent instanceof PortletApplication10MetaData) + { + PortletApplication10MetaData md =3D (PortletApplication10MetaData= )parent; + // add portlet + if (child instanceof PortletMetaData) + { + PortletMetaData portlet =3D (PortletMetaData)child; + portlet.setDisplayName(this.displayNames.getLocalizedString(po= rtlet)); + md.addPortlet(portlet); + } + // add custom-portlet-mode + else if (child instanceof CustomPortletModeMetaData) + { + md.addCustomPortletMode((CustomPortletModeMetaData)child); + } + // add custom window state + else if (child instanceof CustomWindowStateMetaData) + { + md.addCustomWindowState((CustomWindowStateMetaData)child); + } + // add user-attribute + else if (child instanceof UserAttributeMetaData) + { + md.addUserAttribute((UserAttributeMetaData)child); + } + // add security-constraint + else if (child instanceof SecurityConstraintMetaData) + { + SecurityConstraintMetaData security =3D (SecurityConstraintMet= aData)child; + // display-name + security.setDisplayName(this.displayNames.getLocalizedString(s= ecurity)); + md.addSecurityConstraint(security); + } + } + + // portlet-app 2.0 + if (parent instanceof PortletApplication20MetaData) + { + PortletApplication20MetaData md =3D (PortletApplication20MetaData= )parent; + // add public-render-parameter + if (child instanceof PublicRenderParameterMetaData) + { + md.addPublicRenderParameter((PublicRenderParameterMetaData)chi= ld); + } + // add event-defintion + else if (child instanceof EventDefinitionMetaData) + { + md.addEventDefinition((EventDefinitionMetaData)child); + } + // add filter + else if (child instanceof FilterMetaData) + { + FilterMetaData filter =3D (FilterMetaData)child; + filter.setDisplayName(this.displayNames.getLocalizedString(fil= ter)); + md.addFilter(filter); + } + // add filter-mapping + else if (child instanceof FilterMappingMetaData) + { + md.addFilterMapping((FilterMappingMetaData)child); + } + // add container-runtime-option + else if (child instanceof ContainerRuntimeMetaData) + { + md.addContainerRuntime((ContainerRuntimeMetaData)child); + } + // add listener + else if (child instanceof ListenerMetaData) + { + ListenerMetaData listener =3D (ListenerMetaData)child; + listener.setDisplayName(this.displayNames.getLocalizedString(l= istener)); + md.addListener(listener); + } + } + + // portlet + if (parent instanceof PortletMetaData) + { + PortletMetaData md =3D (PortletMetaData)parent; + // init-param + if (child instanceof InitParamMetaData) + { + md.addInitParam((InitParamMetaData)child); + } + // supports + else if (child instanceof SupportsMetaData) + { + md.addSupport((SupportsMetaData)child); + } + // supported-locale + else if (child instanceof SupportedLocaleMetaData) + { + md.addSupportedLocale((SupportedLocaleMetaData)child); + } + // portlet-info + else if (child instanceof PortletInfoMetaData) + { + md.setPortletInfo((PortletInfoMetaData)child); + } + // portlet-preferences + else if (child instanceof PortletPreferencesMetaData) + { + md.setPortletPreferences((PortletPreferencesMetaData)child); + } + // security-role-ref + else if (child instanceof SecurityRoleRefMetaData) + { + md.addSecurityRoleRef((SecurityRoleRefMetaData)child); + } + // supported-events + else if (child instanceof EventDefinitionReferenceMetaData) + { + if ("supported-processing-event".equals(localName)) + { + md.addSupportedProcessingEvent((EventDefinitionReferenceMet= aData)child); + } + else if ("supported-publishing-event".equals(localName)) + { + md.addSupportedPublishingEvent((EventDefinitionReferenceMet= aData)child); + } + } + // container-runtime-option + else if (child instanceof ContainerRuntimeMetaData) + { + md.addContainerRuntime((ContainerRuntimeMetaData)child); + } + } + + // adding user-data-constraint and portlet-name(s) to security-const= raint + if (parent instanceof SecurityConstraintMetaData) + { + SecurityConstraintMetaData md =3D (SecurityConstraintMetaData)par= ent; + // add user-data-constraint + if (child instanceof UserDataConstraintMetaData) + { + md.setUserDataConstraint((UserDataConstraintMetaData)child); + } + // add portlet-collection + else if (child instanceof PortletCollectionMetaData) + { + md.setPortletList((PortletCollectionMetaData)child); + } + } + + // filter + if (parent instanceof FilterMetaData) + { + FilterMetaData md =3D (FilterMetaData)parent; + // add init-param + if (child instanceof InitParamMetaData) + { + md.addInitParam((InitParamMetaData)child); + } + } + + // add portlet-mode and window-state + if (parent instanceof SupportsMetaData) + { + SupportsMetaData md =3D (SupportsMetaData)parent; + if (child instanceof PortletModeMetaData) + { + md.addPortletMode((PortletModeMetaData)child); + } + else if (child instanceof WindowStateMetaData) + { + md.addWindowState((WindowStateMetaData)child); + } + } + + // add preference + if (parent instanceof PortletPreferencesMetaData) + { + PortletPreferencesMetaData md =3D (PortletPreferencesMetaData)par= ent; + if (child instanceof PortletPreferenceMetaData) + { + md.addPortletPreference((PortletPreferenceMetaData)child); + } + } + } + + public void setValue(Object object, UnmarshallingContext nav, String ns= URI, String localName, String value) + { + + // JSR 286 portlet-app attributes - default-namespace and resource-b= undle. + if (object instanceof PortletApplication20MetaData) + { + PortletApplication20MetaData md =3D (PortletApplication20MetaData= )object; + if ("resource-bundle".equals(localName)) + { + md.setResourceBundle(value); + } + else if ("default-namespace".equals(localName)) + { + try + { + md.setDefaultNamespace(new URI(value)); + } + catch (URISyntaxException e) + { + log.error("Invalid syntax for default-namespace: " + value); + } + } + } + + // portlet + if (object instanceof PortletMetaData) + { + PortletMetaData md =3D (PortletMetaData)object; + if ("portlet-name".equals(localName)) + { + md.setPortletName(value); + } + else if ("portlet-class".equals(localName)) + { + md.setPortletClass(value); + } + else if ("cache-scope".equals(localName) && PORTLET_JSR_286_NS.eq= uals(nsURI)) + { + md.setCacheScope(PortletCacheScopeEnum.valueOf(value)); + } + else if ("expiration-cache".equals(localName)) + { + md.setExpirationCache(Integer.valueOf(value)); + } + else if ("resource-bundle".equals(localName)) + { + md.setResourceBundle(value); + } + else if ("supported-public-render-parameter".equals(localName) &&= PORTLET_JSR_286_NS.equals(nsURI)) + { + md.addSupportedPublicRenderParameter(value); + } + } + + if (object instanceof LocalizedDescriptionMetaData) + { + LocalizedDescriptionMetaData localized =3D (LocalizedDescriptionM= etaData)object; + if ("description".equals(localName)) + { + localized.setDescription(value); + } + else if ("display-name".equals(localName)) + { + localized.setDescription(value); + } + } + + // init-param + if (object instanceof InitParamMetaData) + { + InitParamMetaData md =3D (InitParamMetaData)object; + if ("name".equals(localName)) + { + md.setName(value); + } + else if ("value".equals(localName)) + { + md.setValue(value); + } + } + + // supports + if (object instanceof SupportsMetaData) + { + SupportsMetaData md =3D (SupportsMetaData)object; + if ("mime-type".equals(localName)) + { + md.setMimeType(value); + } + } + + // supports --- portlet-mode + if (object instanceof PortletModeMetaData) + { + PortletModeMetaData md =3D (PortletModeMetaData)object; + if ("portlet-mode".equals(localName)) + { + md.setPortletMode(Mode.create(value)); + } + } + + // supports --- window-state + if (object instanceof WindowStateMetaData) + { + WindowStateMetaData md =3D (WindowStateMetaData)object; + if ("window-state".equals(localName)) + { + md.setWindowState(WindowState.create(value)); + } + } + + // supported-locale + if (object instanceof SupportedLocaleMetaData) + { + SupportedLocaleMetaData md =3D (SupportedLocaleMetaData)object; + if ("supported-locale".equals(localName)) + { + md.setLocale(value); + } + } + + // portlet-info + if (object instanceof PortletInfoMetaData) + { + PortletInfoMetaData md =3D (PortletInfoMetaData)object; + if ("title".equals(localName)) + { + md.setTitle(value); + } + else if ("short-title".equals(localName)) + { + md.setShortTitle(value); + } + else if ("keywords".equals(localName)) + { + md.setKeywords(value); + } + } + + // portlet-preferences + if (object instanceof PortletPreferencesMetaData) + { + PortletPreferencesMetaData md =3D (PortletPreferencesMetaData)obj= ect; + if ("preferences-validator".equals(localName)) + { + md.setPreferenceValidator(value); + } + } + + // preference + if (object instanceof PortletPreferenceMetaData) + { + PortletPreferenceMetaData md =3D (PortletPreferenceMetaData)objec= t; + if ("name".equals(localName)) + { + md.setName(value); + } + else if ("value".equals(localName)) + { + md.addValue(value); + } + else if ("read-only".equals(localName)) + { + md.setReadOnly(Boolean.valueOf(value)); + } + } + + // security-role-ref + if (object instanceof SecurityRoleRefMetaData) + { + SecurityRoleRefMetaData md =3D (SecurityRoleRefMetaData)object; + if ("role-name".equals(localName)) + { + md.setRoleName(value); + } + else if ("role-link".equals(localName)) + { + md.setRoleLink(value); + } + } + + // supported events + if (object instanceof EventDefinitionReferenceMetaData) + { + EventDefinitionReferenceMetaData md =3D (EventDefinitionReference= MetaData)object; + if ("qname".equals(localName)) + { + md.setQname(nav.resolveQName(value)); + } + else if ("name".equals(localName)) + { + md.setName(value); + } + } + + // custom-portlet-mode + if (object instanceof CustomPortletModeMetaData) + { + CustomPortletModeMetaData mode =3D (CustomPortletModeMetaData)obj= ect; + if ("portlet-mode".equals(localName)) + { + mode.setPortletMode(value); + } + else if ("portal-managed".equals(localName) && PORTLET_JSR_286_NS= .equals(nsURI)) + { + mode.setPortalManaged(Boolean.parseBoolean(value)); + } + } + + // custom-window-state + if (object instanceof CustomWindowStateMetaData) + { + CustomWindowStateMetaData md =3D (CustomWindowStateMetaData)objec= t; + if ("window-state".equals(localName)) + { + md.setWindowState(value); + } + } + + // user-attribute + if (object instanceof UserAttributeMetaData) + { + UserAttributeMetaData md =3D (UserAttributeMetaData)object; + if ("name".equals(localName)) + { + md.setName(value); + } + } + + // user-data-constraint + if (object instanceof UserDataConstraintMetaData) + { + UserDataConstraintMetaData md =3D (UserDataConstraintMetaData)obj= ect; + if ("transport-guarantee".equals(localName)) + { + md.setTransportQuarantee(TransportGuarantee.valueOf(value)); + } + } + + // portlet-collection in security-constraint + if (object instanceof PortletCollectionMetaData) + { + PortletCollectionMetaData md =3D (PortletCollectionMetaData)objec= t; + if ("portlet-name".equals(localName)) + { + md.addPortletname(value); + } + } + + // filter + if (object instanceof FilterMetaData && PORTLET_JSR_286_NS.equals(ns= URI)) + { + FilterMetaData md =3D (FilterMetaData)object; + if ("filter-class".equals(localName)) + { + md.setFilterClass(value); + } + else if ("filter-name".equals(localName)) + { + md.setFilterName(value); + } + else if ("lifecycle".equals(localName)) + { + int end =3D value.length() - "_PHASE".length(); + String lifeCycle =3D value.substring(0, end > 0 ? end : 0); + try + { + md.addLifecycle(LifeCyclePhase.valueOf(lifeCycle)); + } + catch (IllegalArgumentException e) + { + throw new IllegalArgumentException("Invalid value for lifec= ycle. Valid values are [RENDER_PHASE, RESOURCE_PHASE, ACTION_PHASE, EVENT_P= HASE]"); + } + } + } + + // filter-mapping + if (object instanceof FilterMappingMetaData && PORTLET_JSR_286_NS.eq= uals(nsURI)) + { + FilterMappingMetaData md =3D (FilterMappingMetaData)object; + if ("filter-name".equals(localName)) + { + md.setName(value); + } + if ("portlet-name".equals(localName)) + { + md.addPortletName(value); + } + } + + // event-defintion + if (object instanceof EventDefinitionMetaData && PORTLET_JSR_286_NS.= equals(nsURI)) + { + EventDefinitionMetaData md =3D (EventDefinitionMetaData)object; + if ("name".equals(localName)) + { + md.setName(value); + } + else if ("qname".equals(localName)) + { + md.setQname(nav.resolveQName(value)); + } + else if ("value-type".equals(localName)) + { + md.setValueType(value); + } + else if ("alias".equals(localName)) + { + md.addAlias(nav.resolveQName(value)); + } + } + + // public-render-parameter + if (object instanceof PublicRenderParameterMetaData && PORTLET_JSR_2= 86_NS.equals(nsURI)) + { + PublicRenderParameterMetaData md =3D (PublicRenderParameterMetaDa= ta)object; + if ("identifier".equals(localName)) + { + md.setIdentifier(value); + } + else if ("name".equals(localName)) + { + md.setName(value); + } + else if ("qname".equals(localName)) + { + md.setQname(nav.resolveQName(value)); + } + else if ("alias".equals(localName)) + { + md.addAlias(nav.resolveQName(value)); + } + } + + // container-runtime-option + if (object instanceof ContainerRuntimeMetaData && PORTLET_JSR_286_NS= .equals(nsURI)) + { + ContainerRuntimeMetaData md =3D (ContainerRuntimeMetaData)object; + if ("name".equals(localName)) + { + md.setName(value); + } + else if ("value".equals(localName)) + { + md.addValue(value); + } + } + + // listener + if (object instanceof ListenerMetaData && PORTLET_JSR_286_NS.equals(= nsURI)) + { + ListenerMetaData md =3D (ListenerMetaData)object; + if ("listener-class".equals(localName)) + { + md.setListenerClass(value); + } + } + } +} Added: modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/m= etadata/impl/AnnotationPortletApplication10MetaData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/meta= data/impl/AnnotationPortletApplication10MetaData.java = (rev 0) +++ modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/meta= data/impl/AnnotationPortletApplication10MetaData.java 2008-02-29 17:00:22 U= TC (rev 10158) @@ -0,0 +1,47 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.mc.metadata.impl; + +import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; +import org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants; +import org.jboss.xb.annotations.JBossXmlSchema; + +import javax.xml.bind.annotation.XmlNs; +import javax.xml.bind.annotation.XmlNsForm; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +/** + * @author Emanuel Muckenhuber + * @version $Revision$ + */ +(a)XmlRootElement(name =3D "portlet-app") +(a)XmlType(name =3D "portlet-appType") +(a)JBossXmlSchema(xmlns =3D {@XmlNs(namespaceURI =3D PortletMetaDataConsta= nts.PORTLET_JSR_168_NS, prefix =3D "portlet")}, + ignoreUnresolvedFieldOrClass =3D false, + namespace =3D PortletMetaDataConstants.PORTLET_JSR_168_NS, + elementFormDefault =3D XmlNsForm.QUALIFIED) +public class AnnotationPortletApplication10MetaData extends PortletApplica= tion10MetaData +{ +} \ No newline at end of file Added: modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/m= etadata/impl/AnnotationPortletApplication20MetaData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/meta= data/impl/AnnotationPortletApplication20MetaData.java = (rev 0) +++ modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/meta= data/impl/AnnotationPortletApplication20MetaData.java 2008-02-29 17:00:22 U= TC (rev 10158) @@ -0,0 +1,48 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.mc.metadata.impl; + +import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData; +import org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants; +import org.jboss.xb.annotations.JBossXmlSchema; + +import javax.xml.bind.annotation.XmlNs; +import javax.xml.bind.annotation.XmlNsForm; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +/** + * @author Emanuel Muckenhuber + * @version $Revision$ + */ + +(a)XmlRootElement(name =3D "portlet-app") +(a)XmlType(name =3D "portlet-appType") +(a)JBossXmlSchema(xmlns =3D {@XmlNs(namespaceURI =3D PortletMetaDataConsta= nts.PORTLET_JSR_286_NS, prefix =3D "portlet")}, + ignoreUnresolvedFieldOrClass =3D false, + namespace =3D PortletMetaDataConstants.PORTLET_JSR_286_NS, + elementFormDefault =3D XmlNsForm.QUALIFIED) +public class AnnotationPortletApplication20MetaData extends PortletApplica= tion20MetaData +{ +} \ No newline at end of file Added: modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/m= etadata/impl/PortletApplicationMetaDataException.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/meta= data/impl/PortletApplicationMetaDataException.java = (rev 0) +++ modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/meta= data/impl/PortletApplicationMetaDataException.java 2008-02-29 17:00:22 UTC = (rev 10158) @@ -0,0 +1,51 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.mc.metadata.impl; + +/** + * @author Emanuel Muckenhuber + * @version $Revision$ + */ +public class PortletApplicationMetaDataException extends Exception +{ + public PortletApplicationMetaDataException() + { + super(); + } + + public PortletApplicationMetaDataException(Throwable cause) + { + super(cause); + } + + public PortletApplicationMetaDataException(String message) + { + super(message); + } + + public PortletApplicationMetaDataException(String message, Throwable ca= use) + { + super(message, cause); + } +} Added: modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/m= etadata/impl/ValueTrimmingFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/meta= data/impl/ValueTrimmingFilter.java (rev 0) +++ modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/meta= data/impl/ValueTrimmingFilter.java 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,76 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.mc.metadata.impl; + +import org.jboss.xb.binding.GenericObjectModelFactory; +import org.jboss.xb.binding.UnmarshallingContext; +import org.xml.sax.Attributes; + +/** + * Filter setValue method by doing a trimming before calling = the next model. + * + * @author Julien Viet + * @version $Revision$ + */ +public class ValueTrimmingFilter implements GenericObjectModelFactory +{ + + private final GenericObjectModelFactory next; + + public ValueTrimmingFilter(GenericObjectModelFactory next) throws Illeg= alArgumentException + { + if (next =3D=3D null) + { + throw new IllegalArgumentException("Cannot be null"); + } + this.next =3D next; + } + + public Object newChild(Object object, UnmarshallingContext nav, String = nsURI, String localName, Attributes attrs) + { + return next.newChild(object, nav, nsURI, localName, attrs); + } + + public void addChild(Object parent, Object child, UnmarshallingContext = nav, String nsURI, String localName) + { + next.addChild(parent, child, nav, nsURI, localName); + } + + public void setValue(Object object, UnmarshallingContext nav, String ns= URI, String localName, String value) + { + value =3D value.trim(); + next.setValue(object, nav, nsURI, localName, value); + } + + public Object newRoot(Object root, UnmarshallingContext nav, String nsU= RI, String localName, Attributes attrs) + { + return next.newRoot(root, nav, nsURI, localName, attrs); + } + + public Object completeRoot(Object root, UnmarshallingContext nav, Strin= g nsURI, String localName) + { + return next.completeRoot(root, nav, nsURI, localName); + } + +} \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/m= etadata/AbstractMetaDataTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/meta= data/AbstractMetaDataTestCase.java (rev 0) +++ modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/meta= data/AbstractMetaDataTestCase.java 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,171 @@ +/*************************************************************************= ***** + * 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.portlet.mc.metadata; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; + +import org.jboss.portal.portlet.mc.metadata.factory.PortletApplicationMode= lFactory; +import org.jboss.portal.portlet.mc.metadata.impl.AnnotationPortletApplicat= ion10MetaData; +import org.jboss.portal.portlet.mc.metadata.impl.AnnotationPortletApplicat= ion20MetaData; +import org.jboss.portal.portlet.mc.metadata.impl.ValueTrimmingFilter; +import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; +import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData; + +import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConsta= nts.*; + +import org.jboss.unit.api.pojo.annotations.Parameter; +import org.jboss.xb.binding.JBossXBException; +import org.jboss.xb.binding.Unmarshaller; +import org.jboss.xb.binding.UnmarshallerFactory; +import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver; +import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFa= ctory; +import org.xml.sax.SAXException; +import static org.jboss.unit.api.Assert.*; + +/** + * @author Emanuel Muckenhuber + * @version $Revision$ + */ +public abstract class AbstractMetaDataTestCase +{ + + /** Test parameter for using xml binding annotation. */ + public static final String ANNOTATION_BINDING =3D "annotation"; + + /** Test parameter for using the ObjectModelFactory. */ + public static final String FACTORY_BINDING =3D "factory"; + + /** The schema resolver factory. */ + protected static SingletonSchemaResolverFactory factory; + + /** The schema resolver. */ + protected static DefaultSchemaResolver resolver; + + /** The unmarshaller. */ + protected Unmarshaller unmarshaller =3D null; + + /** Annotation or ObjectModelFactory parsing. */ + private String parser; + + @Parameter(name =3D "parser") + public void setParser(String parser) + { + this.parser =3D parser; + } + + static + { + try + { + factory =3D SingletonSchemaResolverFactory.getInstance(); + resolver =3D (DefaultSchemaResolver) factory.getSchemaBindingReso= lver(); + + /** SchemaResolver */ + resolver.addSchemaLocation(PORTLET_JSR_168_NS, "portlet-app_1_0.x= sd"); + resolver.addSchemaLocation(PORTLET_JSR_286_NS, "portlet-app_2_0.x= sd"); + resolver.addClassBinding(PORTLET_JSR_286_NS, AnnotationPortletApp= lication20MetaData.class); + resolver.addClassBinding(PORTLET_JSR_168_NS, AnnotationPortletApp= lication10MetaData.class); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + + protected PortletApplication10MetaData unmarshall10(String file) throws= JBossXBException, SAXException, IOException + { + if (ANNOTATION_BINDING.equals(parser)) + { + return this.unmarshallAnnotation(file); + } + else if (FACTORY_BINDING.equals(parser)) + { + return this.unmarshallWithFactory(file); + } + else + { + throw new IllegalArgumentException("Wrong parameter for parser."); + } + } + + protected PortletApplication20MetaData unmarshall20(String file) throws= JBossXBException, SAXException, IOException + { + if (ANNOTATION_BINDING.equals(parser)) + { + return (PortletApplication20MetaData)this.unmarshallAnnotation(fi= le); + } + else if (FACTORY_BINDING.equals(parser)) + { + return (PortletApplication20MetaData)this.unmarshallWithFactory(f= ile); + } + else + { + throw new IllegalArgumentException("Wrong parameter for parser."); + } + } + + private PortletApplication10MetaData unmarshallAnnotation(String file) = throws JBossXBException, SAXException, + IOException + { + /** validate */ + unmarshaller =3D UnmarshallerFactory.newInstance().newUnmarshaller(); + unmarshaller.setNamespaceAware(true); + unmarshaller.setSchemaValidation(true); + unmarshaller.setValidation(true); + + /** unmarshal */ + return (PortletApplication10MetaData) unmarshaller.unmarshal(getPath= (file), resolver); + } + + private PortletApplication10MetaData unmarshallWithFactory(String file)= throws JBossXBException + { + /** validate */ + unmarshaller =3D UnmarshallerFactory.newInstance().newUnmarshaller(); + unmarshaller.setNamespaceAware(true); + unmarshaller.setSchemaValidation(true); + unmarshaller.setValidation(true); + + PortletApplicationModelFactory factory =3D new PortletApplicationMod= elFactory(); + /** unmarshal */ + return (PortletApplication10MetaData) unmarshaller.unmarshal(getStre= am(file), new ValueTrimmingFilter(factory), + null); + } + + protected String getPath(String file) + { + URL url =3D Thread.currentThread().getContextClassLoader().getResour= ce(file); + if (url =3D=3D null) + { + fail(file + " not found."); + } + return url.toString(); + } + + protected InputStream getStream(String file) + { + return Thread.currentThread().getContextClassLoader().getResourceAsS= tream(file); + } + +} Added: modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/m= etadata/CustomPortletModeTestEverythingTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/meta= data/CustomPortletModeTestEverythingTestCase.java (= rev 0) +++ modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/meta= data/CustomPortletModeTestEverythingTestCase.java 2008-02-29 17:00:22 UTC (= rev 10158) @@ -0,0 +1,131 @@ +/*************************************************************************= ***** + * 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.portlet.mc.metadata; + +import java.util.Locale; + +import org.jboss.portal.portlet.impl.metadata.CustomPortletModeMetaData; +import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; +import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData; +import org.jboss.unit.api.pojo.annotations.Test; + +import static org.jboss.unit.api.Assert.*; + +/** + * @author Emanuel Muckenhuber + * @version $Revision$ + */ +public class CustomPortletModeTestEverythingTestCase extends AbstractMetaD= ataTestCase +{ + + = + @Test + public void test01() + { + try + { + String xmlFile =3D "metadata/customPortletMode/portlet1.xml"; + + PortletApplication10MetaData md =3D unmarshall10(xmlFile); + assertNotNull(md); + assertTrue(md instanceof PortletApplication10MetaData); + assertEquals("1.0", md.getVersion()); + assertNotNull(md.getCustomPortletModes()); + + CustomPortletModeMetaData cmd1 =3D md.getCustomPortletModes().get= ("Custom"); + assertNotNull(cmd1); + assertEquals("mode1", cmd1.getId()); + assertEquals("Custom", cmd1.getPortletMode()); + assertEquals("portletMode1", cmd1.getDescription().getDefaultStri= ng()); + assertEquals("eigener portlet modus", cmd1.getDescription().getSt= ring(new Locale("de"), false)); + + assertNotNull(md.getCustomPortletModes().get("Custom2")); + } + catch (Exception e) + { + e.printStackTrace(); + fail(); + } + } + + @Test + public void test02() + { + try + { + + String xmlFile =3D "metadata/customPortletMode/portlet2.xml"; + + PortletApplication10MetaData md =3D unmarshall10(xmlFile); + assertNotNull(md); + assertTrue(md instanceof PortletApplication20MetaData); + assertEquals("2.0", md.getVersion()); + + CustomPortletModeMetaData cmd1 =3D md.getCustomPortletModes().get= ("Custom"); + assertNotNull(cmd1); + assertEquals("Custom", cmd1.getPortletMode()); + assertEquals("portletMode1", cmd1.getDescription().getDefaultStri= ng()); = + assertEquals(true, cmd1.isPortalManaged()); + assertEquals("cmode1", cmd1.getId()); + = + CustomPortletModeMetaData cmd2 =3D md.getCustomPortletModes().get= ("Custom2"); + assertNotNull(cmd2); + assertEquals("Custom2", cmd2.getPortletMode()); + assertEquals(false, cmd2.isPortalManaged()); + + CustomPortletModeMetaData cmd3 =3D md.getCustomPortletModes().get= ("Custom3"); + assertNotNull(cmd3); + assertEquals("Custom3", cmd3.getPortletMode()); + + // default value + assertEquals(true, cmd3.isPortalManaged()); + assertEquals("eigener portlet modus", cmd1.getDescription().getSt= ring(new Locale("de"), false)); + assertEquals("Portlet Mode Three", cmd3.getDescription().getDefau= ltString()); + + + } + catch (Exception e) + { + e.printStackTrace(); + fail(); + } + } + + @Test + public void test03() + { + try + { + + String xmlFile =3D "metadata/customPortletMode/portlet1-fail.xml"; + + PortletApplication10MetaData md =3D unmarshall10(xmlFile); + fail("portlet 2.0 properties are not allowed"); + } + catch (Exception e) + { + // OK + } + } + +} Added: modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/m= etadata/CustomWindowStateTestEverythingTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/meta= data/CustomWindowStateTestEverythingTestCase.java (= rev 0) +++ modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/meta= data/CustomWindowStateTestEverythingTestCase.java 2008-02-29 17:00:22 UTC (= rev 10158) @@ -0,0 +1,103 @@ +/*************************************************************************= ***** + * 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.portlet.mc.metadata; + +import java.util.Locale; + +import org.jboss.portal.portlet.impl.metadata.CustomWindowStateMetaData; +import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; +import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData; +import org.jboss.unit.api.pojo.annotations.Test; + +import static org.jboss.unit.api.Assert.*; + +/** + * @author Emanuel Muckenhuber + * @version $Revision$ + */ +public class CustomWindowStateTestEverythingTestCase extends AbstractMetaD= ataTestCase +{ + @Test + public void test01() + { + try + { + + String xmlFile =3D "metadata/customWindowState/portlet1.xml"; + + PortletApplication10MetaData md =3D unmarshall10(xmlFile); + assertNotNull(md); + assertTrue(md instanceof PortletApplication10MetaData); + assertEquals("1.0", md.getVersion()); + + CustomWindowStateMetaData cws1 =3D md.getCustomWindowStates().get= ("windowState1"); + assertEquals("WindowState", cws1.getDescription().getDefaultStrin= g()); + assertEquals("windowState1", cws1.getWindowState()); + assertEquals("Offenes Fenster", cws1.getDescription().getString(n= ew Locale("de"), false)); + assertEquals("foo", cws1.getId()); + CustomWindowStateMetaData cws2 =3D md.getCustomWindowStates().get= ("windowState2"); + assertNotNull(cws2); + + CustomWindowStateMetaData cws3 =3D md.getCustomWindowStates().get= ("windowState3"); + assertEquals("drei", cws3.getId()); + } + catch (Exception e) + { + e.printStackTrace(); + fail(); + } + } + + @Test + public void test02() + { + try + { + + String xmlFile =3D "metadata/customWindowState/portlet2.xml"; + + PortletApplication10MetaData md =3D unmarshall10(xmlFile); + assertNotNull(md); + assertTrue(md instanceof PortletApplication20MetaData); + assertEquals("2.0", md.getVersion()); + + CustomWindowStateMetaData cws1 =3D md.getCustomWindowStates().get= ("windowState1"); + assertEquals("WindowState", cws1.getDescription().getDefaultStrin= g()); + assertEquals("windowState1", cws1.getWindowState()); + assertEquals("Offenes Fenster", cws1.getDescription().getString(n= ew Locale("de"), false)); + assertEquals("foo", cws1.getId()); + = + CustomWindowStateMetaData cws2 =3D md.getCustomWindowStates().get= ("windowState2"); + assertNotNull(cws2); + + CustomWindowStateMetaData cws3 =3D md.getCustomWindowStates().get= ("windowState3"); + assertEquals("drei", cws3.getId()); + } + catch (Exception e) + { + e.printStackTrace(); + fail(); + } + } + +} Added: modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/m= etadata/EventTestEverythingTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/meta= data/EventTestEverythingTestCase.java (rev 0) +++ modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/meta= data/EventTestEverythingTestCase.java 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,145 @@ +/*************************************************************************= ***** + * 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.portlet.mc.metadata; + +import java.util.Locale; + +import javax.xml.namespace.QName; + +import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData; +import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; +import org.jboss.portal.portlet.impl.metadata.event.EventDefinitionMetaDat= a; +import org.jboss.portal.portlet.impl.metadata.event.EventDefinitionReferen= ceMetaData; +import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData; +import org.jboss.unit.api.pojo.annotations.Test; + +import static org.jboss.unit.api.Assert.*; + +/** + * @author Emanuel Muckenhuber + * @version $Revision$ + */ +public class EventTestEverythingTestCase extends AbstractMetaDataTestCase +{ + + @Test + public void test01() + { + try + { + + String xmlFile =3D "metadata/event/portlet-event1.xml"; + + unmarshall10(xmlFile); + fail(); + } + catch (Exception e) + { + // ok + } + } + + @Test + public void test02() + { + try + { + + String xmlFile =3D "metadata/event/portlet-event2.xml"; + + PortletApplication20MetaData md =3D unmarshall20(xmlFile); + assertNotNull(md); + assertTrue(md instanceof PortletApplication20MetaData); + assertEquals("2.0", md.getVersion()); + + EventDefinitionMetaData emd =3D md.getEvents().get(0); + QName qname =3D emd.getQname(); + assertEquals("eventID", emd.getId()); + assertEquals("http://example.com/testEvents", qname.getNamespaceU= RI()); + assertEquals("portletEvent", qname.getLocalPart()); + assertEquals("x", qname.getPrefix()); + assertEquals("org.jboss.portal.event.invoke.refill.beer", emd.get= ValueType()); + assertEquals("descriptionDefaultLanguage", emd.getDescription().g= etDefaultString()); + assertEquals("descriptionDefaultLanguage", emd.getDescription().g= etString(new Locale("en"), false)); + assertEquals("Beschreibung in Deutsch", emd.getDescription().getS= tring(new Locale("de"), false)); + + EventDefinitionMetaData emd2 =3D md.getEvents().get(1); + = + assertNull(emd2.getQname()); + assertEquals("hellouh", emd2.getName()); + assertEquals("hello", emd2.getAlias().get(0).getLocalPart()); + + // portlet event reference testing + PortletMetaData p1 =3D md.getPortlet("Portlet2"); + QName referenceQName =3D new QName("http://example.com/testEvents= ", "portletEvent"); + assertNotNull(p1); + assertEquals("org.jboss.portal.test.portlet.TestSessionPortlet", = p1.getPortletClass()); + + EventDefinitionReferenceMetaData ermd1 =3D p1.getSupportedProcess= ingEvent().get(0); + assertNotNull(ermd1); + assertEquals(referenceQName, ermd1.getQname()); + + EventDefinitionReferenceMetaData ermd2 =3D p1.getSupportedProcess= ingEvent().get(1); + assertNotNull(ermd2); + assertEquals("hellouh", ermd2.getName()); + + EventDefinitionReferenceMetaData ermd3 =3D p1.getSupportedPublish= ingEvent().get(0); + assertNotNull(ermd3); + assertEquals(referenceQName, ermd3.getQname()); + + EventDefinitionReferenceMetaData ermd4 =3D p1.getSupportedPublish= ingEvent().get(1); + assertNotNull(ermd4); + assertEquals("hellouh", ermd4.getName()); + = + } + catch (Exception e) + { + e.printStackTrace(); + fail(); + } + } + + @Test + public void test021() + { + try + { + + String xmlFile =3D "metadata/event/portlet-event2-fail.xml"; + + PortletApplication10MetaData md =3D unmarshall10(xmlFile); + assertNotNull(md); + assertEquals("2.0", md.getVersion()); + +// EventDefinitionMetaData edm =3D md.getEvents().get(0); + + fail("Should fail: choice and qname defined!"); + } + catch (Exception e) + { + // ok + } + } + + = +} Added: modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/m= etadata/FilterTestEverythingTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/meta= data/FilterTestEverythingTestCase.java (rev 0) +++ modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/meta= data/FilterTestEverythingTestCase.java 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,113 @@ +/*************************************************************************= ***** + * 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.portlet.mc.metadata; + +import java.util.Locale; + +import org.jboss.portal.portlet.LifeCyclePhase; +import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData; +import org.jboss.portal.portlet.impl.metadata.common.InitParamMetaData; +import org.jboss.portal.portlet.impl.metadata.filter.FilterMetaData; +import org.jboss.unit.api.pojo.annotations.Test; + +import static org.jboss.unit.api.Assert.*; + +/** + * @author Emanuel Muckenhuber + * @version $Revision$ + */ +public class FilterTestEverythingTestCase extends AbstractMetaDataTestCase +{ + + @Test + public void test01() + { + try + { + unmarshall10("metadata/filter/portlet-filter1.xml"); + // no filters in jsr 168 + fail(); + } + catch (Exception e) + { + // ok + } + } + + @Test + public void test02() + { + try + { + String xmlFile =3D "metadata/filter/portlet-filter2.xml"; + + PortletApplication20MetaData md =3D unmarshall20(xmlFile); + assertNotNull(md); + assertTrue(md instanceof PortletApplication20MetaData); + + FilterMetaData filter =3D md.getFilter("testFilter"); + assertNotNull(filter); + assertEquals("org.jboss.portal.meta.NoExistingClass", filter.getF= ilterClass()); + assertEquals("testFilter", filter.getFilterName()); + assertEquals(LifeCyclePhase.ACTION, filter.getLifecycle().get(0)); + assertEquals(LifeCyclePhase.RENDER, filter.getLifecycle().get(1)); + = + assertEquals("test", filter.getDescription().getDefaultString()); + assertEquals("bla", filter.getDescription().getString(new Locale(= "de"), false)); + + assertEquals("foo", filter.getDisplayName().getString(new Locale(= "fr"), false)); + assertEquals("foobar", filter.getDisplayName().getDefaultString()= ); + = + InitParamMetaData ip =3D filter.getInitParams().get(0); + assertEquals("eins", ip.getId()); + assertEquals("foo", ip.getName()); + assertEquals("bar", ip.getValue()); + assertNotNull(ip.getDescription()); + = + InitParamMetaData ip2 =3D filter.getInitParams().get(1); + assertEquals("test", ip2.getName()); + assertEquals("testing", ip2.getValue()); + assertNull(ip2.getId()); + = + // = + FilterMetaData filter2 =3D md.getFilter("testFilterZwei"); + assertEquals("testFilterZwei", filter2.getFilterName()); + assertEquals(LifeCyclePhase.ACTION, filter2.getLifecycle().get(0)= ); + = + // Filter mapping = + assertTrue(md.getFilterMapping().containsKey("testFilter")); + assertEquals("Portlet1", md.getFilterMapping().get("testFilter").= getPortletNames().get(0)); + assertEquals("Portlet2", md.getFilterMapping().get("testFilter").= getPortletNames().get(1)); + + assertTrue(md.getFilterMapping().containsKey("testFilterZwei")); + assertEquals("Portlet2", md.getFilterMapping().get("testFilterZwe= i").getPortletNames().get(0)); + + } + catch (Exception e) + { + e.printStackTrace(); + fail(); + } + } + +} Added: modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/m= etadata/GeneralMetaDataTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/meta= data/GeneralMetaDataTestCase.java (rev 0) +++ modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/meta= data/GeneralMetaDataTestCase.java 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,151 @@ +/*************************************************************************= ***** + * 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.portlet.mc.metadata; + +import java.net.URI; +import java.util.Locale; + +import org.jboss.portal.portlet.impl.metadata.ListenerMetaData; +import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; +import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData; +import org.jboss.portal.portlet.impl.metadata.PublicRenderParameterMetaDat= a; +import org.jboss.unit.api.pojo.annotations.Test; + +import static org.jboss.unit.api.Assert.*; + +/** + * @author Emanuel Muckenhuber + * @version $Revision$ + */ +public class GeneralMetaDataTestCase extends AbstractMetaDataTestCase +{ + + @Test + public void test01() + { + try + { + PortletApplication10MetaData md =3D this.unmarshall10("metadata/g= eneral/portlet1.xml"); + assertNotNull(md); + assertTrue(md instanceof PortletApplication10MetaData); + assertEquals("1.0", md.getVersion()); + } + catch (Exception e) + { + e.printStackTrace(); + fail("No exception expected"); + } + } + + @Test + public void test02() + { + try + { + PortletApplication10MetaData md =3D this.unmarshall10("metadata/g= eneral/portlet2.xml"); + assertNotNull(md); + assertTrue(md instanceof PortletApplication20MetaData); + assertEquals("2.0", md.getVersion()); + } + catch (Exception e) + { + e.printStackTrace(); + fail(); + } + } + + @Test + public void test021() + { + try + { + PortletApplication20MetaData md =3D unmarshall20("metadata/genera= l/portlet2-jsr286.xml"); + assertEquals("2.0", md.getVersion()); + assertTrue(md instanceof PortletApplication20MetaData); + + assertEquals("MyResourceBundle", md.getResourceBundle()); + assertEquals(new URI("foobar"), md.getDefaultNamespace()); + = + PublicRenderParameterMetaData prp1 =3D md.getPublicRenderParamete= rs().get(0); + + assertEquals("Public render parameter one", prp1.getDescription()= .getDefaultString()); + assertEquals("param1", prp1.getId()); + assertEquals("param1", prp1.getName()); + assertEquals("Parameter1", prp1.getAlias().get(0).getLocalPart()); + assertEquals("Parameter2", prp1.getAlias().get(1).getLocalPart()); + assertEquals("blub", prp1.getIdentifier()); + = + assertEquals("foobar", md.getContainerRuntimeOption("foo").getVal= ues().get(0)); + assertEquals("foobar2", md.getContainerRuntimeOption("foo").getVa= lues().get(1)); + + ListenerMetaData listener1 =3D md.getListeners().get(0); + assertNotNull(listener1); + assertEquals("org.jboss.portal.portlet.test.listener.MyListener",= listener1.getListenerClass()); + assertEquals("Mein Zuh\u00f6rer Eins", listener1.getDisplayName()= .getString(new Locale("de"), false)); + assertEquals("Beschreibung", listener1.getDescription().getString= (new Locale("de"), false)); + = + assertNotNull(md.getListeners().get(1)); + } + catch (Exception e) + { + e.printStackTrace(); + fail(); + } + } + = + @Test + public void test01_generated() + { + try + { + PortletApplication10MetaData md =3D unmarshall10("metadata/genera= l/portlet-app_1_0.xml"); + + assertNotNull(md); + assertTrue(md instanceof PortletApplication10MetaData); + assertEquals("1.0", md.getVersion()); + assertNotNull(md.getCustomPortletModes()); + + } + catch(Exception e) + { + e.printStackTrace(); + fail(); + } + } + = + @Test + public void test02_generated() + { + try + { + PortletApplication10MetaData md =3D this.unmarshall10("metadata/g= eneral/portlet-app_2_0.xml"); + assertEquals("2.0", md.getVersion()); + assertTrue(md instanceof PortletApplication20MetaData); + } + catch(Exception e) + { + e.printStackTrace(); + fail(); + } + } +} Added: modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/m= etadata/PortletTestEverythingTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/meta= data/PortletTestEverythingTestCase.java (rev 0) +++ modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/meta= data/PortletTestEverythingTestCase.java 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,506 @@ +/*************************************************************************= ***** + * 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.portlet.mc.metadata; + +import java.util.List; +import java.util.Locale; + +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; +import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; +import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData; +import org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants; +import org.jboss.portal.portlet.impl.metadata.common.InitParamMetaData; +import org.jboss.portal.portlet.impl.metadata.portlet.PortletCacheScopeEnu= m; +import org.jboss.portal.portlet.impl.metadata.portlet.PortletInfoMetaData; +import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData; +import org.jboss.portal.portlet.impl.metadata.portlet.PortletPreferencesMe= taData; +import org.jboss.portal.portlet.impl.metadata.portlet.SecurityRoleRefMetaD= ata; +import org.jboss.portal.portlet.impl.metadata.portlet.SupportedLocaleMetaD= ata; +import org.jboss.portal.portlet.impl.metadata.portlet.SupportsMetaData; +import org.jboss.unit.api.pojo.annotations.Test; + +import static org.jboss.unit.api.Assert.*; + +/** + * @author Emanuel Muckenhuber + * @version $Revision$ + */ +public class PortletTestEverythingTestCase extends AbstractMetaDataTestCase +{ + + @Test + public void test01() + { + try + { + String xmlFile =3D "metadata/portlet/portlet1.xml"; + + PortletApplication10MetaData md =3D unmarshall10(xmlFile); + assertNotNull(md); + assertTrue(md instanceof PortletApplication10MetaData); + assertEquals("1.0", md.getVersion()); + + Locale fr =3D new Locale("fr"); + Locale default_locale =3D new Locale(PortletMetaDataConstants.DEF= AULT_LOCALE); + + PortletMetaData p1 =3D md.getPortlet("Portlet1"); + assertNotNull(p1); + assertEquals(md, p1.getPortletApplication()); + assertEquals("fragmichnicht", p1.getId()); + assertEquals("Portlet1", p1.getPortletName()); + assertEquals(default_locale, p1.getDescription().getDefaultLocale= ()); + assertEquals("default", p1.getDescription().getDefaultString()); + assertEquals("defaut", p1.getDescription().getString(fr, false)); + assertEquals(default_locale, p1.getDisplayName().getDefaultLocale= ()); + assertEquals("display", p1.getDisplayName().getDefaultString()); + assertEquals("affichage", p1.getDisplayName().getString(fr, false= )); + assertEquals("org.jboss.portal.test.portlet.TestPortlet", p1.getP= ortletClass()); + + InitParamMetaData ip1 =3D p1.getInitParams().get(0); + assertEquals(default_locale, ip1.getDescription().getDefaultLocal= e()); + assertEquals("first parameter", ip1.getDescription().getDefaultSt= ring()); + assertEquals("premier parametre", ip1.getDescription().getString(= fr, false)); + assertEquals("one", ip1.getName()); + assertEquals("1", ip1.getValue()); + + InitParamMetaData ip2 =3D p1.getInitParams().get(1); + assertNotNull(ip2); + assertEquals("second parameter", ip2.getDescription().getDefaultS= tring()); + assertEquals("deuxieme parametre", ip2.getDescription().getString= (fr, false)); + assertEquals("two", ip2.getName()); + assertEquals("2", ip2.getValue()); + + // Expiration cache + assertEquals(0, p1.getExpirationCache()); + + SupportsMetaData smd1 =3D p1.getSupports().get(0); + assertEquals("text/html", smd1.getMimeType()); + assertEquals(Mode.create("VIEW"), smd1.getPortletModes().get(0).g= etPortletMode()); + assertEquals(Mode.create("EDIT"), smd1.getPortletModes().get(1).g= etPortletMode()); + assertEquals(Mode.create("HELP"), smd1.getPortletModes().get(2).g= etPortletMode()); + + SupportsMetaData smd2 =3D p1.getSupports().get(1); + assertEquals("text/wml", smd2.getMimeType()); + assertEquals(Mode.create("VIEW"), smd2.getPortletModes().get(0).g= etPortletMode()); + assertEquals(Mode.create("HELP"), smd2.getPortletModes().get(1).g= etPortletMode()); + + assertEquals("MyResourceBundle", p1.getResourceBundle()); + + List localeList =3D p1.getSupportedLocal= e(); + assertEquals(3, localeList.size()); + assertEquals("en", localeList.get(0).getLocale()); + assertEquals("fr", localeList.get(1).getLocale()); + assertEquals("fr_FR", localeList.get(2).getLocale()); + + PortletInfoMetaData pimd =3D p1.getPortletInfo(); + assertNotNull(pimd); + assertEquals("very long portlet title", pimd.getTitle()); + assertEquals("short portlet title", pimd.getShortTitle()); + assertEquals("a,b,c,d,e,f", pimd.getKeywords()); + + PortletPreferencesMetaData ppmd =3D p1.getPortletPreferences(); + assertNotNull(ppmd); + + assertEquals("MyValidator", ppmd.getPreferenceValidator()); + assertEquals("1", ppmd.getPortletPreferences().get("one").getValu= e().get(0)); + assertEquals("2", ppmd.getPortletPreferences().get("two").getValu= e().get(0)); + assertEquals(false, ppmd.getPortletPreferences().get("two").isRea= dOnly()); + assertEquals("3", ppmd.getPortletPreferences().get("three").getVa= lue().get(0)); + assertEquals(true, ppmd.getPortletPreferences().get("three").isRe= adOnly()); + assertEquals("1", ppmd.getPortletPreferences().get("all").getValu= e().get(0)); + assertEquals("2", ppmd.getPortletPreferences().get("all").getValu= e().get(1)); + assertEquals("3", ppmd.getPortletPreferences().get("all").getValu= e().get(2)); + + SecurityRoleRefMetaData srrmd1 =3D p1.getSecurityRoleRef().get(0); + assertNotNull(srrmd1); + assertEquals("role with no link", srrmd1.getDescription().getDefa= ultString()); + assertEquals("role sans link", srrmd1.getDescription().getString(= fr, false)); + assertEquals("ROLE_NAME_WITHOUT_LINK", srrmd1.getRoleName()); + + SecurityRoleRefMetaData srrmd2 =3D p1.getSecurityRoleRef().get(1); + assertNotNull(srrmd2); + assertEquals("role with link", srrmd2.getDescription().getDefault= String()); + assertEquals("role avec link", srrmd2.getDescription().getString(= fr, false)); + assertEquals("ROLE_NAME_WITH_LINK", srrmd2.getRoleName()); + assertEquals("ROLE_LINK", srrmd2.getRoleLink()); + + // Portlet 2 + + PortletMetaData p2 =3D md.getPortlet("Portlet2"); + assertNotNull(p2); + assertEquals(md, p2.getPortletApplication()); + assertEquals("org.jboss.portal.test.portlet.TestSessionPortlet", = p2.getPortletClass()); + assertEquals("text/html", p2.getSupports().get(0).getMimeType()); + assertEquals("test the portlet session", p2.getPortletInfo().getT= itle()); + + // default value should be 0 + assertEquals(0, p2.getExpirationCache()); + + PortletMetaData p3 =3D md.getPortlet("Portlet3"); + assertNotNull(p3); + assertEquals(md, p3.getPortletApplication()); + + PortletMetaData p4 =3D md.getPortlet("Portlet4"); + assertNotNull(p4); + assertEquals(md, p4.getPortletApplication()); + + PortletMetaData p5 =3D md.getPortlet("Portlet5"); + assertNotNull(p5); + assertEquals(md, p5.getPortletApplication()); + PortletPreferencesMetaData ppmd5 =3D p5.getPortletPreferences(); + assertEquals("1", ppmd5.getPortletPreferences().get("one").getVal= ue().get(0)); + assertEquals("2", ppmd5.getPortletPreferences().get("two").getVal= ue().get(0)); + assertEquals(false, ppmd5.getPortletPreferences().get("two").isRe= adOnly()); + assertEquals("3", ppmd5.getPortletPreferences().get("three").getV= alue().get(0)); + assertEquals(true, ppmd5.getPortletPreferences().get("three").isR= eadOnly()); + assertEquals("1", ppmd5.getPortletPreferences().get("all").getVal= ue().get(0)); + assertEquals("2", ppmd5.getPortletPreferences().get("all").getVal= ue().get(1)); + assertEquals("3", ppmd5.getPortletPreferences().get("all").getVal= ue().get(2)); + + PortletMetaData p6 =3D md.getPortlet("Portlet6"); + assertNotNull(p6); + assertEquals(md, p6.getPortletApplication()); + assertEquals("Portlet6", p6.getResourceBundle()); + assertEquals(3, p6.getSupportedLocale().size()); + assertEquals("en", p6.getSupportedLocale().get(0).getLocale()); + assertEquals("fr", p6.getSupportedLocale().get(1).getLocale()); + assertEquals("fr_FR", p6.getSupportedLocale().get(2).getLocale()); + + PortletMetaData p7 =3D md.getPortlet("Portlet7"); + assertNotNull(p7); + + PortletMetaData p8 =3D md.getPortlet("Portlet8"); + assertNotNull(p8); + + PortletMetaData p9 =3D md.getPortlet("Portlet9"); + assertNotNull(p9); + + PortletMetaData p10 =3D md.getPortlet("Portlet10"); + assertNotNull(p10); + + PortletMetaData p11 =3D md.getPortlet("Portlet11"); + assertNotNull(p11); + + PortletMetaData p12 =3D md.getPortlet("Portlet12"); + assertNotNull(p12); + assertEquals(60, p12.getExpirationCache()); + + PortletMetaData p13 =3D md.getPortlet("Portlet13"); + assertNotNull(p13); + + } + catch (Exception e) + { + e.printStackTrace(); + fail(); + } + } + + @Test + public void test02() + { + try + { + String xmlFile =3D "metadata/portlet/portlet2.xml"; + + PortletApplication10MetaData md =3D unmarshall10(xmlFile); + assertNotNull(md); + assertTrue(md instanceof PortletApplication20MetaData); + assertEquals("2.0", md.getVersion()); + + Locale fr =3D new Locale("fr"); + Locale default_locale =3D new Locale(PortletMetaDataConstants.DEF= AULT_LOCALE); + + PortletMetaData p1 =3D md.getPortlet("Portlet1"); + assertNotNull(p1); + assertEquals("fragmichnicht2", p1.getId()); + assertEquals("Portlet1", p1.getPortletName()); + assertEquals(default_locale, p1.getDescription().getDefaultLocale= ()); + assertEquals("default", p1.getDescription().getDefaultString()); + assertEquals("defaut", p1.getDescription().getString(fr, false)); + assertEquals(default_locale, p1.getDisplayName().getDefaultLocale= ()); + assertEquals("display", p1.getDisplayName().getDefaultString()); + assertEquals("affichage", p1.getDisplayName().getString(fr, false= )); + assertEquals("org.jboss.portal.test.portlet.TestPortlet", p1.getP= ortletClass()); + + InitParamMetaData ip1 =3D p1.getInitParams().get(0); + assertEquals(default_locale, ip1.getDescription().getDefaultLocal= e()); + assertEquals("first parameter", ip1.getDescription().getDefaultSt= ring()); + assertEquals("premier parametre", ip1.getDescription().getString(= fr, false)); + assertEquals("one", ip1.getName()); + assertEquals("1", ip1.getValue()); + + InitParamMetaData ip2 =3D p1.getInitParams().get(1); + assertNotNull(ip2); + assertEquals("second parameter", ip2.getDescription().getDefaultS= tring()); + assertEquals("deuxieme parametre", ip2.getDescription().getString= (fr, false)); + assertEquals("two", ip2.getName()); + assertEquals("2", ip2.getValue()); + + // Expiration cache + assertEquals(0, p1.getExpirationCache()); + + // cache Scope - JSR 286 + assertEquals(PortletCacheScopeEnum.PUBLIC, p1.getCacheScope()); + + SupportsMetaData smd1 =3D p1.getSupports().get(0); + assertEquals("text/html", smd1.getMimeType()); + assertEquals(Mode.create("VIEW"), smd1.getPortletModes().get(0).g= etPortletMode()); + assertEquals(Mode.create("EDIT"), smd1.getPortletModes().get(1).g= etPortletMode()); + assertEquals(Mode.create("HELP"), smd1.getPortletModes().get(2).g= etPortletMode()); + + SupportsMetaData smd2 =3D p1.getSupports().get(1); + assertEquals("text/wml", smd2.getMimeType()); + assertEquals(Mode.create("VIEW"), smd2.getPortletModes().get(0).g= etPortletMode()); + assertEquals(Mode.create("HELP"), smd2.getPortletModes().get(1).g= etPortletMode()); + + List localeList =3D p1.getSupportedLocal= e(); + assertEquals(3, localeList.size()); + assertEquals("en", localeList.get(0).getLocale()); + assertEquals("fr", localeList.get(1).getLocale()); + assertEquals("fr_FR", localeList.get(2).getLocale()); + + assertEquals("MyResourceBundle", p1.getResourceBundle()); + + PortletInfoMetaData pimd =3D p1.getPortletInfo(); + assertNotNull(pimd); + assertEquals("very long portlet title", pimd.getTitle()); + assertEquals("short portlet title", pimd.getShortTitle()); + assertEquals("a,b,c,d,e,f", pimd.getKeywords()); + + PortletPreferencesMetaData ppmd =3D p1.getPortletPreferences(); + assertNotNull(ppmd); + assertEquals("MyValidator", ppmd.getPreferenceValidator()); + assertEquals("1", ppmd.getPortletPreferences().get("one").getValu= e().get(0)); + assertEquals("2", ppmd.getPortletPreferences().get("two").getValu= e().get(0)); + assertEquals(false, ppmd.getPortletPreferences().get("two").isRea= dOnly()); + assertEquals("3", ppmd.getPortletPreferences().get("three").getVa= lue().get(0)); + assertEquals(true, ppmd.getPortletPreferences().get("three").isRe= adOnly()); + assertEquals("1", ppmd.getPortletPreferences().get("all").getValu= e().get(0)); + assertEquals("2", ppmd.getPortletPreferences().get("all").getValu= e().get(1)); + assertEquals("3", ppmd.getPortletPreferences().get("all").getValu= e().get(2)); + + SecurityRoleRefMetaData srrmd1 =3D p1.getSecurityRoleRef().get(0); + assertNotNull(srrmd1); + assertEquals("role with no link", srrmd1.getDescription().getDefa= ultString()); + assertEquals("role sans link", srrmd1.getDescription().getString(= fr, false)); + assertEquals("ROLE_NAME_WITHOUT_LINK", srrmd1.getRoleName()); + + SecurityRoleRefMetaData srrmd2 =3D p1.getSecurityRoleRef().get(1); + assertNotNull(srrmd2); + assertEquals("role with link", srrmd2.getDescription().getDefault= String()); + assertEquals("role avec link", srrmd2.getDescription().getString(= fr, false)); + assertEquals("ROLE_NAME_WITH_LINK", srrmd2.getRoleName()); + assertEquals("ROLE_LINK", srrmd2.getRoleLink()); + + // Portlet2 + + PortletMetaData p2 =3D md.getPortlet("Portlet2"); + assertNotNull(p2); + assertEquals("org.jboss.portal.test.portlet.TestSessionPortlet", = p2.getPortletClass()); + assertEquals("text/html", p2.getSupports().get(0).getMimeType()); + assertEquals("test the portlet session", p2.getPortletInfo().getT= itle()); + + PortletMetaData p3 =3D md.getPortlet("Portlet3"); + assertNotNull(p3); + + PortletMetaData p4 =3D md.getPortlet("Portlet4"); + assertNotNull(p4); + + PortletMetaData p5 =3D md.getPortlet("Portlet5"); + assertNotNull(p5); + PortletPreferencesMetaData ppmd5 =3D p5.getPortletPreferences(); + assertEquals("1", ppmd5.getPortletPreferences().get("one").getVal= ue().get(0)); + assertEquals("2", ppmd5.getPortletPreferences().get("two").getVal= ue().get(0)); + assertEquals(false, ppmd5.getPortletPreferences().get("two").isRe= adOnly()); + assertEquals("3", ppmd5.getPortletPreferences().get("three").getV= alue().get(0)); + assertEquals(true, ppmd5.getPortletPreferences().get("three").isR= eadOnly()); + assertEquals("1", ppmd5.getPortletPreferences().get("all").getVal= ue().get(0)); + assertEquals("2", ppmd5.getPortletPreferences().get("all").getVal= ue().get(1)); + assertEquals("3", ppmd5.getPortletPreferences().get("all").getVal= ue().get(2)); + + PortletMetaData p6 =3D md.getPortlet("Portlet6"); + assertNotNull(p6); + assertEquals("Portlet6", p6.getResourceBundle()); + assertEquals(3, p6.getSupportedLocale().size()); + assertEquals("en", p6.getSupportedLocale().get(0).getLocale()); + assertEquals("fr", p6.getSupportedLocale().get(1).getLocale()); + assertEquals("fr_FR", p6.getSupportedLocale().get(2).getLocale()); + + PortletMetaData p7 =3D md.getPortlet("Portlet7"); + assertNotNull(p7); + + PortletMetaData p8 =3D md.getPortlet("Portlet8"); + assertNotNull(p8); + + PortletMetaData p9 =3D md.getPortlet("Portlet9"); + assertNotNull(p9); + + PortletMetaData p10 =3D md.getPortlet("Portlet10"); + assertNotNull(p10); + + PortletMetaData p11 =3D md.getPortlet("Portlet11"); + assertNotNull(p11); + + PortletMetaData p12 =3D md.getPortlet("Portlet12"); + assertNotNull(p12); + assertEquals(60, p12.getExpirationCache()); + + PortletMetaData p13 =3D md.getPortlet("Portlet13"); + assertNotNull(p13); + } + catch (Exception e) + { + e.printStackTrace(); + fail(); + } + } + + @Test + public void test021() + { + try + { + String xmlFile =3D "metadata/portlet/portlet2-jsr286.xml"; + + PortletApplication10MetaData md =3D unmarshall10(xmlFile); + assertNotNull(md); + assertTrue(md instanceof PortletApplication20MetaData); + assertEquals("2.0", md.getVersion()); + = + Locale fr =3D new Locale("fr"); + Locale default_locale =3D new Locale(PortletMetaDataConstants.DEF= AULT_LOCALE); + + PortletMetaData p1 =3D md.getPortlet("Portlet1"); + assertNotNull(p1); + assertEquals("fragmichnicht2", p1.getId()); + assertEquals("Portlet1", p1.getPortletName()); + assertEquals(default_locale, p1.getDescription().getDefaultLocale= ()); + assertEquals("default", p1.getDescription().getDefaultString()); + assertEquals("defaut", p1.getDescription().getString(fr, false)); + assertEquals(default_locale, p1.getDisplayName().getDefaultLocale= ()); + assertEquals("display", p1.getDisplayName().getDefaultString()); + assertEquals("affichage", p1.getDisplayName().getString(fr, false= )); + assertEquals("org.jboss.portal.test.portlet.TestPortlet", p1.getP= ortletClass()); + + InitParamMetaData ip1 =3D p1.getInitParams().get(0); + assertEquals(default_locale, ip1.getDescription().getDefaultLocal= e()); + assertEquals("first parameter", ip1.getDescription().getDefaultSt= ring()); + assertEquals("premier parametre", ip1.getDescription().getString(= fr, false)); + assertEquals("one", ip1.getName()); + assertEquals("1", ip1.getValue()); + + InitParamMetaData ip2 =3D p1.getInitParams().get(1); + assertNotNull(ip2); + assertEquals("second parameter", ip2.getDescription().getDefaultS= tring()); + assertEquals("deuxieme parametre", ip2.getDescription().getString= (fr, false)); + assertEquals("two", ip2.getName()); + assertEquals("2", ip2.getValue()); + + // Expiration cache + assertEquals(0, p1.getExpirationCache()); + + SupportsMetaData smd1 =3D p1.getSupports().get(0); + assertEquals("text/html", smd1.getMimeType()); + assertEquals(Mode.create("VIEW"), smd1.getPortletModes().get(0).g= etPortletMode()); + assertEquals(Mode.create("EDIT"), smd1.getPortletModes().get(1).g= etPortletMode()); + assertEquals(Mode.create("HELP"), smd1.getPortletModes().get(2).g= etPortletMode()); + // window state jsr 286 + assertEquals(WindowState.create("MAXIMIZED"), smd1.getWindowState= s().get(0).getWindowState()); + assertEquals(WindowState.create("NORMAL"), smd1.getWindowStates()= .get(1).getWindowState()); + + SupportsMetaData smd2 =3D p1.getSupports().get(1); + assertEquals("foo", smd2.getId()); + assertEquals("text/wml", smd2.getMimeType()); + assertEquals(Mode.create("VIEW"), smd2.getPortletModes().get(0).g= etPortletMode()); + assertEquals(Mode.create("HELP"), smd2.getPortletModes().get(1).g= etPortletMode()); + // window state jsr 286 + assertEquals(WindowState.create("NORMAL"), smd2.getWindowStates()= .get(0).getWindowState()); + assertEquals(WindowState.create("CUSTOM"), smd2.getWindowStates()= .get(1).getWindowState()); + + List localeList =3D p1.getSupportedLocal= e(); + assertEquals(3, localeList.size()); + assertEquals("en", localeList.get(0).getLocale()); + assertEquals("fr", localeList.get(1).getLocale()); + assertEquals("fr_FR", localeList.get(2).getLocale()); + + assertEquals("MyResourceBundle", p1.getResourceBundle()); + + PortletInfoMetaData pimd =3D p1.getPortletInfo(); + assertNotNull(pimd); + assertEquals("very long portlet title", pimd.getTitle()); + assertEquals("short portlet title", pimd.getShortTitle()); + assertEquals("a,b,c,d,e,f", pimd.getKeywords()); + + PortletPreferencesMetaData ppmd =3D p1.getPortletPreferences(); + assertNotNull(ppmd); + assertEquals("MyValidator", ppmd.getPreferenceValidator()); + assertEquals("1", ppmd.getPortletPreferences().get("one").getValu= e().get(0)); + assertEquals("2", ppmd.getPortletPreferences().get("two").getValu= e().get(0)); + assertEquals(false, ppmd.getPortletPreferences().get("two").isRea= dOnly()); + assertEquals("3", ppmd.getPortletPreferences().get("three").getVa= lue().get(0)); + assertEquals(true, ppmd.getPortletPreferences().get("three").isRe= adOnly()); + assertEquals("1", ppmd.getPortletPreferences().get("all").getValu= e().get(0)); + assertEquals("2", ppmd.getPortletPreferences().get("all").getValu= e().get(1)); + assertEquals("3", ppmd.getPortletPreferences().get("all").getValu= e().get(2)); + + SecurityRoleRefMetaData srrmd1 =3D p1.getSecurityRoleRef().get(0); + assertNotNull(srrmd1); + assertEquals("role with no link", srrmd1.getDescription().getDefa= ultString()); + assertEquals("role sans link", srrmd1.getDescription().getString(= fr, false)); + assertEquals("ROLE_NAME_WITHOUT_LINK", srrmd1.getRoleName()); + + SecurityRoleRefMetaData srrmd2 =3D p1.getSecurityRoleRef().get(1); + assertNotNull(srrmd2); + assertEquals("role with link", srrmd2.getDescription().getDefault= String()); + assertEquals("role avec link", srrmd2.getDescription().getString(= fr, false)); + assertEquals("ROLE_NAME_WITH_LINK", srrmd2.getRoleName()); + assertEquals("ROLE_LINK", srrmd2.getRoleLink()); + + // JSR 286 properties + assertEquals(PortletCacheScopeEnum.PUBLIC, p1.getCacheScope()); + assertEquals("http://example.com/testEvents", p1.getSupportedProc= essingEvent().get(0).getQname() + .getNamespaceURI()); + assertEquals("portletEvent", p1.getSupportedProcessingEvent().get= (0).getQname().getLocalPart()); + assertEquals("x", p1.getSupportedProcessingEvent().get(0).getQnam= e().getPrefix()); + assertEquals("foo", p1.getSupportedPublicRenderParameters().get(0= )); + assertEquals("bar", p1.getSupportedPublicRenderParameters().get(1= )); + assertEquals("foo2", p1.getSupportedPublicRenderParameters().get(= 2)); + assertEquals("foo2bar", p1.getSupportedPublicRenderParameters().g= et(3)); + + assertTrue(p1.getContainerRuntimeOptions().containsKey("option1")= ); + assertTrue(p1.getContainerRuntimeOptions().containsKey("option2")= ); + assertEquals("value1", p1.getContainerRuntimeOptions().get("optio= n1").getValues().get(0)); + assertEquals("value2", p1.getContainerRuntimeOptions().get("optio= n1").getValues().get(1)); + assertEquals("value3", p1.getContainerRuntimeOptions().get("optio= n2").getValues().get(0)); + + } + catch (Exception e) + { + e.printStackTrace(); + fail(); + } + } + +} Added: modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/m= etadata/RenderParameterTestEverythingTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/meta= data/RenderParameterTestEverythingTestCase.java (re= v 0) +++ modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/meta= data/RenderParameterTestEverythingTestCase.java 2008-02-29 17:00:22 UTC (re= v 10158) @@ -0,0 +1,79 @@ +/*************************************************************************= ***** + * 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.portlet.mc.metadata; + +import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData; +import org.jboss.portal.portlet.impl.metadata.PublicRenderParameterMetaDat= a; +import org.jboss.unit.api.pojo.annotations.Test; + +import static org.jboss.unit.api.Assert.*; +/** + * @author Emanuel Muckenhuber + * @version $Revision$ + */ +public class RenderParameterTestEverythingTestCase extends AbstractMetaDat= aTestCase +{ + + @Test + public void test02() + { + try + { + + String xmlFile =3D "metadata/renderParameter/portlet2.xml"; + + PortletApplication20MetaData md =3D unmarshall20(xmlFile); + assertNotNull(md); + assertTrue(md instanceof PortletApplication20MetaData); + assertEquals("2.0", md.getVersion()); + + PublicRenderParameterMetaData prp1 =3D md.getPublicRenderParamete= rs().get(0); + assertNotNull(prp1); + = + assertEquals("blah", prp1.getIdentifier()); + assertEquals("renderParameter1", prp1.getName()); + = + = + PublicRenderParameterMetaData prp2 =3D md.getPublicRenderParamete= rs().get(1); + assertEquals("foo", prp2.getQname().getLocalPart()); + assertEquals("x", prp2.getQname().getPrefix()); + assertEquals("http://someurl.com", prp2.getQname().getNamespaceUR= I()); + + assertEquals("fooo", prp1.getAlias().get(0).getLocalPart()); + assertEquals("rP1", prp1.getAlias().get(1).getLocalPart()); + + assertEquals("foo", prp2.getAlias().get(0).getLocalPart()); + assertEquals("http://someurl.alias.com", prp2.getAlias().get(0).g= etNamespaceURI()); + assertEquals("s", prp2.getAlias().get(0).getPrefix()); + = + assertEquals("render parameter foo", prp1.getDescription().getDef= aultString()); + + } + catch (Exception e) + { + e.printStackTrace(); + fail(); + } + } + +} Added: modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/m= etadata/SecurityConstraintTestEverythingTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/meta= data/SecurityConstraintTestEverythingTestCase.java = (rev 0) +++ modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/meta= data/SecurityConstraintTestEverythingTestCase.java 2008-02-29 17:00:22 UTC = (rev 10158) @@ -0,0 +1,215 @@ +/*************************************************************************= ***** + * 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.portlet.mc.metadata; + +import java.util.Locale; + +import org.jboss.portal.portlet.TransportGuarantee; +import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; +import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData; +import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData; +import org.jboss.portal.portlet.impl.metadata.security.SecurityConstraintM= etaData; +import org.jboss.unit.api.pojo.annotations.Test; + +import static org.jboss.unit.api.Assert.*; +/** + * @author Emanuel Muckenhuber + * @version $Revision$ + */ +public class SecurityConstraintTestEverythingTestCase extends AbstractMeta= DataTestCase +{ + + @Test + public void test01() + { + try + { + + String xmlFile =3D "metadata/security/portlet1.xml"; + + PortletApplication10MetaData md =3D unmarshall10(xmlFile); + assertNotNull(md); + assertTrue(md instanceof PortletApplication10MetaData); + assertEquals("1.0", md.getVersion()); + + SecurityConstraintMetaData scd1 =3D md.getSecurityConstraints().g= et(0); + assertNotNull(scd1); + assertEquals("test", scd1.getDisplayName().getDefaultString()); + assertEquals("Test", scd1.getDisplayName().getString(new Locale("= de"), false)); + assertEquals(TransportGuarantee.NONE, scd1.getUserDataConstraint(= ).getTransportQuarantee()); + = + assertEquals("foo", scd1.getPortletList().getPortletNames().get(0= )); + assertEquals("foobar", scd1.getPortletList().getPortletNames().ge= t(1)); + assertEquals("foo", scd1.getId()); + = + SecurityConstraintMetaData scd2 =3D md.getSecurityConstraints().g= et(1); + assertNotNull(scd2); + assertEquals(TransportGuarantee.INTEGRAL, scd2.getUserDataConstra= int().getTransportQuarantee()); + assertEquals("foo", scd2.getPortletList().getPortletNames().get(0= )); + assertEquals("fooConstraint", scd1.getUserDataConstraint().getDes= cription().getDefaultString()); + assertEquals("FooConstraint", scd1.getUserDataConstraint().getDes= cription().getString(new Locale("de"), false)); + + try + { + scd2.getPortletList().getPortletNames().get(1); + fail("2nd security constraint should only contain one element,= "); + } + catch (IndexOutOfBoundsException e) + { + // expected java.lang.IndexOutOfBoundsException + } + + PortletMetaData pmd1 =3D md.getPortlet("foo"); + assertNotNull(pmd1); + + PortletMetaData pmd2 =3D md.getPortlet("foobar"); + assertNotNull(pmd2); + } + catch (Exception e) + { + e.printStackTrace(); + fail(); + } + } + + /* + public void test011() + { + try + { + + String xmlFile =3D "security/portlet1-fail1.xml"; + String namespace =3D PortletMetaDataConstants.PORTLET_JSR_168_NS; + = + unmarshall(xmlFile, namespace, PortletApplication10MetaData.class= ); + = + fail(); = + } + catch(Exception e) + { + // OK + } + } + + public void test012() + { + try + { + + String xmlFile =3D "security/portlet1-fail1.xml"; + String namespace =3D PortletMetaDataConstants.PORTLET_JSR_168_NS; + = + unmarshall(xmlFile, namespace, PortletApplication10MetaData.class= ); + fail(); = + } + catch(Exception e) + { + // OK + } + } + */ + + @Test + public void test02() + { + try + { + + String xmlFile =3D "metadata/security/portlet2.xml"; + + PortletApplication10MetaData md =3D unmarshall10( xmlFile); + assertNotNull(md); + assertTrue(md instanceof PortletApplication20MetaData); + assertEquals("2.0", md.getVersion()); + + SecurityConstraintMetaData scd1 =3D md.getSecurityConstraints().g= et(0); + assertNotNull(scd1); + assertEquals("test", scd1.getDisplayName().getDefaultString()); + assertEquals("Test", scd1.getDisplayName().getString(new Locale("= de"), false)); + assertEquals("foo", scd1.getId()); + = + assertEquals(TransportGuarantee.NONE, scd1.getUserDataConstraint(= ).getTransportQuarantee()); + assertEquals("foo", scd1.getPortletList().getPortletNames().get(0= )); + assertEquals("foobar", scd1.getPortletList().getPortletNames().ge= t(1)); + = + + SecurityConstraintMetaData scd2 =3D md.getSecurityConstraints().g= et(1); + assertNotNull(scd2); + assertEquals(TransportGuarantee.INTEGRAL, scd2.getUserDataConstra= int().getTransportQuarantee()); + assertEquals("foo", scd2.getPortletList().getPortletNames().get(0= )); + assertEquals("fooConstraint", scd1.getUserDataConstraint().getDes= cription().getDefaultString()); + assertEquals("FooConstraint", scd1.getUserDataConstraint().getDes= cription().getString(new Locale("de"), false)); + = + try + { + scd2.getPortletList().getPortletNames().get(1); + fail("2nd security constraint should only contain one element,= "); + } + catch (IndexOutOfBoundsException e) + { + // expected java.lang.IndexOutOfBoundsException + } + + } + catch (Exception e) + { + e.printStackTrace(); + fail(); + } + } + /* = + public void test021() + { + try + { + + String xmlFile =3D "security/portlet2-fail1.xml"; + String namespace =3D PortletMetaDataConstants.PORTLET_JSR_286_N= S; + = + unmarshall(xmlFile, namespace, PortletApplication20MetaData.cla= ss); + fail(); = + } + catch(Exception e) + { + // OK + } + } + = + public void test022() + { + try + { + + String xmlFile =3D "security/portlet2-fail2.xml"; + String namespace =3D PortletMetaDataConstants.PORTLET_JSR_286_N= S; + = + unmarshall(xmlFile, namespace, PortletApplication20MetaData.cla= ss); + fail(); = + } + catch(Exception e) + { + // OK + } + } + */ +} Added: modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/m= etadata/UserAttributeTestEverythingTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/meta= data/UserAttributeTestEverythingTestCase.java (rev = 0) +++ modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/meta= data/UserAttributeTestEverythingTestCase.java 2008-02-29 17:00:22 UTC (rev = 10158) @@ -0,0 +1,100 @@ +/*************************************************************************= ***** + * 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.portlet.mc.metadata; + +import java.util.Locale; + +import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; +import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData; +import org.jboss.portal.portlet.impl.metadata.UserAttributeMetaData; +import org.jboss.unit.api.pojo.annotations.Test; + +import static org.jboss.unit.api.Assert.*; + +/** + * @author Emanuel Muckenhuber + * @version $Revision$ + */ +public class UserAttributeTestEverythingTestCase extends AbstractMetaDataT= estCase +{ + + @Test + public void test01() + { + try + { + String xmlFile =3D "metadata/userAttribute/portlet1.xml"; + + PortletApplication10MetaData md =3D unmarshall10(xmlFile); + assertNotNull(md); + assertTrue(md instanceof PortletApplication10MetaData); + + UserAttributeMetaData umb =3D md.getUserAttributes().get("blub"); + assertNotNull(umb); + assertEquals("notFoo", umb.getId()); + assertNull(umb.getDescription()); + + UserAttributeMetaData umd =3D md.getUserAttributes().get("foo"); + assertNotNull(umd); + assertEquals("realFoo", umd.getId()); + assertEquals("foobar", umd.getDescription().getDefaultString()); + assertEquals("fuhbar", umd.getDescription().getString(new Locale(= "de"), true)); + + } + catch (Exception e) + { + e.printStackTrace(); + fail(); + } + } + + @Test + public void test02() + { + try + { + String xmlFile =3D "metadata/userAttribute/portlet2.xml"; + + PortletApplication10MetaData md =3D unmarshall10(xmlFile); + assertNotNull(md); + assertTrue(md instanceof PortletApplication20MetaData); + + UserAttributeMetaData umb =3D md.getUserAttributes().get("blub"); + assertNotNull(umb); + assertEquals("notFoo", umb.getId()); + assertNull(umb.getDescription()); + + UserAttributeMetaData umd =3D md.getUserAttributes().get("foo"); + assertNotNull(umd); + assertEquals("realFoo", umd.getId()); + assertEquals("foobar", umd.getDescription().getDefaultString()); + assertEquals("fuhbar", umd.getDescription().getString(new Locale(= "de"), true)); + } + catch (Exception e) + { + e.printStackTrace(); + fail(); + } + } + +} Added: modules/portlet/trunk/mc/src/test/resources/local-jboss-unit.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/local-jboss-unit.xml = (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/local-jboss-unit.xml 2008-0= 2-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,71 @@ + + + + + + + annotation + factory + + + + + + annotation + factory + + + + + + annotation + factory + + + + + + annotation + factory + + + + + + annotation + factory + + + + + + annotation + factory + + + + + + annotation + factory + + + + + + annotation + factory + + + + + + annotation + factory + + + + Added: modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMo= de/portlet1-fail.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/= portlet1-fail.xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/= portlet1-fail.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,44 @@ + + + + = + + portletMode1 + eigener portlet modus + Custom + true + Portlet Mode One + Eigener Portlet Modus Eins + + + + Portlet Mode One + Custom2 + false + + = + \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMo= de/portlet1.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/= portlet1.xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/= portlet1.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,39 @@ + + + + = + + portletMode1 + eigener portlet modus + Custom + + + + Custom2 + + = + \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMo= de/portlet2.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/= portlet2.xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/= portlet2.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,46 @@ + + + + + + portletMode1 + eigener portlet modus + Custom + true + + + + Custom2 + false + + + + Portlet Mode Three + Custom3 + + + \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/resources/metadata/customWindowSta= te/portlet1.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/customWindowState/= portlet1.xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/customWindowState/= portlet1.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,43 @@ + + + + = + + WindowState + Offenes Fenster + windowState1 + + + + windowState2 + + + + windowState3 + + = + \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/resources/metadata/customWindowSta= te/portlet2.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/customWindowState/= portlet2.xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/customWindowState/= portlet2.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,43 @@ + + + + = + + WindowState + Offenes Fenster + windowState1 + + + + windowState2 + + + + windowState3 + + = + \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-e= vent1.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-even= t1.xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-even= t1.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,33 @@ + + + + = + + MustFail + + = + \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-e= vent2-fail.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-even= t2-fail.xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-even= t2-fail.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,63 @@ + + + + + + Portlet2 + + org.jboss.portal.test.portlet.TestSessionPortlet + + + text/html + + + test the portlet session + + + x:portletEvent + + + hellouh + + = + + x:portletEvent + fooooo + + + hellouh + + + + + x:portletEvent + hellouh + hello + + + + \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-e= vent2.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-even= t2.xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-even= t2.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,69 @@ + + + + + + Portlet2 + + org.jboss.portal.test.portlet.TestSessionPortlet + + + text/html + + + test the portlet session + + + x:portletEvent + + + hellouh + + = + + x:portletEvent + + + hellouh + + + + + descriptionDefaultLanguage + Beschreibung in Deutsch + x:portletEvent + + org.jboss.portal.event.invoke.refill.beer + + + + + hellouh + hello + + + \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/resources/metadata/filter/portlet-= filter1.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/filter/portlet-fil= ter1.xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/filter/portlet-fil= ter1.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,33 @@ + + + + = + + testFilter + + = + \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/resources/metadata/filter/portlet-= filter2.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/filter/portlet-fil= ter2.xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/filter/portlet-fil= ter2.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,73 @@ + + + + = + + test + bla + foo + foobar + testFilter + + org.jboss.portal.meta.NoExistingClass + + ACTION_PHASE + RENDER_PHASE + + biere + beer + foo + bar + + + test + testing + + + + + testFilterZwei + org.jboss.portal.meta.NoExistingClass + ACTION_PHASE + + = + + foo + + = + + testFilter + Portlet1 + Portlet2 + + + + testFilterZwei + Portlet2 + + = + \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet= -app_1_0.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet-ap= p_1_0.xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet-ap= p_1_0.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,65 @@ + + + + description + portlet-name + display-name + portlet-class + + description + name + value + + 0 + + mime-type + portlet-mode + + supported-locale + resource-bundle + + title + short-title + keywords + + + + name + value + true + + preferences-validator + + + description + NMTOKEN + role-link + + + + description + portlet-mode + + + description + window-state + + + description + name + + + display-name + + portlet-name + + + description + NONE + + + Added: modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet= -app_2_0.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet-ap= p_2_0.xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet-ap= p_2_0.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,118 @@ + + + + description + portlet-name + display-name + portlet-class + + description + name + value + + 0 + PRIVATE + + mime-type + portlet-mode + window-state + + supported-locale + resource-bundle + + title + short-title + keywords + + + + name + value + true + + preferences-validator + + + description + NMTOKEN + role-link + + + QName + + + QName + + supported-public-render-parameter + + name + value + + + + description + portlet-mode + true + + + description + window-state + + + description + name + + + display-name + + portlet-name + + + description + CONFIDENTIAL + + + resource-bundle + + description + display-name + filter-name + filter-class + RENDER_PHASE + + description + name + value + + + + filter-name + portlet-name + + http://tempuri.org + + description + QName + QName + value-type + + + description + identifier + QName + QName + + + description + display-name + listener-class + + + name + value + + Added: modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet= 1.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet1.x= ml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet1.x= ml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,337 @@ + + + + + default + defaut + Portlet1 + display + affichage + + org.jboss.portal.test.portlet.TestPortlet + + + first parameter + premier parametre + one + 1 + + + second parameter + deuxieme parametre + two + 2 + + 0 + + text/html + VIEW + EDIT + HELP + + + text/wml + VIEW + HELP + + en + fr + MyResourceBundle + + very long portlet title + short portlet title + a,b,c,d,e,f + + + + one + 1 + + + two + 2 + false + + + three + 3 + true + + + all + 1 + 2 + 3 + + MyValidator + + + role with no link + role sans link + ROLE_NAME_WITHOUT_LINK + + + role with link + role avec link + ROLE_NAME_WITH_LINK + ROLE_LINK + + + + + Portlet2 + + org.jboss.portal.test.portlet.TestSessionPortlet + + + text/html + + + test the portlet session + + + + + Portlet3 + + org.jboss.portal.test.portlet.TestDispatcherPortlet + + + text/html + + + test the portlet request dispatcher + + + + + Portlet4 + + org.jboss.portal.test.portlet.TestRedirectPortlet + + + text/html + + + test the portlet redirection + + + + + + Portlet5 + + org.jboss.portal.test.portlet.TestPortletPreferencesPortlet + + + text/html + + + test the portlet preferences + + + + one + 1 + + + two + 2 + false + + + three + 3 + true + + + all + 1 + 2 + 3 + + + + + + Portlet6 + + org.jboss.portal.test.portlet.TestResourceBundlePortlet + + + text/html + + en + fr + Portlet6 + + Very long portlet title + Short portlet title + a,b,c,d,e,f + + + + + Portlet7 + + org.jboss.portal.test.portlet.TestExceptionDuringActionPortlet + + + text/html + + + Test exception during the action request + + + + + Portlet8 + + org.jboss.portal.test.portlet.TestSecurityPortlet + + + text/html + + + Test portlet security + + + + + Portlet9 + + org.jboss.portal.test.portlet.TestUserInformationPortlet + + + text/html + + + Test user information + + + + + Portlet10 + + org.jboss.portal.test.portlet.TestPortletModePortlet + + + text/html + + + Test portlet modes + + + + + Portlet11 + + org.jboss.portal.test.portlet.TestSecuredProtocolPortlet + + + text/html + + + Test https URL + + + + + Portlet12 + + org.jboss.portal.test.portlet.TestCachedContentPortlet + + 60 + + text/html + + + Test cached content + + + + + Portlet13 + + org.jboss.portal.test.portlet.CrossContextSessionPortlet + + + text/html + + + Test cross session context + + + + + + first mode + premier mode + configure + + + second mode + inactive + + + first state + premier etat + blur + + + second state + black and white + + + first attribute + premier attribut + att1 + + + second attribute + att2 + + + + + Portlet1 + + + CONFIDENTIAL + + + + + Portlet1 + Portlet4 + + + INTEGRAL + + + + Added: modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet= 2-jsr286.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet2-j= sr286.xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet2-j= sr286.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,367 @@ + + + + + default + defaut + Portlet1 + display + affichage + + org.jboss.portal.test.portlet.TestPortlet + + + first parameter + premier parametre + one + 1 + + + second parameter + deuxieme parametre + two + 2 + + 0 + + text/html + VIEW + EDIT + HELP + + + text/wml + VIEW + HELP + + en + fr + MyResourceBundle + + very long portlet title + short portlet title + a,b,c,d,e,f + + + + one + 1 + + + two + 2 + false + + + three + 3 + true + + + all + 1 + 2 + 3 + + MyValidator + + + role with no link + role sans link + ROLE_NAME_WITHOUT_LINK + + + role with link + role avec link + ROLE_NAME_WITH_LINK + ROLE_LINK + + + + + Portlet2 + + org.jboss.portal.test.portlet.TestSessionPortlet + + + text/html + + + test the portlet session + + + + + Portlet3 + + org.jboss.portal.test.portlet.TestDispatcherPortlet + + + text/html + + + test the portlet request dispatcher + + + + + Portlet4 + + org.jboss.portal.test.portlet.TestRedirectPortlet + + + text/html + + + test the portlet redirection + + + + + + Portlet5 + + org.jboss.portal.test.portlet.TestPortletPreferencesPortlet + + + text/html + + + test the portlet preferences + + + + one + 1 + + + two + 2 + false + + + three + 3 + true + + + all + 1 + 2 + 3 + + + + + + Portlet6 + + org.jboss.portal.test.portlet.TestResourceBundlePortlet + + + text/html + + en + fr + Portlet6 + + Very long portlet title + Short portlet title + a,b,c,d,e,f + + + + + Portlet7 + + org.jboss.portal.test.portlet.TestExceptionDuringActionPortlet + + + text/html + + + Test exception during the action request + + + + + Portlet8 + + org.jboss.portal.test.portlet.TestSecurityPortlet + + + text/html + + + Test portlet security + + + + + Portlet9 + + org.jboss.portal.test.portlet.TestUserInformationPortlet + + + text/html + + + Test user information + + + + + Portlet10 + + org.jboss.portal.test.portlet.TestPortletModePortlet + + + text/html + + + Test portlet modes + + + + + Portlet11 + + org.jboss.portal.test.portlet.TestSecuredProtocolPortlet + + + text/html + + + Test https URL + + + + + Portlet12 + + org.jboss.portal.test.portlet.TestCachedContentPortlet + + 60 + + text/html + + + Test cached content + + + + + Portlet13 + + org.jboss.portal.test.portlet.CrossContextSessionPortlet + + + text/html + + + Test cross session context + + + + + + first mode + premier mode + configure + + + second mode + inactive + + + first state + premier etat + blur + + + second state + black and white + + + first attribute + premier attribut + att1 + + + second attribute + att2 + + + + + Portlet1 + + + CONFIDENTIAL + + + + + Portlet1 + Portlet4 + + + INTEGRAL + + + = + MyResourceBundle + foobar + = + + Public render parameter one + blub + param1 + Parameter1 + Parameter2 + + + + Description EN + Beschreibung + My Listener One + Mein Zuh=C3=B6rer Eins + org.jboss.portal.portlet.test.listener.MyListener + + + + My Listener Two + org.jboss.portal.portlet.test.listener.MyListenerTwo + = + = + + foo + foobar + foobar2 + + = + \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet= 2.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet2.x= ml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet2.x= ml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,338 @@ + + + + + default + defaut + Portlet1 + display + affichage + + org.jboss.portal.test.portlet.TestPortlet + + + first parameter + premier parametre + one + 1 + + + second parameter + deuxieme parametre + two + 2 + + 0 + + text/html + VIEW + EDIT + HELP + + + text/wml + VIEW + HELP + + en + fr + MyResourceBundle + + very long portlet title + short portlet title + a,b,c,d,e,f + + + + one + 1 + + + two + 2 + false + + + three + 3 + true + + + all + 1 + 2 + 3 + + MyValidator + + + role with no link + role sans link + ROLE_NAME_WITHOUT_LINK + + + role with link + role avec link + ROLE_NAME_WITH_LINK + ROLE_LINK + + + + + Portlet2 + + org.jboss.portal.test.portlet.TestSessionPortlet + + + text/html + + + test the portlet session + + + + + Portlet3 + + org.jboss.portal.test.portlet.TestDispatcherPortlet + + + text/html + + + test the portlet request dispatcher + + + + + Portlet4 + + org.jboss.portal.test.portlet.TestRedirectPortlet + + + text/html + + + test the portlet redirection + + + + + + Portlet5 + + org.jboss.portal.test.portlet.TestPortletPreferencesPortlet + + + text/html + + + test the portlet preferences + + + + one + 1 + + + two + 2 + false + + + three + 3 + true + + + all + 1 + 2 + 3 + + + + + + Portlet6 + + org.jboss.portal.test.portlet.TestResourceBundlePortlet + + + text/html + + en + fr + Portlet6 + + Very long portlet title + Short portlet title + a,b,c,d,e,f + + + + + Portlet7 + + org.jboss.portal.test.portlet.TestExceptionDuringActionPortlet + + + text/html + + + Test exception during the action request + + + + + Portlet8 + + org.jboss.portal.test.portlet.TestSecurityPortlet + + + text/html + + + Test portlet security + + + + + Portlet9 + + org.jboss.portal.test.portlet.TestUserInformationPortlet + + + text/html + + + Test user information + + + + + Portlet10 + + org.jboss.portal.test.portlet.TestPortletModePortlet + + + text/html + + + Test portlet modes + + + + + Portlet11 + + org.jboss.portal.test.portlet.TestSecuredProtocolPortlet + + + text/html + + + Test https URL + + + + + Portlet12 + + org.jboss.portal.test.portlet.TestCachedContentPortlet + + 60 + + text/html + + + Test cached content + + + + + Portlet13 + + org.jboss.portal.test.portlet.CrossContextSessionPortlet + + + text/html + + + Test cross session context + + + + + + first mode + premier mode + configure + + + second mode + inactive + + + first state + premier etat + blur + + + second state + black and white + + + first attribute + premier attribut + att1 + + + second attribute + att2 + + + + + Portlet1 + + + CONFIDENTIAL + + + + + Portlet1 + Portlet4 + + + INTEGRAL + + + = + + \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet= 1-simple.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet1-s= imple.xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet1-s= imple.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,10 @@ + + = + + foo + + = + \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet= 1.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet1.x= ml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet1.x= ml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,268 @@ + + + default + defaut + Portlet1 + display + affichage + + org.jboss.portal.test.portlet.TestPortlet + + + first parameter + premier parametre + one + 1 + + + second parameter + deuxieme parametre + two + 2 + + 0 + + text/html + VIEW + EDIT + HELP + + + text/wml + VIEW + HELP + + en + fr + fr_FR + MyResourceBundle + + very long portlet title + short portlet title + a,b,c,d,e,f + + + + one + 1 + + + two + 2 + false + + + three + 3 + true + + + all + 1 + 2 + 3 + + MyValidator + + + role with no link + role sans link + ROLE_NAME_WITHOUT_LINK + + + role with link + role avec link + ROLE_NAME_WITH_LINK + ROLE_LINK + + + + + Portlet2 + + org.jboss.portal.test.portlet.TestSessionPortlet + + + text/html + + + test the portlet session + + + + + Portlet3 + + org.jboss.portal.test.portlet.TestDispatcherPortlet + + + text/html + + + test the portlet request dispatcher + + + + + Portlet4 + + org.jboss.portal.test.portlet.TestRedirectPortlet + + + text/html + + + test the portlet redirection + + + + + + Portlet5 + + org.jboss.portal.test.portlet.TestPortletPreferencesPortlet + + + text/html + + + test the portlet preferences + + + + one + 1 + + + two + 2 + false + + + three + 3 + true + + + all + 1 + 2 + 3 + + + + + + Portlet6 + + org.jboss.portal.test.portlet.TestResourceBundlePortlet + + + text/html + + en + fr + fr_FR + Portlet6 + + Very long portlet title + Short portlet title + a,b,c,d,e,f + + + + + Portlet7 + + org.jboss.portal.test.portlet.TestExceptionDuringActionPortlet + + + text/html + + + Test exception during the action request + + + + + Portlet8 + + org.jboss.portal.test.portlet.TestSecurityPortlet + + + text/html + + + Test portlet security + + + + + Portlet9 + + org.jboss.portal.test.portlet.TestUserInformationPortlet + + + text/html + + + Test user information + + + + + Portlet10 + + org.jboss.portal.test.portlet.TestPortletModePortlet + + + text/html + + + Test portlet modes + + + + + Portlet11 + + org.jboss.portal.test.portlet.TestSecuredProtocolPortlet + + + text/html + + + Test https URL + + + + + Portlet12 + + org.jboss.portal.test.portlet.TestCachedContentPortlet + + 60 + + text/html + + + Test cached content + + + + + Portlet13 + + org.jboss.portal.test.portlet.CrossContextSessionPortlet + + + text/html + + + Test cross session context + + + Added: modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet= 2-jsr286.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet2-j= sr286.xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet2-j= sr286.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,111 @@ + + + default + defaut + Portlet1 + display + affichage + + org.jboss.portal.test.portlet.TestPortlet + + + first parameter + premier parametre + one + 1 + + + second parameter + deuxieme parametre + two + 2 + + 0 + PUBLIC + + text/html + VIEW + EDIT + HELP + MAXIMIZED + NORMAL + + + text/wml + VIEW + HELP + NORMAL + CUSTOM + + en + fr + fr_FR + MyResourceBundle + + very long portlet title + short portlet title + a,b,c,d,e,f + + + + one + 1 + + + two + 2 + false + + + three + 3 + true + + + all + 1 + 2 + 3 + + MyValidator + + + role with no link + role sans link + ROLE_NAME_WITHOUT_LINK + + + role with link + role avec link + ROLE_NAME_WITH_LINK + ROLE_LINK + + + x:portletEvent + + + x:portletEvent + + = + foo + bar + foo2 + foo2bar + + option1 + value1 + value2 + + = + + option2 + value3 + + = + + + + \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet= 2.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet2.x= ml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet2.x= ml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,270 @@ + + + default + defaut + Portlet1 + display + affichage + + org.jboss.portal.test.portlet.TestPortlet + + + first parameter + premier parametre + one + 1 + + + second parameter + deuxieme parametre + two + 2 + + 0 + PUBLIC + + text/html + VIEW + EDIT + HELP + + + text/wml + VIEW + HELP + + en + fr + fr_FR + MyResourceBundle + + very long portlet title + short portlet title + a,b,c,d,e,f + + + + one + 1 + + + two + 2 + false + + + three + 3 + true + + + all + 1 + 2 + 3 + + MyValidator + + + role with no link + role sans link + ROLE_NAME_WITHOUT_LINK + + + role with link + role avec link + ROLE_NAME_WITH_LINK + ROLE_LINK + + + + + Portlet2 + + org.jboss.portal.test.portlet.TestSessionPortlet + + + text/html + + + test the portlet session + + + + + Portlet3 + + org.jboss.portal.test.portlet.TestDispatcherPortlet + + + text/html + + + test the portlet request dispatcher + + + + + Portlet4 + + org.jboss.portal.test.portlet.TestRedirectPortlet + + + text/html + + + test the portlet redirection + + + + + + Portlet5 + + org.jboss.portal.test.portlet.TestPortletPreferencesPortlet + + + text/html + + + test the portlet preferences + + + + one + 1 + + + two + 2 + false + + + three + 3 + true + + + all + 1 + 2 + 3 + + + + + + Portlet6 + + org.jboss.portal.test.portlet.TestResourceBundlePortlet + + + text/html + + en + fr + fr_FR + Portlet6 + + Very long portlet title + Short portlet title + a,b,c,d,e,f + + + + + Portlet7 + + org.jboss.portal.test.portlet.TestExceptionDuringActionPortlet + + + text/html + + + Test exception during the action request + + + + + Portlet8 + + org.jboss.portal.test.portlet.TestSecurityPortlet + + + text/html + + + Test portlet security + + + + + Portlet9 + + org.jboss.portal.test.portlet.TestUserInformationPortlet + + + text/html + + + Test user information + + + + + Portlet10 + + org.jboss.portal.test.portlet.TestPortletModePortlet + + + text/html + + + Test portlet modes + + + + + Portlet11 + + org.jboss.portal.test.portlet.TestSecuredProtocolPortlet + + + text/html + + + Test https URL + + + + + Portlet12 + + org.jboss.portal.test.portlet.TestCachedContentPortlet + + 60 + + text/html + + + Test cached content + + + + + Portlet13 + + org.jboss.portal.test.portlet.CrossContextSessionPortlet + + + text/html + + + p13 + + + = + \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/resources/metadata/portlet-app_1_0= .xsd =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/portlet-app_1_0.xs= d (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/portlet-app_1_0.xs= d 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,682 @@ + + + + + This is the XML Schema for the Portlet 1.0 deployment + descriptor. + + + + + The following conventions apply to all J2EE deployment + descriptor elements unless indicated otherwise. - In + elements that specify a pathname to a file within the same + JAR file, relative filenames (i.e., those not starting with + "/") are considered relative to the root of the JAR file's + namespace. Absolute filenames (i.e., those starting with + "/") also specify names in the root of the JAR file's + namespace. In general, relative names are preferred. The + exception is .war files where absolute names are preferred + for consistency with the Servlet API. + + + + + + + + The portlet-app element is the root of the deployment + descriptor for a portlet application. This element has a + required attribute version to specify to which version + of the schema the deployment descriptor conforms. + + + + + + The portlet element contains the name of a portlet. + This name must be unique within the portlet + application. + + + + + + + + + The custom-portlet-mode element contains the + portlet-mode. This portlet mode must be unique + within the portlet application. + + + + + + + + + The custom-window-state element contains the + window-state. This window state must be unique + within the portlet application. + + + + + + + + + The user-attribute element contains the name the + attribute. This name must be unique within the + portlet application. + + + + + + + + + + + + + The init-param element contains the name the + attribute. This name must be unique within + the portlet. + + + + + + + + + The supports element contains the supported + mime-type. This mime type must be unique + within the portlet. + + + + + + + + + The preference element contains the name the + preference. This name must be unique within + the portlet. + + + + + + + + + The security-role-ref element contains the + role-name. This role name must be unique + within the portlet. + + + + + + + + + + + + + + + + + + A custom portlet mode that one or more portlets in this + portlet application supports. Used in: portlet-app + + + + + + + + + + + + A custom window state that one or more portlets in this + portlet application supports. Used in: portlet-app + + + + + + + + + + + + Expriation-cache defines expiration-based caching for + this portlet. The parameter indicates the time in + seconds after which the portlet output expires. -1 + indicates that the output never expires. Used in: + portlet + + + + + + + + + + The init-param element contains a name/value pair as an + initialization param of the portlet Used in:portlet + + + + + + + + + + + + + Locale specific keywords associated with this portlet. + The kewords are separated by commas. Used in: + portlet-info + + + + + + + + + + MIME type name, e.g. "text/html". The MIME type may also + contain the wildcard character '*', like "text/*" or + "*/*". Used in: supports + + + + + + + + + + The name element contains the name of a parameter. Used + in: init-param, ... + + + + + + + + + + The portlet element contains the declarative data of a + portlet. Used in: portlet-app + + + + + + + + + + + + + + + + + + + + + + + + + + + The portlet-class element contains the fully qualified + class name of the portlet. Used in: portlet + + + + + + + + The portlet-collectionType is used to identify a subset + of portlets within a portlet application to which a + security constraint applies. Used in: + security-constraint + + + + + + + + + + + + + + + + + + Portlet modes. The specification pre-defines the + following values as valid portlet mode constants: + "edit", "help", "view". Portlet mode names are not case + sensitive. Used in: custom-portlet-mode, supports + + + + + + + + + + The portlet-name element contains the canonical name of + the portlet. Each portlet name is unique within the + portlet application. Used in: portlet, portlet-mapping + + + + + + + + + + Portlet persistent preference store. Used in: portlet + + + + + + + + + + + + Persistent preference values that may be used for + customization and personalization by the portlet. Used + in: portlet-preferences + + + + + + + + + + + + + The class specified under preferences-validator + implements the PreferencesValidator interface to + validate the preferences settings. Used in: + portlet-preferences + + + + + + + + read-only indicates that a setting cannot be changed in + any of the standard portlet modes ("view","edit" or + "help"). Per default all preferences are modifiable. + Valid values are: - true for read-only - false for + modifiable Used in: preferences + + + + + + + + + + + Filename of the resource bundle containing the language + specific portlet informations in different languages. + Used in: portlet-info + + + + + + + + + + The role-link element is a reference to a defined + security role. The role-link element must contain the + name of one of the security roles defined in the + security-role elements. Used in: security-role-ref + + + + + + + + + + The security-constraintType is used to associate + intended security constraints with one or more portlets. + Used in: portlet-app + + + + + + + + + + + + + The security-role-ref element contains the declaration + of a security role reference in the code of the web + application. The declaration consists of an optional + description, the security role name used in the code, + and an optional link to a security role. If the security + role is not specified, the Deployer must choose an + appropriate security role. The value of the role name + element must be the String used as the parameter to the + EJBContext.isCallerInRole(String roleName) method or the + HttpServletRequest.isUserInRole(String role) method. + Used in: portlet + + + + + + + + + + + + + Locale specific short version of the static title. Used + in: portlet-info + + + + + + + + + + Supports indicates the portlet modes a portlet supports + for a specific content type. All portlets must support + the view mode. Used in: portlet + + + + + + + + + + + + Indicated the locales the portlet supports. Used in: + portlet + + + + + + + + + + Locale specific static title for this portlet. Used in: + portlet-info + + + + + + + + + + The transport-guaranteeType specifies that the + communication between client and portlet should be NONE, + INTEGRAL, or CONFIDENTIAL. NONE means that the portlet + does not require any transport guarantees. A value of + INTEGRAL means that the portlet requires that the data + sent between the client and portlet be sent in such a + way that it can't be changed in transit. CONFIDENTIAL + means that the portlet requires that the data be + transmitted in a fashion that prevents other entities + from observing the contents of the transmission. In most + cases, the presence of the INTEGRAL or CONFIDENTIAL flag + will indicate that the use of SSL is required. Used in: + user-data-constraint + + + + + + + + + + + + User attribute defines a user specific attribute that + the portlet application needs. The portlet within this + application can access this attribute via the request + parameter USER_INFO map. Used in: portlet-app + + + + + + + + + + + + The user-data-constraintType is used to indicate how + data communicated between the client and portlet should + be protected. Used in: security-constraint + + + + + + + + + + + + The value element contains the value of a parameter. + Used in: init-param + + + + + + + + + + Portlet window state. Window state names are not case + sensitive. Used in: custom-window-state + + + + + + + + + + + The description element is used to provide text + describing the parent element. The description element + should include any information that the portlet + application war file producer wants to provide to the + consumer of the portlet application war file (i.e., to + the Deployer). Typically, the tools used by the portlet + application war file consumer will display the + description when processing the parent element that + contains the description. It has an optional attribute + xml:lang to indicate which language is used in the + description according to RFC 1766 + (http://www.ietf.org/rfc/rfc1766.txt). The default value + of this attribute is English(=E2=80=9Cen=E2=80=9D). Used in: init-para= m, + portlet, portlet-app, security-role + + + + + + + + + + + + The display-name type contains a short name that is + intended to be displayed by tools. It is used by + display-name elements. The display name need not be + unique. Example: ... + + Employee Self Service + + + It has an optional attribute xml:lang to indicate which + language is used in the description according to RFC + 1766 (http://www.ietf.org/rfc/rfc1766.txt). The default + value of this attribute is English(=E2=80=9Cen=E2=80=9D). + + + + + + + + + + + + The elements that use this type designate the name of a + Java class or interface. + + + + + + + + The role-nameType designates the name of a security + role. + + The name must conform to the lexical rules for an + NMTOKEN. + + + + + + + + This is a special string datatype that is defined by + J2EE as a base type for defining collapsed strings. When + schemas require trailing/leading space elimination as + well as collapsing the existing whitespace, this base + type may be used. + + + + + + + Added: modules/portlet/trunk/mc/src/test/resources/metadata/portlet-app_2_0= .xsd =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/portlet-app_2_0.xs= d (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/portlet-app_2_0.xs= d 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,830 @@ + + + + + This is the XML Schema for the Portlet 2.0 deployment descriptor. + + + + + The following conventions apply to all J2EE + deployment descriptor elements unless indicated otherwise. + - In elements that specify a pathname to a file within the + same JAR file, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the JAR file's namespace. Absolute filenames (i.e., those + starting with "/") also specify names in the root of the + JAR file's namespace. In general, relative names are + preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + The portlet-app element is the root of the deployment descriptor + for a portlet application. This element has a required attribute version + to specify to which version of the schema the deployment descriptor + conforms. In order to be a valid JSR 286 portlet application the version + must have the value "2.0". + + + + + + The portlet element contains the name of a portlet. + This name must be unique within the portlet application. + + + + + + + + + The custom-portlet-mode element contains the portlet-mode. + This portlet mode must be unique within the portlet application. + + + + + + + + + The custom-window-state element contains the window-state. + This window state must be unique within the portlet application. + + + + + + + + + The user-attribute element contains the name the attribute. + This name must be unique within the portlet application. + + + + + + + + + The filter element contains the name of a filter. + The name must be unique within the portlet application. + + + + + + + + + + + + + The init-param element contains the name the attribute. + This name must be unique within the portlet. + + + + + + + + + The supports element contains the supported mime-type. + This mime type must be unique within the portlet. + + + + + + + + + The preference element contains the name the preference. + This name must be unique within the portlet. + + + + + + + + + The security-role-ref element contains the role-name. + This role name must be unique within the portlet. + + + + + + + + + + + + + + + + + + + + + + + + + + Caching scope, allowed values are "private" indicating that the content= should not be shared + across users and "public" indicating that the content may be shared acr= oss users. + The default value if not present is "private". + Used in: portlet + + + + + + + + + + A custom portlet mode that one or more portlets in = + this portlet application supports. + If the portal does not need to provide some management functionality + for this portlet mode, the portal-managed element needs to be set + to "false", otherwise to "true". Default is "true". + Used in: portlet-app + + + + + + + + + + + + + A custom window state that one or more portlets in this = + portlet application supports. + Used in: portlet-app + + + + + + + + + + + + Expiration-time defines the time in seconds after which the portlet out= put expires. = + -1 indicates that the output never expires. + Used in: portlet + + + + + + + + + + The init-param element contains a name/value pair as an = + initialization param of the portlet + Used in:portlet + + + + + + + + + + + + + Locale specific keywords associated with this portlet. + The kewords are separated by commas. + Used in: portlet-info + + + + + + + + + + MIME type name, e.g. "text/html". + The MIME type may also contain the wildcard + character '*', like "text/*" or "*/*". + Used in: supports + + + + + + + + + + The name element contains the name of a parameter. = + Used in: init-param, ... + + + + + + + + + + The portlet element contains the declarative data of a portlet. = + Used in: portlet-app + + + + + + + + + + + + + + + + + + + + + + + + + + + The portlet-class element contains the fully + qualified class name of the portlet. + Used in: portlet + + + + + + + + The container-runtime-option element contains settings + for the portlet container that the portlet expects to be honored + at runtime. These settings may re-define default portlet container + behavior, like the javax.portlet.escapeXml setting that disables + XML encoding of URLs produced by the portlet tag library as + default. + Names with the javax.portlet prefix are reserved for the Java + Portlet Specification. + Used in: portlet-app, portlet + + + + + + + + + + + Declaration of the filter mappings in this portlet + application is done by using filter-mappingType. + The container uses the filter-mapping + declarations to decide which filters to apply to a request, + and in what order. To determine which filters to + apply it matches filter-mapping declarations on the + portlet-name and the lifecyle phase defined in the + filter element. The order in which filters are invoked = + is the order in which filter-mapping declarations = + that match appear in the list of filter-mapping elements. + Used in: portlet-app + + + + + + + + + + + The filter element specifies a filter that can transform the = + content of portlet requests and portlet responses. = + Filters can access the initialization parameters declared in = + the deployment descriptor at runtime via the FilterConfig = + interface. + A filter can be restricted to one or more lifecycle phases + of the portlet. Valid entries for lifecycle are: + ACTION_PHASE, EVENT_PHASE, RENDER_PHASE, + RESOURCE_PHASE + Used in: portlet-app + + + + + + + + + + + + + + + The portlet-collectionType is used to identify a subset + of portlets within a portlet application to which a = + security constraint applies. + Used in: security-constraint + + + + + + + + + + The event-definitionType is used to declare events the portlet can eith= er + receive or emit. + The name must be unique and must be the one the = + portlet is using in its code for referencing this event. + Used in: portlet-app + + + + + + + + + + + + + + + + + The event-definition-referenceType is used to reference events = + declared with the event-definition element at application level. + Used in: portlet + + + + + + + + + + + + The listenerType is used to declare listeners for this portlet applicat= ion. + Used in: portlet-app + + + + + + + + + + + + + + + + + + + + + portal-managed indicates if a custom portlet mode + needs to be managed by the portal or not. + Per default all custom portlet modes are portal managed. + Valid values are: = + - true for portal-managed + - false for not portal managed + Used in: custom-portlet-modes + + + + + + + + + + + Portlet modes. The specification pre-defines the following values = + as valid portlet mode constants: = + "edit", "help", "view". + Portlet mode names are not case sensitive. + Used in: custom-portlet-mode, supports + + + + + + + + + + The portlet-name element contains the canonical name of the = + portlet. Each portlet name is unique within the portlet = + application. + Used in: portlet, filter-mapping + + + + + + + + + + Portlet persistent preference store. + Used in: portlet + + + + + + + + + + + + Persistent preference values that may be used for customization = + and personalization by the portlet. + Used in: portlet-preferences + + + + + + + + + + + + + The class specified under preferences-validator implements + the PreferencesValidator interface to validate the = + preferences settings. + Used in: portlet-preferences + + + + + + + + read-only indicates that a setting cannot + be changed in any of the standard portlet modes = + ("view","edit" or "help"). + Per default all preferences are modifiable. + Valid values are: = + - true for read-only + - false for modifiable + Used in: preferences + + + + + + + + + + + Name of the resource bundle containing the language specific = + portlet informations in different languages (Filename without + the language specific part (e.g. _en) and the ending (.properties). + Used in: portlet-info + + + + + + + + + + The role-link element is a reference to a defined security role. = + The role-link element must contain the name of one of the = + security roles defined in the security-role elements. + Used in: security-role-ref + + + + + + + + + + The security-constraintType is used to associate + intended security constraints with one or more portlets. + Used in: portlet-app + + + + + + + + + + + + + The security-role-ref element contains the declaration of a = + security role reference in the code of the web application. The = + declaration consists of an optional description, the security = + role name used in the code, and an optional link to a security = + role. If the security role is not specified, the Deployer must = + choose an appropriate security role. + The value of the role name element must be the String used = + as the parameter to the = + EJBContext.isCallerInRole(String roleName) method + or the HttpServletRequest.isUserInRole(String role) method. + Used in: portlet + + + + + + + + + + + + + The public-render-parameters defines a render parameter that is allowed= to be public + and thus be shared with other portlets. + The identifier must be used for referencing this public render paramete= r in the portlet code. + Used in: portlet-app + + + + + + + + + + + + + + + + + Locale specific short version of the static title. + Used in: portlet-info + + + + + + + + + + Supports indicates the portlet modes a = + portlet supports for a specific content type. All portlets must = + support the view mode. = + Used in: portlet + + + + + + + + + + + + + Indicated the locales the portlet supports. + Used in: portlet + + + + + + + + + + Locale specific static title for this portlet. + Used in: portlet-info + + + + + + + + + + The transport-guaranteeType specifies that = + the communication between client and portlet should = + be NONE, INTEGRAL, or CONFIDENTIAL. = + NONE means that the portlet does not + require any transport guarantees. A value of = + INTEGRAL means that the portlet requires that the = + data sent between the client and portlet be sent in = + such a way that it can't be changed in transit. = + CONFIDENTIAL means that the portlet requires = + that the data be transmitted in a fashion that + prevents other entities from observing the contents = + of the transmission. = + In most cases, the presence of the INTEGRAL or + CONFIDENTIAL flag will indicate that the use = + of SSL is required. + Used in: user-data-constraint + + + + + + + + + + + + User attribute defines a user specific attribute that the + portlet application needs. The portlet within this application = + can access this attribute via the request parameter USER_INFO + map. + Used in: portlet-app + + + + + + + + + + + + The user-data-constraintType is used to indicate how + data communicated between the client and portlet should be + protected. + Used in: security-constraint + + + + + + + + + + + + The value element contains the value of a parameter. + Used in: init-param + + + + + + + + + + Portlet window state. Window state names are not case sensitive. + Used in: custom-window-state + + + + + + + + + + + The description element is used to provide text describing the = + parent element. The description element should include any = + information that the portlet application war file producer wants + to provide to the consumer of the portlet application war file = + (i.e., to the Deployer). Typically, the tools used by the = + portlet application war file consumer will display the = + description when processing the parent element that contains the = + description. It has an optional attribute xml:lang to indicate = + which language is used in the description according to = + RFC 1766 (http://www.ietf.org/rfc/rfc1766.txt). The default + value of this attribute is English(=E2=80=9Cen=E2=80=9D). + Used in: init-param, portlet, portlet-app, security-role + + + + + + + + + + + + The display-name type contains a short name that is intended + to be displayed by tools. It is used by display-name + elements. The display name need not be unique. + Example: + ... + Employee Self Service + + It has an optional attribute xml:lang to indicate = + which language is used in the description according to = + RFC 1766 (http://www.ietf.org/rfc/rfc1766.txt). The default + value of this attribute is English(=E2=80=9Cen=E2=80=9D). + + + + + + + + + + + + The elements that use this type designate the name of a + Java class or interface. + + + + + + + + The role-nameType designates the name of a security role. + + The name must conform to the lexical rules for an NMTOKEN. + + + + + + + + This is a special string datatype that is defined by JavaEE = + as a base type for defining collapsed strings. When = + schemas require trailing/leading space elimination as = + well as collapsing the existing whitespace, this base = + type may be used. + + + + + + + + + + The logical name of the filter is declare + by using filter-nameType. This name is used to map the + filter. Each filter name is unique within the portlet + application. + Used in: filter, filter-mapping + + + + + Added: modules/portlet/trunk/mc/src/test/resources/metadata/renderParameter= /portlet2.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/renderParameter/po= rtlet2.xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/renderParameter/po= rtlet2.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,20 @@ + + + + render parameter foo + blah + renderParameter1 + fooo + rP1 + + + + blub + x:foo + s:foo + + + Added: modules/portlet/trunk/mc/src/test/resources/metadata/security/portle= t1-fail1.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet1-= fail1.xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet1-= fail1.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,70 @@ + + + + = + + foo + org.jboss.portal.foo + + text/html + VIEW + + + = + + foobar + org.jboss.portal.foo + + text/html + VIEW + + + = + + test + Test + + foo + foobar + + + fooConstraint + FooConstraint + NONE + + + = + + + foo + + + NONE + + + = + \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/resources/metadata/security/portle= t1-fail2.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet1-= fail2.xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet1-= fail2.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,52 @@ + + + + = + + foo + org.jboss.portal.foo + + text/html + VIEW + + + = + + test + Test + + foo + foobar + + + fooConstraint + FooConstraint + NONE + + + = + \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/resources/metadata/security/portle= t1.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet1.= xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet1.= xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,76 @@ + + + + = + + foo + org.jboss.portal.foo + + text/html + VIEW + + + Foo + + + = + + foobar + org.jboss.portal.foo + + text/html + VIEW + + + FooBar + + + = + + test + Test + + foo + foobar + + + fooConstraint + FooConstraint + NONE + + + = + + + foo + + + INTEGRAL + + + + \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/resources/metadata/security/portle= t2-fail1.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet2-= fail1.xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet2-= fail1.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,70 @@ + + + + = + + foo + org.jboss.portal.foo + + text/html + VIEW + + + = + + foobar + org.jboss.portal.foo + + text/html + VIEW + + + = + + test + Test + + foo + foobar + + + fooConstraint + FooConstraint + NONE + + + = + + + foo + + + NONE + + + = + \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/resources/metadata/security/portle= t2-fail2.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet2-= fail2.xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet2-= fail2.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,51 @@ + + + + = + + foo + org.jboss.portal.foo + + text/html + VIEW + + + = + + test + Test + + foo + foobar + + + fooConstraint + FooConstraint + NONE + + + \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/resources/metadata/security/portle= t2.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet2.= xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet2.= xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,76 @@ + + + + = + + foo + org.jboss.portal.foo + + text/html + VIEW + + + Foo + + + = + + foobar + org.jboss.portal.foo + + text/html + VIEW + + + FooBar + + + = + + test + Test + + foo + foobar + + + fooConstraint + FooConstraint + NONE + + + = + + + foo + + + INTEGRAL + + + = + \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/resources/metadata/userAttribute/p= ortlet1.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/userAttribute/port= let1.xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/userAttribute/port= let1.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,17 @@ + + = + + blub + + = + + foobar + fuhbar + foo + + = + = + \ No newline at end of file Added: modules/portlet/trunk/mc/src/test/resources/metadata/userAttribute/p= ortlet2.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/mc/src/test/resources/metadata/userAttribute/port= let2.xml (rev 0) +++ modules/portlet/trunk/mc/src/test/resources/metadata/userAttribute/port= let2.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -0,0 +1,17 @@ + + = + + blub + + = + + foobar + fuhbar + foo + + = + = + \ No newline at end of file Modified: modules/portlet/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/pom.xml 2008-02-29 00:27:43 UTC (rev 10157) +++ modules/portlet/trunk/pom.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -42,6 +42,7 @@ bridge federation management + mc test = Modified: modules/portlet/trunk/test/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/pom.xml 2008-02-29 00:27:43 UTC (rev 10157) +++ modules/portlet/trunk/test/pom.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -30,6 +30,11 @@ ${project.version} + org.jboss.portal.portlet + portlet-mc + ${project.version} + + concurrent concurrent @@ -62,10 +67,6 @@ portal-test-generic - org.jboss - jbossxb - - jboss jboss-logging-jdk @@ -343,21 +344,17 @@ - + - - - - - - + + + + + + + + + Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/PortletApplicationContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationContextImpl.java 2008-02-29 00:27:43 UTC (rev 10157) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationContextImpl.java 2008-02-29 17:00:22 UTC (rev 10158) @@ -1,72 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test; - -import org.jboss.portal.portlet.container.PortletApplicationContext; -import org.jboss.portal.portlet.container.managed.ManagedPortletApplicatio= n; -import org.jboss.portal.web.WebApp; - -import javax.servlet.ServletContext; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class PortletApplicationContextImpl implements PortletApplicationCo= ntext -{ - - /** . */ - private final WebApp webApp; - - ManagedPortletApplication managedPortletApplication; - - public PortletApplicationContextImpl(WebApp webApp) - { - this.webApp =3D webApp; - } - - public ServletContext getServletContext() - { - return webApp.getServletContext(); - } - - public String getContextPath() - { - return webApp.getContextPath(); - } - - public ClassLoader getClassLoader() - { - return webApp.getClassLoader(); - } - - public void managedStart() - { - managedPortletApplication.managedStart(); - } - - public void managedStop() - { - managedPortletApplication.managedStop(); - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/PortletApplicationDeployer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployer.java 2008-02-29 00:27:43 UTC (rev 10157) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployer.java 2008-02-29 17:00:22 UTC (rev 10158) @@ -1,346 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test; - -import org.apache.log4j.Logger; -import org.jboss.portal.common.io.IOTools; -import org.jboss.portal.portlet.container.managed.PortletApplicationRegist= ry; -import org.jboss.portal.portlet.container.managed.ManagedPortletApplicatio= n; -import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= ntBroadcaster; -import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= ntListener; -import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= nt; -import org.jboss.portal.portlet.container.managed.ManagedObjectEvent; -import org.jboss.portal.portlet.container.managed.ManagedObject; -import org.jboss.portal.portlet.container.managed.ManagedObjectLifeCycleEv= ent; -import org.jboss.portal.portlet.container.managed.LifeCycleStatus; -import org.jboss.portal.portlet.container.PortletContainerInvoker; -import org.jboss.portal.portlet.container.PortletContainer; -import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; -import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConsta= nts.PORTLET_JSR_168_NS; -import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConsta= nts.PORTLET_JSR_286_NS; -import org.jboss.portal.portlet.impl.container.PortletApplicationLifeCycle; -import org.jboss.portal.portlet.impl.container.PortletContainerLifeCycle; -import org.jboss.portal.portlet.test.metadata.factory.PortletApplicationMo= delFactory; -import org.jboss.portal.portlet.test.metadata.impl.AnnotationPortletApplic= ation10MetaData; -import org.jboss.portal.portlet.test.metadata.impl.AnnotationPortletApplic= ation20MetaData; -import org.jboss.portal.portlet.test.metadata.impl.ValueTrimmingFilter; -import org.jboss.portal.web.ServletContainer; -import org.jboss.portal.web.WebApp; -import org.jboss.portal.web.WebAppEvent; -import org.jboss.portal.web.WebAppLifeCycleEvent; -import org.jboss.portal.web.WebAppListener; -import org.jboss.xb.binding.JBossXBException; -import org.jboss.xb.binding.Unmarshaller; -import org.jboss.xb.binding.UnmarshallerFactory; -import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver; -import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFa= ctory; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.util.HashMap; -import java.util.Map; -import java.util.Collection; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -public class PortletApplicationDeployer implements WebAppListener, Portlet= ApplicationRegistry -{ - - static - { - try - { - SingletonSchemaResolverFactory factory =3D SingletonSchemaResolve= rFactory.getInstance(); - DefaultSchemaResolver resolver =3D (DefaultSchemaResolver)factory= .getSchemaBindingResolver(); - - /** SchemaResolver */ - resolver.addSchemaLocation(PORTLET_JSR_168_NS, "portlet-app_1_0.x= sd"); - resolver.addSchemaLocation(PORTLET_JSR_286_NS, "portlet-app_2_0.x= sd"); - resolver.addClassBinding(PORTLET_JSR_286_NS, AnnotationPortletApp= lication20MetaData.class); - resolver.addClassBinding(PORTLET_JSR_168_NS, AnnotationPortletApp= lication10MetaData.class); - } - catch (Exception e) - { - throw new Error(e); - } - } - - /** . */ - private Logger log =3D Logger.getLogger(PortletApplicationDeployer.clas= s); - - /** . */ - private PortletApplicationRegistry registry; - - /** . */ - private ServletContainer servletContainer; - - /** . */ - private Map deploymentMap =3D new= HashMap(); - - /** . */ - private ClassLoader classLoader; - - /** . */ - private final Map applications =3D= new HashMap(); - - /** . */ - private PortletContainerInvoker portletContainerInvoker; - - /** . */ - private ManagedObjectRegistryEventBroadcaster broadcaster; - - public PortletApplicationRegistry getRegistry() - { - return registry; - } - - public void setRegistry(PortletApplicationRegistry registry) - { - this.registry =3D registry; - } - - public ServletContainer getServletContainer() - { - return servletContainer; - } - - public void setServletContainer(ServletContainer servletContainer) - { - this.servletContainer =3D servletContainer; - } - - public PortletContainerInvoker getPortletContainerInvoker() - { - return portletContainerInvoker; - } - - public void setPortletContainerInvoker(PortletContainerInvoker portletC= ontainerInvoker) - { - this.portletContainerInvoker =3D portletContainerInvoker; - } - - public void onEvent(WebAppEvent event) - { - if (event instanceof WebAppLifeCycleEvent) - { - WebAppLifeCycleEvent lifeCycleEvent =3D (WebAppLifeCycleEvent)eve= nt; - String cp =3D event.getWebApp().getContextPath(); - switch (lifeCycleEvent.getType()) - { - case WebAppLifeCycleEvent.ADDED: - log.debug("Going to install war file" + cp); - add(event.getWebApp()); - log.debug("Installed war file" + cp); - break; - case WebAppLifeCycleEvent.REMOVED: - try - { - log.debug("Going to uninstall war file" + cp); - remove(event.getWebApp()); - log.debug("Uninstalled war file" + cp); - } - catch (Throwable e) - { - log.error("Uninstalled war file " + cp + " with an error= ", e); - } - break; - } - } - } - - protected void add(WebApp webApp) - { - // - PortletApplication10MetaData metaData =3D buildPortletApplicationMet= aData(webApp); - if (metaData !=3D null) - { - ClassLoader oldCL =3D Thread.currentThread().getContextClassLoade= r(); - try - { - Thread.currentThread().setContextClassLoader(classLoader); - PortletApplicationDeployment deployment =3D new PortletApplica= tionDeployment(broadcaster, webApp, metaData); - deploymentMap.put(webApp.getContextPath(), deployment); - deployment.install(); - - // - PortletApplicationLifeCycle portletApplicationLifeCycle =3D de= ployment.getPortletApplicationLifeCycle(); - applications.put(portletApplicationLifeCycle.getId(), portletA= pplicationLifeCycle); - } - finally - { - Thread.currentThread().setContextClassLoader(oldCL); - } - } - } - - private void remove(WebApp webApp) - { - PortletApplicationDeployment deployment =3D deploymentMap.remove(web= App.getContextPath()); - if (deployment !=3D null) - { - PortletApplicationLifeCycle portletApplicationLifeCycle =3D deplo= yment.getPortletApplicationLifeCycle(); - applications.remove(portletApplicationLifeCycle.getId()); - - // - ClassLoader oldCL =3D Thread.currentThread().getContextClassLoade= r(); - try - { - Thread.currentThread().setContextClassLoader(classLoader); - deployment.uninstall(); - } - finally - { - Thread.currentThread().setContextClassLoader(oldCL); - } - } - } - - public void start() - { - broadcaster =3D new ManagedObjectRegistryEventBroadcaster(); - classLoader =3D Thread.currentThread().getContextClassLoader(); - - // - broadcaster.addListener(bridgeToInvoker); - servletContainer.addWebAppListener(this); - } - - public void stop() - { - // This should generate remove web app event and in cascade clear th= e registry - // as well as the portlet container invoker - servletContainer.removeWebAppListener(this); - - // - classLoader =3D null; - broadcaster =3D null; - } - - private PortletApplication10MetaData buildPortletApplicationMetaData(We= bApp webApp) - { - try - { - URL url =3D webApp.getServletContext().getResource("/WEB-INF/port= let.xml"); - if (url !=3D null) - { - InputStream in =3D null; - try - { - in =3D IOTools.safeBufferedWrapper(url.openStream()); - - // Validate = - Unmarshaller unmarshaller =3D UnmarshallerFactory.newInstan= ce().newUnmarshaller(); - unmarshaller.setNamespaceAware(true); - unmarshaller.setSchemaValidation(false); - unmarshaller.setValidation(false); - - // - PortletApplicationModelFactory factory =3D new PortletAppli= cationModelFactory(); - - // Unmarshal - PortletApplication10MetaData portletApplicationMD =3D (Port= letApplication10MetaData)unmarshaller.unmarshal(in, new ValueTrimmingFilter= (factory), null); - - // - return portletApplicationMD; - } - finally - { - IOTools.safeClose(in); - } - } - } - catch (IOException e) - { - log.error("Cannot read portlet.xml", e); - } - catch (JBossXBException e) - { - log.error("Cannot parse portlet.xml", e); - } - return null; - } - - public Collection getManagedPortle= tApplications() - { - return applications.values(); - } - - public ManagedPortletApplication getManagedPortletApplication(String id) - { - return applications.get(id); - } - - public void addListener(ManagedObjectRegistryEventListener listener) - { - broadcaster.addListener(listener); - } - - public void removeListener(ManagedObjectRegistryEventListener listener) - { - broadcaster.addListener(listener); - } - - /** - * Bridge managed object event to add/remove portlet container in portl= et container invoker. - */ - private final ManagedObjectRegistryEventListener bridgeToInvoker =3D ne= w ManagedObjectRegistryEventListener() - { - public void onEvent(ManagedObjectRegistryEvent event) - { - if (event instanceof ManagedObjectEvent) - { - ManagedObjectEvent managedObjectEvent =3D (ManagedObjectEvent)= event; - ManagedObject managedObject =3D managedObjectEvent.getManagedO= bject(); - - // - if (managedObject instanceof PortletContainerLifeCycle) - { - PortletContainerLifeCycle portletContainerLifeCycle =3D (Po= rtletContainerLifeCycle)managedObject; - PortletContainer portletContainer =3D portletContainerLifeC= ycle.getPortletContainer(); - - // - if (managedObjectEvent instanceof ManagedObjectLifeCycleEve= nt) - { - ManagedObjectLifeCycleEvent lifeCycleEvent =3D (ManagedO= bjectLifeCycleEvent)managedObjectEvent; - - // - LifeCycleStatus status =3D lifeCycleEvent.getStatus(); - - // - if (status =3D=3D LifeCycleStatus.STARTED) - { - portletContainerInvoker.addPortletContainer(portletCo= ntainer); - } - else - { - portletContainerInvoker.removePortletContainer(portle= tContainer); - } - } - } - } - } - }; -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/PortletApplicationDeployment.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployment.java 2008-02-29 00:27:43 UTC (rev 10157) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletApplicationDeployment.java 2008-02-29 17:00:22 UTC (rev 10158) @@ -1,168 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test; - -import org.apache.log4j.Logger; -import org.jboss.portal.portlet.impl.info.ContainerInfoBuilder; -import org.jboss.portal.portlet.impl.info.ContainerInfoBuilderContext; -import org.jboss.portal.portlet.impl.info.ContainerPortletInfo; -import org.jboss.portal.portlet.impl.info.ContainerFilterInfo; -import org.jboss.portal.portlet.impl.jsr168.ContainerInfoBuilderContextImp= l; -import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl; -import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl; -import org.jboss.portal.portlet.impl.jsr168.PortletFilterImpl; -import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; -import org.jboss.portal.portlet.impl.container.PortletApplicationLifeCycle; -import org.jboss.portal.portlet.impl.container.PortletFilterLifeCycle; -import org.jboss.portal.portlet.impl.container.PortletContainerLifeCycle; -import org.jboss.portal.portlet.container.object.PortletApplicationObject; -import org.jboss.portal.portlet.container.object.PortletContainerObject; -import org.jboss.portal.portlet.container.object.PortletFilterObject; -import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEve= ntListener; -import org.jboss.portal.web.WebApp; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -public class PortletApplicationDeployment -{ - - /** . */ - private final Logger log; - - /** . */ - private final WebApp webApp; - - /** . */ - private final PortletApplication10MetaData metaData; - - /** . */ - private final ManagedObjectRegistryEventListener listener; - - /** . */ - private PortletApplicationLifeCycle portletApplicationLifeCycle; - - public PortletApplicationDeployment( - ManagedObjectRegistryEventListener listener, - WebApp webApp, - PortletApplication10MetaData metaData) - { - this.listener =3D listener; - this.webApp =3D webApp; - this.metaData =3D metaData; - this.log =3D Logger.getLogger(PortletApplicationDeployment.class + "= ." + webApp.getContextPath().replace('.', '_')); - } - - public PortletApplicationLifeCycle getPortletApplicationLifeCycle() - { - return portletApplicationLifeCycle; - } - - void install() - { - - log.debug("Starting installation"); - - // - ContainerInfoBuilderContext builderContext =3D new ContainerInfoBuil= derContextImpl(metaData, webApp); - ContainerInfoBuilder builder =3D new ContainerInfoBuilder(webApp.get= ContextPath(), metaData, builderContext); - builder.build(); - - // - PortletApplicationObject portletApplicationObject =3D new PortletApp= licationImpl(builder.getApplication()); - PortletApplicationContextImpl portletApplicationContext =3D new Port= letApplicationContextImpl(webApp); - - - // - portletApplicationLifeCycle =3D new PortletApplicationLifeCycle( - listener, - portletApplicationContext, - portletApplicationObject); - - // Needed for the managed callbacks - portletApplicationContext.managedPortletApplication =3D portletAppli= cationLifeCycle; - - // - for (ContainerFilterInfo filterInfo : builder.getApplication().getFi= lters().values()) - { - PortletFilterObject portletFilterObject =3D new PortletFilterImpl= (filterInfo); - PortletFilterContextImpl portletFilterContext =3D new PortletFilt= erContextImpl(); - - // - PortletFilterLifeCycle portletFilterLifeCycle =3D portletApplicat= ionLifeCycle.addPortletFilter(portletFilterContext, portletFilterObject); - - // Needed for the managed callbacks - portletFilterContext.managedPortletFilter =3D portletFilterLifeCy= cle; - } - - // - for (ContainerPortletInfo containerInfo : builder.getPortlets()) - { - PortletContainerObject portletContainerObject =3D new PortletCont= ainerImpl(containerInfo); - PortletContainerContextImpl portletContainerContext =3D new Portl= etContainerContextImpl(); - = - // - PortletContainerLifeCycle portletContainerLifeCycle =3D portletAp= plicationLifeCycle.addPortletContainer(portletContainerContext, portletCont= ainerObject); - - // Needed for the managed callbacks - portletContainerContext.managedPortletContainer =3D portletContai= nerLifeCycle; - - // Now create deps - for (String filterRef : containerInfo.getFilterRefs()) - { - PortletFilterLifeCycle portletFilterLifeCycle =3D portletAppli= cationLifeCycle.getManagedPortletFilter(filterRef); - - // - if (portletFilterLifeCycle !=3D null) - { - portletApplicationLifeCycle.addDependency(portletFilterLife= Cycle, portletContainerLifeCycle); - } - else - { - // todo - } - } - } - - // - portletApplicationLifeCycle.create(); - - // - portletApplicationLifeCycle.managedStart(); - - // - - } - - void uninstall() - { - log.debug("Uninstalling"); - - // - portletApplicationLifeCycle.managedStop(); - - // - log.debug("Uninstalled"); - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/PortletContainerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletContainerContextImpl.java 2008-02-29 00:27:43 UTC (rev 10157) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletContainerContextImpl.java 2008-02-29 17:00:22 UTC (rev 10158) @@ -1,47 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test; - -import org.jboss.portal.portlet.container.PortletContainerContext; -import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class PortletContainerContextImpl implements PortletContainerContext -{ - - /** . */ - ManagedPortletContainer managedPortletContainer; - - public void managedStart() - { - managedPortletContainer.managedStart(); - } - - public void managedStop() - { - managedPortletContainer.managedStop(); - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/PortletFilterContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletFilterContextImpl.java 2008-02-29 00:27:43 UTC (rev 10157) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortletFilterContextImpl.java 2008-02-29 17:00:22 UTC (rev 10158) @@ -1,46 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test; - -import org.jboss.portal.portlet.container.PortletFilterContext; -import org.jboss.portal.portlet.container.managed.ManagedPortletFilter; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class PortletFilterContextImpl implements PortletFilterContext -{ - - ManagedPortletFilter managedPortletFilter; - - public void managedStart() - { - managedPortletFilter.managedStart(); - } - - public void managedStop() - { - managedPortletFilter.managedStop(); - } -} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/TestPortletApplicationDeployer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= TestPortletApplicationDeployer.java 2008-02-29 00:27:43 UTC (rev 10157) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= TestPortletApplicationDeployer.java 2008-02-29 17:00:22 UTC (rev 10158) @@ -24,6 +24,7 @@ package org.jboss.portal.portlet.test; = import org.jboss.portal.web.WebApp; +import org.jboss.portal.portlet.mc.PortletApplicationDeployer; = /** * @author Chris Laprun Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-29 00:27:43 UTC (= rev 10157) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-29 17:00:22 UTC (= rev 10158) @@ -134,6 +134,9 @@ + + + @@ -404,6 +407,7 @@ = + = @@ -440,6 +444,7 @@ = + = @@ -707,6 +712,7 @@ + = @@ -749,6 +755,7 @@ = + = @@ -809,6 +816,7 @@ = + = Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/W= EB-INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-beans.xml 2008-02-29 00:27:43 UTC (rev 10157) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-beans.xml 2008-02-29 17:00:22 UTC (rev 10158) @@ -23,7 +23,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~--> = - + Modified: modules/portlet/trunk/test/src/test/resources/test/local-jboss-un= it.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/test/local-jboss-unit.xml= 2008-02-29 00:27:43 UTC (rev 10157) +++ modules/portlet/trunk/test/src/test/resources/test/local-jboss-unit.xml= 2008-02-29 17:00:22 UTC (rev 10158) @@ -21,69 +21,6 @@ - - - annotation - factory - - - - - - annotation - factory - - - - - - annotation - factory - - - - - - annotation - factory - - - - - - annotation - factory - - - - - - annotation - factory - - - - - - annotation - factory - - - - - - annotation - factory - - - - - - annotation - factory - - - --===============0599730529872918953==-- From portal-commits at lists.jboss.org Fri Feb 29 12:35:49 2008 Content-Type: multipart/mixed; boundary="===============1728931323056533096==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10159 - in modules/portlet/trunk: test/src/main/java/org/jboss/portal/portlet/test and 4 other directories. Date: Fri, 29 Feb 2008 12:35:48 -0500 Message-ID: --===============1728931323056533096== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-29 12:35:48 -0500 (Fri, 29 Feb 2008) New Revision: 10159 Added: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/impl/AbstractPortletControllerContext.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/impl/PortletURLRenderer.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/impl/TestPortletInvocationContext.java modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/impl/URLParameterConstants.java Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/U= RLParameterConstants.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/AbstractPortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletURLRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestPortalContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/TestPortletInvocationContext.java Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/P= ortalServlet.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/AbstractRendererContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PageRenderer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/PortletControllerContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/c= ontroller/RendererContextImpl.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ControllerFilter.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PagePortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/PortalRenderResponse.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/taglib/PortletURLTag.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/t= ck/TCKPortletControllerContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/t= ck/TCKRendererContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/t= ck/TCKServlet.java Log: moved a couple of class to the controller module that will make them easier= to reuse Copied: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/por= tlet/controller/impl/AbstractPortletControllerContext.java (from rev 10156,= modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/con= troller/AbstractPortletControllerContext.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/AbstractPortletControllerContext.java = (rev 0) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/AbstractPortletControllerContext.java 2008-02-29 17:35:48 = UTC (rev 10159) @@ -0,0 +1,192 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.controller.impl; + +import org.jboss.portal.common.util.MarkupInfo; +import org.jboss.portal.common.util.MediaType; +import org.jboss.portal.common.io.Serialization; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.impl.spi.AbstractClientContext; +import org.jboss.portal.portlet.impl.spi.AbstractRequestContext; +import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; +import org.jboss.portal.portlet.impl.spi.AbstractServerContext; +import org.jboss.portal.portlet.impl.spi.AbstractUserContext; +import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; +import org.jboss.portal.portlet.impl.spi.AbstractInstanceContext; +import org.jboss.portal.portlet.impl.spi.AbstractPortalContext; +import org.jboss.portal.portlet.info.PortletInfo; +import org.jboss.portal.portlet.invocation.ActionInvocation; +import org.jboss.portal.portlet.invocation.EventInvocation; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.portlet.invocation.ResourceInvocation; +import org.jboss.portal.portlet.invocation.RenderInvocation; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.spi.PortletInvocationContext; +import org.jboss.portal.portlet.spi.PortalContext; +import org.jboss.portal.web.IllegalRequestException; +import org.apache.log4j.Logger; + +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; +import java.util.Collections; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public abstract class AbstractPortletControllerContext implements PortletC= ontrollerContext +{ + + /** . */ + private static Logger log =3D Logger.getLogger(AbstractPortletControlle= rContext.class); + + /** . */ + public static final PortalContext PORTAL_CONTEXT =3D new AbstractPortal= Context(Collections.singletonMap("javax.portlet.markup.head.element.support= ", "true")); + + /** . */ + public static final MarkupInfo MARKUP_INFO =3D new MarkupInfo(MediaType= .HTML, "UTF8"); + + /** . */ + public static final int NAV_SCOPE =3D 0; + + /** . */ + public static final int SESSION_SCOPE =3D 1; + + /** . */ + private final HttpServletRequest req; + + /** . */ + private final HttpServletResponse resp; + + public AbstractPortletControllerContext(HttpServletRequest req, HttpSer= vletResponse resp + ) + throws IllegalRequestException, IOException + { + this.req =3D req; + this.resp =3D resp; + } + + public HttpServletRequest getClientRequest() + { + return req; + } + + public HttpServletResponse getClientResponse() + { + return resp; + } + + public PortletInfo getPortletInfo(String windowId) + { + try + { + return getPortlet(windowId).getInfo(); + } + catch (PortletInvokerException e) + { + log.error("Could not access portlet invoker for locating window "= + windowId, e); + + // + return null; + } + } + + protected abstract Portlet getPortlet(String windowId) throws PortletIn= vokerException; + + protected abstract PortletInvocationResponse invoke(PortletInvocation i= nvocation) throws PortletInvokerException; + + protected abstract Serialization getPageNavigati= onalStateSerialization(); + + public PortletInvocationResponse invoke(ActionInvocation actionInvocati= on) throws PortletInvokerException + { + + TestPortletInvocationContext context =3D (TestPortletInvocationConte= xt)actionInvocation.getContext(); + String windowId =3D context.getWindowId(); + + Portlet portlet =3D getPortlet(windowId); + + actionInvocation.setClientContext(new AbstractClientContext(req)); + actionInvocation.setServerContext(new AbstractServerContext(req, res= p)); + actionInvocation.setInstanceContext(new AbstractInstanceContext(port= let.getContext().getId())); + actionInvocation.setUserContext(new AbstractUserContext(req)); + actionInvocation.setWindowContext(new AbstractWindowContext(windowId= )); + actionInvocation.setPortalContext(PORTAL_CONTEXT); + actionInvocation.setSecurityContext(new AbstractSecurityContext(req)= ); + actionInvocation.setRequestContext(new AbstractRequestContext(req)); + actionInvocation.setTarget(portlet.getContext()); + + return invoke((PortletInvocation)actionInvocation); + } + + public PortletInvocationResponse invoke(List requestCookies, Ev= entInvocation eventInvocation) throws PortletInvokerException + { + TestPortletInvocationContext context =3D (TestPortletInvocationConte= xt)eventInvocation.getContext(); + String windowId =3D context.getWindowId(); + + Portlet portlet =3D getPortlet(windowId); + + eventInvocation.setClientContext(new AbstractClientContext(req, requ= estCookies)); + eventInvocation.setServerContext(new AbstractServerContext(req, resp= )); + eventInvocation.setInstanceContext(new AbstractInstanceContext(portl= et.getContext().getId())); + eventInvocation.setUserContext(new AbstractUserContext(req)); + eventInvocation.setWindowContext(new AbstractWindowContext(windowId)= ); + eventInvocation.setPortalContext(PORTAL_CONTEXT); + eventInvocation.setSecurityContext(new AbstractSecurityContext(req)); + eventInvocation.setTarget(portlet.getContext()); + + return invoke(eventInvocation); + } + + public PortletInvocationResponse invoke(ResourceInvocation resourceInvo= cation) throws PortletInvokerException + { + TestPortletInvocationContext context =3D (TestPortletInvocationConte= xt)resourceInvocation.getContext(); + String windowId =3D context.getWindowId(); + + Portlet portlet =3D getPortlet(windowId); + + resourceInvocation.setClientContext(new AbstractClientContext(req)); + resourceInvocation.setServerContext(new AbstractServerContext(req, r= esp)); + resourceInvocation.setInstanceContext(new AbstractInstanceContext(po= rtlet.getContext().getId())); + resourceInvocation.setUserContext(new AbstractUserContext(req)); + resourceInvocation.setWindowContext(new AbstractWindowContext(window= Id)); + resourceInvocation.setPortalContext(PORTAL_CONTEXT); + resourceInvocation.setSecurityContext(new AbstractSecurityContext(re= q)); + resourceInvocation.setRequestContext(new AbstractRequestContext(req)= ); + resourceInvocation.setTarget(portlet.getContext()); + + // + return invoke((PortletInvocation)resourceInvocation); + } + + public PortletInvocationContext createPortletInvocationContext(String w= indowId, PageNavigationalState pageNavigationalState) + { + return new TestPortletInvocationContext(getPageNavigationalStateSeri= alization(), req, resp, windowId, pageNavigationalState, MARKUP_INFO); + } +} \ No newline at end of file Copied: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/por= tlet/controller/impl/PortletURLRenderer.java (from rev 10146, modules/portl= et/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/Portle= tURLRenderer.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/PortletURLRenderer.java (rev 0) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/PortletURLRenderer.java 2008-02-29 17:35:48 UTC (rev 10159) @@ -0,0 +1,152 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.controller.impl; + +import org.jboss.portal.common.io.IOTools; +import org.jboss.portal.common.io.SerializationFilter; +import org.jboss.portal.common.io.Serialization; +import org.jboss.portal.common.text.CharBuffer; +import org.jboss.portal.common.text.FastURLEncoder; +import org.jboss.portal.common.util.Base64; +import org.jboss.portal.portlet.ContainerURL; +import org.jboss.portal.portlet.URLFormat; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.impl.request.ControllerRequestP= arameterNames; +import org.jboss.portal.portlet.controller.impl.request.ControllerRequestP= arameterMapFactory; +import static org.jboss.portal.portlet.controller.impl.URLParameterConstan= ts.*; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Map; +import java.util.Collections; + +/** + * A class that is able to create portlet URL = + * + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class PortletURLRenderer +{ + + /** . */ + final Serialization serialization; + + /** . */ + final HttpServletRequest clientReq; + + /** . */ + final HttpServletResponse clientResp; + + /** . */ + final PageNavigationalState pageNS; + + public PortletURLRenderer( + PageNavigationalState pageNS, + HttpServletRequest clientReq, + HttpServletResponse clientResp, + Serialization serialization) + { + this.pageNS =3D pageNS; + this.clientReq =3D clientReq; + this.clientResp =3D clientResp; + this.serialization =3D serialization; + } + + private String renderURL(Map parameters, URLFormat form= at) + { + CharBuffer buffer =3D new CharBuffer(); + buffer.append(clientReq.getScheme()); + buffer.append("://"); + buffer.append(clientReq.getServerName()); + buffer.append(':'); + buffer.append(Integer.toString(clientReq.getServerPort())); + buffer.append(clientReq.getContextPath()); + buffer.append(clientReq.getServletPath()); + + // + if (clientReq.getPathInfo() !=3D null) + { + buffer.append(clientReq.getPathInfo()); + } + + // + String parameterSeparator =3D format.getWantEscapeXML() =3D=3D Boole= an.TRUE ? "&" : "&"; + + // + boolean first =3D true; + for (Map.Entry entry : parameters.entrySet()) + { + String name =3D entry.getKey(); + String value =3D entry.getValue(); + buffer.append(first ? "?" : parameterSeparator); + buffer.append(name, FastURLEncoder.getUTF8Instance()); + buffer.append('=3D'); + buffer.append(value, FastURLEncoder.getUTF8Instance()); + first =3D false; + } + + // + String url =3D buffer.asString(); + return clientResp.encodeURL(url); + } + + public String renderURL(URLFormat format) + { + String pageNavigationalState =3D null; + if (pageNS !=3D null) + { + byte[] bytes =3D IOTools.serialize(serialization, SerializationFi= lter.COMPRESSOR, pageNS); + pageNavigationalState =3D Base64.encodeBytes(bytes, true); + } + + // + Map parameters; + if (pageNavigationalState !=3D null) + { + parameters =3D Collections.singletonMap(ControllerRequestParamete= rNames.PAGE_NAVIGATIONAL_STATE, pageNavigationalState); + } + else + { + parameters =3D Collections.emptyMap(); + } + + // + return renderURL(parameters, format); + } + + public String renderURL(String windowId, ContainerURL containerURL, URL= Format format) + { + ControllerRequestParameterMapFactory factory =3D new ControllerReque= stParameterMapFactory(serialization); + + // + Map parameters =3D factory.blah(pageNS, windowId, co= ntainerURL); + + // + parameters.put(TYPE, PORTLET_TYPE); + + // + return renderURL(parameters, format); + } +} Copied: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/por= tlet/controller/impl/TestPortletInvocationContext.java (from rev 10146, mod= ules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/control= ler/TestPortletInvocationContext.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/TestPortletInvocationContext.java = (rev 0) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/TestPortletInvocationContext.java 2008-02-29 17:35:48 UTC = (rev 10159) @@ -0,0 +1,101 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.controller.impl; + +import org.jboss.portal.common.invocation.resolver.MapAttributeResolver; +import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResol= ver; +import org.jboss.portal.common.invocation.resolver.RequestAttributeResolve= r; +import org.jboss.portal.common.util.MarkupInfo; +import org.jboss.portal.common.io.Serialization; +import org.jboss.portal.portlet.ContainerURL; +import org.jboss.portal.portlet.URLFormat; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.impl.PortletURLRenderer; +import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext; +import org.jboss.portal.portlet.invocation.PortletInvocation; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class TestPortletInvocationContext extends AbstractPortletInvocatio= nContext +{ + + /** . */ + private final PortletURLRenderer urlRenderer; + + /** . */ + private final String windowId; + + /** . */ + private final HttpServletRequest clientRequest; + + /** . */ + private final HttpServletResponse clientResponse; + + public TestPortletInvocationContext( + Serialization serialization, + HttpServletRequest clientRequest, + HttpServletResponse clientResponse, + String windowId, + PageNavigationalState pageNavigationalState, + MarkupInfo markupInfo) + { + super(markupInfo); + + // + this.clientRequest =3D clientRequest; + this.clientResponse =3D clientResponse; + this.windowId =3D windowId; + this.urlRenderer =3D new PortletURLRenderer(pageNavigationalState, c= lientRequest, clientResponse, serialization); + + // + addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttribut= eResolver(clientRequest)); + addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeReso= lver()); + addResolver(PortletInvocation.REQUEST_SCOPE, new RequestAttributeRes= olver(clientRequest)); + } + + public String getWindowId() + { + return windowId; + } + + public HttpServletRequest getClientRequest() throws IllegalStateExcepti= on + { + return clientRequest; + } + + public HttpServletResponse getClientResponse() throws IllegalStateExcep= tion + { + return clientResponse; + } + + public String renderURL(ContainerURL containerURL, URLFormat format) + { + return urlRenderer.renderURL(windowId, containerURL, format); + } +} Copied: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/por= tlet/controller/impl/URLParameterConstants.java (from rev 10138, modules/po= rtlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/URLParameterCo= nstants.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/URLParameterConstants.java (rev 0) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/URLParameterConstants.java 2008-02-29 17:35:48 UTC (rev 10= 159) @@ -0,0 +1,47 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.controller.impl; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public final class URLParameterConstants +{ + + private URLParameterConstants() + { + } + + /** + * The type of request. The goal is to allow other types of invocation = to be used by the controller context. + * The controller context itself only works on the portlet type. + */ + public static final String TYPE =3D "type"; + + /** + * The portlet type. + */ + public static final String PORTLET_TYPE =3D "portlet"; + +} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/PortalServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortalServlet.java 2008-02-29 17:00:22 UTC (rev 10158) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= PortalServlet.java 2008-02-29 17:35:48 UTC (rev 10159) @@ -24,6 +24,7 @@ = import org.jboss.portal.portlet.controller.PortletController; import org.jboss.portal.portlet.controller.impl.request.ControllerRequestF= actory; +import org.jboss.portal.portlet.controller.impl.URLParameterConstants; import org.jboss.portal.portlet.controller.request.ControllerRequest; import org.jboss.portal.portlet.controller.response.ControllerResponse; import org.jboss.portal.portlet.invocation.response.ResponseProperties; Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/URLParameterConstants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= URLParameterConstants.java 2008-02-29 17:00:22 UTC (rev 10158) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= URLParameterConstants.java 2008-02-29 17:35:48 UTC (rev 10159) @@ -1,47 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ -package org.jboss.portal.portlet.test; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public final class URLParameterConstants -{ - - private URLParameterConstants() - { - } - - /** - * The type of request. The goal is to allow other types of invocation = to be used by the controller context. - * The controller context itself only works on the portlet type. - */ - public static final String TYPE =3D "type"; - - /** - * The portlet type. - */ - public static final String PORTLET_TYPE =3D "portlet"; - -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/AbstractPortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-29 17:00:22 UTC (r= ev 10158) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractPortletControllerContext.java 2008-02-29 17:35:48 UTC (r= ev 10159) @@ -1,188 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ - -package org.jboss.portal.portlet.test.controller; - -import org.jboss.portal.common.util.MarkupInfo; -import org.jboss.portal.common.util.MediaType; -import org.jboss.portal.common.io.Serialization; -import org.jboss.portal.portlet.Portlet; -import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.controller.PortletControllerContext; -import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.controller.state.PageNavigationalStateSeri= alization; -import org.jboss.portal.portlet.impl.spi.AbstractClientContext; -import org.jboss.portal.portlet.impl.spi.AbstractRequestContext; -import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; -import org.jboss.portal.portlet.impl.spi.AbstractServerContext; -import org.jboss.portal.portlet.impl.spi.AbstractUserContext; -import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; -import org.jboss.portal.portlet.impl.spi.AbstractInstanceContext; -import org.jboss.portal.portlet.info.PortletInfo; -import org.jboss.portal.portlet.invocation.ActionInvocation; -import org.jboss.portal.portlet.invocation.EventInvocation; -import org.jboss.portal.portlet.invocation.PortletInvocation; -import org.jboss.portal.portlet.invocation.ResourceInvocation; -import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.spi.PortletInvocationContext; -import org.jboss.portal.web.IllegalRequestException; -import org.apache.log4j.Logger; - -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -public abstract class AbstractPortletControllerContext implements PortletC= ontrollerContext -{ - - /** . */ - private static Logger log =3D Logger.getLogger(AbstractPortletControlle= rContext.class); - - /** . */ - public static final MarkupInfo MARKUP_INFO =3D new MarkupInfo(MediaType= .HTML, "UTF8"); - - /** . */ - public static final int NAV_SCOPE =3D 0; - - /** . */ - public static final int SESSION_SCOPE =3D 1; - - /** . */ - private final HttpServletRequest req; - - /** . */ - private final HttpServletResponse resp; - - public AbstractPortletControllerContext(HttpServletRequest req, HttpSer= vletResponse resp - ) - throws IllegalRequestException, IOException - { - this.req =3D req; - this.resp =3D resp; - } - - public HttpServletRequest getClientRequest() - { - return req; - } - - public HttpServletResponse getClientResponse() - { - return resp; - } - - public PortletInfo getPortletInfo(String windowId) - { - try - { - return getPortlet(windowId).getInfo(); - } - catch (PortletInvokerException e) - { - log.error("Could not access portlet invoker for locating window "= + windowId, e); - - // - return null; - } - } - - protected abstract Portlet getPortlet(String windowId) throws PortletIn= vokerException; - - protected abstract PortletInvocationResponse invoke(PortletInvocation i= nvocation) throws PortletInvokerException; - - protected abstract Serialization getPageNavigati= onalStateSerialization(); - - public PortletInvocationResponse invoke(ActionInvocation actionInvocati= on) throws PortletInvokerException - { - - TestPortletInvocationContext context =3D (TestPortletInvocationConte= xt)actionInvocation.getContext(); - String windowId =3D context.getWindowId(); - - Portlet portlet =3D getPortlet(windowId); - - actionInvocation.setClientContext(new AbstractClientContext(req)); - actionInvocation.setServerContext(new AbstractServerContext(req, res= p)); - actionInvocation.setInstanceContext(new AbstractInstanceContext(port= let.getContext().getId())); - actionInvocation.setUserContext(new AbstractUserContext(req)); - actionInvocation.setWindowContext(new AbstractWindowContext(windowId= )); - actionInvocation.setPortalContext(new TestPortalContext()); - actionInvocation.setSecurityContext(new AbstractSecurityContext(req)= ); - actionInvocation.setRequestContext(new AbstractRequestContext(req)); - actionInvocation.setTarget(portlet.getContext()); - - return invoke((PortletInvocation)actionInvocation); - } - - public PortletInvocationResponse invoke(List requestCookies, Ev= entInvocation eventInvocation) throws PortletInvokerException - { - TestPortletInvocationContext context =3D (TestPortletInvocationConte= xt)eventInvocation.getContext(); - String windowId =3D context.getWindowId(); - - Portlet portlet =3D getPortlet(windowId); - -// TestInstanceContext instanceContext =3D new TestInstanceContext(re= q, portlet.getContext(), true); - - eventInvocation.setClientContext(new AbstractClientContext(req, requ= estCookies)); - eventInvocation.setServerContext(new AbstractServerContext(req, resp= )); - eventInvocation.setInstanceContext(new AbstractInstanceContext(portl= et.getContext().getId())); - eventInvocation.setUserContext(new AbstractUserContext(req)); - eventInvocation.setWindowContext(new AbstractWindowContext(windowId)= ); - eventInvocation.setPortalContext(new TestPortalContext()); - eventInvocation.setSecurityContext(new AbstractSecurityContext(req)); - eventInvocation.setTarget(portlet.getContext()); - - return invoke(eventInvocation); - } - - public PortletInvocationResponse invoke(ResourceInvocation resourceInvo= cation) throws PortletInvokerException - { - TestPortletInvocationContext context =3D (TestPortletInvocationConte= xt)resourceInvocation.getContext(); - String windowId =3D context.getWindowId(); - - Portlet portlet =3D getPortlet(windowId); - - resourceInvocation.setClientContext(new AbstractClientContext(req)); - resourceInvocation.setServerContext(new AbstractServerContext(req, r= esp)); - resourceInvocation.setInstanceContext(new AbstractInstanceContext(po= rtlet.getContext().getId())); - resourceInvocation.setUserContext(new AbstractUserContext(req)); - resourceInvocation.setWindowContext(new AbstractWindowContext(window= Id)); - resourceInvocation.setPortalContext(new TestPortalContext()); - resourceInvocation.setSecurityContext(new AbstractSecurityContext(re= q)); - resourceInvocation.setRequestContext(new AbstractRequestContext(req)= ); - resourceInvocation.setTarget(portlet.getContext()); - - // - return invoke((PortletInvocation)resourceInvocation); - } - - public PortletInvocationContext createPortletInvocationContext(String w= indowId, PageNavigationalState pageNavigationalState) - { - return new TestPortletInvocationContext(getPageNavigationalStateSeri= alization(), req, resp, windowId, pageNavigationalState, MARKUP_INFO); - } -} \ No newline at end of file Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/AbstractRendererContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractRendererContext.java 2008-02-29 17:00:22 UTC (rev 10158) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/AbstractRendererContext.java 2008-02-29 17:35:48 UTC (rev 10159) @@ -23,9 +23,11 @@ package org.jboss.portal.portlet.test.controller; = import org.jboss.portal.portlet.controller.PortletControllerContext; +import org.jboss.portal.portlet.controller.impl.AbstractPortletControllerC= ontext; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.invocation.RenderInvocation; import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.PortletInvoker; = import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -40,9 +42,13 @@ /** . */ private final AbstractPortletControllerContext portletControllerContext; = - public AbstractRendererContext(AbstractPortletControllerContext portlet= ControllerContext) + /** . */ + private final PortletInvoker portletInvoker; + + protected AbstractRendererContext(AbstractPortletControllerContext port= letControllerContext, PortletInvoker portletInvoker) { this.portletControllerContext =3D portletControllerContext; + this.portletInvoker =3D portletInvoker; } = public HttpServletRequest getClientRequest() @@ -62,6 +68,6 @@ = public PortletInvocationResponse render(RenderInvocation render) throws= PortletInvokerException { - return portletControllerContext.invoke(render); + return portletInvoker.invoke(render); } } Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PageRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PageRenderer.java 2008-02-29 17:00:22 UTC (rev 10158) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PageRenderer.java 2008-02-29 17:35:48 UTC (rev 10159) @@ -45,6 +45,7 @@ import org.jboss.portal.portlet.invocation.response.ContentResponse; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.impl.AbstractPortletControllerC= ontext; import org.w3c.dom.Element; = import javax.servlet.http.HttpServletRequest; @@ -230,7 +231,7 @@ render.setInstanceContext(new AbstractInstanceContext(portlet.getCon= text().getId())); render.setUserContext(new AbstractUserContext(req)); render.setWindowContext(new AbstractWindowContext(portlet.getContext= ().getId())); - render.setPortalContext(new TestPortalContext()); + render.setPortalContext(AbstractPortletControllerContext.PORTAL_CONT= EXT); render.setSecurityContext(new AbstractSecurityContext(req)); render.setTarget(portlet.getContext()); render.setMode(mode); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/PortletControllerContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContextImpl.java 2008-02-29 17:00:22 UTC (rev 1= 0158) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletControllerContextImpl.java 2008-02-29 17:35:48 UTC (rev 1= 0159) @@ -30,6 +30,7 @@ import org.jboss.portal.portlet.controller.event.EventControllerContext; import org.jboss.portal.portlet.controller.impl.event.EventControllerConte= xtImpl; import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; +import org.jboss.portal.portlet.controller.impl.AbstractPortletControllerC= ontext; import org.jboss.portal.portlet.controller.state.StateControllerContext; import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.PageNavigationalStateSeri= alization; @@ -52,7 +53,7 @@ { = /** . */ - private final PortletInvoker invoker; + private final PortletInvoker portletInvoker; = /** . */ private final EventControllerContext eventControllerContext; @@ -69,15 +70,20 @@ super(req, resp); = // - this.invoker =3D (PortletInvoker)servletContext.getAttribute("Consum= erPortletInvoker"); - this.eventControllerContext =3D new EventControllerContextImpl(invok= er); + this.portletInvoker =3D (PortletInvoker)servletContext.getAttribute(= "ConsumerPortletInvoker"); + this.eventControllerContext =3D new EventControllerContextImpl(portl= etInvoker); this.stateControllerContext =3D new StateControllerContextImpl(this); this.serialization =3D new PageNavigationalStateSerialization(stateC= ontrollerContext); } = + public PortletInvoker getPortletInvoker() + { + return portletInvoker; + } + protected Portlet getPortlet(String windowId) throws PortletInvokerExce= ption { - return invoker.getPortlet(PortletContext.createPortletContext(window= Id)); + return portletInvoker.getPortlet(PortletContext.createPortletContext= (windowId)); } = public StateControllerContext getStateControllerContext() @@ -87,7 +93,7 @@ = public PortletInvocationResponse invoke(PortletInvocation invocation) t= hrows PortletInvokerException { - return invoker.invoke(invocation); + return portletInvoker.invoke(invocation); } = public EventControllerContext getEventControllerContext() @@ -97,7 +103,7 @@ = public Collection getPortlets() throws PortletInvokerException { - return invoker.getPortlets(); + return portletInvoker.getPortlets(); } = public Serialization getPageNavigationalStateSer= ialization() Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/PortletURLRenderer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-29 17:00:22 UTC (rev 10158) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/PortletURLRenderer.java 2008-02-29 17:35:48 UTC (rev 10159) @@ -1,150 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ - -package org.jboss.portal.portlet.test.controller; - -import org.jboss.portal.common.io.IOTools; -import org.jboss.portal.common.io.SerializationFilter; -import org.jboss.portal.common.io.Serialization; -import org.jboss.portal.common.text.CharBuffer; -import org.jboss.portal.common.text.FastURLEncoder; -import org.jboss.portal.common.util.Base64; -import org.jboss.portal.portlet.ContainerURL; -import org.jboss.portal.portlet.URLFormat; -import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.controller.impl.request.ControllerRequestP= arameterNames; -import org.jboss.portal.portlet.controller.impl.request.ControllerRequestP= arameterMapFactory; -import static org.jboss.portal.portlet.test.URLParameterConstants.*; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.Map; -import java.util.Collections; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -public class PortletURLRenderer -{ - - /** . */ - final Serialization serialization; - - /** . */ - final HttpServletRequest clientReq; - - /** . */ - final HttpServletResponse clientResp; - - /** . */ - final PageNavigationalState pageNS; - - public PortletURLRenderer( - PageNavigationalState pageNS, - HttpServletRequest clientReq, - HttpServletResponse clientResp, - Serialization serialization) - { - this.pageNS =3D pageNS; - this.clientReq =3D clientReq; - this.clientResp =3D clientResp; - this.serialization =3D serialization; - } - - private String renderURL(Map parameters, URLFormat form= at) - { - CharBuffer buffer =3D new CharBuffer(); - buffer.append(clientReq.getScheme()); - buffer.append("://"); - buffer.append(clientReq.getServerName()); - buffer.append(':'); - buffer.append(Integer.toString(clientReq.getServerPort())); - buffer.append(clientReq.getContextPath()); - buffer.append(clientReq.getServletPath()); - - // - if (clientReq.getPathInfo() !=3D null) - { - buffer.append(clientReq.getPathInfo()); - } - - // - String parameterSeparator =3D format.getWantEscapeXML() =3D=3D Boole= an.TRUE ? "&" : "&"; - - // - boolean first =3D true; - for (Map.Entry entry : parameters.entrySet()) - { - String name =3D entry.getKey(); - String value =3D entry.getValue(); - buffer.append(first ? "?" : parameterSeparator); - buffer.append(name, FastURLEncoder.getUTF8Instance()); - buffer.append('=3D'); - buffer.append(value, FastURLEncoder.getUTF8Instance()); - first =3D false; - } - - // - String url =3D buffer.asString(); - return clientResp.encodeURL(url); - } - - public String renderURL(URLFormat format) - { - String pageNavigationalState =3D null; - if (pageNS !=3D null) - { - byte[] bytes =3D IOTools.serialize(serialization, SerializationFi= lter.COMPRESSOR, pageNS); - pageNavigationalState =3D Base64.encodeBytes(bytes, true); - } - - // - Map parameters; - if (pageNavigationalState !=3D null) - { - parameters =3D Collections.singletonMap(ControllerRequestParamete= rNames.PAGE_NAVIGATIONAL_STATE, pageNavigationalState); - } - else - { - parameters =3D Collections.emptyMap(); - } - - // - return renderURL(parameters, format); - } - - public String renderURL(String windowId, ContainerURL containerURL, URL= Format format) - { - ControllerRequestParameterMapFactory factory =3D new ControllerReque= stParameterMapFactory(serialization); - - // - Map parameters =3D factory.blah(pageNS, windowId, co= ntainerURL); - - // - parameters.put(TYPE, PORTLET_TYPE); - - // - return renderURL(parameters, format); - } -} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/controller/RendererContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/RendererContextImpl.java 2008-02-29 17:00:22 UTC (rev 10158) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/RendererContextImpl.java 2008-02-29 17:35:48 UTC (rev 10159) @@ -39,7 +39,7 @@ = public RendererContextImpl(PortletControllerContextImpl portletControll= erContext) throws PortletInvokerException { - super(portletControllerContext); + super(portletControllerContext, portletControllerContext.getPortletI= nvoker()); = // this.portlets =3D portletControllerContext.getPortlets(); Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/TestPortalContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortalContext.java 2008-02-29 17:00:22 UTC (rev 10158) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortalContext.java 2008-02-29 17:35:48 UTC (rev 10159) @@ -1,40 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ - -package org.jboss.portal.portlet.test.controller; - -import org.jboss.portal.portlet.impl.spi.AbstractPortalContext; - -import java.util.Collections; - -/** - * @author Julien Viet - * @version $Revision: 630 $ - */ -public class TestPortalContext extends AbstractPortalContext -{ - public TestPortalContext() - { - super(Collections.singletonMap("javax.portlet.markup.head.element.su= pport", "true")); - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/controller/TestPortletInvocationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvocationContext.java 2008-02-29 17:00:22 UTC (rev 1= 0158) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= controller/TestPortletInvocationContext.java 2008-02-29 17:35:48 UTC (rev 1= 0159) @@ -1,100 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ - -package org.jboss.portal.portlet.test.controller; - -import org.jboss.portal.common.invocation.resolver.MapAttributeResolver; -import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResol= ver; -import org.jboss.portal.common.invocation.resolver.RequestAttributeResolve= r; -import org.jboss.portal.common.util.MarkupInfo; -import org.jboss.portal.common.io.Serialization; -import org.jboss.portal.portlet.ContainerURL; -import org.jboss.portal.portlet.URLFormat; -import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext; -import org.jboss.portal.portlet.invocation.PortletInvocation; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -public class TestPortletInvocationContext extends AbstractPortletInvocatio= nContext -{ - - /** . */ - private final PortletURLRenderer urlRenderer; - - /** . */ - private final String windowId; - - /** . */ - private final HttpServletRequest clientRequest; - - /** . */ - private final HttpServletResponse clientResponse; - - public TestPortletInvocationContext( - Serialization serialization, - HttpServletRequest clientRequest, - HttpServletResponse clientResponse, - String windowId, - PageNavigationalState pageNavigationalState, - MarkupInfo markupInfo) - { - super(markupInfo); - - // - this.clientRequest =3D clientRequest; - this.clientResponse =3D clientResponse; - this.windowId =3D windowId; - this.urlRenderer =3D new PortletURLRenderer(pageNavigationalState, c= lientRequest, clientResponse, serialization); - - // - addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttribut= eResolver(clientRequest)); - addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeReso= lver()); - addResolver(PortletInvocation.REQUEST_SCOPE, new RequestAttributeRes= olver(clientRequest)); - } - - public String getWindowId() - { - return windowId; - } - - public HttpServletRequest getClientRequest() throws IllegalStateExcepti= on - { - return clientRequest; - } - - public HttpServletResponse getClientResponse() throws IllegalStateExcep= tion - { - return clientResponse; - } - - public String renderURL(ContainerURL containerURL, URLFormat format) - { - return urlRenderer.renderURL(windowId, containerURL, format); - } -} Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-29 17:00:22 UTC (rev 10158) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/ControllerFilter.java 2008-02-29 17:35:48 UTC (rev 10159) @@ -22,8 +22,8 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp; = -import org.jboss.portal.portlet.test.controller.PortletURLRenderer; -import org.jboss.portal.portlet.test.URLParameterConstants; +import org.jboss.portal.portlet.controller.impl.PortletURLRenderer; +import org.jboss.portal.portlet.controller.impl.URLParameterConstants; import org.jboss.portal.portlet.PortletInvoker; import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.URLFormat; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PagePortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-29 17:00:22 UTC (rev 10158) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PagePortletControllerContext.java 2008-02-29 17:35:48 UTC (rev 10159) @@ -32,7 +32,7 @@ import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; -import org.jboss.portal.portlet.test.controller.AbstractPortletControllerC= ontext; +import org.jboss.portal.portlet.controller.impl.AbstractPortletControllerC= ontext; import org.jboss.portal.web.IllegalRequestException; import org.jboss.portal.common.io.Serialization; = Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/PortalRenderResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalRenderResponse.java 2008-02-29 17:00:22 UTC (rev 10158) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/PortalRenderResponse.java 2008-02-29 17:35:48 UTC (rev 10159) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.jsp; = -import org.jboss.portal.portlet.test.controller.TestPortalContext; +import org.jboss.portal.portlet.controller.impl.AbstractPortletControllerC= ontext; import org.jboss.portal.portlet.controller.state.PageNavigationalState; import org.jboss.portal.portlet.controller.state.WindowNavigationalState; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; @@ -171,7 +171,7 @@ render.setInstanceContext(new AbstractInstanceContext(portlet.getCon= text().getId())); render.setUserContext(new AbstractUserContext(portletControllerConte= xt.getClientRequest())); render.setWindowContext(new AbstractWindowContext(windowId)); - render.setPortalContext(new TestPortalContext()); + render.setPortalContext(AbstractPortletControllerContext.PORTAL_CONT= EXT); render.setSecurityContext(new AbstractSecurityContext(portletControl= lerContext.getClientRequest())); render.setTarget(portlet.getContext()); render.setMode(mode); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/jsp/taglib/PortletURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-29 17:00:22 UTC (rev 10158) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= jsp/taglib/PortletURLTag.java 2008-02-29 17:35:48 UTC (rev 10159) @@ -26,7 +26,7 @@ import org.jboss.portal.WindowState; import org.jboss.portal.portlet.test.jsp.PortalRenderResponse; import org.jboss.portal.portlet.test.jsp.PagePortletControllerContext; -import org.jboss.portal.portlet.test.controller.PortletURLRenderer; +import org.jboss.portal.portlet.controller.impl.PortletURLRenderer; import org.jboss.portal.portlet.RenderURL; import org.jboss.portal.portlet.StateString; import org.jboss.portal.portlet.URLFormat; Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/tck/TCKPortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKPortletControllerContext.java 2008-02-29 17:00:22 UTC (rev 10158) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKPortletControllerContext.java 2008-02-29 17:35:48 UTC (rev 10159) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.portlet.test.tck; = -import org.jboss.portal.portlet.test.controller.AbstractPortletControllerC= ontext; +import org.jboss.portal.portlet.controller.impl.AbstractPortletControllerC= ontext; import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.PortletInvoker; @@ -41,7 +41,6 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.ServletContext; import java.io.IOException; -import java.util.Map; import java.util.Set; = /** @@ -52,7 +51,7 @@ { = /** . */ - private final PortletInvoker invoker; + private final PortletInvoker portletInvoker; = /** . */ private final TCKStateControllerContext stateControllerContext; @@ -71,25 +70,30 @@ super(req, resp); = // - this.invoker =3D (PortletInvoker)servletContext.getAttribute("Consum= erPortletInvoker"); + this.portletInvoker =3D (PortletInvoker)servletContext.getAttribute(= "ConsumerPortletInvoker"); this.stateControllerContext =3D new TCKStateControllerContext(new St= ateControllerContextImpl(this)); - this.eventControllerContext =3D new EventControllerContextImpl(invok= er); + this.eventControllerContext =3D new EventControllerContextImpl(portl= etInvoker); this.serialization =3D new TCKPageNavigationalStateSerialization(sta= teControllerContext); } = + public PortletInvoker getPortletInvoker() + { + return portletInvoker; + } + public Set getPortlets() throws PortletInvokerException { - return invoker.getPortlets(); + return portletInvoker.getPortlets(); } = protected Portlet getPortlet(String windowId) throws PortletInvokerExce= ption { - return invoker.getPortlet(PortletContext.createPortletContext(window= Id)); + return portletInvoker.getPortlet(PortletContext.createPortletContext= (windowId)); } = protected PortletInvocationResponse invoke(PortletInvocation invocation= ) throws PortletInvokerException { - return invoker.invoke(invocation); + return portletInvoker.invoke(invocation); } = protected Serialization getPageNavigationalState= Serialization() Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/tck/TCKRendererContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKRendererContext.java 2008-02-29 17:00:22 UTC (rev 10158) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKRendererContext.java 2008-02-29 17:35:48 UTC (rev 10159) @@ -26,6 +26,7 @@ import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.NoSuchPortletException; +import org.jboss.portal.portlet.PortletInvoker; = import java.util.Collection; import java.util.ArrayList; @@ -44,7 +45,7 @@ TCKPortletControllerContext portletControllerContext, TCKPageNavigationalState tckPageNavigationalState) throws PortletInv= okerException { - super(portletControllerContext); + super(portletControllerContext, portletControllerContext.getPortletI= nvoker()); = // Collection involvedPortlets =3D new ArrayList(); Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /test/tck/TCKServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKServlet.java 2008-02-29 17:00:22 UTC (rev 10158) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/= tck/TCKServlet.java 2008-02-29 17:35:48 UTC (rev 10159) @@ -25,7 +25,7 @@ import org.jboss.portal.portlet.test.controller.Renderer; import org.jboss.portal.portlet.test.controller.ControllerResponseRenderer= Factory; import org.jboss.portal.portlet.test.controller.PageRenderer; -import org.jboss.portal.portlet.test.URLParameterConstants; +import org.jboss.portal.portlet.controller.impl.URLParameterConstants; import org.jboss.portal.portlet.controller.PortletController; import org.jboss.portal.portlet.controller.response.ControllerResponse; import org.jboss.portal.portlet.controller.request.ControllerRequest; --===============1728931323056533096==-- From portal-commits at lists.jboss.org Fri Feb 29 12:41:06 2008 Content-Type: multipart/mixed; boundary="===============6463342043601116696==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10160 - modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl. Date: Fri, 29 Feb 2008 12:41:05 -0500 Message-ID: --===============6463342043601116696== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-29 12:41:05 -0500 (Fri, 29 Feb 2008) New Revision: 10160 Added: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/impl/ControllerPortletInvocationContext.java Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/impl/AbstractPortletControllerContext.java Log: rename of TestPortletInvocationContext to ControllerPortletInvocationContext Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/p= ortlet/controller/impl/AbstractPortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/AbstractPortletControllerContext.java 2008-02-29 17:35:48 = UTC (rev 10159) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/AbstractPortletControllerContext.java 2008-02-29 17:41:05 = UTC (rev 10160) @@ -43,7 +43,6 @@ import org.jboss.portal.portlet.invocation.EventInvocation; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.portlet.invocation.ResourceInvocation; -import org.jboss.portal.portlet.invocation.RenderInvocation; import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; import org.jboss.portal.portlet.spi.PortletInvocationContext; import org.jboss.portal.portlet.spi.PortalContext; @@ -126,12 +125,13 @@ = public PortletInvocationResponse invoke(ActionInvocation actionInvocati= on) throws PortletInvokerException { + ControllerPortletInvocationContext context =3D (ControllerPortletInv= ocationContext)actionInvocation.getContext(); = - TestPortletInvocationContext context =3D (TestPortletInvocationConte= xt)actionInvocation.getContext(); + // String windowId =3D context.getWindowId(); - Portlet portlet =3D getPortlet(windowId); = + // actionInvocation.setClientContext(new AbstractClientContext(req)); actionInvocation.setServerContext(new AbstractServerContext(req, res= p)); actionInvocation.setInstanceContext(new AbstractInstanceContext(port= let.getContext().getId())); @@ -142,16 +142,19 @@ actionInvocation.setRequestContext(new AbstractRequestContext(req)); actionInvocation.setTarget(portlet.getContext()); = + // return invoke((PortletInvocation)actionInvocation); } = public PortletInvocationResponse invoke(List requestCookies, Ev= entInvocation eventInvocation) throws PortletInvokerException { - TestPortletInvocationContext context =3D (TestPortletInvocationConte= xt)eventInvocation.getContext(); + ControllerPortletInvocationContext context =3D (ControllerPortletInv= ocationContext)eventInvocation.getContext(); + + // String windowId =3D context.getWindowId(); - Portlet portlet =3D getPortlet(windowId); = + // eventInvocation.setClientContext(new AbstractClientContext(req, requ= estCookies)); eventInvocation.setServerContext(new AbstractServerContext(req, resp= )); eventInvocation.setInstanceContext(new AbstractInstanceContext(portl= et.getContext().getId())); @@ -161,16 +164,19 @@ eventInvocation.setSecurityContext(new AbstractSecurityContext(req)); eventInvocation.setTarget(portlet.getContext()); = + // return invoke(eventInvocation); } = public PortletInvocationResponse invoke(ResourceInvocation resourceInvo= cation) throws PortletInvokerException { - TestPortletInvocationContext context =3D (TestPortletInvocationConte= xt)resourceInvocation.getContext(); + ControllerPortletInvocationContext context =3D (ControllerPortletInv= ocationContext)resourceInvocation.getContext(); + + // String windowId =3D context.getWindowId(); - Portlet portlet =3D getPortlet(windowId); = + // resourceInvocation.setClientContext(new AbstractClientContext(req)); resourceInvocation.setServerContext(new AbstractServerContext(req, r= esp)); resourceInvocation.setInstanceContext(new AbstractInstanceContext(po= rtlet.getContext().getId())); @@ -185,8 +191,10 @@ return invoke((PortletInvocation)resourceInvocation); } = - public PortletInvocationContext createPortletInvocationContext(String w= indowId, PageNavigationalState pageNavigationalState) + public PortletInvocationContext createPortletInvocationContext( + String windowId, + PageNavigationalState pageNavigationalState) { - return new TestPortletInvocationContext(getPageNavigationalStateSeri= alization(), req, resp, windowId, pageNavigationalState, MARKUP_INFO); + return new ControllerPortletInvocationContext(getPageNavigationalSta= teSerialization(), req, resp, windowId, pageNavigationalState, MARKUP_INFO); } } \ No newline at end of file Copied: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/por= tlet/controller/impl/ControllerPortletInvocationContext.java (from rev 1015= 9, modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/impl/TestPortletInvocationContext.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/ControllerPortletInvocationContext.java = (rev 0) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/ControllerPortletInvocationContext.java 2008-02-29 17:41:0= 5 UTC (rev 10160) @@ -0,0 +1,104 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.controller.impl; + +import org.jboss.portal.common.invocation.resolver.MapAttributeResolver; +import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResol= ver; +import org.jboss.portal.common.invocation.resolver.RequestAttributeResolve= r; +import org.jboss.portal.common.util.MarkupInfo; +import org.jboss.portal.common.io.Serialization; +import org.jboss.portal.portlet.ContainerURL; +import org.jboss.portal.portlet.URLFormat; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.impl.PortletURLRenderer; +import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext; +import org.jboss.portal.portlet.invocation.PortletInvocation; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * An implementation of the PortletInvocationContext interfac= e that is related to a specific + * window. + * + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class ControllerPortletInvocationContext extends AbstractPortletInv= ocationContext +{ + + /** . */ + private final PortletURLRenderer urlRenderer; + + /** . */ + private final String windowId; + + /** . */ + private final HttpServletRequest clientRequest; + + /** . */ + private final HttpServletResponse clientResponse; + + public ControllerPortletInvocationContext( + Serialization serialization, + HttpServletRequest clientRequest, + HttpServletResponse clientResponse, + String windowId, + PageNavigationalState pageNavigationalState, + MarkupInfo markupInfo) + { + super(markupInfo); + + // + this.clientRequest =3D clientRequest; + this.clientResponse =3D clientResponse; + this.windowId =3D windowId; + this.urlRenderer =3D new PortletURLRenderer(pageNavigationalState, c= lientRequest, clientResponse, serialization); + + // + addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttribut= eResolver(clientRequest)); + addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeReso= lver()); + addResolver(PortletInvocation.REQUEST_SCOPE, new RequestAttributeRes= olver(clientRequest)); + } + + public String getWindowId() + { + return windowId; + } + + public HttpServletRequest getClientRequest() throws IllegalStateExcepti= on + { + return clientRequest; + } + + public HttpServletResponse getClientResponse() throws IllegalStateExcep= tion + { + return clientResponse; + } + + public String renderURL(ContainerURL containerURL, URLFormat format) + { + return urlRenderer.renderURL(windowId, containerURL, format); + } +} --===============6463342043601116696==-- From portal-commits at lists.jboss.org Fri Feb 29 18:47:04 2008 Content-Type: multipart/mixed; boundary="===============0425153434645711631==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10161 - in modules/portlet/trunk: controller/src/main/java/org/jboss/portal/portlet/controller/impl and 29 other directories. Date: Fri, 29 Feb 2008 18:47:02 -0500 Message-ID: --===============0425153434645711631== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-29 18:47:01 -0500 (Fri, 29 Feb 2008) New Revision: 10161 Added: modules/portlet/trunk/portal/ modules/portlet/trunk/portal/pom.xml modules/portlet/trunk/portal/src/ modules/portlet/trunk/portal/src/assembly/ modules/portlet/trunk/portal/src/assembly/simple-portal-jboss42.xml modules/portlet/trunk/portal/src/build.xml modules/portlet/trunk/portal/src/main/ modules/portlet/trunk/portal/src/main/java/ modules/portlet/trunk/portal/src/main/java/org/ modules/portlet/trunk/portal/src/main/java/org/jboss/ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/InterceptorStackFactoryImpl.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/TestPortletInvoker.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/admin/ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/admin/ui/ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/admin/ui/AdminPortlet.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/ControllerFilter.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/PageEventControllerContext.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/PageParameterDef.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/PagePortletControllerContext.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/PortalPrepareResponse.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/PortalRenderResponse.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/PortalResponse.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/WindowDef.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/WindowResult.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/taglib/ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/taglib/AbstractURLTag.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/taglib/Constants.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/taglib/HeadersTag.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/taglib/JspWriterResponse.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/taglib/PageParamTag.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/taglib/PageTag.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/taglib/ParamTag.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/taglib/PortalBodyTagSupport.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/taglib/PortalSimpleTagSupport.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/taglib/PortletMarkupTag.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/taglib/PortletTag.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/taglib/PortletTitleTag.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/jsp/taglib/PortletURLTag.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/samples/ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/samples/GoogleClippingPortlet.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/samples/GoogleWeatherClippingPortlet.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/samples/RemoteControlResourcePortlet.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/samples/basic/ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/samples/basic/ExceptionPortlet.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/samples/basic/FailDuringInitPortlet.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/samples/basic/HeaderPortlet.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/samples/basic/NullFilter.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/samples/event/ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/samples/event/CartEvent.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/samples/event/CartPortlet.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/samples/event/Catalog.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/samples/event/CatalogItem.java modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/port= al/samples/event/CatalogPortlet.java modules/portlet/trunk/portal/src/main/resources/ modules/portlet/trunk/portal/src/main/resources/samples/ modules/portlet/trunk/portal/src/main/resources/samples/basic-war/ modules/portlet/trunk/portal/src/main/resources/samples/cart-event-portl= et-war/ modules/portlet/trunk/portal/src/main/resources/samples/google-map-portl= et-war/ modules/portlet/trunk/portal/src/main/resources/samples/google-weather-p= ortlet-war/ modules/portlet/trunk/portal/src/main/resources/samples/remotecontrol-po= rtlet-war/ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/META-I= NF/ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-IN= F/ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-IN= F/jboss-web.xml modules/portlet/trunk/portal/src/main/resources/simple-portal-war/css/ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/images/ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/index.= jsp modules/portlet/trunk/portal/src/main/resources/simple-portal-war/js/ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/layout= s/ modules/portlet/trunk/portal/src/test/ modules/portlet/trunk/portal/src/test/java/ modules/portlet/trunk/portal/src/test/resources/ Removed: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/= controller/impl/TestPortletInvocationContext.java modules/portlet/trunk/portal/src/main/resources/samples/basic-war/ modules/portlet/trunk/portal/src/main/resources/samples/cart-event-portl= et-war/ modules/portlet/trunk/portal/src/main/resources/samples/google-map-portl= et-war/ modules/portlet/trunk/portal/src/main/resources/samples/google-weather-p= ortlet-war/ modules/portlet/trunk/portal/src/main/resources/samples/remotecontrol-po= rtlet-war/ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/META-I= NF/ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-IN= F/ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/css/ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/images/ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/index.= jsp modules/portlet/trunk/portal/src/main/resources/simple-portal-war/js/ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/layout= s/ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /admin/ui/ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/j= sp/ modules/portlet/trunk/test/src/test/resources/portal/samples/ modules/portlet/trunk/test/src/test/resources/simple-portal-war/ Modified: modules/portlet/trunk/pom.xml modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-IN= F/jboss-beans.xml modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-IN= F/portal.tld modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-IN= F/web.xml modules/portlet/trunk/test/pom.xml modules/portlet/trunk/test/src/test/build.xml Log: new portal module package for building the simple-portal Deleted: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/po= rtlet/controller/impl/TestPortletInvocationContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/TestPortletInvocationContext.java 2008-02-29 17:41:05 UTC = (rev 10160) +++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet= /controller/impl/TestPortletInvocationContext.java 2008-02-29 23:47:01 UTC = (rev 10161) @@ -1,101 +0,0 @@ -/*************************************************************************= ***** - * JBoss, a division of Red Hat = * - * Copyright 2008, Red Hat Middleware, LLC, and individual = * - * contributors as indicated by the @authors tag. See the = * - * copyright.txt in the distribution for a full listing of = * - * individual contributors. = * - * = * - * This is free software; you can redistribute it and/or modify it = * - * under the terms of the GNU Lesser General Public License as = * - * published by the Free Software Foundation; either version 2.1 of = * - * the License, or (at your option) any later version. = * - * = * - * This software is distributed in the hope that it will be useful, = * - * but WITHOUT ANY WARRANTY; without even the implied warranty of = * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * - * Lesser General Public License for more details. = * - * = * - * You should have received a copy of the GNU Lesser General Public = * - * License along with this software; if not, write to the Free = * - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * - *************************************************************************= *****/ - -package org.jboss.portal.portlet.controller.impl; - -import org.jboss.portal.common.invocation.resolver.MapAttributeResolver; -import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResol= ver; -import org.jboss.portal.common.invocation.resolver.RequestAttributeResolve= r; -import org.jboss.portal.common.util.MarkupInfo; -import org.jboss.portal.common.io.Serialization; -import org.jboss.portal.portlet.ContainerURL; -import org.jboss.portal.portlet.URLFormat; -import org.jboss.portal.portlet.controller.state.PageNavigationalState; -import org.jboss.portal.portlet.controller.impl.PortletURLRenderer; -import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext; -import org.jboss.portal.portlet.invocation.PortletInvocation; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -public class TestPortletInvocationContext extends AbstractPortletInvocatio= nContext -{ - - /** . */ - private final PortletURLRenderer urlRenderer; - - /** . */ - private final String windowId; - - /** . */ - private final HttpServletRequest clientRequest; - - /** . */ - private final HttpServletResponse clientResponse; - - public TestPortletInvocationContext( - Serialization serialization, - HttpServletRequest clientRequest, - HttpServletResponse clientResponse, - String windowId, - PageNavigationalState pageNavigationalState, - MarkupInfo markupInfo) - { - super(markupInfo); - - // - this.clientRequest =3D clientRequest; - this.clientResponse =3D clientResponse; - this.windowId =3D windowId; - this.urlRenderer =3D new PortletURLRenderer(pageNavigationalState, c= lientRequest, clientResponse, serialization); - - // - addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttribut= eResolver(clientRequest)); - addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeReso= lver()); - addResolver(PortletInvocation.REQUEST_SCOPE, new RequestAttributeRes= olver(clientRequest)); - } - - public String getWindowId() - { - return windowId; - } - - public HttpServletRequest getClientRequest() throws IllegalStateExcepti= on - { - return clientRequest; - } - - public HttpServletResponse getClientResponse() throws IllegalStateExcep= tion - { - return clientResponse; - } - - public String renderURL(ContainerURL containerURL, URLFormat format) - { - return urlRenderer.renderURL(windowId, containerURL, format); - } -} Modified: modules/portlet/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/pom.xml 2008-02-29 17:41:05 UTC (rev 10160) +++ modules/portlet/trunk/pom.xml 2008-02-29 23:47:01 UTC (rev 10161) @@ -44,6 +44,7 @@ management mc test + portal = Added: modules/portlet/trunk/portal/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/pom.xml (rev 0) +++ modules/portlet/trunk/portal/pom.xml 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,403 @@ + + + org.jboss.portal.portlet + module-parent + 2.0-SNAPSHOT + ../build/pom.xml + + 4.0.0 + portlet-portal + jar + Portlet Container Simple Portal + + + + + org.jboss.portal.portlet + portlet-portlet + ${project.version} + test-jar + + + org.jboss.portal.portlet + portlet-controller + ${project.version} + + + org.jboss.portal.portlet + portlet-portlet + ${project.version} + + + org.jboss.portal.portlet + portlet-mc + ${project.version} + + + concurrent + concurrent + + + org.jboss.portal.common + common-mc + + + org.jboss.unit + jboss-unit + + + org.jboss.unit + jboss-unit-remote + + + org.jboss.unit + jboss-unit-mc + + + org.jboss.unit + jboss-unit-tooling-ant + + + org.jboss.unit + portal-test + + + org.jboss.unit + portal-test-generic + + + org.jboss + jbossxb + + + jboss + jboss-logging-jdk + + + jboss + jboss-logging-log4j + + + jboss + jboss-remoting + + + org.jboss.microcontainer + jboss-aop-mc-int + + + org.jboss.microcontainer + jboss-classloader + + + org.jboss.microcontainer + jboss-container + + + org.jboss.microcontainer + jboss-dependency + + + org.jboss.microcontainer + jboss-deployers-client-spi + + + org.jboss.microcontainer + jboss-deployers-client + + + org.jboss.microcontainer + jboss-deployers-core-spi + + + org.jboss.microcontainer + jboss-deployers-core + + + org.jboss.microcontainer + jboss-deployers-impl + + + org.jboss.microcontainer + jboss-deployers-spi + + + org.jboss.microcontainer + jboss-deployers-structure-spi + + + org.jboss.microcontainer + jboss-deployers-vfs-spi + + + org.jboss.microcontainer + jboss-deployers-vfs + + + org.jboss.microcontainer + jboss-kernel + + + org.jboss.microcontainer + jboss-managed + + + org.jboss.microcontainer + jboss-metatype + + + commons-logging + commons-logging + + + commons-httpclient + commons-httpclient + + + cargo + cargo-manager + war + test + + + org.jboss.portal.web + web-web + jar + + + javax.ccpp + ccpp + + + + javax.portlet + portlet-api + + + + + apache-taglibs + jstl + + + apache-taglibs + standard + + + + + + + + maven-assembly-plugin + + + src/assembly/simple-portal-jboss42.xml + + + + + + + + + + + + + + + + \ No newline at end of file Added: modules/portlet/trunk/portal/src/assembly/simple-portal-jboss42.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/assembly/simple-portal-jboss42.xml = (rev 0) +++ modules/portlet/trunk/portal/src/assembly/simple-portal-jboss42.xml 200= 8-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,68 @@ + + simple-portal-jboss42 + + dir + + simple-portal + + + + + + org.jboss.portal.common:common-common + org.jboss.portal.common:common-portal + org.jboss.portal.web:web-web + org.jboss.portal.portlet:portlet-portlet + javax.portlet:portlet-api + javax.ccpp:ccpp + javax.xml.bind:jaxb-api + + + + + simple-portal.war/WEB-INF/lib + + org.jboss.portal.common:common-mc + org.jboss.portal.portlet:portlet-controller + org.jboss.portal.portlet:portlet-mc + trove:trove + org.jboss:jboss-common-core + org.jboss:jboss-vfs + org.jboss:javassist + org.jboss:jbossxb + org.jboss.aop:jboss-aop + org.jboss.microcontainer:jboss-aop-mc-int + org.jboss.microcontainer:jboss-classloader + org.jboss.microcontainer:jboss-dependency + org.jboss.microcontainer:jboss-container + org.jboss.microcontainer:jboss-deployers-client-spi + org.jboss.microcontainer:jboss-deployers-client + org.jboss.microcontainer:jboss-deployers-core-spi + org.jboss.microcontainer:jboss-deployers-core + org.jboss.microcontainer:jboss-deployers-impl + org.jboss.microcontainer:jboss-deployers-spi + org.jboss.microcontainer:jboss-deployers-structure-sp= i + org.jboss.microcontainer:jboss-deployers-vfs-spi + org.jboss.microcontainer:jboss-deployers-vfs + org.jboss.microcontainer:jboss-kernel + org.jboss.microcontainer:jboss-managed + + + + + + + + + src/main/resources/simple-portal-war + simple-portal.war + + + + target/classes + simple-portal.war/WEB-INF/classes + + + + + Added: modules/portlet/trunk/portal/src/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/build.xml (rev= 0) +++ modules/portlet/trunk/portal/src/build.xml 2008-02-29 23:47:01 UTC (rev= 10161) @@ -0,0 +1,1014 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/InterceptorStackFactoryImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/InterceptorStackFactoryImpl.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/InterceptorStackFactoryImpl.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,84 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal; + +import org.jboss.portal.common.invocation.Interceptor; +import org.jboss.portal.common.invocation.InterceptorStack; +import org.jboss.portal.common.invocation.InterceptorStackFactory; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class InterceptorStackFactoryImpl implements InterceptorStackFactory +{ + + /** . */ + private volatile Interceptor[] interceptors; + + /** . */ + private final InterceptorStackImpl stack =3D new InterceptorStackImpl(); + + public Interceptor[] getInterceptors() + { + return interceptors; + } + + public void setInterceptors(Interceptor[] interceptors) + { + this.interceptors =3D interceptors; + } + + public InterceptorStack getInterceptorStack() + { + return stack; + } + + private class InterceptorStackImpl implements InterceptorStack + { + + public int getLength() + { + // Avoid dirty reads + Interceptor[] interceptors =3D InterceptorStackFactoryImpl.this.i= nterceptors; + + // + return interceptors !=3D null ? interceptors.length : 0; + } + + public Interceptor getInterceptor(int i) throws ArrayIndexOutOfBound= sException + { + // Avoid dirty reads + Interceptor[] interceptors =3D InterceptorStackFactoryImpl.this.i= nterceptors; + + // + if (interceptors =3D=3D null) + { + throw new ArrayIndexOutOfBoundsException("No interceptors"); + } + + // + return interceptors[i]; + } + } +} \ No newline at end of file Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/TestPortletInvoker.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/TestPortletInvoker.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/TestPortletInvoker.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,159 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.portal; + +import org.jboss.portal.common.invocation.InterceptorStackFactory; +import org.jboss.portal.common.invocation.Invocation; +import org.jboss.portal.common.invocation.InvocationException; +import org.jboss.portal.common.invocation.InvocationHandler; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletContext; +import org.jboss.portal.portlet.PortletInvoker; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.state.DestroyCloneFailure; +import org.jboss.portal.portlet.state.PropertyChange; +import org.jboss.portal.portlet.state.PropertyMap; + +import java.util.List; +import java.util.Set; + +/** + * A simple consumer. + * + * @author Julien Viet + * @version $Revision: 6712 $ + */ +public class TestPortletInvoker implements PortletInvoker +{ + + /** . */ + private InterceptorStackFactory stackFactory; + + /** . */ + private PortletInvoker producer; + + /** . */ + private InvocationHandler handler =3D new InvocationHandler() + { + public Object invoke(Invocation invocation) throws Exception, Invoca= tionException + { + PortletInvocation portletInvocation =3D (PortletInvocation)invoca= tion; + try + { + portletInvocation.setHandler(null); + return producer.invoke(portletInvocation); + } + finally + { + portletInvocation.setHandler(this); + } + } + }; + + public InterceptorStackFactory getStackFactory() + { + return stackFactory; + } + + public void setStackFactory(InterceptorStackFactory stackFactory) + { + this.stackFactory =3D stackFactory; + } + + public PortletInvoker getProducer() + { + return producer; + } + + public void setProducer(PortletInvoker producer) + { + this.producer =3D producer; + } + + public Set getPortlets() throws PortletInvokerException + { + return producer.getPortlets(); + } + + public Portlet getPortlet(PortletContext portletContext) throws Illegal= ArgumentException, PortletInvokerException + { + return producer.getPortlet(portletContext); + } + + public PortletInvocationResponse invoke(PortletInvocation invocation) t= hrows PortletInvokerException + { + InvocationHandler prevHandler =3D invocation.getHandler(); + try + { + invocation.setHandler(handler); + return (PortletInvocationResponse)invocation.invoke(stackFactory.= getInterceptorStack()); + } + catch (Exception e) + { + if (e instanceof PortletInvokerException) + { + throw (PortletInvokerException)e; + } + else if (e instanceof RuntimeException) + { + throw (RuntimeException)e; + } + else + { + throw new PortletInvokerException(e); + } + } + finally + { + invocation.setHandler(prevHandler); + } + } + + public PortletContext createClone(PortletContext portletContext) throws= IllegalArgumentException, PortletInvokerException, UnsupportedOperationExc= eption + { + throw new UnsupportedOperationException(); + } + + public List destroyClones(List por= tletContexts) throws IllegalArgumentException, PortletInvokerException, Uns= upportedOperationException + { + throw new UnsupportedOperationException(); + } + + public PropertyMap getProperties(PortletContext portletContext, Set key= s) throws IllegalArgumentException, PortletInvokerException, UnsupportedOpe= rationException + { + throw new UnsupportedOperationException(); + } + + public PropertyMap getProperties(PortletContext portletContext) throws = IllegalArgumentException, PortletInvokerException, UnsupportedOperationExce= ption + { + throw new UnsupportedOperationException(); + } + + public PortletContext setProperties(PortletContext portletContext, Prop= ertyChange[] changes) throws IllegalArgumentException, PortletInvokerExcept= ion, UnsupportedOperationException + { + throw new UnsupportedOperationException(); + } +} \ No newline at end of file Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/admin/ui/AdminPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/admin/ui/AdminPortlet.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/admin/ui/AdminPortlet.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,172 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.admin.ui; + +import org.jboss.portal.portlet.container.managed.PortletApplicationRegist= ry; +import org.jboss.portal.portlet.container.managed.ManagedPortletApplicatio= n; +import org.jboss.portal.portlet.container.managed.ManagedPortletContainer; +import org.jboss.portal.portlet.container.managed.ManagedPortletFilter; +import org.jboss.portal.portlet.container.managed.ManagedObject; + +import javax.portlet.GenericPortlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.PortletURL; +import java.io.IOException; +import java.io.PrintWriter; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class AdminPortlet extends GenericPortlet +{ + + public void processAction(ActionRequest req, ActionResponse resp) throw= s PortletException, IOException + { + + String lifeCycle =3D req.getParameter("lifecycle"); + + // + String applicationId =3D req.getParameter("application"); + + // + if (applicationId !=3D null) + { + // Use an alias + PortletApplicationRegistry registry =3D (PortletApplicationRegist= ry)getPortletContext().getAttribute("PortletApplicationDeployer"); + + // + ManagedPortletApplication application =3D registry.getManagedPort= letApplication(applicationId); + ManagedObject managedObject =3D application; + + // + String containerId =3D req.getParameter("container"); + if (containerId !=3D null) + { + managedObject =3D application.getManagedPortletContainer(conta= inerId); + } + else + { + String filterId =3D req.getParameter("filter"); + if (filterId !=3D null) + { + managedObject =3D application.getManagedPortletFilter(filte= rId); + } + } + + // + final ManagedObject tmp =3D managedObject; + if (tmp !=3D null) + { + if ("start".equals(lifeCycle)) + { + tmp.managedStart(); + } + else if ("stop".equals(lifeCycle)) + { + // Async stop otherwise it is not possible to stop the admi= n portlet (self deadlock) + new Thread() + { + public void run() + { + tmp.managedStop(); + } + }.start(); + } + } + } + } + + protected void doView(RenderRequest req, RenderResponse resp) throws Po= rtletException, IOException + { + resp.setContentType("text/html"); + PrintWriter writer =3D resp.getWriter(); + + // Use an alias + PortletApplicationRegistry registry =3D (PortletApplicationRegistry)= getPortletContext().getAttribute("PortletApplicationDeployer"); + + // + for (ManagedPortletApplication application : registry.getManagedPort= letApplications()) + { + PortletURL url =3D resp.createActionURL(); + url.setParameter("application", application.getId()); + + // + url.setParameter("lifecycle", "stop"); + String stopURL =3D url.toString(); + + // + url.setParameter("lifecycle", "start"); + String startURL =3D url.toString(); + + // + writer.print("
            • Application " + application.getId() + " " += application.getStatus() + + " Start Stop
              • "); + + // + for (ManagedPortletFilter filter : application.getManagedPortletF= ilters()) + { + url.setParameter("filter", filter.getId()); + + // + url.setParameter("lifecycle", "stop"); + stopURL =3D url.toString(); + + // + url.setParameter("lifecycle", "start"); + startURL =3D url.toString(); + + // + writer.print("
              • Filter " + filter.getId() + " " + filter.get= Status() + " Start Stop=
              • "); + } + + // + for (ManagedPortletContainer container : application.getManagedPo= rtletContainers()) + { + url.setParameter("container", container.getId()); + + // + url.setParameter("lifecycle", "stop"); + stopURL =3D url.toString(); + + // + url.setParameter("lifecycle", "start"); + startURL =3D url.toString(); + + // + writer.print("
              • Container " + container.getId() + " " + cont= ainer.getStatus() + " Start Stop=
              • "); + } + writer.print("
            "); + } + + // + writer.close(); + + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/jsp/ControllerFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/ControllerFilter.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/ControllerFilter.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,273 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.jsp; + +import org.jboss.portal.portlet.controller.impl.PortletURLRenderer; +import org.jboss.portal.portlet.controller.impl.URLParameterConstants; +import org.jboss.portal.portlet.PortletInvoker; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.URLFormat; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.response.ErrorResponse; +import org.jboss.portal.portlet.invocation.response.ContentResponse; +import org.jboss.portal.portlet.controller.PortletController; +import org.jboss.portal.portlet.controller.request.PortletActionRequest; +import org.jboss.portal.portlet.controller.impl.request.ControllerRequestF= actory; +import org.jboss.portal.portlet.controller.request.ControllerRequest; +import org.jboss.portal.portlet.controller.impl.request.ControllerRequestP= arameterNames; +import org.jboss.portal.portlet.controller.response.ControllerResponse; +import org.jboss.portal.portlet.controller.response.PageUpdateResponse; +import org.jboss.portal.portlet.controller.response.ResourceResponse; +import org.jboss.portal.portlet.controller.response.PortletResponse; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.PageNavigationalStateSeri= alization; +import org.jboss.portal.common.io.IOTools; +import org.jboss.portal.common.io.SerializationFilter; +import org.jboss.portal.common.util.Base64; +import org.jboss.portal.web.WebRequest; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.ServletException; +import javax.servlet.ServletOutputStream; +import javax.servlet.Filter; +import javax.servlet.FilterConfig; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.FilterChain; +import javax.servlet.ServletContext; +import java.io.IOException; +import java.io.Writer; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ControllerFilter implements Filter +{ + + /** . */ + private FilterConfig config; + + private ServletContext getServletContext() + { + return config.getServletContext(); + } + + public void init(FilterConfig config) throws ServletException + { + this.config =3D config; + } + + public void doFilter(ServletRequest req, ServletResponse resp, FilterCh= ain chain) throws IOException, ServletException + { + try + { + doFilter((HttpServletRequest)req, (HttpServletResponse)resp, chai= n); + } + catch (PortletInvokerException e) + { + throw new ServletException(e); + } + } + + public void doFilter(HttpServletRequest req, HttpServletResponse resp, = FilterChain chain) throws IOException, ServletException, PortletInvokerExce= ption + { + PortletInvoker invoker =3D (PortletInvoker)getServletContext().getAt= tribute("ConsumerPortletInvoker"); + + // + PortalPrepareResponse prepareResponse =3D new PortalPrepareResponse(= req, resp); + + // Discover existing portlets on the page (introspection phase) + chain.doFilter(req, prepareResponse); + + // Now we can create a populated context + PagePortletControllerContext context =3D new PagePortletControllerCo= ntext(req, resp, invoker, getServletContext(), prepareResponse); + + // The type of invocation + String type =3D req.getParameter(URLParameterConstants.TYPE); + + // Process only portlet type + // The request decoded if not null + PageNavigationalState pageNavigationalState =3D null; + if (URLParameterConstants.PORTLET_TYPE.equals(type)) + { + WebRequest wr =3D new WebRequest(req); + ControllerRequestFactory factory =3D new ControllerRequestFactory= (context.getPageNavigationalStateSerialization()); + ControllerRequest request =3D factory.createRequest(wr); + + ControllerResponse controllerResponse; + try + { + controllerResponse =3D new PortletController().process(context= , request); + } + catch (PortletInvokerException e) + { + throw new ServletException(e); + } + + // + if (controllerResponse instanceof PageUpdateResponse) + { + PageUpdateResponse pageUpdate =3D (PageUpdateResponse)controll= erResponse; + + // We perform a send redirect on actions + if (request instanceof PortletActionRequest) + { + // + PortletURLRenderer renderer =3D new PortletURLRenderer( + pageUpdate.getPageNavigationalState(), + context.getClientRequest(), + context.getClientResponse(), + context.getPageNavigationalStateSerialization()); + + // + String url =3D renderer.renderURL(new URLFormat(null, null,= true, null)); + + // + resp.sendRedirect(url); + + // + return; + } + else + { + pageNavigationalState =3D pageUpdate.getPageNavigationalSta= te(); + } + } + else if (controllerResponse instanceof ResourceResponse) + { + ResourceResponse resourceResponse =3D (ResourceResponse)contro= llerResponse; + PortletInvocationResponse pir =3D resourceResponse.getResponse= (); + + // + if (pir instanceof ContentResponse) + { + ContentResponse contentResponse =3D (ContentResponse)pir; + + // + if (contentResponse.getType() =3D=3D ContentResponse.TYPE_E= MPTY) + { + resp.setStatus(HttpServletResponse.SC_NO_CONTENT); + } + else + { + String contentType =3D contentResponse.getContentType(); + if (contentType !=3D null) + { + resp.setContentType(contentType); + } + + // + if (contentResponse.getType() =3D=3D ContentResponse.TYP= E_BYTES) + { + ServletOutputStream out =3D null; + try + { + out =3D resp.getOutputStream(); + out.write(contentResponse.getBytes()); + } + finally + { + IOTools.safeClose(out); + } + } + else + { + Writer writer =3D null; + try + { + writer =3D resp.getWriter(); + writer.write(contentResponse.getChars()); + } + finally + { + writer.close(); + } + } + } + } + else + { + // todo + } + + // + return; + } + else if (controllerResponse instanceof PortletResponse) + { + PortletResponse portletResponse =3D (PortletResponse)controlle= rResponse; + PortletInvocationResponse pir =3D portletResponse.getResponse(= ); + + // + if (pir instanceof ErrorResponse) + { + ErrorResponse errorResponse =3D (ErrorResponse)pir; + + // + if (errorResponse.getCause() !=3D null) + { + throw new ServletException(errorResponse.getMessage(), e= rrorResponse.getCause()); + } + else + { + throw new ServletException(errorResponse.getMessage()); + } + } + else + { + // todo + } + } + else + { + // todo + } + } + else + { + PageNavigationalStateSerialization serialization =3D new PageNavi= gationalStateSerialization(context.getStateControllerContext()); + // The nav state provided with the request + // Unmarshall portal navigational state if it is provided + pageNavigationalState =3D null; + String blah =3D req.getParameter(ControllerRequestParameterNames.= PAGE_NAVIGATIONAL_STATE); + if (blah !=3D null) + { + byte[] bytes =3D Base64.decode(blah, true); + pageNavigationalState =3D IOTools.unserialize(serialization, S= erializationFilter.COMPRESSOR, bytes); + } + } + + // + PortalRenderResponse renderResponse =3D new PortalRenderResponse(req= , resp, context, pageNavigationalState, prepareResponse); + + // + chain.doFilter(req, renderResponse); + } + + public void destroy() + { + this.config =3D null; + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/jsp/PageEventControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/PageEventControllerContext.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/PageEventControllerContext.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,88 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.jsp; + +import org.jboss.portal.portlet.controller.event.EventControllerContext; +import org.jboss.portal.portlet.controller.event.Event; +import org.jboss.portal.portlet.controller.event.EventPhaseSession; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.info.PortletInfo; + +/** + * Route events according to the portlets discovered on the page. For now = it is pretty trivial. + * We could leverage JSP tags to 'wire' portlets on the same page for inst= ance. + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PageEventControllerContext implements EventControllerContext +{ + + /** . */ + private final PortalPrepareResponse prepareResponse; + + /** . */ + private final PagePortletControllerContext context; + + public PageEventControllerContext( + PagePortletControllerContext context, + PortalPrepareResponse prepareResponse) + { + this.context =3D context; + this.prepareResponse =3D prepareResponse; + } + + public void eventProduced(EventPhaseSession session, Event sourceEvent,= Event producedEvent) + { + for (String windowId : prepareResponse.getWindowIds()) + { + try + { + Portlet portlet =3D context.getPortlet(windowId); + + // + if (portlet !=3D null) + { + PortletInfo portletInfo =3D portlet.getInfo(); + + // + if (portletInfo.getEventing().getConsumedEvents().containsK= ey(producedEvent.getName())) + { + Event distributedEvent =3D new Event(producedEvent.getNa= me(), producedEvent.getPayload(), windowId); + session.queueEvent(distributedEvent); + } + } + } + catch (PortletInvokerException e) + { + e.printStackTrace(); + session.interrupt(); + } + } + } + + public void eventConsumed(EventPhaseSession session, Event sourceEvent,= Event consumedEvent) + { + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/jsp/PageParameterDef.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/PageParameterDef.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/PageParameterDef.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,64 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.jsp; + +import javax.xml.namespace.QName; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PageParameterDef +{ + + /** . */ + private QName name; + + /** . */ + private String value; + + /** . */ + private boolean frozen; + + public PageParameterDef(QName name, String value, boolean frozen) + { + this.name =3D name; + this.value =3D value; + this.frozen =3D frozen; + } + + public QName getName() + { + return name; + } + + public String getValue() + { + return value; + } + + public boolean isFrozen() + { + return frozen; + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/jsp/PagePortletControllerContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/PagePortletControllerContext.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/PagePortletControllerContext.java 2008-02-29 23:47:01 UTC (rev 1016= 1) @@ -0,0 +1,169 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.jsp; + +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.PortletInvoker; +import org.jboss.portal.portlet.info.PortletInfo; +import org.jboss.portal.portlet.controller.state.StateControllerContext; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.PageNavigationalStateSeri= alization; +import org.jboss.portal.portlet.controller.impl.state.StateControllerConte= xtImpl; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.controller.impl.AbstractPortletControllerC= ontext; +import org.jboss.portal.web.IllegalRequestException; +import org.jboss.portal.common.io.Serialization; + +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.Map; +import java.util.HashMap; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PagePortletControllerContext extends AbstractPortletControlle= rContext +{ + + /** . */ + private final PageEventControllerContext eventControllerContext; + + /** . */ + private final StateControllerContext stateControllerContext; + + /** . */ + private final Serialization serialization; + + /** . */ + private final PortalPrepareResponse prepareResponse; + + /** . */ + private final Map portlets; + + /** . */ + private final PortletInvoker invoker; + + public PagePortletControllerContext( + HttpServletRequest req, + HttpServletResponse resp, + PortletInvoker invoker, + ServletContext servletContext, + PortalPrepareResponse prepareResponse) + throws IllegalRequestException, IOException, ServletException, Portl= etInvokerException + { + super(req, resp); + + // + Map portlets =3D new HashMap(); + for (Portlet portlet : invoker.getPortlets()) + { + PortletInfo portletInfo =3D portlet.getInfo(); + String portletName =3D portletInfo.getName(); + String applicationName =3D portletInfo.getApplicationName(); + Key key =3D new Key(applicationName, portletName); + portlets.put(key, portlet); + } + + // + this.invoker =3D invoker; + this.portlets =3D portlets; + this.prepareResponse =3D prepareResponse; + this.stateControllerContext =3D new StateControllerContextImpl(this); + this.eventControllerContext =3D new PageEventControllerContext(this,= prepareResponse); + this.serialization =3D new PageNavigationalStateSerialization(stateC= ontrollerContext); + } + + public Portlet findPortlet(String applicationName, String portletName) + { + return portlets.get(new Key(applicationName, portletName)); + } + + protected Portlet getPortlet(String windowId) throws PortletInvokerExce= ption + { + WindowDef windowDef =3D prepareResponse.getWindowDef(windowId); + + // + return findPortlet(windowDef.getApplicationName(), windowDef.getPort= letName()); + } + + public PortletInvocationResponse invoke(PortletInvocation invocation) t= hrows PortletInvokerException + { + return invoker.invoke(invocation); + } + + public PageEventControllerContext getEventControllerContext() + { + return eventControllerContext; + } + + public StateControllerContext getStateControllerContext() + { + return stateControllerContext; + } + + public Serialization getPageNavigationalStateSer= ialization() + { + return serialization; + } + + private static class Key + { + + /** . */ + private final String applicationName; + + /** . */ + private final String portletName; + + private Key(String applicationName, String portletName) + { + this.applicationName =3D applicationName; + this.portletName =3D portletName; + } + + public boolean equals(Object obj) + { + if (obj =3D=3D this) + { + return true; + } + if (obj instanceof Key) + { + Key that =3D (Key)obj; + return applicationName.equals(that.applicationName) && portlet= Name.equals(that.portletName); + } + return false; + } + + public int hashCode() + { + return applicationName.hashCode() + portletName.hashCode(); + } + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/jsp/PortalPrepareResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/PortalPrepareResponse.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/PortalPrepareResponse.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,261 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.jsp; + +import org.jboss.portal.portlet.PortletInvokerException; + +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.ServletOutputStream; +import javax.xml.namespace.QName; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.Writer; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortalPrepareResponse extends PortalResponse +{ + + /** . */ + private String contentType; + + /** . */ + private Locale locale; + + /** . */ + private String characterEncoding; + + /** . */ + private int bufferSize; + + /** . */ + private ServletOutputStream outputStream; + + /** . */ + private PrintWriter writer; + + /** . */ + private Map windowDefs; + + /** . */ + private Map paramDefs; + + public PortalPrepareResponse(HttpServletRequest request, HttpServletRes= ponse response) throws PortletInvokerException + { + super(request, response); + + // + this.windowDefs =3D new HashMap(); + this.paramDefs =3D new HashMap(); + } + + public Set getWindowIds() + { + return windowDefs.keySet(); + } + + public WindowDef getWindowDef(String windowId) + { + return windowDefs.get(windowId); + } + + public void addWindowDef(String windowId, WindowDef portlet) + { + windowDefs.put(windowId, portlet); + } + + public Set getPageParameterNames() + { + return paramDefs.keySet(); + } + + public PageParameterDef getPageParameterDef(QName name) + { + return paramDefs.get(name); + } + + public void setPageParameterDef(PageParameterDef parameterDef) + { + paramDefs.put(parameterDef.getName(), parameterDef); + } + + public ServletOutputStream getOutputStream() throws IOException + { + if (writer !=3D null) + { + throw new IllegalStateException(); + } + if (outputStream =3D=3D null) + { + outputStream =3D new ServletOutputStream() + { + public void write(int b) throws IOException + { + } + }; + } + return outputStream; + } + + public PrintWriter getWriter() throws IOException + { + if (outputStream !=3D null) + { + throw new IllegalStateException(); + } + if (writer =3D=3D null) + { + Writer tmp =3D new Writer() + { + public void write(char cbuf[], int off, int len) throws IOExce= ption + { + } + public void flush() throws IOException + { + } + public void close() throws IOException + { + } + }; + writer =3D new PrintWriter(tmp); + } + return writer; + } + + public void flushBuffer() throws IOException + { + } + + public boolean isCommitted() + { + return false; + } + + public void reset() + { + } + + public void resetBuffer() + { + } + + public void sendError(int i, String s) throws IOException + { + } + + public void sendError(int i) throws IOException + { + } + + public void sendRedirect(String s) throws IOException + { + } + + public void addCookie(Cookie cookie) + { + } + + public void setDateHeader(String s, long l) + { + } + + public void addDateHeader(String s, long l) + { + } + + public void setHeader(String s, String s1) + { + } + + public void addHeader(String s, String s1) + { + } + + public void setContentType(String contentType) + { + this.contentType =3D contentType; + } + + public void setContentLength(int i) + { + } + + public void setCharacterEncoding(String characterEncoding) + { + this.characterEncoding =3D characterEncoding; + } + + public void setIntHeader(String s, int i) + { + } + + public void addIntHeader(String s, int i) + { + } + + public void setStatus(int i) + { + } + + public void setStatus(int i, String s) + { + } + + public void setLocale(Locale locale) + { + this.locale =3D locale; + } + + public String getContentType() + { + return contentType; + } + + public Locale getLocale() + { + return locale; + } + + public String getCharacterEncoding() + { + return characterEncoding; + } + + public void setBufferSize(int bufferSize) + { + this.bufferSize =3D bufferSize; + } + + public int getBufferSize() + { + return bufferSize; + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/jsp/PortalRenderResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/PortalRenderResponse.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/PortalRenderResponse.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,246 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.jsp; + +import org.jboss.portal.portlet.controller.impl.AbstractPortletControllerC= ontext; +import org.jboss.portal.portlet.controller.state.PageNavigationalState; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.RenderInvocation; +import org.jboss.portal.portlet.PortletInvokerException; +import org.jboss.portal.portlet.Portlet; +import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.impl.spi.AbstractClientContext; +import org.jboss.portal.portlet.impl.spi.AbstractServerContext; +import org.jboss.portal.portlet.impl.spi.AbstractUserContext; +import org.jboss.portal.portlet.impl.spi.AbstractWindowContext; +import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext; +import org.jboss.portal.portlet.impl.spi.AbstractInstanceContext; +import org.jboss.portal.portlet.spi.PortletInvocationContext; +import org.jboss.portal.WindowState; +import org.jboss.portal.Mode; +import org.jboss.portal.common.util.ParameterMap; + +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.xml.namespace.QName; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortalRenderResponse extends PortalResponse +{ + + /** . */ + private PageNavigationalState pageNavigationalState; + + /** . */ + private PagePortletControllerContext portletControllerContext; + + /** . */ + private Map windowResults; + + public PortalRenderResponse( + HttpServletRequest request, + HttpServletResponse response, + PagePortletControllerContext portletControllerContext, + PageNavigationalState pageNavigationalState, + PortalPrepareResponse prepareResponse) throws PortletInvokerException + { + super(request, response); + + // + Set pageParameterNames =3D prepareResponse.getPageParameterNa= mes(); + if (pageParameterNames.size() > 0) + { + if (pageNavigationalState =3D=3D null) + { + pageNavigationalState =3D portletControllerContext.getStateCon= trollerContext().createPageNavigationalState(true); + } + for (QName parameterName : pageParameterNames) + { + PageParameterDef parameterDef =3D prepareResponse.getPageParam= eterDef(parameterName); + boolean update =3D parameterDef.isFrozen() ? true : pageNaviga= tionalState.getPublicNavigationalState(parameterName) =3D=3D null; + if (update) + { + pageNavigationalState.setPublicNavigationalState(parameterN= ame, new String[]{parameterDef.getValue()}); + } + } + } + + // + this.portletControllerContext =3D portletControllerContext; + this.windowResults =3D new HashMap(); + this.pageNavigationalState =3D pageNavigationalState; + + // + render(prepareResponse); + } + + /** + * The page state for the rendering. + * + * @return the page state + */ + public PageNavigationalState getPageNavigationalState() + { + return pageNavigationalState; + } + + public Set getWindowIds() + { + return windowResults.keySet(); + } + + public WindowResult getWindowResult(String windowId) + { + return windowResults.get(windowId); + } + + public PagePortletControllerContext getPortletControllerContext() + { + return portletControllerContext; + } + + private PortletInvocationResponse render(Portlet portlet, String window= Id) throws PortletInvokerException + { + WindowNavigationalState windowNS =3D null; + if (pageNavigationalState !=3D null) + { + windowNS =3D pageNavigationalState.getWindowNavigationalState(win= dowId); + } + + // + ParameterMap publicNS =3D null; + if (pageNavigationalState !=3D null) + { + publicNS =3D pageNavigationalState.getPublicNavigationalState(win= dowId); + } + + // + Mode mode =3D Mode.VIEW; + WindowState windowState =3D WindowState.NORMAL; + StateString portletNS =3D null; + + // + if (windowNS !=3D null) + { + if (windowNS.getMode() !=3D null) + { + mode =3D windowNS.getMode(); + } + if (windowNS.getWindowState() !=3D null) + { + windowState =3D windowNS.getWindowState(); + } + if (windowNS.getPortletNavigationalState() !=3D null) + { + portletNS =3D windowNS.getPortletNavigationalState(); + } + } + + // + PortletInvocationContext renderContext =3D portletControllerContext.= createPortletInvocationContext(windowId, pageNavigationalState); + RenderInvocation render =3D new RenderInvocation(renderContext); + render.setClientContext(new AbstractClientContext(portletControllerC= ontext.getClientRequest())); + render.setServerContext(new AbstractServerContext(portletControllerC= ontext.getClientRequest(), portletControllerContext.getClientResponse())); + render.setInstanceContext(new AbstractInstanceContext(portlet.getCon= text().getId())); + render.setUserContext(new AbstractUserContext(portletControllerConte= xt.getClientRequest())); + render.setWindowContext(new AbstractWindowContext(windowId)); + render.setPortalContext(AbstractPortletControllerContext.PORTAL_CONT= EXT); + render.setSecurityContext(new AbstractSecurityContext(portletControl= lerContext.getClientRequest())); + render.setTarget(portlet.getContext()); + render.setMode(mode); + render.setWindowState(windowState); + render.setNavigationalState(portletNS); + render.setPublicNavigationalState(publicNS); + + // + return portletControllerContext.invoke(render); + } + + private void render(PortalPrepareResponse prepareResponse) + { + for (String windowId : prepareResponse.getWindowIds()) + { + WindowDef windowDef =3D prepareResponse.getWindowDef(windowId); + + // + try + { + Portlet portlet =3D portletControllerContext.getPortlet(window= Id); + + // + if (portlet !=3D null) + { + PortletInvocationResponse portletResponse =3D render(portle= t, windowId); + + // + WindowResult result =3D new WindowResult(windowDef, portlet= Response); + + // + windowResults.put(windowId, result); + } + else + { + // log + } + } + catch (PortletInvokerException e) + { + e.printStackTrace(); + } + } + } + + public boolean isMaximizedWindow(String windowId) + { + if (windowId =3D=3D null) + { + throw new IllegalArgumentException(); + } + return windowId.equals(getMaximizedWindowId()); + } + + public String getMaximizedWindowId() + { + if (pageNavigationalState !=3D null) + { + for (String windowId : pageNavigationalState.getWindowIds()) + { + WindowNavigationalState windowNS =3D pageNavigationalState.get= WindowNavigationalState(windowId); + if (WindowState.MAXIMIZED.equals(windowNS.getWindowState())) + { + return windowId; + } + } + } + + // + return null; + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/jsp/PortalResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/PortalResponse.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/PortalResponse.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,66 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.jsp; + +import org.jboss.portal.portlet.PortletInvokerException; + +import javax.servlet.http.HttpServletResponseWrapper; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpServletRequest; + +/** + * Expose stuff common to action and render response. + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortalResponse extends HttpServletResponseWrapper +{ + + /** . */ + private int count =3D 0; + + /** . */ + private final String pageId; + + public PortalResponse(HttpServletRequest request, HttpServletResponse r= esponse) throws PortletInvokerException + { + super(response); + + // We don't keep a ref to the request since this will be used mainly= during in a dispatch to a JSP + // and the info returned by a request after a dispatch are not the s= ame than before (like the path info). + String pageId =3D request.getRequestURI(); + + // + this.pageId =3D pageId; + } + + /** + * todo : add on JSP portlet tag a notion of 'id', because this id gene= ration relies on the portlet + * rendering order on the page which could not be the same between 2 re= quests. + */ + public String nextId() + { + return pageId + "/" + count++; + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/jsp/WindowDef.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/WindowDef.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/WindowDef.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,103 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.jsp; + +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; + +import java.util.Set; + +/** + * Combines the invocation of a portlet and the info on the portlet JSP ta= g. It does + * not need to be exposed out of this package. + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class WindowDef +{ + + /** . */ + private final String portletName; + + /** . */ + private final String applicationName; + + /** . */ + private final String windowId; + + /** . */ + private final Mode initialMode; + + /** . */ + private final Set supportedModes; + + /** . */ + private final Set supportedWindowStates; + + public WindowDef( + String portletName, + String applicationName, + String windowId, + Mode initialMode, + Set supportedModes, + Set supportedWindowStates) + { + this.portletName =3D portletName; + this.applicationName =3D applicationName; + this.windowId =3D windowId; + this.initialMode =3D initialMode; + this.supportedModes =3D supportedModes; + this.supportedWindowStates =3D supportedWindowStates; + } + + public String getPortletName() + { + return portletName; + } + + public String getApplicationName() + { + return applicationName; + } + + public String getWindowId() + { + return windowId; + } + + public Mode getInitialMode() + { + return initialMode; + } + + public Set getSupportedModes() + { + return supportedModes; + } + + public Set getSupportedWindowStates() + { + return supportedWindowStates; + } +} \ No newline at end of file Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/jsp/WindowResult.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/WindowResult.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/WindowResult.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,59 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.jsp; + +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.portal.jsp.WindowDef; + +/** + * Combines the invocation of a portlet and the info on the portlet JSP ta= g. It does + * not need to be exposed out of this package. + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class WindowResult +{ + + /** . */ + private final WindowDef windowDef; + + /** . */ + private final PortletInvocationResponse response; + + public WindowResult(WindowDef windowDef, PortletInvocationResponse resp= onse) + { + this.windowDef =3D windowDef; + this.response =3D response; + } + + public WindowDef getWindowDef() + { + return windowDef; + } + + public PortletInvocationResponse getResponse() + { + return response; + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/jsp/taglib/AbstractURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/AbstractURLTag.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/AbstractURLTag.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,48 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.jsp.taglib; + +import javax.servlet.jsp.JspException; +import java.util.Map; +import java.util.HashMap; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class AbstractURLTag extends PortalBodyTagSupport +{ + + /** . */ + protected Map params =3D new HashMap(); + + public void setParam(String name, String value) + { + params.put(name, new String[]{value}); + } + + public void doInitBody() throws JspException + { + params.clear(); + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/jsp/taglib/Constants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/Constants.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/Constants.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,65 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.jsp.taglib; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +final class Constants +{ + + private Constants() + { + } + + /** . */ + public static final String ERROR_STATUS =3D "org.jboss.portal.portlet.p= ortal.error.status"; + + /** . */ + public static final String ERROR_CAUSE =3D "org.jboss.portal.portlet.po= rtal.error.cause"; + + /** . */ + public static final String ERROR_MESSAGE =3D "org.jboss.portal.portlet.= portal.error.message"; + + /** . */ + public static final String ERROR_PORTLET_NAME =3D "org.jboss.portal.por= tlet.portal.error.portlet_name"; + + /** . */ + public static final String ERROR_APPLICATION_NAME =3D "org.jboss.portal= .portlet.portal.error.application_name"; + + /** . */ + public static final String ERROR_WINDOW_ID =3D "org.jboss.portal.portle= t.portal.error.window_id"; + + /** . */ + public static final String NOT_FOUND =3D "not_found"; + + /** . */ + public static final String PORTLET_ERROR =3D "portlet_error"; + + /** . */ + public static final String INTERNAL_ERROR =3D "internal_error"; + + /** . */ + public static final String UNAVAILABLE =3D "unavailable"; +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/jsp/taglib/HeadersTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/HeadersTag.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/HeadersTag.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,105 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.jsp.taglib; + +import org.jboss.portal.portlet.portal.jsp.PortalRenderResponse; +import org.jboss.portal.portlet.portal.jsp.WindowResult; +import org.jboss.portal.portlet.portal.jsp.PortalPrepareResponse; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.response.ResponseProperties; +import org.jboss.portal.portlet.invocation.response.ContentResponse; +import org.jboss.portal.common.util.MultiValuedPropertyMap; +import org.jboss.portal.common.xml.XMLTools; +import org.w3c.dom.Element; + +import javax.servlet.jsp.JspException; +import java.io.IOException; +import java.util.List; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class HeadersTag extends PortalSimpleTagSupport +{ + + public HeadersTag() + { + super(false); + } + + public void doTag(PortalPrepareResponse prepareResponse) throws JspExce= ption, IOException + { + } + + public void doTag(PortalRenderResponse renderResponse) throws JspExcept= ion, IOException + { + String maxmizedWindowId =3D renderResponse.getMaximizedWindowId(); + + // + for (String windowId : renderResponse.getWindowIds()) + { + if (maxmizedWindowId =3D=3D null || maxmizedWindowId.equals(windo= wId)) + { + WindowResult result =3D renderResponse.getWindowResult(windowI= d); + + // + if (result !=3D null) + { + PortletInvocationResponse response =3D result.getResponse(); + + // + if (response instanceof ContentResponse) + { + ContentResponse fragmentResponse =3D (ContentResponse)re= sponse; + + // + ResponseProperties properties =3D fragmentResponse.getPr= operties(); + + // + if (properties !=3D null) + { + MultiValuedPropertyMap markupHeaders =3D pro= perties.getMarkupHeaders(); + for (String key : markupHeaders.keySet()) + { + List headElement =3D markupHeaders.getVal= ues(key); + for (Element headerValue : headElement) + { + try + { + String serializedElement =3D XMLTools.toStri= ng(headerValue); + getJspContext().getOut().print(serializedEle= ment); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + } + } + } + } + } + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/jsp/taglib/JspWriterResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/JspWriterResponse.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/JspWriterResponse.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,75 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.jsp.taglib; + +import org.jboss.portal.portlet.portal.jsp.PortalRenderResponse; + +import javax.servlet.http.HttpServletResponseWrapper; +import javax.servlet.jsp.JspWriter; +import javax.servlet.ServletOutputStream; +import java.io.PrintWriter; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +class JspWriterResponse extends HttpServletResponseWrapper +{ + + /** . */ + private final JspWriter delegate; + + /** . */ + private final PrintWriter writer; + + public JspWriterResponse(PortalRenderResponse renderResponse, JspWriter= delegate) + { + super(renderResponse); + + // + this.delegate =3D delegate; + this.writer =3D new PrintWriter(delegate); + } + + public PrintWriter getWriter() throws IOException + { + return writer; + } + + public ServletOutputStream getOutputStream() throws IOException + { + throw new IllegalArgumentException(); + } + + public void resetBuffer() + { + try + { + delegate.clearBuffer(); + } + catch (IOException ignore) + { + } + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/jsp/taglib/PageParamTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/PageParamTag.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/PageParamTag.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,103 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.jsp.taglib; + +import org.jboss.portal.portlet.portal.jsp.PortalRenderResponse; +import org.jboss.portal.portlet.portal.jsp.PortalPrepareResponse; +import org.jboss.portal.portlet.portal.jsp.PageParameterDef; + +import javax.servlet.jsp.JspException; +import javax.xml.namespace.QName; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PageParamTag extends PortalSimpleTagSupport +{ + + /** . */ + private String namespaceURIAttr; + + /** . */ + private String localNameAttr; + + /** . */ + private String valueAttr; + + /** . */ + private String frozenAttr; + + public String getNamespaceURI() + { + return namespaceURIAttr; + } + + public void setNamespaceURI(String namespaceURI) + { + this.namespaceURIAttr =3D namespaceURI; + } + + public String getLocalName() + { + return localNameAttr; + } + + public void setLocalName(String localName) + { + this.localNameAttr =3D localName; + } + + public String getValue() + { + return valueAttr; + } + + public void setValue(String value) + { + this.valueAttr =3D value; + } + + public String getFrozen() + { + return frozenAttr; + } + + public void setFrozen(String frozen) + { + this.frozenAttr =3D frozen; + } + + public void doTag(PortalRenderResponse renderResponse) throws JspExcept= ion, IOException + { + } + + public void doTag(PortalPrepareResponse prepareResponse) throws JspExce= ption, IOException + { + QName name =3D new QName(namespaceURIAttr, localNameAttr); + boolean frozen =3D "true".equals(frozenAttr); + PageParameterDef parameterDef =3D new PageParameterDef(name, valueAt= tr, frozen); + prepareResponse.setPageParameterDef(parameterDef); + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/jsp/taglib/PageTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/PageTag.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/PageTag.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,99 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.jsp.taglib; + +import org.jboss.portal.portlet.portal.jsp.PortalRenderResponse; +import org.jboss.portal.portlet.portal.jsp.PortalPrepareResponse; + +import javax.servlet.jsp.JspException; +import javax.xml.namespace.QName; +import java.io.IOException; +import java.util.Map; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PageTag extends PortalBodyTagSupport +{ + + enum Status + { + ACTIVE, SUSPENDED + } + + /** . */ + Map params; + + /** . */ + String maximizedId; + + /** . */ + String content; + + /** . */ + Status status =3D Status.ACTIVE; + + public int doStartTag(PortalRenderResponse renderResponse) throws JspEx= ception + { + maximizedId =3D renderResponse.getMaximizedWindowId(); + + // + if (maximizedId !=3D null) + { + return EVAL_BODY_BUFFERED; + } + else + { + return EVAL_BODY_INCLUDE; + } + } + + public int doEndTag(PortalRenderResponse renderResponse) throws JspExce= ption + { + if (maximizedId !=3D null) + { + try + { + pageContext.getOut().write(content); + } + catch (IOException e) + { + throw new JspException(e); + } + } + + // + return EVAL_PAGE; + } + + public int doStartTag(PortalPrepareResponse portalResponse) throws JspE= xception + { + return EVAL_BODY_INCLUDE; + } + + public int doEndTag(PortalPrepareResponse portalResponse) throws JspExc= eption + { + return EVAL_PAGE; + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/jsp/taglib/ParamTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/ParamTag.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/ParamTag.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,69 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.jsp.taglib; + +import org.jboss.portal.portlet.portal.jsp.PortalRenderResponse; + +import javax.servlet.jsp.tagext.SimpleTagSupport; +import javax.servlet.jsp.JspException; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ParamTag extends PortalSimpleTagSupport +{ + + /** . */ + private String name; + + /** . */ + private String value; + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name =3D name; + } + + public String getValue() + { + return value; + } + + public void setValue(String value) + { + this.value =3D value; + } + + public void doTag(PortalRenderResponse renderResponse) throws JspExcept= ion, IOException + { + AbstractURLTag urlTag =3D (AbstractURLTag)SimpleTagSupport.findAnces= torWithClass(this, AbstractURLTag.class); + urlTag.setParam(name, value); + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/jsp/taglib/PortalBodyTagSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/PortalBodyTagSupport.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/PortalBodyTagSupport.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,133 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.jsp.taglib; + +import org.jboss.portal.portlet.portal.jsp.PortalRenderResponse; +import org.jboss.portal.portlet.portal.jsp.PortalPrepareResponse; +import org.jboss.portal.portlet.portal.jsp.PortalResponse; +import org.jboss.portal.common.NotYetImplemented; + +import javax.servlet.jsp.tagext.BodyTagSupport; +import javax.servlet.jsp.JspException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortalBodyTagSupport extends BodyTagSupport +{ + + private PortalResponse getPortalResponse() + { + return (PortalResponse)pageContext.getResponse(); + } + + public final int doStartTag() throws JspException + { + return doStartTag(getPortalResponse()); + } + + public final int doEndTag() throws JspException + { + return doEndTag(getPortalResponse()); + } + + public int doStartTag(PortalResponse portalResponse) throws JspException + { + PageTag pageTag =3D (PageTag)findAncestorWithClass(this, PageTag.cla= ss); + + // + if (pageTag =3D=3D null && this instanceof PageTag) + { + pageTag =3D (PageTag)this; + + // + pageTag.status =3D PageTag.Status.ACTIVE; + } + + // + if (pageTag =3D=3D null || pageTag.status !=3D PageTag.Status.ACTIVE) + { + return SKIP_BODY; + } + else + { + if (portalResponse instanceof PortalPrepareResponse) + { + return doStartTag((PortalPrepareResponse)portalResponse); + } + else + { + return doStartTag((PortalRenderResponse)portalResponse); + } + } + } + + public int doEndTag(PortalResponse portalResponse) throws JspException + { + PageTag pageTag =3D (PageTag)findAncestorWithClass(this, PageTag.cla= ss); + + // + if (pageTag =3D=3D null && this instanceof PageTag) + { + pageTag =3D (PageTag)this; + } + + // + if (pageTag !=3D null && pageTag.status =3D=3D PageTag.Status.ACTIVE) + { + if (portalResponse instanceof PortalPrepareResponse) + { + return doEndTag((PortalPrepareResponse)portalResponse); + } + else + { + return doEndTag((PortalRenderResponse)portalResponse); + } + } + else + { + return EVAL_PAGE; + } + } + + public int doStartTag(PortalPrepareResponse prepareResponse) throws Jsp= Exception + { + throw new NotYetImplemented(); + } + + public int doEndTag(PortalPrepareResponse prepareResponse) throws JspEx= ception + { + throw new NotYetImplemented(); + } + + public int doStartTag(PortalRenderResponse renderResponse) throws JspEx= ception + { + throw new NotYetImplemented(); + } + + public int doEndTag(PortalRenderResponse renderResponse) throws JspExce= ption + { + throw new NotYetImplemented(); + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/jsp/taglib/PortalSimpleTagSupport.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/PortalSimpleTagSupport.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/PortalSimpleTagSupport.java 2008-02-29 23:47:01 UTC (rev 101= 61) @@ -0,0 +1,107 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.jsp.taglib; + +import org.jboss.portal.portlet.portal.jsp.PortalRenderResponse; +import org.jboss.portal.portlet.portal.jsp.PortalResponse; +import org.jboss.portal.portlet.portal.jsp.PortalPrepareResponse; +import org.jboss.portal.common.NotYetImplemented; + +import javax.servlet.jsp.tagext.SimpleTagSupport; +import javax.servlet.jsp.PageContext; +import javax.servlet.jsp.JspException; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortalSimpleTagSupport extends SimpleTagSupport +{ + + private final boolean pageScoped; + + public PortalSimpleTagSupport() + { + this(true); + } + + public PortalSimpleTagSupport(boolean pageScoped) + { + this.pageScoped =3D pageScoped; + } + + public boolean isPageScoped() + { + return pageScoped; + } + + private PortalResponse getPortalResponse() + { + PageContext pageContext =3D (PageContext)getJspContext(); + return (PortalResponse)pageContext.getResponse(); + } + + protected final boolean isActive() + { + if (pageScoped) + { + PageTag pageTag =3D (PageTag)findAncestorWithClass(this, PageTag.= class); + + // + return pageTag !=3D null && pageTag.status =3D=3D PageTag.Status.= ACTIVE; + } + else + { + return true; + } + } + + public final void doTag() throws JspException, IOException + { + if (isActive()) + { + PortalResponse portalResponse =3D getPortalResponse(); + + // + if (portalResponse instanceof PortalPrepareResponse) + { + doTag((PortalPrepareResponse)portalResponse); + } + else + { + doTag((PortalRenderResponse)portalResponse); + } + } + } + + public void doTag(PortalPrepareResponse prepareResponse) throws JspExce= ption, IOException + { + throw new NotYetImplemented(); + } + + public void doTag(PortalRenderResponse renderResponse) throws JspExcept= ion, IOException + { + throw new NotYetImplemented(); + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/jsp/taglib/PortletMarkupTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/PortletMarkupTag.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/PortletMarkupTag.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,90 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.jsp.taglib; + +import org.jboss.portal.portlet.portal.jsp.PortalRenderResponse; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.response.ContentResponse; +import org.jboss.portal.portlet.controller.state.WindowNavigationalState; +import org.jboss.portal.WindowState; + +import javax.servlet.jsp.tagext.SimpleTagSupport; +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.JspWriter; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletMarkupTag extends PortalSimpleTagSupport +{ + public void doTag(PortalRenderResponse renderResponse) throws JspExcept= ion, IOException + { + PortletTag portletTag =3D (PortletTag)SimpleTagSupport.findAncestorW= ithClass(this, PortletTag.class); + + PortletInvocationResponse portletResp =3D portletTag.result.getRespo= nse(); + + JspWriter out =3D getJspContext().getOut(); + + if (portletResp !=3D null) + { + if (portletResp instanceof ContentResponse) + { + ContentResponse fragment =3D (ContentResponse)portletResp; + WindowNavigationalState windowNS =3D null; + if (renderResponse.getPageNavigationalState() !=3D null) + { + windowNS =3D renderResponse.getPageNavigationalState().getW= indowNavigationalState(portletTag.result.getWindowDef().getWindowId()); + } + if (windowNS =3D=3D null || !windowNS.getWindowState().equals(= WindowState.MINIMIZED)) + { + if (fragment.getType() !=3D ContentResponse.TYPE_EMPTY) + { + String frag; + if (fragment.getType() =3D=3D ContentResponse.TYPE_BYTES) + { + frag =3D fragment.getBytes().toString(); + } + else + { + frag =3D fragment.getChars(); + } + + out.write(frag); + } + } + } + else + { + out.write(portletResp.getClass().getSimpleName() + "[" + portl= etTag.result.getWindowDef().getPortletName() + "," + portletTag.result.getW= indowDef().getApplicationName() + "]"); + out.flush(); + } + } + else + { + out.write("Empty[" + portletTag.result.getWindowDef().getPortletN= ame() + "," + portletTag.result.getWindowDef().getApplicationName() + "]"); + out.flush(); + } + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/jsp/taglib/PortletTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/PortletTag.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/PortletTag.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,360 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.jsp.taglib; + +import org.jboss.portal.portlet.portal.jsp.PortalRenderResponse; +import org.jboss.portal.portlet.portal.jsp.PortalPrepareResponse; +import org.jboss.portal.portlet.portal.jsp.PortalResponse; +import org.jboss.portal.portlet.portal.jsp.WindowDef; +import org.jboss.portal.portlet.portal.jsp.WindowResult; +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.response.ErrorResponse; +import org.jboss.portal.portlet.invocation.response.UnavailableResponse; +import org.jboss.portal.portlet.invocation.response.ContentResponse; +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; +import org.jboss.portal.common.util.Tools; + +import javax.servlet.jsp.JspException; +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import java.util.LinkedHashSet; +import java.util.Set; +import java.util.Collections; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletTag extends PortalBodyTagSupport +{ + + /** . */ + private static final Set DEFAULT_MODES =3D Collections.unmodifiab= leSet(Tools.toSet(Mode.VIEW, Mode.EDIT, Mode.HELP)); + + /** . */ + private static final Set DEFAULT_WINDOW_STATES =3D Collect= ions.unmodifiableSet(Tools.toSet(WindowState.NORMAL, WindowState.MAXIMIZED,= WindowState.MINIMIZED)); + + /** . */ + private String nameAttr; + + /** . */ + private String applicationNameAttr; + + /** . */ + private String supportedWindowStatesAttr; + + /** . */ + private String supportedModesAttr; + + /** . */ + private String initialModeAttr; + + /** . */ + private String errorPageAttr; + + private Set supportedWindowStates; + private Set supportedModes; + private Mode initialMode; + private PageTag pageTag; + private String windowId; + + WindowResult result; + + public String getName() + { + return nameAttr; + } + + public void setName(String name) + { + this.nameAttr =3D name; + } + + public String getApplicationName() + { + return applicationNameAttr; + } + + public void setApplicationName(String applicationName) + { + this.applicationNameAttr =3D applicationName; + } + + public String getSupportedWindowStates() + { + return supportedWindowStatesAttr; + } + + public void setSupportedWindowStates(String supportedWindowStates) + { + this.supportedWindowStatesAttr =3D supportedWindowStates; + } + + public String getSupportedModes() + { + return supportedModesAttr; + } + + public void setSupportedModes(String supportedModes) + { + this.supportedModesAttr =3D supportedModes; + } + + public String getInitialMode() + { + return initialModeAttr; + } + + public void setInitialMode(String initialMode) + { + this.initialModeAttr =3D initialMode; + } + + public String getErrorPage() + { + return errorPageAttr; + } + + public void setErrorPage(String errorPage) + { + this.errorPageAttr =3D errorPage; + } + + private void initState(PortalResponse portalResponse) + { + // + Set supportedModes =3D new LinkedHashSet(); + if (supportedModesAttr !=3D null) + { + for (String supportedModeValue : supportedModesAttr.split(",")) + { + Mode mode =3D Mode.create(supportedModeValue.trim()); + supportedModes.add(mode); + } + } + else + { + supportedModes =3D DEFAULT_MODES; + } + + // + Set supportedWindowStates =3D new LinkedHashSet(); + if (supportedWindowStatesAttr !=3D null) + { + for (String supportedWindowStateValue : supportedWindowStatesAttr= .split(",")) + { + WindowState windowState =3D WindowState.create(supportedWindow= StateValue.trim()); + supportedWindowStates.add(windowState); + } + } + else + { + supportedWindowStates =3D DEFAULT_WINDOW_STATES; + } + + // + Mode initialMode =3D Mode.VIEW; + if (initialModeAttr !=3D null) + { + initialMode =3D Mode.create(initialModeAttr.trim()); + } + + // + String windowId =3D portalResponse.nextId(); + + // + this.initialMode =3D initialMode; + this.supportedModes =3D supportedModes; + this.supportedWindowStates =3D supportedWindowStates; + this.pageTag =3D (PageTag)findAncestorWithClass(this, PageTag.class); + this.windowId =3D windowId; + } + + private void destroyState() + { + this.initialMode =3D null; + this.supportedModes =3D null; + this.supportedWindowStates =3D null; + this.pageTag =3D null; + this.windowId =3D null; + } + + public int doStartTag(PortalPrepareResponse prepareResponse) throws Jsp= Exception + { + initState(prepareResponse); + + // + WindowDef windowDef =3D new WindowDef(nameAttr, applicationNameAttr,= windowId, initialMode, supportedModes, supportedWindowStates); + + // + prepareResponse.addWindowDef(windowId, windowDef); + + // + return SKIP_BODY; + } + + public int doEndTag(PortalPrepareResponse prepareResponse) throws JspEx= ception + { + destroyState(); + + // + return EVAL_PAGE; + } + + public int doStartTag(PortalRenderResponse renderResponse) throws JspEx= ception + { + initState(renderResponse); + + // + WindowResult result =3D renderResponse.getWindowResult(windowId); + + // + if (result =3D=3D null || result.getResponse() =3D=3D null) + { + handleError(renderResponse, Constants.NOT_FOUND, null, null); + + // We cannot show an absent portlet, no meta data + return SKIP_BODY; + } + else + { + if (pageTag.maximizedId !=3D null) + { + if (windowId.equals(pageTag.maximizedId)) + { + return render(renderResponse, result, EVAL_BODY_BUFFERED); + } + else + { + return SKIP_BODY; + } + } + else + { + return render(renderResponse, result, EVAL_BODY_INCLUDE); + } + } + } + + public int doEndTag(PortalRenderResponse renderResponse) throws JspExce= ption + { + if (bodyContent !=3D null) + { + pageTag.content =3D bodyContent.getString(); + } + + // + destroyState(); + + // + return EVAL_PAGE; + } + + public int render(PortalRenderResponse renderResponse, WindowResult res= ult, int rt) + { + PortletInvocationResponse portletResponse =3D result.getResponse(); + + // + if (portletResponse instanceof ContentResponse) + { + this.result =3D result; + // + return rt; + } + else if (portletResponse instanceof ErrorResponse) + { + ErrorResponse error =3D (ErrorResponse)portletResponse; + + // + handleError(renderResponse, Constants.PORTLET_ERROR, error.getCau= se(), error.getMessage()); + + // + return SKIP_BODY; + } + else if (portletResponse instanceof UnavailableResponse) + { + handleError(renderResponse, Constants.UNAVAILABLE, null, null); + + // + return SKIP_BODY; + } + else + { + handleError(renderResponse, Constants.INTERNAL_ERROR, null, null); + + // + return SKIP_BODY; + } + } + + private void handleError(PortalRenderResponse renderResponse, String er= rorStatus, Throwable cause, String message) + { + if (errorPageAttr !=3D null) + { + RequestDispatcher rd =3D pageContext.getServletContext().getReque= stDispatcher(errorPageAttr); + if (rd !=3D null) + { + ServletRequest request=3D pageContext.getRequest(); + + // + try + { + pageTag.status =3D PageTag.Status.SUSPENDED; + request.setAttribute(Constants.ERROR_STATUS, errorStatus); + request.setAttribute(Constants.ERROR_CAUSE, cause); + request.setAttribute(Constants.ERROR_MESSAGE, message); + request.setAttribute(Constants.ERROR_WINDOW_ID, windowId); + request.setAttribute(Constants.ERROR_APPLICATION_NAME, appl= icationNameAttr); + request.setAttribute(Constants.ERROR_PORTLET_NAME, nameAttr= ); + + // + rd.include(pageContext.getRequest(), new JspWriterResponse(= renderResponse, pageContext.getOut())); + } + catch (ServletException e) + { + // Shall we do smth else ? + e.printStackTrace(); + } + catch (IOException e) + { + // Shall we do smth else ? + e.printStackTrace(); + } + finally + { + pageTag.status =3D PageTag.Status.ACTIVE; + request.removeAttribute(Constants.ERROR_STATUS); + request.removeAttribute(Constants.ERROR_CAUSE); + request.removeAttribute(Constants.ERROR_MESSAGE); + request.removeAttribute(Constants.ERROR_WINDOW_ID); + request.removeAttribute(Constants.ERROR_APPLICATION_NAME); + request.removeAttribute(Constants.ERROR_PORTLET_NAME); + } + } + } + } + +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/jsp/taglib/PortletTitleTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/PortletTitleTag.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/PortletTitleTag.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,56 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.jsp.taglib; + +import org.jboss.portal.portlet.invocation.response.PortletInvocationRespo= nse; +import org.jboss.portal.portlet.invocation.response.FragmentResponse; +import org.jboss.portal.portlet.portal.jsp.PortalRenderResponse; + +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.JspWriter; +import javax.servlet.jsp.tagext.SimpleTagSupport; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletTitleTag extends PortalSimpleTagSupport +{ + + public void doTag(PortalRenderResponse renderResponse) throws JspExcept= ion, IOException + { + + PortletTag portletTag =3D (PortletTag)SimpleTagSupport.findAncestorW= ithClass(this, PortletTag.class); + + PortletInvocationResponse portletResp =3D portletTag.result.getRespo= nse(); + + JspWriter out =3D getJspContext().getOut(); + + if (portletResp instanceof FragmentResponse) + { + FragmentResponse fragment =3D (FragmentResponse)portletResp; + out.write(fragment.getTitle()); + } + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/jsp/taglib/PortletURLTag.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/PortletURLTag.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/jsp/taglib/PortletURLTag.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,145 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.jsp.taglib; + +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; +import org.jboss.portal.portlet.portal.jsp.PortalRenderResponse; +import org.jboss.portal.portlet.portal.jsp.PagePortletControllerContext; +import org.jboss.portal.portlet.controller.impl.PortletURLRenderer; +import org.jboss.portal.portlet.RenderURL; +import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.URLFormat; + +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.JspWriter; +import javax.servlet.jsp.tagext.SimpleTagSupport; +import java.util.Map; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class PortletURLTag extends AbstractURLTag +{ + + /** . */ + private String modeValue; + + /** . */ + private String windowStateValue; + + public String getMode() + { + return modeValue; + } + + public void setMode(String mode) + { + this.modeValue =3D mode; + } + + public String getWindowState() + { + return windowStateValue; + } + + public void setWindowState(String windowState) + { + this.windowStateValue =3D windowState; + } + + public int doStartTag(PortalRenderResponse renderResponse) throws JspEx= ception + { + return EVAL_BODY_BUFFERED; + } + + public int doEndTag(PortalRenderResponse renderResponse) throws JspExce= ption + { + PagePortletControllerContext context =3D renderResponse.getPortletCo= ntrollerContext(); + PortletTag portletTag =3D (PortletTag)SimpleTagSupport.findAncestorW= ithClass(this, PortletTag.class); + + Mode mode =3D null; + if (modeValue !=3D null) + { + mode =3D Mode.create(modeValue.trim()); + } + + // + WindowState windowState =3D null; + if (windowStateValue !=3D null) + { + windowState =3D WindowState.create(windowStateValue.trim()); + } + + PortletURLRenderer renderer =3D new PortletURLRenderer( + renderResponse.getPageNavigationalState(), + context.getClientRequest(), + context.getClientResponse(), + context.getPageNavigationalStateSerialization()); + + final WindowState ws =3D windowState; + final Mode md =3D mode; + + RenderURL url =3D new RenderURL() + { + + + public StateString getNavigationalState() + { + return null; + } + + public Map getPublicNavigationalStateChanges() + { + return params; + } + + public Mode getMode() + { + return md; + } + + public WindowState getWindowState() + { + return ws; + } + }; + + try + { + JspWriter out =3D pageContext.getOut(); + String renderedURL =3D renderer.renderURL(portletTag.result.getWi= ndowDef().getWindowId(), url, new URLFormat(null, null, true, null)); + out.write(renderedURL); + } + catch (IOException e) + { + throw new JspException(e); + } + + // + return EVAL_PAGE; + } + +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/samples/GoogleClippingPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/GoogleClippingPortlet.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/GoogleClippingPortlet.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,178 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.portal.samples; + +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.GenericPortlet; +import javax.portlet.PortletException; +import javax.portlet.PortletMode; +import javax.portlet.PortletPreferences; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import java.io.BufferedInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintWriter; +import java.net.URL; +import java.net.URLConnection; + +/** + * A simple portlet using Google's search services to extract interesting = information (weather, map, ...) from first + * result. + * + * @author Chris Laprun + * @version $Revision: 9912 $ + */ +public class GoogleClippingPortlet extends GenericPortlet +{ + protected static final String A =3D ""; + String end =3D "

    PortletSwap

    +

    PortletSwap

    =

    Po= rtletswap.com is an open community sponsored by JBoss, Inc. to facilitate the exchange of portlets and l= ayouts for use in JBoss Portal.

    Project Informatio= n

    +

    Project Informa= tion

    =

    Learn more about the JBoss= Portal project, on-going development, open issues, and our --===============2509975241632012980==-- From portal-commits at lists.jboss.org Wed Feb 13 14:29:12 2008 Content-Type: multipart/mixed; boundary="===============0935472016399245835==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9955 - in modules/web/trunk: build and 1 other directories. Date: Wed, 13 Feb 2008 14:29:12 -0500 Message-ID: --===============0935472016399245835== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-13 14:29:12 -0500 (Wed, 13 Feb 2008) New Revision: 9955 Modified: modules/web/trunk/build/pom.xml modules/web/trunk/pom.xml modules/web/trunk/web/pom.xml Log: 1.2.0-Beta1 Modified: modules/web/trunk/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/build/pom.xml 2008-02-13 17:34:08 UTC (rev 9954) +++ modules/web/trunk/build/pom.xml 2008-02-13 19:29:12 UTC (rev 9955) @@ -18,7 +18,7 @@ 4.0.0 org.jboss.portal.web module-parent - 1.2.0-SNAPSHOT + 1.2.0-Beta1 pom JBoss Portal Test Module http://www.jboss.com/products/jbossmc @@ -37,7 +37,7 @@ 3.6-beta 2.2.1.GA 1.2.0-Beta1 - 1.2.0-SNAPSHOT + 1.2.0-Beta1 1.2.14 1.1.1 3.0.1 Modified: modules/web/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/pom.xml 2008-02-13 17:34:08 UTC (rev 9954) +++ modules/web/trunk/pom.xml 2008-02-13 19:29:12 UTC (rev 9955) @@ -5,7 +5,7 @@ module-aggregator pom JBoss Portal Web Module - 1.2.0-SNAPSHOT + 1.2.0-Beta1 http://labs.jboss.com/jbossportal = Modified: modules/web/trunk/web/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/web/pom.xml 2008-02-13 17:34:08 UTC (rev 9954) +++ modules/web/trunk/web/pom.xml 2008-02-13 19:29:12 UTC (rev 9955) @@ -3,7 +3,7 @@ org.jboss.portal.web module-parent - 1.2.0-SNAPSHOT + 1.2.0-Beta1 ../build/pom.xml 4.0.0 --===============0935472016399245835==-- From portal-commits at lists.jboss.org Wed Feb 13 14:32:00 2008 Content-Type: multipart/mixed; boundary="===============6989401260623107776==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9956 - modules/web/tags. Date: Wed, 13 Feb 2008 14:32:00 -0500 Message-ID: --===============6989401260623107776== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-13 14:32:00 -0500 (Wed, 13 Feb 2008) New Revision: 9956 Added: modules/web/tags/JBP_WEB_1_2_0_BETA1/ Log: tag web 1.2.0-Beta1 Copied: modules/web/tags/JBP_WEB_1_2_0_BETA1 (from rev 9955, modules/web/tr= unk) --===============6989401260623107776==-- From portal-commits at lists.jboss.org Wed Feb 13 16:05:27 2008 Content-Type: multipart/mixed; boundary="===============6297138728793188123==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9957 - in modules/portlet/trunk: bridge and 7 other directories. Date: Wed, 13 Feb 2008 16:05:27 -0500 Message-ID: --===============6297138728793188123== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-02-13 16:05:27 -0500 (Wed, 13 Feb 2008) New Revision: 9957 Modified: modules/portlet/trunk/bridge/pom.xml modules/portlet/trunk/build/pom.xml modules/portlet/trunk/controller/pom.xml modules/portlet/trunk/federation/pom.xml modules/portlet/trunk/jsr168api/pom.xml modules/portlet/trunk/management/pom.xml modules/portlet/trunk/pom.xml modules/portlet/trunk/portlet/pom.xml modules/portlet/trunk/test/pom.xml Log: update version to 2.0-Beta1 Modified: modules/portlet/trunk/bridge/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/bridge/pom.xml 2008-02-13 19:32:00 UTC (rev 9956) +++ modules/portlet/trunk/bridge/pom.xml 2008-02-13 21:05:27 UTC (rev 9957) @@ -3,7 +3,7 @@ org.jboss.portal.portlet module-parent - 2.0-SNAPSHOT + 2.0-Beta1 ../build/pom.xml 4.0.0 Modified: modules/portlet/trunk/build/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/build/pom.xml 2008-02-13 19:32:00 UTC (rev 9956) +++ modules/portlet/trunk/build/pom.xml 2008-02-13 21:05:27 UTC (rev 9957) @@ -18,10 +18,9 @@ 4.0.0 org.jboss.portal.portlet module-parent - 2.0-SNAPSHOT + 2.0-Beta1 pom JBoss Portal Portlet Module - http://www.jboss.com/products/jbossmc JBoss Portal Portlet Module = Modified: modules/portlet/trunk/controller/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/controller/pom.xml 2008-02-13 19:32:00 UTC (rev 9= 956) +++ modules/portlet/trunk/controller/pom.xml 2008-02-13 21:05:27 UTC (rev 9= 957) @@ -3,7 +3,7 @@ org.jboss.portal.portlet module-parent - 2.0-SNAPSHOT + 2.0-Beta1 ../build/pom.xml 4.0.0 Modified: modules/portlet/trunk/federation/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/federation/pom.xml 2008-02-13 19:32:00 UTC (rev 9= 956) +++ modules/portlet/trunk/federation/pom.xml 2008-02-13 21:05:27 UTC (rev 9= 957) @@ -3,7 +3,7 @@ org.jboss.portal.portlet module-parent - 2.0-SNAPSHOT + 2.0-Beta1 ../build/pom.xml 4.0.0 Modified: modules/portlet/trunk/jsr168api/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/jsr168api/pom.xml 2008-02-13 19:32:00 UTC (rev 99= 56) +++ modules/portlet/trunk/jsr168api/pom.xml 2008-02-13 21:05:27 UTC (rev 99= 57) @@ -3,7 +3,7 @@ org.jboss.portal.portlet module-parent - 2.0-SNAPSHOT + 2.0-Beta1 ../build/pom.xml 4.0.0 Modified: modules/portlet/trunk/management/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/management/pom.xml 2008-02-13 19:32:00 UTC (rev 9= 956) +++ modules/portlet/trunk/management/pom.xml 2008-02-13 21:05:27 UTC (rev 9= 957) @@ -3,7 +3,7 @@ org.jboss.portal.portlet module-parent - 2.0-SNAPSHOT + 2.0-Beta1 ../build/pom.xml 4.0.0 Modified: modules/portlet/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/pom.xml 2008-02-13 19:32:00 UTC (rev 9956) +++ modules/portlet/trunk/pom.xml 2008-02-13 21:05:27 UTC (rev 9957) @@ -5,7 +5,7 @@ module-aggregator pom JBoss Portal Portlet Module Aggregator - 2.0-SNAPSHOT + 2.0-Beta1 http://labs.jboss.com/jbossportal = Modified: modules/portlet/trunk/portlet/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/pom.xml 2008-02-13 19:32:00 UTC (rev 9956) +++ modules/portlet/trunk/portlet/pom.xml 2008-02-13 21:05:27 UTC (rev 9957) @@ -3,7 +3,7 @@ org.jboss.portal.portlet module-parent - 2.0-SNAPSHOT + 2.0-Beta1 ../build/pom.xml 4.0.0 @@ -40,13 +40,13 @@ jaxb-api = - - sun.jdk - tools - 1.5.0 - system - ${JAVA_HOME}/lib/tools.jar - + + + + + + + = Modified: modules/portlet/trunk/test/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/pom.xml 2008-02-13 19:32:00 UTC (rev 9956) +++ modules/portlet/trunk/test/pom.xml 2008-02-13 21:05:27 UTC (rev 9957) @@ -3,7 +3,7 @@ org.jboss.portal.portlet module-parent - 2.0-SNAPSHOT + 2.0-Beta1 ../build/pom.xml 4.0.0 --===============6297138728793188123==-- From portal-commits at lists.jboss.org Wed Feb 13 19:37:37 2008 Content-Type: multipart/mixed; boundary="===============6277455078322425427==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9958 - in modules/portlet/trunk/test/src: test/resources/simple-portal-war/css and 2 other directories. Date: Wed, 13 Feb 2008 19:37:37 -0500 Message-ID: --===============6277455078322425427== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-13 19:37:37 -0500 (Wed, 13 Feb 2008) New Revision: 9958 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/basic/HeaderPortlet.java modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mast= er.css modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o3.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= header.jsp Log: partial refresh portlet updates Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /portal/samples/basic/HeaderPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/HeaderPortlet.java 2008-02-13 21:05:27 UTC (rev 9957) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/HeaderPortlet.java 2008-02-14 00:37:37 UTC (rev 9958) @@ -23,7 +23,10 @@ package org.jboss.portal.portlet.portal.samples.basic; = import org.w3c.dom.Element; +import org.jboss.portal.portlet.ActionURL; +import org.jboss.portal.portlet.RenderURL; = + import javax.portlet.GenericPortlet; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; @@ -31,6 +34,14 @@ import javax.portlet.ResourceRequest; import javax.portlet.ResourceResponse; import javax.portlet.ResourceURL; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.PortletSecurityException; +import javax.portlet.PortletURL; +import javax.portlet.PortletPreferences; +import javax.portlet.PortletMode; import java.io.IOException; import java.io.PrintWriter; = @@ -40,11 +51,29 @@ */ public class HeaderPortlet extends GenericPortlet { + public final static int TITANIUM =3D 0; + public final static int PLATINUM =3D 1; + public final static int GOLD =3D 2; + public final static int SILVER =3D 3; + public final static int TIN =3D 4; + + public void processAction(ActionRequest req, ActionResponse resp) throw= s PortletException, PortletSecurityException, IOException + { + + String repeatText =3D req.getParameter("repeat"); + // set zip as render parameter + if (repeatText !=3D null){ + resp.setRenderParameter("repeat", repeatText); + } + // request view + resp.setPortletMode(PortletMode.VIEW); + + } public void render(RenderRequest req, RenderResponse resp) throws Portl= etException, IOException { ResourceURL resourceURL =3D resp.createResourceURL(); - - // + PortletURL actionURL =3D resp.createActionURL(); + // // Element elt =3D resp.createElement("script"); // elt.setAttribute("type", "text/javascript"); // elt.setAttribute("src", resourceURL.toString()); @@ -52,44 +81,109 @@ // resp.addProperty("script", elt); = // + resp.setContentType("text/html"); PrintWriter writer =3D resp.getWriter(); writer.print("" + "" + - "

    "); + + ""); + + writer.print("" + + "
    " + + "

    Partial Refresh Repeater Demo

    "); + writer.print("" + + "
    " + + "
    \n" + + " Repeat Demo:
    \n= " + + " \n" + + " \n" + + "
    \n" + + "
    " + + ""); + writer.print("
    "); // "" + // "Cl= ick me to trigger script" + + writer.print("


    " + + "

    Partial Refresh Product Catalog

    " + + "
    " + + ""); + writer.print("
    "); resourceURL.setParameter("prodId","1"); - writer.print("Product 1
    "); + writer.print("Product 1
    "); = resourceURL.setParameter("prodId","2"); - writer.print("Product 2
    "); + writer.print("Product 2
    "); = resourceURL.setParameter("prodId","3"); - writer.print("Product 3
    "); + writer.print("Product 3
    "); = - writer.print("
    " + - "
    " + - "
    Product Details
    "); + writer.print("
    "); + writer.print("
    " + + "

    Product Details

    " + + "
    " + + ""); + writer.print("
    "); + writer.print("
    "); + writer.print("
    "); + + + + // writer.print(""); } = public void serveResource(ResourceRequest req, ResourceResponse resp) t= hrows PortletException, IOException { + String repeatText =3D req.getParameter("repeat"); + String prodId =3D req.getParameter("prodId"); + String namespace =3Dresp.getNamespace(); //resp.setContentType("application/json"); resp.setContentType("text/html"); PrintWriter writer =3D resp.getWriter(); + if (repeatText !=3D null){ + writer.print("
    "+ req.getPrivateParamete= rMap().get("repeat")[0] +"
    "); + } + if (prodId !=3D null){ + if (prodId.equals("1")){ + writer.print("
    Product ID: "+ prodId= +"" + + "
    " + + " B BY BURTON ALPHA
    " + + "Sale Price: $314.96 " + + "
    "); + } + if (prodId.equals("2")){ + writer.print("
    Product ID: "+ prodId= +"" + + "
    " + + "FORUM DESTROYER LTD
    " + + "$319.99 " + + "
    "); + } + if (prodId.equals("3")){ + writer.print("
    Product ID: "+ prodId= +"" + + "
    " + + "\n" + + "SANTA CRUZ ALLSTAR
    " + + "$256.00 " + + "
    "); + } = - writer.print("
    " + req.getParameter("prodId") +"
    "); + } = + + + writer.close(); } } Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/c= ss/master.css =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-13 21:05:27 UTC (rev 9957) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-14 00:37:37 UTC (rev 9958) @@ -1,4 +1,5 @@ -body { +body, +div.container { font: normal 12px Lucida Sans, Trebuchet, tahoma, sans-serif; } = @@ -81,6 +82,12 @@ border: 0; } = +.zero { + margin: 0; + padding: 0; + border: 0; +} + body, div, form, Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/demo3.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo3.jsp 2008-02-13 21:05:27 UTC (rev 9957) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo3.jsp 2008-02-14 00:37:37 UTC (rev 9958) @@ -8,6 +8,7 @@ = + = Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/l= ayouts/header.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /header.jsp 2008-02-13 21:05:27 UTC (rev 9957) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /header.jsp 2008-02-14 00:37:37 UTC (rev 9958) @@ -3,7 +3,7 @@ - + Portlet Container 2.0 --===============6277455078322425427==-- From portal-commits at lists.jboss.org Wed Feb 13 20:02:59 2008 Content-Type: multipart/mixed; boundary="===============8064611263779887427==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9959 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Wed, 13 Feb 2008 20:02:56 -0500 Message-ID: --===============8064611263779887427== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-13 20:02:56 -0500 (Wed, 13 Feb 2008) New Revision: 9959 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: 5.2.1.5. Building your Portlet 5.2.1.6. Deploying your Portlet revising and fixing up the spelling errors I introduced Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-14 00:37:37 UTC (rev 9958) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-14 01:02:56 UTC (rev 9959) @@ -142,7 +142,7 @@ Introduction This section details deploying your first portlet in JBoss Portal. B= efore proceeding, download the HelloWorldPorlet from JBoss PortletSwap. + url=3D"http://anonsvn.jboss.org/repos/portletswap/portle= ts/2_6/bundles/HelloWorldPortlet.zip">HelloWorldPortlet from JBoss PortletSwap. @@ -521,7 +521,7 @@ Building your Portlet - A pre-compiled HelloWorldPortlet/helloworldportlet.war file is created after extracting the HelloWorldPorlet.zip= file. To manually build the helloworldportlet.war file: + A pre-compiled HelloWorldPortlet/helloworldportlet.war file is created after extracting the HelloWorldPortlet.zi= p file. To manually build the helloworldportlet.war file: @@ -545,7 +545,7 @@ - Expanding the helloworldportlet.war allows you = to deploy the portlet as an expanded directory, which makes development eas= ier. As well, it gives you access to the XML descriptors, resource files, J= SF, and JSP pages. To expand the helloworldportlet.war= file: + Expanding the helloworldportlet.war file allows= you to deploy the portlet as an expanded directory, which makes developmen= t easier. As well, it gives you access to the XML descriptors, resource fil= es, JSF, and JSP pages. To expand the helloworldportlet.war file: @@ -583,26 +583,49 @@ - Deploying your portlet + Deploying your Portlet - Deploying a portlet is as simple as copying/moving helloworldportlet.war - to your server deploy directory. Doing t= his on a running instance of JBoss Portal and - application server, will trigger a hot-deploy of your portlet: - = - Pointing your browser to http://localhost:8080/portal/, - should yield a view of our HelloWorldPortlet, added to the = default page of Portal: - = - + If you did not expand the helloworldportlet.war f= ile, copy the HelloWorldPortlet/helloworldportlet.war = file into the correct JBoss AS or JBoss EAP deploy/ di= rectory. If you expanded the helloworldportlet.war fil= e, copy the HelloWorldPortlet/output/lib/exploded/helloworldportl= et.war/ directory into the correct JBoss AS or JBoss EAP deploy/ directory. For example, if you are using JBoss AS, co= py the file or directory into the $JBOSS_HOME/server/default/depl= oy/ directory. + + + Performing this step on a running instance of JBoss AS or JBoss EAP,= and JBoss Portal, will trigger a hot-deploy of the portlet: + + + + + + + To see the HelloWorldPortlet, navigate to http://localhost:8080/portal/, or, if the main JB= oss Portal page is already open, refresh the page. The HelloWorldPortlet is= added to the default page of JBoss Portal: + + - + + To re-deploy the portlet, for example, if you have made changes to a= ny of the XML descriptors, touch the $JBOSS_HOME/server/configuration/deploy/helloworldportlet.war/WEB-INF/web.xm= l file. On Linux, run the following command to re-deploy the Hel= loWorldPortlet: + + + +touch $JBOSS_HOME/server/configuration/deploy/h= elloworldportlet.war/WEB-INF/web.xml + + + + Re-deploying the HelloWorldPortlet will produce the following output = on the JBoss AS or JBoss EAP console: + + + + + + A Simple JSP Portlet --===============8064611263779887427==-- From portal-commits at lists.jboss.org Wed Feb 13 20:24:02 2008 Content-Type: multipart/mixed; boundary="===============5678491002320575496==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9960 - modules/portlet/trunk/test/src/test. Date: Wed, 13 Feb 2008 20:24:02 -0500 Message-ID: --===============5678491002320575496== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-13 20:24:02 -0500 (Wed, 13 Feb 2008) New Revision: 9960 Modified: modules/portlet/trunk/test/src/test/build.xml Log: - Now rename Tomcat lib directory to the more explicit copy-to-tomcat-lib. = - Commented out AS 5 references for now. Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-14 01:02:56 UTC (= rev 9959) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-14 01:24:02 UTC (= rev 9960) @@ -712,14 +712,14 @@ - + = = @@ -772,6 +772,9 @@ + + + = --===============5678491002320575496==-- From portal-commits at lists.jboss.org Wed Feb 13 20:26:47 2008 Content-Type: multipart/mixed; boundary="===============8983591464016881099==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9961 - in modules/portlet/trunk/docs: common and 4 other directories. Date: Wed, 13 Feb 2008 20:26:46 -0500 Message-ID: --===============8983591464016881099== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-13 20:26:46 -0500 (Wed, 13 Feb 2008) New Revision: 9961 Added: modules/portlet/trunk/docs/common/ modules/portlet/trunk/docs/common/en/ modules/portlet/trunk/docs/common/en/images/ modules/portlet/trunk/docs/common/en/images/forward.png modules/portlet/trunk/docs/common/en/images/frontpage.png modules/portlet/trunk/docs/common/en/images/messagebox_info.png modules/portlet/trunk/docs/common/en/images/messagebox_warning.png modules/portlet/trunk/docs/common/en/images/previous.png modules/portlet/trunk/docs/common/en/images/renaissance/ modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_Add.g= if modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_Creat= eInstance.gif modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_Delet= e.gif modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_Detai= ls.gif modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_IsDef= ault.gif modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_Layou= t.gif modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_MakeD= efault.gif modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_MoveD= own.gif modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_MoveU= p.gif modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_Prope= rties.gif modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_Renam= e.gif modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_Secur= ity.gif modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_Theme= .gif modules/portlet/trunk/docs/common/en/images/renaissance/animated_favicon= 1.gif modules/portlet/trunk/docs/common/en/images/renaissance/favicon.ico modules/portlet/trunk/docs/common/en/images/renaissance/header_bg.gif modules/portlet/trunk/docs/common/en/images/renaissance/homeimg_cornerel= ement.gif modules/portlet/trunk/docs/common/en/images/renaissance/ico_16_help.gif modules/portlet/trunk/docs/common/en/images/renaissance/ico_16_maximize.= gif modules/portlet/trunk/docs/common/en/images/renaissance/ico_16_minimize.= gif modules/portlet/trunk/docs/common/en/images/renaissance/ico_16_normal.gif modules/portlet/trunk/docs/common/en/images/renaissance/ico_16_reload.gif modules/portlet/trunk/docs/common/en/images/renaissance/ico_16_remove.gif modules/portlet/trunk/docs/common/en/images/renaissance/ico_16_swizzlecl= osed.gif modules/portlet/trunk/docs/common/en/images/renaissance/ico_16_swizzleop= en.gif modules/portlet/trunk/docs/common/en/images/renaissance/ico_addcontent.g= if modules/portlet/trunk/docs/common/en/images/renaissance/ico_admin.gif modules/portlet/trunk/docs/common/en/images/renaissance/ico_arrow_blue_l= eft.gif modules/portlet/trunk/docs/common/en/images/renaissance/ico_arrow_blue_r= ight.gif modules/portlet/trunk/docs/common/en/images/renaissance/ico_arrow_grey_l= eft.gif modules/portlet/trunk/docs/common/en/images/renaissance/ico_arrow_grey_r= ight.gif modules/portlet/trunk/docs/common/en/images/renaissance/ico_cancel.gif modules/portlet/trunk/docs/common/en/images/renaissance/ico_edit.gif modules/portlet/trunk/docs/common/en/images/renaissance/ico_listelement.= gif modules/portlet/trunk/docs/common/en/images/renaissance/logo.gif modules/portlet/trunk/docs/common/en/images/renaissance/msgIcon_Warning.= gif modules/portlet/trunk/docs/common/en/images/renaissance/objectPath_Arrow= .gif modules/portlet/trunk/docs/common/en/images/renaissance/pathBackground.p= ng modules/portlet/trunk/docs/common/en/images/renaissance/pathSeparator.png modules/portlet/trunk/docs/common/en/images/renaissance/portlet-bottom-l= eft.gif modules/portlet/trunk/docs/common/en/images/renaissance/portlet-bottom-m= iddle.gif modules/portlet/trunk/docs/common/en/images/renaissance/portlet-bottom-r= ight.gif modules/portlet/trunk/docs/common/en/images/renaissance/portlet-left-ver= tical.gif modules/portlet/trunk/docs/common/en/images/renaissance/portlet-right-ve= rtical.gif modules/portlet/trunk/docs/common/en/images/renaissance/portlet-top-left= .gif modules/portlet/trunk/docs/common/en/images/renaissance/portlet-top-midd= le.gif modules/portlet/trunk/docs/common/en/images/renaissance/portlet-top-righ= t.gif modules/portlet/trunk/docs/common/en/images/renaissance/spacer.gif modules/portlet/trunk/docs/common/en/images/renaissance/tab_left.gif modules/portlet/trunk/docs/common/en/images/renaissance/tab_left_admin.g= if modules/portlet/trunk/docs/common/en/images/renaissance/tab_left_current= .gif modules/portlet/trunk/docs/common/en/images/renaissance/tab_left_hover2.= gif modules/portlet/trunk/docs/common/en/images/renaissance/tab_right.gif modules/portlet/trunk/docs/common/en/images/renaissance/tab_right_admin.= gif modules/portlet/trunk/docs/common/en/images/renaissance/tab_right_curren= t.gif modules/portlet/trunk/docs/common/en/images/renaissance/tab_right_hover2= .gif modules/portlet/trunk/docs/common/en/images/renaissance/tab_swizzle.gif Modified: modules/portlet/trunk/docs/user-guide/build.xml Log: - Made doc build more specific. - Added common directory for doc images. Added: modules/portlet/trunk/docs/common/en/images/forward.png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/forward.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: modules/portlet/trunk/docs/common/en/images/frontpage.png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/frontpage.= png ___________________________________________________________________ Name: svn:mime-type + image/png Added: modules/portlet/trunk/docs/common/en/images/messagebox_info.png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/messagebox= _info.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: modules/portlet/trunk/docs/common/en/images/messagebox_warning.png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/messagebox= _warning.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: modules/portlet/trunk/docs/common/en/images/previous.png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/previous.p= ng ___________________________________________________________________ Name: svn:mime-type + image/png Added: modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_A= dd.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/actionIcon_Add.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_C= reateInstance.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/actionIcon_CreateInstance.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_D= elete.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/actionIcon_Delete.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_D= etails.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/actionIcon_Details.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_I= sDefault.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/actionIcon_IsDefault.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_L= ayout.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/actionIcon_Layout.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_M= akeDefault.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/actionIcon_MakeDefault.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_M= oveDown.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/actionIcon_MoveDown.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_M= oveUp.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/actionIcon_MoveUp.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_P= roperties.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/actionIcon_Properties.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_R= ename.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/actionIcon_Rename.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_S= ecurity.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/actionIcon_Security.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/actionIcon_T= heme.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/actionIcon_Theme.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/animated_fav= icon1.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/animated_favicon1.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/favicon.ico =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/favicon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/header_bg.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/header_bg.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/homeimg_corn= erelement.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/homeimg_cornerelement.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/ico_16_help.= gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/ico_16_help.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/ico_16_maxim= ize.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/ico_16_maximize.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/ico_16_minim= ize.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/ico_16_minimize.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/ico_16_norma= l.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/ico_16_normal.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/ico_16_reloa= d.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/ico_16_reload.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/ico_16_remov= e.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/ico_16_remove.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/ico_16_swizz= leclosed.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/ico_16_swizzleclosed.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/ico_16_swizz= leopen.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/ico_16_swizzleopen.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/ico_addconte= nt.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/ico_addcontent.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/ico_admin.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/ico_admin.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/ico_arrow_bl= ue_left.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/ico_arrow_blue_left.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/ico_arrow_bl= ue_right.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/ico_arrow_blue_right.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/ico_arrow_gr= ey_left.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/ico_arrow_grey_left.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/ico_arrow_gr= ey_right.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/ico_arrow_grey_right.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/ico_cancel.g= if =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/ico_cancel.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/ico_edit.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/ico_edit.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/ico_listelem= ent.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/ico_listelement.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/logo.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/logo.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/msgIcon_Warn= ing.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/msgIcon_Warning.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/objectPath_A= rrow.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/objectPath_Arrow.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/pathBackgrou= nd.png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/pathBackground.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: modules/portlet/trunk/docs/common/en/images/renaissance/pathSeparato= r.png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/pathSeparator.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: modules/portlet/trunk/docs/common/en/images/renaissance/portlet-bott= om-left.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/portlet-bottom-left.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/portlet-bott= om-middle.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/portlet-bottom-middle.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/portlet-bott= om-right.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/portlet-bottom-right.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/portlet-left= -vertical.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/portlet-left-vertical.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/portlet-righ= t-vertical.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/portlet-right-vertical.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/portlet-top-= left.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/portlet-top-left.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/portlet-top-= middle.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/portlet-top-middle.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/portlet-top-= right.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/portlet-top-right.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/spacer.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/spacer.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/tab_left.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/tab_left.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/tab_left_adm= in.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/tab_left_admin.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/tab_left_cur= rent.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/tab_left_current.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/tab_left_hov= er2.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/tab_left_hover2.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/tab_right.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/tab_right.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/tab_right_ad= min.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/tab_right_admin.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/tab_right_cu= rrent.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/tab_right_current.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/tab_right_ho= ver2.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/tab_right_hover2.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/docs/common/en/images/renaissance/tab_swizzle.= gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/docs/common/en/images/renaissanc= e/tab_swizzle.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: modules/portlet/trunk/docs/user-guide/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/docs/user-guide/build.xml 2008-02-14 01:24:02 UTC= (rev 9960) +++ modules/portlet/trunk/docs/user-guide/build.xml 2008-02-14 01:26:46 UTC= (rev 9961) @@ -1,26 +1,28 @@ - + = - - + + = - - + + = - - - - - + + + + + = - - - - = - + + + + + = + + --===============8983591464016881099==-- From portal-commits at lists.jboss.org Wed Feb 13 20:28:19 2008 Content-Type: multipart/mixed; boundary="===============7232256687278022764==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9962 - modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo. Date: Wed, 13 Feb 2008 20:28:19 -0500 Message-ID: --===============7232256687278022764== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-13 20:28:19 -0500 (Wed, 13 Feb 2008) New Revision: 9962 Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o1.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/hom= e.jsp Log: - Added some content for home page. Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/demo1.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo1.jsp 2008-02-14 01:26:46 UTC (rev 9961) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo1.jsp 2008-02-14 01:28:19 UTC (rev 9962) @@ -9,12 +9,12 @@ - - - - - - + + + + + + = Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/home.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/ho= me.jsp 2008-02-14 01:26:46 UTC (rev 9961) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/ho= me.jsp 2008-02-14 01:28:19 UTC (rev 9962) @@ -1,20 +1,45 @@ <%@ page contentType=3D"text/html" %> -<%@ page language=3D"java" %> -<%@ taglib prefix=3D"jbp" tagdir=3D"/WEB-INF/tags/portal" %> -<%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> -<%@ page isELIgnored=3D"false" %> +<%@ include file=3D"/layouts/header.jsp" %> = - <%@ include file=3D"/layouts/header.jsp" %> = - - - + +

    JBo= ss Portlet Container is the next generation + portlet container on which future versions of JBoss Portal will be base= d. It provides a standard-compliant + implementation of the JSR-286 Portlet 2.0 specification. It has been de= veloped with reusability in mind so that + advanced users, who don't require a full-fledged portal, can leverage t= he portlet management services it provides in + their own applications. JBoss Portlet Container is available through th= e business-friendly LGPL open source license. +

    = -
    - +

    This simple portal is a demonstration of what can be achieved reasonabl= y quickly by leveraging JBoss Portlet + Container.

    = -
    -
    -
    + + + + + + +

    Support Services

    = - <%@ include file=3D"/layouts/footer.jsp" %> \ No newline at end of file +

    JBoss (a division of Red Hat Inc.) offers various support serv= ices tailored to fit your needs. + E= xplore support and service options for + JBoss Portal.

    +

    PortletSwap

    + +

    Portle= tswap.com is an open community sponsored + by JBoss to facilitate the exchange of portlets that can be us= ed with JBoss Portlet Container and JBoss + Portal.

    +

    Project Information

    + +

    Learn more about JBoss Portlet Container + community project, JBoss Portal, + JBoss Portal platform

    +
    + +

    Thank you for downloading and deploying JBoss Portlet Container. We hop= e your enjoy working with it as much as we + enjoy developing it!

    + +

    Baci e abbracci,
    + The JBoss Portal Team.

    + +<%@ include file=3D"/layouts/footer.jsp" %> \ No newline at end of file --===============7232256687278022764==-- From portal-commits at lists.jboss.org Wed Feb 13 20:28:52 2008 Content-Type: multipart/mixed; boundary="===============4325423671310929528==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9963 - in modules/portlet/trunk/build: distrib and 1 other directory. Date: Wed, 13 Feb 2008 20:28:51 -0500 Message-ID: --===============4325423671310929528== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-13 20:28:51 -0500 (Wed, 13 Feb 2008) New Revision: 9963 Added: modules/portlet/trunk/build/distrib/ modules/portlet/trunk/build/distrib/README.txt modules/portlet/trunk/build/distrib/distrib.xml Log: - Started distribution build. Added: modules/portlet/trunk/build/distrib/README.txt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/build/distrib/README.txt = (rev 0) +++ modules/portlet/trunk/build/distrib/README.txt 2008-02-14 01:28:51 UTC = (rev 9963) @@ -0,0 +1,15 @@ + +JBoss Portlet Container +LGPL Licensed (See http://www.gnu.org/copyleft/lesser.html for details on = the product usage) + +JBoss Portlet Container is the next generation portlet container on which = future versions of JBoss +Portal will be based. It provides a standard-compliant implementation of t= he JSR-286 Portlet 2.0 = +specification. It has been developed with reusability in mind so that adva= nced users, who don't require +a full-fledged portal, can leverage the portlet management services it pro= vides in their own applications. +JBoss Portlet Container is available through the business-friendly LGPL op= en source license. + +This distribution also contains a simple portal built on top of JBoss Port= let Container. This simple +portal can be run on Tomcat 6.x and JBoss Application Server 4.2.x. + +INSTALLATION AND RUNNING: +For installation, please refer to the user guide available in the 'docs' d= irectory \ No newline at end of file Property changes on: modules/portlet/trunk/build/distrib/README.txt ___________________________________________________________________ Name: svn:eol-style + native Added: modules/portlet/trunk/build/distrib/distrib.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/build/distrib/distrib.xml = (rev 0) +++ modules/portlet/trunk/build/distrib/distrib.xml 2008-02-14 01:28:51 UTC= (rev 9963) @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: modules/portlet/trunk/build/distrib/distrib.xml ___________________________________________________________________ Name: svn:executable + * --===============4325423671310929528==-- From portal-commits at lists.jboss.org Wed Feb 13 21:01:33 2008 Content-Type: multipart/mixed; boundary="===============0829159592480603024==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9964 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples. Date: Wed, 13 Feb 2008 21:00:30 -0500 Message-ID: --===============0829159592480603024== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-13 21:00:29 -0500 (Wed, 13 Feb 2008) New Revision: 9964 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/RemoteControlResourcePortlet.java Log: - Fixed remote control window that was still referencing /simple context. - Use namespace for javascript functions. Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /portal/samples/RemoteControlResourcePortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/RemoteControlResourcePortlet.java 2008-02-14 01:28:51 UTC (rev 99= 63) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/RemoteControlResourcePortlet.java 2008-02-14 02:00:29 UTC (rev 99= 64) @@ -31,9 +31,11 @@ { renderResponse.setContentType("text/html"); PrintWriter printWriter =3D renderResponse.getWriter(); - printWriter.print(""); - printWriter.print("

    function " + nam= espace + + "_openRemote(url){window.name=3D'" + namespace + "_parent';wind= ow.open(url, '" + namespace + + "_remote', 'width=3D400,height=3D200,scrollable=3Dyes')}"); + printWriter.print("

    Open remote control!

    "); @@ -47,19 +49,20 @@ { resourceResponse.setContentType("text/html"); PrintWriter writer =3D resourceResponse.getWriter(); + String namespace =3D resourceResponse.getNamespace(); // resourceRequest.getPreferences().setValue("color", COLORS[COLOR_IN= DEX++ % 8]); - writer.print("" + - ""); + writer.print("\n"); PortletURL url =3D resourceResponse.createRenderURL(); url.setWindowState(WindowState.MINIMIZED); writer.print("
    • minimize parent portlet
    • "); + " src=3D\"/simple-portal/images/icon-minim= ize.gif\" alt=3D\"\"/> minimize parent portlet"); url.setWindowState(WindowState.MAXIMIZED); writer.print("
    • maximize parent portlet
    • "); + " src=3D\"/simple-portal/images/icon-maxim= ize.gif\" alt=3D\"\"/> maximize parent portlet"); url.setWindowState(WindowState.NORMAL); writer.print("
    • make parent portlet normal
    "); + " src=3D\"/simple-portal/images/icon-norma= l.gif\" alt=3D\"\"/> make parent portlet normal"); writer.print("
    • 'zipcode' public render parameter = value: " + resourceRequest.getParameter(ZIPCODE) + "
      "); writer.print("Set value of 'zipcode' public render parameter = to:
    • "); url.setParameter(ZIPCODE, "80201"); --===============0829159592480603024==-- From portal-commits at lists.jboss.org Wed Feb 13 22:01:13 2008 Content-Type: multipart/mixed; boundary="===============6628991230708158424==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9965 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Wed, 13 Feb 2008 22:01:12 -0500 Message-ID: --===============6628991230708158424== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-13 22:01:12 -0500 (Wed, 13 Feb 2008) New Revision: 9965 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configur= ation.xml docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installa= tion.xml docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: 5.2.1.6. Deploying your Portlet revising section updating previous pages with ulinks to localhost:8080/portal Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/c= onfiguration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configu= ration.xml 2008-02-14 02:00:29 UTC (rev 9964) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configu= ration.xml 2008-02-14 03:01:12 UTC (rev 9965) @@ -38,7 +38,7 @@ - Root user Privileges + Root User Privileges Linux systems require root user privileges to run a server on a p= ort less than 1024. Starting JBoss EAP or JBoss AS on port 80 as a non-priv= ileged user will not work. Running JBoss EAP or JBoss AS as the root user c= ould lead to security breaches. Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/i= nstallation.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-14 02:00:29 UTC (rev 9964) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/install= ation.xml 2008-02-14 03:01:12 UTC (rev 9965) @@ -30,7 +30,7 @@ - Log in to JBoss Portal: using = a Web browser, navigate to http://localhost:8080/portal to open the JBoss Portal homepage. Log in using one of the tw= o default accounts: username user, password = user, or username admin, password admin. + Log in to JBoss Portal: using = a Web browser, navigate to to open the JBoss Portal homepage. Log in using one of the two default= accounts: username user, password user, or username admin, password admin. @@ -166,7 +166,7 @@ - Log in to JBoss Portal: using a Web= browser, navigate to http://localhost:8080/portal to open the JBoss Portal homepage. Log in using one of the two def= ault accounts: username user, password user<= /emphasis>, or username admin, password admi= n: + Log in to JBoss Portal: using a Web= browser, navigate to = to open the JBoss Portal homepage. Log in using one of the two default acco= unts: username user, password user, or username admin, password admin: @@ -259,7 +259,7 @@ - If the source files were obtained from SVN, change into the trunk/src/ directory to see the directories from the above ima= ge. As well, there will be an empty thirdparty directo= ry. This directory will contain files after building the JBoss Portal sourc= e code (). For more info= rmation about the JBoss Portal SVN repository, and accessing different vers= ions of the JBoss Portal codebase, please visit the JBoss Portal SVN Repo page on the JBoss Wiki. + If the source files were obtained from SVN, change into the trunk/src/ directory to see the directories from the above ima= ge. As well, there will be an empty thirdparty directo= ry. This directory will contain files after building the JBoss Portal sourc= e code (see ). For more = information about the JBoss Portal SVN repository, and accessing different = versions of the JBoss Portal codebase, please visit the JBoss Portal SVN Repo<= /ulink> page on the JBoss Wiki. @@ -482,7 +482,7 @@ - Log in to JBoss Portal: usin= g a Web browser, navigate to http://localhost:8080/portal to open the JBoss Portal homepage. Log in using one of the = two default accounts: username user, password user, or username admin, password admin: + Log in to JBoss Portal: usin= g a Web browser, navigate to to open the JBoss Portal homepage. Log in using one of the two defau= lt accounts: username user, password user, or username admin, password admin<= /emphasis>: Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-14 02:00:29 UTC (rev 9964) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-14 03:01:12 UTC (rev 9965) @@ -532,6 +532,11 @@ + If required, edit the HelloWorldPortlet/src/main/org/jb= oss/portlet/hello/HelloWorldPortlet.java file, and the XML descr= iptors in the HelloWorldPortlet/src/resources/helloworldportlet-w= ar/WEB-INF/ directory. + + + + Run the ant deploy command: @@ -585,7 +590,7 @@ Deploying your Portlet - If you did not expand the helloworldportlet.war f= ile, copy the HelloWorldPortlet/helloworldportlet.war = file into the correct JBoss AS or JBoss EAP deploy/ di= rectory. If you expanded the helloworldportlet.war fil= e, copy the HelloWorldPortlet/output/lib/exploded/helloworldportl= et.war/ directory into the correct JBoss AS or JBoss EAP deploy/ directory. For example, if you are using JBoss AS, co= py the file or directory into the $JBOSS_HOME/server/default/depl= oy/ directory. + If you did not expand the helloworldportlet.war f= ile, copy the HelloWorldPortlet/helloworldportlet.war = file into the correct JBoss AS or JBoss EAP deploy/ di= rectory. If you expanded the helloworldportlet.war fil= e, copy the HelloWorldPortlet/output/lib/exploded/helloworldportl= et.war/ directory into the correct JBoss AS or JBoss EAP deploy/ directory. For example, if you are using JBoss AS, co= py the war file or the expanded directory into the $JBOSS_HOME/se= rver/default/deploy/ directory. Performing this step on a running instance of JBoss AS or JBoss EAP,= and JBoss Portal, will trigger a hot-deploy of the portlet: @@ -593,11 +598,11 @@ +warUrl=3D.../tmp/deploy/tmp35219helloworldportlet-exp.war/]]> - To see the HelloWorldPortlet, navigate to http://localhost:8080/portal/, or, if the main JB= oss Portal page is already open, refresh the page. The HelloWorldPortlet is= added to the default page of JBoss Portal: + To see the HelloWorldPortlet, navigate to http://localhost:8080/portal/, or, if the default= JBoss Portal page is already open, refresh the page. The HelloWorldPortlet= is added to the default JBoss Portal page: @@ -615,7 +620,7 @@ - Re-deploying the HelloWorldPortlet will produce the following output = on the JBoss AS or JBoss EAP console: + Re-deploying the HelloWorldPortlet will produce output to the JBoss A= S or JBoss EAP console, similar to the following: --===============2434503316584890184== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-14 02:17:39 -0500 (Thu, 14 Feb 2008) New Revision: 9966 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: minor revisions for: 5.2.2. An Example JSP Portlet 5.2.2.1. Introduction 5.2.2.2. Package Content Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-14 03:01:12 UTC (rev 9965) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-14 07:17:39 UTC (rev 9966) @@ -141,7 +141,7 @@ Introduction - This section details deploying your first portlet in JBoss Portal. B= efore proceeding, download the HelloWorldPortlet from JBoss PortletSwap. @@ -264,7 +264,7 @@ - The following is an example of the HelloWorldPortlet/WEB-IN= F/portlet.xml file. Note: in order to create the WEB-I= NF and META-INF directories, extract the helloworldportlet.war file: + The following is an example of the HelloWorldPortlet/WEB-IN= F/portlet.xml file: - This file must adhere to its definition in the JSR-168 Portlet Specifica= tion. You may define more than one portlet application in this file. + In order to create the WEB-INF and META-I= NF directories, extract the helloworldportlet.war file.This file must adhere to its definition in the JSR-168 Portlet = Specification. You may define more than one portlet application in this fil= e. @@ -597,12 +597,12 @@ - To see the HelloWorldPortlet, navigate to http://localhost:8080/portal/, or, if the default= JBoss Portal page is already open, refresh the page. The HelloWorldPortlet= is added to the default JBoss Portal page: + To see the HelloWorldPortlet, navigate to http://localhost:8080/portal/, or, if the default= JBoss Portal page is already open, refresh the page. The HelloWorldPortlet= is added to the bottom of the default JBoss Portal page: @@ -626,39 +626,34 @@ - A Simple JSP Portlet + An Example JSP Portlet Introduction - This section will introduce the reader to deploying a si= mple JSP portlet in JBoss Portal. It requires - you download the HelloWorldJSPPortlet from PortletSwap.com,= using this - - link. + + This section describes how to deploy a JSP portlet in JBoss Portal. = Before proceeding, download the HelloWorldJSPP= ortlet from JBoss= PortletSwap. The HelloWorldJSPPortlet demonstrates how to use JSPs= for view rendering, and the portlet taglib for generating links. - - This portlet will introduce you to using JSPs for view rend= ering and the portlet taglib for generating - links. - - Package content + Package Content - The application descriptors for this portlet are similar to= the ones we saw in - . See the chapter on - descriptors for more details. + The application descriptors for the HelloWorldJSPPortlet portlet are= similar to those from the HelloWorldPortlet (). See for further = details about application descriptors. + + + The following is an example of the directory structure of the HelloW= orldJSPPortlet portlet. The HelloWorldJSPPortlet portlet contains the tradi= tional portlet and JBoss Portal specific application descriptors: + + - As you can see in the figure above, the package content is = what you'd expect from a traditional web - application augmented with the portlet- and JBoss Portal-sp= ecific application descriptors. --===============2434503316584890184==-- From portal-commits at lists.jboss.org Thu Feb 14 03:06:19 2008 Content-Type: multipart/mixed; boundary="===============3359256899643538263==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9967 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Thu, 14 Feb 2008 03:06:19 -0500 Message-ID: --===============3359256899643538263== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-14 03:06:18 -0500 (Thu, 14 Feb 2008) New Revision: 9967 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: revising 5.2.2.3. Portlet Class with variablelists. Periodic backup. This will break the book until later commits. Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-14 07:17:39 UTC (rev 9966) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-14 08:06:18 UTC (rev 9967) @@ -659,12 +659,11 @@ Portlet Class - Included in the - download bundle you should have one java source fil= e: - HelloWorldJSPPortlet\src\main\org\jboss\portlet\he= llo\HelloWorldJSPPortlet.java, - containing the following: - HelloWorldJSPPortlet contai= ns a HelloWorldJSPPortlet/src/main/org/jboss/portlet/hello/HelloW= orldJSPPortlet.java file: + + + - Now let's look at some of our methods: - - - - + + + + + - Support for these Modes must be declared in the po= rtlet.xml. They will be triggered when a user - clicks on the respective icons in the portlet wind= ow titlebar, or through generated links within - the portlet. - - - - - + + + + Support for these modes must be declared in the HelloWorldJSPP= ortlet/WEB-INF/portlet.xml file. They will be triggered when a u= ser clicks on the respective icons in the portlet window titlebar, or throu= gh generated links within the portlet. + + + + + - This method will be triggered upon clicking on an = ActionURL from our - view.jsp. It will retrieve yourname from the HTML form, +}]]> + + + + This method is triggered when a user clicks on an action= URL, which is defined in the HelloWorldJSPPortle= t/WEB-INF/jsp/view.jsp file. This retrieves your= name from the HTML form, and passes it as a rende= rParameter to the doView() method. + + + + = + It will retrieve yourname from the HTML form, and pass it along as a renderParameter to the doView() method. --===============3359256899643538263==-- From portal-commits at lists.jboss.org Thu Feb 14 03:46:35 2008 Content-Type: multipart/mixed; boundary="===============2404185924936327495==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9968 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Thu, 14 Feb 2008 03:46:35 -0500 Message-ID: --===============2404185924936327495== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-14 03:46:35 -0500 (Thu, 14 Feb 2008) New Revision: 9968 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: 5.2.2.3. Portlet Class revising, fixing my broken variablelist Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-14 08:06:18 UTC (rev 9967) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-14 08:46:35 UTC (rev 9968) @@ -744,8 +744,7 @@ - - - = - It will retrieve yourname from the HTML form, - and pass it along as a renderParameter to the doView() - method. - - - - - rResponse.setContentType("text/htm= l"); - Just like in the servlet world, you must declare w= hich kind of MIME type of the content the - portlet will be generating. - - - - - - In this case, our doView implem= entation is responsible for dispatching to - the appropriate JSP view.jsp or= view2.jsp, depending on - the existence of the yourname p= arameter passed in from - processAction. - - - - + + + + + As in the servlet-world, you must declare what content-type the portlet = will be responding in. Do this before starting to write content, or the por= tlet will throw an exception. + + + + + + + + The doView implementation is responsible for dispatch= ing to the appropriate JSP, HelloWorldJSPPortlet/WEB-INF/jsp/view= .jsp or HelloWorldJSPPortlet/WEB-INF/jsp/view2.jsp, depending on the existence of the yourname para= meter passed in from processAction. + + + + + JSP files and the portlet taglib --===============2404185924936327495==-- From portal-commits at lists.jboss.org Thu Feb 14 11:23:10 2008 Content-Type: multipart/mixed; boundary="===============7659533760003711457==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9969 - modules/portlet/trunk/build/distrib. Date: Thu, 14 Feb 2008 11:23:07 -0500 Message-ID: --===============7659533760003711457== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-14 11:23:07 -0500 (Thu, 14 Feb 2008) New Revision: 9969 Modified: modules/portlet/trunk/build/distrib/distrib.xml Log: - Added samples to binary distributions. Modified: modules/portlet/trunk/build/distrib/distrib.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/build/distrib/distrib.xml 2008-02-14 08:46:35 UTC= (rev 9968) +++ modules/portlet/trunk/build/distrib/distrib.xml 2008-02-14 16:23:07 UTC= (rev 9969) @@ -130,6 +130,9 @@ + + + = --===============7659533760003711457==-- From portal-commits at lists.jboss.org Thu Feb 14 12:51:12 2008 Content-Type: multipart/mixed; boundary="===============3864306533276487840==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9970 - in modules/portlet/trunk/test/src/test/resources/simple-portal-war: demo and 1 other directories. Date: Thu, 14 Feb 2008 12:51:12 -0500 Message-ID: --===============3864306533276487840== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-14 12:51:12 -0500 (Thu, 14 Feb 2008) New Revision: 9970 Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/images/c= ontent-box-bg.gif modules/portlet/trunk/test/src/test/resources/simple-portal-war/images/c= ontent-box-head-lt.gif modules/portlet/trunk/test/src/test/resources/simple-portal-war/images/c= ontent-box-head-rt.gif modules/portlet/trunk/test/src/test/resources/simple-portal-war/images/p= c20-picture.gif Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mast= er.css modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/hom= e.jsp Log: home page markup Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/c= ss/master.css =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-14 16:23:07 UTC (rev 9969) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-14 17:51:12 UTC (rev 9970) @@ -314,3 +314,48 @@ div.remote-container ul li a { color: #332299 } + +/*-------------------------------------Home page*/ + +div#container div#content div.main-content { + padding: 5px; + width: 950px; + border-bottom: 1px solid #777777; +} + +div#container div#content div.content-box { + background-image: url( /simple-portal/images/content-box-bg.gif ); + background-repeat: repeat-x; + background-position: top right; + height: 200px ; + width: 300px; + margin: 0 13px 0 13px; +} + +div#container div#content div.content-box div.box-header { + position: relative; + height: 28px; + width: 100%; +} + +div#container div#content div.content-box div.box-header h3{ + padding: 4px 0 0 10px; + font-size:1.2em; +} + + +div#container div#content div.content-box div.box-header img.left { + position: absolute; + top: 0; + left: 0; +} + +div#container div#content div.content-box div.box-header img.right { + position: absolute; + top: 0; + right: 0; +} + +div#container div#content div.content-box div.box-content { + padding: 5px; +} \ No newline at end of file Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/home.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/ho= me.jsp 2008-02-14 16:23:07 UTC (rev 9969) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/ho= me.jsp 2008-02-14 17:51:12 UTC (rev 9970) @@ -1,9 +1,12 @@ <%@ page contentType=3D"text/html" %> <%@ include file=3D"/layouts/header.jsp" %> - - +
      +
      -

      JBo= ss Portlet Container is the next generation +

      + 3D"" + + JBoss Portlet Container is the next generation portlet container on which future versions of JBoss Portal will be base= d. It provides a standard-compliant implementation of the JSR-286 Portlet 2.0 specification. It has been de= veloped with reusability in mind so that advanced users, who don't require a full-fledged portal, can leverage t= he portlet management services it provides in @@ -12,34 +15,55 @@ =

      This simple portal is a demonstration of what can be achieved reasonabl= y quickly by leveraging JBoss Portlet Container.

      +
      +
      +
      +
      + 3D"" +

      Support Services

      + 3D"" +
      +
      +

      JBoss (a division of Red Hat Inc.) offers various support service= s tailored to fit your needs. + Explore= support and service options for + JBoss Portal.

      +
      +
      = - - - - - - -

      Support Services

      - -

      JBoss (a division of Red Hat Inc.) offers various support serv= ices tailored to fit your needs. - E= xplore support and service options for - JBoss Portal.

      -

      PortletSwap

      - -

      Portle= tswap.com is an open community sponsored +

      +
      + 3D"" +

      PortletSwap

      + 3D"" +
      +
      +

      Portletsw= ap.com is an open community sponsored by JBoss to facilitate the exchange of portlets that can be us= ed with JBoss Portlet Container and JBoss Portal.

      -

      Project Information

      + + = -

      Learn more about JBoss Portlet Container - community project, JBoss Portal, - JBoss Portal platform

      -
      - -

      Thank you for downloading and deploying JBoss Portlet Container. We hop= e your enjoy working with it as much as we +

      +
      + 3D"" +

      Project Information

      + 3D"" +
      +
      +

      Learn more about JBoss Portlet Container + community project, JBoss Portal, + JBoss Portal platform

      +
      +
      +
      +
      +

      Thank you for downloading and deploying JBoss Portlet Container. We = hope your enjoy working with it as much as we enjoy developing it!

      = -

      Baci e abbracci,
      - The JBoss Portal Team.

      +

      Baci e abbracci,
      + The JBoss Portal Team.

      +
      = +
      + <%@ include file=3D"/layouts/footer.jsp" %> \ No newline at end of file Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/imag= es/content-box-bg.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/test/src/test/resources/simple-p= ortal-war/images/content-box-bg.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/imag= es/content-box-head-lt.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/test/src/test/resources/simple-p= ortal-war/images/content-box-head-lt.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/imag= es/content-box-head-rt.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/test/src/test/resources/simple-p= ortal-war/images/content-box-head-rt.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/imag= es/pc20-picture.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: modules/portlet/trunk/test/src/test/resources/simple-p= ortal-war/images/pc20-picture.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream --===============3864306533276487840==-- From portal-commits at lists.jboss.org Thu Feb 14 12:54:26 2008 Content-Type: multipart/mixed; boundary="===============0579372189799049228==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9971 - modules/portlet/trunk/test/src/test/resources/simple-portal-war/css. Date: Thu, 14 Feb 2008 12:54:26 -0500 Message-ID: --===============0579372189799049228== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-14 12:54:26 -0500 (Thu, 14 Feb 2008) New Revision: 9971 Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mast= er.css Log: change link color Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/c= ss/master.css =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-14 17:51:12 UTC (rev 9970) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-14 17:54:26 UTC (rev 9971) @@ -129,7 +129,7 @@ } = a { - color: #666666; + color: #990000; } = p { --===============0579372189799049228==-- From portal-commits at lists.jboss.org Thu Feb 14 13:17:56 2008 Content-Type: multipart/mixed; boundary="===============6965426337220413382==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9972 - in modules/portlet/trunk/test/src/test/resources/simple-portal-war: images and 1 other directory. Date: Thu, 14 Feb 2008 13:16:16 -0500 Message-ID: --===============6965426337220413382== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-14 13:16:15 -0500 (Thu, 14 Feb 2008) New Revision: 9972 Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mast= er.css modules/portlet/trunk/test/src/test/resources/simple-portal-war/images/p= c20-picture.gif Log: small change Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/c= ss/master.css =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-14 17:54:26 UTC (rev 9971) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-14 18:16:15 UTC (rev 9972) @@ -323,6 +323,10 @@ border-bottom: 1px solid #777777; } = +div#container div#content div.main-content p { + padding: 5px; +} + div#container div#content div.content-box { background-image: url( /simple-portal/images/content-box-bg.gif ); background-repeat: repeat-x; Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/i= mages/pc20-picture.gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) --===============6965426337220413382==-- From portal-commits at lists.jboss.org Thu Feb 14 14:05:59 2008 Content-Type: multipart/mixed; boundary="===============8090922884046854323==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9973 - in modules/portlet/trunk/test/src/test/resources/simple-portal-war: demo and 1 other directory. Date: Thu, 14 Feb 2008 14:05:59 -0500 Message-ID: --===============8090922884046854323== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-14 14:05:58 -0500 (Thu, 14 Feb 2008) New Revision: 9973 Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mast= er.css modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/wik= ipedia.jsp Log: wikipedia formatting Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/c= ss/master.css =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-14 18:16:15 UTC (rev 9972) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-14 19:05:58 UTC (rev 9973) @@ -362,4 +362,15 @@ = div#container div#content div.content-box div.box-content { padding: 5px; +} + +/*-------------------------------------Wiki page*/ + +div#container div#content div.wiki-content { + padding: 5px; + border-bottom: 1px solid #777777; +} + +div#container div#content div.wiki-content p { + padding: 5px; } \ No newline at end of file Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/wikipedia.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/wi= kipedia.jsp 2008-02-14 18:16:15 UTC (rev 9972) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/wi= kipedia.jsp 2008-02-14 19:05:58 UTC (rev 9973) @@ -8,7 +8,7 @@ = -
      +
      --===============8090922884046854323==-- From portal-commits at lists.jboss.org Thu Feb 14 14:59:49 2008 Content-Type: multipart/mixed; boundary="===============0656861386821472700==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9974 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/basic. Date: Thu, 14 Feb 2008 14:59:48 -0500 Message-ID: --===============0656861386821472700== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-14 14:59:47 -0500 (Thu, 14 Feb 2008) New Revision: 9974 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/basic/HeaderPortlet.java Log: formatting Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /portal/samples/basic/HeaderPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/HeaderPortlet.java 2008-02-14 19:05:58 UTC (rev 9973) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/HeaderPortlet.java 2008-02-14 19:59:47 UTC (rev 9974) @@ -112,7 +112,7 @@ " \n" + "
      " + ""); - writer.print("
      "); + writer.print("
      "= ); // "" + // "Cl= ick me to trigger script" + writer.print("


      " + --===============0656861386821472700==-- From portal-commits at lists.jboss.org Thu Feb 14 17:13:57 2008 Content-Type: multipart/mixed; boundary="===============1151803486081248594==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9975 - modules/portlet/trunk/build/distrib. Date: Thu, 14 Feb 2008 17:13:57 -0500 Message-ID: --===============1151803486081248594== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-14 17:13:56 -0500 (Thu, 14 Feb 2008) New Revision: 9975 Added: modules/portlet/trunk/build/distrib/JBossPC-README.txt Modified: modules/portlet/trunk/build/distrib/distrib.xml Log: - Now create bundled distributions. Requires either (or both) TOMCAT_6_HOME= or JBOSS_4_2_HOME to be set. Copied: modules/portlet/trunk/build/distrib/JBossPC-README.txt (from rev 99= 70, modules/portlet/trunk/build/distrib/README.txt) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/build/distrib/JBossPC-README.txt = (rev 0) +++ modules/portlet/trunk/build/distrib/JBossPC-README.txt 2008-02-14 22:13= :56 UTC (rev 9975) @@ -0,0 +1,15 @@ + +JBoss Portlet Container +LGPL Licensed (See http://www.gnu.org/copyleft/lesser.html for details on = the product usage) + +JBoss Portlet Container is the next generation portlet container on which = future versions of JBoss +Portal will be based. It provides a standard-compliant implementation of t= he JSR-286 Portlet 2.0 = +specification. It has been developed with reusability in mind so that adva= nced users, who don't require +a full-fledged portal, can leverage the portlet management services it pro= vides in their own applications. +JBoss Portlet Container is available through the business-friendly LGPL op= en source license. + +This distribution also contains a simple portal built on top of JBoss Port= let Container. This simple +portal can be run on Tomcat 6.x and JBoss Application Server 4.2.x. + +INSTALLATION AND RUNNING: +For installation, please refer to the user guide available in the 'jbosspc= -docs' directory \ No newline at end of file Property changes on: modules/portlet/trunk/build/distrib/JBossPC-README.txt ___________________________________________________________________ Name: svn:eol-style + native Modified: modules/portlet/trunk/build/distrib/distrib.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/build/distrib/distrib.xml 2008-02-14 19:59:47 UTC= (rev 9974) +++ modules/portlet/trunk/build/distrib/distrib.xml 2008-02-14 22:13:56 UTC= (rev 9975) @@ -1,29 +1,30 @@ = - - + + + = - + + - - + + = - - + + = - - = - + = @@ -38,11 +39,11 @@ = --> - + - + @@ -54,7 +55,7 @@ - + = @@ -85,25 +86,42 @@ - + + + + + - + + + = - + + + + + - + + + + + + = @@ -112,10 +130,10 @@ - + - + = @@ -126,6 +144,12 @@ + + + + + + @@ -135,10 +159,17 @@ = + + + + + + + - + = @@ -147,9 +178,8 @@ - + - @@ -162,4 +192,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + --===============1151803486081248594==-- From portal-commits at lists.jboss.org Thu Feb 14 17:43:40 2008 Content-Type: multipart/mixed; boundary="===============0197514256400590434==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9976 - modules/portlet/trunk/build/distrib. Date: Thu, 14 Feb 2008 17:43:38 -0500 Message-ID: --===============0197514256400590434== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-14 17:43:38 -0500 (Thu, 14 Feb 2008) New Revision: 9976 Modified: modules/portlet/trunk/build/distrib/distrib.xml Log: - Compress each distrib individually. Modified: modules/portlet/trunk/build/distrib/distrib.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/build/distrib/distrib.xml 2008-02-14 22:13:56 UTC= (rev 9975) +++ modules/portlet/trunk/build/distrib/distrib.xml 2008-02-14 22:43:38 UTC= (rev 9976) @@ -23,7 +23,7 @@ = - = @@ -81,6 +81,9 @@ + + + = - - - - - - - @@ -186,7 +182,7 @@ = - + --===============0197514256400590434==-- From portal-commits at lists.jboss.org Thu Feb 14 19:04:47 2008 Content-Type: multipart/mixed; boundary="===============0676648416089026618==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9977 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Thu, 14 Feb 2008 19:04:47 -0500 Message-ID: --===============0676648416089026618== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-14 19:04:46 -0500 (Thu, 14 Feb 2008) New Revision: 9977 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: 5.2.2.3. Portlet Class minor revisions, splitting first example for = HelloWorldJSPPorlet.java into two screen elements Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-14 22:43:38 UTC (rev 9976) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-15 00:04:46 UTC (rev 9977) @@ -141,7 +141,7 @@ Introduction - This section describes how to deploy a portlet in JBoss Portal. Befo= re proceeding, download the HelloWorldPortlet from JBoss PortletSwap. @@ -264,7 +264,7 @@ - The following is an example of the HelloWorldPortlet/WEB-IN= F/portlet.xml file: + The following is an example of the HelloWorldPortlet/WEB-IN= F/portlet.xml file. In order to create the WEB-INF/ and META-INF/ directories, extract the helloworldportlet.war file.This file must adhere to its defi= nition in the JSR-168 Portlet Specification. You may define more than one p= ortlet application in this file: - In order to create the WEB-INF and META-I= NF directories, extract the helloworldportlet.war file.This file must adhere to its definition in the JSR-168 Portlet = Specification. You may define more than one portlet application in this fil= e. - - HelloWorldPortlet]]> @@ -633,20 +630,20 @@ - An Example JSP Portlet + An example JSP Portlet Introduction - This section describes how to deploy a JSP portlet in JBoss Portal. = Before proceeding, download the HelloWorldJSPP= ortlet from JBoss= PortletSwap. The HelloWorldJSPPortlet demonstrates how to use JSPs= for view rendering, and the portlet taglib for generating links. + This section describes how to deploy a JSP portlet for JBoss Portal.= Before proceeding, download the HelloWorldJSP= Portlet from JBos= s PortletSwap. The HelloWorldJSPPortlet demonstrates how to use JSP= s for view rendering, and the portlet taglib for generating links. Package Content - The application descriptors for the HelloWorldJSPPortlet portlet are= similar to those from the HelloWorldPortlet (). See for further = details about application descriptors. + The application descriptors for the HelloWorldJSPPortlet portlet are= similar to those from the HelloWorldPortlet (). See for further = information about application descriptors. - The following is an example of the directory structure of the HelloW= orldJSPPortlet portlet. The HelloWorldJSPPortlet portlet contains the tradi= tional portlet and JBoss Portal specific application descriptors: + The following is an example of the directory structure of the HelloW= orldJSPPortlet portlet. The HelloWorldJSPPortlet portlet contains the tradi= tional portlet and JBoss Portal specific application descriptors. In order = to create the WEB-INF/ and META-INF/ directories, extract the helloworldjspportlet.war = file. @@ -659,7 +656,7 @@ Portlet Class - The HelloWorldJSPPortlet contai= ns a HelloWorldJSPPortlet/src/main/org/jboss/portlet/hello/HelloW= orldJSPPortlet.java file: + The HelloWorldJSPPortlet contai= ns the HelloWorldJSPPortlet/src/main/org/jboss/portlet/hello/Hell= oWorldJSPPortlet.java file: +protected void doHelp(RenderRequest rRequest, RenderResponse rResponse) + throws PortletException, IOException, UnavailableExcept= ion]]> + @@ -776,7 +773,7 @@ - The doView implementation is responsible for dispatch= ing to the appropriate JSP, HelloWorldJSPPortlet/WEB-INF/jsp/view= .jsp or HelloWorldJSPPortlet/WEB-INF/jsp/view2.jsp, depending on the existence of the yourname para= meter passed in from processAction. + The doView implementation is responsible for dispatch= ing to the appropriate JSP, HelloWorldJSPPortlet/WEB-INF/jsp/view= .jsp, or HelloWorldJSPPortlet/WEB-INF/jsp/view2.jsp, depending on the existence of the yourname par= ameter passed in from processAction. --===============0676648416089026618==-- From portal-commits at lists.jboss.org Thu Feb 14 19:33:56 2008 Content-Type: multipart/mixed; boundary="===============8374153903901399293==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9978 - in modules/portlet/trunk: test/src/test and 1 other directories. Date: Thu, 14 Feb 2008 19:33:56 -0500 Message-ID: --===============8374153903901399293== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-14 19:33:56 -0500 (Thu, 14 Feb 2008) New Revision: 9978 Removed: modules/portlet/trunk/build/distrib/README.txt Modified: modules/portlet/trunk/build/distrib/distrib.xml modules/portlet/trunk/test/src/test/build.xml modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/hom= e.jsp Log: - Fixed issue with samples not being properly copied to tomcat distrib. - Added option to not generate source distrib. - Standardized distrib names. - Added licenses to distrib. - Added JBoss Logging to tomcat lib dir. - Clean-ups. Deleted: modules/portlet/trunk/build/distrib/README.txt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/build/distrib/README.txt 2008-02-15 00:04:46 UTC = (rev 9977) +++ modules/portlet/trunk/build/distrib/README.txt 2008-02-15 00:33:56 UTC = (rev 9978) @@ -1,15 +0,0 @@ - -JBoss Portlet Container -LGPL Licensed (See http://www.gnu.org/copyleft/lesser.html for details on = the product usage) - -JBoss Portlet Container is the next generation portlet container on which = future versions of JBoss -Portal will be based. It provides a standard-compliant implementation of t= he JSR-286 Portlet 2.0 = -specification. It has been developed with reusability in mind so that adva= nced users, who don't require -a full-fledged portal, can leverage the portlet management services it pro= vides in their own applications. -JBoss Portlet Container is available through the business-friendly LGPL op= en source license. - -This distribution also contains a simple portal built on top of JBoss Port= let Container. This simple -portal can be run on Tomcat 6.x and JBoss Application Server 4.2.x. - -INSTALLATION AND RUNNING: -For installation, please refer to the user guide available in the 'docs' d= irectory \ No newline at end of file Modified: modules/portlet/trunk/build/distrib/distrib.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/build/distrib/distrib.xml 2008-02-15 00:04:46 UTC= (rev 9977) +++ modules/portlet/trunk/build/distrib/distrib.xml 2008-02-15 00:33:56 UTC= (rev 9978) @@ -3,11 +3,11 @@ - + = - + @@ -28,24 +28,9 @@ = - - - - + = @@ -73,7 +58,7 @@ - @@ -117,7 +102,7 @@ - + -

      - 3D"" - - JBoss Portlet Container is the next generation - portlet container on which future versions of JBoss Portal will be base= d. It provides a standard-compliant - implementation of the JSR-286 Portlet 2.0 specification. It has been de= veloped with reusability in mind so that - advanced users, who don't require a full-fledged portal, can leverage t= he portlet management services it provides in - their own applications. JBoss Portlet Container is available through th= e business-friendly LGPL open source license. -

      +
      +

      + 3D"" + + JBoss Portlet Container is the next generation + portlet container on which future versions of JBoss Portal will b= e based. It provides a standard-compliant + implementation of the JSR-286 Portlet 2.0 specification. It has b= een developed with reusability in mind so that + advanced users, who don't require a full-fledged portal, can leve= rage the portlet management services it + provides in + their own applications. JBoss Portlet Container is available thro= ugh the business-friendly LGPL open source + license. +

      = -

      This simple portal is a demonstration of what can be achieved reasonabl= y quickly by leveraging JBoss Portlet - Container.

      -
      +

      This simple portal is a demonstration of what can be achieved rea= sonably quickly by leveraging JBoss Portlet + Container.

      +

      -
      -
      - 3D"" -

      Support Services

      - 3D"" + +
      +
      + 3D"" + +

      Support Services

      + 3D"" +
      +
      +

      JBoss (a division of Red Hat Inc.) offers various support serv= ices tailored to fit your needs. + E= xplore support and service options for + JBoss Portal.

      +
      -
      -

      JBoss (a division of Red Hat Inc.) offers various support service= s tailored to fit your needs. - Explore= support and service options for - JBoss Portal.

      -
      -
      = -
      -
      - 3D"" -

      PortletSwap

      - 3D"" -
      -
      -

      Portletsw= ap.com is an open community sponsored +

      +
      + 3D"" + +

      PortletSwap

      + 3D"" +
      +
      +

      Portle= tswap.com is an open community sponsored by JBoss to facilitate the exchange of portlets that can be us= ed with JBoss Portlet Container and JBoss Portal.

      +
      -
      = -
      -
      - 3D"" -

      Project Information

      - 3D"" +
      +
      + 3D"" + +

      Project Information

      + 3D"" +
      +
      +

      Learn more about JBoss Portlet Container + community project, JBoss Portal, + JBoss Portal platform

      +
      -
      -

      Learn more about JBoss Portlet Container - community project, JBoss Portal, - JBoss Portal platform

      -
      -

      -
      -

      Thank you for downloading and deploying JBoss Portlet Container. We = hope your enjoy working with it as much as we - enjoy developing it!

      = -

      Baci e abbracci,
      - The JBoss Portal Team.

      -
      +
      +

      Thank you for downloading and deploying JBoss Portlet Container. = We hope your enjoy working with it as much as + we + enjoy developing it!

      = +

      Baci e abbracci,
      + The JBoss Portal Team.

      +
      +
      = <%@ include file=3D"/layouts/footer.jsp" %> \ No newline at end of file --===============8374153903901399293==-- From portal-commits at lists.jboss.org Thu Feb 14 19:54:09 2008 Content-Type: multipart/mixed; boundary="===============0427466042809539606==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9979 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples. Date: Thu, 14 Feb 2008 19:54:09 -0500 Message-ID: --===============0427466042809539606== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-14 19:54:09 -0500 (Thu, 14 Feb 2008) New Revision: 9979 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/RemoteControlResourcePortlet.java Log: - Added state to SF and Denver for consistency. - Removed commented code. Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /portal/samples/RemoteControlResourcePortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/RemoteControlResourcePortlet.java 2008-02-15 00:33:56 UTC (rev 99= 78) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/RemoteControlResourcePortlet.java 2008-02-15 00:54:09 UTC (rev 99= 79) @@ -23,8 +23,6 @@ public class RemoteControlResourcePortlet extends GenericPortlet { private static final String ZIPCODE =3D "zipcode"; - private static int COLOR_INDEX =3D 0; - private static final String[] COLORS =3D {"000", "f00", "0f0", "00f", "= ff0", "0ff", "f0f", "fff"}; = @Override protected void doView(RenderRequest renderRequest, RenderResponse rende= rResponse) throws PortletException, IOException @@ -39,9 +37,6 @@ ResourceURL resource =3D renderResponse.createResourceURL(); printWriter.print(resource); printWriter.print("')\">Open remote control!

      "); - /*String color =3D renderRequest.getPreferences().getValue("color", = "000"); - printWriter.print("

      Preferred color:  

      ");*/ } = @Override @@ -50,7 +45,6 @@ resourceResponse.setContentType("text/html"); PrintWriter writer =3D resourceResponse.getWriter(); String namespace =3D resourceResponse.getNamespace(); -// resourceRequest.getPreferences().setValue("color", COLORS[COLOR_IN= DEX++ % 8]); writer.print("\n"); PortletURL url =3D resourceResponse.createRenderURL(); @@ -66,9 +60,9 @@ writer.print("
      • 'zipcode' public render parameter = value: " + resourceRequest.getParameter(ZIPCODE) + "
        "); writer.print("Set value of 'zipcode' public render parameter = to:
      • "); url.setParameter(ZIPCODE, "80201"); - writer.print("
      • Denver"); + writer.print("
      • Denver, CO"); url.setParameter(ZIPCODE, "94102"); - writer.print("
      • San Francisco"); + writer.print("
      • San Francisco, CA"); url.setParameter(ZIPCODE, "20001"); writer.print("
      • Washington, DC"); writer.print("
      "); --===============0427466042809539606==-- From portal-commits at lists.jboss.org Thu Feb 14 19:57:46 2008 Content-Type: multipart/mixed; boundary="===============4867591712141779387==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9980 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Thu, 14 Feb 2008 19:57:46 -0500 Message-ID: --===============4867591712141779387== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-14 19:57:45 -0500 (Thu, 14 Feb 2008) New Revision: 9980 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: 5.2.2.4. JSP Files and the Portlet Taglib minor revision, replacing itemizedlist with = variablelist Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-15 00:54:09 UTC (rev 9979) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-15 00:57:45 UTC (rev 9980) @@ -754,7 +754,7 @@ - This method is triggered when a user clicks on an action= URL, which is defined in the HelloWorldJSPPortle= t/WEB-INF/jsp/view.jsp file. This retrieves your= name from the HTML form, and passes it as a rende= rParameter to the doView() method. + This method is triggered when a user clicks on an action= URL, which is defined in the HelloWorldJSPPortle= t/WEB-INF/jsp/view.jsp file. This retrieves your= name from the HTML form, and passes it as a aResponse.setRenderParameter to the doView() method. @@ -781,22 +781,23 @@ - JSP files and the portlet taglib + JSP Files and the Portlet Taglib - Of importance in this tutorial are the two view JSPs. The f= irst, view.jsp, allows the - user to input his name, which is then posted to the processAction method in our - portlet class, set as a renderParameter,= then the render method is - invoked (in our case, doView, which then= dispatches to our - view2.jsp). + The HelloWorldJSPPortlet/WEB-INF/jsp/view.jsp a= nd HelloWorldJSPPortlet/WEB-INF/jsp/view2.jsp JSP file= s are included in the HelloWorldJSPPortlet portlet. The first, vi= ew.jsp, allows a user to input their name. This is then posted t= o the processAction method in the portlet = class, which is set in the aResponse.setRenderParameter. The render method, doView= , is invoked, which dispatches to the view2.jsp<= /filename> JSP: + + - Now let's have a look at our view.jsp: + + The following is an example of the HelloWorldJSPPortlet/WE= B-INF/jsp/view.jsp file: + - + = = @@ -814,42 +815,57 @@ You can also link to other pages, using a renderURL, like ">this. -
      ]]> - - - - ]]> - Define the portlet taglib. You do NOT need to bundle the portlet taglib, - JBoss Portal will handle that for you. - - - - - ]= ]> - Calling defineObjects makes ava= ilable implicit objects, such as - renderRequest, actionRequest, portletConf= ig, in this JSP. - - - - - - " method=3D"POST">]]> - We create an HTML form, but generate the URL it wi= ll post to using the portlet tag library. In - this case, notice how we are creating an = actionURL, which will activate our - processAction method, passing i= n any input parameters in the form. - - - - - -">]]> - Likewise, we are able to create a link to our doView method, by simply - creating it with a renderURL, t= hat passes in our yourname - parameter. - - - - +
    ]]> + + + + + ]]> + + + + Define the portlet taglib. You do NOT need to bundl= e the portlet taglib, + JBoss Portal will handle that for you. + + + +]]> + + + + Calling defineObjects makes available implicit object= s, such as + renderRequest, actionRequest, portletConfig, in this = JSP. + + + + + " method=3D"POST">]]> + + + + We create an HTML form, but generate the URL it will post to using the p= ortlet tag library. In + this case, notice how we are creating an actionURL, w= hich will activate our + processAction method, passing in any input parameters= in the form. + + + + +">]]> + + + + Likewise, we are able to create a link to our doView = method, by simply + creating it with a renderURL, that passes in our yourname + parameter. + + + + + Building and deploying your portlet --===============4867591712141779387==-- From portal-commits at lists.jboss.org Thu Feb 14 20:56:02 2008 Content-Type: multipart/mixed; boundary="===============0123714341754068374==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9981 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Thu, 14 Feb 2008 20:56:02 -0500 Message-ID: --===============0123714341754068374== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-14 20:56:01 -0500 (Thu, 14 Feb 2008) New Revision: 9981 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: 5.2.2.4. JSP Files and the Portlet Tag Library minor revisions to text explaining the view.jsp file Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-15 00:57:45 UTC (rev 9980) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-15 01:56:01 UTC (rev 9981) @@ -781,9 +781,9 @@ - JSP Files and the Portlet Taglib + JSP Files and the Portlet Tag Library - The HelloWorldJSPPortlet/WEB-INF/jsp/view.jsp a= nd HelloWorldJSPPortlet/WEB-INF/jsp/view2.jsp JSP file= s are included in the HelloWorldJSPPortlet portlet. The first, vi= ew.jsp, allows a user to input their name. This is then posted t= o the processAction method in the portlet = class, which is set in the aResponse.setRenderParameter. The render method, doView= , is invoked, which dispatches to the view2.jsp<= /filename> JSP: + The HelloWorldJSPPortlet/WEB-INF/jsp/view.jsp a= nd HelloWorldJSPPortlet/WEB-INF/jsp/view2.jsp JSP file= s are included in the HelloWorldJSPPortlet portlet. The view.jsp<= /filename> file allows a user to input their name. This is then posted to t= he processAction method in the portlet cla= ss, which is set as a aResponse.setRenderParameter. The render method, doView, is invoked, which dispatches to the view2.jsp JSP: @@ -825,8 +825,7 @@ - Define the portlet taglib. You do NOT need to bundl= e the portlet taglib, - JBoss Portal will handle that for you. + Define the portlet tag library (taglib). You do not need to bundle the p= ortlet taglib - JBoss Portal handles this for you. @@ -835,8 +834,8 @@ - Calling defineObjects makes available implicit object= s, such as - renderRequest, actionRequest, portletConfig, in this = JSP. + Calling defineObjects makes available implicit object= s in the JSP, such as + renderRequest, actionRequest, portletConfig. @@ -846,9 +845,7 @@ - We create an HTML form, but generate the URL it will post to using the p= ortlet tag library. In - this case, notice how we are creating an actionURL, w= hich will activate our - processAction method, passing in any input parameters= in the form. + A HTML form is created. This form posts to the URL defined by the portle= t taglib. In this example, an actionURL is= created, that activates the processAction method, which= passes the input parameters in the form. @@ -858,9 +855,7 @@ - Likewise, we are able to create a link to our doView = method, by simply - creating it with a renderURL, that passes in our yourname - parameter. + You can create a link to the doView met= hod by creating a renderURL, that passes t= he yourname parameter. --===============0123714341754068374==-- From portal-commits at lists.jboss.org Thu Feb 14 20:58:37 2008 Content-Type: multipart/mixed; boundary="===============2618200536948200204==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9982 - in modules/portlet/trunk/docs/user-guide/en: modules and 1 other directory. Date: Thu, 14 Feb 2008 20:58:37 -0500 Message-ID: --===============2618200536948200204== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chris.laprun(a)jboss.com Date: 2008-02-14 20:58:37 -0500 (Thu, 14 Feb 2008) New Revision: 9982 Added: modules/portlet/trunk/docs/user-guide/en/modules/installation.xml Modified: modules/portlet/trunk/docs/user-guide/en/master.xml modules/portlet/trunk/docs/user-guide/en/modules/introduction.xml Log: - Started documentation. Modified: modules/portlet/trunk/docs/user-guide/en/master.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/docs/user-guide/en/master.xml 2008-02-15 01:56:01= UTC (rev 9981) +++ modules/portlet/trunk/docs/user-guide/en/master.xml 2008-02-15 01:58:37= UTC (rev 9982) @@ -1,8 +1,9 @@ - ]> + "../../docbook-support/support/docbook-dtd/docbookx.dtd" [ + + + ]> Simple Portlet Container @@ -13,8 +14,14 @@ Viet julien(a)jboss.org + + Chris + Laprun + chris.laprun(a)jboss.com + &introduction; + &installation; = Added: modules/portlet/trunk/docs/user-guide/en/modules/installation.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/docs/user-guide/en/modules/installation.xml = (rev 0) +++ modules/portlet/trunk/docs/user-guide/en/modules/installation.xml 2008-= 02-15 01:58:37 UTC (rev 9982) @@ -0,0 +1,129 @@ + + + + + Julien + Viet + julien(a)jboss.org + + + Chris + Laprun + chris.laprun(a)jboss.com + + + + Installation + + Downloading and installing + Two bundled versions are provided to showcase JBoss Portlet Co= ntainer in action with minimum effort. Theses + bundles each include a servlet container configured with the Simp= le Portal demonstration portal along with + some JSR-286 compliant portlets. You will need to have Java 5 con= figured on your machine to run the + demonstration portal. + You can download Java 5 at + http://java.sun.com/javase/downloads/index_jdk5.jsp. Once= you have Java installed, you are ready to + download one of JBoss Portlet Container bundles. The following li= nk has the list of downloads for JBoss Portlet + Container: + http://labs.jboss.com/portal/portletcontainer/download. T= wo bundles are currently provided: one with + Tomcat 6.0.16 and one with JBoss Application Server 4.2.2.GA. + + + JBoss AS 4.2.x bundle + + Of note in the bundle are the following directories: + + + bin + - Contains the startup/shutdown commands for JBoss Appli= cation Server + + + docs + - Contains documentation for JBoss Application Server + + + jbosspc-docs + - Contains documentation for JBoss Portlet Container (th= is document included) + + + server + - Contains JBoss Application Server configuration and the + simple-portal.war + file along with several sample portlets in the + deploy + directory of the + default + configuration + + + + + To start the demonstration portal, go to the + bin + directory and execute either + run.sh + or + run.bat + (depending on your platform). + + + + Tomcat 6.0.x bundle + + Of note in the bundle are the following directories: + + + bin + - Contains the startup/shutdown commands for Tomcat + + + logs + - Contains the logs once the servlet container is starte= d (the most interesting one being one with + locahost + in its name) + + + jbosspc-docs + - Contains documentation for JBoss Portlet Container (th= is document included) + + + lib + - Contains Tomcat libraries to which several support lib= raries for JBoss Portlet Container have been + added + + + webapps + - Contains Tomcat default applications and the + simple-portal.war + file along with several sample portlets + + + + + To start the demonstration portal, go to the + bin + directory and execute either + startup.sh + or + startup.bat + (depending on your platform). + + + + + + Testing Portal Container's demonstration portal + Once the servlet container is started, bring up your web brows= er and go to the following URL: + http://localho= st:8080/simple-portal. + You should see the default page for Portlet Container's demonstra= tion portal: + + + + +
    + Default page for Portlet Container's demonstration po= rtal. +
    "; + int begIndex =3D html.indexOf(beg); + if (begIndex !=3D -1) + { + // extract table containing specific first result + int endIndex =3D html.indexOf(end, begIndex); + html =3D html.substring(begIndex + beg.length(), endIndex + end.l= ength()); + + html =3D postProcessHTML(html); + + renderResponse.setContentType("text/html"); + PrintWriter printWriter =3D renderResponse.getWriter(); + printWriter.print(html); + } + } + + protected String getZipCode(RenderRequest renderRequest) + { + String zip =3D renderRequest.getParameter(ZIP); + if (zip =3D=3D null) + { + zip =3D renderRequest.getPreferences().getValue(ZIP, SAN_FRAN); + } + return zip; + } + + @Override + protected void doEdit(RenderRequest renderRequest, RenderResponse rende= rResponse) throws PortletException, IOException + { + renderResponse.setContentType("text/html"); + renderResponse.getWriter().print( + "
    \n" + + "
    \n" + + " Change Location:\n" + + "\n" + + "
    Zip Code:
    \n" + + " \n" + + "
    \n" + + " \n" + + "
    \n" + + "
    "); + } + + @Override + public void processAction(ActionRequest actionRequest, ActionResponse a= ctionResponse) throws PortletException, IOException + { + String zip =3D actionRequest.getParameter(ZIP); + + if (null !=3D zip) + { + PortletPreferences prefs =3D actionRequest.getPreferences(); + prefs.setValue(ZIP, zip); + prefs.store(); + } + + // set zip as render parameter + actionResponse.setRenderParameter(ZIP, zip); + + // request view + actionResponse.setPortletMode(PortletMode.VIEW); + } + + protected String postProcessHTML(String html) + { + // links should open in new windows + html =3D html.replaceAll(A, A_TARGET_BLANK); + + // src attributes should be absolute + html =3D html.replaceAll("src=3D/", "src=3Dhttp://google.com/"); + html =3D html.replaceAll("src=3D\"/", "src=3D\"http://google.com/"); + + // forms should open in new windows and have an absolute action URL + html =3D html.replaceAll("action=3D\"/", "target=3D'_blank' action= =3D\"http://google.com/"); + + return html; + } + + protected String getQueryString(String zip) + { + return GOOGLE + zip; + } + + private byte[] getBytes(InputStream in, int bufferSize) throws IOExcept= ion, IllegalArgumentException + { + ByteArrayOutputStream out =3D new ByteArrayOutputStream(); + + byte[] buffer =3D new byte[bufferSize]; + while (true) + { + int i =3D in.read(buffer); + if (i =3D=3D 0) + { + continue; + } + if (i =3D=3D -1) + { + break; + } + out.write(buffer, 0, i); + } + return out.toByteArray(); + } + +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/samples/GoogleWeatherClippingPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/GoogleWeatherClippingPortlet.java (rev = 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/GoogleWeatherClippingPortlet.java 2008-02-29 23:47:01 UTC (rev = 10161) @@ -0,0 +1,55 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.portal.samples; + +/** + * @author Chris Laprun + * @version $Revision: 9912 $ + */ +public class GoogleWeatherClippingPortlet extends GoogleClippingPortlet +{ + private final static String WEATHER_URL =3D "http://www.google.com/sear= ch?q=3Dweather+"; + private static final String A_END =3D ""; + + protected String getQueryString(String zip) + { + return WEATHER_URL + zip; + } + + protected String postProcessHTML(String html) + { + int begIndex; + int endIndex; + + // remove add to iGoogle link + begIndex =3D html.indexOf(A); + if (begIndex !=3D -1) + { + endIndex =3D html.indexOf(A_END, begIndex); + html =3D html.substring(0, begIndex) + html.substring(endIndex + = A_END.length()); + } + + return super.postProcessHTML(html); + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/samples/RemoteControlResourcePortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/RemoteControlResourcePortlet.java (rev = 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/RemoteControlResourcePortlet.java 2008-02-29 23:47:01 UTC (rev = 10161) @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2008, Your Corporation. All Rights Reserved. + */ + +package org.jboss.portal.portlet.portal.samples; + +import javax.portlet.GenericPortlet; +import javax.portlet.PortletException; +import javax.portlet.PortletURL; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import javax.portlet.ResourceURL; +import javax.portlet.WindowState; +import java.io.IOException; +import java.io.PrintWriter; + +/** + * @author Chris Laprun + * @version $Revision: 9979 $ + */ +public class RemoteControlResourcePortlet extends GenericPortlet +{ + private static final String ZIPCODE =3D "zipcode"; + + @Override + protected void doView(RenderRequest renderRequest, RenderResponse rende= rResponse) throws PortletException, IOException + { + renderResponse.setContentType("text/html"); + PrintWriter printWriter =3D renderResponse.getWriter(); + String namespace =3D renderResponse.getNamespace(); + printWriter.print("\n"); + PortletURL url =3D resourceResponse.createRenderURL(); + url.setWindowState(WindowState.MINIMIZED); + writer.print("
    "); + writer.print("
    • 'zipcode' public render parameter = value: " + resourceRequest.getParameter(ZIPCODE) + "
      "); + writer.print("Set value of 'zipcode' public render parameter = to:
    • "); + url.setParameter(ZIPCODE, "80201"); + writer.print("
    • Denver, CO"); + url.setParameter(ZIPCODE, "94102"); + writer.print("
    • San Francisco, CA"); + url.setParameter(ZIPCODE, "20001"); + writer.print("
    • Washington, DC"); + writer.print("
    "); + } + + private String createParentURL(PortletURL url) + { + return "openLinkInParent('" + url + "')"; + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/samples/basic/ExceptionPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/basic/ExceptionPortlet.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/basic/ExceptionPortlet.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,113 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.samples.basic; + +import javax.portlet.GenericPortlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.PortletURL; +import javax.portlet.PortletRequest; +import javax.portlet.ActionRequest; +import javax.portlet.PortletSecurityException; +import javax.portlet.ActionResponse; +import java.io.IOException; +import java.io.PrintWriter; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ExceptionPortlet extends GenericPortlet +{ + + public void processAction(ActionRequest req, ActionResponse resp) throw= s PortletException, PortletSecurityException, IOException + { + throwException(req); + } + + protected void doView(RenderRequest req, RenderResponse resp) throws Po= rtletException, PortletSecurityException, IOException + { + throwException(req); + + // + resp.setContentType("text/html"); + PrintWriter writer =3D resp.getWriter(); + PortletURL renderURL =3D resp.createRenderURL(); + PortletURL actionURL =3D resp.createActionURL(); + + // + writer.write("

    "); + writer.write("

    Throw :
    "= ); + writer.write("
    "); + renderURL.setParameter("op", "portletexception"); + writer.write(""); + renderURL.setParameter("op", "portletsecurityexception"); + writer.write(""); + renderURL.setParameter("op", "ioexception"); + writer.write(""); + renderURL.setParameter("op", "runtimeexception"); + writer.write(""); + actionURL.setParameter("op", "error"); + writer.write("
    render Error<= /div>"); + actionURL.setParameter("op", "portletexception"); + writer.write(""); + actionURL.setParameter("op", "portletsecurityexception"); + writer.write(""); + actionURL.setParameter("op", "ioexception"); + writer.write(""); + actionURL.setParameter("op", "runtimeexception"); + writer.write(""); + actionURL.setParameter("op", "error"); + writer.write("
    action Error<= /div>"); + writer.write("
    "); + writer.write("

    "); + } + + private void throwException(PortletRequest req) throws PortletException= , IOException + { + String op =3D req.getParameter("op"); + + // Throw any required exception + if ("portletexception".equals(op)) + { + throw new PortletException(); + } + if ("portletsecurityexception".equals(op)) + { + throw new PortletSecurityException(""); + } + if ("ioexception".equals(op)) + { + throw new IOException(); + } + if ("runtimeexception".equals(op)) + { + throw new RuntimeException(); + } + if ("error".equals(op)) + { + throw new Error(); + } + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/samples/basic/FailDuringInitPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/basic/FailDuringInitPortlet.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/basic/FailDuringInitPortlet.java 2008-02-29 23:47:01 UTC (rev 1= 0161) @@ -0,0 +1,65 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.samples.basic; + +import javax.portlet.GenericPortlet; +import javax.portlet.PortletException; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import java.io.IOException; +import java.io.PrintWriter; + +/** + * A portlet that will fail only one time during startup (so it is possibl= e to restart it). + * + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class FailDuringInitPortlet extends GenericPortlet +{ + + private static int initCount =3D 0; + + public void init() throws PortletException + { + if (initCount =3D=3D 0) + { + initCount =3D 1; + + // + throw new PortletException(); + } + else + { + // Nothing + } + } + + protected void doView(RenderRequest renderRequest, RenderResponse rende= rResponse) throws PortletException, IOException + { + renderResponse.setContentType("text/html"); + PrintWriter writer =3D renderResponse.getWriter(); + writer.print("A portlet that may fail during init"); + writer.close(); + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/samples/basic/HeaderPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/basic/HeaderPortlet.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/basic/HeaderPortlet.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,189 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.samples.basic; + +import org.w3c.dom.Element; +import org.jboss.portal.portlet.ActionURL; +import org.jboss.portal.portlet.RenderURL; + + +import javax.portlet.GenericPortlet; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import javax.portlet.ResourceURL; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.PortletSecurityException; +import javax.portlet.PortletURL; +import javax.portlet.PortletPreferences; +import javax.portlet.PortletMode; +import java.io.IOException; +import java.io.PrintWriter; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class HeaderPortlet extends GenericPortlet +{ + public final static int TITANIUM =3D 0; + public final static int PLATINUM =3D 1; + public final static int GOLD =3D 2; + public final static int SILVER =3D 3; + public final static int TIN =3D 4; + + public void processAction(ActionRequest req, ActionResponse resp) throw= s PortletException, PortletSecurityException, IOException + { + + String repeatText =3D req.getParameter("repeat"); + // set zip as render parameter + if (repeatText !=3D null){ + resp.setRenderParameter("repeat", repeatText); + } + // request view + resp.setPortletMode(PortletMode.VIEW); + + } + public void render(RenderRequest req, RenderResponse resp) throws Portl= etException, IOException + { + ResourceURL resourceURL =3D resp.createResourceURL(); + PortletURL actionURL =3D resp.createActionURL(); + // +// Element elt =3D resp.createElement("script"); +// elt.setAttribute("type", "text/javascript"); +// elt.setAttribute("src", resourceURL.toString()); +// elt.appendChild(elt.getOwnerDocument().createTextNode("")); +// resp.addProperty("script", elt); + + // + + resp.setContentType("text/html"); + PrintWriter writer =3D resp.getWriter(); + writer.print("" + + ""); + + writer.print("" + + "
    " + + "

    Partial Refresh Repeater Demo

    "); + writer.print("" + + "
    " + + "
    \n" + + " Repeat Demo:
    \n= " + + " \n" + + " \n" + + "
    \n" + + "
    " + + ""); + writer.print("
    "= ); +// "" + +// "Cl= ick me to trigger script" + + writer.print("


    " + + "

    Partial Refresh Product Catalog

    " + + "
    " + + ""); + writer.print("
    "); + resourceURL.setParameter("prodId","1"); + writer.print("Product 1
    "); + + resourceURL.setParameter("prodId","2"); + writer.print("Product 2
    "); + + resourceURL.setParameter("prodId","3"); + writer.print("Product 3
    "); + + writer.print("
    "); + writer.print("
    " + + "

    Product Details

    " + + "
    " + + ""); + writer.print("
    "); + writer.print("
    "); + writer.print("
    "); + + + + // writer.print("
    "); + } + + public void serveResource(ResourceRequest req, ResourceResponse resp) t= hrows PortletException, IOException + { + String repeatText =3D req.getParameter("repeat"); + String prodId =3D req.getParameter("prodId"); + + String namespace =3Dresp.getNamespace(); + //resp.setContentType("application/json"); + resp.setContentType("text/html"); + PrintWriter writer =3D resp.getWriter(); + if (repeatText !=3D null){ + writer.print("
    "+ req.getPrivateParamete= rMap().get("repeat")[0] +"
    "); + } + if (prodId !=3D null){ + if (prodId.equals("1")){ + writer.print("
    Product ID: "+ prodId= +"" + + "
    " + + " B BY BURTON ALPHA
    " + + "Sale Price: $314.96 " + + "
    "); + } + if (prodId.equals("2")){ + writer.print("
    Product ID: "+ prodId= +"" + + "
    " + + "FORUM DESTROYER LTD
    " + + "$319.99 " + + "
    "); + } + if (prodId.equals("3")){ + writer.print("
    Product ID: "+ prodId= +"" + + "
    " + + "\n" + + "SANTA CRUZ ALLSTAR
    " + + "$256.00 " + + "
    "); + } + + } + + + + + writer.close(); + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/samples/basic/NullFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/basic/NullFilter.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/basic/NullFilter.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,75 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.portal.samples.basic; + +import javax.portlet.filter.RenderFilter; +import javax.portlet.filter.ActionFilter; +import javax.portlet.filter.EventFilter; +import javax.portlet.filter.ResourceFilter; +import javax.portlet.filter.FilterChain; +import javax.portlet.filter.FilterConfig; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import java.io.IOException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class NullFilter implements RenderFilter, ActionFilter, EventFilter= , ResourceFilter +{ + public void init(FilterConfig config) throws PortletException + { + } + + public void doFilter(RenderRequest req, RenderResponse resp, FilterChai= n chain) throws IOException, PortletException + { + chain.doFilter(req, resp); + } + + public void doFilter(ActionRequest req, ActionResponse resp, FilterChai= n chain) throws IOException, PortletException + { + chain.doFilter(req, resp); + } + + public void doFilter(EventRequest req, EventResponse resp, FilterChain = chain) throws IOException, PortletException + { + chain.doFilter(req, resp); + } + + public void doFilter(ResourceRequest req, ResourceResponse resp, Filter= Chain chain) throws IOException, PortletException + { + chain.doFilter(req, resp); + } + + public void destroy() + { + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/samples/event/CartEvent.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/event/CartEvent.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/event/CartEvent.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,50 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.portal.samples.event; + +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.namespace.QName; +import java.io.Serializable; + +/** + * @author Chris Laprun + * @version $Revision: 9912 $ + */ +(a)XmlRootElement +public class CartEvent implements Serializable +{ + private String id; + + public static final QName QNAME =3D new QName("urn:jboss:portal:samples= :event", "CartEvent"); + + public CartEvent(String id) + { + this.id =3D id; + } + + public String getId() + { + return id; + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/samples/event/CartPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/event/CartPortlet.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/event/CartPortlet.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,83 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.portal.samples.event; + +import javax.portlet.Event; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.GenericPortlet; +import javax.portlet.PortletException; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import java.io.IOException; +import java.io.Writer; +import java.util.ArrayList; +import java.util.List; + +/** + * @author Chris Laprun + * @version $Revision: 9932 $ + */ +public class CartPortlet extends GenericPortlet +{ + List items =3D new ArrayList(7); + + @Override + protected void doView(RenderRequest renderRequest, RenderResponse rende= rResponse) throws PortletException, IOException + { + renderResponse.setContentType("text/html"); + Writer writer =3D renderResponse.getWriter(); + + + if (!items.isEmpty()) + { + writer.append(""); + int total =3D 0; + for (CatalogItem item : items) + { + int price =3D item.getPrice(); + total +=3D price; + writer.append(""); + } + writer.append("
    DescriptionPric= e
    ").append(item.getDescription()).append= ("$").append("" + price) + .append("
    Total:") + .append("$" + total).append("
    "); + } + else + { + writer.append("Cart is empty."); + } + } + + @Override + public void processEvent(EventRequest eventRequest, EventResponse event= Response) throws PortletException, IOException + { + Event event =3D eventRequest.getEvent(); + if (event.getName().equals("CartEvent")) + { + CartEvent cartEvent =3D (CartEvent)event.getValue(); + items.add(Catalog.get(cartEvent.getId())); + } + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/samples/event/Catalog.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/event/Catalog.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/event/Catalog.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,63 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.portal.samples.event; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +/** + * @author Chris Laprun + * @version $Revision: 9912 $ + */ +public class Catalog +{ + private static Map items; + + static + { + items =3D new HashMap(7); + items.put("1", new CatalogItem("1", 800, "Bike")); + items.put("2", new CatalogItem("2", 450, "Snowboard")); + items.put("3", new CatalogItem("3", 225, "Tent")); + items.put("4", new CatalogItem("4", 75, "Backpack")); + items.put("5", new CatalogItem("5", 119, "Skateboard")); + items.put("6", new CatalogItem("6", 333, "Surfboard")); + items.put("7", new CatalogItem("7", 90, "Sneakers")); + } + + private Catalog() + { + } + + public static CatalogItem get(String id) + { + return items.get(id); + } + + public static Collection getAll() + { + return items.values(); + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/samples/event/CatalogItem.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/event/CatalogItem.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/event/CatalogItem.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,57 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.portal.samples.event; + +/** + * @author Chris Laprun + * @version $Revision: 9912 $ + */ +public class CatalogItem +{ + private String id; + private int price; + private String description; + + public CatalogItem(String id, int price, String description) + { + this.id =3D id; + this.price =3D price; + this.description =3D description; + } + + public String getId() + { + return id; + } + + public int getPrice() + { + return price; + } + + public String getDescription() + { + return description; + } +} Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/= portal/samples/event/CatalogPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/event/CatalogPortlet.java (rev 0) +++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/por= tal/samples/event/CatalogPortlet.java 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,71 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2008, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ + +package org.jboss.portal.portlet.portal.samples.event; + +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.GenericPortlet; +import javax.portlet.PortletException; +import javax.portlet.PortletURL; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import java.io.IOException; +import java.io.Writer; +import java.util.Collection; + +/** + * @author Chris Laprun + * @version $Revision: 9932 $ + */ +public class CatalogPortlet extends GenericPortlet +{ + @Override + protected void doView(RenderRequest renderRequest, RenderResponse rende= rResponse) throws PortletException, IOException + { + renderResponse.setContentType("text/html"); + Writer writer =3D renderResponse.getWriter(); + + writer.append(""); + + PortletURL addURL =3D renderResponse.createActionURL(); + addURL.setParameter("op", "add"); + + Collection items =3D Catalog.getAll(); + for (CatalogItem item : items) + { + addURL.setParameter("id", item.getId()); + writer.append(""); + } + + writer.append("
    DescriptionPriceActions
    ").append(item.getDescription()).append("<= /td>$").append("" + item.getPrice()) + .append("Add to cart
    "); + } + + @Override + public void processAction(ActionRequest actionRequest, ActionResponse a= ctionResponse) throws PortletException, IOException + { + String value =3D actionRequest.getParameter("id"); + actionResponse.setEvent(CartEvent.QNAME, new CartEvent(value)); + } +} Copied: modules/portlet/trunk/portal/src/main/resources/samples (from rev 1= 0138, modules/portlet/trunk/test/src/test/resources/portal/samples) Copied: modules/portlet/trunk/portal/src/main/resources/samples/basic-war (= from rev 10160, modules/portlet/trunk/test/src/test/resources/portal/sample= s/basic-war) Copied: modules/portlet/trunk/portal/src/main/resources/samples/cart-event-= portlet-war (from rev 10160, modules/portlet/trunk/test/src/test/resources/= portal/samples/cart-event-portlet-war) Copied: modules/portlet/trunk/portal/src/main/resources/samples/google-map-= portlet-war (from rev 10160, modules/portlet/trunk/test/src/test/resources/= portal/samples/google-map-portlet-war) Copied: modules/portlet/trunk/portal/src/main/resources/samples/google-weat= her-portlet-war (from rev 10160, modules/portlet/trunk/test/src/test/resour= ces/portal/samples/google-weather-portlet-war) Copied: modules/portlet/trunk/portal/src/main/resources/samples/remotecontr= ol-portlet-war (from rev 10160, modules/portlet/trunk/test/src/test/resourc= es/portal/samples/remotecontrol-portlet-war) Copied: modules/portlet/trunk/portal/src/main/resources/simple-portal-war (= from rev 10138, modules/portlet/trunk/test/src/test/resources/simple-portal= -war) Copied: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/M= ETA-INF (from rev 10160, modules/portlet/trunk/test/src/test/resources/simp= le-portal-war/META-INF) Copied: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/W= EB-INF (from rev 10160, modules/portlet/trunk/test/src/test/resources/simpl= e-portal-war/WEB-INF) Modified: modules/portlet/trunk/portal/src/main/resources/simple-portal-war= /WEB-INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /jboss-beans.xml 2008-02-29 17:41:05 UTC (rev 10160) +++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-I= NF/jboss-beans.xml 2008-02-29 23:47:01 UTC (rev 10161) @@ -45,7 +45,7 @@ - + @@ -55,7 +55,7 @@ = - + @@ -70,7 +70,7 @@ - + Added: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WE= B-INF/jboss-web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-I= NF/jboss-web.xml (rev 0) +++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-I= NF/jboss-web.xml 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,31 @@ + + + + + + test:loader=3Dportlet + + \ No newline at end of file Modified: modules/portlet/trunk/portal/src/main/resources/simple-portal-war= /WEB-INF/portal.tld =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /portal.tld 2008-02-29 17:41:05 UTC (rev 10160) +++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-I= NF/portal.tld 2008-02-29 23:47:01 UTC (rev 10161) @@ -10,13 +10,13 @@ = page - org.jboss.portal.portlet.test.jsp.taglib.PageTag + org.jboss.portal.portlet.portal.jsp.taglib.PageTag JSP = portlet - org.jboss.portal.portlet.test.jsp.taglib.PortletTag + org.jboss.portal.portlet.portal.jsp.taglib.PortletTag JSP name @@ -54,19 +54,19 @@ = portletmarkup - org.jboss.portal.portlet.test.jsp.taglib.PortletMarkupTag= + org.jboss.portal.portlet.portal.jsp.taglib.PortletMarkupT= ag empty = portlettitle - org.jboss.portal.portlet.test.jsp.taglib.PortletTitleTag<= /tag-class> + org.jboss.portal.portlet.portal.jsp.taglib.PortletTitleTa= g empty = portleturl - org.jboss.portal.portlet.test.jsp.taglib.PortletURLTag + org.jboss.portal.portlet.portal.jsp.taglib.PortletURLTag<= /tag-class> JSP mode @@ -82,7 +82,7 @@ = param - org.jboss.portal.portlet.test.jsp.taglib.ParamTag + org.jboss.portal.portlet.portal.jsp.taglib.ParamTag empty name @@ -100,7 +100,7 @@ = pageparam - org.jboss.portal.portlet.test.jsp.taglib.PageParamTag + org.jboss.portal.portlet.portal.jsp.taglib.PageParamTag empty namespaceURI @@ -129,7 +129,7 @@ = headers - org.jboss.portal.portlet.test.jsp.taglib.HeadersTag + org.jboss.portal.portlet.portal.jsp.taglib.HeadersTag empty = Modified: modules/portlet/trunk/portal/src/main/resources/simple-portal-war= /WEB-INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF= /web.xml 2008-02-29 17:41:05 UTC (rev 10160) +++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-I= NF/web.xml 2008-02-29 23:47:01 UTC (rev 10161) @@ -28,7 +28,7 @@ version=3D"2.5"> ControllerFilter - org.jboss.portal.portlet.test.jsp.ControllerFilter + org.jboss.portal.portlet.portal.jsp.ControllerFilter ControllerFilter Copied: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/c= ss (from rev 10160, modules/portlet/trunk/test/src/test/resources/simple-po= rtal-war/css) Copied: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/d= emo (from rev 10160, modules/portlet/trunk/test/src/test/resources/simple-p= ortal-war/demo) Copied: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/i= mages (from rev 10160, modules/portlet/trunk/test/src/test/resources/simple= -portal-war/images) Deleted: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/= index.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.j= sp 2008-02-27 20:42:50 UTC (rev 10138) +++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/index= .jsp 2008-02-29 23:47:01 UTC (rev 10161) @@ -1,8 +0,0 @@ -<%@ page language=3D"java" %> -<%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> -<%@ page isELIgnored=3D"false" %> - - - - - Copied: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/i= ndex.jsp (from rev 10160, modules/portlet/trunk/test/src/test/resources/sim= ple-portal-war/index.jsp) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portal/src/main/resources/simple-portal-war/index= .jsp (rev 0) +++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/index= .jsp 2008-02-29 23:47:01 UTC (rev 10161) @@ -0,0 +1,8 @@ +<%@ page language=3D"java" %> +<%@ taglib uri=3D"/WEB-INF/portal.tld" prefix=3D"portal" %> +<%@ page isELIgnored=3D"false" %> + + + + + Copied: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/j= s (from rev 10160, modules/portlet/trunk/test/src/test/resources/simple-por= tal-war/js) Copied: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/l= ayouts (from rev 10160, modules/portlet/trunk/test/src/test/resources/simpl= e-portal-war/layouts) Modified: modules/portlet/trunk/test/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/pom.xml 2008-02-29 17:41:05 UTC (rev 10160) +++ modules/portlet/trunk/test/pom.xml 2008-02-29 23:47:01 UTC (rev 10161) @@ -367,7 +367,6 @@ = - = Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-29 17:41:05 UTC (= rev 10160) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-29 23:47:01 UTC (= rev 10161) @@ -699,29 +699,6 @@ = = - - - - - - - - - - - - - - - - - - - - - - - = @@ -871,83 +848,7 @@ = = - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + = \ No newline at end of file --===============0425153434645711631==-- From portal-commits at lists.jboss.org Fri Feb 29 18:49:38 2008 Content-Type: multipart/mixed; boundary="===============0434071961540793668==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10162 - modules/portlet/trunk/test/src/test/resources. Date: Fri, 29 Feb 2008 18:49:38 -0500 Message-ID: --===============0434071961540793668== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-29 18:49:38 -0500 (Fri, 29 Feb 2008) New Revision: 10162 Removed: modules/portlet/trunk/test/src/test/resources/portal/ Log: remove empty dir --===============0434071961540793668==-- From portal-commits at lists.jboss.org Fri Feb 29 18:50:13 2008 Content-Type: multipart/mixed; boundary="===============0090688265482820792==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10163 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet. Date: Fri, 29 Feb 2008 18:50:13 -0500 Message-ID: --===============0090688265482820792== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-29 18:50:12 -0500 (Fri, 29 Feb 2008) New Revision: 10163 Removed: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/ Log: remove empty dir --===============0090688265482820792==--