Author: jogep Date: Sun Jun 26 09:53:13 2011 New Revision: 1139753 URL: http://svn.apache.org/viewvc?rev=1139753&view=rev Log: WW-3620: Bring Portlet 2.0 (JSR286) plugin from sandbox to trunk
Modified: struts/struts2/trunk/apps/portlet/pom.xml struts/struts2/trunk/apps/portlet/src/main/webapp/WEB-INF/portlet.xml struts/struts2/trunk/apps/portlet/src/main/webapp/WEB-INF/web.xml struts/struts2/trunk/archetypes/struts2-archetype-dbportlet/src/main/resources/archetype-resources/pom.xml struts/struts2/trunk/archetypes/struts2-archetype-dbportlet/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/portlet.xml struts/struts2/trunk/archetypes/struts2-archetype-portlet/src/main/resources/archetype-resources/pom.xml struts/struts2/trunk/archetypes/struts2-archetype-portlet/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/portlet.xml struts/struts2/trunk/plugins/portlet/pom.xml struts/struts2/trunk/plugins/portlet/src/test/java/org/apache/struts2/portlet/PortletRequestMapTest.java struts/struts2/trunk/pom.xml Modified: struts/struts2/trunk/apps/portlet/pom.xml URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/portlet/pom.xml?rev=1139753&r1=1139752&r2=1139753&view=diff ============================================================================== --- struts/struts2/trunk/apps/portlet/pom.xml (original) +++ struts/struts2/trunk/apps/portlet/pom.xml Sun Jun 26 09:53:13 2011 @@ -93,8 +93,8 @@ <dependencies> <dependency> - <groupId>portlet-api</groupId> - <artifactId>portlet-api</artifactId> + <groupId>javax.portlet</groupId> + <artifactId>portlet-api</artifactId> <scope>provided</scope> </dependency> <dependency> Modified: struts/struts2/trunk/apps/portlet/src/main/webapp/WEB-INF/portlet.xml URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/portlet/src/main/webapp/WEB-INF/portlet.xml?rev=1139753&r1=1139752&r2=1139753&view=diff ============================================================================== --- struts/struts2/trunk/apps/portlet/src/main/webapp/WEB-INF/portlet.xml (original) +++ struts/struts2/trunk/apps/portlet/src/main/webapp/WEB-INF/portlet.xml Sun Jun 26 09:53:13 2011 @@ -73,7 +73,7 @@ <portlet-name>StrutsPortlet2</portlet-name> <display-name xml:lang="EN">Struts Test Portlet2</display-name> - <portlet-class>org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class> + <portlet-class>org.apache.struts2.portlet.dispatcher.Jsr286Dispatcher</portlet-class> <!-- The view mode namespace. Maps to a namespace in the Struts 2 config file. --> <init-param> Modified: struts/struts2/trunk/apps/portlet/src/main/webapp/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/portlet/src/main/webapp/WEB-INF/web.xml?rev=1139753&r1=1139752&r2=1139753&view=diff ============================================================================== --- struts/struts2/trunk/apps/portlet/src/main/webapp/WEB-INF/web.xml (original) +++ struts/struts2/trunk/apps/portlet/src/main/webapp/WEB-INF/web.xml Sun Jun 26 09:53:13 2011 @@ -8,11 +8,8 @@ /WEB-INF/applicationContext*.xml </param-value> </context-param> + <listener> + <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> + </listener> - <!-- Uncomment to use the dispatcher servlet --> - <!--<servlet id="Struts2PortletDispatcherServlet"> - <servlet-name>Struts2PortletDispatcherServlet</servlet-name> - <servlet-class>org.apache.struts2.portlet.dispatcher.DispatcherServlet</servlet-class> - </servlet>--> - </web-app> Modified: struts/struts2/trunk/archetypes/struts2-archetype-dbportlet/src/main/resources/archetype-resources/pom.xml URL: http://svn.apache.org/viewvc/struts/struts2/trunk/archetypes/struts2-archetype-dbportlet/src/main/resources/archetype-resources/pom.xml?rev=1139753&r1=1139752&r2=1139753&view=diff ============================================================================== --- struts/struts2/trunk/archetypes/struts2-archetype-dbportlet/src/main/resources/archetype-resources/pom.xml (original) +++ struts/struts2/trunk/archetypes/struts2-archetype-dbportlet/src/main/resources/archetype-resources/pom.xml Sun Jun 26 09:53:13 2011 @@ -59,7 +59,7 @@ <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> - <version>2.5.6</version> + <version>3.0.5.RELEASE</version> </dependency> <!-- Database driver (change for your specific database) --> @@ -85,9 +85,9 @@ </dependency> <dependency> - <groupId>portlet-api</groupId> + <groupId>javax.portlet</groupId> <artifactId>portlet-api</artifactId> - <version>1.0</version> + <version>2.0</version> <scope>provided</scope> </dependency> @@ -117,9 +117,9 @@ </configuration> <dependencies> <dependency> - <groupId>portlet-api</groupId> + <groupId>javax.portlet</groupId> <artifactId>portlet-api</artifactId> - <version>1.0</version> + <version>2.0</version> </dependency> </dependencies> </plugin> Modified: struts/struts2/trunk/archetypes/struts2-archetype-dbportlet/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/portlet.xml URL: http://svn.apache.org/viewvc/struts/struts2/trunk/archetypes/struts2-archetype-dbportlet/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/portlet.xml?rev=1139753&r1=1139752&r2=1139753&view=diff ============================================================================== --- struts/struts2/trunk/archetypes/struts2-archetype-dbportlet/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/portlet.xml (original) +++ struts/struts2/trunk/archetypes/struts2-archetype-dbportlet/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/portlet.xml Sun Jun 26 09:53:13 2011 @@ -6,7 +6,7 @@ xsi:schemaLocation="http://java.sun.com/ <portlet-name>StrutsDBPortlet</portlet-name> <display-name xml:lang="EN">Struts Database Portlet</display-name> - <portlet-class>org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class> + <portlet-class>org.apache.struts2.portlet.dispatcher.Jsr286Dispatcher</portlet-class> <init-param> <name>actionPackages</name> Modified: struts/struts2/trunk/archetypes/struts2-archetype-portlet/src/main/resources/archetype-resources/pom.xml URL: http://svn.apache.org/viewvc/struts/struts2/trunk/archetypes/struts2-archetype-portlet/src/main/resources/archetype-resources/pom.xml?rev=1139753&r1=1139752&r2=1139753&view=diff ============================================================================== --- struts/struts2/trunk/archetypes/struts2-archetype-portlet/src/main/resources/archetype-resources/pom.xml (original) +++ struts/struts2/trunk/archetypes/struts2-archetype-portlet/src/main/resources/archetype-resources/pom.xml Sun Jun 26 09:53:13 2011 @@ -37,7 +37,7 @@ <dependency> <groupId>javax.portlet</groupId> <artifactId>portlet-api</artifactId> - <version>1.0</version> + <version>2.0</version> <scope>provided</scope> </dependency> Modified: struts/struts2/trunk/archetypes/struts2-archetype-portlet/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/portlet.xml URL: http://svn.apache.org/viewvc/struts/struts2/trunk/archetypes/struts2-archetype-portlet/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/portlet.xml?rev=1139753&r1=1139752&r2=1139753&view=diff ============================================================================== --- struts/struts2/trunk/archetypes/struts2-archetype-portlet/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/portlet.xml (original) +++ struts/struts2/trunk/archetypes/struts2-archetype-portlet/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/portlet.xml Sun Jun 26 09:53:13 2011 @@ -12,7 +12,7 @@ <portlet-name>HelloPortlet</portlet-name> <display-name xml:lang="EN">${artifactId}</display-name> - <portlet-class>org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class> + <portlet-class>org.apache.struts2.portlet.dispatcher.Jsr286Dispatcher</portlet-class> <!-- The namespace for the actions configured for view mode --> <init-param> Modified: struts/struts2/trunk/plugins/portlet/pom.xml URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/portlet/pom.xml?rev=1139753&r1=1139752&r2=1139753&view=diff ============================================================================== --- struts/struts2/trunk/plugins/portlet/pom.xml (original) +++ struts/struts2/trunk/plugins/portlet/pom.xml Sun Jun 26 09:53:13 2011 @@ -1,66 +1,62 @@ <?xml version="1.0" encoding="UTF-8"?> - <!-- - /* * $Id: pom.xml 601700 2007-12-06 11:05:08Z nilsga $ * * Licensed to - the Apache Software Foundation (ASF) under one * or more contributor - license agreements. See the NOTICE file * distributed with this work - for additional information * regarding copyright ownership. The ASF - licenses this file * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance * with - the License. You may obtain a copy of the License at * * - http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by - applicable law or agreed to in writing, * software distributed under - the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES - OR CONDITIONS OF ANY * KIND, either express or implied. See the - License for the * specific language governing permissions and - limitations * under the License. */ - --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.struts</groupId> - <artifactId>struts2-plugins</artifactId> - <version>2.3.1-SNAPSHOT</version> - </parent> - <groupId>org.apache.struts</groupId> - <artifactId>struts2-portlet2-plugin</artifactId> - <packaging>jar</packaging> - <name>Struts 2 Portlet 2.0 Plugin</name> - - <scm> - <connection>scm:svn:http://svn.apache.org/repos/asf/struts/sandbox/trunk/struts2-portlet2-plugin/</connection> - <developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/sandbox/trunk/struts2-portlet2-plugin/ - </developerConnection> - <url>http://svn.apache.org/repos/asf/struts/sandbox/trunk/struts2-portlet2-plugin/</url> - </scm> - - <dependencies> - <dependency> - <groupId>asm</groupId> - <artifactId>asm</artifactId> - <version>3.3</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>asm</groupId> - <artifactId>asm-commons</artifactId> - <version>3.3</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - <version>4.8.2</version> - </dependency> - - <dependency> - <groupId>javax.servlet.jsp</groupId> - <artifactId>jsp-api</artifactId> - <version>2.1</version> - <scope>provided</scope> - </dependency> +<!-- +/* + * $Id: pom.xml 1090136 2011-04-08 06:39:51Z lukaszlenart $ + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.struts</groupId> + <artifactId>struts2-plugins</artifactId> + <version>2.3.1-SNAPSHOT</version> + </parent> + <groupId>org.apache.struts</groupId> + <artifactId>struts2-portlet-plugin</artifactId> + <packaging>jar</packaging> + <name>Struts 2 Portlet Plugin</name> + + <scm> + <connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/plugins/portlet/</connection> + <developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/plugins/portlet/</developerConnection> + <url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/plugins/portlet/</url> + </scm> + + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>struts2-junit-plugin</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>jsp-api</artifactId> + <scope>provided</scope> + </dependency> <dependency> <groupId>commons-lang</groupId> @@ -71,140 +67,84 @@ <dependency> <groupId>org.apache.velocity</groupId> <artifactId>velocity</artifactId> - <version>1.6.3</version> <optional>true</optional> </dependency> <dependency> <groupId>org.apache.velocity</groupId> <artifactId>velocity-tools</artifactId> - <version>1.3</version> <optional>true</optional> - <exclusions> - <exclusion> - <groupId>velocity</groupId> - <artifactId>velocity</artifactId> - </exclusion> - <exclusion> - <groupId>struts</groupId> - <artifactId>struts</artifactId> - </exclusion> - </exclusions> - </dependency> - - <!-- Portlet --> - <dependency> - <groupId>javax.portlet</groupId> - <artifactId>portlet-api</artifactId> - <version>2.0</version> - <optional>true</optional> - </dependency> - - <dependency> - <groupId>mockobjects</groupId> - <artifactId>mockobjects-jdk1.3-j2ee1.3</artifactId> - <version>0.09</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.easymock</groupId> - <artifactId>easymock</artifactId> - <version>2.4</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.easymock</groupId> - <artifactId>easymockclassextension</artifactId> - <version>2.4</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>jmock</groupId> - <artifactId>jmock</artifactId> - <version>1.2.0</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>jmock</groupId> - <artifactId>jmock-cglib</artifactId> - <version>1.2.0</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>mockobjects</groupId> - <artifactId>mockobjects-core</artifactId> - <version>0.09</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.9</version> - <scope>test</scope> - </dependency> - - <!-- Mocks for unit testing (by Spring) --> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-mock</artifactId> - <version>2.0.7</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-portlet</artifactId> - <version>2.0.7</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>2.5.6</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>commons-fileupload</groupId> - <artifactId>commons-fileupload</artifactId> - <version>1.2.2</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>struts2-junit-plugin</artifactId> - <version>${project.version}</version> - <scope>test</scope> - </dependency> - </dependencies> - - <repositories> - <repository> - <id>apache.snapshots</id> - <name>Apache Maven Repository (Snapshots and Test Builds)</name> - <url>http://people.apache.org/repo/m2-snapshot-repository</url> - <releases> - <enabled>false</enabled> - </releases> - <snapshots> - <enabled>true</enabled> - </snapshots> - </repository> - <repository> - <id>exo</id> - <name>Exlolab repository</name> - <url>http://maven2.exoplatform.org/maven/</url> - <releases> - <enabled>true</enabled> - </releases> - <snapshots> - <enabled>false</enabled> - </snapshots> - </repository> + </dependency> + + <!-- Portlet --> + <dependency> + <groupId>javax.portlet</groupId> + <artifactId>portlet-api</artifactId> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>mockobjects</groupId> + <artifactId>mockobjects-jdk1.3-j2ee1.3</artifactId> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.easymock</groupId> + <artifactId>easymock</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>jmock</groupId> + <artifactId>jmock</artifactId> + <scope>test</scope> + </dependency> - </repositories> + <dependency> + <groupId>jmock</groupId> + <artifactId>jmock-cglib</artifactId> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>mockobjects</groupId> + <artifactId>mockobjects-core</artifactId> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <scope>test</scope> + </dependency> + + <!-- Mocks for unit testing (by Spring) --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-mock</artifactId> + <version>2.0.7</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-portlet</artifactId> + <version>2.0.8</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>commons-fileupload</groupId> + <artifactId>commons-fileupload</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + <scope>test</scope> + </dependency> + </dependencies> </project> Modified: struts/struts2/trunk/plugins/portlet/src/test/java/org/apache/struts2/portlet/PortletRequestMapTest.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/portlet/src/test/java/org/apache/struts2/portlet/PortletRequestMapTest.java?rev=1139753&r1=1139752&r2=1139753&view=diff ============================================================================== --- struts/struts2/trunk/plugins/portlet/src/test/java/org/apache/struts2/portlet/PortletRequestMapTest.java (original) +++ struts/struts2/trunk/plugins/portlet/src/test/java/org/apache/struts2/portlet/PortletRequestMapTest.java Sun Jun 26 09:53:13 2011 @@ -83,25 +83,27 @@ public class PortletRequestMapTest exten PortletRequestMap map = new PortletRequestMap(request); Set entries = map.entrySet(); - assertEquals(2, entries.size()); + assertEquals(3, entries.size()); Iterator it = entries.iterator(); - Map.Entry entry = (Map.Entry)it.next(); - checkEntry(entry); - entry = (Map.Entry)it.next(); - checkEntry(entry); - + for (Iterator iterator = entries.iterator(); iterator.hasNext();) { + Map.Entry entry = (Map.Entry) iterator.next(); + checkEntry(entry); + } } - private void checkEntry(Map.Entry entry) { - if(entry.getKey().equals("testAttribute1")) { + private void checkEntry(Map.Entry entry) { + if(entry.getKey().equals("testAttribute1")) { assertEquals("testValue1", entry.getValue()); } else if(entry.getKey().equals("testAttribute2")) { assertEquals("testValue2", entry.getValue()); } + else if(entry.getKey().equals("javax.portlet.lifecycle_phase")) { + assertNull(entry.getValue()); + } else { - fail("Unexpected entry in etry set: " + entry); + fail("Unexpected entry in entry set: " + entry); } - } + } } Modified: struts/struts2/trunk/pom.xml URL: http://svn.apache.org/viewvc/struts/struts2/trunk/pom.xml?rev=1139753&r1=1139752&r2=1139753&view=diff ============================================================================== --- struts/struts2/trunk/pom.xml (original) +++ struts/struts2/trunk/pom.xml Sun Jun 26 09:53:13 2011 @@ -87,7 +87,7 @@ <currentVersion>${project.version}</currentVersion> <struts2.springPlatformVersion>3.0.5.RELEASE</struts2.springPlatformVersion> <ognl.version>3.0.2</ognl.version> - <asm.version>3.1</asm.version> + <asm.version>3.3</asm.version> <tiles.version>2.0.6</tiles.version> </properties> @@ -625,14 +625,14 @@ <dependency> <groupId>jmock</groupId> <artifactId>jmock</artifactId> - <version>1.0.1</version> + <version>1.2.0</version> <scope>test</scope> </dependency> <dependency> <groupId>jmock</groupId> <artifactId>jmock-cglib</artifactId> - <version>1.0.1</version> + <version>1.2.0</version> <scope>test</scope> </dependency> @@ -682,9 +682,9 @@ <!-- Portlet --> <dependency> - <groupId>portlet-api</groupId> + <groupId>javax.portlet</groupId> <artifactId>portlet-api</artifactId> - <version>1.0</version> + <version>2.0</version> </dependency> <dependency>