You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by ms...@apache.org on 2015/11/27 13:37:42 UTC

[01/38] portals-pluto git commit: Replaced code that reads the deployment descriptor with an implementation that can be better extended to add v3.0 support. Added test cases. Uses jaxb binding classes that are generated at compile time.

Repository: portals-pluto
Updated Branches:
  refs/heads/V3Prototype 4bd6c63f0 -> 875769b8d


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet286NoCache.xml
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet286NoCache.xml b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet286NoCache.xml
new file mode 100644
index 0000000..8b54a86
--- /dev/null
+++ b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet286NoCache.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app id="id1"
+   xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+   version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
+http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
+
+   <portlet>
+      <description>AboutPortletDescription</description>
+      <portlet-name>AboutPortlet</portlet-name>
+      <display-name>About Portlet</display-name>
+      <display-name xml:lang="fr">About Portlet</display-name>
+      <portlet-class>org.apache.pluto.driver.portlets.AboutPortlet</portlet-class>
+      <init-param>
+         <description xml:lang="de">a</description>
+         <name>b</name>
+         <value>v</value>
+      </init-param>
+      <supports>
+         <mime-type>text/html</mime-type>
+         <portlet-mode>VIEW</portlet-mode>
+         <portlet-mode>EDIT</portlet-mode>
+         <portlet-mode>HELP</portlet-mode>
+      </supports>
+      <supported-locale>en</supported-locale>
+      <portlet-info>
+         <title>About Apache Pluto</title>
+      </portlet-info>
+   </portlet>
+   <custom-portlet-mode id="mode1">
+      <description xml:lang="de">description</description>
+      <portlet-mode>portlet-mode</portlet-mode>
+   </custom-portlet-mode>
+   <custom-window-state id="state1">
+      <description xml:lang="de">description</description>
+      <window-state>window-state</window-state>
+   </custom-window-state>
+   <user-attribute id="att1">
+      <description xml:lang="de">description</description>
+      <name>name</name>
+   </user-attribute>
+   <security-constraint id="cons1">
+      <display-name xml:lang="de">display-name</display-name>
+      <portlet-collection>
+         <portlet-name>portlet-name</portlet-name>
+      </portlet-collection>
+      <user-data-constraint id="data1">
+         <description xml:lang="de">description</description>
+         <transport-guarantee>NONE</transport-guarantee>
+      </user-data-constraint>
+   </security-constraint>
+   <resource-bundle>resource-bundle</resource-bundle>
+   <filter>
+      <description xml:lang="de">description</description>
+      <display-name xml:lang="de">display-name</display-name>
+      <filter-name>filter-name</filter-name>
+      <filter-class>filter-class</filter-class>
+      <lifecycle>lifecycle</lifecycle>
+      <init-param id="init2">
+         <description xml:lang="de">description</description>
+         <name>name</name>
+         <value>value</value>
+      </init-param>
+   </filter>
+   <filter-mapping>
+      <filter-name>filter-name</filter-name>
+      <portlet-name>portlet-name</portlet-name>
+   </filter-mapping>
+   <event-definition id="event1">
+      <description xml:lang="de">description</description>
+      <name>QName</name>
+      <alias>QName</alias>
+      <value-type>java-class</value-type>
+   </event-definition>
+   <public-render-parameter id="public1">
+      <description xml:lang="de">description</description>
+      <identifier>identifier</identifier>
+      <qname>QName</qname>
+   </public-render-parameter>
+   <public-render-parameter id="public2">
+      <description xml:lang="de">description2</description>
+      <identifier>identifier2</identifier>
+      <name>Name</name>
+   </public-render-parameter>
+   <container-runtime-option>
+      <name>Runtime-Option-Portlet-App</name>
+      <value>false</value>
+   </container-runtime-option>
+</portlet-app>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet362Generated.xml
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet362Generated.xml b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet362Generated.xml
new file mode 100644
index 0000000..f3cd5a7
--- /dev/null
+++ b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet362Generated.xml
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app id="id1" version="3.0"
+   xmlns="http://xmlns.jcp.org/xml/ns/portlet" 
+   xmlns:portlet="http://xmlns.jcp.org/xml/ns/portlet" 
+   xmlns:xml="http://www.w3.org/XML/1998/namespace"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/portlet portlet-app_3_0.xsd ">
+
+   <!-- generated test file -->
+
+   <portlet id="id2">
+      <description xml:lang="de">multi 
+      line 
+      description</description>
+      <portlet-name>portlet362</portlet-name>
+      <display-name xml:lang="de">display-name</display-name>
+      <portlet-class>org.apache.pluto.container.om.portlet.impl.fixtures.TestPortlet</portlet-class>
+      <init-param id="init1">
+         <description xml:lang="de">description</description>
+         <name>name</name>
+         <value>value</value>
+      </init-param>
+      <init-param id="init2">
+         <description xml:lang="de">description</description>
+         <name>nullValueParam</name>
+         <value></value>
+      </init-param>
+      <expiration-cache>50</expiration-cache>
+      <cache-scope>private</cache-scope>
+      <supports id="sup1">
+         <mime-type>mime-type</mime-type>
+         <portlet-mode>portlet-mode</portlet-mode>
+         <portlet:window-state>window-state</portlet:window-state>
+      </supports>
+      <supports id="sup2">
+         <mime-type>mime-type2</mime-type>
+         <portlet-mode>portlet-mode2</portlet-mode>
+         <portlet:window-state>window-state2</portlet:window-state>
+      </supports>
+      <supports id="sup3">
+         <mime-type>mime-type3</mime-type>
+         <portlet-mode>portlet-mode3</portlet-mode>
+         <portlet:window-state>window-state3</portlet:window-state>
+      </supports>
+      <supported-locale>supported-locale</supported-locale>
+      <resource-bundle>resource-bundle</resource-bundle>
+      <portlet-info id="info1">
+         <title>title</title>
+         <short-title>short-title</short-title>
+         <keywords>keywords</keywords>
+      </portlet-info>
+      <portlet-preferences id="prefs">
+         <preference id="pref1">
+            <name>name</name>
+            <value>value</value>
+            <read-only>true</read-only>
+         </preference>
+         <preferences-validator>
+            org.apache.pluto.container.om.portlet.impl.fixtures.TestPreferencesValidator
+         </preferences-validator>
+      </portlet-preferences>
+      <security-role-ref id="sec1">
+         <description xml:lang="de">description</description>
+         <role-name>NMTOKEN</role-name>
+         <role-link>role-link</role-link>
+      </security-role-ref>
+      <supported-processing-event>
+         <name>supported-processing-event</name>
+      </supported-processing-event>
+      <supported-publishing-event>
+         <qname xmlns:x="http://test.com">x:supported-publishing-event</qname>
+      </supported-publishing-event>
+      <supported-public-render-parameter>supported-public-render-parameter
+      </supported-public-render-parameter>
+      <container-runtime-option>
+         <name>Runtime-Option1</name>
+         <value>true</value>
+      </container-runtime-option>
+      <container-runtime-option>
+         <name>Runtime-Option2</name>
+         <value>value2</value>
+      </container-runtime-option>
+   </portlet>
+   <custom-portlet-mode id="mode1">
+      <description xml:lang="de">description</description>
+      <portlet-mode>portlet-mode</portlet-mode>
+      <portal-managed>false</portal-managed>
+   </custom-portlet-mode>
+   <custom-window-state id="state1">
+      <description xml:lang="de">description</description>
+      <window-state>window-state</window-state>
+   </custom-window-state>
+   <user-attribute id="att1">
+      <description xml:lang="de">description</description>
+      <name>name</name>
+   </user-attribute>
+   <security-constraint id="cons1">
+      <display-name xml:lang="de">display-name</display-name>
+      <portlet-collection>
+         <portlet-name>portlet362</portlet-name>
+      </portlet-collection>
+      <user-data-constraint id="data1">
+         <description xml:lang="de">description</description>
+         <transport-guarantee>NONE</transport-guarantee>
+      </user-data-constraint>
+   </security-constraint>
+   <resource-bundle>org.apache.portal.ResourceBundle</resource-bundle>
+   <filter>
+      <description xml:lang="de">description</description>
+      <display-name xml:lang="de">display-name</display-name>
+      <filter-name>filter-name</filter-name>
+      <filter-class>org.apache.pluto.container.om.portlet.impl.fixtures.TestFilter</filter-class>
+      <lifecycle>lifecycle</lifecycle>
+      <init-param id="init2">
+         <description xml:lang="de">description</description>
+         <name>name</name>
+         <value>value</value>
+      </init-param>
+   </filter>
+   <filter-mapping>
+      <filter-name>filter-name</filter-name>
+      <portlet-name>portlet362</portlet-name>
+   </filter-mapping>
+   <portlet:default-namespace>https://www.apache.org/</portlet:default-namespace>
+   <event-definition id="event1">
+      <description xml:lang="de">description</description>
+      <name>supported-processing-event</name>
+      <alias>QName</alias>
+      <value-type>org.apache.pluto.container.om.portlet.impl.fixtures.TestEventType</value-type>
+   </event-definition>
+   <event-definition id="event2">
+      <description xml:lang="de">description</description>
+      <qname xmlns:x="http://test.com">x:supported-publishing-event</qname>
+      <alias>QName</alias>
+      <value-type>java.lang.String</value-type>
+   </event-definition>
+   <public-render-parameter id="public1">
+      <description xml:lang="de">description</description>
+      <identifier>supported-public-render-parameter</identifier>
+      <qname>QName</qname>
+   </public-render-parameter>
+   <public-render-parameter id="public2">
+      <description xml:lang="de">description2</description>
+      <identifier>identifier2</identifier>
+      <name>Name</name>
+   </public-render-parameter>
+   <listener>
+      <description xml:lang="de">description</description>
+      <display-name xml:lang="de">display-name</display-name>
+      <listener-class>org.apache.pluto.container.om.portlet.impl.fixtures.TestListener</listener-class>
+   </listener>
+   <container-runtime-option>
+      <name>Runtime-Option-Portlet-App</name>
+      <value>false</value>
+   </container-runtime-option>
+</portlet-app>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/webApp23simple.xml
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/webApp23simple.xml b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/webApp23simple.xml
new file mode 100644
index 0000000..d8e3aba
--- /dev/null
+++ b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/webApp23simple.xml
@@ -0,0 +1,23 @@
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd" >
+
+<web-app>
+  <display-name>Servlet 2.3 Web Application</display-name>
+
+   <servlet>
+      <servlet-name>Fred</servlet-name>
+      <servlet-class>high-class</servlet-class>
+   </servlet>
+
+   <locale-encoding-mapping-list>
+      <locale-encoding-mapping>
+         <locale>de</locale>
+         <encoding>UTF-8</encoding>
+      </locale-encoding-mapping>
+      <locale-encoding-mapping>
+         <locale>ja</locale>
+         <encoding>Shift_JIS</encoding>
+      </locale-encoding-mapping>
+   </locale-encoding-mapping-list>
+</web-app>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/webApp24simple.xml
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/webApp24simple.xml b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/webApp24simple.xml
new file mode 100644
index 0000000..4a5473d
--- /dev/null
+++ b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/webApp24simple.xml
@@ -0,0 +1,24 @@
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
+         http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+         version="2.4">
+
+  <display-name>Servlet 2.4 Web Application</display-name>
+
+   <servlet>
+      <servlet-name>Fred</servlet-name>
+      <servlet-class>high-class</servlet-class>
+   </servlet>
+
+   <locale-encoding-mapping-list>
+      <locale-encoding-mapping>
+         <locale>de</locale>
+         <encoding>UTF-8</encoding>
+      </locale-encoding-mapping>
+      <locale-encoding-mapping>
+         <locale>ja</locale>
+         <encoding>Shift_JIS</encoding>
+      </locale-encoding-mapping>
+   </locale-encoding-mapping-list>
+</web-app>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/webApp25simple.xml
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/webApp25simple.xml b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/webApp25simple.xml
new file mode 100644
index 0000000..18a273c
--- /dev/null
+++ b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/webApp25simple.xml
@@ -0,0 +1,12 @@
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
+         http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+         version="2.5">
+
+   <servlet>
+      <servlet-name>Fred</servlet-name>
+      <servlet-class>high-class</servlet-class>
+   </servlet>
+
+</web-app>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/webApp30simple.xml
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/webApp30simple.xml b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/webApp30simple.xml
new file mode 100644
index 0000000..5ff33f8
--- /dev/null
+++ b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/webApp30simple.xml
@@ -0,0 +1,30 @@
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
+         http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+         version="3.0">
+
+   <servlet>
+      <servlet-name>Fred</servlet-name>
+      <servlet-class>high-class</servlet-class>
+   </servlet>
+
+   <locale-encoding-mapping-list>
+      <locale-encoding-mapping>
+         <locale>de_CH_CH</locale>
+         <encoding>UTF-8</encoding>
+      </locale-encoding-mapping>
+      <locale-encoding-mapping>
+         <locale>en_US</locale>
+         <encoding>UTF-8</encoding>
+      </locale-encoding-mapping>
+      <locale-encoding-mapping>
+         <locale>sl-rozaj-biske-1994</locale>
+         <encoding>UTF-8</encoding>
+      </locale-encoding-mapping>
+      <locale-encoding-mapping>
+         <locale>zh-Hans-CN</locale>
+         <encoding>Shift_JIS</encoding>
+      </locale-encoding-mapping>
+   </locale-encoding-mapping-list>
+</web-app>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/webApp31simple.xml
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/webApp31simple.xml b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/webApp31simple.xml
new file mode 100644
index 0000000..45e2c60
--- /dev/null
+++ b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/webApp31simple.xml
@@ -0,0 +1,22 @@
+<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
+       http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
+   version="3.1"
+>
+
+   <servlet>
+      <servlet-name>Fred</servlet-name>
+      <servlet-class>high-class</servlet-class>
+   </servlet>
+
+   <locale-encoding-mapping-list>
+      <locale-encoding-mapping>
+         <locale>de</locale>
+         <encoding>UTF-8</encoding>
+      </locale-encoding-mapping>
+      <locale-encoding-mapping>
+         <locale>ja</locale>
+         <encoding>Shift_JIS</encoding>
+      </locale-encoding-mapping>
+   </locale-encoding-mapping-list>
+</web-app>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index e90209f..0df5d83 100644
--- a/pom.xml
+++ b/pom.xml
@@ -273,7 +273,7 @@ generate mailto links. -->
     <ant.version>1.6.5</ant.version>
     <commons-io.version>1.3.1</commons-io.version>
     <ccpp-api.version>1.0</ccpp-api.version>
-    <junit.version>4.0</junit.version>
+    <junit.version>4.12</junit.version>
     <jmock.version>1.2.0</jmock.version>
     <xmlunit.version>1.1</xmlunit.version>
 
@@ -535,8 +535,8 @@ TODO: Check if we need all of them. -->
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId>
           <configuration>
-            <source>1.5</source>
-            <target>1.5</target>
+            <source>1.7</source>
+            <target>1.7</target>
           </configuration>
         </plugin>
         <plugin>


[23/38] portals-pluto git commit: Completed the move to dynamic servlet deployment. Now it should no longer be necessary to use the maven plugin to process the portlet web.xml files. The web.xml can be the minimum needed by the application itself, or can

Posted by ms...@apache.org.
Completed the move to dynamic servlet deployment. Now it should no longer be
necessary to use the maven plugin to process the portlet web.xml files. The
web.xml can be the minimum needed by the application itself, or can be not
present at all as allowed by the servlet specification 3.1. The portlet DD
is still needed, however, since the configuration through annotation code is
not yet implemented.

One point that needs to be addressed in the future is the servlet container
initializer. Portlet container bringup should probably be moved to a Spring
WebApplicationInitializer, which would probably allow a nicer module
structure.


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/8fb2d088
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/8fb2d088
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/8fb2d088

Branch: refs/heads/V3Prototype
Commit: 8fb2d088c82e43c7a384024e16548387e54ed93b
Parents: 1535653
Author: Scott Nicklous <ms...@apache.org>
Authored: Wed Nov 18 11:31:28 2015 +0100
Committer: Scott Nicklous <ms...@apache.org>
Committed: Wed Nov 18 11:31:28 2015 +0100

----------------------------------------------------------------------
 .../pluto/container/PortletInvokerService.java  | 290 +++++------
 .../driver/PortalDriverContainerServices.java   | 106 ++--
 .../driver/PortletContainerInitializer.java     |  37 +-
 .../pluto/container/driver/PortletServlet.java  | 505 ++-----------------
 .../pluto/container/driver/PortletServlet3.java | 475 +++++++++++++++++
 .../om/portlet/impl/ConfigurationProcessor.java |   7 +-
 .../container/DefaultPortletInvokerService.java |  19 +-
 .../container/PortletDescriptorRegistry.java    |  35 +-
 pom.xml                                         |   1 +
 9 files changed, 761 insertions(+), 714 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8fb2d088/pluto-container-api/src/main/java/org/apache/pluto/container/PortletInvokerService.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletInvokerService.java b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletInvokerService.java
index 56eca34..8b35a56 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletInvokerService.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletInvokerService.java
@@ -1,142 +1,148 @@
-/*
- * 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.
- */
-package org.apache.pluto.container;
-
-import java.io.IOException;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.EventRequest;
-import javax.portlet.EventResponse;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletResponse;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.ResourceRequest;
-import javax.portlet.ResourceResponse;
-
-
-/**
- * Service used to invoke portlets.
- */
-public interface PortletInvokerService {
-
-    /**
-     * The key used to bind the <code>PortletRequest</code> to the underlying
-     * <code>HttpServletRequest</code>.
-     */
-    String PORTLET_REQUEST = "javax.portlet.request";
-
-    /**
-     * The key used to bind the <code>PortletResponse</code> to the underlying
-     * <code>HttpServletRequest</code>.
-     */
-    String PORTLET_RESPONSE = "javax.portlet.response";
-
-    /**
-     * The key used to bind the <code>PortletConfig</code> to the underlying
-     * PortletConfig.
-     */
-    String PORTLET_CONFIG = "javax.portlet.config";
-
-    /**
-     * The request attribute key used to retrieve the <code>PortletRequestContext</code> instance
-     */
-    String REQUEST_CONTEXT = PortletRequestContext.class.getName();
-
-    /**
-     * The request attribute key used to retrieve the <code>PortletRequestContext</code> instance
-     */
-    String RESPONSE_CONTEXT = PortletResponseContext.class.getName();
-
-    /**
-     * The key used to bind the method of processing being requested by the
-     * container to the underlying <code>PortletRquest</code>.
-     */
-    String METHOD_ID = "org.apache.pluto.core.method";
-
-    /**
-     * The unique method identifier for render requests.  Render requests are
-     * requested through a call to the {@link PortletContainer#doRender(org.apache.pluto.container.PortletWindow,
-     * javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}
-     * method.
-     */
-    Integer METHOD_RENDER = new Integer(1);
-
-    /**
-     * The unique method identifier for render requests.  Render requests are
-     * requested through a call to the {@link PortletContainer#doAction(org.apache.pluto.container.PortletWindow,
-     * javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}
-     * method.
-     */
-    Integer METHOD_ACTION = new Integer(3);
-
-    /**
-     * The unique method identifier for load requests.  Load requests are
-     * requested through a call to the {@link PortletContainer#doLoad(org.apache.pluto.container.PortletWindow,
-     * javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}
-     * method.
-     */
-    Integer METHOD_LOAD = new Integer(5);
-
-    /**
-     * The unique method identifier for resource Serving requests.  Resource requests are
-     * requested through a call to the {@link PortletContainer#doServeResource(PortletWindow,
-     *  javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}
-     * method.
-     */
-    Integer METHOD_RESOURCE = new Integer(7);
-
-    /**
-     * The unique method identifier for render requests.  Render requests are
-     * requested through a call to the {@link PortletContainer#doEvent(org.apache.pluto.container.PortletWindow,
-     * javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.portlet.Event)}
-     * method.
-     */
-    Integer METHOD_EVENT = new Integer(9);
-
-    /**
-     * The unique method identifier for admin requests.  Admin requests
-     * are requested through a call to the {@link PortletContainer#doAdmin(PortletWindow, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}
-     * method.
-     */
-    Integer  METHOD_ADMIN = new Integer(11);
-
-    /**
-     * The public key, to store the FilterManager in the request.
-     */
-    String FILTER_MANAGER = "FilterManager";
-
-    void action(PortletRequestContext ctx, ActionRequest req, ActionResponse res, FilterManager filterManager)
-    throws IOException, PortletException, PortletContainerException;
-
-    void event(PortletRequestContext ctx, EventRequest request, EventResponse response, FilterManager filterManager)
-    throws IOException, PortletException, PortletContainerException;
-
-    void render(PortletRequestContext ctx, RenderRequest req, RenderResponse res, FilterManager filterManager)
-    throws IOException, PortletException, PortletContainerException;
-
-    void serveResource(PortletRequestContext ctx, ResourceRequest req, ResourceResponse res, FilterManager filterManager)
-    throws IOException, PortletException, PortletContainerException;
-
-    void load(PortletRequestContext ctx, PortletRequest req, PortletResponse res)
-    throws IOException, PortletException, PortletContainerException;
-
-    void admin(PortletRequestContext ctx, PortletRequest req, PortletResponse res)
-    throws IOException, PortletException, PortletContainerException;
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.container;
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletResponse;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+
+
+/**
+ * Service used to invoke portlets.
+ */
+public interface PortletInvokerService {
+
+
+   /** 
+    * URI prefix of the portlet invoker servlet for generating the servlet mapping.
+    */
+   static final String URIPREFIX = "/PlutoInvoker3/";
+         
+    /**
+     * The key used to bind the <code>PortletRequest</code> to the underlying
+     * <code>HttpServletRequest</code>.
+     */
+    String PORTLET_REQUEST = "javax.portlet.request";
+
+    /**
+     * The key used to bind the <code>PortletResponse</code> to the underlying
+     * <code>HttpServletRequest</code>.
+     */
+    String PORTLET_RESPONSE = "javax.portlet.response";
+
+    /**
+     * The key used to bind the <code>PortletConfig</code> to the underlying
+     * PortletConfig.
+     */
+    String PORTLET_CONFIG = "javax.portlet.config";
+
+    /**
+     * The request attribute key used to retrieve the <code>PortletRequestContext</code> instance
+     */
+    String REQUEST_CONTEXT = PortletRequestContext.class.getName();
+
+    /**
+     * The request attribute key used to retrieve the <code>PortletRequestContext</code> instance
+     */
+    String RESPONSE_CONTEXT = PortletResponseContext.class.getName();
+
+    /**
+     * The key used to bind the method of processing being requested by the
+     * container to the underlying <code>PortletRquest</code>.
+     */
+    String METHOD_ID = "org.apache.pluto.core.method";
+
+    /**
+     * The unique method identifier for render requests.  Render requests are
+     * requested through a call to the {@link PortletContainer#doRender(org.apache.pluto.container.PortletWindow,
+     * javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}
+     * method.
+     */
+    Integer METHOD_RENDER = new Integer(1);
+
+    /**
+     * The unique method identifier for render requests.  Render requests are
+     * requested through a call to the {@link PortletContainer#doAction(org.apache.pluto.container.PortletWindow,
+     * javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}
+     * method.
+     */
+    Integer METHOD_ACTION = new Integer(3);
+
+    /**
+     * The unique method identifier for load requests.  Load requests are
+     * requested through a call to the {@link PortletContainer#doLoad(org.apache.pluto.container.PortletWindow,
+     * javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}
+     * method.
+     */
+    Integer METHOD_LOAD = new Integer(5);
+
+    /**
+     * The unique method identifier for resource Serving requests.  Resource requests are
+     * requested through a call to the {@link PortletContainer#doServeResource(PortletWindow,
+     *  javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}
+     * method.
+     */
+    Integer METHOD_RESOURCE = new Integer(7);
+
+    /**
+     * The unique method identifier for render requests.  Render requests are
+     * requested through a call to the {@link PortletContainer#doEvent(org.apache.pluto.container.PortletWindow,
+     * javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.portlet.Event)}
+     * method.
+     */
+    Integer METHOD_EVENT = new Integer(9);
+
+    /**
+     * The unique method identifier for admin requests.  Admin requests
+     * are requested through a call to the {@link PortletContainer#doAdmin(PortletWindow, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}
+     * method.
+     */
+    Integer  METHOD_ADMIN = new Integer(11);
+
+    /**
+     * The public key, to store the FilterManager in the request.
+     */
+    String FILTER_MANAGER = "FilterManager";
+
+    void action(PortletRequestContext ctx, ActionRequest req, ActionResponse res, FilterManager filterManager)
+    throws IOException, PortletException, PortletContainerException;
+
+    void event(PortletRequestContext ctx, EventRequest request, EventResponse response, FilterManager filterManager)
+    throws IOException, PortletException, PortletContainerException;
+
+    void render(PortletRequestContext ctx, RenderRequest req, RenderResponse res, FilterManager filterManager)
+    throws IOException, PortletException, PortletContainerException;
+
+    void serveResource(PortletRequestContext ctx, ResourceRequest req, ResourceResponse res, FilterManager filterManager)
+    throws IOException, PortletException, PortletContainerException;
+
+    void load(PortletRequestContext ctx, PortletRequest req, PortletResponse res)
+    throws IOException, PortletException, PortletContainerException;
+
+    void admin(PortletRequestContext ctx, PortletRequest req, PortletResponse res)
+    throws IOException, PortletException, PortletContainerException;
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8fb2d088/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortalDriverContainerServices.java
----------------------------------------------------------------------
diff --git a/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortalDriverContainerServices.java b/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortalDriverContainerServices.java
index f9fbd84..1508579 100644
--- a/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortalDriverContainerServices.java
+++ b/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortalDriverContainerServices.java
@@ -1,53 +1,53 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.driver;
-
-/**
- * Defines the additional services needed for the Pluto Portal Driver to integrate with the Pluto Container
- * and accessed from the <code>org.apache.pluto.container.driver.PortletServlet</code>
- * and the <code>org.apache.pluto.container.driver.impl.DefaultPortletInvokerService</code>.
- * These extra services are not required nor used by the container itself directly.
- *
- * @since 2.0
- * @version $Id$
- */
-public interface PortalDriverContainerServices
-{
-    /**
-     * Returns the portlet context services implementation
-     * used by the container.
-     *
-     * @return registry service implementation
-     */
-    PortletContextService getPortletContextService();
-
-    /**
-     * Returns the portlet registry services implementation
-     * used by the container.
-     *
-     * @return registry service implementation
-     */
-    PortletRegistryService getPortletRegistryService();
-
-    /**
-     * Returns the admin service implementation used by
-     * the container.
-     *
-     * @return portal admin service
-     */
-    PortalAdministrationService getPortalAdministrationService();
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.container.driver;
+
+/**
+ * Defines the additional services needed for the Pluto Portal Driver to integrate with the Pluto Container
+ * and accessed from the <code>org.apache.pluto.container.driver.PortletServlet3</code>
+ * and the <code>org.apache.pluto.container.driver.impl.DefaultPortletInvokerService</code>.
+ * These extra services are not required nor used by the container itself directly.
+ *
+ * @since 2.0
+ * @version $Id$
+ */
+public interface PortalDriverContainerServices
+{
+    /**
+     * Returns the portlet context services implementation
+     * used by the container.
+     *
+     * @return registry service implementation
+     */
+    PortletContextService getPortletContextService();
+
+    /**
+     * Returns the portlet registry services implementation
+     * used by the container.
+     *
+     * @return registry service implementation
+     */
+    PortletRegistryService getPortletRegistryService();
+
+    /**
+     * Returns the admin service implementation used by
+     * the container.
+     *
+     * @return portal admin service
+     */
+    PortalAdministrationService getPortalAdministrationService();
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8fb2d088/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletContainerInitializer.java
----------------------------------------------------------------------
diff --git a/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletContainerInitializer.java b/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletContainerInitializer.java
index efb8d79..300b3af 100644
--- a/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletContainerInitializer.java
+++ b/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletContainerInitializer.java
@@ -24,7 +24,10 @@ import java.util.Set;
 import javax.servlet.ServletContainerInitializer;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
+import javax.servlet.ServletRegistration;
 
+import org.apache.pluto.container.PortletInvokerService;
+import org.apache.pluto.container.om.portlet.PortletDefinition;
 import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -93,14 +96,40 @@ public class PortletContainerInitializer implements ServletContainerInitializer
                holder.processWebDD(win);
             }
 
-            ctx.setAttribute(ConfigurationHolder.ATTRIB_NAME, holder);
-            
+            if (holder.getPad().getPortlets().size() > 0) {
+               
+               // dynamically deploy the portlet servlets
+               for (PortletDefinition pd : holder.getPad().getPortlets()) {
+                  String pn = pd.getPortletName();
+                  String mapping = PortletInvokerService.URIPREFIX + pn;
+
+                  if (isDebug) {
+                     StringBuilder txt = new StringBuilder();
+                     txt.append("Adding PortletServlet3, name: ");
+                     txt.append(pn);
+                     txt.append(", mapping: ").append(mapping);
+                     LOG.debug(txt.toString());
+                  }
+                  
+                  ServletRegistration.Dynamic sr = ctx.addServlet(pn + "_PS3", PortletServlet3.class);
+                  sr.addMapping(mapping);
+                  sr.setInitParameter(PortletServlet3.PORTLET_NAME, pn);
+                  sr.setLoadOnStartup(100);
+
+               }
+
+               ctx.setAttribute(ConfigurationHolder.ATTRIB_NAME, holder);
+               
+            } else {
+               LOG.error("Configuration problem - no portlet definitions");
+            }
+
          } catch (Exception e) {
             StringBuilder txt = new StringBuilder(128);
-            txt.append("Exception reading portlet application configuration");
+            txt.append("Exception processing portlet application configuration");
             txt.append(", Servlet ctx name: ").append(
                   ctx.getServletContextName());
-            txt.append(", Exception: ").append(e.getLocalizedMessage());
+            txt.append(", Exception: ").append(e.toString());
             LOG.error(txt.toString());
          }
       }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8fb2d088/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet.java
----------------------------------------------------------------------
diff --git a/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet.java b/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet.java
index 3962977..7b6d61d 100644
--- a/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet.java
+++ b/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet.java
@@ -1,469 +1,36 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.driver;
-
-import java.io.IOException;
-import java.util.Timer;
-import java.util.TimerTask;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.EventPortlet;
-import javax.portlet.EventRequest;
-import javax.portlet.EventResponse;
-import javax.portlet.Portlet;
-import javax.portlet.PortletConfig;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletResponse;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.ResourceRequest;
-import javax.portlet.ResourceResponse;
-import javax.portlet.ResourceServingPortlet;
-import javax.portlet.UnavailableException;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.pluto.container.FilterManager;
-import org.apache.pluto.container.PortletContainerException;
-import org.apache.pluto.container.PortletInvokerService;
-import org.apache.pluto.container.PortletRequestContext;
-import org.apache.pluto.container.PortletResponseContext;
-import org.apache.pluto.container.PortletWindow;
-import org.apache.pluto.container.om.portlet.PortletDefinition;
-
-/**
- * Portlet Invocation Servlet. This servlet recieves cross context requests from
- * the the container and services the portlet request for the specified method.
- *
- * @version 1.1
- * @since 09/22/2004
- */
-public class PortletServlet extends HttpServlet
-{
-    private static final long serialVersionUID = -5096339022539360365L;
-
-    static class NullPortlet implements EventPortlet, ResourceServingPortlet, Portlet
-    {
-        public void processEvent(EventRequest arg0, EventResponse arg1)
-        throws PortletException, IOException
-        {
-        }
-
-        public void serveResource(ResourceRequest arg0, ResourceResponse arg1)
-        throws PortletException, IOException
-        {
-        }
-
-        public void destroy()
-        {
-        }
-
-        public void init(PortletConfig arg0) throws PortletException
-        {
-        }
-
-        public void processAction(ActionRequest arg0, ActionResponse arg1)
-        throws PortletException, IOException
-        {
-        }
-
-        public void render(RenderRequest arg0, RenderResponse arg1)
-        throws PortletException, IOException
-        {
-        }
-    }
-
-    // Private Member Variables ------------------------------------------------
-    /**
-     * The portlet name as defined in the portlet app descriptor.
-     */
-    private String portletName;
-
-    /**
-     * The portlet instance wrapped by this servlet.
-     */
-    private Portlet portlet;
-
-    /**
-     * The internal portlet context instance.
-     */
-    private DriverPortletContext portletContext;
-
-    /**
-     * The internal portlet config instance.
-     */
-    private DriverPortletConfig portletConfig;
-
-    /**
-     * The Event Portlet instance (the same object as portlet) wrapped by this
-     * servlet.
-     */
-    private EventPortlet eventPortlet;
-
-    /** The resource serving portlet instance wrapped by this servlet. */
-    private ResourceServingPortlet resourceServingPortlet;
-
-    private PortletContextService contextService;
-
-    private boolean started = false;
-    Timer   startTimer;
-
-    // HttpServlet Impl --------------------------------------------------------
-
-    public String getServletInfo()
-    {
-        return "Pluto PortletServlet [" + portletName + "]";
-    }
-
-    /**
-     * Initialize the portlet invocation servlet.
-     *
-     * @throws ServletException
-     *             if an error occurs while loading portlet.
-     */
-    public void init(ServletConfig config) throws ServletException
-    {
-
-        // Call the super initialization method.
-        super.init(config);
-
-        // Retrieve portlet name as defined as an initialization parameter.
-        portletName = getInitParameter("portlet-name");
-
-        started = false;
-
-        startTimer = new Timer(true);
-        final ServletContext servletContext = getServletContext();
-        final ClassLoader paClassLoader = Thread.currentThread().getContextClassLoader();
-        startTimer.schedule(new TimerTask()
-        {
-            public void run()
-            {
-                synchronized(servletContext)
-                {
-                    if (startTimer != null)
-                    {
-                        if (attemptRegistration(servletContext, paClassLoader ))
-                        {
-                            startTimer.cancel();
-                            startTimer = null;
-                        }
-                    }
-                }
-            }
-        }, 1, 10000);
-    }
-
-    protected boolean attemptRegistration(ServletContext context, ClassLoader paClassLoader)
-    {
-        if (PlutoServices.getServices() != null)
-        {
-            contextService = PlutoServices.getServices().getPortletContextService();
-            try
-            {
-                ServletConfig sConfig = getServletConfig();
-                if (sConfig == null)
-                {
-                    String msg = "Problem obtaining servlet configuration(getServletConfig() returns null).";
-                    context.log(msg);
-                    return true;
-                }
-
-                String applicationName = contextService.register(sConfig);
-                started = true;
-                portletContext = contextService.getPortletContext(applicationName);
-                portletConfig = contextService.getPortletConfig(applicationName, portletName);
-
-            }
-            catch (PortletContainerException ex)
-            {
-                context.log(ex.getMessage(),ex);
-                return true;
-            }
-
-            PortletDefinition portletDD = portletConfig.getPortletDefinition();
-
-            //          Create and initialize the portlet wrapped in the servlet.
-            try
-            {
-                Class<?> clazz = paClassLoader.loadClass((portletDD.getPortletClass()));
-                portlet = (Portlet) clazz.newInstance();
-                portlet.init(portletConfig);
-                initializeEventPortlet();
-                initializeResourceServingPortlet();
-                return true;
-            }
-            catch (Exception ex)
-            {
-                context.log(ex.getMessage(),ex);
-                // take out of service
-                portlet = null;
-                portletConfig = null;
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public void destroy()
-    {
-        synchronized(getServletContext())
-        {
-            if ( startTimer != null )
-            {
-                startTimer.cancel();
-                startTimer = null;
-            }
-            else if ( started && portletContext != null)
-            {
-                started = false;
-                contextService.unregister(portletContext);
-                if (portlet != null)
-                {
-                    try
-                    {
-                        portlet.destroy();
-                    }
-                    catch (Exception e)
-                    {
-                        // ignore
-                    }
-                    portlet = null;
-                }
-            }
-            super.destroy();
-        }
-    }
-
-    protected void doGet(HttpServletRequest request,
-            HttpServletResponse response) throws ServletException, IOException
-            {
-        dispatch(request, response);
-            }
-
-    protected void doPost(HttpServletRequest request,
-            HttpServletResponse response) throws ServletException, IOException
-            {
-        dispatch(request, response);
-            }
-
-    protected void doPut(HttpServletRequest request,
-            HttpServletResponse response) throws ServletException, IOException
-            {
-        dispatch(request, response);
-            }
-
-    // Private Methods ---------------------------------------------------------
-
-    /**
-     * Dispatch the request to the appropriate portlet methods. This method
-     * assumes that the following attributes are set in the servlet request
-     * scope:
-     * <ul>
-     * <li>METHOD_ID: indicating which method to dispatch.</li>
-     * <li>PORTLET_REQUEST: the internal portlet request.</li>
-     * <li>PORTLET_RESPONSE: the internal portlet response.</li>
-     * </ul>
-     *
-     * @param request
-     *            the servlet request.
-     * @param response
-     *            the servlet response.
-     * @throws ServletException
-     * @throws IOException
-     */
-    private void dispatch(HttpServletRequest request,
-            HttpServletResponse response) throws ServletException, IOException
-            {
-        if (portlet == null)
-        {
-            throw new javax.servlet.UnavailableException("Portlet "+portletName+" unavailable");
-        }
-
-        // Retrieve attributes from the servlet request.
-        Integer methodId = (Integer) request.getAttribute(PortletInvokerService.METHOD_ID);
-
-        final PortletRequest portletRequest = (PortletRequest)request.getAttribute(PortletInvokerService.PORTLET_REQUEST);
-
-        final PortletResponse portletResponse = (PortletResponse)request.getAttribute(PortletInvokerService.PORTLET_RESPONSE);
-
-        final PortletRequestContext requestContext = (PortletRequestContext)portletRequest.getAttribute(PortletInvokerService.REQUEST_CONTEXT);
-        final PortletResponseContext responseContext = (PortletResponseContext)portletRequest.getAttribute(PortletInvokerService.RESPONSE_CONTEXT);
-
-        final FilterManager filterManager = (FilterManager)request.getAttribute(PortletInvokerService.FILTER_MANAGER);
-
-        request.removeAttribute(PortletInvokerService.METHOD_ID);
-        request.removeAttribute(PortletInvokerService.PORTLET_REQUEST);
-        request.removeAttribute(PortletInvokerService.PORTLET_RESPONSE);
-        request.removeAttribute(PortletInvokerService.FILTER_MANAGER);
-
-        requestContext.init(portletConfig, getServletContext(), request, response);
-        responseContext.init(request, response);
-
-        PortletWindow window = requestContext.getPortletWindow();
-
-        PortletInvocationEvent event = new PortletInvocationEvent(portletRequest, window, methodId.intValue());
-
-        notify(event, true, null);
-
-        // FilterManager filtermanager = (FilterManager) request.getAttribute(
-        // "filter-manager");
-
-        try
-        {
-
-            // The requested method is RENDER: call Portlet.render(..)
-            if (methodId == PortletInvokerService.METHOD_RENDER)
-            {
-                RenderRequest renderRequest = (RenderRequest) portletRequest;
-                RenderResponse renderResponse = (RenderResponse) portletResponse;
-                filterManager.processFilter(renderRequest, renderResponse,
-                        portlet, portletContext);
-            }
-
-            // The requested method is RESOURCE: call
-            // ResourceServingPortlet.serveResource(..)
-            else if (methodId == PortletInvokerService.METHOD_RESOURCE)
-            {
-                ResourceRequest resourceRequest = (ResourceRequest) portletRequest;
-                ResourceResponse resourceResponse = (ResourceResponse) portletResponse;
-                filterManager.processFilter(resourceRequest, resourceResponse,
-                        resourceServingPortlet, portletContext);
-            }
-
-            // The requested method is ACTION: call Portlet.processAction(..)
-            else if (methodId == PortletInvokerService.METHOD_ACTION)
-            {
-                ActionRequest actionRequest = (ActionRequest) portletRequest;
-                ActionResponse actionResponse = (ActionResponse) portletResponse;
-                filterManager.processFilter(actionRequest, actionResponse,
-                        portlet, portletContext);
-            }
-
-            // The request methode is Event: call Portlet.processEvent(..)
-            else if (methodId == PortletInvokerService.METHOD_EVENT)
-            {
-                EventRequest eventRequest = (EventRequest) portletRequest;
-                EventResponse eventResponse = (EventResponse) portletResponse;
-                filterManager.processFilter(eventRequest, eventResponse,
-                        eventPortlet, portletContext);
-            }
-            // The requested method is ADMIN: call handlers.
-            else if (methodId == PortletInvokerService.METHOD_ADMIN)
-            {
-                PortalAdministrationService pas = PlutoServices.getServices().getPortalAdministrationService();
-
-                for (AdministrativeRequestListener l : pas.getAdministrativeRequestListeners())
-                {
-                    l.administer(portletRequest, portletResponse);
-                }
-            }
-
-            // The requested method is LOAD: do nothing.
-            else if (methodId == PortletInvokerService.METHOD_LOAD)
-            {
-                // Do nothing.
-            }
-
-            notify(event, false, null);
-
-        }
-        catch (UnavailableException ex)
-        {
-            //
-            // if (e.isPermanent()) { throw new
-            // UnavailableException(e.getMessage()); } else { throw new
-            // UnavailableException(e.getMessage(), e.getUnavailableSeconds());
-            // }
-            //
-
-            // Portlet.destroy() isn't called by Tomcat, so we have to fix it.
-            try
-            {
-                portlet.destroy();
-            }
-            catch (Throwable th)
-            {
-                // Don't care for Exception
-                this.getServletContext().log("Error during portlet destroy.", th);
-            }
-            // take portlet out of service
-            portlet = null;
-
-            // TODO: Handle everything as permanently for now.
-            throw new javax.servlet.UnavailableException(ex.getMessage());
-
-        }
-        catch (PortletException ex)
-        {
-            notify(event, false, ex);
-            throw new ServletException(ex);
-
-        }
-            }
-
-    protected void notify(PortletInvocationEvent event, boolean pre, Throwable e)
-    {
-        PortalAdministrationService pas = PlutoServices.getServices().getPortalAdministrationService();
-
-        for (PortletInvocationListener listener : pas.getPortletInvocationListeners())
-        {
-            if (pre)
-            {
-                listener.onBegin(event);
-            }
-            else if (e == null)
-            {
-                listener.onEnd(event);
-            }
-            else
-            {
-                listener.onError(event, e);
-            }
-        }
-    }
-
-    private void initializeEventPortlet()
-    {
-        if (portlet instanceof EventPortlet)
-        {
-            eventPortlet = (EventPortlet) portlet;
-        }
-        else
-        {
-            eventPortlet = new NullPortlet();
-        }
-    }
-
-    private void initializeResourceServingPortlet()
-    {
-        if (portlet instanceof ResourceServingPortlet)
-        {
-            resourceServingPortlet = (ResourceServingPortlet) portlet;
-        }
-        else
-        {
-            resourceServingPortlet = new NullPortlet();
-        }
-    }
-}
+/*  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.
+ */
+
+
+package org.apache.pluto.container.driver;
+
+import javax.servlet.http.HttpServlet;
+
+/**
+ * Dummy servlet to allow "legacy" portlets with web.xml files specifying PortletServlet to deploy properly.
+ * The real portlet servlet is PortletServlet3, which is deployed through the servlet container
+ * initializer.
+ * 
+ * @see PortletServlet3
+ * @see PortletContainerInitializer
+ * @author Scott Nicklous
+ */
+public class PortletServlet extends HttpServlet {
+   private static final long serialVersionUID = -2550104981099637033L;
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8fb2d088/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet3.java
----------------------------------------------------------------------
diff --git a/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet3.java b/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet3.java
new file mode 100644
index 0000000..5f1f013
--- /dev/null
+++ b/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet3.java
@@ -0,0 +1,475 @@
+/*
+ * 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.
+ */
+package org.apache.pluto.container.driver;
+
+import java.io.IOException;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.EventPortlet;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletResponse;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.portlet.ResourceServingPortlet;
+import javax.portlet.UnavailableException;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.pluto.container.FilterManager;
+import org.apache.pluto.container.PortletContainerException;
+import org.apache.pluto.container.PortletInvokerService;
+import org.apache.pluto.container.PortletRequestContext;
+import org.apache.pluto.container.PortletResponseContext;
+import org.apache.pluto.container.PortletWindow;
+import org.apache.pluto.container.om.portlet.PortletDefinition;
+
+/**
+ * Portlet Invocation Servlet. This servlet recieves cross context requests from
+ * the the container and services the portlet request for the specified method.
+ *
+ * @version 1.1
+ * @since 09/22/2004
+ */
+public class PortletServlet3 extends HttpServlet
+{
+    private static final long serialVersionUID = -5096339022539360365L;
+    
+    /**
+     * Portlet name constant, needed by portlet container initializer
+     */
+    public static final String PORTLET_NAME = "portlet-name"; 
+
+
+    static class NullPortlet implements EventPortlet, ResourceServingPortlet, Portlet
+    {
+        public void processEvent(EventRequest arg0, EventResponse arg1)
+        throws PortletException, IOException
+        {
+        }
+
+        public void serveResource(ResourceRequest arg0, ResourceResponse arg1)
+        throws PortletException, IOException
+        {
+        }
+
+        public void destroy()
+        {
+        }
+
+        public void init(PortletConfig arg0) throws PortletException
+        {
+        }
+
+        public void processAction(ActionRequest arg0, ActionResponse arg1)
+        throws PortletException, IOException
+        {
+        }
+
+        public void render(RenderRequest arg0, RenderResponse arg1)
+        throws PortletException, IOException
+        {
+        }
+    }
+
+    // Private Member Variables ------------------------------------------------
+    /**
+     * The portlet name as defined in the portlet app descriptor.
+     */
+    private String portletName;
+
+    /**
+     * The portlet instance wrapped by this servlet.
+     */
+    private Portlet portlet;
+
+    /**
+     * The internal portlet context instance.
+     */
+    private DriverPortletContext portletContext;
+
+    /**
+     * The internal portlet config instance.
+     */
+    private DriverPortletConfig portletConfig;
+
+    /**
+     * The Event Portlet instance (the same object as portlet) wrapped by this
+     * servlet.
+     */
+    private EventPortlet eventPortlet;
+
+    /** The resource serving portlet instance wrapped by this servlet. */
+    private ResourceServingPortlet resourceServingPortlet;
+
+    private PortletContextService contextService;
+
+    private boolean started = false;
+    Timer   startTimer;
+
+    // HttpServlet Impl --------------------------------------------------------
+
+    public String getServletInfo()
+    {
+        return "Pluto PortletServlet3 [" + portletName + "]";
+    }
+
+    /**
+     * Initialize the portlet invocation servlet.
+     *
+     * @throws ServletException
+     *             if an error occurs while loading portlet.
+     */
+    public void init(ServletConfig config) throws ServletException
+    {
+
+        // Call the super initialization method.
+        super.init(config);
+
+        // Retrieve portlet name as defined as an initialization parameter.
+        portletName = getInitParameter(PORTLET_NAME);
+
+        started = false;
+
+        startTimer = new Timer(true);
+        final ServletContext servletContext = getServletContext();
+        final ClassLoader paClassLoader = Thread.currentThread().getContextClassLoader();
+        startTimer.schedule(new TimerTask()
+        {
+            public void run()
+            {
+                synchronized(servletContext)
+                {
+                    if (startTimer != null)
+                    {
+                        if (attemptRegistration(servletContext, paClassLoader ))
+                        {
+                            startTimer.cancel();
+                            startTimer = null;
+                        }
+                    }
+                }
+            }
+        }, 1, 10000);
+    }
+
+    protected boolean attemptRegistration(ServletContext context, ClassLoader paClassLoader)
+    {
+        if (PlutoServices.getServices() != null)
+        {
+            contextService = PlutoServices.getServices().getPortletContextService();
+            try
+            {
+                ServletConfig sConfig = getServletConfig();
+                if (sConfig == null)
+                {
+                    String msg = "Problem obtaining servlet configuration(getServletConfig() returns null).";
+                    context.log(msg);
+                    return true;
+                }
+
+                String applicationName = contextService.register(sConfig);
+                started = true;
+                portletContext = contextService.getPortletContext(applicationName);
+                portletConfig = contextService.getPortletConfig(applicationName, portletName);
+
+            }
+            catch (PortletContainerException ex)
+            {
+                context.log(ex.getMessage(),ex);
+                return true;
+            }
+
+            PortletDefinition portletDD = portletConfig.getPortletDefinition();
+
+            //          Create and initialize the portlet wrapped in the servlet.
+            try
+            {
+                Class<?> clazz = paClassLoader.loadClass((portletDD.getPortletClass()));
+                portlet = (Portlet) clazz.newInstance();
+                portlet.init(portletConfig);
+                initializeEventPortlet();
+                initializeResourceServingPortlet();
+                return true;
+            }
+            catch (Exception ex)
+            {
+                context.log(ex.getMessage(),ex);
+                // take out of service
+                portlet = null;
+                portletConfig = null;
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public void destroy()
+    {
+        synchronized(getServletContext())
+        {
+            if ( startTimer != null )
+            {
+                startTimer.cancel();
+                startTimer = null;
+            }
+            else if ( started && portletContext != null)
+            {
+                started = false;
+                contextService.unregister(portletContext);
+                if (portlet != null)
+                {
+                    try
+                    {
+                        portlet.destroy();
+                    }
+                    catch (Exception e)
+                    {
+                        // ignore
+                    }
+                    portlet = null;
+                }
+            }
+            super.destroy();
+        }
+    }
+
+    protected void doGet(HttpServletRequest request,
+            HttpServletResponse response) throws ServletException, IOException
+            {
+        dispatch(request, response);
+            }
+
+    protected void doPost(HttpServletRequest request,
+            HttpServletResponse response) throws ServletException, IOException
+            {
+        dispatch(request, response);
+            }
+
+    protected void doPut(HttpServletRequest request,
+            HttpServletResponse response) throws ServletException, IOException
+            {
+        dispatch(request, response);
+            }
+
+    // Private Methods ---------------------------------------------------------
+
+    /**
+     * Dispatch the request to the appropriate portlet methods. This method
+     * assumes that the following attributes are set in the servlet request
+     * scope:
+     * <ul>
+     * <li>METHOD_ID: indicating which method to dispatch.</li>
+     * <li>PORTLET_REQUEST: the internal portlet request.</li>
+     * <li>PORTLET_RESPONSE: the internal portlet response.</li>
+     * </ul>
+     *
+     * @param request
+     *            the servlet request.
+     * @param response
+     *            the servlet response.
+     * @throws ServletException
+     * @throws IOException
+     */
+    private void dispatch(HttpServletRequest request,
+            HttpServletResponse response) throws ServletException, IOException
+            {
+        if (portlet == null)
+        {
+            throw new javax.servlet.UnavailableException("Portlet "+portletName+" unavailable");
+        }
+
+        // Retrieve attributes from the servlet request.
+        Integer methodId = (Integer) request.getAttribute(PortletInvokerService.METHOD_ID);
+
+        final PortletRequest portletRequest = (PortletRequest)request.getAttribute(PortletInvokerService.PORTLET_REQUEST);
+
+        final PortletResponse portletResponse = (PortletResponse)request.getAttribute(PortletInvokerService.PORTLET_RESPONSE);
+
+        final PortletRequestContext requestContext = (PortletRequestContext)portletRequest.getAttribute(PortletInvokerService.REQUEST_CONTEXT);
+        final PortletResponseContext responseContext = (PortletResponseContext)portletRequest.getAttribute(PortletInvokerService.RESPONSE_CONTEXT);
+
+        final FilterManager filterManager = (FilterManager)request.getAttribute(PortletInvokerService.FILTER_MANAGER);
+
+        request.removeAttribute(PortletInvokerService.METHOD_ID);
+        request.removeAttribute(PortletInvokerService.PORTLET_REQUEST);
+        request.removeAttribute(PortletInvokerService.PORTLET_RESPONSE);
+        request.removeAttribute(PortletInvokerService.FILTER_MANAGER);
+
+        requestContext.init(portletConfig, getServletContext(), request, response);
+        responseContext.init(request, response);
+
+        PortletWindow window = requestContext.getPortletWindow();
+
+        PortletInvocationEvent event = new PortletInvocationEvent(portletRequest, window, methodId.intValue());
+
+        notify(event, true, null);
+
+        // FilterManager filtermanager = (FilterManager) request.getAttribute(
+        // "filter-manager");
+
+        try
+        {
+
+            // The requested method is RENDER: call Portlet.render(..)
+            if (methodId == PortletInvokerService.METHOD_RENDER)
+            {
+                RenderRequest renderRequest = (RenderRequest) portletRequest;
+                RenderResponse renderResponse = (RenderResponse) portletResponse;
+                filterManager.processFilter(renderRequest, renderResponse,
+                        portlet, portletContext);
+            }
+
+            // The requested method is RESOURCE: call
+            // ResourceServingPortlet.serveResource(..)
+            else if (methodId == PortletInvokerService.METHOD_RESOURCE)
+            {
+                ResourceRequest resourceRequest = (ResourceRequest) portletRequest;
+                ResourceResponse resourceResponse = (ResourceResponse) portletResponse;
+                filterManager.processFilter(resourceRequest, resourceResponse,
+                        resourceServingPortlet, portletContext);
+            }
+
+            // The requested method is ACTION: call Portlet.processAction(..)
+            else if (methodId == PortletInvokerService.METHOD_ACTION)
+            {
+                ActionRequest actionRequest = (ActionRequest) portletRequest;
+                ActionResponse actionResponse = (ActionResponse) portletResponse;
+                filterManager.processFilter(actionRequest, actionResponse,
+                        portlet, portletContext);
+            }
+
+            // The request methode is Event: call Portlet.processEvent(..)
+            else if (methodId == PortletInvokerService.METHOD_EVENT)
+            {
+                EventRequest eventRequest = (EventRequest) portletRequest;
+                EventResponse eventResponse = (EventResponse) portletResponse;
+                filterManager.processFilter(eventRequest, eventResponse,
+                        eventPortlet, portletContext);
+            }
+            // The requested method is ADMIN: call handlers.
+            else if (methodId == PortletInvokerService.METHOD_ADMIN)
+            {
+                PortalAdministrationService pas = PlutoServices.getServices().getPortalAdministrationService();
+
+                for (AdministrativeRequestListener l : pas.getAdministrativeRequestListeners())
+                {
+                    l.administer(portletRequest, portletResponse);
+                }
+            }
+
+            // The requested method is LOAD: do nothing.
+            else if (methodId == PortletInvokerService.METHOD_LOAD)
+            {
+                // Do nothing.
+            }
+
+            notify(event, false, null);
+
+        }
+        catch (UnavailableException ex)
+        {
+            //
+            // if (e.isPermanent()) { throw new
+            // UnavailableException(e.getMessage()); } else { throw new
+            // UnavailableException(e.getMessage(), e.getUnavailableSeconds());
+            // }
+            //
+
+            // Portlet.destroy() isn't called by Tomcat, so we have to fix it.
+            try
+            {
+                portlet.destroy();
+            }
+            catch (Throwable th)
+            {
+                // Don't care for Exception
+                this.getServletContext().log("Error during portlet destroy.", th);
+            }
+            // take portlet out of service
+            portlet = null;
+
+            // TODO: Handle everything as permanently for now.
+            throw new javax.servlet.UnavailableException(ex.getMessage());
+
+        }
+        catch (PortletException ex)
+        {
+            notify(event, false, ex);
+            throw new ServletException(ex);
+
+        }
+            }
+
+    protected void notify(PortletInvocationEvent event, boolean pre, Throwable e)
+    {
+        PortalAdministrationService pas = PlutoServices.getServices().getPortalAdministrationService();
+
+        for (PortletInvocationListener listener : pas.getPortletInvocationListeners())
+        {
+            if (pre)
+            {
+                listener.onBegin(event);
+            }
+            else if (e == null)
+            {
+                listener.onEnd(event);
+            }
+            else
+            {
+                listener.onError(event, e);
+            }
+        }
+    }
+
+    private void initializeEventPortlet()
+    {
+        if (portlet instanceof EventPortlet)
+        {
+            eventPortlet = (EventPortlet) portlet;
+        }
+        else
+        {
+            eventPortlet = new NullPortlet();
+        }
+    }
+
+    private void initializeResourceServingPortlet()
+    {
+        if (portlet instanceof ResourceServingPortlet)
+        {
+            resourceServingPortlet = (ResourceServingPortlet) portlet;
+        }
+        else
+        {
+            resourceServingPortlet = new NullPortlet();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8fb2d088/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationProcessor.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationProcessor.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationProcessor.java
index bfd6c6e..204b5d7 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationProcessor.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationProcessor.java
@@ -98,7 +98,7 @@ public abstract class ConfigurationProcessor {
    protected void checkValidClass(String clsName, Class<?> assignable, String msg) {
    
       StringBuilder txt = new StringBuilder(128);
-      txt.append(msg);
+      txt.append(msg).append(", class name: ");
       txt.append(clsName);
       if (!isValidIdentifier(clsName)) {
          txt.append(". Invalid java identifier.");
@@ -109,7 +109,7 @@ public abstract class ConfigurationProcessor {
       // Make sure the class can be loaded
       Class<?> valClass = null;
       try {
-         ClassLoader cl = this.getClass().getClassLoader();
+         ClassLoader cl = Thread.currentThread().getContextClassLoader();
          valClass = cl.loadClass(clsName);
          if (assignable != null && !assignable.isAssignableFrom(valClass)) {
             txt.append(". Specified class is not a ");
@@ -117,7 +117,8 @@ public abstract class ConfigurationProcessor {
             throw new Exception();
          }
       } catch (ClassNotFoundException e) {
-         LOG.warn(txt.toString() + e.getLocalizedMessage());
+         txt.append(", Exception: ").append(e.toString());
+         LOG.warn(txt.toString());
          // can't throw exception if class not found, since the portlet
          // application definition is used by the assembly mojo
       } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8fb2d088/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DefaultPortletInvokerService.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DefaultPortletInvokerService.java b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DefaultPortletInvokerService.java
index 30ddfaa..32c097f 100644
--- a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DefaultPortletInvokerService.java
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DefaultPortletInvokerService.java
@@ -42,7 +42,7 @@ import org.apache.pluto.container.PortletInvokerService;
 import org.apache.pluto.container.PortletRequestContext;
 import org.apache.pluto.container.PortletWindow;
 import org.apache.pluto.container.driver.PortletContextService;
-import org.apache.pluto.container.driver.PortletServlet;
+import org.apache.pluto.container.driver.PortletServlet3;
 import org.apache.pluto.container.util.StringManager;
 
 /**
@@ -65,11 +65,6 @@ public class DefaultPortletInvokerService implements PortletInvokerService {
 
     // Private Member Variables ------------------------------------------------
 
-    /** URI prefix of the portlet invoker servlet.
-     *  TODO: this is Pluto Portal Driver specific!
-     * */
-    private static final String PREFIX = "/PlutoInvoker/";
-
     private PortletContextService portletContextService;
 
     // Constructor -------------------------------------------------------------
@@ -90,7 +85,7 @@ public class DefaultPortletInvokerService implements PortletInvokerService {
      * @param context request context used for the invocation
      * @param request  action request used for the invocation.
      * @param response action response used for the invocation.
-     * @see PortletServlet
+     * @see PortletServlet3
      * @see javax.portlet.Portlet#processAction(javax.portlet.ActionRequest,javax.portlet.ActionResponse)
      */
     public void action(PortletRequestContext context, ActionRequest request, ActionResponse response, FilterManager filterManager)
@@ -106,7 +101,7 @@ public class DefaultPortletInvokerService implements PortletInvokerService {
      *
      * @param request  action request used for the invocation.
      * @param response action response used for the invocation.
-     * @see PortletServlet
+     * @see PortletServlet3
      * @see javax.portlet.Portlet#render(javax.portlet.RenderRequest,javax.portlet.RenderResponse)
      */
     public void render(PortletRequestContext context, RenderRequest request, RenderResponse response, FilterManager filterManager)
@@ -122,7 +117,7 @@ public class DefaultPortletInvokerService implements PortletInvokerService {
      *
      * @param request  action request used for the invocation.
      * @param response action response used for the invocation.
-     * @see PortletServlet
+     * @see PortletServlet3
      * @see javax.portlet.Portlet#render(javax.portlet.RenderRequest,javax.portlet.RenderResponse)
      */
     public void event(PortletRequestContext context, EventRequest request, EventResponse response, FilterManager filterManager)
@@ -138,7 +133,7 @@ public class DefaultPortletInvokerService implements PortletInvokerService {
      *
      * @param request  resource request used for the invocation.
      * @param response resource response used for the invocation.
-     * @see PortletServlet
+     * @see PortletServlet3
      * @see javax.portlet.Portlet#resource(javax.portlet.ResourceRequest,javax.portlet.ResourceResponse)
      */
     public void serveResource(PortletRequestContext context, ResourceRequest request, ResourceResponse response, FilterManager filterManager)
@@ -154,7 +149,7 @@ public class DefaultPortletInvokerService implements PortletInvokerService {
      *
      * @param request  action request used for the invocation.
      * @param response action response used for the invocation.
-     * @see PortletServlet
+     * @see PortletServlet3
      */
     public void load(PortletRequestContext context, PortletRequest request, PortletResponse response)
     throws IOException, PortletException, PortletContainerException {
@@ -205,7 +200,7 @@ public class DefaultPortletInvokerService implements PortletInvokerService {
         String appName = portletWindow.getPortletDefinition().getApplication().getName();
         ServletContext servletContext = portletContextService.getPortletContext(appName).getServletContext();
 
-        String uri =  PREFIX + portletWindow.getPortletDefinition().getPortletName();
+        String uri =  PortletInvokerService.URIPREFIX + portletWindow.getPortletDefinition().getPortletName();
         if (LOG.isDebugEnabled()) {
             LOG.debug("Dispatching to portlet servlet at: " + uri);
         }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8fb2d088/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortletDescriptorRegistry.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortletDescriptorRegistry.java b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortletDescriptorRegistry.java
index 79094e7..87b6b6a 100644
--- a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortletDescriptorRegistry.java
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortletDescriptorRegistry.java
@@ -16,7 +16,6 @@
  */
 package org.apache.pluto.driver.container;
 
-import java.io.InputStream;
 import java.util.Map;
 import java.util.WeakHashMap;
 
@@ -48,13 +47,6 @@ public class PortletDescriptorRegistry {
    private static final Logger LOG = LoggerFactory
          .getLogger(PortletDescriptorRegistry.class);
    private static final boolean isDebug = LOG.isDebugEnabled();
-   
-
-   /** Web deployment descriptor location. */
-   private static final String WEB_XML     = "/WEB-INF/web.xml";
-
-   /** Portlet deployment descriptor location. */
-   private static final String PORTLET_XML = "/WEB-INF/portlet.xml";
 
    /** Exception Messages. */
    private static final StringManager EXCEPTIONS  = StringManager.getManager(PortletDescriptorRegistry.class
@@ -64,6 +56,7 @@ public class PortletDescriptorRegistry {
    // Private Member Variables ------------------------------------------------
 
    /** The portlet application descriptor service. */
+   @SuppressWarnings("unused")
    private final PortletAppDescriptorService                       portletDDService;
 
    /**
@@ -107,7 +100,8 @@ public class PortletDescriptorRegistry {
    // Private Methods ---------------------------------------------------------
 
    /**
-    * Creates the portlet.xml deployment descriptor representation.
+    * Creates and retisters the portlet application configuration based on the
+    * config data read by the PortletContainerInitializer.
     * 
     * @param servletContext
     *           the servlet context for which the DD is requested.
@@ -133,30 +127,9 @@ public class PortletDescriptorRegistry {
          portletApp.setName(name);
          
       } else {
-         
-         if (isDebug) {
-            LOG.debug("Reading portlet config. ctx path: " + contextPath);
-         }
-
-         try {
-            InputStream paIn = servletContext.getResourceAsStream(PORTLET_XML);
-            InputStream webIn = servletContext.getResourceAsStream(WEB_XML);
-            if (paIn == null) {
-               throw new PortletContainerException("Cannot find '"
-                     + PORTLET_XML
-                     + "'. Are you sure it is in the deployed package?");
-            }
-            if (webIn == null) {
-               throw new PortletContainerException("Cannot find '" + WEB_XML
-                     + "'. Are you sure it is in the deployed package?");
-            }
-            portletApp = portletDDService.read(name, contextPath, paIn);
-            portletDDService.mergeWebDescriptor(portletApp, webIn);
-         } catch (Exception ex) {
             throw new PortletContainerException(EXCEPTIONS.getString(
                   "error.context.descriptor.load",
-                  new String[] { servletContext.getServletContextName() }), ex);
-         }
+                  new String[] { servletContext.getServletContextName(), "No config data stored in context." }));
       }
       return portletApp;
    }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8fb2d088/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 7a6a2e8..debae93 100644
--- a/pom.xml
+++ b/pom.xml
@@ -269,6 +269,7 @@ generate mailto links. -->
     <commons-cli.version>1.0</commons-cli.version>
     <slf4j.version>1.7.5</slf4j.version>
     <springframework.version>2.0.2</springframework.version>
+<!--     <springframework.version>4.2.3.RELEASE</springframework.version> -->
     <maven.version>2.0.5</maven.version>
     <ant.version>1.6.5</ant.version>
     <commons-io.version>2.4</commons-io.version>


[06/38] portals-pluto git commit: Replaced code that reads the deployment descriptor with an implementation that can be better extended to add v3.0 support. Added test cases. Uses jaxb binding classes that are generated at compile time.

Posted by ms...@apache.org.
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/resources/org/apache/pluto/container/impl/portlet-app_2_0.xsd
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/resources/org/apache/pluto/container/impl/portlet-app_2_0.xsd b/pluto-container/src/main/resources/org/apache/pluto/container/impl/portlet-app_2_0.xsd
index e4dfbd2..eaa3aa6 100644
--- a/pluto-container/src/main/resources/org/apache/pluto/container/impl/portlet-app_2_0.xsd
+++ b/pluto-container/src/main/resources/org/apache/pluto/container/impl/portlet-app_2_0.xsd
@@ -1,830 +1,830 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.0" xml:lang="en">
-	<annotation>
-		<documentation>
-		This is the XML Schema for the Portlet 2.0 deployment descriptor.
-		</documentation>
-	</annotation>
-	<annotation>
-		<documentation>
-		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.
-		</documentation>
-	</annotation>
-	<!-- *********************************************************** -->
-	<import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
-	<element name="portlet-app" type="portlet:portlet-appType">
-		<annotation>
-			<documentation>
-			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".
-			</documentation>
-		</annotation>
-		<unique name="portlet-name-uniqueness">
-			<annotation>
-				<documentation>
-				The portlet element contains the name of a portlet.
-				This name must be unique within the portlet application.
-				 </documentation>
-			</annotation>
-			<selector xpath="portlet:portlet"/>
-			<field xpath="portlet:portlet-name"/>
-		</unique>
-		<unique name="custom-portlet-mode-uniqueness">
-			<annotation>
-				<documentation>
-				The custom-portlet-mode element contains the portlet-mode.
-				This portlet mode must be unique within the portlet application.
-				</documentation>
-			</annotation>
-			<selector xpath="portlet:custom-portlet-mode"/>
-			<field xpath="portlet:portlet-mode"/>
-		</unique>
-		<unique name="custom-window-state-uniqueness">
-			<annotation>
-				<documentation>
-				The custom-window-state element contains the window-state.
-				This window state must be unique within the portlet application.
-				</documentation>
-			</annotation>
-			<selector xpath="portlet:custom-window-state"/>
-			<field xpath="portlet:window-state"/>
-		</unique>
-		<unique name="user-attribute-name-uniqueness">
-			<annotation>
-				<documentation>
-				The user-attribute element contains the name the attribute.
-				This name must be unique within the portlet application.
-				</documentation>
-			</annotation>
-			<selector xpath="portlet:user-attribute"/>
-			<field xpath="portlet:name"/>
-		</unique>
-		<unique name="filter-name-uniqueness">
-			<annotation>
-				<documentation>
-				The filter element contains the name of a filter.
-				The name must be unique within the portlet application.
-				</documentation>
-			</annotation>
-			<selector xpath="portlet:filter"/>
-			<field xpath="portlet:filter-name"/>
-		</unique>
-	</element>
-	<complexType name="portlet-appType">
-		<sequence>
-			<element name="portlet" type="portlet:portletType" minOccurs="0" maxOccurs="unbounded">
-				<unique name="init-param-name-uniqueness">
-					<annotation>
-						<documentation>
-						The init-param element contains the name the attribute.
-						This name must be unique within the portlet.
-						</documentation>
-					</annotation>
-					<selector xpath="portlet:init-param"/>
-					<field xpath="portlet:name"/>
-				</unique>
-				<unique name="supports-mime-type-uniqueness">
-					<annotation>
-						<documentation>
-						The supports element contains the supported mime-type.
-						This mime type must be unique within the portlet.
-						</documentation>
-					</annotation>
-					<selector xpath="portlet:supports"/>
-					<field xpath="mime-type"/>
-				</unique>
-				<unique name="preference-name-uniqueness">
-					<annotation>
-						<documentation>
-						The preference element contains the name the preference.
-						This name must be unique within the portlet.
-						</documentation>
-					</annotation>
-					<selector xpath="portlet:portlet-preferences/portlet:preference"/>
-					<field xpath="portlet:name"/>
-				</unique>
-				<unique name="security-role-ref-name-uniqueness">
-					<annotation>
-						<documentation>
-						The security-role-ref element contains the role-name.
-						This role name must be unique within the portlet.
-						</documentation>
-					</annotation>
-					<selector xpath="portlet:security-role-ref"/>
-					<field xpath="portlet:role-name"/>
-				</unique>
-			</element>
-			<element name="custom-portlet-mode" type="portlet:custom-portlet-modeType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="custom-window-state" type="portlet:custom-window-stateType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="user-attribute" type="portlet:user-attributeType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="security-constraint" type="portlet:security-constraintType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="resource-bundle" type="portlet:resource-bundleType" minOccurs="0"/>
-			<element name="filter" type="portlet:filterType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="filter-mapping" type="portlet:filter-mappingType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="default-namespace" type="xs:anyURI" minOccurs="0"/>
-			<element name="event-definition" type="portlet:event-definitionType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="public-render-parameter" type="portlet:public-render-parameterType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="listener" type="portlet:listenerType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="container-runtime-option" type="portlet:container-runtime-optionType" minOccurs="0" maxOccurs="unbounded"/>
-		</sequence>
-		<attribute name="version" type="portlet:string" use="required"/>
-		<attribute name="id" type="portlet:string" use="optional"/>
-	</complexType>
-	<complexType name="cache-scopeType">
-		<annotation>
-			<documentation>
-			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 across users.
-			The default value if not present is "private".
-			Used in: portlet
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="portlet:string"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="custom-portlet-modeType">
-		<annotation>
-			<documentation>
-			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
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="portlet-mode" type="portlet:portlet-modeType"/>
-			<element name="portal-managed" type="portlet:portal-managedType" minOccurs="0"/>
-		</sequence>
-		<attribute name="id" type="portlet:string" use="optional"/>
-	</complexType>
-	<complexType name="custom-window-stateType">
-		<annotation>
-			<documentation>
-			A custom window state that one or more portlets in this 
-			portlet application supports.
-			Used in: portlet-app
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="window-state" type="portlet:window-stateType"/>
-		</sequence>
-		<attribute name="id" type="portlet:string" use="optional"/>
-	</complexType>
-	<complexType name="expiration-cacheType">
-		<annotation>
-			<documentation>
-			Expiration-time defines the time in seconds after which the portlet output expires. 
-			-1 indicates that the output never expires.
-			Used in: portlet
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="int"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="init-paramType">
-		<annotation>
-			<documentation>
-			The init-param element contains a name/value pair as an 
-			initialization param of the portlet
-			Used in:portlet
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="name" type="portlet:nameType"/>
-			<element name="value" type="portlet:valueType"/>
-		</sequence>
-		<attribute name="id" type="portlet:string" use="optional"/>
-	</complexType>
-	<complexType name="keywordsType">
-		<annotation>
-			<documentation>
-			Locale specific keywords associated with this portlet.
-			The kewords are separated by commas.
-			Used in: portlet-info
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="portlet:string"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="mime-typeType">
-		<annotation>
-			<documentation>
-			MIME type name, e.g. "text/html".
-			The MIME type may also contain the wildcard
-			character '*', like "text/*" or "*/*".
-			Used in: supports
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="portlet:string"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="nameType">
-		<annotation>
-			<documentation>
-			The name element contains the name of a parameter. 
-			Used in: init-param, ...
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="portlet:string"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="portletType">
-		<annotation>
-			<documentation>
-			The portlet element contains the declarative data of a portlet. 
-			Used in: portlet-app
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="portlet-name" type="portlet:portlet-nameType"/>
-			<element name="display-name" type="portlet:display-nameType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="portlet-class" type="portlet:portlet-classType"/>
-			<element name="init-param" type="portlet:init-paramType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="expiration-cache" type="portlet:expiration-cacheType" minOccurs="0"/>
-			<element name="cache-scope" type="portlet:cache-scopeType" minOccurs="0"/>
-			<element name="supports" type="portlet:supportsType" maxOccurs="unbounded"/>
-			<element name="supported-locale" type="portlet:supported-localeType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="resource-bundle" type="portlet:resource-bundleType" minOccurs="0"/>
-			<element name="portlet-info" type="portlet:portlet-infoType" minOccurs="0"/>
-			<element name="portlet-preferences" type="portlet:portlet-preferencesType" minOccurs="0"/>
-			<element name="security-role-ref" type="portlet:security-role-refType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="supported-processing-event" type="portlet:event-definition-referenceType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="supported-publishing-event" type="portlet:event-definition-referenceType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="supported-public-render-parameter" type="portlet:string" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="container-runtime-option" type="portlet:container-runtime-optionType" minOccurs="0" maxOccurs="unbounded"/>
-		</sequence>
-		<attribute name="id" type="portlet:string" use="optional"/>
-	</complexType>
-	<simpleType name="portlet-classType">
-		<annotation>
-			<documentation>
-			 The portlet-class element contains the fully
-			 qualified class name of the portlet.
-			Used in: portlet
-			</documentation>
-		</annotation>
-		<restriction base="portlet:fully-qualified-classType"/>
-	</simpleType>
-	<complexType name="container-runtime-optionType">
-		<annotation>
-			<documentation>
-			 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
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="name" type="portlet:nameType"/>
-			<element name="value" type="portlet:valueType" minOccurs="0" maxOccurs="unbounded"/>
-		</sequence>
-	</complexType>
-	<complexType name="filter-mappingType">
-		<annotation>
-			<documentation>
-			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
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="filter-name" type="portlet:filter-nameType"/>
-			<element name="portlet-name" type="portlet:portlet-nameType" maxOccurs="unbounded"/>
-		</sequence>
-	</complexType>
-	<complexType name="filterType">
-		<annotation>
-			<documentation>
-				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
-				</documentation>
-		</annotation>
-		<sequence>
-			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="display-name" type="portlet:display-nameType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="filter-name" type="portlet:filter-nameType"/>
-			<element name="filter-class" type="portlet:fully-qualified-classType"/>
-			<element name="lifecycle" type="portlet:string" maxOccurs="unbounded"/>
-			<element name="init-param" type="portlet:init-paramType" minOccurs="0" maxOccurs="unbounded"/>
-		</sequence>
-	</complexType>
-	<complexType name="portlet-collectionType">
-		<annotation>
-			<documentation>
-			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
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="portlet-name" type="portlet:portlet-nameType" maxOccurs="unbounded"/>
-		</sequence>
-	</complexType>
-	<complexType name="event-definitionType">
-		<annotation>
-			<documentation>
-			The event-definitionType is used to declare events the portlet can either
-			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
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
-			<choice>
-				<element name="qname" type="xs:QName"/>
-				<element name="name" type="xs:NCName"/>
-			</choice>
-			<element name="alias" type="xs:QName" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="value-type" type="portlet:fully-qualified-classType" minOccurs="0"/>
-		</sequence>
-		<attribute name="id" type="portlet:string" use="optional"/>
-	</complexType>
-	<complexType name="event-definition-referenceType">
-		<annotation>
-			<documentation>
-			The event-definition-referenceType is used to reference events 
-			declared with the event-definition element at application level.
-			Used in: portlet
-			</documentation>
-		</annotation>
-		<choice>
-			<element name="qname" type="xs:QName"/>
-			<element name="name" type="xs:NCName"/>
-		</choice>
-		<attribute name="id" type="portlet:string" use="optional"/>
-	</complexType>
-	<complexType name="listenerType">
-		<annotation>
-			<documentation>
-			The listenerType is used to declare listeners for this portlet application.
-			Used in: portlet-app
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="display-name" type="portlet:display-nameType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="listener-class" type="portlet:fully-qualified-classType"/>
-		</sequence>
-		<attribute name="id" type="portlet:string" use="optional"/>
-	</complexType>
-	<complexType name="portlet-infoType">
-		<sequence>
-			<element name="title" type="portlet:titleType" minOccurs="0"/>
-			<element name="short-title" type="portlet:short-titleType" minOccurs="0"/>
-			<element name="keywords" type="portlet:keywordsType" minOccurs="0"/>
-		</sequence>
-		<attribute name="id" type="portlet:string" use="optional"/>
-	</complexType>
-	<simpleType name="portal-managedType">
-		<annotation>
-			<documentation>
-			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
-			</documentation>
-		</annotation>
-		<restriction base="portlet:string">
-			<enumeration value="true"/>
-			<enumeration value="false"/>
-		</restriction>
-	</simpleType>
-	<complexType name="portlet-modeType">
-		<annotation>
-			<documentation>
-			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
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="portlet:string"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="portlet-nameType">
-		<annotation>
-			<documentation>
-			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
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="portlet:string"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="portlet-preferencesType">
-		<annotation>
-			<documentation>
-			Portlet persistent preference store.
-			Used in: portlet
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="preference" type="portlet:preferenceType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="preferences-validator" type="portlet:preferences-validatorType" minOccurs="0"/>
-		</sequence>
-		<attribute name="id" type="portlet:string" use="optional"/>
-	</complexType>
-	<complexType name="preferenceType">
-		<annotation>
-			<documentation>
-			Persistent preference values that may be used for customization 
-			and personalization by the portlet.
-			Used in: portlet-preferences
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="name" type="portlet:nameType"/>
-			<element name="value" type="portlet:valueType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="read-only" type="portlet:read-onlyType" minOccurs="0"/>
-		</sequence>
-		<attribute name="id" type="portlet:string" use="optional"/>
-	</complexType>
-	<simpleType name="preferences-validatorType">
-		<annotation>
-			<documentation>
-			The class specified under preferences-validator implements
-			the PreferencesValidator interface to validate the 
-			preferences settings.
-			Used in: portlet-preferences
-			</documentation>
-		</annotation>
-		<restriction base="portlet:fully-qualified-classType"/>
-	</simpleType>
-	<simpleType name="read-onlyType">
-		<annotation>
-			<documentation>
-			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
-			</documentation>
-		</annotation>
-		<restriction base="portlet:string">
-			<enumeration value="true"/>
-			<enumeration value="false"/>
-		</restriction>
-	</simpleType>
-	<complexType name="resource-bundleType">
-		<annotation>
-			<documentation>
-			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
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="portlet:string"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="role-linkType">
-		<annotation>
-			<documentation>
-			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
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="portlet:string"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="security-constraintType">
-		<annotation>
-			<documentation>
-			The security-constraintType is used to associate
-			intended security constraints with one or more portlets.
-			Used in: portlet-app
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="display-name" type="portlet:display-nameType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="portlet-collection" type="portlet:portlet-collectionType"/>
-			<element name="user-data-constraint" type="portlet:user-data-constraintType"/>
-		</sequence>
-		<attribute name="id" type="portlet:string" use="optional"/>
-	</complexType>
-	<complexType name="security-role-refType">
-		<annotation>
-			<documentation>
-			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
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="role-name" type="portlet:role-nameType"/>
-			<element name="role-link" type="portlet:role-linkType" minOccurs="0"/>
-		</sequence>
-		<attribute name="id" type="portlet:string" use="optional"/>
-	</complexType>
-	<complexType name="public-render-parameterType">
-		<annotation>
-			<documentation>
-			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 parameter in the portlet code.
-			Used in: portlet-app
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="identifier" type="portlet:string"/>
-			<choice>
-				<element name="qname" type="xs:QName"/>
-				<element name="name" type="xs:NCName"/>
-			</choice>
-			<element name="alias" type="xs:QName" minOccurs="0" maxOccurs="unbounded"/>
-		</sequence>
-		<attribute name="id" type="portlet:string" use="optional"/>
-	</complexType>
-	<complexType name="short-titleType">
-		<annotation>
-			<documentation>
-			Locale specific short version of the static title.
-			Used in: portlet-info
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="portlet:string"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="supportsType">
-		<annotation>
-			<documentation>
-			Supports indicates the portlet modes a 
-			portlet supports for a specific content type. All portlets must 
-			support the view mode. 
-			Used in: portlet
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="mime-type" type="portlet:mime-typeType"/>
-			<element name="portlet-mode" type="portlet:portlet-modeType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="window-state" type="portlet:window-stateType" minOccurs="0" maxOccurs="unbounded"/>
-		</sequence>
-		<attribute name="id" type="portlet:string" use="optional"/>
-	</complexType>
-	<complexType name="supported-localeType">
-		<annotation>
-			<documentation>
-			Indicated the locales the portlet supports.
-			Used in: portlet
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="portlet:string"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="titleType">
-		<annotation>
-			<documentation>
-			Locale specific static title for this portlet.
-			Used in: portlet-info
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="portlet:string"/>
-		</simpleContent>
-	</complexType>
-	<simpleType name="transport-guaranteeType">
-		<annotation>
-			<documentation>
-			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
-			</documentation>
-		</annotation>
-		<restriction base="portlet:string">
-			<enumeration value="NONE"/>
-			<enumeration value="INTEGRAL"/>
-			<enumeration value="CONFIDENTIAL"/>
-		</restriction>
-	</simpleType>
-	<complexType name="user-attributeType">
-		<annotation>
-			<documentation>
-			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
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="name" type="portlet:nameType"/>
-		</sequence>
-		<attribute name="id" type="portlet:string" use="optional"/>
-	</complexType>
-	<complexType name="user-data-constraintType">
-		<annotation>
-			<documentation>
-			The user-data-constraintType is used to indicate how
-			data communicated between the client and portlet should be
-			protected.
-			Used in: security-constraint
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="transport-guarantee" type="portlet:transport-guaranteeType"/>
-		</sequence>
-		<attribute name="id" type="portlet:string" use="optional"/>
-	</complexType>
-	<complexType name="valueType">
-		<annotation>
-			<documentation>
-			The value element contains the value of a parameter.
-			Used in: init-param
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="portlet:string"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="window-stateType">
-		<annotation>
-			<documentation>
-			Portlet window state. Window state names are not case sensitive.
-			Used in: custom-window-state
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="portlet:string"/>
-		</simpleContent>
-	</complexType>
-	<!--- everything below is copied from j2ee_1_4.xsd -->
-	<complexType name="descriptionType">
-		<annotation>
-			<documentation>
-			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(“en”).
-			Used in: init-param, portlet, portlet-app, security-role
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="portlet:string">
-				<attribute ref="xml:lang"/>
-			</extension>
-		</simpleContent>
-	</complexType>
-	<complexType name="display-nameType">
-		<annotation>
-			<documentation>
-			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:
-				...
-  			<display-name xml:lang="en">Employee Self Service</display-name>
-
-			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(“en”).
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="portlet:string">
-				<attribute ref="xml:lang"/>
-			</extension>
-		</simpleContent>
-	</complexType>
-	<simpleType name="fully-qualified-classType">
-		<annotation>
-			<documentation>
-			The elements that use this type designate the name of a
-			Java class or interface.
-			</documentation>
-		</annotation>
-		<restriction base="portlet:string"/>
-	</simpleType>
-	<simpleType name="role-nameType">
-		<annotation>
-			<documentation>
-			The role-nameType designates the name of a security role.
-
-			The name must conform to the lexical rules for an NMTOKEN.
-			</documentation>
-		</annotation>
-		<restriction base="NMTOKEN"/>
-	</simpleType>
-	<simpleType name="string">
-		<annotation>
-			<documentation>
-			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.
-			</documentation>
-		</annotation>
-		<restriction base="string">
-			<whiteSpace value="collapse"/>
-		</restriction>
-	</simpleType>
-	<simpleType name="filter-nameType">
-		<annotation>
-			<documentation>
-			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
-			</documentation>
-		</annotation>
-		<restriction base="portlet:string"/>
-	</simpleType>
-</schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.0" xml:lang="en">
+	<annotation>
+		<documentation>
+		This is the XML Schema for the Portlet 2.0 deployment descriptor.
+		</documentation>
+	</annotation>
+	<annotation>
+		<documentation>
+		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.
+		</documentation>
+	</annotation>
+	<!-- *********************************************************** -->
+	<import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+	<element name="portlet-app" type="portlet:portlet-appType">
+		<annotation>
+			<documentation>
+			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".
+			</documentation>
+		</annotation>
+		<unique name="portlet-name-uniqueness">
+			<annotation>
+				<documentation>
+				The portlet element contains the name of a portlet.
+				This name must be unique within the portlet application.
+				 </documentation>
+			</annotation>
+			<selector xpath="portlet:portlet"/>
+			<field xpath="portlet:portlet-name"/>
+		</unique>
+		<unique name="custom-portlet-mode-uniqueness">
+			<annotation>
+				<documentation>
+				The custom-portlet-mode element contains the portlet-mode.
+				This portlet mode must be unique within the portlet application.
+				</documentation>
+			</annotation>
+			<selector xpath="portlet:custom-portlet-mode"/>
+			<field xpath="portlet:portlet-mode"/>
+		</unique>
+		<unique name="custom-window-state-uniqueness">
+			<annotation>
+				<documentation>
+				The custom-window-state element contains the window-state.
+				This window state must be unique within the portlet application.
+				</documentation>
+			</annotation>
+			<selector xpath="portlet:custom-window-state"/>
+			<field xpath="portlet:window-state"/>
+		</unique>
+		<unique name="user-attribute-name-uniqueness">
+			<annotation>
+				<documentation>
+				The user-attribute element contains the name the attribute.
+				This name must be unique within the portlet application.
+				</documentation>
+			</annotation>
+			<selector xpath="portlet:user-attribute"/>
+			<field xpath="portlet:name"/>
+		</unique>
+		<unique name="filter-name-uniqueness">
+			<annotation>
+				<documentation>
+				The filter element contains the name of a filter.
+				The name must be unique within the portlet application.
+				</documentation>
+			</annotation>
+			<selector xpath="portlet:filter"/>
+			<field xpath="portlet:filter-name"/>
+		</unique>
+	</element>
+	<complexType name="portlet-appType">
+		<sequence>
+			<element name="portlet" type="portlet:portletType" minOccurs="0" maxOccurs="unbounded">
+				<unique name="init-param-name-uniqueness">
+					<annotation>
+						<documentation>
+						The init-param element contains the name the attribute.
+						This name must be unique within the portlet.
+						</documentation>
+					</annotation>
+					<selector xpath="portlet:init-param"/>
+					<field xpath="portlet:name"/>
+				</unique>
+				<unique name="supports-mime-type-uniqueness">
+					<annotation>
+						<documentation>
+						The supports element contains the supported mime-type.
+						This mime type must be unique within the portlet.
+						</documentation>
+					</annotation>
+					<selector xpath="portlet:supports"/>
+					<field xpath="mime-type"/>
+				</unique>
+				<unique name="preference-name-uniqueness">
+					<annotation>
+						<documentation>
+						The preference element contains the name the preference.
+						This name must be unique within the portlet.
+						</documentation>
+					</annotation>
+					<selector xpath="portlet:portlet-preferences/portlet:preference"/>
+					<field xpath="portlet:name"/>
+				</unique>
+				<unique name="security-role-ref-name-uniqueness">
+					<annotation>
+						<documentation>
+						The security-role-ref element contains the role-name.
+						This role name must be unique within the portlet.
+						</documentation>
+					</annotation>
+					<selector xpath="portlet:security-role-ref"/>
+					<field xpath="portlet:role-name"/>
+				</unique>
+			</element>
+			<element name="custom-portlet-mode" type="portlet:custom-portlet-modeType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="custom-window-state" type="portlet:custom-window-stateType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="user-attribute" type="portlet:user-attributeType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="security-constraint" type="portlet:security-constraintType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="resource-bundle" type="portlet:resource-bundleType" minOccurs="0"/>
+			<element name="filter" type="portlet:filterType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="filter-mapping" type="portlet:filter-mappingType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="default-namespace" type="xs:anyURI" minOccurs="0"/>
+			<element name="event-definition" type="portlet:event-definitionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="public-render-parameter" type="portlet:public-render-parameterType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="listener" type="portlet:listenerType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="container-runtime-option" type="portlet:container-runtime-optionType" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+		<attribute name="version" type="portlet:string" use="required"/>
+		<attribute name="id" type="portlet:string" use="optional"/>
+	</complexType>
+	<complexType name="cache-scopeType">
+		<annotation>
+			<documentation>
+			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 across users.
+			The default value if not present is "private".
+			Used in: portlet
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="custom-portlet-modeType">
+		<annotation>
+			<documentation>
+			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
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="portlet-mode" type="portlet:portlet-modeType"/>
+			<element name="portal-managed" type="portlet:portal-managedType" minOccurs="0"/>
+		</sequence>
+		<attribute name="id" type="portlet:string" use="optional"/>
+	</complexType>
+	<complexType name="custom-window-stateType">
+		<annotation>
+			<documentation>
+			A custom window state that one or more portlets in this 
+			portlet application supports.
+			Used in: portlet-app
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="window-state" type="portlet:window-stateType"/>
+		</sequence>
+		<attribute name="id" type="portlet:string" use="optional"/>
+	</complexType>
+	<complexType name="expiration-cacheType">
+		<annotation>
+			<documentation>
+			Expiration-time defines the time in seconds after which the portlet output expires. 
+			-1 indicates that the output never expires.
+			Used in: portlet
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="int"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="init-paramType">
+		<annotation>
+			<documentation>
+			The init-param element contains a name/value pair as an 
+			initialization param of the portlet
+			Used in:portlet
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="name" type="portlet:nameType"/>
+			<element name="value" type="portlet:valueType"/>
+		</sequence>
+		<attribute name="id" type="portlet:string" use="optional"/>
+	</complexType>
+	<complexType name="keywordsType">
+		<annotation>
+			<documentation>
+			Locale specific keywords associated with this portlet.
+			The kewords are separated by commas.
+			Used in: portlet-info
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="mime-typeType">
+		<annotation>
+			<documentation>
+			MIME type name, e.g. "text/html".
+			The MIME type may also contain the wildcard
+			character '*', like "text/*" or "*/*".
+			Used in: supports
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="nameType">
+		<annotation>
+			<documentation>
+			The name element contains the name of a parameter. 
+			Used in: init-param, ...
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="portletType">
+		<annotation>
+			<documentation>
+			The portlet element contains the declarative data of a portlet. 
+			Used in: portlet-app
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="portlet-name" type="portlet:portlet-nameType"/>
+			<element name="display-name" type="portlet:display-nameType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="portlet-class" type="portlet:portlet-classType"/>
+			<element name="init-param" type="portlet:init-paramType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="expiration-cache" type="portlet:expiration-cacheType" minOccurs="0"/>
+			<element name="cache-scope" type="portlet:cache-scopeType" minOccurs="0"/>
+			<element name="supports" type="portlet:supportsType" maxOccurs="unbounded"/>
+			<element name="supported-locale" type="portlet:supported-localeType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="resource-bundle" type="portlet:resource-bundleType" minOccurs="0"/>
+			<element name="portlet-info" type="portlet:portlet-infoType" minOccurs="0"/>
+			<element name="portlet-preferences" type="portlet:portlet-preferencesType" minOccurs="0"/>
+			<element name="security-role-ref" type="portlet:security-role-refType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="supported-processing-event" type="portlet:event-definition-referenceType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="supported-publishing-event" type="portlet:event-definition-referenceType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="supported-public-render-parameter" type="portlet:string" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="container-runtime-option" type="portlet:container-runtime-optionType" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+		<attribute name="id" type="portlet:string" use="optional"/>
+	</complexType>
+	<simpleType name="portlet-classType">
+		<annotation>
+			<documentation>
+			 The portlet-class element contains the fully
+			 qualified class name of the portlet.
+			Used in: portlet
+			</documentation>
+		</annotation>
+		<restriction base="portlet:fully-qualified-classType"/>
+	</simpleType>
+	<complexType name="container-runtime-optionType">
+		<annotation>
+			<documentation>
+			 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
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="name" type="portlet:nameType"/>
+			<element name="value" type="portlet:valueType" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+	</complexType>
+	<complexType name="filter-mappingType">
+		<annotation>
+			<documentation>
+			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
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="filter-name" type="portlet:filter-nameType"/>
+			<element name="portlet-name" type="portlet:portlet-nameType" maxOccurs="unbounded"/>
+		</sequence>
+	</complexType>
+	<complexType name="filterType">
+		<annotation>
+			<documentation>
+				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
+				</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="display-name" type="portlet:display-nameType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="filter-name" type="portlet:filter-nameType"/>
+			<element name="filter-class" type="portlet:fully-qualified-classType"/>
+			<element name="lifecycle" type="portlet:string" maxOccurs="unbounded"/>
+			<element name="init-param" type="portlet:init-paramType" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+	</complexType>
+	<complexType name="portlet-collectionType">
+		<annotation>
+			<documentation>
+			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
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="portlet-name" type="portlet:portlet-nameType" maxOccurs="unbounded"/>
+		</sequence>
+	</complexType>
+	<complexType name="event-definitionType">
+		<annotation>
+			<documentation>
+			The event-definitionType is used to declare events the portlet can either
+			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
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<choice>
+				<element name="qname" type="xs:QName"/>
+				<element name="name" type="xs:NCName"/>
+			</choice>
+			<element name="alias" type="xs:QName" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="value-type" type="portlet:fully-qualified-classType" minOccurs="0"/>
+		</sequence>
+		<attribute name="id" type="portlet:string" use="optional"/>
+	</complexType>
+	<complexType name="event-definition-referenceType">
+		<annotation>
+			<documentation>
+			The event-definition-referenceType is used to reference events 
+			declared with the event-definition element at application level.
+			Used in: portlet
+			</documentation>
+		</annotation>
+		<choice>
+			<element name="qname" type="xs:QName"/>
+			<element name="name" type="xs:NCName"/>
+		</choice>
+		<attribute name="id" type="portlet:string" use="optional"/>
+	</complexType>
+	<complexType name="listenerType">
+		<annotation>
+			<documentation>
+			The listenerType is used to declare listeners for this portlet application.
+			Used in: portlet-app
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="display-name" type="portlet:display-nameType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="listener-class" type="portlet:fully-qualified-classType"/>
+		</sequence>
+		<attribute name="id" type="portlet:string" use="optional"/>
+	</complexType>
+	<complexType name="portlet-infoType">
+		<sequence>
+			<element name="title" type="portlet:titleType" minOccurs="0"/>
+			<element name="short-title" type="portlet:short-titleType" minOccurs="0"/>
+			<element name="keywords" type="portlet:keywordsType" minOccurs="0"/>
+		</sequence>
+		<attribute name="id" type="portlet:string" use="optional"/>
+	</complexType>
+	<simpleType name="portal-managedType">
+		<annotation>
+			<documentation>
+			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
+			</documentation>
+		</annotation>
+		<restriction base="portlet:string">
+			<enumeration value="true"/>
+			<enumeration value="false"/>
+		</restriction>
+	</simpleType>
+	<complexType name="portlet-modeType">
+		<annotation>
+			<documentation>
+			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
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="portlet-nameType">
+		<annotation>
+			<documentation>
+			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
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="portlet-preferencesType">
+		<annotation>
+			<documentation>
+			Portlet persistent preference store.
+			Used in: portlet
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="preference" type="portlet:preferenceType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="preferences-validator" type="portlet:preferences-validatorType" minOccurs="0"/>
+		</sequence>
+		<attribute name="id" type="portlet:string" use="optional"/>
+	</complexType>
+	<complexType name="preferenceType">
+		<annotation>
+			<documentation>
+			Persistent preference values that may be used for customization 
+			and personalization by the portlet.
+			Used in: portlet-preferences
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="name" type="portlet:nameType"/>
+			<element name="value" type="portlet:valueType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="read-only" type="portlet:read-onlyType" minOccurs="0"/>
+		</sequence>
+		<attribute name="id" type="portlet:string" use="optional"/>
+	</complexType>
+	<simpleType name="preferences-validatorType">
+		<annotation>
+			<documentation>
+			The class specified under preferences-validator implements
+			the PreferencesValidator interface to validate the 
+			preferences settings.
+			Used in: portlet-preferences
+			</documentation>
+		</annotation>
+		<restriction base="portlet:fully-qualified-classType"/>
+	</simpleType>
+	<simpleType name="read-onlyType">
+		<annotation>
+			<documentation>
+			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
+			</documentation>
+		</annotation>
+		<restriction base="portlet:string">
+			<enumeration value="true"/>
+			<enumeration value="false"/>
+		</restriction>
+	</simpleType>
+	<complexType name="resource-bundleType">
+		<annotation>
+			<documentation>
+			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
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="role-linkType">
+		<annotation>
+			<documentation>
+			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
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="security-constraintType">
+		<annotation>
+			<documentation>
+			The security-constraintType is used to associate
+			intended security constraints with one or more portlets.
+			Used in: portlet-app
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="display-name" type="portlet:display-nameType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="portlet-collection" type="portlet:portlet-collectionType"/>
+			<element name="user-data-constraint" type="portlet:user-data-constraintType"/>
+		</sequence>
+		<attribute name="id" type="portlet:string" use="optional"/>
+	</complexType>
+	<complexType name="security-role-refType">
+		<annotation>
+			<documentation>
+			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
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="role-name" type="portlet:role-nameType"/>
+			<element name="role-link" type="portlet:role-linkType" minOccurs="0"/>
+		</sequence>
+		<attribute name="id" type="portlet:string" use="optional"/>
+	</complexType>
+	<complexType name="public-render-parameterType">
+		<annotation>
+			<documentation>
+			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 parameter in the portlet code.
+			Used in: portlet-app
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="identifier" type="portlet:string"/>
+			<choice>
+				<element name="qname" type="xs:QName"/>
+				<element name="name" type="xs:NCName"/>
+			</choice>
+			<element name="alias" type="xs:QName" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+		<attribute name="id" type="portlet:string" use="optional"/>
+	</complexType>
+	<complexType name="short-titleType">
+		<annotation>
+			<documentation>
+			Locale specific short version of the static title.
+			Used in: portlet-info
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="supportsType">
+		<annotation>
+			<documentation>
+			Supports indicates the portlet modes a 
+			portlet supports for a specific content type. All portlets must 
+			support the view mode. 
+			Used in: portlet
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="mime-type" type="portlet:mime-typeType"/>
+			<element name="portlet-mode" type="portlet:portlet-modeType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="window-state" type="portlet:window-stateType" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+		<attribute name="id" type="portlet:string" use="optional"/>
+	</complexType>
+	<complexType name="supported-localeType">
+		<annotation>
+			<documentation>
+			Indicated the locales the portlet supports.
+			Used in: portlet
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="titleType">
+		<annotation>
+			<documentation>
+			Locale specific static title for this portlet.
+			Used in: portlet-info
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<simpleType name="transport-guaranteeType">
+		<annotation>
+			<documentation>
+			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
+			</documentation>
+		</annotation>
+		<restriction base="portlet:string">
+			<enumeration value="NONE"/>
+			<enumeration value="INTEGRAL"/>
+			<enumeration value="CONFIDENTIAL"/>
+		</restriction>
+	</simpleType>
+	<complexType name="user-attributeType">
+		<annotation>
+			<documentation>
+			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
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="name" type="portlet:nameType"/>
+		</sequence>
+		<attribute name="id" type="portlet:string" use="optional"/>
+	</complexType>
+	<complexType name="user-data-constraintType">
+		<annotation>
+			<documentation>
+			The user-data-constraintType is used to indicate how
+			data communicated between the client and portlet should be
+			protected.
+			Used in: security-constraint
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="transport-guarantee" type="portlet:transport-guaranteeType"/>
+		</sequence>
+		<attribute name="id" type="portlet:string" use="optional"/>
+	</complexType>
+	<complexType name="valueType">
+		<annotation>
+			<documentation>
+			The value element contains the value of a parameter.
+			Used in: init-param
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="window-stateType">
+		<annotation>
+			<documentation>
+			Portlet window state. Window state names are not case sensitive.
+			Used in: custom-window-state
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<!--- everything below is copied from j2ee_1_4.xsd -->
+	<complexType name="descriptionType">
+		<annotation>
+			<documentation>
+			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(“en”).
+			Used in: init-param, portlet, portlet-app, security-role
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string">
+				<attribute ref="xml:lang"/>
+			</extension>
+		</simpleContent>
+	</complexType>
+	<complexType name="display-nameType">
+		<annotation>
+			<documentation>
+			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:
+				...
+  			<display-name xml:lang="en">Employee Self Service</display-name>
+
+			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(“en”).
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string">
+				<attribute ref="xml:lang"/>
+			</extension>
+		</simpleContent>
+	</complexType>
+	<simpleType name="fully-qualified-classType">
+		<annotation>
+			<documentation>
+			The elements that use this type designate the name of a
+			Java class or interface.
+			</documentation>
+		</annotation>
+		<restriction base="portlet:string"/>
+	</simpleType>
+	<simpleType name="role-nameType">
+		<annotation>
+			<documentation>
+			The role-nameType designates the name of a security role.
+
+			The name must conform to the lexical rules for an NMTOKEN.
+			</documentation>
+		</annotation>
+		<restriction base="NMTOKEN"/>
+	</simpleType>
+	<simpleType name="string">
+		<annotation>
+			<documentation>
+			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.
+			</documentation>
+		</annotation>
+		<restriction base="xs:token">
+			<whiteSpace value="collapse"/>
+		</restriction>
+	</simpleType>
+	<simpleType name="filter-nameType">
+		<annotation>
+			<documentation>
+			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
+			</documentation>
+		</annotation>
+		<restriction base="portlet:string"/>
+	</simpleType>
+</schema>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/resources/org/apache/pluto/container/impl/portlet-app_3_0.xsd
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/resources/org/apache/pluto/container/impl/portlet-app_3_0.xsd b/pluto-container/src/main/resources/org/apache/pluto/container/impl/portlet-app_3_0.xsd
index 524b494..a2f1f16 100644
--- a/pluto-container/src/main/resources/org/apache/pluto/container/impl/portlet-app_3_0.xsd
+++ b/pluto-container/src/main/resources/org/apache/pluto/container/impl/portlet-app_3_0.xsd
@@ -818,7 +818,7 @@
 			type may be used.
 			</documentation>
 		</annotation>
-		<restriction base="string">
+		<restriction base="xs:token">
 			<whiteSpace value="collapse"/>
 		</restriction>
 	</simpleType>


[33/38] portals-pluto git commit: Continued work on header phase implementation. Implemented PortletResponse#addProperty(String, Element) for both V2 and V3 portlets. Completed execution path that allows the header information to be integrated into the o

Posted by ms...@apache.org.
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java
index 868dc20..ddc6c63 100644
--- a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java
@@ -18,8 +18,11 @@ package org.apache.pluto.driver;
 
 import java.io.IOException;
 import java.io.Writer;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
 import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
@@ -27,8 +30,12 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.pluto.container.HeaderData;
 import org.apache.pluto.container.PortletContainer;
 import org.apache.pluto.container.PortletContainerException;
+import org.apache.pluto.container.om.portlet.ContainerRuntimeOption;
+import org.apache.pluto.container.om.portlet.PortletDefinition;
+import org.apache.pluto.driver.config.DriverConfiguration;
 import org.apache.pluto.driver.core.PortalRequestContext;
 import org.apache.pluto.driver.core.PortletWindowImpl;
 import org.apache.pluto.driver.services.portal.PageConfig;
@@ -40,9 +47,9 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * The controller servlet used to drive the Portal Driver. All requests mapped
- * to this servlet will be processed as Portal Requests.
- *
+ * The controller servlet used to drive the Portal Driver. All requests mapped to this servlet will be processed as
+ * Portal Requests.
+ * 
  * @version 1.0
  * @since Sep 22, 2004
  */
@@ -51,8 +58,7 @@ public class PortalDriverServlet extends HttpServlet {
    private static final long   serialVersionUID = 1L;
 
    /** Internal Logger. */
-   private static final Logger LOG              = LoggerFactory
-                                                      .getLogger(PortalDriverServlet.class);
+   private static final Logger LOG              = LoggerFactory.getLogger(PortalDriverServlet.class);
 
    /** The Portal Driver sServlet Context */
    private ServletContext      servletContext   = null;
@@ -72,15 +78,13 @@ public class PortalDriverServlet extends HttpServlet {
    }
 
    /**
-    * Initialize the Portal Driver. This method retrieves the portlet container
-    * instance from the servlet context scope.
+    * Initialize the Portal Driver. This method retrieves the portlet container instance from the servlet context scope.
     * 
     * @see PortletContainer
     */
    public void init() {
       servletContext = getServletContext();
-      container = (PortletContainer) servletContext
-            .getAttribute(AttributeKeys.PORTLET_CONTAINER);
+      container = (PortletContainer) servletContext.getAttribute(AttributeKeys.PORTLET_CONTAINER);
       String charset = getServletConfig().getInitParameter("charset");
       if (charset != null && charset.length() > 0) {
          contentType = "text/html; charset=" + charset;
@@ -100,8 +104,7 @@ public class PortalDriverServlet extends HttpServlet {
     * @throws IOException
     *            if an error occurs writing to the response.
     */
-   public void doGet(HttpServletRequest request, HttpServletResponse response)
-         throws ServletException, IOException {
+   public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
       if (LOG.isDebugEnabled()) {
          LOG.debug("Start of PortalDriverServlet.doGet() to process portlet request . . .");
       }
@@ -110,16 +113,14 @@ public class PortalDriverServlet extends HttpServlet {
          response.setContentType(contentType);
       }
 
-      PortalRequestContext portalRequestContext = new PortalRequestContext(
-            getServletContext(), request, response);
+      PortalRequestContext portalRequestContext = new PortalRequestContext(getServletContext(), request, response);
 
       PortalURL portalURL = null;
 
       try {
          portalURL = portalRequestContext.getRequestedPortalURL();
       } catch (Exception ex) {
-         String msg = "Cannot handle request for portal URL. Problem: "
-               + ex.getMessage();
+         String msg = "Cannot handle request for portal URL. Problem: " + ex.getMessage();
          LOG.error(msg, ex);
          throw new ServletException(msg, ex);
       }
@@ -129,60 +130,54 @@ public class PortalDriverServlet extends HttpServlet {
       // Handle Action, Ajax Action, Partial Action, & Resource requests.
       // Render requests handled subsequently.
 
-      if (targetWindow != null && portalURL.getType() != URLType.Render
-            && portalURL.getType() != URLType.Portal) {
+      if (targetWindow != null && portalURL.getType() != URLType.Render && portalURL.getType() != URLType.Portal) {
 
          String reqType = portalURL.getType().toString();
          PortletWindowConfig windowConfig = PortletWindowConfig.fromId(targetWindow);
-         PortletWindowImpl portletWindow = new PortletWindowImpl(container,
-               windowConfig, portalURL);
+         PortletWindowImpl portletWindow = new PortletWindowImpl(container, windowConfig, portalURL);
 
          if (LOG.isDebugEnabled()) {
-            LOG.debug("Processing " + reqType + " request for window: "
-                  + portletWindow.getId().getStringId());
+            LOG.debug("Processing " + reqType + " request for window: " + portletWindow.getId().getStringId());
          }
 
          try {
             PageState ps;
             String jsondata;
             switch (portalURL.getType()) {
-               case Action:
-                  container.doAction(portletWindow, request, response, true);
-                  break;
-               case AjaxAction:
-                  container.doAction(portletWindow, request, response, false);
-                  response.setContentType("application/json");
-                  ps = new PageState(request);
-                  Writer writer = response.getWriter();
-                  jsondata = ps.toJSONString();
-                  LOG.debug("Ajax Action: returning new page state to client: "
-                        + jsondata);
-                  writer.write(jsondata);
-                  break;
-               case PartialAction:
-                  container.doAction(portletWindow, request, response, false);
-
-                  // The page state is made available to the ResourceRequest by
-                  // passing
-                  // it through all layers, which allows for special case
-                  // processing at
-                  // some points.
-
-                  ps = new PageState(request);
-                  jsondata = ps.toJSONString();
-                  if (LOG.isDebugEnabled()) {
-                     LOG.debug("Partial Action: dump page state:\n" + jsondata);
-                  }
-
-                  container.doServeResource(portletWindow, request, response,
-                        jsondata);
-                  break;
-               case Resource:
-                  container.doServeResource(portletWindow, request, response,
-                        null);
-                  break;
-               default:
-                  LOG.warn("Unknown request: " + reqType);
+            case Action:
+               container.doAction(portletWindow, request, response, true);
+               break;
+            case AjaxAction:
+               container.doAction(portletWindow, request, response, false);
+               response.setContentType("application/json");
+               ps = new PageState(request);
+               Writer writer = response.getWriter();
+               jsondata = ps.toJSONString();
+               LOG.debug("Ajax Action: returning new page state to client: " + jsondata);
+               writer.write(jsondata);
+               break;
+            case PartialAction:
+               container.doAction(portletWindow, request, response, false);
+
+               // The page state is made available to the ResourceRequest by
+               // passing
+               // it through all layers, which allows for special case
+               // processing at
+               // some points.
+
+               ps = new PageState(request);
+               jsondata = ps.toJSONString();
+               if (LOG.isDebugEnabled()) {
+                  LOG.debug("Partial Action: dump page state:\n" + jsondata);
+               }
+
+               container.doServeResource(portletWindow, request, response, jsondata);
+               break;
+            case Resource:
+               container.doServeResource(portletWindow, request, response, null);
+               break;
+            default:
+               LOG.warn("Unknown request: " + reqType);
             }
          } catch (PortletContainerException ex) {
             LOG.error(ex.getMessage(), ex);
@@ -214,23 +209,24 @@ public class PortalDriverServlet extends HttpServlet {
 
          request.setAttribute(AttributeKeys.CURRENT_PAGE, pageConfig);
          String uri = (pageConfig.getUri() != null) ? pageConfig.getUri() : DEFAULT_PAGE_URI;
-         
+
          // Execute header request for each portlet on the page
-         
+
          if (LOG.isDebugEnabled()) {
             LOG.debug("Executing header requests for target portlets.");
          }
 
-         doHeaders(request, response, portalURL);
-         
+         String markup = doHeaders(request, response, portalURL);
+         request.setAttribute(AttributeKeys.HEAD_SECTION_MARKUP, markup);
+
          if (LOG.isDebugEnabled()) {
             LOG.debug("Dispatching to: " + uri);
          }
-         
+
          // Dispatch to the JSP that aggregates the page.
          RequestDispatcher dispatcher = request.getRequestDispatcher(uri);
          dispatcher.forward(request, response);
-         
+
          if (LOG.isDebugEnabled()) {
             LOG.debug("Render request processed.\n\n");
          }
@@ -238,8 +234,7 @@ public class PortalDriverServlet extends HttpServlet {
    }
 
    /**
-    * Pass all POST requests to
-    * {@link #doGet(HttpServletRequest, HttpServletResponse)}.
+    * Pass all POST requests to {@link #doGet(HttpServletRequest, HttpServletResponse)}.
     * 
     * @param request
     *           the incoming servlet request.
@@ -250,22 +245,55 @@ public class PortalDriverServlet extends HttpServlet {
     * @throws IOException
     *            if an exception occurs writing to the response.
     */
-   public void doPost(HttpServletRequest request, HttpServletResponse response)
-         throws ServletException, IOException {
+   public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
       doGet(request, response);
    }
-   
-   
-   private void doHeaders(HttpServletRequest req, HttpServletResponse resp, PortalURL purl) {
+
+   private String doHeaders(HttpServletRequest req, HttpServletResponse resp, PortalURL purl) throws ServletException,
+         IOException {
+
+      ServletContext sc = req.getServletContext();
+      DriverConfiguration dc = (DriverConfiguration) sc.getAttribute(AttributeKeys.DRIVER_CONFIG);
+      StringBuilder markup = new StringBuilder(128);
       
+
       for (String pid : purl.getPortletIds()) {
-         PortletWindowConfig wcfg = PortletWindowConfig.fromId(pid); 
+
+         PortletWindowConfig wcfg = PortletWindowConfig.fromId(pid);
          PortletWindowImpl pwin = new PortletWindowImpl(container, wcfg, purl);
+         HeaderData hd = null;
+
          try {
-            container.doHeader(pwin, req, resp);
-         } catch (Exception e) {
+            if (purl.isVersion3(pid)) {
+               hd = container.doHeader(pwin, req, resp);
+            } else if (purl.getVersion(pid).equalsIgnoreCase("2.0")) {
+
+               String appName = wcfg.getContextPath();
+               String portletName = PortletWindowConfig.parsePortletName(pid);
+               PortletDefinition pd = dc.getPortletRegistryService().getPortletApplication(appName)
+                     .getPortlet(portletName);
+               ContainerRuntimeOption crt = pd.getContainerRuntimeOption("javax.portlet.renderHeaders");
+               if (crt != null) {
+                  List<String> headers = crt.getValues();
+                  if (headers.size() == 1 && headers.get(0).equalsIgnoreCase("true")) {
+                    hd = container.doRender(pwin, req, resp, PortletRequest.RENDER_HEADERS);
+                  }
+               }
+            }
             
+            if (hd != null) {
+               markup.append(hd.getHeadSectionMarkup()).append("\n");
+            }
+            
+         } catch (PortletContainerException ex) {
+            LOG.error(ex.getMessage(), ex);
+            throw new ServletException(ex);
+         } catch (PortletException ex) {
+            LOG.error(ex.getMessage(), ex);
+            throw new ServletException(ex);
          }
       }
+      
+      return markup.toString();
    }
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/PortletTag.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/PortletTag.java b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/PortletTag.java
index d465928..6a2d644 100644
--- a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/PortletTag.java
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/PortletTag.java
@@ -1,231 +1,248 @@
-/*
- * 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.
- */
-package org.apache.pluto.driver.tags;
-
-import java.io.StringWriter;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.portlet.WindowState;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.tagext.BodyTagSupport;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.pluto.container.PortletContainer;
-import org.apache.pluto.container.PortletWindow;
-import org.apache.pluto.driver.AttributeKeys;
-import org.apache.pluto.driver.core.PortalRequestContext;
-import org.apache.pluto.driver.core.PortalServletResponse;
-import org.apache.pluto.driver.core.PortletWindowImpl;
-import org.apache.pluto.driver.services.portal.PortletWindowConfig;
-import org.apache.pluto.driver.url.PortalURL;
-import org.apache.pluto.tags.el.ExpressionEvaluatorProxy;
-
-/**
- * The portlet tag is used to render a portlet specified by the portlet ID.
- *
- * @see javax.portlet.Portlet#render(javax.portlet.RenderRequest,javax.portlet.RenderResponse)
- * @see org.apache.pluto.container.PortletContainer#doRender(PortletWindow, HttpServletRequest, HttpServletResponse)
- *
- */
-public class PortletTag extends BodyTagSupport {
-	
-	/** Logger. */
-    private static final Logger LOG = LoggerFactory.getLogger(PortletTag.class);
-    
-    /** Status constant for failed rendering. */
-    public static final int FAILED = 0;
-    
-    /** Status constant for successful rendering. */
-    public static final int SUCCESS = 1;
-    
-    
-    // Private Member Variables ------------------------------------------------
-    
-    /** The portlet ID attribute passed into this tag. */
-    private String portletId;
-
-    /** The evaluated value of the portlet ID attribute. */
-    private String evaluatedPortletId;
-
-    /** The cached portal servlet response holding rendering result. */
-    private PortalServletResponse response;
-
-    /** The cached rendering status: SUCCESS or FAILED. */
-    private int status;
-    
-    /** The cached Throwable instance when fail to render the portlet. */
-    private Throwable throwable;
-
-
-    // Tag Attribute Accessors -------------------------------------------------
-    
-    /**
-     * Returns the portlet ID attribute.
-     * @return the portlet ID attribute.
-     */
-    public String getPortletId() {
-        return portletId;
-    }
-    
-    /**
-     * Sets the portlet ID attribute.
-     * @param portletId  the portlet ID attribute.
-     */
-    public void setPortletId(String portletId) {
-        this.portletId = portletId;
-    }
-    
-    
-    // BodyTagSupport Impl -----------------------------------------------------
-    
-    /**
-     * Method invoked when the start tag is encountered.
-     * @throws JspException  if an error occurs.
-     */
-    public int doStartTag() throws JspException {
-        
-    	// Evaluate portlet ID attribute.
-    	evaluatePortletId();
-        
-    	// Retrieve the portlet window config for the evaluated portlet ID.
-        ServletContext servletContext = pageContext.getServletContext();
-
-        PortletWindowConfig windowConfig =
-            PortletWindowConfig.fromId(evaluatedPortletId);
-
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Rendering Portlet Window: " + windowConfig);
-        }
-        
-        // Retrieve the current portal URL.
-        PortalRequestContext portalEnv = PortalRequestContext.getContext(
-                (HttpServletRequest) pageContext.getRequest());
-        PortalURL portalURL = portalEnv.getRequestedPortalURL();
-        
-        // Retrieve the portlet container from servlet context.
-        PortletContainer container = (PortletContainer)
-                servletContext.getAttribute(AttributeKeys.PORTLET_CONTAINER);
-        
-        // Create the portlet window to render.
-        PortletWindow window = null;
-
-
-        try {
-        	window = new PortletWindowImpl(container, windowConfig, portalURL);
-        } catch(RuntimeException e) // FIXME: Prose a change to anything else, handle it.
-        {
-      	  if (LOG.isDebugEnabled()) {
-              LOG.debug("The portlet " + windowConfig.getPortletName() + " is not available. Is already deployed?");
-          }
-        }
-
-    	// Create portal servlet response to wrap the original
-    	// HTTP servlet response.
-    	PortalServletResponse portalResponse = new PortalServletResponse(
-                (HttpServletResponse) pageContext.getResponse());
-    	
-    	
-        if(window!=null)
-        {
-        	// Check if someone else is maximized. If yes, don't show content.
-        	Map windowStates = portalURL.getWindowStates();
-        	for (Iterator it = windowStates.keySet().iterator(); it.hasNext(); ) {
-        		String windowId = (String) it.next();
-        		WindowState windowState = (WindowState) windowStates.get(windowId);
-        		if (WindowState.MAXIMIZED.equals(windowState)
-        				&& !window.getId().getStringId().equals(windowId)) {
-        			return SKIP_BODY;
-        		}
-        	}
-
-        
-        }
-        
-        // Render the portlet and cache the response.
-        try {
-            container.doRender(window, (HttpServletRequest)pageContext.getRequest(), portalResponse);
-            response = portalResponse;
-            status = SUCCESS;
-        } catch (Throwable th) {
-            status = FAILED;
-            throwable = th;
-        }
-        
-        // Continue to evaluate the tag body.
-        return EVAL_BODY_INCLUDE;
-    }
-    
-    
-    // Package Methods ---------------------------------------------------------
-    
-    /**
-     * Returns the rendering status.
-     * @return the rendering status.
-     */
-    int getStatus() {
-        return status;
-    }
-    
-    /**
-     * Returns the portal servlet response holding rendering result. 
-     * @return the portal servlet response holding rendering result.
-     */
-    PortalServletResponse getPortalServletResponse() {
-        return response;
-    }
-    
-    /**
-     * Returns the error that has occurred when rendering portlet.
-     * @return the error that has occurred when rendering portlet.
-     */
-    Throwable getThrowable() {
-        return throwable;
-    }
-    
-    /**
-     * Returns the evaluated portlet ID.
-     * @return the evaluated portlet ID.
-     */
-    String getEvaluatedPortletId() {
-        return evaluatedPortletId;
-    }
-
-    
-    
-    // Private Methods ---------------------------------------------------------
-    
-    /**
-     * Evaluates the portlet ID attribute passed into this tag. This method
-     * evaluates the member variable <code>portletId</code> and saves the
-     * evaluated result to <code>evaluatedPortletId</code>
-     * @throws JspException  if an error occurs.
-     */
-    private void evaluatePortletId() throws JspException {
-        ExpressionEvaluatorProxy proxy = ExpressionEvaluatorProxy.getProxy();
-        Object obj = proxy.evaluate(portletId, pageContext);
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Evaluated portletId to: " + obj);
-        }
-        evaluatedPortletId = (String) obj;
-    }
-    
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.driver.tags;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.portlet.PortletRequest;
+import javax.portlet.WindowState;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.BodyTagSupport;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.pluto.container.PortletContainer;
+import org.apache.pluto.container.PortletWindow;
+import org.apache.pluto.container.om.portlet.ContainerRuntimeOption;
+import org.apache.pluto.container.om.portlet.PortletDefinition;
+import org.apache.pluto.driver.AttributeKeys;
+import org.apache.pluto.driver.config.DriverConfiguration;
+import org.apache.pluto.driver.core.PortalRequestContext;
+import org.apache.pluto.driver.core.PortalServletResponse;
+import org.apache.pluto.driver.core.PortletWindowImpl;
+import org.apache.pluto.driver.services.portal.PortletWindowConfig;
+import org.apache.pluto.driver.url.PortalURL;
+import org.apache.pluto.tags.el.ExpressionEvaluatorProxy;
+
+/**
+ * The portlet tag is used to render a portlet specified by the portlet ID.
+ * 
+ * @see javax.portlet.Portlet#render(javax.portlet.RenderRequest,javax.portlet.RenderResponse)
+ * @see org.apache.pluto.container.PortletContainer#doRender(PortletWindow, HttpServletRequest, HttpServletResponse)
+ * 
+ */
+public class PortletTag extends BodyTagSupport {
+   private static final long     serialVersionUID = 7369029503826395301L;
+
+   /** Logger. */
+   private static final Logger   LOG              = LoggerFactory.getLogger(PortletTag.class);
+
+   /** Status constant for failed rendering. */
+   public static final int       FAILED           = 0;
+
+   /** Status constant for successful rendering. */
+   public static final int       SUCCESS          = 1;
+
+   // Private Member Variables ------------------------------------------------
+
+   /** The portlet ID attribute passed into this tag. */
+   private String                portletId;
+
+   /** The evaluated value of the portlet ID attribute. */
+   private String                evaluatedPortletId;
+
+   /** The cached portal servlet response holding rendering result. */
+   private PortalServletResponse response;
+
+   /** The cached rendering status: SUCCESS or FAILED. */
+   private int                   status;
+
+   /** The cached Throwable instance when fail to render the portlet. */
+   private Throwable             throwable;
+
+   // Tag Attribute Accessors -------------------------------------------------
+
+   /**
+    * Returns the portlet ID attribute.
+    * 
+    * @return the portlet ID attribute.
+    */
+   public String getPortletId() {
+      return portletId;
+   }
+
+   /**
+    * Sets the portlet ID attribute.
+    * 
+    * @param portletId
+    *           the portlet ID attribute.
+    */
+   public void setPortletId(String portletId) {
+      this.portletId = portletId;
+   }
+
+   // BodyTagSupport Impl -----------------------------------------------------
+
+   /**
+    * Method invoked when the start tag is encountered.
+    * 
+    * @throws JspException
+    *            if an error occurs.
+    */
+   public int doStartTag() throws JspException {
+
+      // Evaluate portlet ID attribute.
+      evaluatePortletId();
+
+      // Retrieve the portlet window config for the evaluated portlet ID.
+      ServletContext servletContext = pageContext.getServletContext();
+
+      PortletWindowConfig windowConfig = PortletWindowConfig.fromId(evaluatedPortletId);
+
+      if (LOG.isDebugEnabled()) {
+         LOG.debug("Rendering Portlet Window: " + windowConfig);
+      }
+
+      // Retrieve the current portal URL.
+      PortalRequestContext portalEnv = PortalRequestContext.getContext((HttpServletRequest) pageContext.getRequest());
+      PortalURL portalURL = portalEnv.getRequestedPortalURL();
+
+      // Retrieve the portlet container from servlet context.
+      PortletContainer container = (PortletContainer) servletContext.getAttribute(AttributeKeys.PORTLET_CONTAINER);
+
+      // Create the portlet window to render.
+      PortletWindow window = null;
+
+      try {
+         window = new PortletWindowImpl(container, windowConfig, portalURL);
+      } catch (RuntimeException e) // FIXME: Prose a change to anything else, handle it.
+      {
+         if (LOG.isDebugEnabled()) {
+            LOG.debug("The portlet " + windowConfig.getPortletName() + " is not available. Is already deployed?");
+         }
+      }
+
+      // Create portal servlet response to wrap the original
+      // HTTP servlet response.
+      PortalServletResponse portalResponse = new PortalServletResponse((HttpServletResponse) pageContext.getResponse());
+
+      if (window != null) {
+         // Check if someone else is maximized. If yes, don't show content.
+         Map<String, WindowState> windowStates = portalURL.getWindowStates();
+         for (Iterator<String> it = windowStates.keySet().iterator(); it.hasNext();) {
+            String windowId = (String) it.next();
+            WindowState windowState = (WindowState) windowStates.get(windowId);
+            if (WindowState.MAXIMIZED.equals(windowState) && !window.getId().getStringId().equals(windowId)) {
+               return SKIP_BODY;
+            }
+         }
+
+      }
+
+      // Render the portlet and cache the response.
+      try {
+         String renderHeaders = null;
+         if (portalURL.getVersion(evaluatedPortletId).equalsIgnoreCase("2.0")) {
+
+            DriverConfiguration dc = (DriverConfiguration) servletContext.getAttribute(AttributeKeys.DRIVER_CONFIG);
+            String appName = windowConfig.getContextPath();
+            String portletName = PortletWindowConfig.parsePortletName(evaluatedPortletId);
+            PortletDefinition pd = dc.getPortletRegistryService().getPortletApplication(appName)
+                  .getPortlet(portletName);
+            ContainerRuntimeOption crt = pd.getContainerRuntimeOption("javax.portlet.renderHeaders");
+            if (crt != null) {
+               List<String> headers = crt.getValues();
+               if (headers.size() == 1 && headers.get(0).equalsIgnoreCase("true")) {
+                  renderHeaders = PortletRequest.RENDER_MARKUP;
+               }
+            }
+         }
+
+         container.doRender(window, (HttpServletRequest) pageContext.getRequest(), portalResponse, renderHeaders);
+         response = portalResponse;
+         status = SUCCESS;
+      } catch (Throwable th) {
+         status = FAILED;
+         throwable = th;
+      }
+
+      // Continue to evaluate the tag body.
+      return EVAL_BODY_INCLUDE;
+   }
+
+   // Package Methods ---------------------------------------------------------
+
+   /**
+    * Returns the rendering status.
+    * 
+    * @return the rendering status.
+    */
+   int getStatus() {
+      return status;
+   }
+
+   /**
+    * Returns the portal servlet response holding rendering result.
+    * 
+    * @return the portal servlet response holding rendering result.
+    */
+   PortalServletResponse getPortalServletResponse() {
+      return response;
+   }
+
+   /**
+    * Returns the error that has occurred when rendering portlet.
+    * 
+    * @return the error that has occurred when rendering portlet.
+    */
+   Throwable getThrowable() {
+      return throwable;
+   }
+
+   /**
+    * Returns the evaluated portlet ID.
+    * 
+    * @return the evaluated portlet ID.
+    */
+   String getEvaluatedPortletId() {
+      return evaluatedPortletId;
+   }
+
+   // Private Methods ---------------------------------------------------------
+
+   /**
+    * Evaluates the portlet ID attribute passed into this tag. This method evaluates the member variable
+    * <code>portletId</code> and saves the evaluated result to <code>evaluatedPortletId</code>
+    * 
+    * @throws JspException
+    *            if an error occurs.
+    */
+   private void evaluatePortletId() throws JspException {
+      ExpressionEvaluatorProxy proxy = ExpressionEvaluatorProxy.getProxy();
+      Object obj = proxy.evaluate(portletId, pageContext);
+      if (LOG.isDebugEnabled()) {
+         LOG.debug("Evaluated portletId to: " + obj);
+      }
+      evaluatedPortletId = (String) obj;
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/pluto-portal/src/main/webapp/WEB-INF/themes/pluto-default-theme.jsp
----------------------------------------------------------------------
diff --git a/pluto-portal/src/main/webapp/WEB-INF/themes/pluto-default-theme.jsp b/pluto-portal/src/main/webapp/WEB-INF/themes/pluto-default-theme.jsp
index 0c53aba..abb5e20 100644
--- a/pluto-portal/src/main/webapp/WEB-INF/themes/pluto-default-theme.jsp
+++ b/pluto-portal/src/main/webapp/WEB-INF/themes/pluto-default-theme.jsp
@@ -62,6 +62,9 @@ group (the left column) displays portlets with odd IDs, while the second group
     <script type="text/javascript" src="<c:out value="${pageContext.request.contextPath}"/>/pluto.js"></script>
     <script type="text/javascript" src="<c:out value="${pageContext.request.contextPath}"/>/portletHubImpl.js"></script>
     <script type="text/javascript" src="<c:out value="${pageContext.request.contextPath}"/>/portlet.js"></script>
+    
+    <!-- Now include the head section markup provided by the portlet header processing methods -->
+    ${headMarkup}
 </head>
 
 <body>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/portlet-api/src/main/java/javax/portlet/GenericPortlet.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/GenericPortlet.java b/portlet-api/src/main/java/javax/portlet/GenericPortlet.java
index 8b9b8c4..79b7ca9 100644
--- a/portlet-api/src/main/java/javax/portlet/GenericPortlet.java
+++ b/portlet-api/src/main/java/javax/portlet/GenericPortlet.java
@@ -72,7 +72,7 @@ import javax.xml.namespace.QName;
  * or class variables and external objects such as files, database connections,
  * and network connections.
  */
-public abstract class GenericPortlet implements Portlet, PortletConfig, EventPortlet, ResourceServingPortlet {
+public abstract class GenericPortlet implements Portlet, PortletConfig, EventPortlet, ResourceServingPortlet, HeaderPortlet {
 
 	private transient PortletConfig config;
 
@@ -211,6 +211,18 @@ public abstract class GenericPortlet implements Portlet, PortletConfig, EventPor
 	}
 
 	/**
+	 * V3 method implementing the headers stage within the render phase. The default
+	 * implementation does nothing.
+	 * <p>
+	 * Version 3 portlets should override this method to set HTTP headers, cookies, and
+	 * to provide markup for the overall document <code>HEAD</code> section.
+	 */
+	@Override
+   public void renderHeaders(HeaderRequest request, HeaderResponse response) throws PortletException, java.io.IOException {
+   }
+
+
+	/**
 	 * The default implementation of this method sets the headers using the
 	 * <code>doHeaders</code> method, sets the title using the
 	 * <code>getTitle</code> method and invokes the <code>doDispatch</code>


[17/38] portals-pluto git commit: Adapted Puto to use new configuration classes

Posted by ms...@apache.org.
Adapted Puto to use new configuration classes


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/54db2766
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/54db2766
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/54db2766

Branch: refs/heads/V3Prototype
Commit: 54db27666c805f810751b2e9a791f63111adc7bc
Parents: bf15b33
Author: Scott Nicklous <ms...@apache.org>
Authored: Tue Oct 27 07:35:04 2015 +0100
Committer: Scott Nicklous <ms...@apache.org>
Committed: Tue Oct 27 07:35:04 2015 +0100

----------------------------------------------------------------------
 maven-pluto-plugin/pom.xml                      |   6 +
 .../om/portlet/impl/ConfigurationProcessor.java |   4 +
 .../impl/JSR168ConfigurationProcessor.java      |   4 +-
 .../impl/JSR286ConfigurationProcessor.java      |  11 +-
 .../impl/JSR362ConfigurationProcessor.java      |   4 +-
 .../container/EventCoordinationServiceImpl.java | 671 ++++++++++---------
 .../services/container/EventProviderImpl.java   | 328 +++++----
 .../services/container/PortletWindowThread.java | 320 +++++----
 .../container/DriverPortletConfigImpl.java      |  15 +-
 .../PublicRenderParameterQNameMapper.java       |  10 -
 .../container/ResourceBundleFactoryTest.java    |  14 +-
 pluto-util/pom.xml                              |   6 +
 .../assemble/SecondWarTestPortletClass.java     |  78 +++
 .../util/assemble/WarTestPortletClass.java      |  78 +++
 .../assemble/ear/ComplexEarDeployerTest.ear     | Bin 3411 -> 3276 bytes
 .../pluto/util/assemble/ear/EarDeployerTest.ear | Bin 1711 -> 1892 bytes
 .../apache/pluto/util/assemble/file/portlet.xml |  78 +--
 .../assemble/war/WarDeployerTestPortlet.war     | Bin 1456 -> 1779 bytes
 .../war/WarDeployerTestPortletNoManifest.war    | Bin 1024 -> 1188 bytes
 pom.xml                                         |   2 +-
 20 files changed, 891 insertions(+), 738 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/54db2766/maven-pluto-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/maven-pluto-plugin/pom.xml b/maven-pluto-plugin/pom.xml
index aa19829..6fc3eed 100644
--- a/maven-pluto-plugin/pom.xml
+++ b/maven-pluto-plugin/pom.xml
@@ -38,6 +38,12 @@
       <scope>compile</scope>
     </dependency>
     <dependency>
+      <groupId>org.apache.portals.pluto</groupId>
+      <artifactId>portlet-api</artifactId>
+      <version>${project.version}</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-core</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/54db2766/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationProcessor.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationProcessor.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationProcessor.java
index 455f9e9..bfd6c6e 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationProcessor.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationProcessor.java
@@ -116,6 +116,10 @@ public abstract class ConfigurationProcessor {
             txt.append(assignable.getCanonicalName());
             throw new Exception();
          }
+      } catch (ClassNotFoundException e) {
+         LOG.warn(txt.toString() + e.getLocalizedMessage());
+         // can't throw exception if class not found, since the portlet
+         // application definition is used by the assembly mojo
       } catch (Exception e) {
          LOG.warn(txt.toString());
          throw new IllegalArgumentException(txt.toString(), e);

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/54db2766/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR168ConfigurationProcessor.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR168ConfigurationProcessor.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR168ConfigurationProcessor.java
index e0a6468..89304a9 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR168ConfigurationProcessor.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR168ConfigurationProcessor.java
@@ -442,9 +442,9 @@ public class JSR168ConfigurationProcessor extends ConfigurationProcessor {
          String warning;
          String pn = portlet.getPortletName().getValue();
          if (!isValidIdentifier(pn)) {
-            warning = "Bad portlet name: " + pn;
+            warning = "Portlet name not valid Java identifier: " + pn;
             LOG.warn(warning);
-            throw new IllegalArgumentException(warning);
+            // throw new IllegalArgumentException(warning);
          }
          
          String clsName = portlet.getPortletClass();

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/54db2766/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR286ConfigurationProcessor.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR286ConfigurationProcessor.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR286ConfigurationProcessor.java
index 2e9e940..0f32ad0 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR286ConfigurationProcessor.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR286ConfigurationProcessor.java
@@ -560,7 +560,7 @@ public class JSR286ConfigurationProcessor extends ConfigurationProcessor {
 
          // validate data
          if ((item.getName() == null) || (item.getName().getValue() == null)) {
-            String warning = "Bad portlet preference. Ppreference name was null.";
+            String warning = "Bad portlet preference. Preference name was null.";
             LOG.warn(warning);
             throw new IllegalArgumentException(warning);
          }
@@ -572,7 +572,10 @@ public class JSR286ConfigurationProcessor extends ConfigurationProcessor {
          for (ValueType vt : vals) {
             lines.add(vt.getValue());
          }
-         boolean isRO = (item.getReadOnly().value().equalsIgnoreCase("true"));
+         boolean isRO = false;      // default if not specified
+         if (item.getReadOnly() != null && item.getReadOnly().value() != null) {
+            isRO = (item.getReadOnly().value().equalsIgnoreCase("true"));
+         }
 
          Preference pref = new PreferenceImpl(name, isRO, lines);
          list.add(pref);
@@ -770,9 +773,9 @@ public class JSR286ConfigurationProcessor extends ConfigurationProcessor {
          String warning;
          String pn = portlet.getPortletName().getValue();
          if (!isValidIdentifier(pn)) {
-            warning = "Bad portlet name: " + pn;
+            warning = "Portlet name not valid Java identifier: " + pn;
             LOG.warn(warning);
-            throw new IllegalArgumentException(warning);
+            //throw new IllegalArgumentException(warning);
          }
 
          String clsName = portlet.getPortletClass();

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/54db2766/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR362ConfigurationProcessor.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR362ConfigurationProcessor.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR362ConfigurationProcessor.java
index d23afc2..e20898d 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR362ConfigurationProcessor.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR362ConfigurationProcessor.java
@@ -770,9 +770,9 @@ public class JSR362ConfigurationProcessor extends ConfigurationProcessor {
          String warning;
          String pn = portlet.getPortletName().getValue();
          if (!isValidIdentifier(pn)) {
-            warning = "Bad portlet name: " + pn;
+            warning = "Portlet name not valid Java identifier: " + pn;
             LOG.warn(warning);
-            throw new IllegalArgumentException(warning);
+            // throw new IllegalArgumentException(warning);
          }
 
          String clsName = portlet.getPortletClass();

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/54db2766/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventCoordinationServiceImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventCoordinationServiceImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventCoordinationServiceImpl.java
index f34dcd9..3048273 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventCoordinationServiceImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventCoordinationServiceImpl.java
@@ -57,341 +57,362 @@ import java.io.Serializable;
 import java.io.StringReader;
 import java.util.*;
 
-public class EventCoordinationServiceImpl implements EventCoordinationService
-{
-	/** Logger. */
-	private static final Logger LOG = LoggerFactory.getLogger(EventCoordinationServiceImpl.class);
-
-	private static final long WAITING_CYCLE = 100;
-
-	/** PortletRegistryService used to obtain PortletApplicationConfig objects */
-	private final PortletRegistryService portletRegistry;
-
-	/** PortletContextService used to obtain PortletContext objects */
-    private final PortletContextService portletContextService;
-
-    public EventCoordinationServiceImpl(PortletRegistryService portletRegistry, PortletContextService portletContextService) {
-        this.portletRegistry = portletRegistry;
-        this.portletContextService = portletContextService;
-    }
-
-    public void processEvents(PortletContainer container, PortletWindow portletWindow, HttpServletRequest request,
-                              HttpServletResponse response, List<Event> events)
-    {
-        ServletContext containerServletContext = PortalRequestContext.getContext(request).getServletContext();
-        DriverConfiguration driverConfig = (DriverConfiguration) containerServletContext
-                .getAttribute(AttributeKeys.DRIVER_CONFIG);
-
-        // PortalURL portalURL = PortalURLParserImpl.getParser().parse(request);
-        PortalURL portalURL = PortalRequestContext.getContext(request).createPortalURL();
-
-//      Map<String, PortletWindowThread> portletWindowThreads = new HashMap<String, PortletWindowThread>();
-
-//      ThreadGroup threadGroup = new ThreadGroup("FireEventThreads");
-
-        for (Event event : events)
-        {
-            List<String> portletNames = getAllPortletsRegisteredForEvent(
-                    event, driverConfig, containerServletContext);
-
-            // Deliver events to all portlets in the portal
-            // Collection<PortletWindowConfig> portlets = getAllPortlets(driverConfig);
-            
-            // Limit event delivery to portlets that are on the current page
-            Collection<PortletWindowConfig> portlets = new ArrayList<PortletWindowConfig>();
-            for (String pid : portalURL.getPortletIds()) {
-               portlets.add(PortletWindowConfig.fromId(pid));
+public class EventCoordinationServiceImpl implements EventCoordinationService {
+   /** Logger. */
+   private static final Logger          LOG           = LoggerFactory
+                                                            .getLogger(EventCoordinationServiceImpl.class);
+
+   private static final long            WAITING_CYCLE = 100;
+
+   /** PortletRegistryService used to obtain PortletApplicationConfig objects */
+   private final PortletRegistryService portletRegistry;
+
+   /** PortletContextService used to obtain PortletContext objects */
+   private final PortletContextService  portletContextService;
+
+   public EventCoordinationServiceImpl(PortletRegistryService portletRegistry,
+         PortletContextService portletContextService) {
+      this.portletRegistry = portletRegistry;
+      this.portletContextService = portletContextService;
+   }
+
+   public void processEvents(PortletContainer container,
+         PortletWindow portletWindow, HttpServletRequest request,
+         HttpServletResponse response, List<Event> events) {
+      ServletContext containerServletContext = PortalRequestContext.getContext(
+            request).getServletContext();
+      DriverConfiguration driverConfig = (DriverConfiguration) containerServletContext
+            .getAttribute(AttributeKeys.DRIVER_CONFIG);
+
+      // PortalURL portalURL = PortalURLParserImpl.getParser().parse(request);
+      PortalURL portalURL = PortalRequestContext.getContext(request)
+            .createPortalURL();
+
+      // Map<String, PortletWindowThread> portletWindowThreads = new
+      // HashMap<String, PortletWindowThread>();
+
+      // ThreadGroup threadGroup = new ThreadGroup("FireEventThreads");
+
+      for (Event event : events) {
+         List<String> portletNames = getAllPortletsRegisteredForEvent(event,
+               driverConfig, containerServletContext);
+
+         // Deliver events to all portlets in the portal
+         // Collection<PortletWindowConfig> portlets =
+         // getAllPortlets(driverConfig);
+
+         // Limit event delivery to portlets that are on the current page
+         Collection<PortletWindowConfig> portlets = new ArrayList<PortletWindowConfig>();
+         for (String pid : portalURL.getPortletIds()) {
+            portlets.add(PortletWindowConfig.fromId(pid));
+         }
+
+         // iterate all portlets in the portal
+         for (PortletWindowConfig config : portlets) {
+            PortletWindow window = new PortletWindowImpl(container, config,
+                  portalURL);
+            if (portletNames != null) {
+               for (String portlet : portletNames) {
+                  if (portlet.equals(config.getId())) {
+                     /*
+                      * PLUTO-569: multi-threaded (event) request processing
+                      * isn't thread save with the Pluto Portal Driver handling
+                      * of request attributes as they all are stored/managed
+                      * within the single underlying HttpServletRequest.
+                      * Providing proper thread save parallel request processing
+                      * would require extensive enhancements to the Pluto Portal
+                      * Driver and as such is out-of-scope for the purpose of
+                      * the Portal Driver itself.
+                      * 
+                      * // the thread now is a new one, with possible //
+                      * waiting, // for the old to exit
+                      * 
+                      * 
+                      * PortletWindowThread portletWindowThread =
+                      * getPortletWindowThread(portletWindowThreads,
+                      * threadGroup, container, config, window, request,
+                      * response, containerServletContext);
+                      * 
+                      * // is this event portletWindowThread.addEvent(event);
+                      * 
+                      * portletWindowThread.start();
+                      * 
+                      * } } } } waitForEventExecution(threadGroup); try {
+                      * Thread.sleep(WAITING_CYCLE); } catch
+                      * (InterruptedException e) { LOG.warn(e.getMessage(),e); }
+                      * } waitForEventExecution(threadGroup);
+                      */
+                     doEvent(container, window, event, request, response);
+                  }
+               }
             }
+         }
+      }
+   }
 
-            // iterate all portlets in the portal
-            for (PortletWindowConfig config : portlets) {
-                PortletWindow window = new PortletWindowImpl(container, config, portalURL);
-                if (portletNames != null) {
-                    for (String portlet : portletNames) {
-                        if (portlet.equals(config.getId())) {
-/* PLUTO-569: multi-threaded (event) request processing isn't thread save with the Pluto Portal Driver handling of request attributes
-   as they all are stored/managed within the single underlying HttpServletRequest.
-   Providing proper thread save parallel request processing would require extensive enhancements to the Pluto Portal Driver and as
-   such is out-of-scope for the purpose of the Portal Driver itself.
-
-                            // the thread now is a new one, with possible
-                            // waiting,
-                            // for the old to exit
-                            
-
-                            PortletWindowThread portletWindowThread = getPortletWindowThread(portletWindowThreads,
-                                    threadGroup, container, config, window, request, response, containerServletContext);
-
-                            // is this event
-                            portletWindowThread.addEvent(event);
-
-                            portletWindowThread.start();
-                            
-                        }
-                    }
-                }
+   protected void doEvent(PortletContainer container,
+         PortletWindow portletWindow, Event event, HttpServletRequest request,
+         HttpServletResponse response) {
+      try {
+         Object value = event.getValue();
+
+         XMLStreamReader xml = null;
+         try {
+            if (value instanceof String) {
+               String in = (String) value;
+               xml = XMLInputFactory.newInstance().createXMLStreamReader(
+                     new StringReader(in));
             }
-            waitForEventExecution(threadGroup);
+         } catch (XMLStreamException e1) {
+            throw new IllegalStateException(e1);
+         } catch (FactoryConfigurationError e1) {
+            throw new IllegalStateException(e1);
+         }
+
+         if (xml != null) {
+            // XMLStreamReader xml = (XMLStreamReader) event.getValue();
+
+            // provider.getEventDefinition(event.getQName());
             try {
-                Thread.sleep(WAITING_CYCLE);
-            } catch (InterruptedException e) {
-                LOG.warn(e.getMessage(),e);
+               // now test if object is jaxb
+               EventDefinition eventDefinitionDD = getEventDefintion(
+                     portletWindow, event.getQName());
+
+               ClassLoader loader = portletContextService
+                     .getClassLoader(portletWindow.getPortletDefinition()
+                           .getApplication().getName());
+               Class<? extends Serializable> clazz = loader.loadClass(
+                     eventDefinitionDD.getValueType()).asSubclass(
+                     Serializable.class);
+
+               JAXBContext jc = JAXBContext.newInstance(clazz);
+               Unmarshaller unmarshaller = jc.createUnmarshaller();
+
+               // unmarshaller.setEventHandler(new
+               // javax.xml.bind.helpers.DefaultValidationEventHandler());
+
+               JAXBElement result = unmarshaller.unmarshal(xml, clazz);
+
+               event = new EventImpl(event.getQName(),
+                     (Serializable) result.getValue());
+            } catch (JAXBException e) {
+               throw new IllegalStateException(e);
+            } catch (ClassCastException e) {
+               throw new IllegalStateException(e);
+            } catch (ClassNotFoundException e) {
+               throw new IllegalStateException(e);
+            } catch (PortletContainerException e) {
+               throw new IllegalStateException(e);
             }
-        }
-        waitForEventExecution(threadGroup);
-*/                          
-                            doEvent(container, window, event, request, response);
+         }
+         container.doEvent(portletWindow, request, response, event);
+      } catch (PortletException e) {
+         LOG.warn(e.getMessage(), e);
+      } catch (IOException e) {
+         LOG.warn(e.getMessage(), e);
+      } catch (PortletContainerException e) {
+         LOG.warn(e.getMessage(), e);
+      }
+   }
+
+   private EventDefinition getEventDefintion(PortletWindow portletWindow, QName name) {
+      PortletApplicationDefinition appDD = portletWindow.getPortletDefinition().getApplication();
+      
+      for (EventDefinition def : appDD.getEventDefinitions()) {
+         if (def.getQName().equals(name)) {
+            return def;
+         }
+      }
+      
+      throw new IllegalStateException();
+   }
+
+   private List<String> getAllPortletsRegisteredForEvent(Event event,
+         DriverConfiguration driverConfig,
+         ServletContext containerServletContext) {
+      Set<String> resultSet = new HashSet<String>();
+      List<String> resultList = new ArrayList<String>();
+      QName eventName = event.getQName();
+      Collection<PortletWindowConfig> portlets = getAllPortlets(driverConfig);
+
+      for (PortletWindowConfig portlet : portlets) {
+         String contextPath = portlet.getContextPath();
+         String applicationName = contextPath;
+         PortletApplicationDefinition portletAppDD = null;
+         try {
+            portletAppDD = portletRegistry
+                  .getPortletApplication(applicationName);
+            List<? extends PortletDefinition> portletDDs = portletAppDD
+                  .getPortlets();
+            List<QName> aliases = getAllAliases(eventName, portletAppDD);
+            for (PortletDefinition portletDD : portletDDs) {
+               List<? extends EventDefinitionReference> processingEvents = portletDD
+                     .getSupportedProcessingEvents();
+               if (isEventSupported(processingEvents, eventName,
+                     portletAppDD.getDefaultNamespace())) {
+                  if (portletDD.getPortletName().equals(
+                        portlet.getPortletName())) {
+                     resultSet.add(portlet.getId());
+                  }
+               } else {
+
+                  if (processingEvents != null) {
+                     for (EventDefinitionReference ref : processingEvents) {
+                        QName name = ref.getQualifiedName();
+                        if (name == null) {
+                           continue;
                         }
-                    }
-                }
-            }
-        }
-    }
-    
-    protected void doEvent(PortletContainer container, PortletWindow portletWindow, Event event, 
-                               HttpServletRequest request, HttpServletResponse response ) {
-        try {
-            Object value = event.getValue();
-            
-            XMLStreamReader xml = null;
-            try {
-                if (value instanceof String) {
-                    String in = (String) value; 
-                    xml = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(in));
-                }           
-            }  
-            catch (XMLStreamException e1) {
-                throw new IllegalStateException(e1);
-            } catch (FactoryConfigurationError e1) {
-                throw new IllegalStateException(e1);
-            }
-            
-            if (xml != null) {
-                //XMLStreamReader xml = (XMLStreamReader) event.getValue();
-                
-                    //provider.getEventDefinition(event.getQName());
-                try {
-                    // now test if object is jaxb
-                    EventDefinition eventDefinitionDD = getEventDefintion(portletWindow, event.getQName()); 
-                    
-                    ClassLoader loader = portletContextService.getClassLoader(portletWindow.getPortletDefinition().getApplication().getName());
-                    Class<? extends Serializable> clazz = loader.loadClass(eventDefinitionDD.getValueType()).asSubclass(Serializable.class);
-
-                    JAXBContext jc = JAXBContext.newInstance(clazz);
-                    Unmarshaller unmarshaller  = jc.createUnmarshaller();
-
-//                  unmarshaller.setEventHandler(new javax.xml.bind.helpers.DefaultValidationEventHandler());
-
-                    JAXBElement result = unmarshaller.unmarshal(xml,clazz);
-
-                    event =  new EventImpl(event.getQName(),(Serializable) result.getValue());
-                } catch (JAXBException e) {
-                    throw new IllegalStateException(e);
-                } catch (ClassCastException e) {
-                    throw new IllegalStateException(e);
-                } catch (ClassNotFoundException e) {
-                    throw new IllegalStateException(e);
-                } catch (PortletContainerException e) {
-                    throw new IllegalStateException(e);
-                }
-            }                   
-            container.doEvent(portletWindow, request, response, event); 
-        } catch (PortletException e) {
-            LOG.warn(e.getMessage(),e);
-        } catch (IOException e) {
-            LOG.warn(e.getMessage(),e);
-        } catch (PortletContainerException e) {
-            LOG.warn(e.getMessage(),e);
-        }   
-    }
-
-    private EventDefinition getEventDefintion(PortletWindow portletWindow, QName name) {
-        PortletApplicationDefinition appDD = portletWindow.getPortletDefinition().getApplication();
-        for (EventDefinition def : appDD.getEventDefinitions()){
-            if (def.getQName() != null){
-                if (def.getQName().equals(name))
-                    return def;
+                        // add also grouped portlets, that ends with "."
+                        if (name.toString().endsWith(".")
+                              && eventName.toString().startsWith(
+                                    name.toString())
+                              && portletDD.getPortletName().equals(
+                                    portlet.getPortletName())) {
+                           resultSet.add(portlet.getId());
+                        }
+                        // also look for alias names:
+                        if (aliases != null) {
+                           for (QName alias : aliases) {
+                              if (alias.toString().equals(name.toString())
+                                    && portletDD.getPortletName().equals(
+                                          portlet.getPortletName())) {
+                                 resultSet.add(portlet.getId());
+                              }
+                           }
+                        }
+                        // also look for default namespaced events
+                        if (name.getNamespaceURI() == null
+                              || name.getNamespaceURI().equals("")) {
+                           String defaultNamespace = portletAppDD
+                                 .getDefaultNamespace();
+                           QName qname = new QName(defaultNamespace,
+                                 name.getLocalPart());
+                           if (eventName.toString().equals(qname.toString())
+                                 && portletDD.getPortletName().equals(
+                                       portlet.getPortletName())) {
+                              resultSet.add(portlet.getId());
+                           }
+                        }
+                     }
+                  }
+               }
             }
-            else{
-                QName tmp = new QName(appDD.getDefaultNamespace(),def.getName());
-                if (tmp.equals(name))
-                    return def;
+         } catch (PortletContainerException e) {
+            LOG.warn(e.getMessage(), e);
+         }
+      }
+
+      // make list
+      for (String name : resultSet) {
+         resultList.add(name);
+      }
+      return resultList;
+   }
+
+   private boolean isEventSupported(
+         List<? extends EventDefinitionReference> supportedEvents,
+         QName eventName, String defaultNamespace) {
+      if (supportedEvents != null) {
+         for (EventDefinitionReference ref : supportedEvents) {
+            QName refQName = ref.getQualifiedName();
+            if (refQName != null && refQName.equals(eventName)) {
+               return true;
             }
-        }
-        throw new IllegalStateException();
-    }
-    
-	private List<String> getAllPortletsRegisteredForEvent(Event event,
-			DriverConfiguration driverConfig, ServletContext containerServletContext) {
-		Set<String> resultSet = new HashSet<String>();
-		List<String> resultList = new ArrayList<String>();
-		QName eventName = event.getQName();
-		Collection<PortletWindowConfig> portlets = getAllPortlets(driverConfig);
-
-		for (PortletWindowConfig portlet : portlets) {
-			String contextPath = portlet.getContextPath();
-            String applicationName = contextPath;
-			PortletApplicationDefinition portletAppDD = null;
-			try {
-				portletAppDD = portletRegistry.getPortletApplication(applicationName);
-				List<? extends PortletDefinition> portletDDs = portletAppDD.getPortlets();
-				List<QName> aliases = getAllAliases(eventName, portletAppDD);
-				for (PortletDefinition portletDD : portletDDs) {
-					List<? extends EventDefinitionReference> processingEvents = portletDD.getSupportedProcessingEvents();
-					if (isEventSupported(processingEvents, eventName, portletAppDD.getDefaultNamespace())) {
-                        if (portletDD.getPortletName().equals(portlet.getPortletName())) {
-                                                          resultSet.add(portlet.getId());
-                        }
-					} else {
-
-						if (processingEvents != null) {
-							for (EventDefinitionReference ref : processingEvents) {
-							    QName name = ref.getQualifiedName(portletAppDD.getDefaultNamespace());
-							    if (name == null)
-							    {
-							        continue;
-							    }
-								// add also grouped portlets, that ends with "."
-								if (name.toString().endsWith(".")
-										&& eventName.toString().startsWith(name.toString())
-										&& portletDD.getPortletName().equals(portlet.getPortletName())) {
-									resultSet.add(portlet.getId());
-								}
-								// also look for alias names:
-								if (aliases != null) {
-									for (QName alias : aliases) {
-										if (alias.toString().equals(name.toString())
-												&& portletDD.getPortletName().equals(portlet.getPortletName())) {
-											resultSet.add(portlet.getId());
-										}
-									}
-								}
-								// also look for default namespaced events
-								if (name.getNamespaceURI() == null || name.getNamespaceURI().equals("")) {
-									String defaultNamespace = portletAppDD.getDefaultNamespace();
-									QName qname = new QName(defaultNamespace, name.getLocalPart());
-									if (eventName.toString().equals(qname.toString())
-											&& portletDD.getPortletName().equals(portlet.getPortletName())) {
-										resultSet.add(portlet.getId());
-									}
-								}
-							}
-						}
-					}
-				}
-			} catch (PortletContainerException e) {
-				LOG.warn(e.getMessage(),e);
-			}
-		}
-
-		// make list
-		for (String name : resultSet) {
-			resultList.add(name);
-		}
-		return resultList;
-	}
-	
-	private boolean isEventSupported(List<? extends EventDefinitionReference> supportedEvents, QName eventName, String defaultNamespace)
-	{
-	    if (supportedEvents != null)
-	    {
-	        for (EventDefinitionReference ref : supportedEvents)
-	        {
-	            QName refQName = ref.getQualifiedName(defaultNamespace);
-	            if (refQName != null && refQName.equals(eventName))
-	            {
-	                return true;
-	            }
-	        }
-	    }
-	    return false;
-	}
-
-	private List<QName> getAllAliases(QName eventName, PortletApplicationDefinition portletAppDD) {
-		if (portletAppDD.getEventDefinitions() != null) {
-			
-			for (EventDefinition def : portletAppDD.getEventDefinitions()){
-			    QName defQName = def.getQualifiedName(portletAppDD.getDefaultNamespace());
-				if (defQName != null && defQName.equals(eventName)){
-						return def.getAliases();
-				}
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * gets the right PortletWindowThread or makes a new one, if theres none
-	 * 
-	 */
-	private PortletWindowThread getPortletWindowThread(Map<String, PortletWindowThread> portletWindowThreads, ThreadGroup threadGroup,
-			PortletContainer container, PortletWindowConfig config,
-			PortletWindow window, HttpServletRequest req, HttpServletResponse res, ServletContext containerServletContext)
-	{
-        String windowID = window.getId().getStringId();
-        PortletWindowThread portletWindowThread = portletWindowThreads
-                .get(windowID);
-        if (portletWindowThread == null) {
-            portletWindowThread = new PortletWindowThread(threadGroup, config.getId(),
-                                                          container, window, 
-                                                          req, res, portletContextService);
-            portletWindowThreads.put(windowID, portletWindowThread);
-        } else {
-            // a thread could be started twice, so we make a new one,
-            // after the old thread stopped
-            // try {
-            try {
-                portletWindowThread.join();
-            } catch (InterruptedException e) {
-                LOG.warn(e.getMessage(),e);
+         }
+      }
+      return false;
+   }
+
+   private List<QName> getAllAliases(QName eventName,
+         PortletApplicationDefinition portletAppDD) {
+      if (portletAppDD.getEventDefinitions() != null) {
+
+         for (EventDefinition def : portletAppDD.getEventDefinitions()) {
+            QName defQName = def.getQName();
+            if (defQName != null && defQName.equals(eventName)) {
+               return def.getAliases();
             }
-            portletWindowThreads.remove(portletWindowThread);
-            portletWindowThread = new PortletWindowThread(threadGroup, config.getId(),
-                                                          container, window, 
-                                                          req, res, portletContextService);
-            portletWindowThreads.put(windowID, portletWindowThread);
-        }
-        return portletWindowThread;
-	}
-
-	/**
-	 * Wait for event execution.
-	 */
-	private void waitForEventExecution(ThreadGroup threadGroup) {
-		long counter = 0;
-		while (threadGroup.activeCount() > 0) {
-			try {
-				counter = +WAITING_CYCLE;
-				if (counter > 500) {
-					threadGroup.stop();
-				}
-				Thread.sleep(WAITING_CYCLE);
-			} catch (InterruptedException e) {
-				LOG.warn(e.getMessage(),e);
-			}
-		}
-	}
-
-	/**
+         }
+      }
+      return null;
+   }
+
+   
+   /**
+    * gets the right PortletWindowThread or makes a new one, if theres none
+    * 
+    */
+//   private PortletWindowThread getPortletWindowThread(
+//         Map<String, PortletWindowThread> portletWindowThreads,
+//         ThreadGroup threadGroup, PortletContainer container,
+//         PortletWindowConfig config, PortletWindow window,
+//         HttpServletRequest req, HttpServletResponse res,
+//         ServletContext containerServletContext) {
+//      String windowID = window.getId().getStringId();
+//      PortletWindowThread portletWindowThread = portletWindowThreads
+//            .get(windowID);
+//      if (portletWindowThread == null) {
+//         portletWindowThread = new PortletWindowThread(threadGroup,
+//               config.getId(), container, window, req, res,
+//               portletContextService);
+//         portletWindowThreads.put(windowID, portletWindowThread);
+//      } else {
+//         // a thread could be started twice, so we make a new one,
+//         // after the old thread stopped
+//         // try {
+//         try {
+//            portletWindowThread.join();
+//         } catch (InterruptedException e) {
+//            LOG.warn(e.getMessage(), e);
+//         }
+//         portletWindowThreads.remove(portletWindowThread);
+//         portletWindowThread = new PortletWindowThread(threadGroup,
+//               config.getId(), container, window, req, res,
+//               portletContextService);
+//         portletWindowThreads.put(windowID, portletWindowThread);
+//      }
+//      return portletWindowThread;
+//   }
+
+   /**
+    * Wait for event execution.
+    */
+//   private void waitForEventExecution(ThreadGroup threadGroup) {
+//      long counter = 0;
+//      while (threadGroup.activeCount() > 0) {
+//         try {
+//            counter = +WAITING_CYCLE;
+//            if (counter > 500) {
+//               threadGroup.stop();
+//            }
+//            Thread.sleep(WAITING_CYCLE);
+//         } catch (InterruptedException e) {
+//            LOG.warn(e.getMessage(), e);
+//         }
+//      }
+//   }
+
+   /**
 	 * 
 	 */
-	private Collection<PortletWindowConfig> getAllPortlets(DriverConfiguration driverConfig)
-	{
-		Collection<PortletWindowConfig> portlets = new ArrayList<PortletWindowConfig>();
-        Collection pages = driverConfig.getPages();
-        if (pages != null){
-            Iterator iPages = pages.iterator();
-            while(iPages.hasNext()){
-                PageConfig pageConfig = (PageConfig) iPages.next();
-                Collection portletIDs = pageConfig.getPortletIds();
-                if (portletIDs != null){
-                    Iterator iPortletIDs = portletIDs.iterator();
-                    while(iPortletIDs.hasNext()){
-                        portlets.add(PortletWindowConfig.fromId(iPortletIDs.next().toString()));
-                    }
-                }
+   private Collection<PortletWindowConfig> getAllPortlets(
+         DriverConfiguration driverConfig) {
+      Collection<PortletWindowConfig> portlets = new ArrayList<PortletWindowConfig>();
+      Collection pages = driverConfig.getPages();
+      if (pages != null) {
+         Iterator iPages = pages.iterator();
+         while (iPages.hasNext()) {
+            PageConfig pageConfig = (PageConfig) iPages.next();
+            Collection portletIDs = pageConfig.getPortletIds();
+            if (portletIDs != null) {
+               Iterator iPortletIDs = portletIDs.iterator();
+               while (iPortletIDs.hasNext()) {
+                  portlets.add(PortletWindowConfig.fromId(iPortletIDs.next()
+                        .toString()));
+               }
             }
-        }
-		return portlets;
-	}
+         }
+      }
+      return portlets;
+   }
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/54db2766/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventProviderImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventProviderImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventProviderImpl.java
index fba2134..df0ca7d 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventProviderImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventProviderImpl.java
@@ -1,172 +1,156 @@
-/*
- * 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.
- */
-package org.apache.pluto.driver.services.container;
-
-import java.io.Serializable;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.util.List;
-
-import javax.portlet.Event;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.namespace.QName;
-import javax.xml.stream.FactoryConfigurationError;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.pluto.container.EventProvider;
-import org.apache.pluto.container.PortletContainerException;
-import org.apache.pluto.container.PortletWindow;
-import org.apache.pluto.container.driver.PortletRegistryService;
-import org.apache.pluto.container.om.portlet.EventDefinition;
-import org.apache.pluto.container.om.portlet.EventDefinitionReference;
-import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
-import org.apache.pluto.driver.services.portal.PortletWindowConfig;
-
-/**
- * @version $Id$
- */
-public class EventProviderImpl implements EventProvider
-{
-    /** Logger. */
-    private static final Logger LOG = LoggerFactory.getLogger(EventProviderImpl.class);
-    private PortletWindow portletWindow;
-    private PortletRegistryService portletRegistry;
-    
-    public EventProviderImpl(PortletWindow portletWindow, PortletRegistryService portletRegistry)
-    {
-        this.portletWindow = portletWindow;
-        this.portletRegistry = portletRegistry;
-    }
-
-    @SuppressWarnings("unchecked")
-    public Event createEvent(QName qname, Serializable value) throws IllegalArgumentException
-    {
-        if (isDeclaredAsPublishingEvent(qname))
-        {
-            if (value != null && !isValueInstanceOfDefinedClass(qname, value))
-            {
-                throw new IllegalArgumentException("Payload class (" +
-                                                   value.getClass().getCanonicalName() +
-                                                   ") does not have the right class, check your defined event types in portlet.xml.");
-            }
-            try
-            {
-                if (value == null)
-                {
-                    return new EventImpl(qname, value);
-                }
-                else
-                {
-                    ClassLoader cl = Thread.currentThread().getContextClassLoader();
-                    Writer out = new StringWriter();
-                    Class clazz = value.getClass();
-                    try
-                    {
-                        Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
-                        JAXBContext jc = JAXBContext.newInstance(clazz);
-                        Marshaller marshaller = jc.createMarshaller();
-                        JAXBElement<Serializable> element = new JAXBElement<Serializable>(qname, clazz, value);
-                        marshaller.marshal(element, out);
-                    }
-                    finally
-                    {
-                        Thread.currentThread().setContextClassLoader(cl);
-                    }
-                    return new EventImpl(qname, out.toString());
-                }
-            }
-            catch (JAXBException e)
-            {
-                // maybe there is no valid jaxb binding
-                // TODO wsrp:eventHandlingFailed
-                LOG.error("Event handling failed", e);
-            }
-            catch (FactoryConfigurationError e)
-            {
-                LOG.warn(e.getMessage(),e);
-            }
-        }
-        return null;
-    }
-
-    private boolean isDeclaredAsPublishingEvent(QName qname)
-    {
-        String applicationId = PortletWindowConfig.parseContextPath(portletWindow.getId().getStringId());
-        String applicationName = applicationId;
-        String portletName = PortletWindowConfig.parsePortletName(portletWindow.getId().getStringId());
-        List<? extends EventDefinitionReference> events = null;
-        try
-        {
-            events = portletRegistry.getPortlet(applicationName, portletName).getSupportedPublishingEvents();
-        }
-        catch (PortletContainerException e1)
-        {
-            e1.printStackTrace();
-        }
-        if (events != null)
-        {
-            String defaultNamespace = portletWindow.getPortletDefinition().getApplication()
-                                                   .getDefaultNamespace();
-            for (EventDefinitionReference ref : events)
-            {
-                QName name = ref.getQualifiedName(defaultNamespace);
-                if (name == null)
-                {
-                    continue;
-                }
-                if (qname.equals(name))
-                {
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-
-    private boolean isValueInstanceOfDefinedClass(QName qname, Serializable value)
-    {
-        PortletApplicationDefinition app = portletWindow.getPortletDefinition().getApplication();
-        List<? extends EventDefinition> events = app.getEventDefinitions();
-        if (events != null)
-        {
-            for (EventDefinition def : events)
-            {
-                if (def.getQName() != null)
-                {
-                    if (def.getQName().equals(qname))
-                    {
-                        return value.getClass().getName().equals(def.getValueType());
-                    }
-                }
-                else
-                {
-                    QName tmp = new QName(app.getDefaultNamespace(), def.getName());
-                    if (tmp.equals(qname))
-                    {
-                        return value.getClass().getName().equals(def.getValueType());
-                    }
-                }
-            }
-        }
-        // event not declared
-        return true;
-    }
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.driver.services.container;
+
+import java.io.Serializable;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.List;
+
+import javax.portlet.Event;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.namespace.QName;
+import javax.xml.stream.FactoryConfigurationError;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.pluto.container.EventProvider;
+import org.apache.pluto.container.PortletContainerException;
+import org.apache.pluto.container.PortletWindow;
+import org.apache.pluto.container.driver.PortletRegistryService;
+import org.apache.pluto.container.om.portlet.EventDefinition;
+import org.apache.pluto.container.om.portlet.EventDefinitionReference;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.driver.services.portal.PortletWindowConfig;
+
+/**
+ * @version $Id$
+ */
+public class EventProviderImpl implements EventProvider
+{
+    /** Logger. */
+    private static final Logger LOG = LoggerFactory.getLogger(EventProviderImpl.class);
+    private PortletWindow portletWindow;
+    private PortletRegistryService portletRegistry;
+    
+    public EventProviderImpl(PortletWindow portletWindow, PortletRegistryService portletRegistry)
+    {
+        this.portletWindow = portletWindow;
+        this.portletRegistry = portletRegistry;
+    }
+
+    @SuppressWarnings("unchecked")
+    public Event createEvent(QName qname, Serializable value) throws IllegalArgumentException
+    {
+        if (isDeclaredAsPublishingEvent(qname))
+        {
+            if (value != null && !isValueInstanceOfDefinedClass(qname, value))
+            {
+                throw new IllegalArgumentException("Payload class (" +
+                                                   value.getClass().getCanonicalName() +
+                                                   ") does not have the right class, check your defined event types in portlet.xml.");
+            }
+            try
+            {
+                if (value == null)
+                {
+                    return new EventImpl(qname, value);
+                }
+                else
+                {
+                    ClassLoader cl = Thread.currentThread().getContextClassLoader();
+                    Writer out = new StringWriter();
+                    Class clazz = value.getClass();
+                    try
+                    {
+                        Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
+                        JAXBContext jc = JAXBContext.newInstance(clazz);
+                        Marshaller marshaller = jc.createMarshaller();
+                        JAXBElement<Serializable> element = new JAXBElement<Serializable>(qname, clazz, value);
+                        marshaller.marshal(element, out);
+                    }
+                    finally
+                    {
+                        Thread.currentThread().setContextClassLoader(cl);
+                    }
+                    return new EventImpl(qname, out.toString());
+                }
+            }
+            catch (JAXBException e)
+            {
+                // maybe there is no valid jaxb binding
+                // TODO wsrp:eventHandlingFailed
+                LOG.error("Event handling failed", e);
+            }
+            catch (FactoryConfigurationError e)
+            {
+                LOG.warn(e.getMessage(),e);
+            }
+        }
+        return null;
+    }
+
+    private boolean isDeclaredAsPublishingEvent(QName qname)
+    {
+        String applicationId = PortletWindowConfig.parseContextPath(portletWindow.getId().getStringId());
+        String applicationName = applicationId;
+        String portletName = PortletWindowConfig.parsePortletName(portletWindow.getId().getStringId());
+        List<? extends EventDefinitionReference> events = null;
+        try
+        {
+            events = portletRegistry.getPortlet(applicationName, portletName).getSupportedPublishingEvents();
+        }
+        catch (PortletContainerException e1)
+        {
+            e1.printStackTrace();
+        }
+        if (events != null)
+        {
+            for (EventDefinitionReference ref : events)
+            {
+                QName name = ref.getQualifiedName();
+                if (name == null)
+                {
+                    continue;
+                }
+                if (qname.equals(name))
+                {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+   private boolean isValueInstanceOfDefinedClass(QName qname, Serializable value) {
+      PortletApplicationDefinition app = portletWindow.getPortletDefinition().getApplication();
+      
+      List<? extends EventDefinition> events = app.getEventDefinitions();
+      if (events != null) {
+         for (EventDefinition def : events) {
+            if (def.getQName().equals(qname)) {
+               return value.getClass().getName().equals(def.getValueType());
+            }
+         }
+      }
+        // event not declared
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/54db2766/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletWindowThread.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletWindowThread.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletWindowThread.java
index d5a491d..3d44198 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletWindowThread.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletWindowThread.java
@@ -1,163 +1,157 @@
-/*
- * 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.
- */
-package org.apache.pluto.driver.services.container;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.portlet.Event;
-import javax.portlet.PortletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.namespace.QName;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.pluto.container.PortletContainer;
-import org.apache.pluto.container.PortletContainerException;
-import org.apache.pluto.container.PortletWindow;
-import org.apache.pluto.container.driver.PortletContextService;
-import org.apache.pluto.container.om.portlet.EventDefinition;
-import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
-
-public class PortletWindowThread extends Thread {
-	
-	/** Logger. */
-    private static final Logger LOG = LoggerFactory.getLogger(PortletWindowThread.class);
-    
-    private PortletContainer container;
-    
-	private PortletWindow portletWindow;
-	
-	private HttpServletRequest request;
-    private HttpServletResponse response;
-	
-	/** PortletRegistryService used to obtain PortletApplicationConfig objects */
-	private PortletContextService portletContextService;
-	
-	private List<Event> events = new ArrayList<Event>();
-
-	public PortletWindowThread(ThreadGroup group, String name,
-	                           PortletContainer container, PortletWindow window, 
-	                           HttpServletRequest request, HttpServletResponse response, 
-	                           PortletContextService portletContextService)
-	{
-		super(group, name);
-        this.request = request;
-        this.response = response;
-		this.portletWindow = window;
-		this.container = container;
-		this.portletContextService = portletContextService;
-	}
-
-	/* (non-Javadoc)
-	 * @see java.lang.Thread#run()
-	 */
-	@Override
-	public void run() {
-		super.run();
-		while (events.size() > 0) {
-			try {
-//				synchronized (this) {
-					Event event = events.remove(0);
-			        Object value = event.getValue();
-			        
-			        XMLStreamReader xml = null;
-					try {
-						if (value instanceof String) {
-							String in = (String) value; 
-							xml = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(in));
-						}			
-					}  
-					catch (XMLStreamException e1) {
-						throw new IllegalStateException(e1);
-					} catch (FactoryConfigurationError e1) {
-						throw new IllegalStateException(e1);
-					}
-			        
-			        if (xml != null) {
-			        	//XMLStreamReader xml = (XMLStreamReader) event.getValue();
-			        	
-			        		//provider.getEventDefinition(event.getQName());
-			        	try {
-			        		// now test if object is jaxb
-			        		EventDefinition eventDefinitionDD = getEventDefintion(event.getQName()); 
-			        		
-			        		ClassLoader loader = portletContextService.getClassLoader(portletWindow.getPortletDefinition().getApplication().getName());
-			        		Class<? extends Serializable> clazz = loader.loadClass(eventDefinitionDD.getValueType()).asSubclass(Serializable.class);
-
-			        		JAXBContext jc = JAXBContext.newInstance(clazz);
-			        		Unmarshaller unmarshaller  = jc.createUnmarshaller();
-
-//			        		unmarshaller.setEventHandler(new javax.xml.bind.helpers.DefaultValidationEventHandler());
-
-			        		JAXBElement result = unmarshaller.unmarshal(xml,clazz);
-
-			        		event =  new EventImpl(event.getQName(),(Serializable) result.getValue());
-			        	} catch (JAXBException e) {
-			        		throw new IllegalStateException(e);
-			        	} catch (ClassCastException e) {
-			        		throw new IllegalStateException(e);
-			        	} catch (ClassNotFoundException e) {
-			        		throw new IllegalStateException(e);
-			        	} catch (PortletContainerException e) {
-			        		throw new IllegalStateException(e);
-						}
-			        }					
-					container.doEvent(portletWindow, request, response, event);	
-//				}
-			} catch (PortletException e) {
-				LOG.warn(e.getMessage(),e);
-			} catch (IOException e) {
-				LOG.warn(e.getMessage(),e);
-			} catch (PortletContainerException e) {
-				LOG.warn(e.getMessage(),e);
-			}	
-		}
-	}
-
-	public void addEvent(Event event) {
-		this.events.add(event);	
-	}
-
-	private EventDefinition getEventDefintion(QName name) {
-		PortletApplicationDefinition appDD = portletWindow.getPortletDefinition().getApplication();
-		for (EventDefinition def : appDD.getEventDefinitions()){
-			if (def.getQName() != null){
-				if (def.getQName().equals(name))
-					return def;
-			}
-			else{
-				QName tmp = new QName(appDD.getDefaultNamespace(),def.getName());
-				if (tmp.equals(name))
-					return def;
-			}
-		}
-		throw new IllegalStateException();
-	}
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.driver.services.container;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.portlet.Event;
+import javax.portlet.PortletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.namespace.QName;
+import javax.xml.parsers.FactoryConfigurationError;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.pluto.container.PortletContainer;
+import org.apache.pluto.container.PortletContainerException;
+import org.apache.pluto.container.PortletWindow;
+import org.apache.pluto.container.driver.PortletContextService;
+import org.apache.pluto.container.om.portlet.EventDefinition;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+
+public class PortletWindowThread extends Thread {
+	
+	/** Logger. */
+    private static final Logger LOG = LoggerFactory.getLogger(PortletWindowThread.class);
+    
+    private PortletContainer container;
+    
+	private PortletWindow portletWindow;
+	
+	private HttpServletRequest request;
+    private HttpServletResponse response;
+	
+	/** PortletRegistryService used to obtain PortletApplicationConfig objects */
+	private PortletContextService portletContextService;
+	
+	private List<Event> events = new ArrayList<Event>();
+
+	public PortletWindowThread(ThreadGroup group, String name,
+	                           PortletContainer container, PortletWindow window, 
+	                           HttpServletRequest request, HttpServletResponse response, 
+	                           PortletContextService portletContextService)
+	{
+		super(group, name);
+        this.request = request;
+        this.response = response;
+		this.portletWindow = window;
+		this.container = container;
+		this.portletContextService = portletContextService;
+	}
+
+	/* (non-Javadoc)
+	 * @see java.lang.Thread#run()
+	 */
+	@Override
+	public void run() {
+		super.run();
+		while (events.size() > 0) {
+			try {
+//				synchronized (this) {
+					Event event = events.remove(0);
+			        Object value = event.getValue();
+			        
+			        XMLStreamReader xml = null;
+					try {
+						if (value instanceof String) {
+							String in = (String) value; 
+							xml = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(in));
+						}			
+					}  
+					catch (XMLStreamException e1) {
+						throw new IllegalStateException(e1);
+					} catch (FactoryConfigurationError e1) {
+						throw new IllegalStateException(e1);
+					}
+			        
+			        if (xml != null) {
+			        	//XMLStreamReader xml = (XMLStreamReader) event.getValue();
+			        	
+			        		//provider.getEventDefinition(event.getQName());
+			        	try {
+			        		// now test if object is jaxb
+			        		EventDefinition eventDefinitionDD = getEventDefintion(event.getQName()); 
+			        		
+			        		ClassLoader loader = portletContextService.getClassLoader(portletWindow.getPortletDefinition().getApplication().getName());
+			        		Class<? extends Serializable> clazz = loader.loadClass(eventDefinitionDD.getValueType()).asSubclass(Serializable.class);
+
+			        		JAXBContext jc = JAXBContext.newInstance(clazz);
+			        		Unmarshaller unmarshaller  = jc.createUnmarshaller();
+
+//			        		unmarshaller.setEventHandler(new javax.xml.bind.helpers.DefaultValidationEventHandler());
+
+			        		JAXBElement<?> result = unmarshaller.unmarshal(xml,clazz);
+
+			        		event =  new EventImpl(event.getQName(),(Serializable) result.getValue());
+			        	} catch (JAXBException e) {
+			        		throw new IllegalStateException(e);
+			        	} catch (ClassCastException e) {
+			        		throw new IllegalStateException(e);
+			        	} catch (ClassNotFoundException e) {
+			        		throw new IllegalStateException(e);
+			        	} catch (PortletContainerException e) {
+			        		throw new IllegalStateException(e);
+						}
+			        }					
+					container.doEvent(portletWindow, request, response, event);	
+//				}
+			} catch (PortletException e) {
+				LOG.warn(e.getMessage(),e);
+			} catch (IOException e) {
+				LOG.warn(e.getMessage(),e);
+			} catch (PortletContainerException e) {
+				LOG.warn(e.getMessage(),e);
+			}	
+		}
+	}
+
+	public void addEvent(Event event) {
+		this.events.add(event);	
+	}
+
+	private EventDefinition getEventDefintion(QName name) {
+		PortletApplicationDefinition appDD = portletWindow.getPortletDefinition().getApplication();
+		for (EventDefinition def : appDD.getEventDefinitions()){
+		   if (def.getQName().equals(name)) {
+		      return def;
+		   }
+		}
+		throw new IllegalStateException();
+	}
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/54db2766/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DriverPortletConfigImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DriverPortletConfigImpl.java b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DriverPortletConfigImpl.java
index a4a624b..a9845e3 100644
--- a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DriverPortletConfigImpl.java
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DriverPortletConfigImpl.java
@@ -85,20 +85,7 @@ public class DriverPortletConfigImpl extends AbstractPortletConfigImpl implement
          PublicRenderParameter prp = prps.get(prpname);
          if (prp != null) {
             QName qn = prp.getQName();
-            if (qn == null) {
-               String name = prp.getName();
-               String ns = portlet.getApplication().getDefaultNamespace();
-               if (name != null && ns != null) {
-                  qn = new QName(ns, name);
-               } else {
-                  LOG.warn("Bad public render parameter name / namespace definition. name="
-                        + name + ", namespace=" + ns);
-               }
-            }
-            
-            if (qn != null) {
-               prpdefs.put(prpname, qn);
-            }
+            prpdefs.put(prpname, qn);
          } else {
             LOG.warn("Could not get public render parameter definition for identifier: " + prpname);
          }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/54db2766/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterQNameMapper.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterQNameMapper.java b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterQNameMapper.java
index 42fb80e..21579ae 100644
--- a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterQNameMapper.java
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterQNameMapper.java
@@ -90,7 +90,6 @@ public class PublicRenderParameterQNameMapper implements PublicRenderParameterMa
             Collection<String> prpIds = pd.getSupportedPublicRenderParameters();
             if (prpIds != null && prpIds.size() > 0) {
                Collection<? extends PublicRenderParameter> prpDefs = pad.getPublicRenderParameters();
-               String namespace = pad.getDefaultNamespace();
                for (String prpId : prpIds) {
                   Iterator<? extends PublicRenderParameter> i = prpDefs.iterator();
                   QName qn = null;
@@ -98,15 +97,6 @@ public class PublicRenderParameterQNameMapper implements PublicRenderParameterMa
                      PublicRenderParameter prpDef = i.next();
                      if (prpDef.getIdentifier().equals(prpId)) {
                         qn = prpDef.getQName();
-                        if (qn == null) {
-                           // If qname is null, build a qnamme from the name & namespace fields
-                           String name = prpDef.getName();
-                           if (name == null) {
-                              LOGGER.error("Problem with PRP definition: Both QName and Nqme are null.");
-                           } else {
-                              qn = new QName(namespace, name);
-                           }
-                        }
                      }
                   }
                   if (qn == null) {

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/54db2766/pluto-portal-driver/src/test/java/org/apache/pluto/driver/container/ResourceBundleFactoryTest.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/test/java/org/apache/pluto/driver/container/ResourceBundleFactoryTest.java b/pluto-portal-driver/src/test/java/org/apache/pluto/driver/container/ResourceBundleFactoryTest.java
index 8654d4b..98a5eaf 100644
--- a/pluto-portal-driver/src/test/java/org/apache/pluto/driver/container/ResourceBundleFactoryTest.java
+++ b/pluto-portal-driver/src/test/java/org/apache/pluto/driver/container/ResourceBundleFactoryTest.java
@@ -24,6 +24,8 @@ import junit.framework.Assert;
 
 import org.apache.pluto.container.om.portlet.PortletDefinition;
 import org.apache.pluto.container.om.portlet.PortletInfo;
+import org.apache.pluto.container.om.portlet.impl.PortletDefinitionImpl;
+import org.apache.pluto.container.om.portlet.impl.PortletInfoImpl;
 import org.apache.pluto.container.om.portlet20.impl.PortletType;
 import org.apache.pluto.driver.container.ResourceBundleFactory;
 
@@ -38,12 +40,12 @@ public class ResourceBundleFactoryTest extends PlutoTestCase {
     public void setUp() throws Exception {
         super.setUp();
 
-        validDD = new PortletType();
-
-        PortletInfo info = validDD.getPortletInfo();
-        info.setTitle("Info Title");
-        info.setShortTitle("Info Short Title");
-        info.setKeywords("Info Keywords");
+        String ti = "Info Title";
+        String sti = "Info Short Title";
+        String kw = "Info Keywords";
+        PortletInfo info = new PortletInfoImpl(ti, kw, sti);
+        validDD = new PortletDefinitionImpl("RBTestPortlet", null);
+        validDD.setPortletInfo(info);
         validDD.setResourceBundle(TestResourceBundle.class.getName());
     }
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/54db2766/pluto-util/pom.xml
----------------------------------------------------------------------
diff --git a/pluto-util/pom.xml b/pluto-util/pom.xml
index e119e4b..12b18a7 100644
--- a/pluto-util/pom.xml
+++ b/pluto-util/pom.xml
@@ -46,6 +46,12 @@
       <version>${project.version}</version>
       <scope>compile</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.portals.pluto</groupId>
+      <artifactId>portlet-api</artifactId>
+      <version>${project.version}</version>
+      <scope>provided</scope>
+    </dependency>
 
     <dependency>
       <groupId>commons-cli</groupId>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/54db2766/pluto-util/src/test/java/org/apache/pluto/util/assemble/SecondWarTestPortletClass.java
----------------------------------------------------------------------
diff --git a/pluto-util/src/test/java/org/apache/pluto/util/assemble/SecondWarTestPortletClass.java b/pluto-util/src/test/java/org/apache/pluto/util/assemble/SecondWarTestPortletClass.java
new file mode 100644
index 0000000..9f29c73
--- /dev/null
+++ b/pluto-util/src/test/java/org/apache/pluto/util/assemble/SecondWarTestPortletClass.java
@@ -0,0 +1,78 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.util.assemble;
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * Dummy portlet for test
+ * 
+ * @author Scott Nicklous
+ *
+ */
+public class SecondWarTestPortletClass implements Portlet {
+
+   /* (non-Javadoc)
+    * @see javax.portlet.Portlet#destroy()
+    */
+   @Override
+   public void destroy() {
+      // TODO Auto-generated method stub
+
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.Portlet#init(javax.portlet.PortletConfig)
+    */
+   @Override
+   public void init(PortletConfig arg0) throws PortletException {
+      // TODO Auto-generated method stub
+
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.Portlet#processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)
+    */
+   @Override
+   public void processAction(ActionRequest arg0, ActionResponse arg1)
+         throws PortletException, IOException {
+      // TODO Auto-generated method stub
+
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.Portlet#render(javax.portlet.RenderRequest, javax.portlet.RenderResponse)
+    */
+   @Override
+   public void render(RenderRequest arg0, RenderResponse arg1)
+         throws PortletException, IOException {
+      // TODO Auto-generated method stub
+
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/54db2766/pluto-util/src/test/java/org/apache/pluto/util/assemble/WarTestPortletClass.java
----------------------------------------------------------------------
diff --git a/pluto-util/src/test/java/org/apache/pluto/util/assemble/WarTestPortletClass.java b/pluto-util/src/test/java/org/apache/pluto/util/assemble/WarTestPortletClass.java
new file mode 100644
index 0000000..07d44ab
--- /dev/null
+++ b/pluto-util/src/test/java/org/apache/pluto/util/assemble/WarTestPortletClass.java
@@ -0,0 +1,78 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.util.assemble;
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * Dummy portlet for test
+ * 
+ * @author Scott Nicklous
+ *
+ */
+public class WarTestPortletClass implements Portlet {
+
+   /* (non-Javadoc)
+    * @see javax.portlet.Portlet#destroy()
+    */
+   @Override
+   public void destroy() {
+      // TODO Auto-generated method stub
+
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.Portlet#init(javax.portlet.PortletConfig)
+    */
+   @Override
+   public void init(PortletConfig arg0) throws PortletException {
+      // TODO Auto-generated method stub
+
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.Portlet#processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)
+    */
+   @Override
+   public void processAction(ActionRequest arg0, ActionResponse arg1)
+         throws PortletException, IOException {
+      // TODO Auto-generated method stub
+
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.Portlet#render(javax.portlet.RenderRequest, javax.portlet.RenderResponse)
+    */
+   @Override
+   public void render(RenderRequest arg0, RenderResponse arg1)
+         throws PortletException, IOException {
+      // TODO Auto-generated method stub
+
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/54db2766/pluto-util/src/test/resources/org/apache/pluto/util/assemble/ear/ComplexEarDeployerTest.ear
----------------------------------------------------------------------
diff --git a/pluto-util/src/test/resources/org/apache/pluto/util/assemble/ear/ComplexEarDeployerTest.ear b/pluto-util/src/test/resources/org/apache/pluto/util/assemble/ear/ComplexEarDeployerTest.ear
index 41a0520..00b5d7c 100644
Binary files a/pluto-util/src/test/resources/org/apache/pluto/util/assemble/ear/ComplexEarDeployerTest.ear and b/pluto-util/src/test/resources/org/apache/pluto/util/assemble/ear/ComplexEarDeployerTest.ear differ

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/54db2766/pluto-util/src/test/resources/org/apache/pluto/util/assemble/ear/EarDeployerTest.ear
----------------------------------------------------------------------
diff --git a/pluto-util/src/test/resources/org/apache/pluto/util/assemble/ear/EarDeployerTest.ear b/pluto-util/src/test/resources/org/apache/pluto/util/assemble/ear/EarDeployerTest.ear
index c6bfdc5..a8064f3 100644
Binary files a/pluto-util/src/test/resources/org/apache/pluto/util/assemble/ear/EarDeployerTest.ear and b/pluto-util/src/test/resources/org/apache/pluto/util/assemble/ear/EarDeployerTest.ear differ

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/54db2766/pluto-util/src/test/resources/org/apache/pluto/util/assemble/file/portlet.xml
----------------------------------------------------------------------
diff --git a/pluto-util/src/test/resources/org/apache/pluto/util/assemble/file/portlet.xml b/pluto-util/src/test/resources/org/apache/pluto/util/assemble/file/portlet.xml
index 1a6680d..b25c91c 100644
--- a/pluto-util/src/test/resources/org/apache/pluto/util/assemble/file/portlet.xml
+++ b/pluto-util/src/test/resources/org/apache/pluto/util/assemble/file/portlet.xml
@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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.
--->
-<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
-    <portlet>
-        <portlet-name>WarTestPortletName</portlet-name>
-        <portlet-class>WarTestPortletClass</portlet-class>
-        <expiration-cache>0</expiration-cache>
-        <supports>
-            <mime-type>text/html</mime-type>
-            <portlet-mode>help</portlet-mode>
-        </supports>
-        <supported-locale>en-US</supported-locale>
-
-        <portlet-info>
-            <title>WarTestPortlet Title</title>
-            <short-title>WarTestPortlet Short Title</short-title>
-            <keywords>WarTestPortlet, Keywords</keywords>
-        </portlet-info>
-    </portlet>
-</portlet-app>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
+    <portlet>
+        <portlet-name>WarTestPortletName</portlet-name>
+        <portlet-class>org.apache.pluto.util.assemble.WarTestPortletClass</portlet-class>
+        <expiration-cache>0</expiration-cache>
+        <supports>
+            <mime-type>text/html</mime-type>
+            <portlet-mode>help</portlet-mode>
+        </supports>
+        <supported-locale>en-US</supported-locale>
+
+        <portlet-info>
+            <title>WarTestPortlet Title</title>
+            <short-title>WarTestPortlet Short Title</short-title>
+            <keywords>WarTestPortlet, Keywords</keywords>
+        </portlet-info>
+    </portlet>
+</portlet-app>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/54db2766/pluto-util/src/test/resources/org/apache/pluto/util/assemble/war/WarDeployerTestPortlet.war
----------------------------------------------------------------------
diff --git a/pluto-util/src/test/resources/org/apache/pluto/util/assemble/war/WarDeployerTestPortlet.war b/pluto-util/src/test/resources/org/apache/pluto/util/assemble/war/WarDeployerTestPortlet.war
index e1748e6..6b79e4d 100644
Binary files a/pluto-util/src/test/resources/org/apache/pluto/util/assemble/war/WarDeployerTestPortlet.war and b/pluto-util/src/test/resources/org/apache/pluto/util/assemble/war/WarDeployerTestPortlet.war differ

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/54db2766/pluto-util/src/test/resources/org/apache/pluto/util/assemble/war/WarDeployerTestPortletNoManifest.war
----------------------------------------------------------------------
diff --git a/pluto-util/src/test/resources/org/apache/pluto/util/assemble/war/WarDeployerTestPortletNoManifest.war b/pluto-util/src/test/resources/org/apache/pluto/util/assemble/war/WarDeployerTestPortletNoManifest.war
index 38a96c9..95af62b 100644
Binary files a/pluto-util/src/test/resources/org/apache/pluto/util/assemble/war/WarDeployerTestPortletNoManifest.war and b/pluto-util/src/test/resources/org/apache/pluto/util/assemble/war/WarDeployerTestPortletNoManifest.war differ

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/54db2766/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 0df5d83..79aa290 100644
--- a/pom.xml
+++ b/pom.xml
@@ -271,7 +271,7 @@ generate mailto links. -->
     <springframework.version>2.0.2</springframework.version>
     <maven.version>2.0.5</maven.version>
     <ant.version>1.6.5</ant.version>
-    <commons-io.version>1.3.1</commons-io.version>
+    <commons-io.version>2.4</commons-io.version>
     <ccpp-api.version>1.0</ccpp-api.version>
     <junit.version>4.12</junit.version>
     <jmock.version>1.2.0</jmock.version>


[07/38] portals-pluto git commit: Replaced code that reads the deployment descriptor with an implementation that can be better extended to add v3.0 support. Added test cases. Uses jaxb binding classes that are generated at compile time.

Posted by ms...@apache.org.
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/UserDataConstraintType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/UserDataConstraintType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/UserDataConstraintType.java
deleted file mode 100644
index 2eaf68c..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/UserDataConstraintType.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.Description;
-import org.apache.pluto.container.om.portlet.UserDataConstraint;
-
-/**
- * The user-data-constraintType is used to indicate how data communicated between the client and portlet should be
- * protected. Used in: security-constraint <p>Java class for user-data-constraintType complex type. <p>The following
- * schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;user-data-constraintType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;transport-guarantee&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}transport-guaranteeType&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "user-data-constraintType", propOrder = { "description", "transportGuarantee" })
-public class UserDataConstraintType implements UserDataConstraint
-{
-    @XmlElement(name = "description")
-    protected List<DescriptionType> description;
-    @XmlElement(name = "transport-guarantee", required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String transportGuarantee;
-
-    public Description getDescription(Locale locale)
-    {
-        for (Description d : getDescriptions())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Description> getDescriptions()
-    {
-        if (description == null)
-        {
-            description = new ArrayList<DescriptionType>();
-        }
-        return description;
-    }
-    
-    public Description addDescription(String lang)
-    {
-        DescriptionType d = new DescriptionType();
-        d.setLang(lang);
-        if (getDescription(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
-        }
-        getDescriptions();
-        description.add(d);
-        return d;
-    }
-
-    public String getTransportGuarantee()
-    {
-        return transportGuarantee;
-    }
-
-    public void setTransportGuarantee(String value)
-    {
-        transportGuarantee = value;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/package-info.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/package-info.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/package-info.java
deleted file mode 100644
index f61841d..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/package-info.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.
- * 
- * @version $Id$
- */
-@javax.xml.bind.annotation.XmlSchema(namespace = "http://xmlns.jcp.org/xml/ns/portlet", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
-package org.apache.pluto.container.om.portlet30.impl;
-

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/resources/org/apache/pluto/container/impl/portlet-app_1_0.xsd
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/resources/org/apache/pluto/container/impl/portlet-app_1_0.xsd b/pluto-container/src/main/resources/org/apache/pluto/container/impl/portlet-app_1_0.xsd
index cfd0c9c..6a26877 100644
--- a/pluto-container/src/main/resources/org/apache/pluto/container/impl/portlet-app_1_0.xsd
+++ b/pluto-container/src/main/resources/org/apache/pluto/container/impl/portlet-app_1_0.xsd
@@ -1,632 +1,627 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<schema targetNamespace="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0" xml:lang="en">
-	<annotation>
-		<documentation>
-		This is the XML Schema for the Portlet 1.0 deployment descriptor.
-		</documentation>
-	</annotation>
-	<annotation>
-		<documentation>
-		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.
-		</documentation>
-	</annotation>
-	<!-- *********************************************************** -->
-	<import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
-	<element name="portlet-app" type="portlet:portlet-appType">
-		<annotation>
-			<documentation>
-			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.
-			</documentation>
-		</annotation>
-		<unique name="portlet-name-uniqueness">
-			<annotation>
-				<documentation>
-				The portlet element contains the name of a portlet.
-				This name must be unique within the portlet application.
-				 </documentation>
-			</annotation>
-			<selector xpath="portlet:portlet"/>
-			<field xpath="portlet:portlet-name"/>
-		</unique>
-		<unique name="custom-portlet-mode-uniqueness">
-			<annotation>
-				<documentation>
-				The custom-portlet-mode element contains the portlet-mode.
-				This portlet mode must be unique within the portlet application.
-				</documentation>
-			</annotation>
-			<selector xpath="portlet:custom-portlet-mode"/>
-			<field xpath="portlet:portlet-mode"/>
-		</unique>
-		<unique name="custom-window-state-uniqueness">
-			<annotation>
-				<documentation>
-				The custom-window-state element contains the window-state.
-				This window state must be unique within the portlet application.
-				</documentation>
-			</annotation>
-			<selector xpath="portlet:custom-window-state"/>
-			<field xpath="portlet:window-state"/>
-		</unique>
-		<unique name="user-attribute-name-uniqueness">
-			<annotation>
-				<documentation>
-				The user-attribute element contains the name the attribute.
-				This name must be unique within the portlet application.
-				</documentation>
-			</annotation>
-			<selector xpath="portlet:user-attribute"/>
-			<field xpath="portlet:name"/>
-		</unique>
-	</element>
-	<complexType name="portlet-appType">
-		<sequence>
-			<element name="portlet" type="portlet:portletType" minOccurs="0" maxOccurs="unbounded">
-				<unique name="init-param-name-uniqueness">
-					<annotation>
-						<documentation>
-						The init-param element contains the name the attribute.
-						This name must be unique within the portlet.
-						</documentation>
-					</annotation>
-					<selector xpath="portlet:init-param"/>
-					<field xpath="portlet:name"/>
-				</unique>
-				<unique name="supports-mime-type-uniqueness">
-					<annotation>
-						<documentation>
-						The supports element contains the supported mime-type.
-						This mime type must be unique within the portlet.
-						</documentation>
-					</annotation>
-					<selector xpath="portlet:supports"/>
-					<field xpath="mime-type"/>
-				</unique>
-				<unique name="preference-name-uniqueness">
-					<annotation>
-						<documentation>
-						The preference element contains the name the preference.
-						This name must be unique within the portlet.
-						</documentation>
-					</annotation>
-					<selector xpath="portlet:portlet-preferences/portlet:preference"/>
-					<field xpath="portlet:name"/>
-				</unique>
-				<unique name="security-role-ref-name-uniqueness">
-					<annotation>
-						<documentation>
-						The security-role-ref element contains the role-name.
-						This role name must be unique within the portlet.
-						</documentation>
-					</annotation>
-					<selector xpath="portlet:security-role-ref"/>
-					<field xpath="portlet:role-name"/>
-				</unique>
-			</element>
-			<element name="custom-portlet-mode" type="portlet:custom-portlet-modeType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="custom-window-state" type="portlet:custom-window-stateType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="user-attribute" type="portlet:user-attributeType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="security-constraint" type="portlet:security-constraintType" minOccurs="0" maxOccurs="unbounded"/>
-		</sequence>
-		<attribute name="version" type="string" use="required"/>
-		<attribute name="id" type="string" use="optional"/>
-	</complexType>
-	<complexType name="custom-portlet-modeType">
-		<annotation>
-			<documentation>
-			A custom portlet mode that one or more portlets in 
-			this portlet application supports.
-			Used in: portlet-app
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="portlet-mode" type="portlet:portlet-modeType"/>
-		</sequence>
-		<attribute name="id" type="string" use="optional"/>
-	</complexType>
-	<complexType name="custom-window-stateType">
-		<annotation>
-			<documentation>
-			A custom window state that one or more portlets in this 
-			portlet application supports.
-			Used in: portlet-app
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="window-state" type="portlet:window-stateType"/>
-		</sequence>
-		<attribute name="id" type="string" use="optional"/>
-	</complexType>
-	<complexType name="expiration-cacheType">
-		<annotation>
-			<documentation>
-			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
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="int"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="init-paramType">
-		<annotation>
-			<documentation>
-			The init-param element contains a name/value pair as an 
-			initialization param of the portlet
-			Used in:portlet
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="name" type="portlet:nameType"/>
-			<element name="value" type="portlet:valueType"/>
-		</sequence>
-		<attribute name="id" type="string" use="optional"/>
-	</complexType>
-	<complexType name="keywordsType">
-		<annotation>
-			<documentation>
-			Locale specific keywords associated with this portlet.
-			The kewords are separated by commas.
-			Used in: portlet-info
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="string"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="mime-typeType">
-		<annotation>
-			<documentation>
-			MIME type name, e.g. "text/html".
-			The MIME type may also contain the wildcard
-			character '*', like "text/*" or "*/*".
-			Used in: supports
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="string"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="nameType">
-		<annotation>
-			<documentation>
-			The name element contains the name of a parameter. 
-			Used in: init-param, ...
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="string"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="portletType">
-		<annotation>
-			<documentation>
-			The portlet element contains the declarative data of a portlet. 
-			Used in: portlet-app
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="portlet-name" type="portlet:portlet-nameType"/>
-			<element name="display-name" type="portlet:display-nameType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="portlet-class" type="portlet:portlet-classType"/>
-			<element name="init-param" type="portlet:init-paramType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="expiration-cache" type="portlet:expiration-cacheType" minOccurs="0"/>
-			<element name="supports" type="portlet:supportsType" maxOccurs="unbounded"/>
-			<element name="supported-locale" type="portlet:supported-localeType" minOccurs="0" maxOccurs="unbounded"/>
-			<choice>
-				<sequence>
-					<element name="resource-bundle" type="portlet:resource-bundleType"/>
-					<element name="portlet-info" type="portlet:portlet-infoType" minOccurs="0"/>
-   			  	</sequence>
-   				<element name="portlet-info" type="portlet:portlet-infoType"/>
-			</choice>
-			<element name="portlet-preferences" type="portlet:portlet-preferencesType" minOccurs="0"/>
-			<element name="security-role-ref" type="portlet:security-role-refType" minOccurs="0" maxOccurs="unbounded"/>
-		</sequence>
-		<attribute name="id" type="string" use="optional"/>
-	</complexType>
-	<simpleType name="portlet-classType">
-		<annotation>
-			<documentation>
-			 The portlet-class element contains the fully
-			 qualified class name of the portlet.
-			Used in: portlet
-			</documentation>
-		</annotation>
-		<restriction base="portlet:fully-qualified-classType"/>
-	</simpleType>
-	<complexType name="portlet-collectionType">
-		<annotation>
-			<documentation>
-			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
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="portlet-name" type="portlet:portlet-nameType" maxOccurs="unbounded"/>
-		</sequence>
-	</complexType>
-	<complexType name="portlet-infoType">
-		<sequence>
-			<element name="title" type="portlet:titleType"/>
-			<element name="short-title" type="portlet:short-titleType" minOccurs="0"/>
-			<element name="keywords" type="portlet:keywordsType" minOccurs="0"/>
-		</sequence>
-		<attribute name="id" type="string" use="optional"/>
-	</complexType>
-	<complexType name="portlet-modeType">
-		<annotation>
-			<documentation>
-			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
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="string"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="portlet-nameType">
-		<annotation>
-			<documentation>
-			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
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="string"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="portlet-preferencesType">
-		<annotation>
-			<documentation>
-			Portlet persistent preference store.
-			Used in: portlet
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="preference" type="portlet:preferenceType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="preferences-validator" type="portlet:preferences-validatorType" minOccurs="0"/>
-		</sequence>
-		<attribute name="id" type="string" use="optional"/>
-	</complexType>
-	<complexType name="preferenceType">
-		<annotation>
-			<documentation>
-			Persistent preference values that may be used for customization 
-			and personalization by the portlet.
-			Used in: portlet-preferences
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="name" type="portlet:nameType"/>
-			<element name="value" type="portlet:valueType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="read-only" type="portlet:read-onlyType" minOccurs="0"/>
-		</sequence>
-		<attribute name="id" type="string" use="optional"/>
-	</complexType>
-	<simpleType name="preferences-validatorType">
-		<annotation>
-			<documentation>
-			The class specified under preferences-validator implements
-			the PreferencesValidator interface to validate the 
-			preferences settings.
-			Used in: portlet-preferences
-			</documentation>
-		</annotation>
-		<restriction base="portlet:fully-qualified-classType"/>
-	</simpleType>
-	<simpleType name="read-onlyType">
-		<annotation>
-			<documentation>
-			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
-			</documentation>
-		</annotation>
-		<restriction base="portlet:string">
-			<enumeration value="true"/>
-			<enumeration value="false"/>
-		</restriction>
-	</simpleType>
-	<complexType name="resource-bundleType">
-		<annotation>
-			<documentation>
-			Filename of the resource bundle containing the language specific 
-			portlet informations in different languages.
-			Used in: portlet-info
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="string"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="role-linkType">
-		<annotation>
-			<documentation>
-			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
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="string"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="security-constraintType">
-		<annotation>
-			<documentation>
-			The security-constraintType is used to associate
-			intended security constraints with one or more portlets.
-			Used in: portlet-app
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="display-name" type="portlet:display-nameType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="portlet-collection" type="portlet:portlet-collectionType"/>
-			<element name="user-data-constraint" type="portlet:user-data-constraintType"/>
-		</sequence>
-		<attribute name="id" type="string" use="optional"/>
-	</complexType>
-	<complexType name="security-role-refType">
-		<annotation>
-			<documentation>
-			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
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="role-name" type="portlet:role-nameType"/>
-			<element name="role-link" type="portlet:role-linkType" minOccurs="0"/>
-		</sequence>
-		<attribute name="id" type="string" use="optional"/>
-	</complexType>
-	<complexType name="short-titleType">
-		<annotation>
-			<documentation>
-			Locale specific short version of the static title.
-			Used in: portlet-info
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="string"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="supportsType">
-		<annotation>
-			<documentation>
-			Supports indicates the portlet modes a 
-			portlet supports for a specific content type. All portlets must 
-			support the view mode. 
-			Used in: portlet
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="mime-type" type="portlet:mime-typeType"/>
-			<element name="portlet-mode" type="portlet:portlet-modeType" minOccurs="0" maxOccurs="unbounded"/>
-		</sequence>
-		<attribute name="id" type="string" use="optional"/>
-	</complexType>
-	<complexType name="supported-localeType">
-		<annotation>
-			<documentation>
-			Indicated the locales the portlet supports.
-			Used in: portlet
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="string"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="titleType">
-		<annotation>
-			<documentation>
-			Locale specific static title for this portlet.
-			Used in: portlet-info
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="string"/>
-		</simpleContent>
-	</complexType>
-	<simpleType name="transport-guaranteeType">
-		<annotation>
-			<documentation>
-			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
-			</documentation>
-		</annotation>
-		<restriction base="portlet:string">
-			<enumeration value="NONE"/>
-			<enumeration value="INTEGRAL"/>
-			<enumeration value="CONFIDENTIAL"/>
-		</restriction>
-	</simpleType>
-	<complexType name="user-attributeType">
-		<annotation>
-			<documentation>
-			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
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="name" type="portlet:nameType"/>
-		</sequence>
-		<attribute name="id" type="string" use="optional"/>
-	</complexType>
-	<complexType name="user-data-constraintType">
-		<annotation>
-			<documentation>
-			The user-data-constraintType is used to indicate how
-			data communicated between the client and portlet should be
-			protected.
-			Used in: security-constraint
-			</documentation>
-		</annotation>
-		<sequence>
-			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
-			<element name="transport-guarantee" type="portlet:transport-guaranteeType"/>
-		</sequence>
-		<attribute name="id" type="string" use="optional"/>
-	</complexType>
-	<complexType name="valueType">
-		<annotation>
-			<documentation>
-			The value element contains the value of a parameter.
-			Used in: init-param
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="string"/>
-		</simpleContent>
-	</complexType>
-	<complexType name="window-stateType">
-		<annotation>
-			<documentation>
-			Portlet window state. Window state names are not case sensitive.
-			Used in: custom-window-state
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="string"/>
-		</simpleContent>
-	</complexType>
-	<!--- everything below is copied from j2ee_1_4.xsd -->
-	<complexType name="descriptionType">
-		<annotation>
-			<documentation>
-			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(“en”).
-			Used in: init-param, portlet, portlet-app, security-role
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="string">
-				<attribute ref="xml:lang"/>
-			</extension>
-		</simpleContent>
-	</complexType>
-	<complexType name="display-nameType">
-		<annotation>
-			<documentation>
-			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:
-				...
-  			<display-name xml:lang="en">Employee Self Service</display-name>
-
-			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(“en”).
-			</documentation>
-		</annotation>
-		<simpleContent>
-			<extension base="portlet:string">
-				<attribute ref="xml:lang"/>
-			</extension>
-		</simpleContent>
-	</complexType>
-	<simpleType name="fully-qualified-classType">
-		<annotation>
-			<documentation>
-			The elements that use this type designate the name of a
-			Java class or interface.
-			</documentation>
-		</annotation>
-		<restriction base="portlet:string"/>
-	</simpleType>
-	<simpleType name="role-nameType">
-		<annotation>
-			<documentation>
-			The role-nameType designates the name of a security role.
-
-			The name must conform to the lexical rules for an NMTOKEN.
-			</documentation>
-		</annotation>
-		<restriction base="NMTOKEN"/>
-	</simpleType>
-	<simpleType name="string">
-		<annotation>
-			<documentation>
-			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.
-			</documentation>
-		</annotation>
-		<restriction base="string">
-			<whiteSpace value="collapse"/>
-		</restriction>
-	</simpleType>
-</schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0" xml:lang="en">
+	<annotation>
+		<documentation>
+		This is the XML Schema for the Portlet 1.0 deployment descriptor.
+		</documentation>
+	</annotation>
+	<annotation>
+		<documentation>
+		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.
+		</documentation>
+	</annotation>
+	<!-- *********************************************************** -->
+	<import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+	<element name="portlet-app" type="portlet:portlet-appType">
+		<annotation>
+			<documentation>
+			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.
+			</documentation>
+		</annotation>
+		<unique name="portlet-name-uniqueness">
+			<annotation>
+				<documentation>
+				The portlet element contains the name of a portlet.
+				This name must be unique within the portlet application.
+				 </documentation>
+			</annotation>
+			<selector xpath="portlet:portlet"/>
+			<field xpath="portlet:portlet-name"/>
+		</unique>
+		<unique name="custom-portlet-mode-uniqueness">
+			<annotation>
+				<documentation>
+				The custom-portlet-mode element contains the portlet-mode.
+				This portlet mode must be unique within the portlet application.
+				</documentation>
+			</annotation>
+			<selector xpath="portlet:custom-portlet-mode"/>
+			<field xpath="portlet:portlet-mode"/>
+		</unique>
+		<unique name="custom-window-state-uniqueness">
+			<annotation>
+				<documentation>
+				The custom-window-state element contains the window-state.
+				This window state must be unique within the portlet application.
+				</documentation>
+			</annotation>
+			<selector xpath="portlet:custom-window-state"/>
+			<field xpath="portlet:window-state"/>
+		</unique>
+		<unique name="user-attribute-name-uniqueness">
+			<annotation>
+				<documentation>
+				The user-attribute element contains the name the attribute.
+				This name must be unique within the portlet application.
+				</documentation>
+			</annotation>
+			<selector xpath="portlet:user-attribute"/>
+			<field xpath="portlet:name"/>
+		</unique>
+	</element>
+	<complexType name="portlet-appType">
+		<sequence>
+			<element name="portlet" type="portlet:portletType" minOccurs="0" maxOccurs="unbounded">
+				<unique name="init-param-name-uniqueness">
+					<annotation>
+						<documentation>
+						The init-param element contains the name the attribute.
+						This name must be unique within the portlet.
+						</documentation>
+					</annotation>
+					<selector xpath="portlet:init-param"/>
+					<field xpath="portlet:name"/>
+				</unique>
+				<unique name="supports-mime-type-uniqueness">
+					<annotation>
+						<documentation>
+						The supports element contains the supported mime-type.
+						This mime type must be unique within the portlet.
+						</documentation>
+					</annotation>
+					<selector xpath="portlet:supports"/>
+					<field xpath="mime-type"/>
+				</unique>
+				<unique name="preference-name-uniqueness">
+					<annotation>
+						<documentation>
+						The preference element contains the name the preference.
+						This name must be unique within the portlet.
+						</documentation>
+					</annotation>
+					<selector xpath="portlet:portlet-preferences/portlet:preference"/>
+					<field xpath="portlet:name"/>
+				</unique>
+				<unique name="security-role-ref-name-uniqueness">
+					<annotation>
+						<documentation>
+						The security-role-ref element contains the role-name.
+						This role name must be unique within the portlet.
+						</documentation>
+					</annotation>
+					<selector xpath="portlet:security-role-ref"/>
+					<field xpath="portlet:role-name"/>
+				</unique>
+			</element>
+			<element name="custom-portlet-mode" type="portlet:custom-portlet-modeType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="custom-window-state" type="portlet:custom-window-stateType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="user-attribute" type="portlet:user-attributeType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="security-constraint" type="portlet:security-constraintType" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+		<attribute name="version" type="string" use="required"/>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="custom-portlet-modeType">
+		<annotation>
+			<documentation>
+			A custom portlet mode that one or more portlets in 
+			this portlet application supports.
+			Used in: portlet-app
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="portlet-mode" type="portlet:portlet-modeType"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="custom-window-stateType">
+		<annotation>
+			<documentation>
+			A custom window state that one or more portlets in this 
+			portlet application supports.
+			Used in: portlet-app
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="window-state" type="portlet:window-stateType"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="expiration-cacheType">
+		<annotation>
+			<documentation>
+			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
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="int"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="init-paramType">
+		<annotation>
+			<documentation>
+			The init-param element contains a name/value pair as an 
+			initialization param of the portlet
+			Used in:portlet
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="name" type="portlet:nameType"/>
+			<element name="value" type="portlet:valueType"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="keywordsType">
+		<annotation>
+			<documentation>
+			Locale specific keywords associated with this portlet.
+			The kewords are separated by commas.
+			Used in: portlet-info
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="mime-typeType">
+		<annotation>
+			<documentation>
+			MIME type name, e.g. "text/html".
+			The MIME type may also contain the wildcard
+			character '*', like "text/*" or "*/*".
+			Used in: supports
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="nameType">
+		<annotation>
+			<documentation>
+			The name element contains the name of a parameter. 
+			Used in: init-param, ...
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="portletType">
+		<annotation>
+			<documentation>
+			The portlet element contains the declarative data of a portlet. 
+			Used in: portlet-app
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="portlet-name" type="portlet:portlet-nameType"/>
+			<element name="display-name" type="portlet:display-nameType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="portlet-class" type="portlet:portlet-classType"/>
+			<element name="init-param" type="portlet:init-paramType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="expiration-cache" type="portlet:expiration-cacheType" minOccurs="0"/>
+			<element name="supports" type="portlet:supportsType" maxOccurs="unbounded"/>
+			<element name="supported-locale" type="portlet:supported-localeType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="resource-bundle" type="portlet:resource-bundleType" minOccurs="0"/>
+					<element name="portlet-info" type="portlet:portlet-infoType" minOccurs="0"/>
+			<element name="portlet-preferences" type="portlet:portlet-preferencesType" minOccurs="0"/>
+			<element name="security-role-ref" type="portlet:security-role-refType" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<simpleType name="portlet-classType">
+		<annotation>
+			<documentation>
+			 The portlet-class element contains the fully
+			 qualified class name of the portlet.
+			Used in: portlet
+			</documentation>
+		</annotation>
+		<restriction base="portlet:fully-qualified-classType"/>
+	</simpleType>
+	<complexType name="portlet-collectionType">
+		<annotation>
+			<documentation>
+			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
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="portlet-name" type="portlet:portlet-nameType" maxOccurs="unbounded"/>
+		</sequence>
+	</complexType>
+	<complexType name="portlet-infoType">
+		<sequence>
+			<element name="title" type="portlet:titleType"/>
+			<element name="short-title" type="portlet:short-titleType" minOccurs="0"/>
+			<element name="keywords" type="portlet:keywordsType" minOccurs="0"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="portlet-modeType">
+		<annotation>
+			<documentation>
+			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
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="portlet-nameType">
+		<annotation>
+			<documentation>
+			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
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="portlet-preferencesType">
+		<annotation>
+			<documentation>
+			Portlet persistent preference store.
+			Used in: portlet
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="preference" type="portlet:preferenceType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="preferences-validator" type="portlet:preferences-validatorType" minOccurs="0"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="preferenceType">
+		<annotation>
+			<documentation>
+			Persistent preference values that may be used for customization 
+			and personalization by the portlet.
+			Used in: portlet-preferences
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="name" type="portlet:nameType"/>
+			<element name="value" type="portlet:valueType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="read-only" type="portlet:read-onlyType" minOccurs="0"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<simpleType name="preferences-validatorType">
+		<annotation>
+			<documentation>
+			The class specified under preferences-validator implements
+			the PreferencesValidator interface to validate the 
+			preferences settings.
+			Used in: portlet-preferences
+			</documentation>
+		</annotation>
+		<restriction base="portlet:fully-qualified-classType"/>
+	</simpleType>
+	<simpleType name="read-onlyType">
+		<annotation>
+			<documentation>
+			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
+			</documentation>
+		</annotation>
+		<restriction base="portlet:string">
+			<enumeration value="true"/>
+			<enumeration value="false"/>
+		</restriction>
+	</simpleType>
+	<complexType name="resource-bundleType">
+		<annotation>
+			<documentation>
+			Filename of the resource bundle containing the language specific 
+			portlet informations in different languages.
+			Used in: portlet-info
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="role-linkType">
+		<annotation>
+			<documentation>
+			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
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="security-constraintType">
+		<annotation>
+			<documentation>
+			The security-constraintType is used to associate
+			intended security constraints with one or more portlets.
+			Used in: portlet-app
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="display-name" type="portlet:display-nameType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="portlet-collection" type="portlet:portlet-collectionType"/>
+			<element name="user-data-constraint" type="portlet:user-data-constraintType"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="security-role-refType">
+		<annotation>
+			<documentation>
+			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
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="role-name" type="portlet:role-nameType"/>
+			<element name="role-link" type="portlet:role-linkType" minOccurs="0"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="short-titleType">
+		<annotation>
+			<documentation>
+			Locale specific short version of the static title.
+			Used in: portlet-info
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="supportsType">
+		<annotation>
+			<documentation>
+			Supports indicates the portlet modes a 
+			portlet supports for a specific content type. All portlets must 
+			support the view mode. 
+			Used in: portlet
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="mime-type" type="portlet:mime-typeType"/>
+			<element name="portlet-mode" type="portlet:portlet-modeType" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="supported-localeType">
+		<annotation>
+			<documentation>
+			Indicated the locales the portlet supports.
+			Used in: portlet
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="titleType">
+		<annotation>
+			<documentation>
+			Locale specific static title for this portlet.
+			Used in: portlet-info
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<simpleType name="transport-guaranteeType">
+		<annotation>
+			<documentation>
+			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
+			</documentation>
+		</annotation>
+		<restriction base="portlet:string">
+			<enumeration value="NONE"/>
+			<enumeration value="INTEGRAL"/>
+			<enumeration value="CONFIDENTIAL"/>
+		</restriction>
+	</simpleType>
+	<complexType name="user-attributeType">
+		<annotation>
+			<documentation>
+			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
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="name" type="portlet:nameType"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="user-data-constraintType">
+		<annotation>
+			<documentation>
+			The user-data-constraintType is used to indicate how
+			data communicated between the client and portlet should be
+			protected.
+			Used in: security-constraint
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="transport-guarantee" type="portlet:transport-guaranteeType"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="valueType">
+		<annotation>
+			<documentation>
+			The value element contains the value of a parameter.
+			Used in: init-param
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="window-stateType">
+		<annotation>
+			<documentation>
+			Portlet window state. Window state names are not case sensitive.
+			Used in: custom-window-state
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string"/>
+		</simpleContent>
+	</complexType>
+	<!--- everything below is copied from j2ee_1_4.xsd -->
+	<complexType name="descriptionType">
+		<annotation>
+			<documentation>
+			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(“en”).
+			Used in: init-param, portlet, portlet-app, security-role
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string">
+				<attribute ref="xml:lang"/>
+			</extension>
+		</simpleContent>
+	</complexType>
+	<complexType name="display-nameType">
+		<annotation>
+			<documentation>
+			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:
+				...
+  			<display-name xml:lang="en">Employee Self Service</display-name>
+
+			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(“en”).
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string">
+				<attribute ref="xml:lang"/>
+			</extension>
+		</simpleContent>
+	</complexType>
+	<simpleType name="fully-qualified-classType">
+		<annotation>
+			<documentation>
+			The elements that use this type designate the name of a
+			Java class or interface.
+			</documentation>
+		</annotation>
+		<restriction base="portlet:string"/>
+	</simpleType>
+	<simpleType name="role-nameType">
+		<annotation>
+			<documentation>
+			The role-nameType designates the name of a security role.
+
+			The name must conform to the lexical rules for an NMTOKEN.
+			</documentation>
+		</annotation>
+		<restriction base="NMTOKEN"/>
+	</simpleType>
+	<simpleType name="string">
+		<annotation>
+			<documentation>
+			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.
+			</documentation>
+		</annotation>
+		<restriction base="xs:token">
+			<whiteSpace value="collapse"/>
+		</restriction>
+	</simpleType>
+</schema>


[29/38] portals-pluto git commit: Integrated latest version of the portlet API 3.0. Made necessary minor adaptations the Pluto code and demo portlets to make the previously available funtionality work. For the partial action request, changed implementati

Posted by ms...@apache.org.
Integrated latest version of the portlet API 3.0. Made necessary minor
adaptations the Pluto code and demo portlets to make the previously
available funtionality work. For the partial action request, changed
implementation to pass the PageState as a resource request attribute rather
than through use of a method on ResourceRequest.


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/7fb0624d
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/7fb0624d
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/7fb0624d

Branch: refs/heads/V3Prototype
Commit: 7fb0624d7bceacd2601e2217edc7ea9713cd20f7
Parents: 8fb2d08
Author: Scott Nicklous <ms...@apache.org>
Authored: Wed Nov 18 16:28:43 2015 +0100
Committer: Scott Nicklous <ms...@apache.org>
Committed: Wed Nov 18 16:28:43 2015 +0100

----------------------------------------------------------------------
 .../basic/portlet/PartialActionPortlet.java     |   7 +-
 .../main/java/basic/portlet/AuthSCPortlet.java  |  14 +-
 .../java/basic/portlet/ColorSelPortlet.java     |   1 +
 .../java/basic/portlet/ImageSelPortlet.java     |   1 +
 .../main/java/basic/portlet/LongPortlet.java    |  13 +-
 .../java/basic/portlet/MessageBoxPortlet.java   |   3 +-
 .../basic/portlet/PortletConfigPortlet.java     |   5 +-
 .../java/basic/portlet/ResourcePortlet.java     |   1 +
 .../java/basic/portlet/UrlAPTestPortlet.java    |  40 +-
 .../java/basic/portlet/UrlRPTestPortlet.java    |  47 +-
 .../main/java/basic/portlet/UrlTestPortlet.java |  14 +-
 .../src/main/webapp/WEB-INF/jsp/view-ascp.jsp   |   8 +-
 .../src/main/webapp/WEB-INF/jsp/view-long.jsp   |   6 +-
 .../src/main/webapp/WEB-INF/jsp/view-ptp.jsp    |   4 +-
 .../src/main/webapp/WEB-INF/jsp/view-uaptp.jsp  |  10 +-
 .../src/main/webapp/WEB-INF/jsp/view-urptp.jsp  |  10 +-
 .../src/main/webapp/WEB-INF/jsp/view-utp.jsp    |  10 +-
 .../pluto/container/driver/PortletServlet3.java |  10 +
 .../container/impl/ActionResponseImpl.java      | 205 ++---
 .../pluto/container/impl/ActionURLImpl.java     |   4 +-
 .../pluto/container/impl/BaseURLImpl.java       |  10 +-
 .../pluto/container/impl/MimeResponseImpl.java  |  10 +-
 .../pluto/container/impl/PortletURLImpl.java    |  34 +-
 .../pluto/container/impl/RenderURLImpl.java     |   4 +-
 .../container/impl/ResourceRequestImpl.java     |  12 -
 .../container/impl/ResourceResponseImpl.java    |  18 +-
 pom.xml                                         |   8 +-
 portlet-api/pom.xml                             | 157 ++--
 .../main/java/javax/portlet/ActionResponse.java |  67 +-
 .../javax/portlet/ConditionalDispatcher.java    | 157 ++++
 .../main/java/javax/portlet/HeaderPortlet.java  |  63 ++
 .../main/java/javax/portlet/HeaderRequest.java  |  30 +
 .../main/java/javax/portlet/HeaderResponse.java |  84 ++
 .../main/java/javax/portlet/MethodToken.java    |  68 ++
 .../main/java/javax/portlet/MimeResponse.java   |  40 +-
 .../src/main/java/javax/portlet/PortletURL.java |  17 +
 .../main/java/javax/portlet/RenderResponse.java |   1 +
 .../java/javax/portlet/ResourceRequest.java     |  46 +-
 .../java/javax/portlet/ResourceResponse.java    |   8 +-
 .../javax/portlet/annotations/ActionMethod.java |  89 ++
 .../javax/portlet/annotations/ActionParam.java  |  68 ++
 .../javax/portlet/annotations/BeanPortlet.java  |  47 ++
 .../annotations/ConditionalDispatchMethod.java  | 112 +++
 .../portlet/annotations/ContentTypeSupport.java |  87 ++
 .../javax/portlet/annotations/ContextPath.java  |  58 ++
 .../portlet/annotations/CustomPortletMode.java  |  76 ++
 .../portlet/annotations/CustomWindowState.java  |  64 ++
 .../javax/portlet/annotations/Dependency.java   |  65 ++
 .../portlet/annotations/DestroyMethod.java      |  76 ++
 .../portlet/annotations/EventDefinition.java    | 107 +++
 .../javax/portlet/annotations/EventMethod.java  | 119 +++
 .../javax/portlet/annotations/HeaderMethod.java | 137 +++
 .../javax/portlet/annotations/InitMethod.java   |  74 ++
 .../portlet/annotations/InitParameter.java      |  58 ++
 .../javax/portlet/annotations/LocaleString.java |  67 ++
 .../javax/portlet/annotations/Namespace.java    |  58 ++
 .../portlet/annotations/PortletApplication.java | 143 ++++
 .../annotations/PortletConfiguration.java       | 236 ++++++
 .../annotations/PortletConfigurations.java      |  51 ++
 .../javax/portlet/annotations/PortletQName.java |  92 ++
 .../annotations/PortletRequestFilter.java       | 129 +++
 .../portlet/annotations/PortletResources.java   | 153 ++++
 .../annotations/PortletSerializable.java        |  84 ++
 .../annotations/PortletSessionScoped.java       |  76 ++
 .../portlet/annotations/PortletStateScoped.java |  96 +++
 .../PortletURLGenerationListener.java           | 129 +++
 .../javax/portlet/annotations/Preference.java   |  73 ++
 .../annotations/PreferencesValidator.java       |  83 ++
 .../PublicRenderParameterDefinition.java        |  93 ++
 .../javax/portlet/annotations/RenderMethod.java | 143 ++++
 .../javax/portlet/annotations/RenderParam.java  |  68 ++
 .../portlet/annotations/ResourceParam.java      |  77 ++
 .../portlet/annotations/RuntimeOption.java      |  58 ++
 .../portlet/annotations/SecurityRoleRef.java    |  61 ++
 .../annotations/ServeResourceMethod.java        | 157 ++++
 .../javax/portlet/annotations/Supports.java     |  74 ++
 .../javax/portlet/annotations/URLFactory.java   | 197 +++++
 .../portlet/annotations/UserAttribute.java      |  61 ++
 .../javax/portlet/annotations/WindowId.java     |  57 ++
 .../javax/portlet/annotations/package-info.java | 316 +++++++
 .../portlet/filter/ActionRequestWrapper.java    | 245 ++----
 .../portlet/filter/ActionResponseWrapper.java   | 315 +++----
 .../filter/ClientDataRequestWrapper.java        | 125 +++
 .../portlet/filter/EventRequestWrapper.java     | 194 ++---
 .../portlet/filter/EventResponseWrapper.java    | 293 ++-----
 .../java/javax/portlet/filter/HeaderFilter.java | 113 +++
 .../javax/portlet/filter/HeaderFilterChain.java |  61 ++
 .../portlet/filter/HeaderRequestWrapper.java    |  80 ++
 .../portlet/filter/HeaderResponseWrapper.java   |  76 ++
 .../portlet/filter/MimeResponseWrapper.java     | 223 +++++
 .../portlet/filter/PortletRequestWrapper.java   | 844 +++++++++----------
 .../portlet/filter/PortletResponseWrapper.java  | 281 +++---
 .../portlet/filter/RenderRequestWrapper.java    | 178 ++--
 .../portlet/filter/RenderResponseWrapper.java   | 351 +++-----
 .../portlet/filter/ResourceRequestWrapper.java  | 322 +++----
 .../portlet/filter/ResourceResponseWrapper.java | 391 +++------
 .../filter/StateAwareResponseWrapper.java       | 168 ++++
 97 files changed, 7172 insertions(+), 2404 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/PortletHubDemo/src/main/java/basic/portlet/PartialActionPortlet.java
----------------------------------------------------------------------
diff --git a/PortletHubDemo/src/main/java/basic/portlet/PartialActionPortlet.java b/PortletHubDemo/src/main/java/basic/portlet/PartialActionPortlet.java
index 50ef9a0..185daea 100644
--- a/PortletHubDemo/src/main/java/basic/portlet/PartialActionPortlet.java
+++ b/PortletHubDemo/src/main/java/basic/portlet/PartialActionPortlet.java
@@ -35,6 +35,9 @@ import javax.portlet.PortletRequestDispatcher;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 import javax.portlet.ResourceRequest;
+
+import static javax.portlet.ResourceRequest.*;
+
 import javax.portlet.ResourceResponse;
 
 /**
@@ -61,6 +64,7 @@ public class PartialActionPortlet extends GenericPortlet {
 
    }
 
+   @SuppressWarnings("deprecation")
    @Override
    public void processAction(ActionRequest req, ActionResponse resp)
          throws PortletException, IOException {
@@ -89,6 +93,7 @@ public class PartialActionPortlet extends GenericPortlet {
    /* (non-Javadoc)
     * @see javax.portlet.GenericPortlet#serveResource(javax.portlet.ResourceRequest, javax.portlet.ResourceResponse)
     */
+   @SuppressWarnings("deprecation")
    @Override
    public void serveResource(ResourceRequest req, ResourceResponse resp)
          throws PortletException, IOException {
@@ -99,7 +104,7 @@ public class PartialActionPortlet extends GenericPortlet {
       String num = req.getParameter(PARAM_NUM_ACTIONS);
       num = (num == null) ? "error" : num;
       
-      String pageState = req.getPageState();
+      String pageState = (String) req.getAttribute(PAGE_STATE);
       
       writer.write("<p>Partial Action has been executed " + num + " times.</p>\n");
       writer.write(";#delimiter#;");

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/PortletV3Demo/src/main/java/basic/portlet/AuthSCPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/AuthSCPortlet.java b/PortletV3Demo/src/main/java/basic/portlet/AuthSCPortlet.java
index 62b5fe0..71fe067 100644
--- a/PortletV3Demo/src/main/java/basic/portlet/AuthSCPortlet.java
+++ b/PortletV3Demo/src/main/java/basic/portlet/AuthSCPortlet.java
@@ -18,17 +18,11 @@
 
 package basic.portlet;
 
-import static basic.portlet.Constants.*;
+import static basic.portlet.Constants.PARAM_STATUSCODE;
 
 import java.io.IOException;
 import java.io.PrintWriter;
-import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.TreeMap;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -36,15 +30,9 @@ import javax.portlet.ActionParameters;
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
 import javax.portlet.GenericPortlet;
-
-import static javax.portlet.MimeResponse.ParameterCopyOption.*;
-
-import javax.portlet.ActionURL;
-import javax.portlet.MutableActionParameters;
 import javax.portlet.MutableRenderParameters;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.RenderParameters;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 import javax.portlet.ResourceRequest;

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/PortletV3Demo/src/main/java/basic/portlet/ColorSelPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/ColorSelPortlet.java b/PortletV3Demo/src/main/java/basic/portlet/ColorSelPortlet.java
index c6447dc..5f657bf 100644
--- a/PortletV3Demo/src/main/java/basic/portlet/ColorSelPortlet.java
+++ b/PortletV3Demo/src/main/java/basic/portlet/ColorSelPortlet.java
@@ -63,6 +63,7 @@ public class ColorSelPortlet extends GenericPortlet {
          throws PortletException, IOException {
    }
 
+   @SuppressWarnings("deprecation")
    public void processAction(ActionRequest req, ActionResponse resp)
          throws PortletException, IOException {
             

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/PortletV3Demo/src/main/java/basic/portlet/ImageSelPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/ImageSelPortlet.java b/PortletV3Demo/src/main/java/basic/portlet/ImageSelPortlet.java
index 4475ebb..24095f0 100644
--- a/PortletV3Demo/src/main/java/basic/portlet/ImageSelPortlet.java
+++ b/PortletV3Demo/src/main/java/basic/portlet/ImageSelPortlet.java
@@ -67,6 +67,7 @@ public class ImageSelPortlet extends GenericPortlet {
    /* (non-Javadoc)
     * @see javax.portlet.GenericPortlet#serveResource(javax.portlet.ResourceRequest, javax.portlet.ResourceResponse)
     */
+   @SuppressWarnings("deprecation")
    @Override
    public void serveResource(ResourceRequest req, ResourceResponse resp)
          throws PortletException, IOException {

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/PortletV3Demo/src/main/java/basic/portlet/LongPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/LongPortlet.java b/PortletV3Demo/src/main/java/basic/portlet/LongPortlet.java
index 529be1c..9f5f78c 100644
--- a/PortletV3Demo/src/main/java/basic/portlet/LongPortlet.java
+++ b/PortletV3Demo/src/main/java/basic/portlet/LongPortlet.java
@@ -18,16 +18,11 @@
 
 package basic.portlet;
 
-import static basic.portlet.Constants.*;
+import static basic.portlet.Constants.ATTRIB_LONGLINES;
 
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.TreeMap;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -35,15 +30,9 @@ import javax.portlet.ActionParameters;
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
 import javax.portlet.GenericPortlet;
-
-import static javax.portlet.MimeResponse.ParameterCopyOption.*;
-
-import javax.portlet.ActionURL;
-import javax.portlet.MutableActionParameters;
 import javax.portlet.MutableRenderParameters;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.RenderParameters;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 import javax.portlet.ResourceRequest;

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/PortletV3Demo/src/main/java/basic/portlet/MessageBoxPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/MessageBoxPortlet.java b/PortletV3Demo/src/main/java/basic/portlet/MessageBoxPortlet.java
index f8363b0..f397886 100644
--- a/PortletV3Demo/src/main/java/basic/portlet/MessageBoxPortlet.java
+++ b/PortletV3Demo/src/main/java/basic/portlet/MessageBoxPortlet.java
@@ -62,6 +62,7 @@ public class MessageBoxPortlet extends GenericPortlet {
 
    }
 
+   @SuppressWarnings("deprecation")
    @Override
    public void processAction(ActionRequest req, ActionResponse resp)
          throws PortletException, IOException {
@@ -83,7 +84,7 @@ public class MessageBoxPortlet extends GenericPortlet {
       req.getPortletSession().setAttribute(ATTRIB_MSGS, msgs);
    }
    
-   @SuppressWarnings("unchecked")
+   @SuppressWarnings({ "unchecked", "deprecation" })
    @Override
    public void processEvent(EventRequest req, EventResponse resp) 
          throws PortletException ,IOException {

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/PortletV3Demo/src/main/java/basic/portlet/PortletConfigPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/PortletConfigPortlet.java b/PortletV3Demo/src/main/java/basic/portlet/PortletConfigPortlet.java
index af1c1dc..4aaf5cd 100644
--- a/PortletV3Demo/src/main/java/basic/portlet/PortletConfigPortlet.java
+++ b/PortletV3Demo/src/main/java/basic/portlet/PortletConfigPortlet.java
@@ -18,10 +18,11 @@
 
 package basic.portlet;
 
-import static basic.portlet.Constants.*;
+import static basic.portlet.Constants.ATTRIB_PMS;
+import static basic.portlet.Constants.ATTRIB_PRPS;
+import static basic.portlet.Constants.ATTRIB_WS;
 
 import java.io.IOException;
-import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Map;

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/PortletV3Demo/src/main/java/basic/portlet/ResourcePortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/ResourcePortlet.java b/PortletV3Demo/src/main/java/basic/portlet/ResourcePortlet.java
index f8bbbdd..64829af 100644
--- a/PortletV3Demo/src/main/java/basic/portlet/ResourcePortlet.java
+++ b/PortletV3Demo/src/main/java/basic/portlet/ResourcePortlet.java
@@ -70,6 +70,7 @@ public class ResourcePortlet extends GenericPortlet {
    /* (non-Javadoc)
     * @see javax.portlet.GenericPortlet#serveResource(javax.portlet.ResourceRequest, javax.portlet.ResourceResponse)
     */
+   @SuppressWarnings("deprecation")
    @Override
    public void serveResource(ResourceRequest req, ResourceResponse resp)
          throws PortletException, IOException {

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/PortletV3Demo/src/main/java/basic/portlet/UrlAPTestPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/UrlAPTestPortlet.java b/PortletV3Demo/src/main/java/basic/portlet/UrlAPTestPortlet.java
index d05457f..bf5913c 100644
--- a/PortletV3Demo/src/main/java/basic/portlet/UrlAPTestPortlet.java
+++ b/PortletV3Demo/src/main/java/basic/portlet/UrlAPTestPortlet.java
@@ -35,7 +35,7 @@ import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
 import javax.portlet.GenericPortlet;
 
-import static javax.portlet.MimeResponse.ParameterCopyOption.*;
+import static javax.portlet.MimeResponse.Copy.*;
 
 import javax.portlet.ActionURL;
 import javax.portlet.MutableActionParameters;
@@ -148,36 +148,36 @@ public class UrlAPTestPortlet extends GenericPortlet {
       TreeMap<String, String> urls = new TreeMap<String, String>();
       MutableRenderParameters mrp = req.getRenderParameters().clone();
       
-      ActionURL aurl = resp.createActionURL(COPY_NO_PARAMETERS);
+      ActionURL aurl = resp.createActionURL(NONE);
       urls.put(" 1 No render parameters", aurl.toString());
 
-      aurl = resp.createActionURL(COPY_NO_PARAMETERS);
+      aurl = resp.createActionURL(NONE);
       aurl.getRenderParameters().set(mrp);
       urls.put(" 2 Copy with req clone", aurl.toString());
 
-      aurl = resp.createActionURL(COPY_NO_PARAMETERS);
+      aurl = resp.createActionURL(NONE);
       mrp.setValue(name1, val1);
       aurl.getRenderParameters().set(mrp);
       urls.put(" 3 Copy with req clone, 1 addl", aurl.toString());
       
-      aurl = resp.createActionURL(COPY_RENDER_PARAMETERS);
+      aurl = resp.createActionURL(ALL);
       aurl.getRenderParameters().clearPrivate();
       urls.put(" 4 Clear private", aurl.toString());
       
-      aurl = resp.createActionURL(COPY_RENDER_PARAMETERS);
+      aurl = resp.createActionURL(ALL);
       aurl.getRenderParameters().clearPublic();;
       urls.put(" 5 Clear public", aurl.toString());
       
-      aurl = resp.createActionURL(COPY_RENDER_PARAMETERS);
+      aurl = resp.createActionURL(ALL);
       aurl.getRenderParameters().clear();
       urls.put(" 6 Clear all", aurl.toString());
       
-      aurl = resp.createActionURL(COPY_RENDER_PARAMETERS);
+      aurl = resp.createActionURL(ALL);
       mrp = aurl.getRenderParameters().clone();
       logger.fine("MRP from request # entries: " + mrp.size());
       
       {
-         aurl = resp.createActionURL(COPY_RENDER_PARAMETERS);
+         aurl = resp.createActionURL(ALL);
          MutableRenderParameters mrp2 = mrp.clone();
          mrp2.clearPrivate();
          logger.fine("MRP2 afer clearPrivate # entries: " + mrp2.size());
@@ -186,7 +186,7 @@ public class UrlAPTestPortlet extends GenericPortlet {
       }
       
       {
-         aurl = resp.createActionURL(COPY_RENDER_PARAMETERS);
+         aurl = resp.createActionURL(ALL);
          MutableRenderParameters mrp2 = mrp.clone();
          mrp2.clearPublic();
          logger.fine("MRP2 afer clearPublic # entries: " + mrp2.size());
@@ -195,7 +195,7 @@ public class UrlAPTestPortlet extends GenericPortlet {
       }
       
       {
-         aurl = resp.createActionURL(COPY_RENDER_PARAMETERS);
+         aurl = resp.createActionURL(ALL);
          MutableRenderParameters mrp2 = mrp.clone();
          mrp2.clear();
          logger.fine("MRP2 afer clear # entries: " + mrp2.size());
@@ -204,7 +204,7 @@ public class UrlAPTestPortlet extends GenericPortlet {
       }
       
       {
-         aurl = resp.createActionURL(COPY_RENDER_PARAMETERS);
+         aurl = resp.createActionURL(ALL);
          MutableRenderParameters mrp2 = mrp.clone();
          mrp2.clear();
          mrp2.setValue(name1, val1);
@@ -214,7 +214,7 @@ public class UrlAPTestPortlet extends GenericPortlet {
       }
       
       {
-         aurl = resp.createActionURL(COPY_RENDER_PARAMETERS);
+         aurl = resp.createActionURL(ALL);
          MutableRenderParameters mrp2 = mrp.clone();
          mrp2.clear();
          mrp2.setValue(name1, val1);
@@ -225,7 +225,7 @@ public class UrlAPTestPortlet extends GenericPortlet {
       }
       
       {
-         aurl = resp.createActionURL(COPY_RENDER_PARAMETERS);
+         aurl = resp.createActionURL(ALL);
          MutableRenderParameters mrp2 = mrp.clone();
          mrp2.clear();
          mrp2.setValue(name1, val1);
@@ -244,23 +244,23 @@ public class UrlAPTestPortlet extends GenericPortlet {
       urls = new TreeMap<String, String>();
       mrp = req.getRenderParameters().clone();
       
-      aurl = resp.createActionURL(COPY_RENDER_PARAMETERS);
+      aurl = resp.createActionURL(ALL);
       urls.put(" 1 No action parameters", aurl.toString());
       
-      aurl = resp.createActionURL(COPY_RENDER_PARAMETERS);
+      aurl = resp.createActionURL(ALL);
       aurl.getActionParameters().setValue(name1, val1);
       aurl.getActionParameters().setValues(name2, new String[]{val2});
       aurl.getActionParameters().clear();
       urls.put(" 2 set & clear action params", aurl.toString());
       
-      aurl = resp.createActionURL(COPY_RENDER_PARAMETERS);
+      aurl = resp.createActionURL(ALL);
       MutableActionParameters map = aurl.getActionParameters().clone();
       map.setValue(name3, val3);
       map.setValues(name1, new String[]{val1, val2});
       logger.fine("MAP from request # entries: " + map.size());
       
       {
-         aurl = resp.createActionURL(COPY_RENDER_PARAMETERS);
+         aurl = resp.createActionURL(ALL);
          MutableActionParameters map2 = map.clone();
          map2.clear();
          logger.fine("MAP2 afer clear # entries: " + map2.size());
@@ -269,7 +269,7 @@ public class UrlAPTestPortlet extends GenericPortlet {
       }
       
       {
-         aurl = resp.createActionURL(COPY_RENDER_PARAMETERS);
+         aurl = resp.createActionURL(ALL);
          MutableActionParameters map2 = map.clone();
          logger.fine("MAP2 afer adding 2: # entries: " + map2.size());
          aurl.getActionParameters().add(map2);
@@ -277,7 +277,7 @@ public class UrlAPTestPortlet extends GenericPortlet {
       }
       
       {
-         aurl = resp.createActionURL(COPY_RENDER_PARAMETERS);
+         aurl = resp.createActionURL(ALL);
          MutableActionParameters map2 = map.clone();
          map2.clear();
          map2.setValue(name1, val1);

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/PortletV3Demo/src/main/java/basic/portlet/UrlRPTestPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/UrlRPTestPortlet.java b/PortletV3Demo/src/main/java/basic/portlet/UrlRPTestPortlet.java
index 85e5e44..8985255 100644
--- a/PortletV3Demo/src/main/java/basic/portlet/UrlRPTestPortlet.java
+++ b/PortletV3Demo/src/main/java/basic/portlet/UrlRPTestPortlet.java
@@ -18,10 +18,21 @@
 
 package basic.portlet;
 
-import static basic.portlet.Constants.*;
+import static basic.portlet.Constants.ATTRIB_PARAMS;
+import static basic.portlet.Constants.ATTRIB_RENURLS;
+import static basic.portlet.Constants.PARAM_AURLCOPY;
+import static basic.portlet.Constants.PARAM_AURLCOPY_ALL;
+import static basic.portlet.Constants.PARAM_NAME;
+import static basic.portlet.Constants.PARAM_REMTYPE;
+import static basic.portlet.Constants.PARAM_REMTYPE_REM;
+import static basic.portlet.Constants.PARAM_REMTYPE_SET;
+import static basic.portlet.Constants.PARAM_SETTYPE;
+import static basic.portlet.Constants.PARAM_SETTYPE_VARRAY;
+import static basic.portlet.Constants.PARAM_VALUES;
+import static javax.portlet.MimeResponse.Copy.ALL;
+import static javax.portlet.MimeResponse.Copy.NONE;
 
 import java.io.IOException;
-import java.io.PrintWriter;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Enumeration;
@@ -35,9 +46,6 @@ import javax.portlet.ActionParameters;
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
 import javax.portlet.GenericPortlet;
-
-import static javax.portlet.MimeResponse.ParameterCopyOption.*;
-
 import javax.portlet.MutableRenderParameters;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequestDispatcher;
@@ -45,11 +53,8 @@ import javax.portlet.RenderParameters;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 import javax.portlet.RenderURL;
-import javax.portlet.ResourceParameters;
 import javax.portlet.ResourceRequest;
 import javax.portlet.ResourceResponse;
-import javax.portlet.ResourceURL;
-import static javax.portlet.ResourceURL.*;
 
 
 /**
@@ -151,36 +156,36 @@ public class UrlRPTestPortlet extends GenericPortlet {
       TreeMap<String, String> urls = new TreeMap<String, String>();
       MutableRenderParameters mrp = req.getRenderParameters().clone();
       
-      RenderURL rurl = resp.createRenderURL(COPY_NO_PARAMETERS);
+      RenderURL rurl = resp.createRenderURL(NONE);
       urls.put(" 1 No render parameters", rurl.toString());
 
-      rurl = resp.createRenderURL(COPY_NO_PARAMETERS);
+      rurl = resp.createRenderURL(NONE);
       rurl.getRenderParameters().set(mrp);
       urls.put(" 2 Copy with req clone", rurl.toString());
 
-      rurl = resp.createRenderURL(COPY_NO_PARAMETERS);
+      rurl = resp.createRenderURL(NONE);
       mrp.setValue(name1, val1);
       rurl.getRenderParameters().set(mrp);
       urls.put(" 3 Copy with req clone, 1 addl", rurl.toString());
       
-      rurl = resp.createRenderURL(COPY_RENDER_PARAMETERS);
+      rurl = resp.createRenderURL(ALL);
       rurl.getRenderParameters().clearPrivate();
       urls.put(" 4 Clear private", rurl.toString());
       
-      rurl = resp.createRenderURL(COPY_RENDER_PARAMETERS);
+      rurl = resp.createRenderURL(ALL);
       rurl.getRenderParameters().clearPublic();;
       urls.put(" 5 Clear public", rurl.toString());
       
-      rurl = resp.createRenderURL(COPY_RENDER_PARAMETERS);
+      rurl = resp.createRenderURL(ALL);
       rurl.getRenderParameters().clear();
       urls.put(" 6 Clear all", rurl.toString());
       
-      rurl = resp.createRenderURL(COPY_RENDER_PARAMETERS);
+      rurl = resp.createRenderURL(ALL);
       mrp = rurl.getRenderParameters().clone();
       logger.fine("MRP from request # entries: " + mrp.getNames().size());
       
       {
-         rurl = resp.createRenderURL(COPY_RENDER_PARAMETERS);
+         rurl = resp.createRenderURL(ALL);
          MutableRenderParameters mrp2 = mrp.clone();
          mrp2.clearPrivate();
          logger.fine("MRP2 afer clearPrivate # entries: " + mrp2.getNames().size());
@@ -189,7 +194,7 @@ public class UrlRPTestPortlet extends GenericPortlet {
       }
       
       {
-         rurl = resp.createRenderURL(COPY_RENDER_PARAMETERS);
+         rurl = resp.createRenderURL(ALL);
          MutableRenderParameters mrp2 = mrp.clone();
          mrp2.clearPublic();
          logger.fine("MRP2 afer clearPublic # entries: " + mrp2.getNames().size());
@@ -198,7 +203,7 @@ public class UrlRPTestPortlet extends GenericPortlet {
       }
       
       {
-         rurl = resp.createRenderURL(COPY_RENDER_PARAMETERS);
+         rurl = resp.createRenderURL(ALL);
          MutableRenderParameters mrp2 = mrp.clone();
          mrp2.clear();
          logger.fine("MRP2 afer clear # entries: " + mrp2.getNames().size());
@@ -207,7 +212,7 @@ public class UrlRPTestPortlet extends GenericPortlet {
       }
       
       {
-         rurl = resp.createRenderURL(COPY_RENDER_PARAMETERS);
+         rurl = resp.createRenderURL(ALL);
          MutableRenderParameters mrp2 = mrp.clone();
          mrp2.clear();
          mrp2.setValue(name1, val1);
@@ -217,7 +222,7 @@ public class UrlRPTestPortlet extends GenericPortlet {
       }
       
       {
-         rurl = resp.createRenderURL(COPY_RENDER_PARAMETERS);
+         rurl = resp.createRenderURL(ALL);
          MutableRenderParameters mrp2 = mrp.clone();
          mrp2.clear();
          mrp2.setValue(name1, val1);
@@ -228,7 +233,7 @@ public class UrlRPTestPortlet extends GenericPortlet {
       }
       
       {
-         rurl = resp.createRenderURL(COPY_RENDER_PARAMETERS);
+         rurl = resp.createRenderURL(ALL);
          MutableRenderParameters mrp2 = mrp.clone();
          mrp2.clear();
          mrp2.setValue(name1, val1);

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/PortletV3Demo/src/main/java/basic/portlet/UrlTestPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/UrlTestPortlet.java b/PortletV3Demo/src/main/java/basic/portlet/UrlTestPortlet.java
index 82e1b3e..8e62c51 100644
--- a/PortletV3Demo/src/main/java/basic/portlet/UrlTestPortlet.java
+++ b/PortletV3Demo/src/main/java/basic/portlet/UrlTestPortlet.java
@@ -36,7 +36,7 @@ import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
 import javax.portlet.GenericPortlet;
 
-import static javax.portlet.MimeResponse.ParameterCopyOption.*;
+import static javax.portlet.MimeResponse.Copy.*;
 
 import javax.portlet.MutableRenderParameters;
 import javax.portlet.PortletException;
@@ -144,26 +144,26 @@ public class UrlTestPortlet extends GenericPortlet {
       
       TreeMap<String, String> urls = new TreeMap<String, String>();
       
-      RenderURL rurl = resp.createRenderURL(COPY_NO_PARAMETERS);
+      RenderURL rurl = resp.createRenderURL(NONE);
       urls.put(" 1 Copy no params, 0 new", rurl.toString());
 
-      rurl = resp.createRenderURL(COPY_PUBLIC_RENDER_PARAMETERS);
+      rurl = resp.createRenderURL(PUBLIC);
       urls.put(" 2 Copy public params, 0 new", rurl.toString());
       
-      rurl = resp.createRenderURL(COPY_RENDER_PARAMETERS);
+      rurl = resp.createRenderURL(ALL);
       urls.put(" 3 Copy all params, 0 new", rurl.toString());
       
-      rurl = resp.createRenderURL(COPY_NO_PARAMETERS);
+      rurl = resp.createRenderURL(NONE);
       rurl.getRenderParameters().setValue(name1, val1);
       rurl.getRenderParameters().setValue(name2, val2);
       urls.put(" 4 Copy no params, 2 new", rurl.toString());
 
-      rurl = resp.createRenderURL(COPY_PUBLIC_RENDER_PARAMETERS);
+      rurl = resp.createRenderURL(PUBLIC);
       rurl.getRenderParameters().setValue(name1, val1);
       rurl.getRenderParameters().setValue(name2, val2);
       urls.put(" 5 Copy public params, 2 new", rurl.toString());
       
-      rurl = resp.createRenderURL(COPY_RENDER_PARAMETERS);
+      rurl = resp.createRenderURL(ALL);
       rurl.getRenderParameters().setValue(name1, val1);
       rurl.getRenderParameters().setValue(name2, val2);
       urls.put(" 6 Copy all params, 2 new", rurl.toString());

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-ascp.jsp
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-ascp.jsp b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-ascp.jsp
index ba4c3af..8c2a458 100644
--- a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-ascp.jsp
+++ b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-ascp.jsp
@@ -20,8 +20,8 @@ limitations under the License.
 <%@ taglib uri="http://xmlns.jcp.org/portlet_3_0"  prefix="portlet" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ page import="java.io.*,java.util.*,javax.portlet.*" %>
-<%@ page import="javax.portlet.MimeResponse.ParameterCopyOption" %>
-<%@ page import="static javax.portlet.MimeResponse.ParameterCopyOption.*" %>
+<%@ page import="javax.portlet.MimeResponse.Copy" %>
+<%@ page import="static javax.portlet.MimeResponse.Copy.*" %>
 <%@ page import="static basic.portlet.Constants.*" %>
 
 <portlet:defineObjects />
@@ -56,7 +56,7 @@ and other URLs that are marked as authenticated.</p>
       out.println("'>Resource URL, status code = " + sc + "</a></p>");
    }
    
-   RenderURL renurl = renderResponse.createRenderURL(COPY_RENDER_PARAMETERS);
+   RenderURL renurl = renderResponse.createRenderURL(ALL);
    renurl.setAuthenticated(true);
    out.print("<p><a href='");
    out.print(renurl.toString());
@@ -68,7 +68,7 @@ and other URLs that are marked as authenticated.</p>
    out.print(resurl.toString());
    out.println("'>Resource URL with setAuthenticated(true)</a></p>");
    
-   ActionURL acturl = renderResponse.createActionURL(COPY_RENDER_PARAMETERS);
+   ActionURL acturl = renderResponse.createActionURL(ALL);
    acturl.setAuthenticated(true);
    StringBuilder txt = new StringBuilder();
    txt.append("<form  METHOD='POST' ACTION='").append(acturl.toString()).append("'>")

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-long.jsp
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-long.jsp b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-long.jsp
index 18036fd..e12f0b2 100644
--- a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-long.jsp
+++ b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-long.jsp
@@ -20,8 +20,8 @@ limitations under the License.
 <%@ taglib uri="http://xmlns.jcp.org/portlet_3_0"  prefix="portlet" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ page import="java.io.*,java.util.*,javax.portlet.*" %>
-<%@ page import="javax.portlet.MimeResponse.ParameterCopyOption" %>
-<%@ page import="static javax.portlet.MimeResponse.ParameterCopyOption.*" %>
+<%@ page import="javax.portlet.MimeResponse.Copy" %>
+<%@ page import="static javax.portlet.MimeResponse.Copy.*" %>
 <%@ page import="static basic.portlet.Constants.*" %>
 
 <portlet:defineObjects />
@@ -56,7 +56,7 @@ limitations under the License.
       if (lineNum > lines.size()) {
          lineNum = lines.size();
       }
-      RenderURL rurl = renderResponse.createRenderURL(COPY_RENDER_PARAMETERS);
+      RenderURL rurl = renderResponse.createRenderURL(ALL);
       rurl.setFragmentIdentifier(frag);
       out.print("<p><a href='");
       out.print(rurl.toString());

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-ptp.jsp
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-ptp.jsp b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-ptp.jsp
index 9c1ee22..43152f7 100644
--- a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-ptp.jsp
+++ b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-ptp.jsp
@@ -21,7 +21,7 @@ limitations under the License.
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ page import="java.io.*,java.util.*,javax.portlet.*" %>
 <%@ page import="static basic.portlet.Constants.*" %>
-<%@ page import="static javax.portlet.MimeResponse.ParameterCopyOption.*" %>
+<%@ page import="static javax.portlet.MimeResponse.Copy.*" %>
 
 <portlet:defineObjects />
 
@@ -52,7 +52,7 @@ Leaving the value field empty will set the parameter to an array containing a si
 <p><%=prpStr.toString() %></p>
 <p><hr/></p>
 <%
-   ActionURL aurl = renderResponse.createActionURL(COPY_RENDER_PARAMETERS);
+   ActionURL aurl = renderResponse.createActionURL(ALL);
 %>
 <FORM id='<portlet:namespace/>-setParams' METHOD='POST' ACTION='<%=aurl.toString() %>' enctype='application/x-www-form-urlencoded' accept-charset='UTF-8'>
    <table><tr><td align='left'>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-uaptp.jsp
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-uaptp.jsp b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-uaptp.jsp
index 56a841b..ee621d1 100644
--- a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-uaptp.jsp
+++ b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-uaptp.jsp
@@ -20,8 +20,8 @@ limitations under the License.
 <%@ taglib uri="http://xmlns.jcp.org/portlet_3_0"  prefix="portlet" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ page import="java.io.*,java.util.*,javax.portlet.*" %>
-<%@ page import="javax.portlet.MimeResponse.ParameterCopyOption" %>
-<%@ page import="static javax.portlet.MimeResponse.ParameterCopyOption.*" %>
+<%@ page import="javax.portlet.MimeResponse.Copy" %>
+<%@ page import="static javax.portlet.MimeResponse.Copy.*" %>
 <%@ page import="static basic.portlet.Constants.*" %>
 
 <portlet:defineObjects />
@@ -35,13 +35,13 @@ limitations under the License.
 
    String aurlCopy = renderRequest.getRenderParameters().getValue(PARAM_AURLCOPY);
    aurlCopy = (aurlCopy == null) ? PARAM_AURLCOPY_ALL : aurlCopy;
-   ParameterCopyOption pco = COPY_NO_PARAMETERS;
+   Copy pco = NONE;
    String acText = "Copy no parameters";
    if (aurlCopy.equals(PARAM_AURLCOPY_ALL)) {
-      pco = COPY_RENDER_PARAMETERS;
+      pco = ALL;
       acText = "Copy render parameters";
    } else if (aurlCopy.equals(PARAM_AURLCOPY_PUBLIC)) {
-      pco = COPY_PUBLIC_RENDER_PARAMETERS;
+      pco = PUBLIC;
       acText = "Copy public parameters";
    }
    ActionURL aurl = renderResponse.createActionURL(pco);

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-urptp.jsp
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-urptp.jsp b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-urptp.jsp
index 615c38d..a02ce0e 100644
--- a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-urptp.jsp
+++ b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-urptp.jsp
@@ -20,8 +20,8 @@ limitations under the License.
 <%@ taglib uri="http://xmlns.jcp.org/portlet_3_0"  prefix="portlet" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ page import="java.io.*,java.util.*,javax.portlet.*" %>
-<%@ page import="javax.portlet.MimeResponse.ParameterCopyOption" %>
-<%@ page import="static javax.portlet.MimeResponse.ParameterCopyOption.*" %>
+<%@ page import="javax.portlet.MimeResponse.Copy" %>
+<%@ page import="static javax.portlet.MimeResponse.Copy.*" %>
 <%@ page import="static basic.portlet.Constants.*" %>
 
 <portlet:defineObjects />
@@ -35,13 +35,13 @@ limitations under the License.
 
    String aurlCopy = renderRequest.getRenderParameters().getValue(PARAM_AURLCOPY);
    aurlCopy = (aurlCopy == null) ? PARAM_AURLCOPY_ALL : aurlCopy;
-   ParameterCopyOption pco = COPY_NO_PARAMETERS;
+   Copy pco = NONE;
    String acText = "Copy no parameters";
    if (aurlCopy.equals(PARAM_AURLCOPY_ALL)) {
-      pco = COPY_RENDER_PARAMETERS;
+      pco = ALL;
       acText = "Copy render parameters";
    } else if (aurlCopy.equals(PARAM_AURLCOPY_PUBLIC)) {
-      pco = COPY_PUBLIC_RENDER_PARAMETERS;
+      pco = PUBLIC;
       acText = "Copy public parameters";
    }
    ActionURL aurl = renderResponse.createActionURL(pco);

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-utp.jsp
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-utp.jsp b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-utp.jsp
index fa8865d..02fd60b 100644
--- a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-utp.jsp
+++ b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-utp.jsp
@@ -20,8 +20,8 @@ limitations under the License.
 <%@ taglib uri="http://xmlns.jcp.org/portlet_3_0"  prefix="portlet" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ page import="java.io.*,java.util.*,javax.portlet.*" %>
-<%@ page import="javax.portlet.MimeResponse.ParameterCopyOption" %>
-<%@ page import="static javax.portlet.MimeResponse.ParameterCopyOption.*" %>
+<%@ page import="javax.portlet.MimeResponse.Copy" %>
+<%@ page import="static javax.portlet.MimeResponse.Copy.*" %>
 <%@ page import="static basic.portlet.Constants.*" %>
 
 <portlet:defineObjects />
@@ -35,13 +35,13 @@ limitations under the License.
 
    String aurlCopy = renderRequest.getRenderParameters().getValue(PARAM_AURLCOPY);
    aurlCopy = (aurlCopy == null) ? PARAM_AURLCOPY_ALL : aurlCopy;
-   ParameterCopyOption pco = COPY_NO_PARAMETERS;
+   Copy pco = NONE;
    String acText = "Copy no parameters";
    if (aurlCopy.equals(PARAM_AURLCOPY_ALL)) {
-      pco = COPY_RENDER_PARAMETERS;
+      pco = ALL;
       acText = "Copy render parameters";
    } else if (aurlCopy.equals(PARAM_AURLCOPY_PUBLIC)) {
-      pco = COPY_PUBLIC_RENDER_PARAMETERS;
+      pco = PUBLIC;
       acText = "Copy public parameters";
    }
    ActionURL aurl = renderResponse.createActionURL(pco);

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet3.java
----------------------------------------------------------------------
diff --git a/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet3.java b/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet3.java
index 5f1f013..804f316 100644
--- a/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet3.java
+++ b/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet3.java
@@ -47,6 +47,7 @@ import org.apache.pluto.container.FilterManager;
 import org.apache.pluto.container.PortletContainerException;
 import org.apache.pluto.container.PortletInvokerService;
 import org.apache.pluto.container.PortletRequestContext;
+import org.apache.pluto.container.PortletResourceRequestContext;
 import org.apache.pluto.container.PortletResponseContext;
 import org.apache.pluto.container.PortletWindow;
 import org.apache.pluto.container.om.portlet.PortletDefinition;
@@ -352,6 +353,15 @@ public class PortletServlet3 extends HttpServlet
             else if (methodId == PortletInvokerService.METHOD_RESOURCE)
             {
                 ResourceRequest resourceRequest = (ResourceRequest) portletRequest;
+
+                // if pageState != null, we're dealing with a Partial Action request, so
+                // store the page state string as a request attribute
+                PortletResourceRequestContext rc = (PortletResourceRequestContext) requestContext;
+                String ps = rc.getPageState();
+                if (ps != null) {
+                   resourceRequest.setAttribute(ResourceRequest.PAGE_STATE, ps);
+                }
+
                 ResourceResponse resourceResponse = (ResourceResponse) portletResponse;
                 filterManager.processFilter(resourceRequest, resourceResponse,
                         resourceServingPortlet, portletContext);

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/pluto-container/src/main/java/org/apache/pluto/container/impl/ActionResponseImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/ActionResponseImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/ActionResponseImpl.java
index b8ad5ba..a43e309 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/ActionResponseImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/ActionResponseImpl.java
@@ -1,98 +1,107 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.impl;
-
-import java.io.IOException;
-
-import javax.portlet.ActionResponse;
-
-import org.apache.pluto.container.PortletActionResponseContext;
-import org.apache.pluto.container.ResourceURLProvider;
-import org.apache.pluto.container.util.ArgumentUtility;
-
-public class ActionResponseImpl extends StateAwareResponseImpl implements ActionResponse
-{
-    private boolean stateChanged;
-    protected boolean redirected;
-    
-    public ActionResponseImpl(PortletActionResponseContext responseContext)
-    {
-        super(responseContext);
-    }
-
-    protected void checkSetRedirected()
-    {
-        if (stateChanged)
-        {
-            throw new IllegalStateException("sendRedirect no longer allowed after navigational state changes");
-        }
-        if (redirected)
-        {
-            throw new IllegalStateException("sendRedirect already called");
-        }
-        redirected = true;
-    }
-    
-    protected void checkSetStateChanged()
-    {
-        if (redirected)
-        {
-            throw new IllegalStateException("State change no longer allowed after a sendRedirect");
-        }
-        stateChanged = true;
-    }
-    
-    protected String getRedirectLocation(String location)
-    {
-        ArgumentUtility.validateNotEmpty("location", location);
-        ResourceURLProvider provider = getResponseContext().getResourceURLProvider();
-
-        if (location.indexOf("://") != -1)
-        {
-            provider.setAbsoluteURL(location);
-        } 
-        else 
-        {
-            provider.setFullPath(location);
-        }
-        location = getServletResponse().encodeRedirectURL(provider.toString());
-        if (location.indexOf("/") == -1)
-        {
-            throw new IllegalArgumentException("There is a relative path given, an IllegalArgumentException must be thrown.");
-        }
-        return location;
-    }
-    
-    public void sendRedirect(String location) throws IOException
-    {
-        location = getRedirectLocation(location);
-        checkSetRedirected();
-        ((PortletActionResponseContext)getResponseContext()).setRedirect(location);
-    }
-    
-	public void sendRedirect(String location, String renderUrlParamName) throws IOException 
-	{
-        ArgumentUtility.validateNotEmpty("renderUrlParamName", renderUrlParamName);
-        location = getRedirectLocation(location);
-        if (!redirected)
-        {
-            stateChanged = false;
-        }
-        checkSetRedirected();
-        ((PortletActionResponseContext)getResponseContext()).setRedirect(location, renderUrlParamName);
-	}
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.container.impl;
+
+import java.io.IOException;
+
+import javax.portlet.ActionResponse;
+import javax.portlet.MimeResponse.Copy;
+import javax.portlet.RenderURL;
+
+import org.apache.pluto.container.PortletActionResponseContext;
+import org.apache.pluto.container.ResourceURLProvider;
+import org.apache.pluto.container.util.ArgumentUtility;
+
+public class ActionResponseImpl extends StateAwareResponseImpl implements ActionResponse
+{
+    private boolean stateChanged;
+    protected boolean redirected;
+    
+    public ActionResponseImpl(PortletActionResponseContext responseContext)
+    {
+        super(responseContext);
+    }
+
+    protected void checkSetRedirected()
+    {
+        if (stateChanged)
+        {
+            throw new IllegalStateException("sendRedirect no longer allowed after navigational state changes");
+        }
+        if (redirected)
+        {
+            throw new IllegalStateException("sendRedirect already called");
+        }
+        redirected = true;
+    }
+    
+    protected void checkSetStateChanged()
+    {
+        if (redirected)
+        {
+            throw new IllegalStateException("State change no longer allowed after a sendRedirect");
+        }
+        stateChanged = true;
+    }
+    
+    protected String getRedirectLocation(String location)
+    {
+        ArgumentUtility.validateNotEmpty("location", location);
+        ResourceURLProvider provider = getResponseContext().getResourceURLProvider();
+
+        if (location.indexOf("://") != -1)
+        {
+            provider.setAbsoluteURL(location);
+        } 
+        else 
+        {
+            provider.setFullPath(location);
+        }
+        location = getServletResponse().encodeRedirectURL(provider.toString());
+        if (location.indexOf("/") == -1)
+        {
+            throw new IllegalArgumentException("There is a relative path given, an IllegalArgumentException must be thrown.");
+        }
+        return location;
+    }
+    
+    public void sendRedirect(String location) throws IOException
+    {
+        location = getRedirectLocation(location);
+        checkSetRedirected();
+        ((PortletActionResponseContext)getResponseContext()).setRedirect(location);
+    }
+    
+	public void sendRedirect(String location, String renderUrlParamName) throws IOException 
+	{
+        ArgumentUtility.validateNotEmpty("renderUrlParamName", renderUrlParamName);
+        location = getRedirectLocation(location);
+        if (!redirected)
+        {
+            stateChanged = false;
+        }
+        checkSetRedirected();
+        ((PortletActionResponseContext)getResponseContext()).setRedirect(location, renderUrlParamName);
+	}
+
+   @Override
+   public RenderURL getRedirectURL(Copy option) throws IllegalStateException {
+      // TODO: implement
+      //return new RenderURLImpl(responseContext, option);
+      return null;
+   }
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/pluto-container/src/main/java/org/apache/pluto/container/impl/ActionURLImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/ActionURLImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/ActionURLImpl.java
index 61923b5..6c9f6fd 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/ActionURLImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/ActionURLImpl.java
@@ -1,7 +1,7 @@
 package org.apache.pluto.container.impl;
 
 import javax.portlet.ActionURL;
-import javax.portlet.MimeResponse.ParameterCopyOption;
+import javax.portlet.MimeResponse.Copy;
 import javax.portlet.MutableActionParameters;
 
 import org.apache.pluto.container.PortletMimeResponseContext;
@@ -35,7 +35,7 @@ public class ActionURLImpl extends PortletURLImpl implements ActionURL {
     * @param responseContext
     * @param urlProvider
     */
-   public ActionURLImpl(PortletMimeResponseContext responseContext, ParameterCopyOption copy) {
+   public ActionURLImpl(PortletMimeResponseContext responseContext, Copy copy) {
       super(responseContext, 
             responseContext.getPortletURLProvider(PortletURLProvider.TYPE.ACTION), copy);
    }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/pluto-container/src/main/java/org/apache/pluto/container/impl/BaseURLImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/BaseURLImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/BaseURLImpl.java
index a5496ef..b1e2b89 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/BaseURLImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/BaseURLImpl.java
@@ -29,7 +29,7 @@ import java.util.Set;
 
 import javax.portlet.ActionURL;
 import javax.portlet.BaseURL;
-import javax.portlet.MimeResponse.ParameterCopyOption;
+import javax.portlet.MimeResponse.Copy;
 import javax.portlet.PortalContext;
 import javax.portlet.PortletMode;
 import javax.portlet.PortletSecurityException;
@@ -83,16 +83,16 @@ public abstract class BaseURLImpl implements BaseURL {
    }
 
    public BaseURLImpl(PortletMimeResponseContext responseContext,
-         PortletURLProvider portletURLProvider, ParameterCopyOption copy) {
+         PortletURLProvider portletURLProvider, Copy copy) {
       this(responseContext, portletURLProvider);
       
       switch (copy) {
-      case COPY_NO_PARAMETERS:
+      case NONE:
          urlProvider.clearParameters(windowId, PortletURLProvider.ParamType.PUBLIC);
-      case COPY_PUBLIC_RENDER_PARAMETERS:
+      case PUBLIC:
          urlProvider.clearParameters(windowId, PortletURLProvider.ParamType.RENDER);
          break;
-      case COPY_RENDER_PARAMETERS:
+      case ALL:
       }
    }
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/pluto-container/src/main/java/org/apache/pluto/container/impl/MimeResponseImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/MimeResponseImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/MimeResponseImpl.java
index 1b688ac..8958cf9 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/MimeResponseImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/MimeResponseImpl.java
@@ -26,7 +26,7 @@ import java.util.Locale;
 import javax.portlet.CacheControl;
 import javax.portlet.MimeResponse;
 
-import static javax.portlet.MimeResponse.ParameterCopyOption.*;
+import static javax.portlet.MimeResponse.Copy.*;
 
 import javax.portlet.RenderURL;
 import javax.portlet.ActionURL;
@@ -75,19 +75,19 @@ public class MimeResponseImpl extends PortletResponseImpl implements
 
    @SuppressWarnings("unchecked")
    public ActionURL createActionURL() {
-      return new ActionURLImpl(responseContext, COPY_PUBLIC_RENDER_PARAMETERS);
+      return new ActionURLImpl(responseContext, PUBLIC);
    }
 
    @SuppressWarnings("unchecked")
    public RenderURL createRenderURL() {
-      return new RenderURLImpl(responseContext, COPY_PUBLIC_RENDER_PARAMETERS);
+      return new RenderURLImpl(responseContext, PUBLIC);
    }
 
-   public ActionURL createActionURL(ParameterCopyOption option) {
+   public ActionURL createActionURL(Copy option) {
       return new ActionURLImpl(responseContext, option);
    }
 
-   public RenderURL createRenderURL(ParameterCopyOption option) {
+   public RenderURL createRenderURL(Copy option) {
       return new RenderURLImpl(responseContext, option);
    }
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletURLImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletURLImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletURLImpl.java
index 5b5a25f..ed76761 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletURLImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletURLImpl.java
@@ -21,13 +21,14 @@ import java.util.Enumeration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.portlet.MimeResponse.ParameterCopyOption;
+import javax.portlet.MimeResponse.Copy;
 import javax.portlet.MutableRenderParameters;
 import javax.portlet.PortletMode;
 import javax.portlet.PortletModeException;
 import javax.portlet.PortletURL;
 import javax.portlet.WindowState;
 import javax.portlet.WindowStateException;
+import javax.portlet.annotations.PortletSerializable;
 
 import org.apache.pluto.container.PortletMimeResponseContext;
 import org.apache.pluto.container.PortletResponseContext;
@@ -37,6 +38,7 @@ import org.apache.pluto.container.om.portlet.PortletDefinition;
 import org.apache.pluto.container.om.portlet.Supports;
 import org.apache.pluto.container.util.ArgumentUtility;
 
+
 /**
  * Refactoring to implement class hierarchy among various URL types
  * 
@@ -61,7 +63,7 @@ public abstract class PortletURLImpl extends BaseURLImpl implements PortletURL {
    }
 
    public PortletURLImpl(PortletMimeResponseContext responseContext,
-         PortletURLProvider portletURLProvider, ParameterCopyOption copy) {
+         PortletURLProvider portletURLProvider, Copy copy) {
       super(responseContext, portletURLProvider, copy);
    }
 
@@ -146,4 +148,32 @@ public abstract class PortletURLImpl extends BaseURLImpl implements PortletURL {
    public MutableRenderParameters getRenderParameters() {
       return new MutableRenderParametersImpl(urlProvider, windowId);
    }
+   
+   @SuppressWarnings("unused")
+   @Override
+   public void setBeanParameter(PortletSerializable bean) {
+      if (bean == null) {
+         StringBuilder txt = new StringBuilder(128);
+         txt.append("Required parameter is null.");
+         txt.append(", bean: ").append(bean);
+         LOGGER.info(txt.toString());
+         throw new IllegalArgumentException(txt.toString());
+      }
+      
+      // TODO: must be fixed when the bean implementation is integrated!!
+      String name = "Bob";
+      //String name = PortletStateScopedBeanHolder.getParameterName(bean.getClass());
+      
+      if (name == null) {
+         StringBuilder txt = new StringBuilder(128);
+         txt.append("Given bean is not @PortletStateScoped.");
+         txt.append(", bean: ").append(bean);
+         LOGGER.info(txt.toString());
+         throw new IllegalArgumentException(txt.toString());
+      }
+      
+      getRenderParameters().setValues(name, bean.serialize());
+      
+   }
+
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/pluto-container/src/main/java/org/apache/pluto/container/impl/RenderURLImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/RenderURLImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/RenderURLImpl.java
index 9ddd985..6f99cec 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/RenderURLImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/RenderURLImpl.java
@@ -19,7 +19,7 @@
 
 package org.apache.pluto.container.impl;
 
-import javax.portlet.MimeResponse.ParameterCopyOption;
+import javax.portlet.MimeResponse.Copy;
 import javax.portlet.RenderURL;
 
 import org.apache.pluto.container.PortletMimeResponseContext;
@@ -37,7 +37,7 @@ public class RenderURLImpl extends PortletURLImpl implements RenderURL {
     * @param copy 
     * @param urlProvider
     */
-   public RenderURLImpl(PortletMimeResponseContext responseContext, ParameterCopyOption copy) {
+   public RenderURLImpl(PortletMimeResponseContext responseContext, Copy copy) {
       super(responseContext,
             responseContext.getPortletURLProvider(PortletURLProvider.TYPE.RENDER), copy);
    }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/pluto-container/src/main/java/org/apache/pluto/container/impl/ResourceRequestImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/ResourceRequestImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/ResourceRequestImpl.java
index c75691b..e09ce3a 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/ResourceRequestImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/ResourceRequestImpl.java
@@ -81,18 +81,6 @@ public class ResourceRequestImpl extends ClientDataRequestImpl implements Resour
     {
         return getServletRequest().getHeaders("accept");
     }
-
-   /* (non-Javadoc)
-    * @see javax.portlet.ResourceRequest#getPageState()
-    */
-   public String getPageState() {
-      // The page state is provided through the request context.
-      String ps = requestContext.getPageState();
-      if (LOG.isDebugEnabled()) {
-         LOG.debug("ResourceRequest#getPageState called.");
-      }
-      return ps;
-   }
    
    // Debug code - intercept getParameter call & dump all parameters to trace
    @Override

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/pluto-container/src/main/java/org/apache/pluto/container/impl/ResourceResponseImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/ResourceResponseImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/ResourceResponseImpl.java
index ddc13d7..aba15c6 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/ResourceResponseImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/ResourceResponseImpl.java
@@ -16,7 +16,7 @@
  */
 package org.apache.pluto.container.impl;
 
-import static javax.portlet.MimeResponse.ParameterCopyOption.COPY_PUBLIC_RENDER_PARAMETERS;
+import static javax.portlet.MimeResponse.Copy.PUBLIC;
 
 import java.io.IOException;
 import java.io.PrintWriter;
@@ -28,8 +28,6 @@ import javax.portlet.ResourceResponse;
 import javax.portlet.ResourceURL;
 
 import org.apache.pluto.container.PortletResourceResponseContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public class ResourceResponseImpl extends MimeResponseImpl implements ResourceResponse
 {
@@ -49,7 +47,7 @@ public class ResourceResponseImpl extends MimeResponseImpl implements ResourceRe
     }
 	
     @Override
-    public ActionURL createActionURL(ParameterCopyOption option) {
+    public ActionURL createActionURL(Copy option) {
        if (ResourceURL.PAGE.equals(requestCacheLevel)) {
           return new ActionURLImpl(responseContext, option);
        } else {
@@ -58,7 +56,7 @@ public class ResourceResponseImpl extends MimeResponseImpl implements ResourceRe
     }
 
     @Override
-    public RenderURL createRenderURL(ParameterCopyOption option) {
+    public RenderURL createRenderURL(Copy option) {
        if (ResourceURL.PAGE.equals(requestCacheLevel)) {
           return new RenderURLImpl(responseContext, option);
        } else {
@@ -66,22 +64,24 @@ public class ResourceResponseImpl extends MimeResponseImpl implements ResourceRe
        }
     }
    
-    @Override
+    @SuppressWarnings("unchecked")
+   @Override
     public ActionURL createActionURL()
     {
         if (ResourceURL.PAGE.equals(requestCacheLevel))
         {
-            return new ActionURLImpl(responseContext, COPY_PUBLIC_RENDER_PARAMETERS);
+            return new ActionURLImpl(responseContext, PUBLIC);
         }
         throw new IllegalStateException("Not allowed to create an ActionURL with current request cacheability level "+requestCacheLevel);
     }
     
-    @Override
+    @SuppressWarnings("unchecked")
+   @Override
     public RenderURL createRenderURL()
     {
         if (ResourceURL.PAGE.equals(requestCacheLevel))
         {
-            return new RenderURLImpl(responseContext, COPY_PUBLIC_RENDER_PARAMETERS);
+            return new RenderURLImpl(responseContext, PUBLIC);
         }
         throw new IllegalStateException("Not allowed to create a RenderURL with current request cacheability level "+requestCacheLevel);
     }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index debae93..3b22b0e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -356,9 +356,14 @@ TODO: Check if we need all of them. -->
       
       <!-- CDI Library -->
       <dependency>
+         <groupId>javax.enterprise</groupId>
+         <artifactId>cdi-api</artifactId>
+         <version>1.2</version>
+      </dependency>
+      <dependency>
           <groupId>org.jboss.weld.servlet</groupId>
           <artifactId>weld-servlet</artifactId>
-          <version>${}</version>
+          <version>${cdi.version}</version>
       </dependency>      
 
       <!--  CCPP Libraries -->
@@ -543,6 +548,7 @@ TODO: Check if we need all of them. -->
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId>
+          <version>3.1</version>
           <configuration>
             <source>1.7</source>
             <target>1.7</target>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/pom.xml
----------------------------------------------------------------------
diff --git a/portlet-api/pom.xml b/portlet-api/pom.xml
index 647c050..ef6f28a 100644
--- a/portlet-api/pom.xml
+++ b/portlet-api/pom.xml
@@ -1,98 +1,91 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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
+<!-- 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. $Id: pom.xml 
+   774158 2009-05-13 00:42:04Z ate $ -->
 
-   http://www.apache.org/licenses/LICENSE-2.0
+<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"
+>
 
-  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.
-  
-  $Id: pom.xml 774158 2009-05-13 00:42:04Z ate $
--->
+   <modelVersion>4.0.0</modelVersion>
 
-<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">
+   <parent>
+      <groupId>org.apache.portals.pluto</groupId>
+      <artifactId>pluto</artifactId>
+      <version>3.0-SNAPSHOT</version>
+   </parent>
 
-  <modelVersion>4.0.0</modelVersion>
+   <artifactId>portlet-api</artifactId>
+   <packaging>bundle</packaging>
+   <name>Java Portlet API V3.0</name>
+   <description>The Java Portlet API version 3.0 developed by the Java Community Process JSR-362 Expert Group.</description>
 
-  <parent>
-    <groupId>org.apache.portals.pluto</groupId>
-    <artifactId>pluto</artifactId>
-    <version>3.0-SNAPSHOT</version>
-  </parent>
+   <!-- temp values for URL & scm stuff. to be updated later -->
+   <url>http://msnicklous.github.io/portletspec3/apidocs/index.html</url>
 
-  <artifactId>portlet-api</artifactId>
-  <packaging>bundle</packaging>
-  <name>Java Portlet API V3.0</name>
-  <description>The Java Portlet API version 3.0 developed by the Java Community Process JSR-362 Expert Group.</description>
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.tomcat</groupId>
+         <artifactId>tomcat-servlet-api</artifactId>
+         <scope>provided</scope>
+      </dependency>
+      <dependency>
+         <groupId>javax.enterprise</groupId>
+         <artifactId>cdi-api</artifactId>
+      </dependency>
+   </dependencies>
 
-  <!-- temp values for URL & scm stuff. to be updated later -->
-  <url>http://msnicklous.github.io/portletspec3/apidocs/index.html</url>
+   <scm>
+      <connection>git://git.apache.org/pluto.git</connection>
+      <developerConnection>git://git.apache.org/pluto.git</developerConnection>
+      <url>http://msnicklous.github.io/portletspec3/apidocs/index.html</url>
+   </scm>
 
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.tomcat</groupId>
-      <artifactId>tomcat-servlet-api</artifactId>
-      <scope>provided</scope>
-    </dependency>
-  </dependencies>
+   <build>
+      <pluginManagement>
+         <plugins>
+            <plugin>
+               <groupId>org.apache.maven.plugins</groupId>
+               <artifactId>maven-compiler-plugin</artifactId>
+            </plugin>
+            <plugin>
+               <groupId>org.apache.felix</groupId>
+               <artifactId>maven-bundle-plugin</artifactId>
+               <version>2.0.0</version>
+               <extensions>true</extensions>
+               <configuration>
+                  <instructions>
+                     <Export-Package>javax.portlet.filter;version=2.0.0,
+                        javax.portlet;version=2.0.0
+                     </Export-Package>
+                     <Import-Package>
+                        javax.servlet.http;version=2.4,*
+                     </Import-Package>
+                     <Implementation-Title>${project.name}</Implementation-Title>
+                     <Implementation-Version>${project.version}</Implementation-Version>
+                     <Bundle-DocURL>${project.url}</Bundle-DocURL>
+                  </instructions>
+               </configuration>
+            </plugin>
+         </plugins>
+      </pluginManagement>
 
-  <scm>
-    <connection>git://git.apache.org/pluto.git</connection>
-    <developerConnection>git://git.apache.org/pluto.git</developerConnection>
-    <url>http://msnicklous.github.io/portletspec3/apidocs/index.html</url>
-  </scm>
-
-  <build>
-    <pluginManagement>
       <plugins>
-        <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-compiler-plugin</artifactId>
-          <configuration>
-            <source>1.5</source>
-            <target>1.5</target>
-          </configuration>
-        </plugin>
-        <plugin>
-          <groupId>org.apache.felix</groupId>
-          <artifactId>maven-bundle-plugin</artifactId>
-          <version>2.0.0</version>
-          <extensions>true</extensions>
-          <configuration>
-            <instructions>
-              <Export-Package>javax.portlet.filter;version=2.0.0,
-                javax.portlet;version=2.0.0
-              </Export-Package>
-              <Import-Package>
-                javax.servlet.http;version=2.4,*
-              </Import-Package>
-              <Implementation-Title>${project.name}</Implementation-Title>
-              <Implementation-Version>${project.version}</Implementation-Version>
-              <Bundle-DocURL>${project.url}</Bundle-DocURL>
-            </instructions>
-          </configuration>
-        </plugin>
+         <plugin>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>maven-bundle-plugin</artifactId>
+         </plugin>
       </plugins>
-    </pluginManagement>
+   </build>
 
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-      </plugin>
-    </plugins>
-  </build>
-  
 </project>
 
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/ActionResponse.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/ActionResponse.java b/portlet-api/src/main/java/javax/portlet/ActionResponse.java
index 3d617fb..31fb5f1 100644
--- a/portlet-api/src/main/java/javax/portlet/ActionResponse.java
+++ b/portlet-api/src/main/java/javax/portlet/ActionResponse.java
@@ -24,9 +24,12 @@
 
 package javax.portlet;
 
+import javax.portlet.MimeResponse.Copy;
+
 
 /**
- * The <CODE>ActionResponse</CODE> interface represents the portlet
+ * <span class="changed_modified_3_0">The</span> 
+ * <CODE>ActionResponse</CODE> interface represents the portlet
  * response to an action request.
  * It extends the <CODE>StateAwareResponse</CODE> interface to provide specific 
  * action response functionality to portlets.<br>
@@ -51,7 +54,7 @@ public interface ActionResponse extends StateAwareResponse
    * the portlet container may encode the given URL before the 
    * redirection is issued to the client.
    * <p>
-   * The sendRedirect method can not be invoked after any of the 
+    * The sendRedirect method cannot be invoked after any of the 
    * following methods of the ActionResponse interface has been called:
    * <ul>
    * <li>setPortletMode</li>
@@ -59,6 +62,7 @@ public interface ActionResponse extends StateAwareResponse
    * <li>setRenderParameter</li>
    * <li>setRenderParameters</li>
    * <li>removePublicRenderParamter</li>
+    * <li>getRenderParameters</li>
    * </ul>
    *
    * @param		location	the redirect location URL
@@ -98,6 +102,7 @@ public interface ActionResponse extends StateAwareResponse
    * <li>setWindowState
    * <li>setRenderParameter
    * <li>setRenderParameters
+    * <li>getRenderParameters</li>
    * </ul>
    * are only used for creating the render URL and not remembered after the redirect
    * is issued. 
@@ -116,6 +121,64 @@ public interface ActionResponse extends StateAwareResponse
 
   public void sendRedirect(String location, String renderUrlParamName)
     throws java.io.IOException; 
+  
+
+   /**
+    * <div class="changed_added_3_0">
+    * Returns a render URL containing render parameters according to the
+    * MimeResponse.Copy argument. The portlet may modify the returned render URL. The
+    * URL is intended to be used in the sendRedirect(String location) method to allow
+    * the portlet to force a redirect to the same page with modified portlet state.    * Creates a render URL targeting the current portlet. 
+    * <p>
+    * The getRedirectURL method cannot be invoked after any of the 
+    * following methods of the ActionResponse interface has been called:
+    * <ul>
+    * <li>setPortletMode</li>
+    * <li>setWindowState</li>
+    * <li>setRenderParameter</li>
+    * <li>setRenderParameters</li>
+    * <li>removePublicRenderParameter</li>
+    * <li>getRenderParameters</li>
+    * </ul>
+    * <p>
+    * 
+    * <p>
+    * The new render URL will contain render parameters from the
+    * current request as specified by the <code>option</code> parameter.
+    * <dl>
+    * <dt>NONE</dt>
+    * <dd>All public and private parameters are removed from the URL.</dd>
+    * <dt>ALL</dt>
+    * <dd>The public and private parameters governing the current 
+    * request are added to the URL.</dd>
+    * <dt>PUBLIC</dt>
+    * <dd>Only public parameters governing the current
+    * request are added to the URL.</dd>
+    * </dl>
+    * The URL can be further extended by adding render
+    * parameters, portlet mode, and window state.
+    * If no additional portlet mode, window
+    * state or security modifier is set on the URL, the values from the
+    * current render or resource request are preserved.
+    * <p>
+    * If a public render parameter value is set or removed on a render URL, then the public 
+    * render parameter will be set to the new value or removed when the URL is activated.
+    * </div>
+    * 
+    * @param option
+    *            Specifies how current parameters are to be copied to the URL
+    *
+    * @see Copy
+    * 
+    * @return a portlet render URL
+    *
+    * @exception java.lang.IllegalStateException
+    *                    if the method is invoked after any of above mentioned methods of 
+    *                    the ActionResponse interface has been called.
+    *     
+    * @since 3.0
+    */
+   public RenderURL getRedirectURL(Copy option)  throws IllegalStateException;
 }
 
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/ConditionalDispatcher.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/ConditionalDispatcher.java b/portlet-api/src/main/java/javax/portlet/ConditionalDispatcher.java
new file mode 100644
index 0000000..132ee12
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/ConditionalDispatcher.java
@@ -0,0 +1,157 @@
+/*  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.
+ */
+
+
+package javax.portlet;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * <div class="changed_added_3_0">
+ * This interface provides methods to be implemented in order to implement conditional 
+ * method dispatching.
+ * </div>
+ *
+ */
+public interface ConditionalDispatcher {
+
+   /**
+    * <div class="changed_added_3_0">
+    * Called by the portlet container when an {@literal @}RenderMethod annotated 
+    * method is to be dispatched.
+    * <p>
+    * The method should analyze the given <code>Set</code> of candidate methods using
+    * the annotations available from each <code>MethodToken</code> 
+    * based on the current request and
+    * create a list of method tokens representing the methods to be invoked. 
+    * The output list may be empty or <code>null</code>. 
+    * A given method token may appear in the output list more than once.  
+    * <p>
+    * If the method returns a non-<code>null</code> List object, the portlet container will
+    * invoke the methods in the order they appear in the list, and then 
+    * perform no further dispatching operation for the current request.
+    * <p>
+    * If the method returns <code>null</code>, the portlet container will dispatch the 
+    * method using its implementation-specific algorithm.
+    * <p>
+    * If the method throws an exception, it will be treated as an unhandled exception
+    * during render request processing. The portlet container will perform no 
+    * further dispatching.
+    * </div>
+    *  
+    * @param request    The render render request
+    * @param response   The render render response
+    * @param methods    A <code>Set</code> containing the 
+    *                   method tokens representing the candidate methods for this dispatch action.
+    * @return           A list of method tokens if the dispatch has been handled. The list may be empty.
+    *                   <code>null</code> if the portlet container is to continue with 
+    *                   dispatching.
+    * @throws IOException        If an I/O error occurs
+    * @throws PortletException   If an unexpected condition arises
+    * 
+    * @see  MethodToken
+    * @see  javax.portlet.annotations.RenderMethod
+    */
+   public List<MethodToken> dispatch(RenderRequest request, RenderResponse response, 
+                                     Set<MethodToken> methods) 
+                                     throws IOException, PortletException;
+
+   /**
+    * <div class="changed_added_3_0">
+    * Called by the portlet container when an {@literal @}HeaderMethod annotated 
+    * method is to be dispatched.
+    * <p>
+    * The method should analyze the given <code>Set</code> of candidate methods using
+    * the annotations available from each <code>MethodToken</code> 
+    * based on the current request and
+    * create a list of method tokens representing the methods to be invoked. 
+    * The output list may be empty or <code>null</code>. 
+    * A given method token may appear in the output list more than once.  
+    * <p>
+    * If the method returns a non-<code>null</code> List object, the portlet container will
+    * invoke the methods in the order they appear in the list, and then 
+    * perform no further dispatching operation for the current request.
+    * <p>
+    * If the method returns <code>null</code>, the portlet container will dispatch the 
+    * method using its implementation-specific algorithm.
+    * <p>
+    * If the method throws an exception, it will be treated as an unhandled exception
+    * during header request processing. The portlet container will perform no 
+    * further dispatching.
+    * </div>
+    *  
+    * @param request    The header request
+    * @param response   The header  response
+    * @param methods    A <code>Set</code> containing the 
+    *                   method tokens representing the candidate methods for this dispatch action.
+    * @return           A list of method tokens if the dispatch has been handled. The list may be empty.
+    *                   <code>null</code> if the portlet container is to continue with 
+    *                   dispatching.
+    * @throws IOException        If an I/O error occurs
+    * @throws PortletException   If an unexpected condition arises
+    * 
+    * @see  MethodToken
+    * @see  javax.portlet.annotations.HeaderMethod
+    */
+   public List<MethodToken> dispatch(HeaderRequest request,  HeaderResponse response, 
+                                     Set<MethodToken> methods)
+                                     throws IOException, PortletException;
+
+   /**
+    * <div class="changed_added_3_0">
+    * Called by the portlet container when an {@literal @}ServeResourceMethod annotated 
+    * method is to be dispatched.
+    * <p>
+    * The method should analyze the given <code>Set</code> of candidate methods using
+    * the annotations available from each <code>MethodToken</code> 
+    * based on the current request and
+    * create a list of method tokens representing the methods to be invoked. 
+    * The output list may be empty or <code>null</code>. 
+    * A given method token may appear in the output list more than once.  
+    * <p>
+    * If the method returns a non-<code>null</code> List object, the portlet container will
+    * invoke the methods in the order they appear in the list, and then 
+    * perform no further dispatching operation for the current request.
+    * <p>
+    * If the method returns <code>null</code>, the portlet container will dispatch the 
+    * method using its implementation-specific algorithm.
+    * <p>
+    * If the method throws an exception, it will be treated as an unhandled exception
+    * during resource request processing. The portlet container will perform no 
+    * further dispatching.
+    * </div>
+    *  
+    * @param request    The resource request
+    * @param response   The resource response
+    * @param methods    A <code>Set</code> containing the 
+    *                   method tokens representing the candidate methods for this dispatch action.
+    * @return           A list of method tokens if the dispatch has been handled. The list may be empty.
+    *                   <code>null</code> if the portlet container is to continue with 
+    *                   dispatching.
+    * @throws IOException        If an I/O error occurs
+    * @throws PortletException   If an unexpected condition arises
+    * 
+    * @see  MethodToken
+    * @see  javax.portlet.annotations.ServeResourceMethod
+    */
+   public List<MethodToken> dispatch(ResourceRequest request,  ResourceResponse response,
+                                     Set<MethodToken> methods) 
+                                     throws IOException, PortletException;
+}


[30/38] portals-pluto git commit: Implemented ActionResponse#getRedirectURL() method. Added redirect portlet to the PortletV3Demo for demo and test.

Posted by ms...@apache.org.
Implemented ActionResponse#getRedirectURL() method. Added redirect portlet
to the PortletV3Demo for demo and test.


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/29448a1f
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/29448a1f
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/29448a1f

Branch: refs/heads/V3Prototype
Commit: 29448a1ff3213be5fcdad5756be95cc0dabe878e
Parents: 7fb0624
Author: Scott Nicklous <ms...@apache.org>
Authored: Thu Nov 19 15:24:41 2015 +0100
Committer: Scott Nicklous <ms...@apache.org>
Committed: Thu Nov 19 15:24:41 2015 +0100

----------------------------------------------------------------------
 PortletV3Demo/pom.xml                           |  12 +-
 .../src/main/java/basic/portlet/Constants.java  |   1 +
 .../java/basic/portlet/RedirectPortlet.java     | 108 ++++++
 .../src/main/webapp/WEB-INF/jsp/view-rdp.jsp    |  64 ++++
 .../src/main/webapp/WEB-INF/portlet.xml         |  18 +
 .../pluto/container/PortletResponseContext.java | 126 +++----
 .../container/impl/ActionResponseImpl.java      | 131 ++++---
 .../pluto/container/impl/BaseURLImpl.java       |   3 +-
 .../pluto/container/impl/PortletURLImpl.java    |   8 +-
 .../pluto/container/impl/RenderURLImpl.java     |   4 +-
 .../container/impl/StateAwareResponseImpl.java  |   3 +-
 .../PortletMimeResponseContextImpl.java         |   7 -
 .../container/PortletResponseContextImpl.java   | 351 ++++++++++---------
 13 files changed, 507 insertions(+), 329 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/29448a1f/PortletV3Demo/pom.xml
----------------------------------------------------------------------
diff --git a/PortletV3Demo/pom.xml b/PortletV3Demo/pom.xml
index 3ff5884..a957244 100644
--- a/PortletV3Demo/pom.xml
+++ b/PortletV3Demo/pom.xml
@@ -18,6 +18,12 @@
         <scope>provided</scope>
       </dependency>
       <dependency>
+         <groupId>org.apache.portals.pluto</groupId>
+         <artifactId>pluto-taglib</artifactId>
+         <version>${project.version}</version>
+         <scope>provided</scope>
+      </dependency>
+      <dependency>
          <groupId>org.apache.tomcat</groupId>
          <artifactId>tomcat-servlet-api</artifactId>
          <scope>provided</scope>
@@ -45,12 +51,6 @@
           <artifactId>taglibs-standard-jstlel</artifactId>
           <scope>provided</scope>
       </dependency>
-      <dependency>
-         <groupId>org.apache.portals.pluto</groupId>
-         <artifactId>pluto-taglib</artifactId>
-         <version>2.1.0-M3</version>
-         <scope>provided</scope>
-      </dependency>
    </dependencies>
 
    <build>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/29448a1f/PortletV3Demo/src/main/java/basic/portlet/Constants.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/Constants.java b/PortletV3Demo/src/main/java/basic/portlet/Constants.java
index 32c3b10..25bfec2 100644
--- a/PortletV3Demo/src/main/java/basic/portlet/Constants.java
+++ b/PortletV3Demo/src/main/java/basic/portlet/Constants.java
@@ -40,6 +40,7 @@ public class Constants {
    public final static String PARAM_FG_GREEN = "green";
    public final static String PARAM_FG_BLUE = "blue";
    public final static String PARAM_MSG_INPUT = "imsg";
+   public final static String PARAM_URL_INPUT = "url";
    
    public final static String PARAM_NUM_ACTIONS = "numActions";
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/29448a1f/PortletV3Demo/src/main/java/basic/portlet/RedirectPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/RedirectPortlet.java b/PortletV3Demo/src/main/java/basic/portlet/RedirectPortlet.java
new file mode 100644
index 0000000..a983a6e
--- /dev/null
+++ b/PortletV3Demo/src/main/java/basic/portlet/RedirectPortlet.java
@@ -0,0 +1,108 @@
+/*  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.
+ */
+
+package basic.portlet;
+
+import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.portlet.ActionParameters;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.ActionURL;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderParameters;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.RenderURL;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+
+import static javax.portlet.MimeResponse.Copy.*;
+import static basic.portlet.Constants.*;
+
+/**
+ * Portlet for testing the redirect funtionality, including the new getRedirectURL API.
+ */
+public class RedirectPortlet extends GenericPortlet {
+
+   private static final Logger  LOGGER  = Logger.getLogger(RedirectPortlet.class.getName());
+   private static final boolean isDebug = LOGGER.isLoggable(Level.FINE);
+
+   protected void doView(RenderRequest req, RenderResponse resp) throws PortletException, IOException {
+
+      resp.setContentType("text/html");
+      
+      // provide an action URL to the JSP as a workaround, since the tag library is still JSR 286
+      ActionURL aurl = resp.createActionURL(ALL);
+      req.setAttribute(ATTRIB_ACTURL, aurl.toString());
+
+      PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/view-rdp.jsp");
+      rd.include(req, resp);
+
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see javax.portlet.GenericPortlet#serveResource(javax.portlet.ResourceRequest, javax.portlet.ResourceResponse)
+    */
+   @Override
+   public void serveResource(ResourceRequest req, ResourceResponse resp) throws PortletException, IOException {
+   }
+
+   public void processAction(ActionRequest req, ActionResponse resp) throws PortletException, IOException {
+
+      ActionParameters ap = req.getActionParameters();
+      RenderParameters rp = req.getRenderParameters();
+
+      StringBuilder txt = new StringBuilder(128);
+      if (isDebug) {
+         txt.append("Action parms: ").append(ap.getNames());
+         txt.append(", Render parms: ").append(rp.getNames());
+         txt.append(", Color: ").append(rp.getValue(PARAM_COLOR));
+      }
+
+      String color = ap.getValue(PARAM_COLOR);
+      if (color != null && color.length() > 0) {
+         if (!color.matches("^#(?:[A-Fa-f0-9]{3}){1,2}$")) {
+            color = "FDD";
+         }
+      }
+      
+      String url = ap.getValue(PARAM_URL_INPUT);
+      if (url == null || url.length() <= 0) {
+         RenderURL rurl = resp.getRedirectURL(ALL);
+         rurl.getRenderParameters().setValue(PARAM_COLOR, color);
+         url = rurl.toString();
+         if (isDebug) {
+            txt.append(", redirecting to redirect URL with new color=").append(color);
+         }
+      }
+      resp.sendRedirect(url);
+      
+      if (isDebug) {
+         LOGGER.fine(txt.toString());
+      }
+
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/29448a1f/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-rdp.jsp
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-rdp.jsp b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-rdp.jsp
new file mode 100644
index 0000000..7e8d59b
--- /dev/null
+++ b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-rdp.jsp
@@ -0,0 +1,64 @@
+<%--
+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.
+--%>
+<%@ page session="false" %>
+<%@ taglib uri="http://xmlns.jcp.org/portlet_3_0"  prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ page import="static basic.portlet.Constants.*" %>
+
+<portlet:defineObjects />
+
+<% 
+   String clr = renderRequest.getRenderParameters().getValue(PARAM_COLOR);
+   if (clr == null) {
+      clr = "#FFF";
+   }
+%>
+
+<div style='background-color:<%=clr %>; padding:8px;'>
+<h3>V3 Redirect Portlet</h3><hr/>
+<p>
+Portlet to demo the V3 action response redirect functionality. You can enter a redirect that the
+processAction method will redirect to along with a color value. If a redirect URL is entered, the portlet
+will redirect to that URL.
+</p><p> 
+If no URL is entered, the portlet will obtain a redirect URL, which is 
+basically a render URL to itself, and redirect to that URL to refresh the page. If a color 
+value is entered, it will be set as a render parameter on the redirect URL.
+The color will be set as background color for the portlet, so you can see the effect of the
+redirect.
+</p>
+<!-- Note that the action URL is provided to the JSP by the render method as a workaround, 
+     since the tag lib is still at JSR 286 level. -->
+<form method='POST'  enctype='application/x-www-form-urlencoded' action="<%=renderRequest.getAttribute(ATTRIB_ACTURL) %>">
+  <table><tr>
+     <td align='left'>Enter background color :</td>
+     <td>
+        <input id='<portlet:namespace/>-color' name='<%=PARAM_COLOR%>' type='text' value='' size='10' maxlength='10'>
+     </td>
+     <td>
+     <div id='<portlet:namespace/>-putMsgHere'></div>
+   </td></tr><tr><td>
+   Enter URL:
+   </td><td colspan=3>
+   <input id='<portlet:namespace/>-msg' name='<%=PARAM_URL_INPUT%>' type='text' value='' size='50' maxlength='50'>
+   </td></tr><tr><td>
+   <INPUT id ='<portlet:namespace/>-send' VALUE='redirect' TYPE='submit'>
+   </td></tr></table>
+</FORM>
+</div>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/29448a1f/PortletV3Demo/src/main/webapp/WEB-INF/portlet.xml
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/webapp/WEB-INF/portlet.xml b/PortletV3Demo/src/main/webapp/WEB-INF/portlet.xml
index 48462f6..d1217a2 100644
--- a/PortletV3Demo/src/main/webapp/WEB-INF/portlet.xml
+++ b/PortletV3Demo/src/main/webapp/WEB-INF/portlet.xml
@@ -94,6 +94,24 @@
    </portlet>
 
    <portlet>
+      <portlet-name>V3RedirectPortlet</portlet-name>
+      <display-name>Redirect Test Portlet</display-name>
+      
+      <portlet-class>basic.portlet.RedirectPortlet</portlet-class>
+
+      <supports>
+         <mime-type>text/html</mime-type>
+         <portlet-mode>VIEW</portlet-mode>
+      </supports>
+
+      <supported-locale>en</supported-locale>        
+
+      <portlet-info>
+         <title>Redirect Test Portlet</title>
+      </portlet-info>
+   </portlet>
+
+   <portlet>
       <portlet-name>PortletConfigPortlet1</portlet-name>
       <display-name>Portlet Config Portlet #1</display-name>
       

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/29448a1f/pluto-container-api/src/main/java/org/apache/pluto/container/PortletResponseContext.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletResponseContext.java b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletResponseContext.java
index c3718e1..8d48f14 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletResponseContext.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletResponseContext.java
@@ -1,62 +1,64 @@
-/*
- * 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.
- */
-package org.apache.pluto.container;
-
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-
-/**
- * @author <a href="mailto:ate@douma.nu">Ate Douma</a>
- * @version $Id$
- */
-public interface PortletResponseContext
-{
-    void init(HttpServletRequest servletRequest, HttpServletResponse servletResponse);
-    PortletContainer getContainer();
-    HttpServletRequest getContainerRequest();
-    HttpServletResponse getContainerResponse();
-    HttpServletRequest getServletRequest();
-    HttpServletResponse getServletResponse();
-    PortletWindow getPortletWindow();
-    
-    ResourceURLProvider getResourceURLProvider();
-    void addProperty(Cookie cookie);
-    void addProperty(String key, Element element);
-    void addProperty(String key, String value);
-    void setProperty(String key, String value);
-    Element createElement(String tagName) throws DOMException;
-
-    /**
-     * Closing the response context means processing has been completed and
-     * internal storage can be flushed and written out to the Portal.
-     * It is not required for the Portal to do internal buffering, except for
-     * the PortletEventResponseContext as the portlet spec explicitely states that
-     * any changes during a processEvent should be ignored if an exception occurs,
-     * in which case the portlet container should only call release() and not close().
-     */
-    void close();
-    
-    /**
-     * Releasing the response context means its internal storage can be released as well.
-     * If any outstanding changes have not been processed yet, those will be lost.
-     */
-    void release();
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.container;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.pluto.container.PortletURLProvider.TYPE;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Element;
+
+/**
+ * @author <a href="mailto:ate@douma.nu">Ate Douma</a>
+ * @version $Id$
+ */
+public interface PortletResponseContext
+{
+    void init(HttpServletRequest servletRequest, HttpServletResponse servletResponse);
+    PortletContainer getContainer();
+    HttpServletRequest getContainerRequest();
+    HttpServletResponse getContainerResponse();
+    HttpServletRequest getServletRequest();
+    HttpServletResponse getServletResponse();
+    PortletWindow getPortletWindow();
+    
+    ResourceURLProvider getResourceURLProvider();
+    PortletURLProvider getPortletURLProvider(TYPE type);
+    void addProperty(Cookie cookie);
+    void addProperty(String key, Element element);
+    void addProperty(String key, String value);
+    void setProperty(String key, String value);
+    Element createElement(String tagName) throws DOMException;
+
+    /**
+     * Closing the response context means processing has been completed and
+     * internal storage can be flushed and written out to the Portal.
+     * It is not required for the Portal to do internal buffering, except for
+     * the PortletEventResponseContext as the portlet spec explicitely states that
+     * any changes during a processEvent should be ignored if an exception occurs,
+     * in which case the portlet container should only call release() and not close().
+     */
+    void close();
+    
+    /**
+     * Releasing the response context means its internal storage can be released as well.
+     * If any outstanding changes have not been processed yet, those will be lost.
+     */
+    void release();
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/29448a1f/pluto-container/src/main/java/org/apache/pluto/container/impl/ActionResponseImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/ActionResponseImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/ActionResponseImpl.java
index a43e309..364cc6b 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/ActionResponseImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/ActionResponseImpl.java
@@ -26,82 +26,69 @@ import org.apache.pluto.container.PortletActionResponseContext;
 import org.apache.pluto.container.ResourceURLProvider;
 import org.apache.pluto.container.util.ArgumentUtility;
 
-public class ActionResponseImpl extends StateAwareResponseImpl implements ActionResponse
-{
-    private boolean stateChanged;
-    protected boolean redirected;
-    
-    public ActionResponseImpl(PortletActionResponseContext responseContext)
-    {
-        super(responseContext);
-    }
+public class ActionResponseImpl extends StateAwareResponseImpl implements ActionResponse {
+   private boolean   stateChanged;
+   protected boolean redirected;
 
-    protected void checkSetRedirected()
-    {
-        if (stateChanged)
-        {
-            throw new IllegalStateException("sendRedirect no longer allowed after navigational state changes");
-        }
-        if (redirected)
-        {
-            throw new IllegalStateException("sendRedirect already called");
-        }
-        redirected = true;
-    }
-    
-    protected void checkSetStateChanged()
-    {
-        if (redirected)
-        {
-            throw new IllegalStateException("State change no longer allowed after a sendRedirect");
-        }
-        stateChanged = true;
-    }
-    
-    protected String getRedirectLocation(String location)
-    {
-        ArgumentUtility.validateNotEmpty("location", location);
-        ResourceURLProvider provider = getResponseContext().getResourceURLProvider();
+   public ActionResponseImpl(PortletActionResponseContext responseContext) {
+      super(responseContext);
+   }
+
+   protected void checkSetRedirected() {
+      if (stateChanged) {
+         throw new IllegalStateException("sendRedirect no longer allowed after navigational state changes");
+      }
+      if (redirected) {
+         throw new IllegalStateException("sendRedirect already called");
+      }
+      redirected = true;
+   }
+
+   protected void checkSetStateChanged() {
+      if (redirected) {
+         throw new IllegalStateException("State change no longer allowed after a sendRedirect");
+      }
+      stateChanged = true;
+   }
+
+   protected String getRedirectLocation(String location) {
+      ArgumentUtility.validateNotEmpty("location", location);
+      ResourceURLProvider provider = getResponseContext().getResourceURLProvider();
 
-        if (location.indexOf("://") != -1)
-        {
-            provider.setAbsoluteURL(location);
-        } 
-        else 
-        {
-            provider.setFullPath(location);
-        }
-        location = getServletResponse().encodeRedirectURL(provider.toString());
-        if (location.indexOf("/") == -1)
-        {
-            throw new IllegalArgumentException("There is a relative path given, an IllegalArgumentException must be thrown.");
-        }
-        return location;
-    }
-    
-    public void sendRedirect(String location) throws IOException
-    {
-        location = getRedirectLocation(location);
-        checkSetRedirected();
-        ((PortletActionResponseContext)getResponseContext()).setRedirect(location);
-    }
-    
-	public void sendRedirect(String location, String renderUrlParamName) throws IOException 
-	{
-        ArgumentUtility.validateNotEmpty("renderUrlParamName", renderUrlParamName);
-        location = getRedirectLocation(location);
-        if (!redirected)
-        {
-            stateChanged = false;
-        }
-        checkSetRedirected();
-        ((PortletActionResponseContext)getResponseContext()).setRedirect(location, renderUrlParamName);
-	}
+      if (location.indexOf("://") != -1) {
+         provider.setAbsoluteURL(location);
+      } else {
+         provider.setFullPath(location);
+      }
+      location = getServletResponse().encodeRedirectURL(provider.toString());
+      if (location.indexOf("/") == -1) {
+         throw new IllegalArgumentException(
+               "There is a relative path given, an IllegalArgumentException must be thrown.");
+      }
+      return location;
+   }
+
+   public void sendRedirect(String location) throws IOException {
+      location = getRedirectLocation(location);
+      checkSetRedirected();
+      ((PortletActionResponseContext) getResponseContext()).setRedirect(location);
+   }
+
+   public void sendRedirect(String location, String renderUrlParamName) throws IOException {
+      ArgumentUtility.validateNotEmpty("renderUrlParamName", renderUrlParamName);
+      location = getRedirectLocation(location);
+      if (!redirected) {
+         stateChanged = false;
+      }
+      checkSetRedirected();
+      ((PortletActionResponseContext) getResponseContext()).setRedirect(location, renderUrlParamName);
+   }
 
    @Override
    public RenderURL getRedirectURL(Copy option) throws IllegalStateException {
-      // TODO: implement
-      //return new RenderURLImpl(responseContext, option);
-      return null;
+      if (stateChanged) {
+         throw new IllegalStateException("sendRedirect no longer allowed after navigational state changes");
+      }
+      return new RenderURLImpl(responseContext, option);
    }
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/29448a1f/pluto-container/src/main/java/org/apache/pluto/container/impl/BaseURLImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/BaseURLImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/BaseURLImpl.java
index b1e2b89..65dbf00 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/BaseURLImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/BaseURLImpl.java
@@ -39,7 +39,6 @@ import javax.portlet.RenderURL;
 import javax.portlet.ResourceURL;
 import javax.portlet.WindowState;
 
-import org.apache.pluto.container.PortletMimeResponseContext;
 import org.apache.pluto.container.PortletResponseContext;
 import org.apache.pluto.container.PortletURLListenerService;
 import org.apache.pluto.container.PortletURLProvider;
@@ -82,7 +81,7 @@ public abstract class BaseURLImpl implements BaseURL {
       }
    }
 
-   public BaseURLImpl(PortletMimeResponseContext responseContext,
+   public BaseURLImpl(PortletResponseContext responseContext,
          PortletURLProvider portletURLProvider, Copy copy) {
       this(responseContext, portletURLProvider);
       

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/29448a1f/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletURLImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletURLImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletURLImpl.java
index ed76761..8beff45 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletURLImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletURLImpl.java
@@ -18,9 +18,6 @@ package org.apache.pluto.container.impl;
 
 import java.util.Enumeration;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import javax.portlet.MimeResponse.Copy;
 import javax.portlet.MutableRenderParameters;
 import javax.portlet.PortletMode;
@@ -30,13 +27,14 @@ import javax.portlet.WindowState;
 import javax.portlet.WindowStateException;
 import javax.portlet.annotations.PortletSerializable;
 
-import org.apache.pluto.container.PortletMimeResponseContext;
 import org.apache.pluto.container.PortletResponseContext;
 import org.apache.pluto.container.PortletURLProvider;
 import org.apache.pluto.container.om.portlet.CustomPortletMode;
 import org.apache.pluto.container.om.portlet.PortletDefinition;
 import org.apache.pluto.container.om.portlet.Supports;
 import org.apache.pluto.container.util.ArgumentUtility;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -62,7 +60,7 @@ public abstract class PortletURLImpl extends BaseURLImpl implements PortletURL {
       super(responseContext, urlProvider);
    }
 
-   public PortletURLImpl(PortletMimeResponseContext responseContext,
+   public PortletURLImpl(PortletResponseContext responseContext,
          PortletURLProvider portletURLProvider, Copy copy) {
       super(responseContext, portletURLProvider, copy);
    }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/29448a1f/pluto-container/src/main/java/org/apache/pluto/container/impl/RenderURLImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/RenderURLImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/RenderURLImpl.java
index 6f99cec..879a512 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/RenderURLImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/RenderURLImpl.java
@@ -22,7 +22,7 @@ package org.apache.pluto.container.impl;
 import javax.portlet.MimeResponse.Copy;
 import javax.portlet.RenderURL;
 
-import org.apache.pluto.container.PortletMimeResponseContext;
+import org.apache.pluto.container.PortletResponseContext;
 import org.apache.pluto.container.PortletURLProvider;
 import org.apache.pluto.container.util.ArgumentUtility;
 
@@ -37,7 +37,7 @@ public class RenderURLImpl extends PortletURLImpl implements RenderURL {
     * @param copy 
     * @param urlProvider
     */
-   public RenderURLImpl(PortletMimeResponseContext responseContext, Copy copy) {
+   public RenderURLImpl(PortletResponseContext responseContext, Copy copy) {
       super(responseContext,
             responseContext.getPortletURLProvider(PortletURLProvider.TYPE.RENDER), copy);
    }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/29448a1f/pluto-container/src/main/java/org/apache/pluto/container/impl/StateAwareResponseImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/StateAwareResponseImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/StateAwareResponseImpl.java
index 78b55c9..e09fb6e 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/StateAwareResponseImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/StateAwareResponseImpl.java
@@ -49,7 +49,7 @@ public abstract class StateAwareResponseImpl extends PortletResponseImpl
    @SuppressWarnings("unused")
    private final boolean isDebug = LOGGER.isDebugEnabled();
 
-   private PortletStateAwareResponseContext responseContext;
+   protected PortletStateAwareResponseContext responseContext;
    private final String                     windowId;
 
    public StateAwareResponseImpl(PortletStateAwareResponseContext responseContext) {
@@ -186,6 +186,7 @@ public abstract class StateAwareResponseImpl extends PortletResponseImpl
    }
 
    public MutableRenderParameters getRenderParameters() {
+      checkSetStateChanged();
       return responseContext.getRenderParameters(windowId);
    }
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/29448a1f/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletMimeResponseContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletMimeResponseContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletMimeResponseContextImpl.java
index a418988..2c458bc 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletMimeResponseContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletMimeResponseContextImpl.java
@@ -27,9 +27,7 @@ import javax.servlet.http.HttpServletResponse;
 
 import org.apache.pluto.container.PortletContainer;
 import org.apache.pluto.container.PortletMimeResponseContext;
-import org.apache.pluto.container.PortletURLProvider;
 import org.apache.pluto.container.PortletWindow;
-import org.apache.pluto.container.PortletURLProvider.TYPE;
 import org.apache.pluto.container.util.PrintWriterServletOutputStream;
 
 /**
@@ -208,9 +206,4 @@ public abstract class PortletMimeResponseContextImpl extends PortletResponseCont
             getServletResponse().setContentType(contentType);
         }
     }
-
-    public PortletURLProvider getPortletURLProvider(TYPE type)
-    {
-        return isClosed() ? null : new PortletURLProviderImpl(getPortalURL(), type, getPortletWindow());
-    }
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/29448a1f/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
index 00a02db..7093bcf 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
@@ -1,172 +1,179 @@
-/*
- * 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.
- */
-package org.apache.pluto.driver.services.container;
-
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.apache.pluto.container.PortletContainer;
-import org.apache.pluto.container.PortletResponseContext;
-import org.apache.pluto.container.PortletWindow;
-import org.apache.pluto.container.ResourceURLProvider;
-import org.apache.pluto.driver.core.PortalRequestContext;
-import org.apache.pluto.driver.url.PortalURL;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * @version $Id$
- *
- */
-public abstract class PortletResponseContextImpl implements PortletResponseContext
-{
-    private PortletContainer container;
-    private HttpServletRequest containerRequest;
-    private HttpServletResponse containerResponse;
-    private HttpServletRequest servletRequest;
-    private HttpServletResponse servletResponse;
-    private PortletWindow window;
-    private PortalURL portalURL;
-    private boolean closed;
-    private boolean released;
-    
-    public PortletResponseContextImpl(PortletContainer container, HttpServletRequest containerRequest,
-                                      HttpServletResponse containerResponse, PortletWindow window)
-    {
-        this.container = container;
-        this.containerRequest = containerRequest;
-        this.containerResponse = containerResponse;
-        this.window = window;
-        this.portalURL = PortalRequestContext.getContext(containerRequest).createPortalURL();
-    }
-    
-    protected PortalURL getPortalURL()
-    {
-        return portalURL;
-    }
-
-    protected boolean isClosed()
-    {
-        return closed;
-    }
-    
-    protected boolean isReleased()
-    {
-        return released;
-    }
-
-    public void init(HttpServletRequest servletRequest, HttpServletResponse servletResponse)
-    {
-        this.servletRequest = servletRequest;
-        this.servletResponse = servletResponse;
-    }
-    
-    public void addProperty(Cookie cookie)
-    {
-        if (!isClosed())
-        {
-            servletResponse.addCookie(cookie);
-        }
-    }
-
-    public void addProperty(String key, Element element)
-    {
-        // not supported 
-    }
-
-    public void addProperty(String key, String value)
-    {
-        // not supported
-    }
-    
-    public Element createElement(String tagName) throws DOMException
-    {
-        DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
-        DocumentBuilder docBuilder;
-        
-        try
-        {
-            docBuilder = dbfac.newDocumentBuilder();
-            Document doc = docBuilder.newDocument();
-            return doc.createElement(tagName);
-        }
-        catch (ParserConfigurationException e)
-        {
-            throw new DOMException((short) 0, "Initialization failure");
-        }
-    }
-
-    public void close()
-    {
-        closed = true;
-    }
-
-    public PortletContainer getContainer()
-    {
-        return container;
-    }
-
-    public PortletWindow getPortletWindow()
-    {
-        return window;
-    }
-
-    public HttpServletRequest getContainerRequest()
-    {
-        return containerRequest;
-    }
-
-    public HttpServletResponse getContainerResponse()
-    {
-        return containerResponse;
-    }
-
-    public HttpServletRequest getServletRequest()
-    {
-        return servletRequest;
-    }
-
-    public HttpServletResponse getServletResponse()
-    {
-        return servletResponse;
-    }
-
-    public void release()
-    {
-        closed = true;
-        released = true;
-        container = null;
-        servletRequest = null;
-        servletResponse = null;
-        window = null;
-    }
-
-    public void setProperty(String key, String value)
-    {
-        // not supported
-    }
-
-    public ResourceURLProvider getResourceURLProvider()
-    {
-        return isReleased() ? null : new ResourceURLProviderImpl(servletRequest,window);
-    }
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.driver.services.container;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.pluto.container.PortletContainer;
+import org.apache.pluto.container.PortletResponseContext;
+import org.apache.pluto.container.PortletURLProvider;
+import org.apache.pluto.container.PortletWindow;
+import org.apache.pluto.container.ResourceURLProvider;
+import org.apache.pluto.container.PortletURLProvider.TYPE;
+import org.apache.pluto.driver.core.PortalRequestContext;
+import org.apache.pluto.driver.url.PortalURL;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * @version $Id$
+ *
+ */
+public abstract class PortletResponseContextImpl implements PortletResponseContext
+{
+    private PortletContainer container;
+    private HttpServletRequest containerRequest;
+    private HttpServletResponse containerResponse;
+    private HttpServletRequest servletRequest;
+    private HttpServletResponse servletResponse;
+    private PortletWindow window;
+    private PortalURL portalURL;
+    private boolean closed;
+    private boolean released;
+    
+    public PortletResponseContextImpl(PortletContainer container, HttpServletRequest containerRequest,
+                                      HttpServletResponse containerResponse, PortletWindow window)
+    {
+        this.container = container;
+        this.containerRequest = containerRequest;
+        this.containerResponse = containerResponse;
+        this.window = window;
+        this.portalURL = PortalRequestContext.getContext(containerRequest).createPortalURL();
+    }
+    
+    protected PortalURL getPortalURL()
+    {
+        return portalURL;
+    }
+
+    protected boolean isClosed()
+    {
+        return closed;
+    }
+    
+    protected boolean isReleased()
+    {
+        return released;
+    }
+
+    public void init(HttpServletRequest servletRequest, HttpServletResponse servletResponse)
+    {
+        this.servletRequest = servletRequest;
+        this.servletResponse = servletResponse;
+    }
+    
+    public void addProperty(Cookie cookie)
+    {
+        if (!isClosed())
+        {
+            servletResponse.addCookie(cookie);
+        }
+    }
+
+    public void addProperty(String key, Element element)
+    {
+        // not supported 
+    }
+
+    public void addProperty(String key, String value)
+    {
+        // not supported
+    }
+    
+    public Element createElement(String tagName) throws DOMException
+    {
+        DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
+        DocumentBuilder docBuilder;
+        
+        try
+        {
+            docBuilder = dbfac.newDocumentBuilder();
+            Document doc = docBuilder.newDocument();
+            return doc.createElement(tagName);
+        }
+        catch (ParserConfigurationException e)
+        {
+            throw new DOMException((short) 0, "Initialization failure");
+        }
+    }
+
+    public void close()
+    {
+        closed = true;
+    }
+
+    public PortletContainer getContainer()
+    {
+        return container;
+    }
+
+    public PortletWindow getPortletWindow()
+    {
+        return window;
+    }
+
+    public HttpServletRequest getContainerRequest()
+    {
+        return containerRequest;
+    }
+
+    public HttpServletResponse getContainerResponse()
+    {
+        return containerResponse;
+    }
+
+    public HttpServletRequest getServletRequest()
+    {
+        return servletRequest;
+    }
+
+    public HttpServletResponse getServletResponse()
+    {
+        return servletResponse;
+    }
+
+    public void release()
+    {
+        closed = true;
+        released = true;
+        container = null;
+        servletRequest = null;
+        servletResponse = null;
+        window = null;
+    }
+
+    public void setProperty(String key, String value)
+    {
+        // not supported
+    }
+
+    public ResourceURLProvider getResourceURLProvider()
+    {
+        return isReleased() ? null : new ResourceURLProviderImpl(servletRequest,window);
+    }
+
+    public PortletURLProvider getPortletURLProvider(TYPE type)
+    {
+        return isClosed() ? null : new PortletURLProviderImpl(getPortalURL(), type, getPortletWindow());
+    }
+}


[34/38] portals-pluto git commit: Continued work on header phase implementation. Implemented PortletResponse#addProperty(String, Element) for both V2 and V3 portlets. Completed execution path that allows the header information to be integrated into the o

Posted by ms...@apache.org.
Continued work on header phase implementation. Implemented
PortletResponse#addProperty(String, Element) for both V2 and V3 portlets.
Completed execution path that allows the header information to be integrated
into the overall portal response.


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/8f9bca1b
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/8f9bca1b
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/8f9bca1b

Branch: refs/heads/V3Prototype
Commit: 8f9bca1bc1d1dad3f817821d19b1f1e244873fbb
Parents: 65c0050
Author: Scott Nicklous <ms...@apache.org>
Authored: Tue Nov 24 10:48:39 2015 +0100
Committer: Scott Nicklous <ms...@apache.org>
Committed: Tue Nov 24 10:51:58 2015 +0100

----------------------------------------------------------------------
 .../main/java/basic/portlet/HeaderPortlet.java  | 113 +++++
 .../src/main/webapp/WEB-INF/jsp/view-hdp.jsp    |  32 ++
 .../src/main/webapp/WEB-INF/portlet.xml         |  18 +
 .../src/main/webapp/resources/css/styles.css    |  15 +-
 .../org/apache/pluto/container/HeaderData.java  |  42 ++
 .../pluto/container/PortletContainer.java       |  10 +-
 .../pluto/container/PortletRequestContext.java  |   4 +
 .../pluto/container/PortletResponseContext.java |   8 +
 .../pluto/container/driver/PortletServlet3.java |   4 +
 .../container/impl/PortletContainerImpl.java    |  27 +-
 .../services/container/PortalContextImpl.java   | 338 ++++++-------
 .../PortletActionResponseContextImpl.java       | 202 ++++----
 .../PortletEventResponseContextImpl.java        |  80 ++--
 .../PortletHeaderResponseContextImpl.java       |   2 +
 .../PortletRenderResponseContextImpl.java       | 112 ++---
 .../container/PortletRequestContextImpl.java    |  13 +-
 .../PortletResourceResponseContextImpl.java     |   2 +
 .../container/PortletResponseContextImpl.java   | 371 ++++++++------
 .../org/apache/pluto/driver/AttributeKeys.java  | 134 +++---
 .../pluto/driver/PortalDriverServlet.java       | 176 ++++---
 .../apache/pluto/driver/tags/PortletTag.java    | 479 ++++++++++---------
 .../WEB-INF/themes/pluto-default-theme.jsp      |   3 +
 .../main/java/javax/portlet/GenericPortlet.java |  14 +-
 23 files changed, 1308 insertions(+), 891 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/PortletV3Demo/src/main/java/basic/portlet/HeaderPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/HeaderPortlet.java b/PortletV3Demo/src/main/java/basic/portlet/HeaderPortlet.java
new file mode 100644
index 0000000..3270287
--- /dev/null
+++ b/PortletV3Demo/src/main/java/basic/portlet/HeaderPortlet.java
@@ -0,0 +1,113 @@
+/*  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.
+ */
+
+package basic.portlet;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.portlet.ActionParameters;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.ActionURL;
+import javax.portlet.GenericPortlet;
+import javax.portlet.HeaderRequest;
+import javax.portlet.HeaderResponse;
+import javax.portlet.MimeResponse;
+import javax.portlet.PortalContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderParameters;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.RenderURL;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+
+import org.w3c.dom.Element;
+
+import static javax.portlet.MimeResponse.Copy.*;
+import static basic.portlet.Constants.*;
+
+/**
+ * Portlet for testing the redirect funtionality, including the new getRedirectURL API.
+ */
+public class HeaderPortlet extends GenericPortlet {
+
+   private static final Logger  LOGGER  = Logger.getLogger(HeaderPortlet.class.getName());
+   private static final boolean isDebug = LOGGER.isLoggable(Level.FINE);
+   
+   @Override
+   public void renderHeaders(HeaderRequest req, HeaderResponse resp) throws PortletException, IOException {
+      
+      if (LOGGER.isLoggable(Level.FINE)) {
+         StringBuilder txt = new StringBuilder(128);
+         txt.append("Doing the headers. ");
+         txt.append("portal ctx prop names: ");
+         txt.append(Collections.list(req.getPortalContext().getPropertyNames()).toString());
+         txt.append(", markup head prop: ");
+         txt.append(req.getPortalContext().getProperty(PortalContext.MARKUP_HEAD_ELEMENT_SUPPORT));
+         txt.append(", RENDER_PART: ");
+         txt.append((String)req.getAttribute(PortletRequest.RENDER_PART));
+         LOGGER.fine(txt.toString());
+      }
+
+      // Add link tag to head section to include the style sheet
+      Element link = resp.createElement("link");
+      link.setAttribute("rel", "stylesheet");
+      link.setAttribute("type", "text/css");
+      String contextRoot = req.getContextPath();
+      link.setAttribute("href", contextRoot + "/resources/css/styles.css");
+      resp.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, link);
+
+   }
+
+   @Override
+   protected void doView(RenderRequest req, RenderResponse resp) throws PortletException, IOException {
+      
+      if (LOGGER.isLoggable(Level.FINE)) {
+         StringBuilder txt = new StringBuilder(128);
+         txt.append("Rendering. ");
+         txt.append("RENDER_PART: ");
+         txt.append((String)req.getAttribute(PortletRequest.RENDER_PART));
+         LOGGER.fine(txt.toString());
+      }
+
+      resp.setContentType("text/html");
+
+      PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/view-hdp.jsp");
+      rd.include(req, resp);
+
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see javax.portlet.GenericPortlet#serveResource(javax.portlet.ResourceRequest, javax.portlet.ResourceResponse)
+    */
+   @Override
+   public void serveResource(ResourceRequest req, ResourceResponse resp) throws PortletException, IOException {
+   }
+
+   public void processAction(ActionRequest req, ActionResponse resp) throws PortletException, IOException {
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-hdp.jsp
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-hdp.jsp b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-hdp.jsp
new file mode 100644
index 0000000..95d4e44
--- /dev/null
+++ b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-hdp.jsp
@@ -0,0 +1,32 @@
+<%--
+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.
+--%>
+<%@ page session="false" %>
+<%@ taglib uri="http://xmlns.jcp.org/portlet_3_0"  prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ page import="static basic.portlet.Constants.*" %>
+
+<portlet:defineObjects />
+
+<div class='headerPortlet'>
+<h3>V3 Header Portlet</h3><hr/>
+<p>
+Portlet to demo the V3 header request functionality. The portlet uses a CSS class that sets a border and
+background color.
+</p>
+</div>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/PortletV3Demo/src/main/webapp/WEB-INF/portlet.xml
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/webapp/WEB-INF/portlet.xml b/PortletV3Demo/src/main/webapp/WEB-INF/portlet.xml
index d1217a2..a7aba59 100644
--- a/PortletV3Demo/src/main/webapp/WEB-INF/portlet.xml
+++ b/PortletV3Demo/src/main/webapp/WEB-INF/portlet.xml
@@ -112,6 +112,24 @@
    </portlet>
 
    <portlet>
+      <portlet-name>V3HeaderPortlet</portlet-name>
+      <display-name>Header Phase Test Portlet</display-name>
+      
+      <portlet-class>basic.portlet.HeaderPortlet</portlet-class>
+
+      <supports>
+         <mime-type>text/html</mime-type>
+         <portlet-mode>VIEW</portlet-mode>
+      </supports>
+
+      <supported-locale>en</supported-locale>        
+
+      <portlet-info>
+         <title>Header Phase Test Portlet</title>
+      </portlet-info>
+   </portlet>
+
+   <portlet>
       <portlet-name>PortletConfigPortlet1</portlet-name>
       <display-name>Portlet Config Portlet #1</display-name>
       

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/PortletV3Demo/src/main/webapp/resources/css/styles.css
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/webapp/resources/css/styles.css b/PortletV3Demo/src/main/webapp/resources/css/styles.css
index 9029874..cecb135 100644
--- a/PortletV3Demo/src/main/webapp/resources/css/styles.css
+++ b/PortletV3Demo/src/main/webapp/resources/css/styles.css
@@ -1,16 +1,5 @@
-.emphasis {
-   font-style: italic;
-   font-size: 1.3em;
-}
-
-.basicJSFApp {
-   padding: 5px;
-   background-color: #DDFFDD;
-   border: thin solid #66DD66;
-}
-
-.infoBox {
+.headerPortlet {
    padding: 5px;
    background-color: #DDDDFF;
-   border: thin solid #6666DD;
+   border: thick solid #2288EE;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/pluto-container-api/src/main/java/org/apache/pluto/container/HeaderData.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/HeaderData.java b/pluto-container-api/src/main/java/org/apache/pluto/container/HeaderData.java
new file mode 100644
index 0000000..8283739
--- /dev/null
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/HeaderData.java
@@ -0,0 +1,42 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container;
+
+/**
+ * This class is a holder for the HTTP header data, cookies, and header section markup 
+ * provided by the portlet during header phase execution. 
+ * 
+ * @author Scott Nicklous
+ *
+ */
+public class HeaderData {
+
+   private String headSectionMarkup = "";
+
+   public String getHeadSectionMarkup() {
+      return headSectionMarkup;
+   }
+
+   public void setHeadSectionMarkup(String headSectionMarkup) {
+      this.headSectionMarkup = headSectionMarkup;
+   }
+   
+   
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletContainer.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletContainer.java b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletContainer.java
index 8529654..f986c9f 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletContainer.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletContainer.java
@@ -72,8 +72,9 @@ public interface PortletContainer {
      * @throws IOException               if the streaming causes an I/O problem
      * @throws PortletContainerException if the portlet container implementation
      *                                   has trouble fulfilling the request
+     * @return The header data 
      */
-    void doHeader(PortletWindow portletWindow,
+    HeaderData doHeader(PortletWindow portletWindow,
             HttpServletRequest request,
             HttpServletResponse response)
     throws PortletException, IOException, PortletContainerException;
@@ -83,15 +84,18 @@ public interface PortletContainer {
      * @param portletWindow the portlet Window
      * @param request               the servlet request
      * @param response              the servlet response
+     * @param renderHeaders         marks if doHeaders or render
      * @throws PortletException          if one portlet has trouble fulfilling
      *                                   the request
      * @throws IOException               if the streaming causes an I/O problem
      * @throws PortletContainerException if the portlet container implementation
      *                                   has trouble fulfilling the request
+     * @return The header data if it's a RENDER_HEADERS call, otherwise <code>null</code>                                   
      */
-    void doRender(PortletWindow portletWindow,
+    HeaderData doRender(PortletWindow portletWindow,
             HttpServletRequest request,
-            HttpServletResponse response)
+            HttpServletResponse response,
+            String renderHeaders)
     throws PortletException, IOException, PortletContainerException;
 
     /**

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletRequestContext.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletRequestContext.java b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletRequestContext.java
index 26b3860..322e427 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletRequestContext.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletRequestContext.java
@@ -76,4 +76,8 @@ public interface PortletRequestContext
      * @return
      */
     ActionParameters getActionParameters();
+    
+    // for render headers support
+    void setRenderHeaders(String renderHeaders);
+    String getRenderHeaders();
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletResponseContext.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletResponseContext.java b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletResponseContext.java
index 8d48f14..ef541ef 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletResponseContext.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletResponseContext.java
@@ -22,6 +22,7 @@ import javax.servlet.http.HttpServletResponse;
 
 import org.apache.pluto.container.PortletURLProvider.TYPE;
 import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
 /**
@@ -38,6 +39,13 @@ public interface PortletResponseContext
     HttpServletResponse getServletResponse();
     PortletWindow getPortletWindow();
     
+    // needed for header processing
+    void setLifecycle(String lifecycle);
+    String getLifecycle();
+    void setPropsAllowed(boolean isSetPropsAllowed);
+    boolean isSetPropsAllowed();
+    HeaderData getHeaderData();
+    
     ResourceURLProvider getResourceURLProvider();
     PortletURLProvider getPortletURLProvider(TYPE type);
     void addProperty(Cookie cookie);

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet3.java
----------------------------------------------------------------------
diff --git a/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet3.java b/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet3.java
index e8aaf53..d939d24 100644
--- a/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet3.java
+++ b/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet3.java
@@ -320,6 +320,10 @@ public class PortletServlet3 extends HttpServlet {
          // The requested method is RENDER: call Portlet.render(..)
          if (methodId == PortletInvokerService.METHOD_RENDER) {
             RenderRequest renderRequest = (RenderRequest) portletRequest;
+            String rh = requestContext.getRenderHeaders();
+            if (rh != null) {
+               renderRequest.setAttribute(PortletRequest.RENDER_PART, rh);
+            }
             RenderResponse renderResponse = (RenderResponse) portletResponse;
             filterManager.processFilter(renderRequest, renderResponse, portlet, portletContext);
          }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java
index 84b5146..c1be463 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java
@@ -37,6 +37,7 @@ import javax.servlet.http.HttpServletResponse;
 
 import org.apache.pluto.container.ContainerServices;
 import org.apache.pluto.container.FilterManager;
+import org.apache.pluto.container.HeaderData;
 import org.apache.pluto.container.PortletActionResponseContext;
 import org.apache.pluto.container.PortletContainer;
 import org.apache.pluto.container.PortletContainerException;
@@ -135,7 +136,7 @@ public class PortletContainerImpl implements PortletContainer
      * @see javax.portlet.Portlet#header(HeaderRequest, HeaderResponse)
      */
     @Override
-    public void doHeader(PortletWindow portletWindow,
+    public HeaderData doHeader(PortletWindow portletWindow,
             HttpServletRequest request,
             HttpServletResponse response)
     throws PortletException, IOException, PortletContainerException
@@ -151,15 +152,17 @@ public class PortletContainerImpl implements PortletContainer
 
         PortletRequestContext requestContext = rcService.getPortletHeaderRequestContext(this, request, response, portletWindow);
         PortletHeaderResponseContext responseContext = rcService.getPortletHeaderResponseContext(this, request, response, portletWindow);
+        responseContext.setPropsAllowed(true);
         HeaderRequest portletRequest = envService.createHeaderRequest(requestContext, responseContext);
         HeaderResponse portletResponse = envService.createHeaderResponse(responseContext);
+        HeaderData headerData = new HeaderData();
 
         FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.HEADER_PHASE);
 
         try
         {
             invoker.header(requestContext, portletRequest, portletResponse, filterManager);
-            // Mark portlet interaction is completed: backend implementation can flush response state now
+            headerData = responseContext.getHeaderData();
             responseContext.close();
         }
         finally
@@ -168,6 +171,7 @@ public class PortletContainerImpl implements PortletContainer
         }
 
         debugWithName("Portlet header done for: " + portletWindow.getPortletDefinition().getPortletName());
+        return headerData;
     }
 
 
@@ -184,9 +188,10 @@ public class PortletContainerImpl implements PortletContainer
      * @see javax.portlet.Portlet#render(RenderRequest, RenderResponse)
      */
     @Override
-    public void doRender(PortletWindow portletWindow,
+    public HeaderData doRender(PortletWindow portletWindow,
             HttpServletRequest request,
-            HttpServletResponse response)
+            HttpServletResponse response,
+            String renderHeaders)
     throws PortletException, IOException, PortletContainerException
     {
         ensureInitialized();
@@ -200,6 +205,15 @@ public class PortletContainerImpl implements PortletContainer
 
         PortletRequestContext requestContext = rcService.getPortletRenderRequestContext(this, request, response, portletWindow);
         PortletRenderResponseContext responseContext = rcService.getPortletRenderResponseContext(this, request, response, portletWindow);
+
+        if (renderHeaders != null && renderHeaders.equals(PortletRequest.RENDER_HEADERS)) {
+           responseContext.setPropsAllowed(true);
+        } else {
+           responseContext.setPropsAllowed(false);
+        }
+        requestContext.setRenderHeaders(renderHeaders);
+        HeaderData headerData = new HeaderData();
+
         RenderRequest portletRequest = envService.createRenderRequest(requestContext, responseContext);
         RenderResponse portletResponse = envService.createRenderResponse(responseContext);
 
@@ -208,7 +222,7 @@ public class PortletContainerImpl implements PortletContainer
         try
         {
             invoker.render(requestContext, portletRequest, portletResponse, filterManager);
-            // Mark portlet interaction is completed: backend implementation can flush response state now
+            headerData = responseContext.getHeaderData();
             responseContext.close();
         }
         finally
@@ -217,6 +231,7 @@ public class PortletContainerImpl implements PortletContainer
         }
 
         debugWithName("Portlet render done for: " + portletWindow.getPortletDefinition().getPortletName());
+        return headerData;
     }
 
     /**
@@ -247,6 +262,7 @@ public class PortletContainerImpl implements PortletContainer
 
         PortletResourceRequestContext requestContext = rcService.getPortletResourceRequestContext(this, request, response, portletWindow, pageState);
         PortletResourceResponseContext responseContext = rcService.getPortletResourceResponseContext(this, request, response, portletWindow);
+        responseContext.setPropsAllowed(true);
         ResourceRequest portletRequest = envService.createResourceRequest(requestContext, responseContext);
         ResourceResponse portletResponse = envService.createResourceResponse(responseContext, requestContext.getCacheability());
 
@@ -297,6 +313,7 @@ public class PortletContainerImpl implements PortletContainer
 
         PortletRequestContext requestContext = rcService.getPortletActionRequestContext(this, request, response, portletWindow);
         PortletActionResponseContext responseContext = rcService.getPortletActionResponseContext(this, request, response, portletWindow);
+        responseContext.setPropsAllowed(true);
         ActionRequest portletRequest = envService.createActionRequest(requestContext, responseContext);
         ActionResponse portletResponse = envService.createActionResponse(responseContext);
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortalContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortalContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortalContextImpl.java
index 9f1eeac..faec892 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortalContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortalContextImpl.java
@@ -1,166 +1,172 @@
-/*
- * 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.
- */
-package org.apache.pluto.driver.services.container;
-
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Vector;
-
-import javax.portlet.PortalContext;
-import javax.portlet.PortletMode;
-import javax.portlet.WindowState;
-
-import org.apache.pluto.driver.config.DriverConfiguration;
-
-/**
- * <code>PortalContext</code> implementation for the Pluto Portal Driver.
- */
-public class PortalContextImpl implements PortalContext {
-
-    /**
-     * The <code>DriverConfigurationImpl</code> from which this
-     * <code>PortalContext</code> recieves it's configuration information.
-     */
-    private DriverConfiguration config;
-
-    /**
-     * Portal information.
-     */
-    private String info = null;
-
-    /**
-     * Portal Properties
-     */
-    private HashMap properties = new HashMap();
-
-    /**
-     * Supported PortletModes.
-     */
-    private Vector portletModes;
-
-    /**
-     * Supported WindowStates.
-     */
-    private Vector windowStates;
-
-
-    /**
-     * Default Constructor.
-     * @param config
-     */
-    public PortalContextImpl(DriverConfiguration config) {
-        this.config = config;
-        reset();
-    }
-
-    /**
-     * Get a dynamic portal property.
-     * @param name
-     * @return the property value associated with the given key.
-     * @throws IllegalArgumentException if the specified name is null.
-     */
-    public String getProperty(String name) {
-        if (name == null) {
-            throw new IllegalArgumentException("Property name == null");
-        }
-
-        return (String) properties.get(name);
-    }
-
-
-    /**
-     * Get an enumeration containing all names of the portal properties.
-     * @return an enumeration of all keys to which properties are bound.
-     */
-    public Enumeration getPropertyNames() {
-        Vector names = new Vector(properties.keySet());
-        return names.elements();
-    }
-
-
-    /**
-     * Get an enumeration of all <code>PortletMode</code>s supported by this
-     * portal.
-     * @return enumeration of all supported portlet modes.
-     */
-    public Enumeration getSupportedPortletModes() {
-        if (portletModes == null) {
-            portletModes = new Vector();
-            Enumeration enumeration = new Vector(config.getSupportedPortletModes()).elements();
-            while (enumeration.hasMoreElements()) {
-                portletModes.add(
-                    new PortletMode(enumeration.nextElement().toString()));
-            }
-        }
-        return portletModes.elements();
-    }
-
-    /**
-     * Get an enumeration of all <code>WindowState</code>s supported by this
-     * portal.
-     * @return an enumeration of all supported window states.
-     */
-    public Enumeration getSupportedWindowStates() {
-        if (windowStates == null) {
-            windowStates = new Vector();
-            Enumeration enumeration = new Vector(config.getSupportedWindowStates()).elements();
-            while (enumeration.hasMoreElements()) {
-                windowStates.add(
-                    new WindowState(enumeration.nextElement().toString()));
-            }
-        }
-        return windowStates.elements();
-    }
-
-    /**
-     * Get the portal info for this portal.
-     * @return the portal information for this context.
-     */
-    public String getPortalInfo() {
-        if(info == null) {
-            info = config.getPortalName() + "/" + config.getPortalVersion();
-        }
-        return info;
-    }
-
-
-    // additional methods.
-    // methods used container internally to set
-
-    public void setProperty(String name, String value) {
-        if (name == null) {
-            throw new IllegalArgumentException("Property name == null");
-        }
-
-        properties.put(name, value);
-    }
-
-
-    /**
-     * reset all values to default portlet modes and window states; delete all
-     * properties and set the given portlet information as portlet info string.
-     */
-    public void reset() {
-        info = null;
-        properties.clear();
-    }
-
-    public DriverConfiguration getDriverConfiguration() {
-        return config;
-    }
-
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.driver.services.container;
+
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Vector;
+
+import javax.portlet.PortalContext;
+import javax.portlet.PortletMode;
+import javax.portlet.WindowState;
+
+import org.apache.pluto.driver.config.DriverConfiguration;
+
+/**
+ * <code>PortalContext</code> implementation for the Pluto Portal Driver.
+ */
+public class PortalContextImpl implements PortalContext {
+   
+
+    /**
+     * The <code>DriverConfigurationImpl</code> from which this
+     * <code>PortalContext</code> recieves it's configuration information.
+     */
+    private DriverConfiguration config;
+
+    /**
+     * Portal information.
+     */
+    private String info = null;
+
+    /**
+     * Portal Properties
+     */
+    private HashMap<String, String> properties = new HashMap<String, String>();
+
+    /**
+     * Supported PortletModes.
+     */
+    private Vector<PortletMode> portletModes;
+
+    /**
+     * Supported WindowStates.
+     */
+    private Vector<WindowState> windowStates;
+
+
+    /**
+     * Default Constructor.
+     * @param config
+     */
+    public PortalContextImpl(DriverConfiguration config) {
+        this.config = config;
+        reset();
+
+        // we now support render headers
+        properties.put(PortalContext.MARKUP_HEAD_ELEMENT_SUPPORT, "true");
+    }
+
+    /**
+     * Get a dynamic portal property.
+     * @param name
+     * @return the property value associated with the given key.
+     * @throws IllegalArgumentException if the specified name is null.
+     */
+    public String getProperty(String name) {
+        if (name == null) {
+            throw new IllegalArgumentException("Property name == null");
+        }
+
+        return (String) properties.get(name);
+    }
+
+
+    /**
+     * Get an enumeration containing all names of the portal properties.
+     * @return an enumeration of all keys to which properties are bound.
+     */
+    public Enumeration<String> getPropertyNames() {
+        Vector<String> names = new Vector<String>(properties.keySet());
+        return names.elements();
+    }
+
+
+    /**
+     * Get an enumeration of all <code>PortletMode</code>s supported by this
+     * portal.
+     * @return enumeration of all supported portlet modes.
+     */
+    public Enumeration<PortletMode> getSupportedPortletModes() {
+        if (portletModes == null) {
+            portletModes = new Vector<PortletMode>();
+            @SuppressWarnings({ "unchecked", "rawtypes" })
+            Enumeration enumeration = new Vector(config.getSupportedPortletModes()).elements();
+            while (enumeration.hasMoreElements()) {
+                portletModes.add(
+                    new PortletMode(enumeration.nextElement().toString()));
+            }
+        }
+        return portletModes.elements();
+    }
+
+    /**
+     * Get an enumeration of all <code>WindowState</code>s supported by this
+     * portal.
+     * @return an enumeration of all supported window states.
+     */
+    public Enumeration<WindowState> getSupportedWindowStates() {
+        if (windowStates == null) {
+            windowStates = new Vector<WindowState>();
+            @SuppressWarnings({ "unchecked", "rawtypes" })
+            Enumeration enumeration = new Vector(config.getSupportedWindowStates()).elements();
+            while (enumeration.hasMoreElements()) {
+                windowStates.add(
+                    new WindowState(enumeration.nextElement().toString()));
+            }
+        }
+        return windowStates.elements();
+    }
+
+    /**
+     * Get the portal info for this portal.
+     * @return the portal information for this context.
+     */
+    public String getPortalInfo() {
+        if(info == null) {
+            info = config.getPortalName() + "/" + config.getPortalVersion();
+        }
+        return info;
+    }
+
+
+    // additional methods.
+    // methods used container internally to set
+
+    public void setProperty(String name, String value) {
+        if (name == null) {
+            throw new IllegalArgumentException("Property name == null");
+        }
+
+        properties.put(name, value);
+    }
+
+
+    /**
+     * reset all values to default portlet modes and window states; delete all
+     * properties and set the given portlet information as portlet info string.
+     */
+    public void reset() {
+        info = null;
+        properties.clear();
+    }
+
+    public DriverConfiguration getDriverConfiguration() {
+        return config;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletActionResponseContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletActionResponseContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletActionResponseContextImpl.java
index a8b545a..51773f5 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletActionResponseContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletActionResponseContextImpl.java
@@ -1,100 +1,102 @@
-/*
- * 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.
- */
-package org.apache.pluto.driver.services.container;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.pluto.container.PortletActionResponseContext;
-import org.apache.pluto.container.PortletContainer;
-import org.apache.pluto.container.PortletWindow;
-import org.apache.pluto.driver.core.PortalRequestContext;
-import org.apache.pluto.driver.url.PortalURL;
-
-/**
- * @version $Id$
- *
- */
-public class PortletActionResponseContextImpl extends PortletStateAwareResponseContextImpl implements
-                PortletActionResponseContext
-{
-    private boolean redirect;
-    private String redirectLocation;
-    private String renderURLParamName;
-    
-    public PortletActionResponseContextImpl(PortletContainer container, HttpServletRequest containerRequest,
-                                            HttpServletResponse containerResponse, PortletWindow window)
-    {
-        super(container, containerRequest, containerResponse, window);
-    }
-
-    public String getResponseURL()
-    {
-        if (!isReleased())
-        {
-            close();
-            if (!redirect || renderURLParamName != null)
-            {
-                PortalURL url = PortalRequestContext.getContext(getServletRequest()).createPortalURL();
-                if (redirect)
-                {
-                    try
-                    {
-                        return redirectLocation + "?" + URLEncoder.encode(renderURLParamName, "UTF-8") + "=" + URLEncoder.encode(url.toURL(true), "UTF-8");
-                    }
-                    catch (UnsupportedEncodingException e)
-                    {
-                        // Cannot happen: UTF-8 is a buildin/required encoder
-                        return null;
-                    }
-                }
-                else
-                {
-                    return url.toURL(false);
-                }
-            }
-            else
-            {
-                return redirectLocation;
-            }
-        }
-        return null;
-    }
-
-    public boolean isRedirect()
-    {
-        return redirect;
-    }
-
-    public void setRedirect(String location)
-    {
-        setRedirect(location, null);
-    }
-
-    public void setRedirect(String location, String renderURLParamName)
-    {
-        if (!isClosed())
-        {
-            this.redirectLocation = location;
-            this.renderURLParamName = renderURLParamName;
-            this.redirect = true;
-        }
-    }
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.driver.services.container;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
+import javax.portlet.PortletRequest;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.pluto.container.PortletActionResponseContext;
+import org.apache.pluto.container.PortletContainer;
+import org.apache.pluto.container.PortletWindow;
+import org.apache.pluto.driver.core.PortalRequestContext;
+import org.apache.pluto.driver.url.PortalURL;
+
+/**
+ * @version $Id$
+ *
+ */
+public class PortletActionResponseContextImpl extends PortletStateAwareResponseContextImpl implements
+                PortletActionResponseContext
+{
+    private boolean redirect;
+    private String redirectLocation;
+    private String renderURLParamName;
+    
+    public PortletActionResponseContextImpl(PortletContainer container, HttpServletRequest containerRequest,
+                                            HttpServletResponse containerResponse, PortletWindow window)
+    {
+        super(container, containerRequest, containerResponse, window);
+        setLifecycle(PortletRequest.ACTION_PHASE);
+    }
+
+    public String getResponseURL()
+    {
+        if (!isReleased())
+        {
+            close();
+            if (!redirect || renderURLParamName != null)
+            {
+                PortalURL url = PortalRequestContext.getContext(getServletRequest()).createPortalURL();
+                if (redirect)
+                {
+                    try
+                    {
+                        return redirectLocation + "?" + URLEncoder.encode(renderURLParamName, "UTF-8") + "=" + URLEncoder.encode(url.toURL(true), "UTF-8");
+                    }
+                    catch (UnsupportedEncodingException e)
+                    {
+                        // Cannot happen: UTF-8 is a buildin/required encoder
+                        return null;
+                    }
+                }
+                else
+                {
+                    return url.toURL(false);
+                }
+            }
+            else
+            {
+                return redirectLocation;
+            }
+        }
+        return null;
+    }
+
+    public boolean isRedirect()
+    {
+        return redirect;
+    }
+
+    public void setRedirect(String location)
+    {
+        setRedirect(location, null);
+    }
+
+    public void setRedirect(String location, String renderURLParamName)
+    {
+        if (!isClosed())
+        {
+            this.redirectLocation = location;
+            this.renderURLParamName = renderURLParamName;
+            this.redirect = true;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletEventResponseContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletEventResponseContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletEventResponseContextImpl.java
index 9546578..d717aa8 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletEventResponseContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletEventResponseContextImpl.java
@@ -1,39 +1,41 @@
-/*
- * 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.
- */
-package org.apache.pluto.driver.services.container;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.pluto.container.PortletContainer;
-import org.apache.pluto.container.PortletEventResponseContext;
-import org.apache.pluto.container.PortletWindow;
-
-/**
- * @version $Id$
- *
- */
-public class PortletEventResponseContextImpl extends PortletStateAwareResponseContextImpl implements
-                PortletEventResponseContext
-{
-
-    public PortletEventResponseContextImpl(PortletContainer container, HttpServletRequest containerRequest,
-                                           HttpServletResponse containerResponse, PortletWindow window)
-    {
-        super(container, containerRequest, containerResponse, window);
-    }
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.driver.services.container;
+
+import javax.portlet.PortletRequest;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.pluto.container.PortletContainer;
+import org.apache.pluto.container.PortletEventResponseContext;
+import org.apache.pluto.container.PortletWindow;
+
+/**
+ * @version $Id$
+ *
+ */
+public class PortletEventResponseContextImpl extends PortletStateAwareResponseContextImpl implements
+                PortletEventResponseContext
+{
+
+    public PortletEventResponseContextImpl(PortletContainer container, HttpServletRequest containerRequest,
+                                           HttpServletResponse containerResponse, PortletWindow window)
+    {
+        super(container, containerRequest, containerResponse, window);
+        setLifecycle(PortletRequest.EVENT_PHASE);
+    }
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletHeaderResponseContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletHeaderResponseContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletHeaderResponseContextImpl.java
index 5825be5..e74b824 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletHeaderResponseContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletHeaderResponseContextImpl.java
@@ -19,6 +19,7 @@ package org.apache.pluto.driver.services.container;
 import java.util.Collection;
 
 import javax.portlet.PortletMode;
+import javax.portlet.PortletRequest;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
@@ -38,6 +39,7 @@ public class PortletHeaderResponseContextImpl extends PortletMimeResponseContext
                                             HttpServletResponse containerResponse, PortletWindow window)
     {
         super(container, containerRequest, containerResponse, window);
+        setLifecycle(PortletRequest.HEADER_PHASE);
     }
 
     public void setNextPossiblePortletModes(Collection<PortletMode> portletModes)

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRenderResponseContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRenderResponseContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRenderResponseContextImpl.java
index 5191783..02bfd20 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRenderResponseContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRenderResponseContextImpl.java
@@ -1,55 +1,57 @@
-/*
- * 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.
- */
-package org.apache.pluto.driver.services.container;
-
-import java.util.Collection;
-
-import javax.portlet.PortletMode;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.pluto.container.PortletContainer;
-import org.apache.pluto.container.PortletRenderResponseContext;
-import org.apache.pluto.container.PortletWindow;
-import org.apache.pluto.driver.AttributeKeys;
-
-/**
- * @version $Id$
- *
- */
-public class PortletRenderResponseContextImpl extends PortletMimeResponseContextImpl implements
-                PortletRenderResponseContext
-{
-    public PortletRenderResponseContextImpl(PortletContainer container, HttpServletRequest containerRequest,
-                                            HttpServletResponse containerResponse, PortletWindow window)
-    {
-        super(container, containerRequest, containerResponse, window);
-    }
-
-    public void setNextPossiblePortletModes(Collection<PortletMode> portletModes)
-    {
-        // not supported
-    }
-
-    public void setTitle(String title)
-    {
-        if (!isClosed())
-        {
-            getServletRequest().setAttribute(AttributeKeys.PORTLET_TITLE, title);
-        }
-    }
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.driver.services.container;
+
+import java.util.Collection;
+
+import javax.portlet.PortletMode;
+import javax.portlet.PortletRequest;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.pluto.container.PortletContainer;
+import org.apache.pluto.container.PortletRenderResponseContext;
+import org.apache.pluto.container.PortletWindow;
+import org.apache.pluto.driver.AttributeKeys;
+
+/**
+ * @version $Id$
+ *
+ */
+public class PortletRenderResponseContextImpl extends PortletMimeResponseContextImpl implements
+                PortletRenderResponseContext
+{
+    public PortletRenderResponseContextImpl(PortletContainer container, HttpServletRequest containerRequest,
+                                            HttpServletResponse containerResponse, PortletWindow window)
+    {
+        super(container, containerRequest, containerResponse, window);
+        setLifecycle(PortletRequest.RENDER_PHASE);
+    }
+
+    public void setNextPossiblePortletModes(Collection<PortletMode> portletModes)
+    {
+        // not supported
+    }
+
+    public void setTitle(String title)
+    {
+        if (!isClosed())
+        {
+            getServletRequest().setAttribute(AttributeKeys.PORTLET_TITLE, title);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextImpl.java
index 2d2eb23..694b955 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextImpl.java
@@ -62,8 +62,9 @@ public class PortletRequestContextImpl implements PortletRequestContext {
    private PortletConfig       portletConfig;
    private ServletContext      servletContext;
    private Cookie              cookies[];
+   private String              renderHeaders = null;      
    
-   // make sure thethese classes are loaded first by the container classloader
+   // make sure these classes are loaded first by the container classloader
    // so that the logs from these classes land in the Pluto log file.
    static {
       PortletURLProviderImpl.load();
@@ -95,6 +96,16 @@ public class PortletRequestContextImpl implements PortletRequestContext {
       this.paramFactory = url.getPortletParameterFactory();
    }
 
+   @Override
+   public String getRenderHeaders() {
+      return renderHeaders;
+   }
+
+   @Override
+   public void setRenderHeaders(String renderHeaders) {
+      this.renderHeaders = renderHeaders;
+   }
+
    protected boolean isReservedAttributeName(String name) {
       return name.startsWith("javax.servlet.");
    }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResourceResponseContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResourceResponseContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResourceResponseContextImpl.java
index e098316..94818ed 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResourceResponseContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResourceResponseContextImpl.java
@@ -18,6 +18,7 @@ package org.apache.pluto.driver.services.container;
 
 import java.util.Locale;
 
+import javax.portlet.PortletRequest;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
@@ -42,6 +43,7 @@ public class PortletResourceResponseContextImpl extends PortletMimeResponseConte
                                               HttpServletResponse containerResponse, PortletWindow window)
     {        
         super(container, containerRequest, containerResponse, window);
+        setLifecycle(PortletRequest.RESOURCE_PHASE);
     }
 
     public void setCharacterEncoding(String charset)

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
index 7093bcf..491a539 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
@@ -16,164 +16,257 @@
  */
 package org.apache.pluto.driver.services.container;
 
+import static javax.portlet.PortletRequest.HEADER_PHASE;
+import static javax.portlet.PortletRequest.RENDER_PHASE;
+
+import java.io.StringWriter;
+import java.util.HashSet;
+import java.util.Set;
+
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
 
+import org.apache.pluto.container.HeaderData;
 import org.apache.pluto.container.PortletContainer;
 import org.apache.pluto.container.PortletResponseContext;
 import org.apache.pluto.container.PortletURLProvider;
+import org.apache.pluto.container.PortletURLProvider.TYPE;
 import org.apache.pluto.container.PortletWindow;
 import org.apache.pluto.container.ResourceURLProvider;
-import org.apache.pluto.container.PortletURLProvider.TYPE;
 import org.apache.pluto.driver.core.PortalRequestContext;
 import org.apache.pluto.driver.url.PortalURL;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.w3c.dom.DOMException;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
 /**
  * @version $Id$
- *
+ * 
  */
-public abstract class PortletResponseContextImpl implements PortletResponseContext
-{
-    private PortletContainer container;
-    private HttpServletRequest containerRequest;
-    private HttpServletResponse containerResponse;
-    private HttpServletRequest servletRequest;
-    private HttpServletResponse servletResponse;
-    private PortletWindow window;
-    private PortalURL portalURL;
-    private boolean closed;
-    private boolean released;
-    
-    public PortletResponseContextImpl(PortletContainer container, HttpServletRequest containerRequest,
-                                      HttpServletResponse containerResponse, PortletWindow window)
-    {
-        this.container = container;
-        this.containerRequest = containerRequest;
-        this.containerResponse = containerResponse;
-        this.window = window;
-        this.portalURL = PortalRequestContext.getContext(containerRequest).createPortalURL();
-    }
-    
-    protected PortalURL getPortalURL()
-    {
-        return portalURL;
-    }
-
-    protected boolean isClosed()
-    {
-        return closed;
-    }
-    
-    protected boolean isReleased()
-    {
-        return released;
-    }
-
-    public void init(HttpServletRequest servletRequest, HttpServletResponse servletResponse)
-    {
-        this.servletRequest = servletRequest;
-        this.servletResponse = servletResponse;
-    }
-    
-    public void addProperty(Cookie cookie)
-    {
-        if (!isClosed())
-        {
-            servletResponse.addCookie(cookie);
-        }
-    }
-
-    public void addProperty(String key, Element element)
-    {
-        // not supported 
-    }
-
-    public void addProperty(String key, String value)
-    {
-        // not supported
-    }
-    
-    public Element createElement(String tagName) throws DOMException
-    {
-        DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
-        DocumentBuilder docBuilder;
-        
-        try
-        {
-            docBuilder = dbfac.newDocumentBuilder();
-            Document doc = docBuilder.newDocument();
-            return doc.createElement(tagName);
-        }
-        catch (ParserConfigurationException e)
-        {
-            throw new DOMException((short) 0, "Initialization failure");
-        }
-    }
-
-    public void close()
-    {
-        closed = true;
-    }
-
-    public PortletContainer getContainer()
-    {
-        return container;
-    }
-
-    public PortletWindow getPortletWindow()
-    {
-        return window;
-    }
-
-    public HttpServletRequest getContainerRequest()
-    {
-        return containerRequest;
-    }
-
-    public HttpServletResponse getContainerResponse()
-    {
-        return containerResponse;
-    }
-
-    public HttpServletRequest getServletRequest()
-    {
-        return servletRequest;
-    }
-
-    public HttpServletResponse getServletResponse()
-    {
-        return servletResponse;
-    }
-
-    public void release()
-    {
-        closed = true;
-        released = true;
-        container = null;
-        servletRequest = null;
-        servletResponse = null;
-        window = null;
-    }
-
-    public void setProperty(String key, String value)
-    {
-        // not supported
-    }
-
-    public ResourceURLProvider getResourceURLProvider()
-    {
-        return isReleased() ? null : new ResourceURLProviderImpl(servletRequest,window);
-    }
-
-    public PortletURLProvider getPortletURLProvider(TYPE type)
-    {
-        return isClosed() ? null : new PortletURLProviderImpl(getPortalURL(), type, getPortletWindow());
-    }
+public abstract class PortletResponseContextImpl implements PortletResponseContext {
+
+   /** Logger. */
+   private static final Logger      LOG               = LoggerFactory.getLogger(PortletResponseContextImpl.class);
+   private static final boolean     isDebug           = LOG.isDebugEnabled();
+
+   private PortletContainer         container;
+   private HttpServletRequest       containerRequest;
+   private HttpServletResponse      containerResponse;
+   private HttpServletRequest       servletRequest;
+   private HttpServletResponse      servletResponse;
+   private PortletWindow            window;
+   private PortalURL                portalURL;
+   private boolean                  closed;
+   private boolean                  released;
+
+   // needed for processing of properties based on request type
+   private String                   lifecycle;
+   private boolean                  isSetPropsAllowed = false;
+
+   private Document                 doc               = null;
+   private Element                  root              = null;
+   private static final String      ROOT_ELEMENT      = "rootElement";
+   private static final Set<String> allowedTags       = new HashSet<String>();
+   static {
+      allowedTags.add("META");
+      allowedTags.add("LINK");
+      allowedTags.add("STYLE");
+      allowedTags.add("SCRIPT");
+      allowedTags.add("NOSCRIPT");
+   }
+   
+   // holder for the header data
+   protected HeaderData headerData = new HeaderData();
+
+   public PortletResponseContextImpl(PortletContainer container, HttpServletRequest containerRequest,
+         HttpServletResponse containerResponse, PortletWindow window) {
+      this.container = container;
+      this.containerRequest = containerRequest;
+      this.containerResponse = containerResponse;
+      this.window = window;
+      this.portalURL = PortalRequestContext.getContext(containerRequest).createPortalURL();
+   }
+
+   public String getLifecycle() {
+      return lifecycle;
+   }
+
+   public void setLifecycle(String lifecycle) {
+      this.lifecycle = lifecycle;
+   }
+
+   public boolean isSetPropsAllowed() {
+      return isSetPropsAllowed;
+   }
+
+   public void setPropsAllowed(boolean isSetPropsAllowed) {
+      this.isSetPropsAllowed = isSetPropsAllowed;
+   }
+   
+   /**
+    * returns the header data provided by the portlet during header phase execution.
+    */
+   @Override
+   public HeaderData getHeaderData() {
+      headerData.setHeadSectionMarkup(getTags());
+      return headerData;
+   }
+
+   /**
+    * returns a string containing any tags that should go into the document head section.
+    * 
+    * @return String containing the tags, or the empty string if no tags are available.
+    */
+   private String getTags() {
+      String tags = "";
+      if (doc != null) {
+         DOMSource src = new DOMSource(doc);
+         StringWriter sw = new StringWriter();
+         StreamResult res = new StreamResult(sw);
+         try {
+
+            Transformer trans = TransformerFactory.newInstance().newTransformer();
+            trans.setOutputProperty(OutputKeys.INDENT, "yes");
+            trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+            trans.setOutputProperty(OutputKeys.METHOD, "html");
+
+            trans.transform(src, res);
+
+            String regex = "(?:\\s*)</{0,1}" + ROOT_ELEMENT + ">(?:\\s*)";
+            tags = sw.toString().replaceAll(regex, "");
+
+         } catch (Exception e) {
+            StringBuilder txt = new StringBuilder();
+            txt.append("Error converting tags to string. Exception: ");
+            txt.append(e.toString());
+            LOG.warn(txt.toString());
+         }
+      }
+
+      if (isDebug) {
+         StringBuilder sb = new StringBuilder();
+         sb.append("returning tags: ");
+         sb.append((tags.length()>0) ? "\n" + tags : "");
+         LOG.debug(sb.toString());
+      }
+
+      return tags;
+   }
+
+   protected PortalURL getPortalURL() {
+      return portalURL;
+   }
+
+   protected boolean isClosed() {
+      return closed;
+   }
+
+   protected boolean isReleased() {
+      return released;
+   }
+
+   public void init(HttpServletRequest servletRequest, HttpServletResponse servletResponse) {
+      this.servletRequest = servletRequest;
+      this.servletResponse = servletResponse;
+   }
+
+   public void addProperty(Cookie cookie) {
+      if (!isClosed()) {
+         servletResponse.addCookie(cookie);
+      }
+   }
+
+   /**
+    * saves elements for adding to the head section markup if header request or render request
+    */
+   public void addProperty(String key, Element element) {
+      if (!isClosed() && isSetPropsAllowed && element != null && root != null) {
+         if (lifecycle.equals(RENDER_PHASE) || lifecycle.equals(HEADER_PHASE)) {
+            String tag = element.getTagName().toUpperCase();
+            if (allowedTags.contains(tag)) {
+               root.appendChild(element);
+            }
+         }
+      }
+   }
+
+   public void addProperty(String key, String value) {
+      // not supported
+   }
+
+   public Element createElement(String tagName) throws DOMException {
+
+      try {
+         if (doc == null) {
+            DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
+            DocumentBuilder docBuilder = dbfac.newDocumentBuilder();
+            doc = docBuilder.newDocument();
+            root = doc.createElement(ROOT_ELEMENT);
+            doc.appendChild(root);
+         }
+         return doc.createElement(tagName);
+      } catch (ParserConfigurationException e) {
+         throw new DOMException((short) 0, "Initialization failure");
+      }
+   }
+
+   public void close() {
+      closed = true;
+   }
+
+   public PortletContainer getContainer() {
+      return container;
+   }
+
+   public PortletWindow getPortletWindow() {
+      return window;
+   }
+
+   public HttpServletRequest getContainerRequest() {
+      return containerRequest;
+   }
+
+   public HttpServletResponse getContainerResponse() {
+      return containerResponse;
+   }
+
+   public HttpServletRequest getServletRequest() {
+      return servletRequest;
+   }
+
+   public HttpServletResponse getServletResponse() {
+      return servletResponse;
+   }
+
+   public void release() {
+      closed = true;
+      released = true;
+      container = null;
+      servletRequest = null;
+      servletResponse = null;
+      window = null;
+   }
+
+   public void setProperty(String key, String value) {
+      // not supported
+   }
+
+   public ResourceURLProvider getResourceURLProvider() {
+      return isReleased() ? null : new ResourceURLProviderImpl(servletRequest, window);
+   }
+
+   public PortletURLProvider getPortletURLProvider(TYPE type) {
+      return isClosed() ? null : new PortletURLProviderImpl(getPortalURL(), type, getPortletWindow());
+   }
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8f9bca1b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/AttributeKeys.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/AttributeKeys.java b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/AttributeKeys.java
index bf3c4f7..bf11239 100644
--- a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/AttributeKeys.java
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/AttributeKeys.java
@@ -1,64 +1,70 @@
-/*
- * 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.
- */
-package org.apache.pluto.driver;
-
-/**
- * Constants used as attribute keys to bind values to servlet context or servlet
- * request.
- *
- * @version 1.0
- * @since Sep 25, 2004
- */
-public class AttributeKeys {
-
-    /**
-     * Attribute Key used to bind the application's driver config to the
-     * ServletContext.
-     */
-    public static final String DRIVER_CONFIG = "driverConfig";
-
-    /**
-     * Attribute Key used to bind the application's driver admin config
-     * to the ServletContext.
-     */
-    public static final String DRIVER_ADMIN_CONFIG = "driverAdminConfig";
-
-    /**
-     * Attribute Key used to bind the application's portlet container to the
-     * ServletContext.
-     */
-    public static final String PORTLET_CONTAINER = "portletContainer";
-
-    /** Attribute key used to bind the current page to servlet request. */
-    public static final String CURRENT_PAGE = "currentPage";
-
-    /** Attribute key used to bind the portlet title to servlet request. */
-    public static final String PORTLET_TITLE =
-    		"org.apache.pluto.driver.DynamicPortletTitle";
-
-    public static final String PORTAL_URL_PARSER = "PORTAL_URL_PARSER";
-
-    // Constructor -------------------------------------------------------------
-
-    /**
-     * Private constructor that prevents external instantiation.
-     */
-    private AttributeKeys() {
-
-    }
-}
-
+/*
+ * 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.
+ */
+package org.apache.pluto.driver;
+
+/**
+ * Constants used as attribute keys to bind values to servlet context or servlet
+ * request.
+ *
+ * @version 1.0
+ * @since Sep 25, 2004
+ */
+public class AttributeKeys {
+
+    /**
+     * Attribute Key used to bind the application's driver config to the
+     * ServletContext.
+     */
+    public static final String DRIVER_CONFIG = "driverConfig";
+
+    /**
+     * Attribute Key used to bind the application's driver admin config
+     * to the ServletContext.
+     */
+    public static final String DRIVER_ADMIN_CONFIG = "driverAdminConfig";
+
+    /**
+     * Attribute Key used to bind the application's portlet container to the
+     * ServletContext.
+     */
+    public static final String PORTLET_CONTAINER = "portletContainer";
+
+    /** Attribute key used to bind the current page to servlet request. */
+    public static final String CURRENT_PAGE = "currentPage";
+
+    /** Attribute key used to bind the portlet title to servlet request. */
+    public static final String PORTLET_TITLE =
+    		"org.apache.pluto.driver.DynamicPortletTitle";
+
+    public static final String PORTAL_URL_PARSER = "PORTAL_URL_PARSER";
+    
+    /**
+     * For passing the head section markup collected from the portlets 
+     * to the aggregation JSP.
+     */
+    public static final String HEAD_SECTION_MARKUP = "headMarkup";
+
+    // Constructor -------------------------------------------------------------
+
+    /**
+     * Private constructor that prevents external instantiation.
+     */
+    private AttributeKeys() {
+
+    }
+}
+


[22/38] portals-pluto git commit: Started step-wise refinement to move to ServletContainerInitializer for initializing the portlet applications and pluto portlet container. Added container initializer that reads the portlet DD. modified the descriptor re

Posted by ms...@apache.org.
Started step-wise refinement to move to ServletContainerInitializer for
initializing the portlet applications and pluto portlet container. Added
container initializer that reads the portlet DD. modified the descriptor
registry to use the config read ny the initializer.


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/15356530
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/15356530
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/15356530

Branch: refs/heads/V3Prototype
Commit: 15356530d5e9161350bf7ab3a3ba97539968c6c5
Parents: 094449e
Author: Scott Nicklous <ms...@apache.org>
Authored: Tue Nov 17 15:18:36 2015 +0100
Committer: Scott Nicklous <ms...@apache.org>
Committed: Tue Nov 17 15:18:36 2015 +0100

----------------------------------------------------------------------
 .../pluto/maven/InstallationDependency.java     |   1 +
 pluto-container-driver-api/pom.xml              | 126 ++--
 .../driver/PortletContainerInitializer.java     | 110 +++
 .../javax.servlet.ServletContainerInitializer   |   1 +
 pluto-container/pom.xml                         |   2 +-
 .../impl/HttpServletPortletResponseWrapper.java | 678 ++++++++++---------
 .../om/portlet/impl/ConfigurationHolder.java    |   2 +
 .../util/DummyServletOutputStream.java          | 244 +++----
 .../util/PrintWriterServletOutputStream.java    | 278 ++++----
 pluto-portal-driver-impl/pom.xml                |   7 +
 pluto-portal-driver/pom.xml                     |   8 +
 .../container/PortletDescriptorRegistry.java    | 298 ++++----
 pluto-portal/pom.xml                            |   1 +
 pluto-testsuite/pom.xml                         |   4 +-
 pom.xml                                         |   8 +-
 15 files changed, 985 insertions(+), 783 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/15356530/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/InstallationDependency.java
----------------------------------------------------------------------
diff --git a/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/InstallationDependency.java b/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/InstallationDependency.java
index 5854075..8aec848 100644
--- a/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/InstallationDependency.java
+++ b/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/InstallationDependency.java
@@ -144,6 +144,7 @@ class InstallationDependency {
 
     static {
         SHARED.add(PORTLET_API);
+        SHARED.add(CONTAINER);
         SHARED.add(CONTAINER_API);
         SHARED.add(CONTAINER_DRIVER_API);
         SHARED.add(TAGLIB);

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/15356530/pluto-container-driver-api/pom.xml
----------------------------------------------------------------------
diff --git a/pluto-container-driver-api/pom.xml b/pluto-container-driver-api/pom.xml
index a4bad16..915bf55 100644
--- a/pluto-container-driver-api/pom.xml
+++ b/pluto-container-driver-api/pom.xml
@@ -1,62 +1,70 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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.portals.pluto</groupId>
-    <artifactId>pluto</artifactId>
-    <version>3.0-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>pluto-container-driver-api</artifactId>
-  <packaging>bundle</packaging>
-  <name>Apache Pluto Container Driver API</name>
-
-  <dependencies>
-    <!-- Specification Libraries =========================================== -->
-    <dependency>
-      <groupId>org.apache.portals.pluto</groupId>
-      <artifactId>portlet-api</artifactId>
-      <version>${project.version}</version>
-      <scope>provided</scope>
-    </dependency>
-    
-    <dependency>
-      <groupId>org.apache.tomcat</groupId>
-      <artifactId>tomcat-servlet-api</artifactId>
-      <scope>provided</scope>
-    </dependency>
-
-    <!--  CCPP Libraries -->
-    <dependency>
-      <groupId>javax.ccpp</groupId>
-      <artifactId>ccpp</artifactId>
-      <scope>provided</scope>
-    </dependency>
-
-    <dependency>
+<!-- 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.portals.pluto</groupId>
-      <artifactId>pluto-container-api</artifactId>
-      <version>${project.version}</version>
-      <scope>compile</scope>
-    </dependency>
-  </dependencies>
+      <artifactId>pluto</artifactId>
+      <version>3.0-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>pluto-container-driver-api</artifactId>
+   <packaging>bundle</packaging>
+   <name>Apache Pluto Container Driver API</name>
+
+   <dependencies>
+      <!-- Specification Libraries =========================================== -->
+      <dependency>
+         <groupId>org.apache.portals.pluto</groupId>
+         <artifactId>portlet-api</artifactId>
+         <version>${project.version}</version>
+         <scope>provided</scope>
+      </dependency>
+
+      <dependency>
+         <groupId>org.apache.tomcat</groupId>
+         <artifactId>tomcat-servlet-api</artifactId>
+         <scope>provided</scope>
+      </dependency>
+
+      <!-- CCPP Libraries -->
+      <dependency>
+         <groupId>javax.ccpp</groupId>
+         <artifactId>ccpp</artifactId>
+         <scope>provided</scope>
+      </dependency>
+
+      <dependency>
+         <groupId>org.apache.portals.pluto</groupId>
+         <artifactId>pluto-container-api</artifactId>
+         <version>${project.version}</version>
+         <scope>compile</scope>
+      </dependency>
+
+      <dependency>
+         <groupId>org.apache.portals.pluto</groupId>
+         <artifactId>pluto-container</artifactId>
+         <version>${project.version}</version>
+         <scope>provided</scope>
+      </dependency>
+
+      <!-- Other Support Libraries =========================================== -->
+      <dependency>
+         <groupId>org.slf4j</groupId>
+         <artifactId>slf4j-api</artifactId>
+         <scope>provided</scope>
+      </dependency>
+   </dependencies>
 </project>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/15356530/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletContainerInitializer.java
----------------------------------------------------------------------
diff --git a/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletContainerInitializer.java b/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletContainerInitializer.java
new file mode 100644
index 0000000..efb8d79
--- /dev/null
+++ b/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletContainerInitializer.java
@@ -0,0 +1,110 @@
+/*  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.
+ */
+
+package org.apache.pluto.container.driver;
+
+import java.io.InputStream;
+import java.util.Set;
+
+import javax.servlet.ServletContainerInitializer;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Servlet container initializer that reads the configuration and adds the
+ * portlet servlets for any portlets contained in the application.
+ * 
+ * @author Scott Nicklous
+ * 
+ */
+// @HandlesTypes({PortletApplication.class, PortletConfiguration.class})
+public class PortletContainerInitializer implements ServletContainerInitializer {
+
+   private static final String WEB_XML     = "/WEB-INF/web.xml";
+   private static final String PORTLET_XML = "/WEB-INF/portlet.xml";
+
+   /** Logger. */
+   private static final Logger LOG         = LoggerFactory
+                                                 .getLogger(PortletContainerInitializer.class);
+   private static boolean      isDebug     = LOG.isDebugEnabled();
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see javax.servlet.ServletContainerInitializer#onStartup(java.util.Set,
+    * javax.servlet.ServletContext)
+    */
+   @Override
+   public void onStartup(Set<Class<?>> classes, ServletContext ctx)
+         throws ServletException {
+
+      InputStream win = ctx.getResourceAsStream(WEB_XML);
+      InputStream pin = ctx.getResourceAsStream(PORTLET_XML);
+
+      if (isDebug) {
+         StringBuilder txt = new StringBuilder(128);
+         txt.append("§§§ ServletContainerInitializer. ctx path: ").append(
+               ctx.getContextPath());
+         txt.append(", servlet ctx name: ").append(ctx.getServletContextName());
+         txt.append(", # portlet annotations: ").append(
+               (classes != null) ? classes.size() : "null");
+         txt.append(", found web.xml: ").append(win != null);
+         txt.append(", found portlet.xml: ").append(pin != null);
+         LOG.debug(txt.toString());
+      }
+
+      // If portlet configuration is available, parse it and launch the portlet
+      // servlets
+      if ((classes != null && classes.size() > 0) || pin != null) {
+
+         try {
+            ConfigurationHolder holder = new ConfigurationHolder();
+
+            if (classes != null) {
+               // digest any & all configuration annotations
+            }
+
+            if (pin != null) {
+               // parse the portlet deployment descriptor
+               holder.processPortletDD(pin);
+            }
+
+            if (win != null) {
+               // parse the web app deployment descriptor
+               holder.processWebDD(win);
+            }
+
+            ctx.setAttribute(ConfigurationHolder.ATTRIB_NAME, holder);
+            
+         } catch (Exception e) {
+            StringBuilder txt = new StringBuilder(128);
+            txt.append("Exception reading portlet application configuration");
+            txt.append(", Servlet ctx name: ").append(
+                  ctx.getServletContextName());
+            txt.append(", Exception: ").append(e.getLocalizedMessage());
+            LOG.error(txt.toString());
+         }
+      }
+
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/15356530/pluto-container-driver-api/src/main/resources/META-INF/services/javax.servlet.ServletContainerInitializer
----------------------------------------------------------------------
diff --git a/pluto-container-driver-api/src/main/resources/META-INF/services/javax.servlet.ServletContainerInitializer b/pluto-container-driver-api/src/main/resources/META-INF/services/javax.servlet.ServletContainerInitializer
new file mode 100644
index 0000000..9471946
--- /dev/null
+++ b/pluto-container-driver-api/src/main/resources/META-INF/services/javax.servlet.ServletContainerInitializer
@@ -0,0 +1 @@
+org.apache.pluto.container.driver.PortletContainerInitializer
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/15356530/pluto-container/pom.xml
----------------------------------------------------------------------
diff --git a/pluto-container/pom.xml b/pluto-container/pom.xml
index e3129c0..1108ace 100644
--- a/pluto-container/pom.xml
+++ b/pluto-container/pom.xml
@@ -37,7 +37,7 @@
       <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
-         <scope>compile</scope>
+         <scope>provided</scope>
       </dependency>
 
       <!-- Specification Libraries =========================================== -->

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/15356530/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletResponseWrapper.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletResponseWrapper.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletResponseWrapper.java
index 010fedd..6b93fda 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletResponseWrapper.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletResponseWrapper.java
@@ -1,333 +1,345 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.impl;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.util.Locale;
-
-import javax.portlet.ActionResponse;
-import javax.portlet.MimeResponse;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletResponse;
-import javax.portlet.ResourceResponse;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpServletResponseWrapper;
-
-import org.apache.pluto.container.util.DummyPrintWriter;
-import org.apache.pluto.container.util.DummyServletOutputStream;
-
-/**
- * @author <a href="mailto:ate@douma.nu">Ate Douma</a>
- * @version $Id$
- */
-public class HttpServletPortletResponseWrapper extends HttpServletResponseWrapper
-{
-    private final boolean forwarded;
-    private final PortletResponse portletResponse;
-    private final MimeResponse mimeResponse;
-    private final String lifecyclePhase;
-    private boolean included;
-    private OutputStream outputStream;
-    private ServletOutputStream servletOutputStream;
-    
-    public HttpServletPortletResponseWrapper(HttpServletResponse response, PortletRequest portletRequest, PortletResponse portletResponse, boolean included)
-    {
-        super(response);
-        this.portletResponse = portletResponse;
-        this.lifecyclePhase = (String)portletRequest.getAttribute(PortletRequest.LIFECYCLE_PHASE);
-        this.mimeResponse = PortletRequest.RENDER_PHASE.equals(lifecyclePhase) || PortletRequest.RESOURCE_PHASE.equals(lifecyclePhase) ? (MimeResponse)portletResponse : null;
-        this.forwarded = !included;
-        this.included = included;
-    }
-    
-    public void setIncluded(boolean included)
-    {
-        this.included = included;
-    }
-    
-    @Override
-    public void addCookie(Cookie cookie)
-    {
-        if (forwarded && !included)
-        {
-            portletResponse.addProperty(cookie);
-        }
-    }
-
-    @Override
-    public void addDateHeader(String name, long date)
-    {
-        if (forwarded && !included && mimeResponse != null)
-        {
-            mimeResponse.addProperty(name, Long.toString(date));
-        }
-    }
-
-    @Override
-    public void addHeader(String name, String value)
-    {
-        if (forwarded && !included && mimeResponse != null)
-        {
-            mimeResponse.addProperty(name, value);
-        }
-    }
-
-    @Override
-    public void addIntHeader(String name, int value)
-    {
-        if (forwarded && !included && mimeResponse != null)
-        {
-            mimeResponse.addProperty(name, Integer.toString(value));
-        }
-    }
-
-    @Override
-    public boolean containsHeader(String name)
-    {
-        return false;
-    }
-
-    @Override
-    public String encodeRedirectUrl(String url)
-    {
-        return null;
-    }
-
-    @Override
-    public String encodeRedirectURL(String url)
-    {
-        return null;
-    }
-
-    @Override
-    public String encodeUrl(String url)
-    {
-        return encodeURL(url);
-    }
-
-    @Override
-    public String encodeURL(String url)
-    {
-        if (url != null && url.indexOf("://") == -1 && !url.startsWith("/"))
-        {
-            // The Portlet Spec only allows URL encoding for absolute or full path URIs
-            // Letting this pass through thus would lead to an IllegalArgumentException been thrown.
-
-            // TODO: figure out how (if not impossible) this can be (pre)fixed properly
-            return url;
-        }
-        return portletResponse.encodeURL(url);
-    }
-
-    @Override
-    public void sendError(int sc, String msg) throws IOException
-    {
-    }
-
-    @Override
-    public void sendError(int sc) throws IOException
-    {
-    }
-
-    @Override
-    public void sendRedirect(String location) throws IOException
-    {
-        if (forwarded && !included && PortletRequest.ACTION_PHASE.equals(lifecyclePhase))
-        {
-            ((ActionResponse)portletResponse).sendRedirect(location);
-        }
-    }
-
-    @Override
-    public void setDateHeader(String name, long date)
-    {
-        if (forwarded && !included && mimeResponse != null)
-        {
-            mimeResponse.setProperty(name, Long.toString(date));
-        }
-    }
-
-    @Override
-    public void setHeader(String name, String value)
-    {
-        if (forwarded && !included && mimeResponse != null)
-        {
-            mimeResponse.setProperty(name, value);
-        }
-    }
-
-    @Override
-    public void setIntHeader(String name, int value)
-    {
-        if (forwarded && !included && mimeResponse != null)
-        {
-            mimeResponse.setProperty(name, Integer.toString(value));
-        }
-    }
-
-    @Override
-    public void setStatus(int sc, String sm)
-    {
-        setStatus(sc);
-    }
-
-    @Override
-    public void setStatus(int sc)
-    {
-        if (forwarded && !included && PortletRequest.RESOURCE_PHASE.equals(lifecyclePhase))
-        {
-            mimeResponse.setProperty(ResourceResponse.HTTP_STATUS_CODE, Integer.toString(sc));
-        }
-    }
-
-    @Override
-    public void flushBuffer() throws IOException
-    {
-        if (mimeResponse != null)
-        {
-            mimeResponse.flushBuffer();
-        }            
-    }
-
-    @Override
-    public int getBufferSize()
-    {
-        return mimeResponse != null ? mimeResponse.getBufferSize() : 0;
-    }
-
-    @Override
-    public String getCharacterEncoding()
-    {
-        return mimeResponse != null ? mimeResponse.getCharacterEncoding() : null;
-    }
-
-    @Override
-    public String getContentType()
-    {
-        return mimeResponse != null ? mimeResponse.getContentType() : null;
-    }
-
-    @Override
-    public Locale getLocale()
-    {
-        return mimeResponse != null ? mimeResponse.getLocale() : null;
-    }
-
-    @Override
-    public ServletOutputStream getOutputStream() throws IOException
-    {
-    	if (servletOutputStream == null)
-    	{
-        	outputStream = mimeResponse != null ? mimeResponse.getPortletOutputStream() : DummyServletOutputStream.getInstance();
-        	if (outputStream instanceof ServletOutputStream)
-        	{
-        		servletOutputStream = (ServletOutputStream)outputStream;
-        	}
-        	else
-        	{
-        		servletOutputStream = new ServletOutputStream()
-        		{
-					@Override
-					public void write(int b) throws IOException 
-					{
-						outputStream.write(b);
-					}
-        		};
-        	}
-    	}
-    	return servletOutputStream;
-    }
-
-    @Override
-    public PrintWriter getWriter() throws IOException
-    {
-        return mimeResponse != null ? mimeResponse.getWriter() : DummyPrintWriter.getInstance();
-    }
-
-    @Override
-    public boolean isCommitted()
-    {
-        return mimeResponse != null ? mimeResponse.isCommitted() : forwarded ? false : true;
-    }
-
-    @Override
-    public void reset()
-    {
-        if (mimeResponse != null)
-        {
-            mimeResponse.reset();
-        }
-    }
-
-    @Override
-    public void resetBuffer()
-    {
-        if (mimeResponse != null)
-        {
-            mimeResponse.resetBuffer();
-        }
-    }
-
-    @Override
-    public void setBufferSize(int size)
-    {
-        if (mimeResponse != null)
-        {
-            mimeResponse.setBufferSize(size);
-        }
-    }
-
-    @Override
-    public void setCharacterEncoding(String charset)
-    {
-        if (forwarded && !included && PortletRequest.RESOURCE_PHASE.equals(lifecyclePhase))
-        {
-            ((ResourceResponse)portletResponse).setCharacterEncoding(charset);
-        }
-    }
-
-    @Override
-    public void setContentLength(int len)
-    {
-        if (forwarded && !included && PortletRequest.RESOURCE_PHASE.equals(lifecyclePhase))
-        {
-            ((ResourceResponse)portletResponse).setContentLength(len);
-        }
-    }
-
-    @Override
-    public void setContentType(String type)
-    {
-        if (forwarded && !included && mimeResponse != null)
-        {
-            mimeResponse.setContentType(type);
-        }
-    }
-
-    @Override
-    public void setLocale(Locale loc)
-    {
-        if (forwarded && !included && PortletRequest.RESOURCE_PHASE.equals(lifecyclePhase))
-        {
-            ((ResourceResponse)portletResponse).setLocale(loc);
-        }
-    }    
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.container.impl;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.Locale;
+
+import javax.portlet.ActionResponse;
+import javax.portlet.MimeResponse;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletResponse;
+import javax.portlet.ResourceResponse;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.WriteListener;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletResponseWrapper;
+
+import org.apache.pluto.container.util.DummyPrintWriter;
+import org.apache.pluto.container.util.DummyServletOutputStream;
+
+/**
+ * @author <a href="mailto:ate@douma.nu">Ate Douma</a>
+ * @version $Id$
+ */
+public class HttpServletPortletResponseWrapper extends HttpServletResponseWrapper
+{
+    private final boolean forwarded;
+    private final PortletResponse portletResponse;
+    private final MimeResponse mimeResponse;
+    private final String lifecyclePhase;
+    private boolean included;
+    private OutputStream outputStream;
+    private ServletOutputStream servletOutputStream;
+    
+    public HttpServletPortletResponseWrapper(HttpServletResponse response, PortletRequest portletRequest, PortletResponse portletResponse, boolean included)
+    {
+        super(response);
+        this.portletResponse = portletResponse;
+        this.lifecyclePhase = (String)portletRequest.getAttribute(PortletRequest.LIFECYCLE_PHASE);
+        this.mimeResponse = PortletRequest.RENDER_PHASE.equals(lifecyclePhase) || PortletRequest.RESOURCE_PHASE.equals(lifecyclePhase) ? (MimeResponse)portletResponse : null;
+        this.forwarded = !included;
+        this.included = included;
+    }
+    
+    public void setIncluded(boolean included)
+    {
+        this.included = included;
+    }
+    
+    @Override
+    public void addCookie(Cookie cookie)
+    {
+        if (forwarded && !included)
+        {
+            portletResponse.addProperty(cookie);
+        }
+    }
+
+    @Override
+    public void addDateHeader(String name, long date)
+    {
+        if (forwarded && !included && mimeResponse != null)
+        {
+            mimeResponse.addProperty(name, Long.toString(date));
+        }
+    }
+
+    @Override
+    public void addHeader(String name, String value)
+    {
+        if (forwarded && !included && mimeResponse != null)
+        {
+            mimeResponse.addProperty(name, value);
+        }
+    }
+
+    @Override
+    public void addIntHeader(String name, int value)
+    {
+        if (forwarded && !included && mimeResponse != null)
+        {
+            mimeResponse.addProperty(name, Integer.toString(value));
+        }
+    }
+
+    @Override
+    public boolean containsHeader(String name)
+    {
+        return false;
+    }
+
+    @Override
+    public String encodeRedirectUrl(String url)
+    {
+        return null;
+    }
+
+    @Override
+    public String encodeRedirectURL(String url)
+    {
+        return null;
+    }
+
+    @Override
+    public String encodeUrl(String url)
+    {
+        return encodeURL(url);
+    }
+
+    @Override
+    public String encodeURL(String url)
+    {
+        if (url != null && url.indexOf("://") == -1 && !url.startsWith("/"))
+        {
+            // The Portlet Spec only allows URL encoding for absolute or full path URIs
+            // Letting this pass through thus would lead to an IllegalArgumentException been thrown.
+
+            // TODO: figure out how (if not impossible) this can be (pre)fixed properly
+            return url;
+        }
+        return portletResponse.encodeURL(url);
+    }
+
+    @Override
+    public void sendError(int sc, String msg) throws IOException
+    {
+    }
+
+    @Override
+    public void sendError(int sc) throws IOException
+    {
+    }
+
+    @Override
+    public void sendRedirect(String location) throws IOException
+    {
+        if (forwarded && !included && PortletRequest.ACTION_PHASE.equals(lifecyclePhase))
+        {
+            ((ActionResponse)portletResponse).sendRedirect(location);
+        }
+    }
+
+    @Override
+    public void setDateHeader(String name, long date)
+    {
+        if (forwarded && !included && mimeResponse != null)
+        {
+            mimeResponse.setProperty(name, Long.toString(date));
+        }
+    }
+
+    @Override
+    public void setHeader(String name, String value)
+    {
+        if (forwarded && !included && mimeResponse != null)
+        {
+            mimeResponse.setProperty(name, value);
+        }
+    }
+
+    @Override
+    public void setIntHeader(String name, int value)
+    {
+        if (forwarded && !included && mimeResponse != null)
+        {
+            mimeResponse.setProperty(name, Integer.toString(value));
+        }
+    }
+
+    @Override
+    public void setStatus(int sc, String sm)
+    {
+        setStatus(sc);
+    }
+
+    @Override
+    public void setStatus(int sc)
+    {
+        if (forwarded && !included && PortletRequest.RESOURCE_PHASE.equals(lifecyclePhase))
+        {
+            mimeResponse.setProperty(ResourceResponse.HTTP_STATUS_CODE, Integer.toString(sc));
+        }
+    }
+
+    @Override
+    public void flushBuffer() throws IOException
+    {
+        if (mimeResponse != null)
+        {
+            mimeResponse.flushBuffer();
+        }            
+    }
+
+    @Override
+    public int getBufferSize()
+    {
+        return mimeResponse != null ? mimeResponse.getBufferSize() : 0;
+    }
+
+    @Override
+    public String getCharacterEncoding()
+    {
+        return mimeResponse != null ? mimeResponse.getCharacterEncoding() : null;
+    }
+
+    @Override
+    public String getContentType()
+    {
+        return mimeResponse != null ? mimeResponse.getContentType() : null;
+    }
+
+    @Override
+    public Locale getLocale()
+    {
+        return mimeResponse != null ? mimeResponse.getLocale() : null;
+    }
+
+    @Override
+    public ServletOutputStream getOutputStream() throws IOException
+    {
+    	if (servletOutputStream == null)
+    	{
+        	outputStream = mimeResponse != null ? mimeResponse.getPortletOutputStream() : DummyServletOutputStream.getInstance();
+        	if (outputStream instanceof ServletOutputStream)
+        	{
+        		servletOutputStream = (ServletOutputStream)outputStream;
+        	}
+        	else
+        	{
+        		servletOutputStream = new ServletOutputStream()
+        		{
+					@Override
+					public void write(int b) throws IOException 
+					{
+						outputStream.write(b);
+					}
+
+               @Override
+               public boolean isReady() {
+                  // Servlet 3.1 API. Not implemented.
+                  return true;
+               }
+
+               @Override
+               public void setWriteListener(WriteListener arg0) {
+                  // Servlet 3.1 API. Not implemented.
+               }
+        		};
+        	}
+    	}
+    	return servletOutputStream;
+    }
+
+    @Override
+    public PrintWriter getWriter() throws IOException
+    {
+        return mimeResponse != null ? mimeResponse.getWriter() : DummyPrintWriter.getInstance();
+    }
+
+    @Override
+    public boolean isCommitted()
+    {
+        return mimeResponse != null ? mimeResponse.isCommitted() : forwarded ? false : true;
+    }
+
+    @Override
+    public void reset()
+    {
+        if (mimeResponse != null)
+        {
+            mimeResponse.reset();
+        }
+    }
+
+    @Override
+    public void resetBuffer()
+    {
+        if (mimeResponse != null)
+        {
+            mimeResponse.resetBuffer();
+        }
+    }
+
+    @Override
+    public void setBufferSize(int size)
+    {
+        if (mimeResponse != null)
+        {
+            mimeResponse.setBufferSize(size);
+        }
+    }
+
+    @Override
+    public void setCharacterEncoding(String charset)
+    {
+        if (forwarded && !included && PortletRequest.RESOURCE_PHASE.equals(lifecyclePhase))
+        {
+            ((ResourceResponse)portletResponse).setCharacterEncoding(charset);
+        }
+    }
+
+    @Override
+    public void setContentLength(int len)
+    {
+        if (forwarded && !included && PortletRequest.RESOURCE_PHASE.equals(lifecyclePhase))
+        {
+            ((ResourceResponse)portletResponse).setContentLength(len);
+        }
+    }
+
+    @Override
+    public void setContentType(String type)
+    {
+        if (forwarded && !included && mimeResponse != null)
+        {
+            mimeResponse.setContentType(type);
+        }
+    }
+
+    @Override
+    public void setLocale(Locale loc)
+    {
+        if (forwarded && !included && PortletRequest.RESOURCE_PHASE.equals(lifecyclePhase))
+        {
+            ((ResourceResponse)portletResponse).setLocale(loc);
+        }
+    }    
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/15356530/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java
index f93904e..1acf42b 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java
@@ -43,6 +43,8 @@ import org.slf4j.LoggerFactory;
  * 
  */
 public class ConfigurationHolder {
+   
+   public static final String ATTRIB_NAME = "PortletAppConfig";
 
    private PortletApplicationDefinition   pad = null;
    private ConfigurationProcessor         jcp = null;

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/15356530/pluto-container/src/main/java/org/apache/pluto/container/util/DummyServletOutputStream.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/util/DummyServletOutputStream.java b/pluto-container/src/main/java/org/apache/pluto/container/util/DummyServletOutputStream.java
index 5cd9821..5da4dbe 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/util/DummyServletOutputStream.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/util/DummyServletOutputStream.java
@@ -1,117 +1,127 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.util;
-
-import java.io.IOException;
-
-import javax.servlet.ServletOutputStream;
-
-public final class DummyServletOutputStream extends ServletOutputStream{
-
-    private static final ServletOutputStream instance = new DummyServletOutputStream();
-    
-    public static ServletOutputStream getInstance()
-    {
-        return instance;
-    }
-    
-    private DummyServletOutputStream()
-    {
-    }
-    
-	@Override
-	public void write(int b) throws IOException {
-	}
-
-	@Override
-	public void print(boolean arg0) throws IOException {
-	}
-
-	@Override
-	public void print(char arg0) throws IOException {
-	}
-
-	@Override
-	public void print(double arg0) throws IOException {
-	}
-
-	@Override
-	public void print(float arg0) throws IOException {
-	}
-
-	@Override
-	public void print(int arg0) throws IOException {
-	}
-
-	@Override
-	public void print(long arg0) throws IOException {
-	}
-
-	@Override
-	public void print(String arg0) throws IOException {
-	}
-
-	@Override
-	public void println() throws IOException {
-	}
-
-	@Override
-	public void println(boolean arg0) throws IOException {
-	}
-
-	@Override
-	public void println(char arg0) throws IOException {
-	}
-
-	@Override
-	public void println(double arg0) throws IOException {
-	}
-
-	@Override
-	public void println(float arg0) throws IOException {
-	}
-
-	@Override
-	public void println(int arg0) throws IOException {
-	}
-
-	@Override
-	public void println(long arg0) throws IOException {
-	}
-
-	@Override
-	public void println(String arg0) throws IOException {
-	}
-
-	@Override
-	public void close() throws IOException {
-	}
-
-	@Override
-	public void flush() throws IOException {
-	}
-
-	@Override
-	public void write(byte[] b, int off, int len) throws IOException {
-	}
-
-	@Override
-	public void write(byte[] b) throws IOException {
-	}
-
-	
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.container.util;
+
+import java.io.IOException;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.WriteListener;
+
+public final class DummyServletOutputStream extends ServletOutputStream{
+
+    private static final ServletOutputStream instance = new DummyServletOutputStream();
+    
+    public static ServletOutputStream getInstance()
+    {
+        return instance;
+    }
+    
+    private DummyServletOutputStream()
+    {
+    }
+    
+	@Override
+	public void write(int b) throws IOException {
+	}
+
+	@Override
+	public void print(boolean arg0) throws IOException {
+	}
+
+	@Override
+	public void print(char arg0) throws IOException {
+	}
+
+	@Override
+	public void print(double arg0) throws IOException {
+	}
+
+	@Override
+	public void print(float arg0) throws IOException {
+	}
+
+	@Override
+	public void print(int arg0) throws IOException {
+	}
+
+	@Override
+	public void print(long arg0) throws IOException {
+	}
+
+	@Override
+	public void print(String arg0) throws IOException {
+	}
+
+	@Override
+	public void println() throws IOException {
+	}
+
+	@Override
+	public void println(boolean arg0) throws IOException {
+	}
+
+	@Override
+	public void println(char arg0) throws IOException {
+	}
+
+	@Override
+	public void println(double arg0) throws IOException {
+	}
+
+	@Override
+	public void println(float arg0) throws IOException {
+	}
+
+	@Override
+	public void println(int arg0) throws IOException {
+	}
+
+	@Override
+	public void println(long arg0) throws IOException {
+	}
+
+	@Override
+	public void println(String arg0) throws IOException {
+	}
+
+	@Override
+	public void close() throws IOException {
+	}
+
+	@Override
+	public void flush() throws IOException {
+	}
+
+	@Override
+	public void write(byte[] b, int off, int len) throws IOException {
+	}
+
+	@Override
+	public void write(byte[] b) throws IOException {
+	}
+
+   @Override
+   public boolean isReady() {
+      return true;
+   }
+
+   @Override
+   public void setWriteListener(WriteListener arg0) {
+   }
+
+	
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/15356530/pluto-container/src/main/java/org/apache/pluto/container/util/PrintWriterServletOutputStream.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/util/PrintWriterServletOutputStream.java b/pluto-container/src/main/java/org/apache/pluto/container/util/PrintWriterServletOutputStream.java
index 6975d6d..93ae3f2 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/util/PrintWriterServletOutputStream.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/util/PrintWriterServletOutputStream.java
@@ -1,133 +1,145 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.util;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.UnsupportedEncodingException;
-
-import javax.servlet.ServletOutputStream;
-
-/**
- * This is a specialized class implementing a ServletOutputStream that works in
- * conjunction with a PrintWriter to send data to the browser. It is used when a
- * J2EE server throws an IllegalStateException when you call getOutputStream on
- * a response which someone has previously called getWriter on.
- */
-public class PrintWriterServletOutputStream extends ServletOutputStream {
-
-    /**
-     * The PrintWriter that is wrapped on top of the base input stream
-     */
-    PrintWriter mPrintWriter;
-
-    /**
-     * The character encoding of the response.
-     */
-    private String characterEncoding;
-
-    public PrintWriterServletOutputStream(PrintWriter pw, String encoding)
-    {
-        super();
-        mPrintWriter = pw;
-        characterEncoding = encoding;
-    }
-    
-    /**
-     * Writes an array of bytes
-     * @param pBuf the array to be written
-     * @throws IOException if an I/O error occurred
-     */
-    public void write(byte[] pBuf) throws IOException {
-        this.write(pBuf, 0, pBuf.length);
-    }
-
-    /**
-     * Writes a single byte to the output stream
-     */
-    public void write(int pVal) throws IOException {
-        mPrintWriter.write(pVal);
-    }
-
-    /**
-     * Writes a subarray of bytes
-     * @param pBuf    the array to be written
-     * @param pOffset the offset into the array
-     * @param pLength the number of bytes to write
-     * @throws IOException if an I/O error occurred
-     */
-    public void write(byte[] pBuf, int pOffset, int pLength)
-        throws IOException {
-        String strValue = null;
-        if(characterEncoding != null && !"".equals(characterEncoding)) {
-            try {
-                strValue = new String(pBuf, pOffset, pLength, characterEncoding);
-            }
-            catch(UnsupportedEncodingException uee) {
-                // ignore and allow the null to handle.
-            }
-        }
-
-        if(strValue == null) {
-            strValue = new String(pBuf, pOffset, pLength);
-        }
-
-        mPrintWriter.write(strValue);
-    }
-
-    /**
-     * Flushes the stream, writing any buffered output bytes
-     * @throws IOException if an I/O error occurred
-     */
-    public void flush() throws IOException {
-        mPrintWriter.flush();
-    }
-
-    /**
-     * Closes the stream
-     * @throws IOException if an I/O error occurred
-     */
-    public void close() throws IOException {
-        mPrintWriter.close();
-    }
-
-    /**
-     * Prints a string.
-     * @param pVal the String to be printed
-     * @throws IOException if an I/O error has occurred
-     */
-    public void print(String pVal) throws IOException {
-        mPrintWriter.print(pVal);
-    }
-
-    /**
-     * Prints an string followed by a CRLF.
-     * @param pVal the String to be printed
-     * @throws IOException if an I/O error has occurred
-     */
-    public void println(String pVal) throws IOException {
-        mPrintWriter.println(pVal);
-    }
-
-    /**
-     * Prints a CRLF
-     * @throws IOException if an I/O error has occurred
-     */
-    public void println() throws IOException {
-        mPrintWriter.println();
-    }
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.container.util;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.WriteListener;
+
+/**
+ * This is a specialized class implementing a ServletOutputStream that works in
+ * conjunction with a PrintWriter to send data to the browser. It is used when a
+ * J2EE server throws an IllegalStateException when you call getOutputStream on
+ * a response which someone has previously called getWriter on.
+ */
+public class PrintWriterServletOutputStream extends ServletOutputStream {
+
+    /**
+     * The PrintWriter that is wrapped on top of the base input stream
+     */
+    PrintWriter mPrintWriter;
+
+    /**
+     * The character encoding of the response.
+     */
+    private String characterEncoding;
+
+    public PrintWriterServletOutputStream(PrintWriter pw, String encoding)
+    {
+        super();
+        mPrintWriter = pw;
+        characterEncoding = encoding;
+    }
+    
+    /**
+     * Writes an array of bytes
+     * @param pBuf the array to be written
+     * @throws IOException if an I/O error occurred
+     */
+    public void write(byte[] pBuf) throws IOException {
+        this.write(pBuf, 0, pBuf.length);
+    }
+
+    /**
+     * Writes a single byte to the output stream
+     */
+    public void write(int pVal) throws IOException {
+        mPrintWriter.write(pVal);
+    }
+
+    /**
+     * Writes a subarray of bytes
+     * @param pBuf    the array to be written
+     * @param pOffset the offset into the array
+     * @param pLength the number of bytes to write
+     * @throws IOException if an I/O error occurred
+     */
+    public void write(byte[] pBuf, int pOffset, int pLength)
+        throws IOException {
+        String strValue = null;
+        if(characterEncoding != null && !"".equals(characterEncoding)) {
+            try {
+                strValue = new String(pBuf, pOffset, pLength, characterEncoding);
+            }
+            catch(UnsupportedEncodingException uee) {
+                // ignore and allow the null to handle.
+            }
+        }
+
+        if(strValue == null) {
+            strValue = new String(pBuf, pOffset, pLength);
+        }
+
+        mPrintWriter.write(strValue);
+    }
+
+    /**
+     * Flushes the stream, writing any buffered output bytes
+     * @throws IOException if an I/O error occurred
+     */
+    public void flush() throws IOException {
+        mPrintWriter.flush();
+    }
+
+    /**
+     * Closes the stream
+     * @throws IOException if an I/O error occurred
+     */
+    public void close() throws IOException {
+        mPrintWriter.close();
+    }
+
+    /**
+     * Prints a string.
+     * @param pVal the String to be printed
+     * @throws IOException if an I/O error has occurred
+     */
+    public void print(String pVal) throws IOException {
+        mPrintWriter.print(pVal);
+    }
+
+    /**
+     * Prints an string followed by a CRLF.
+     * @param pVal the String to be printed
+     * @throws IOException if an I/O error has occurred
+     */
+    public void println(String pVal) throws IOException {
+        mPrintWriter.println(pVal);
+    }
+
+    /**
+     * Prints a CRLF
+     * @throws IOException if an I/O error has occurred
+     */
+    public void println() throws IOException {
+        mPrintWriter.println();
+    }
+
+   @Override
+   public boolean isReady() {
+      // Servlet 3.1 API. not implemented; always ready. 
+      return true;
+   }
+
+   @Override
+   public void setWriteListener(WriteListener arg0) {
+      // Servlet 3.1 API. not implemented.
+   }
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/15356530/pluto-portal-driver-impl/pom.xml
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/pom.xml b/pluto-portal-driver-impl/pom.xml
index 786e16c..1102f58 100644
--- a/pluto-portal-driver-impl/pom.xml
+++ b/pluto-portal-driver-impl/pom.xml
@@ -74,6 +74,13 @@
       <artifactId>junit</artifactId>
       <scope>test</scope>
     </dependency>
+    
+    <!-- Other Support Libraries =========================================== -->
+    <dependency>
+       <groupId>org.slf4j</groupId>
+       <artifactId>slf4j-api</artifactId>
+       <scope>provided</scope>
+    </dependency>
 
     <dependency>
       <groupId>org.apache.portals.pluto</groupId>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/15356530/pluto-portal-driver/pom.xml
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/pom.xml b/pluto-portal-driver/pom.xml
index 8457627..ad8b481 100644
--- a/pluto-portal-driver/pom.xml
+++ b/pluto-portal-driver/pom.xml
@@ -129,6 +129,14 @@
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
     </dependency>
+    
+    <!-- Other Support Libraries =========================================== -->
+    <dependency>
+       <groupId>org.slf4j</groupId>
+       <artifactId>slf4j-api</artifactId>
+       <scope>provided</scope>
+    </dependency>
+
 
     <!-- Testing Libraries ================================================= -->
     <dependency>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/15356530/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortletDescriptorRegistry.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortletDescriptorRegistry.java b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortletDescriptorRegistry.java
index b84f2e9..79094e7 100644
--- a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortletDescriptorRegistry.java
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortletDescriptorRegistry.java
@@ -1,134 +1,164 @@
-/*
- * 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.
- */
-package org.apache.pluto.driver.container;
-
-import java.io.InputStream;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-import javax.servlet.ServletContext;
-
-import org.apache.pluto.container.PortletAppDescriptorService;
-import org.apache.pluto.container.PortletContainerException;
-import org.apache.pluto.container.driver.PlutoConfigurationException;
-import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
-import org.apache.pluto.container.util.StringManager;
-
-/**
- * Simple caching mechanism used to manage portlet descriptors. This mechanism
- * takes special considerations to make sure that the cache is invalidated for
- * any ServletContext that is destroyed, thus allowing for a the context to be
- * redeployed.
- *
- * NOTE: This should only be used internally.  Do not access it from embedding
- * portals, instead, utilize the PortletRegistryService.
- *
- * @version 1.0
- * @since Nov 3, 2004
- */
-public class PortletDescriptorRegistry {
-
-    /** Web deployment descriptor location. */
-    private static final String WEB_XML = "/WEB-INF/web.xml";
-
-    /** Portlet deployment descriptor location. */
-    private static final String PORTLET_XML = "/WEB-INF/portlet.xml";
-
-    /** Exception Messages. */
-    private static final StringManager EXCEPTIONS = StringManager.getManager(
-            PortletDescriptorRegistry.class.getPackage().getName());
-
-    // Private Member Variables ------------------------------------------------
-
-    /** The portlet application descriptor service. */
-    private final PortletAppDescriptorService portletDDService;
-
-    /**
-     * Cache of descriptors.  WeakHashMap is used so that
-     * once the context is destroyed (kinda), the cache is eliminated.
-     * Ideally we'd use a ServletContextListener, but at this
-     * point I'm wondering if we really want to add another
-     * config requirement in the servlet xml? Hmm. . .
-     */
-    private final Map<ServletContext, PortletApplicationDefinition> cache = new WeakHashMap<ServletContext, PortletApplicationDefinition>();
-
-
-    // Constructor -------------------------------------------------------------
-
-    //someone didn't want this accessible externally.
-    PortletDescriptorRegistry(PortletAppDescriptorService portletDDService)
-    {
-        this.portletDDService = portletDDService;
-    }
-
-    // Public Methods ----------------------------------------------------------
-
-    /**
-     * Retrieve the Portlet Application Deployment Descriptor for the given
-     * servlet context.  Create it if it does not allready exist.
-     *
-     * @param servletContext  the servlet context.
-     * @return The portlet application deployment descriptor.
-     * @throws PortletContainerException if the descriptor can not be found or parsed
-     */
-    public PortletApplicationDefinition getPortletAppDD(ServletContext servletContext, String name, String contextPath)
-    throws PortletContainerException {
-        PortletApplicationDefinition portletApp = cache.get(servletContext);
-        if (portletApp == null) {
-        	portletApp = createDefinition(servletContext, name, contextPath);
-            cache.put(servletContext, portletApp);
-        }
-        return portletApp;
-    }
-
-
-    // Private Methods ---------------------------------------------------------
-
-    /**
-     * Creates the portlet.xml deployment descriptor representation.
-     *
-     * @param servletContext  the servlet context for which the DD is requested.
-     * @return the Portlet Application Deployment Descriptor.
-     * @throws PortletContainerException
-     */
-    private PortletApplicationDefinition createDefinition(ServletContext servletContext, String name, String contextPath)
-    throws PortletContainerException {
-        PortletApplicationDefinition portletApp = null;
-        try {
-            InputStream paIn = servletContext.getResourceAsStream(PORTLET_XML);
-            InputStream webIn = servletContext.getResourceAsStream(WEB_XML);
-            if (paIn == null) {
-                throw new PortletContainerException("Cannot find '" + PORTLET_XML +
-                    "'. Are you sure it is in the deployed package?");
-            }
-            if (webIn == null) {
-                throw new PortletContainerException("Cannot find '" + WEB_XML +
-                    "'. Are you sure it is in the deployed package?");
-            }
-            portletApp = portletDDService.read(name, contextPath, paIn);
-            portletDDService.mergeWebDescriptor(portletApp, webIn);
-        } catch (Exception ex) {
-            throw new PortletContainerException(EXCEPTIONS.getString(
-                    "error.context.descriptor.load",
-                    new String[] { servletContext.getServletContextName() }),
-                    ex);
-        }
-        return portletApp;
-    }
-
-}
-
+/*
+ * 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.
+ */
+package org.apache.pluto.driver.container;
+
+import java.io.InputStream;
+import java.util.Map;
+import java.util.WeakHashMap;
+
+import javax.servlet.ServletContext;
+
+import org.apache.pluto.container.PortletAppDescriptorService;
+import org.apache.pluto.container.PortletContainerException;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.util.StringManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Simple caching mechanism used to manage portlet descriptors. This mechanism
+ * takes special considerations to make sure that the cache is invalidated for
+ * any ServletContext that is destroyed, thus allowing for a the context to be
+ * redeployed.
+ * 
+ * NOTE: This should only be used internally. Do not access it from embedding
+ * portals, instead, utilize the PortletRegistryService.
+ * 
+ * @version 1.0
+ * @since Nov 3, 2004
+ */
+public class PortletDescriptorRegistry {
+   
+   /** Logger. */
+   private static final Logger LOG = LoggerFactory
+         .getLogger(PortletDescriptorRegistry.class);
+   private static final boolean isDebug = LOG.isDebugEnabled();
+   
+
+   /** Web deployment descriptor location. */
+   private static final String WEB_XML     = "/WEB-INF/web.xml";
+
+   /** Portlet deployment descriptor location. */
+   private static final String PORTLET_XML = "/WEB-INF/portlet.xml";
+
+   /** Exception Messages. */
+   private static final StringManager EXCEPTIONS  = StringManager.getManager(PortletDescriptorRegistry.class
+                                                                                           .getPackage()
+                                                                                           .getName());
+
+   // Private Member Variables ------------------------------------------------
+
+   /** The portlet application descriptor service. */
+   private final PortletAppDescriptorService                       portletDDService;
+
+   /**
+    * Cache of descriptors. WeakHashMap is used so that once the context is
+    * destroyed (kinda), the cache is eliminated. Ideally we'd use a
+    * ServletContextListener, but at this point I'm wondering if we really want
+    * to add another config requirement in the servlet xml? Hmm. . .
+    */
+   private final Map<ServletContext, PortletApplicationDefinition> cache       = new WeakHashMap<ServletContext, PortletApplicationDefinition>();
+
+   // Constructor -------------------------------------------------------------
+
+   // someone didn't want this accessible externally.
+   PortletDescriptorRegistry(PortletAppDescriptorService portletDDService) {
+      this.portletDDService = portletDDService;
+   }
+
+   // Public Methods ----------------------------------------------------------
+
+   /**
+    * Retrieve the Portlet Application Deployment Descriptor for the given
+    * servlet context. Create it if it does not allready exist.
+    * 
+    * @param servletContext
+    *           the servlet context.
+    * @return The portlet application deployment descriptor.
+    * @throws PortletContainerException
+    *            if the descriptor can not be found or parsed
+    */
+   public PortletApplicationDefinition getPortletAppDD(
+         ServletContext servletContext, String name, String contextPath)
+         throws PortletContainerException {
+      PortletApplicationDefinition portletApp = cache.get(servletContext);
+      if (portletApp == null) {
+         portletApp = createDefinition(servletContext, name, contextPath);
+         cache.put(servletContext, portletApp);
+      }
+      return portletApp;
+   }
+
+   // Private Methods ---------------------------------------------------------
+
+   /**
+    * Creates the portlet.xml deployment descriptor representation.
+    * 
+    * @param servletContext
+    *           the servlet context for which the DD is requested.
+    * @return the Portlet Application Deployment Descriptor.
+    * @throws PortletContainerException
+    */
+   private PortletApplicationDefinition createDefinition(
+         ServletContext servletContext, String name, String contextPath)
+         throws PortletContainerException {
+      
+      PortletApplicationDefinition portletApp = null;
+      ConfigurationHolder holder = (ConfigurationHolder) servletContext
+            .getAttribute(ConfigurationHolder.ATTRIB_NAME);
+      
+      if (holder != null) {
+         
+         if (isDebug) {
+            LOG.debug("Registering config initializer. ctx path: " + contextPath);
+         }
+         
+         portletApp = holder.getPad();
+         portletApp.setContextPath(contextPath);
+         portletApp.setName(name);
+         
+      } else {
+         
+         if (isDebug) {
+            LOG.debug("Reading portlet config. ctx path: " + contextPath);
+         }
+
+         try {
+            InputStream paIn = servletContext.getResourceAsStream(PORTLET_XML);
+            InputStream webIn = servletContext.getResourceAsStream(WEB_XML);
+            if (paIn == null) {
+               throw new PortletContainerException("Cannot find '"
+                     + PORTLET_XML
+                     + "'. Are you sure it is in the deployed package?");
+            }
+            if (webIn == null) {
+               throw new PortletContainerException("Cannot find '" + WEB_XML
+                     + "'. Are you sure it is in the deployed package?");
+            }
+            portletApp = portletDDService.read(name, contextPath, paIn);
+            portletDDService.mergeWebDescriptor(portletApp, webIn);
+         } catch (Exception ex) {
+            throw new PortletContainerException(EXCEPTIONS.getString(
+                  "error.context.descriptor.load",
+                  new String[] { servletContext.getServletContextName() }), ex);
+         }
+      }
+      return portletApp;
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/15356530/pluto-portal/pom.xml
----------------------------------------------------------------------
diff --git a/pluto-portal/pom.xml b/pluto-portal/pom.xml
index 8364b94..f523a3c 100644
--- a/pluto-portal/pom.xml
+++ b/pluto-portal/pom.xml
@@ -35,6 +35,7 @@
       <groupId>org.apache.portals.pluto</groupId>
       <artifactId>pluto-container</artifactId>
       <version>${project.version}</version>
+      <scope>provided</scope>
       <exclusions>
         <exclusion>
           <groupId>org.apache.portals.pluto</groupId>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/15356530/pluto-testsuite/pom.xml
----------------------------------------------------------------------
diff --git a/pluto-testsuite/pom.xml b/pluto-testsuite/pom.xml
index bb4f09d..3ed6d48 100644
--- a/pluto-testsuite/pom.xml
+++ b/pluto-testsuite/pom.xml
@@ -72,12 +72,12 @@
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
-            <scope>${dependency.scope}</scope>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-jdk14</artifactId>
-            <scope>${dependency.scope}</scope>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/15356530/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d262334..7a6a2e8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -257,10 +257,10 @@ generate mailto links. -->
     <javax.portlet.version.major>3</javax.portlet.version.major>
     <javax.portlet.version.minor>0</javax.portlet.version.minor>
     <portals.portlet-api.version>${project.version}</portals.portlet-api.version>
-    <servlet-api.version>7.0.50</servlet-api.version>
-    <jsp-api.version>7.0.50</jsp-api.version>
-    <jstl.version>7.0.50</jstl.version>
-    <el-api.version>7.0.50</el-api.version>
+    <servlet-api.version>8.0.28</servlet-api.version>
+    <jsp-api.version>8.0.28</jsp-api.version>
+    <jstl.version>8.0.28</jstl.version>
+    <el-api.version>8.0.28</el-api.version>
     <taglibs.standard.version>1.2.1</taglibs.standard.version>
     <jaxb.version>2.1</jaxb.version>
     <jaxb-impl.version>2.1.9</jaxb-impl.version>


[19/38] portals-pluto git commit: fixed bugs. added tracing.

Posted by ms...@apache.org.
fixed bugs. added tracing.


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/536c8608
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/536c8608
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/536c8608

Branch: refs/heads/V3Prototype
Commit: 536c8608a205bbee462528ecc58c194564cf67e2
Parents: 802dadb
Author: Scott Nicklous <ms...@apache.org>
Authored: Tue Oct 27 14:26:47 2015 +0100
Committer: Scott Nicklous <ms...@apache.org>
Committed: Tue Oct 27 14:26:47 2015 +0100

----------------------------------------------------------------------
 .../impl/PortletAppDescriptorServiceImpl.java   | 35 ++++++++++++++++----
 .../om/portlet/impl/ConfigurationHolder.java    | 14 ++++++++
 .../driver/container/PortletContextManager.java | 16 +++++++++
 3 files changed, 58 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/536c8608/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletAppDescriptorServiceImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletAppDescriptorServiceImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletAppDescriptorServiceImpl.java
index 11cfbc4..48a9aab 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletAppDescriptorServiceImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletAppDescriptorServiceImpl.java
@@ -44,7 +44,10 @@ import javax.xml.xpath.XPathFactory;
 
 import org.apache.pluto.container.PortletAppDescriptorService;
 import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.PortletDefinition;
 import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
@@ -56,11 +59,12 @@ import org.xml.sax.SAXException;
  * Service that reads the portlet deployment descriptor.
  */
 
-public class PortletAppDescriptorServiceImpl implements
-      PortletAppDescriptorService {
-
-   private PortletApplicationDefinition pad        = null;
-   private ConfigurationHolder          confHolder = new ConfigurationHolder();
+public class PortletAppDescriptorServiceImpl implements PortletAppDescriptorService {
+   
+   /** Logger. */
+   private static final Logger LOG = LoggerFactory.getLogger(PortletAppDescriptorServiceImpl.class);
+   private static final boolean isDebug = LOG.isDebugEnabled();
+   
 
    public PortletAppDescriptorServiceImpl() {
    }
@@ -77,6 +81,9 @@ public class PortletAppDescriptorServiceImpl implements
          throw new IOException("Cannot read from a null InputStream");
       }
 
+      PortletApplicationDefinition pad        = null;
+      ConfigurationHolder          confHolder = new ConfigurationHolder();
+
       // read the deployment descriptor
       try {
          confHolder.processPortletDD(in);
@@ -93,11 +100,25 @@ public class PortletAppDescriptorServiceImpl implements
       return pad;
    }
 
-   public void mergeWebDescriptor(PortletApplicationDefinition pa,
+   public void mergeWebDescriptor(PortletApplicationDefinition pad,
          InputStream webDescriptor) throws Exception {
       
-      confHolder = new ConfigurationHolder(pa);
+      ConfigurationHolder confHolder = new ConfigurationHolder(pad);
       confHolder.processWebDD(webDescriptor);
+      
+      if (isDebug) {
+         StringBuilder txt = new StringBuilder(128);
+         txt.append("Processed web DD for Portlet app: ").append(pad.getName());
+         txt.append(", context path: ").append(pad.getContextPath());
+         txt.append(", # portlets: ").append(pad.getPortlets().size());
+         txt.append(", names: ");
+         String sep = "";
+         for (PortletDefinition pd : pad.getPortlets()) {
+            txt.append(sep).append(pd.getPortletName());
+            sep = ", ";
+         }
+         LOG.debug(txt.toString());
+      }
    }
 
    /**

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/536c8608/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java
index f547bd2..51fdab9 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java
@@ -30,6 +30,7 @@ import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
 import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.PortletDefinition;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -201,6 +202,19 @@ public class ConfigurationHolder {
       }
 
       pad = jcp.process(jel);
+      
+      if (isDebug) {
+         StringBuilder txt = new StringBuilder(128);
+         txt.append("Parsed DD for Portlet app: ").append(pad.getName());
+         txt.append(", # portlets: ").append(pad.getPortlets().size());
+         txt.append(", names: ");
+         String sep = "";
+         for (PortletDefinition pd : pad.getPortlets()) {
+            txt.append(sep).append(pd.getPortletName());
+            sep = ", ";
+         }
+         LOG.debug(txt.toString());
+      }
 
    }
    

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/536c8608/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortletContextManager.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortletContextManager.java b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortletContextManager.java
index 9e6cf05..8257f8a 100644
--- a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortletContextManager.java
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortletContextManager.java
@@ -57,6 +57,8 @@ public class PortletContextManager implements PortletRegistryService, PortletCon
      * Logger Instance
      */
     private static final Logger LOG = LoggerFactory.getLogger(PortletContextManager.class);
+    private static final boolean isDebug = LOG.isDebugEnabled();
+   
 
     /**
      * The PortletContext cache map: key is servlet context, and value is the
@@ -117,6 +119,20 @@ public class PortletContextManager implements PortletRegistryService, PortletCon
         if (!portletContexts.containsKey(contextPath)) {
 
             PortletApplicationDefinition portletApp = portletRegistry.getPortletAppDD(servletContext, contextPath, contextPath);
+            
+            if (isDebug) {
+               StringBuilder txt = new StringBuilder(128);
+               txt.append("Parsed DD for Portlet app: ").append(portletApp.getName());
+               txt.append(", context path: ").append(portletApp.getContextPath());
+               txt.append(", # portlets: ").append(portletApp.getPortlets().size());
+               txt.append(", names: ");
+               String sep = "";
+               for (PortletDefinition pd : portletApp.getPortlets()) {
+                  txt.append(sep).append(pd.getPortletName());
+                  sep = ", ";
+               }
+               LOG.debug(txt.toString());
+            }
 
             DriverPortletContext portletContext = new DriverPortletContextImpl(servletContext, portletApp, rdService);
 


[38/38] portals-pluto git commit: bug fix to allow any header to be set during the resource phase

Posted by ms...@apache.org.
bug fix to allow any header to be set during the resource phase


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/875769b8
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/875769b8
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/875769b8

Branch: refs/heads/V3Prototype
Commit: 875769b8de2b07e8f2cd3f345986cd52f3eef771
Parents: d442480
Author: Scott Nicklous <ms...@apache.org>
Authored: Fri Nov 27 13:19:31 2015 +0100
Committer: Scott Nicklous <ms...@apache.org>
Committed: Fri Nov 27 13:19:31 2015 +0100

----------------------------------------------------------------------
 .../services/container/PortletResponseContextImpl.java    | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/875769b8/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
index c59784b..3898fda 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
@@ -175,8 +175,9 @@ public abstract class PortletResponseContextImpl implements PortletResponseConte
          txt.append(", value: ").append(value);
         LOG.warn(txt.toString());
       } else {
-         // header names are case insensitive
-         if (disallowedHeaders.contains(key.toUpperCase())) {
+         // header names are case insensitive. allow setting all headers 
+         // during the resource phase.
+         if (!lifecycle.matches(RESOURCE_PHASE) && disallowedHeaders.contains(key.toUpperCase())) {
             StringBuilder txt = new StringBuilder(128);
             txt.append("Ignoring disallowed HTTP header: ").append(key);
             txt.append(" with value: ").append(value);
@@ -241,8 +242,9 @@ public abstract class PortletResponseContextImpl implements PortletResponseConte
          txt.append(", value: ").append(value);
          LOG.warn(txt.toString());
       } else {
-         // header names are case insensitive
-         if (disallowedHeaders.contains(key.toUpperCase())) {
+         // header names are case insensitive. allow setting all headers 
+         // during the resource phase.
+         if (!lifecycle.matches(RESOURCE_PHASE) && disallowedHeaders.contains(key.toUpperCase())) {
             StringBuilder txt = new StringBuilder(128);
             txt.append("Ignoring disallowed HTTP header: ").append(key);
             txt.append(" with value: ").append(value);


[05/38] portals-pluto git commit: Replaced code that reads the deployment descriptor with an implementation that can be better extended to add v3.0 support. Added test cases. Uses jaxb binding classes that are generated at compile time.

Posted by ms...@apache.org.
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/resources/org/apache/pluto/container/impl/web-app_2_3.dtd
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/resources/org/apache/pluto/container/impl/web-app_2_3.dtd b/pluto-container/src/main/resources/org/apache/pluto/container/impl/web-app_2_3.dtd
deleted file mode 100644
index 8c51a4a..0000000
--- a/pluto-container/src/main/resources/org/apache/pluto/container/impl/web-app_2_3.dtd
+++ /dev/null
@@ -1,1063 +0,0 @@
-<!--
-Copyright (c) 2000 Sun Microsystems, Inc.,
-901 San Antonio Road,
-Palo Alto, California 94303, U.S.A.
-All rights reserved.
-
-Sun Microsystems, Inc. has intellectual property rights relating to
-technology embodied in the product that is described in this document.
-In particular, and without limitation, these intellectual property
-rights may include one or more of the U.S. patents listed at
-http://www.sun.com/patents and one or more additional patents or
-pending patent applications in the U.S. and in other countries.
-
-This document and the product to which it pertains are distributed
-under licenses restricting their use, copying, distribution, and
-decompilation.  This document may be reproduced and distributed but may
-not be changed without prior written authorization of Sun and its
-licensors, if any.
-
-Third-party software, including font technology, is copyrighted and
-licensed from Sun suppliers.
-
-Sun,  Sun Microsystems,  the Sun logo,  Java,  JavaServer Pages,  Java
-Naming and Directory Interface,  JDBC,  JDK,  JavaMail and  and
-Enterprise JavaBeans are trademarks or registered trademarks of Sun
-Microsystems, Inc. in the U.S. and other countries.
-
-Federal Acquisitions: Commercial Software - Government Users Subject to
-Standard License Terms and Conditions.
-
-DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED
-CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED
-WARRANTY OF MERCHANTABILITY, FITNESS FOR FOR A PARTICULAR PURPOSE OR
-NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH
-DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
-
-
-_________________________________________________________________________
-
-Copyright (c) 2000 Sun Microsystems, Inc.,
-901 San Antonio Road,
-Palo Alto, California 94303, E'tats-Unis.
-Tous droits re'serve's.
-
-Sun Microsystems, Inc. a les droits de proprie'te' intellectuels
-relatants a` la technologie incorpore'e dans le produit qui est de'crit
-dans ce document. En particulier, et sans la limitation, ces droits de
-proprie'te' intellectuels peuvent inclure un ou plus des brevets
-ame'ricains e'nume're's a` http://www.sun.com/patents et un ou les
-brevets plus supple'mentaires ou les applications de brevet en attente
-dans les E'tats-Unis et dans les autres pays.
-
-Ce produit ou document est prote'ge' par un copyright et distribue'
-avec des licences qui en restreignent l'utilisation, la copie, la
-distribution, et la de'compilation.  Ce documention associe n peut
-e^tre reproduite et distribuer, par quelque moyen que ce soit, sans
-l'autorisation pre'alable et e'crite de Sun et de ses bailleurs de
-licence, le cas e'che'ant.
-
-Le logiciel de'tenu par des tiers, et qui comprend la technologie
-relative aux polices de caracte`res, est prote'ge' par un copyright et
-licencie' par des fournisseurs de Sun.
-
-Sun,  Sun Microsystems,  le logo Sun,  Java,  JavaServer Pages,  Java
-Naming and Directory Interface,  JDBC,  JDK,  JavaMail et  and
-Enterprise JavaBeans sont des marques de fabrique ou des marques
-de'pose'es de Sun Microsystems, Inc. aux E'tats-Unis et dans d'autres
-pays.
-
-LA DOCUMENTATION EST FOURNIE "EN L'E'TAT" ET TOUTES AUTRES CONDITIONS,
-DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT
-EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS
-NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A
-L'APTITUDE A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE
-CONTREFAC,ON.
--->
-
-<!--
-This is the XML DTD for the Servlet 2.3 deployment descriptor.
-All Servlet 2.3 deployment descriptors must include a DOCTYPE
-of the following form:
-
-  <!DOCTYPE web-app PUBLIC
-"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
-"http://java.sun.com/dtd/web-app_2_3.dtd">
-
--->
-
-<!--
-The following conventions apply to all J2EE deployment descriptor
-elements unless indicated otherwise.
-
-- In elements that contain PCDATA, leading and trailing whitespace
-  in the data may be ignored.
-
-- In elements whose value is an "enumerated type", the value is
-  case sensitive.
-
-- 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 web-app element is the root of the deployment descriptor for
-a web application.
--->
-<!ELEMENT web-app (icon?, display-name?, description?, distributable?,
-context-param*, filter*, filter-mapping*, listener*, servlet*,
-servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?,
-error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*,
-login-config?, security-role*, env-entry*, ejb-ref*,  ejb-local-ref*)>
-
-<!--
-The auth-constraint element indicates the user roles that should
-be permitted access to this resource collection. The role-name
-used here must either correspond to the role-name of one of the
-security-role elements defined for this web application, or be
-the specially reserved role-name "*" that is a compact syntax for
-indicating all roles in the web application. If both "*" and
-rolenames appear, the container interprets this as all roles.
-If no roles are defined, no user is allowed access to the portion of
-the web application described by the containing security-constraint.
-The container matches role names case sensitively when determining
-access.
-
-
-Used in: security-constraint
--->
-<!ELEMENT auth-constraint (description?, role-name*)>
-
-<!--
-The auth-method element is used to configure the authentication
-mechanism for the web application. As a prerequisite to gaining access to any web resources which are protected by an authorization
-constraint, a user must have authenticated using the configured
-mechanism. Legal values for this element are "BASIC", "DIGEST",
-"FORM", or "CLIENT-CERT".
-
-Used in: login-config
--->
-<!ELEMENT auth-method (#PCDATA)>
-
-<!--
-The context-param element contains the declaration of a web
-application's servlet context initialization parameters.
-
-Used in: web-app
--->
-<!ELEMENT context-param (param-name, param-value, description?)>
-
-<!--
-The description element is used to provide text describing the parent
-element.  The description element should include any information that
-the web application war file producer wants to provide to the consumer of
-the web application war file (i.e., to the Deployer). Typically, the tools
-used by the web application war file consumer will display the description
-when processing the parent element that contains the description.
-
-Used in: auth-constraint, context-param, ejb-local-ref, ejb-ref,
-env-entry, filter, init-param, resource-env-ref, resource-ref, run-as,
-security-role, security-role-ref, servlet, user-data-constraint,
-web-app, web-resource-collection
--->
-<!ELEMENT description (#PCDATA)>
-
-<!--
-The display-name element contains a short name that is intended to be
-displayed by tools.  The display name need not be unique.
-
-Used in: filter, security-constraint, servlet, web-app
-
-Example:
-
-<display-name>Employee Self Service</display-name>
--->
-<!ELEMENT display-name (#PCDATA)>
-
-<!--
-The distributable element, by its presence in a web application
-deployment descriptor, indicates that this web application is
-programmed appropriately to be deployed into a distributed servlet
-container
-
-Used in: web-app
--->
-<!ELEMENT distributable EMPTY>
-
-<!--
-The ejb-link element is used in the ejb-ref or ejb-local-ref
-elements to specify that an EJB reference is linked to an
-enterprise bean.
-
-The name in the ejb-link element is composed of a
-path name specifying the ejb-jar containing the referenced enterprise
-bean with the ejb-name of the target bean appended and separated from
-the path name by "#".  The path name is relative to the war file
-containing the web application that is referencing the enterprise bean.
-This allows multiple enterprise beans with the same ejb-name to be
-uniquely identified.
-
-Used in: ejb-local-ref, ejb-ref
-
-Examples:
-
-<ejb-link>EmployeeRecord</ejb-link>
-
-<ejb-link>../products/product.jar#ProductEJB</ejb-link>
-
--->
-<!ELEMENT ejb-link (#PCDATA)>
-
-<!--
-The ejb-local-ref element is used for the declaration of a reference to
-an enterprise bean's local home. The declaration consists of:
-
-- an optional description
-- the EJB reference name used in the code of the web application
-  that's referencing the enterprise bean
-- the expected type of the referenced enterprise bean
-- the expected local home and local interfaces of the referenced
-  enterprise bean
-- optional ejb-link information, used to specify the referenced
-  enterprise bean
-
-Used in: web-app
--->
-<!ELEMENT ejb-local-ref (description?, ejb-ref-name, ejb-ref-type,
-local-home, local, ejb-link?)>
-
-<!--
-The ejb-ref element is used for the declaration of a reference to
-an enterprise bean's home. The declaration consists of:
-
-- an optional description
-- the EJB reference name used in the code of
-  the web application that's referencing the enterprise bean
-- the expected type of the referenced enterprise bean
-- the expected home and remote interfaces of the referenced
-  enterprise bean
-- optional ejb-link information, used to specify the referenced
-  enterprise bean
-
-Used in: web-app
--->
-<!ELEMENT ejb-ref (description?, ejb-ref-name, ejb-ref-type,
-home, remote, ejb-link?)>
-
-<!--
-The ejb-ref-name element contains the name of an EJB reference. The
-EJB reference is an entry in the web application's environment and is
-relative to the java:comp/env context.  The name must be unique
-within the web application.
-
-It is recommended that name is prefixed with "ejb/".
-
-Used in: ejb-local-ref, ejb-ref
-
-Example:
-
-<ejb-ref-name>ejb/Payroll</ejb-ref-name>
--->
-<!ELEMENT ejb-ref-name (#PCDATA)>
-
-<!--
-The ejb-ref-type element contains the expected type of the
-referenced enterprise bean.
-
-The ejb-ref-type element must be one of the following:
-
-<ejb-ref-type>Entity</ejb-ref-type>
-<ejb-ref-type>Session</ejb-ref-type>
-
-Used in: ejb-local-ref, ejb-ref
--->
-<!ELEMENT ejb-ref-type (#PCDATA)>
-
-<!--
-The env-entry element contains the declaration of a web application's
-environment entry. The declaration consists of an optional
-description, the name of the environment entry, and an optional
-value.  If a value is not specified, one must be supplied
-during deployment.
--->
-<!ELEMENT env-entry (description?, env-entry-name, env-entry-value?,
-env-entry-type)>
-
-<!--
-The env-entry-name element contains the name of a web applications's
-environment entry.  The name is a JNDI name relative to the
-java:comp/env context.  The name must be unique within a web application.
-
-Example:
-
-<env-entry-name>minAmount</env-entry-name>
-
-Used in: env-entry
--->
-<!ELEMENT env-entry-name (#PCDATA)>
-
-<!--
-The env-entry-type element contains the fully-qualified Java type of
-the environment entry value that is expected by the web application's
-code.
-
-The following are the legal values of env-entry-type:
-
-java.lang.Boolean
-java.lang.Byte
-java.lang.Character
-java.lang.String
-java.lang.Short
-java.lang.Integer
-java.lang.Long
-java.lang.Float
-java.lang.Double
-
-Used in: env-entry
--->
-<!ELEMENT env-entry-type (#PCDATA)>
-
-<!--
-The env-entry-value element contains the value of a web application's
-environment entry. The value must be a String that is valid for the
-constructor of the specified type that takes a single String
-parameter, or for java.lang.Character, a single character.
-
-Example:
-
-<env-entry-value>100.00</env-entry-value>
-
-Used in: env-entry
--->
-<!ELEMENT env-entry-value (#PCDATA)>
-
-<!--
-The error-code contains an HTTP error code, ex: 404
-
-Used in: error-page
--->
-<!ELEMENT error-code (#PCDATA)>
-
-<!--
-The error-page element contains a mapping between an error code
-or exception type to the path of a resource in the web application
-
-Used in: web-app
--->
-<!ELEMENT error-page ((error-code | exception-type), location)>
-
-<!--
-The exception type contains a fully qualified class name of a
-Java exception type.
-
-Used in: error-page
--->
-<!ELEMENT exception-type (#PCDATA)>
-
-<!--
-The extension element contains a string describing an
-extension. example: "txt"
-
-Used in: mime-mapping
--->
-<!ELEMENT extension (#PCDATA)>
-
-<!--
-Declares a filter in the web application. The filter is mapped to
-either a servlet or a URL pattern in the filter-mapping element, using
-the filter-name value to reference. Filters can access the
-initialization parameters declared in the deployment descriptor at
-runtime via the FilterConfig interface.
-
-Used in: web-app
--->
-<!ELEMENT filter (icon?, filter-name, display-name?, description?,
-filter-class, init-param*)>
-
-<!--
-The fully qualified classname of the filter.
-
-Used in: filter
--->
-<!ELEMENT filter-class (#PCDATA)>
-
-<!--
-Declaration of the filter mappings in this web application. The
-container uses the filter-mapping declarations to decide which filters
-to apply to a request, and in what order. The container matches the
-request URI to a Servlet in the normal way. To determine which filters
-to apply it matches filter-mapping declarations either on servlet-name,
-or on url-pattern for each filter-mapping element, depending on which
-style is used. The order in which filters are invoked is the order in
-which filter-mapping declarations that match a request URI for a
-servlet appear in the list of filter-mapping elements.The filter-name
-value must be the value of the <filter-name> sub-elements of one of the
-<filter> declarations in the deployment descriptor.
-
-Used in: web-app
--->
-<!ELEMENT filter-mapping (filter-name, (url-pattern | servlet-name))>
-
-<!--
-The logical name of the filter. This name is used to map the filter.
-Each filter name is unique within the web application.
-
-Used in: filter, filter-mapping
--->
-<!ELEMENT filter-name (#PCDATA)>
-
-<!--
-The form-error-page element defines the location in the web app
-where the error page that is displayed when login is not successful
-can be found. The path begins with a leading / and is interpreted
-relative to the root of the WAR.
-
-Used in: form-login-config
--->
-<!ELEMENT form-error-page (#PCDATA)>
-
-<!--
-The form-login-config element specifies the login and error pages
-that should be used in form based login. If form based authentication
-is not used, these elements are ignored.
-
-Used in: login-config
--->
-<!ELEMENT form-login-config (form-login-page, form-error-page)>
-
-<!--
-The form-login-page element defines the location in the web app
-where the page that can be used for login can be found. The path
-begins with a leading / and is interpreted relative to the root of the WAR.
-
-Used in: form-login-config
--->
-<!ELEMENT form-login-page (#PCDATA)>
-
-<!--
-The home element contains the fully-qualified name of the enterprise
-bean's home interface.
-
-Used in: ejb-ref
-
-Example:
-
-<home>com.aardvark.payroll.PayrollHome</home>
--->
-<!ELEMENT home (#PCDATA)>
-
-<!--
-The http-method contains an HTTP method (GET | POST |...).
-
-Used in: web-resource-collection
--->
-<!ELEMENT http-method (#PCDATA)>
-
-<!--
-The icon element contains small-icon and large-icon elements that
-specify the file names for small and a large GIF or JPEG icon images
-used to represent the parent element in a GUI tool.
-
-Used in: filter, servlet, web-app
--->
-<!ELEMENT icon (small-icon?, large-icon?)>
-
-<!--
-The init-param element contains a name/value pair as an
-initialization param of the servlet
-
-Used in: filter, servlet
--->
-<!ELEMENT init-param (param-name, param-value, description?)>
-
-<!--
-The jsp-file element contains the full path to a JSP file within
-the web application beginning with a `/'.
-
-Used in: servlet
--->
-<!ELEMENT jsp-file (#PCDATA)>
-
-<!--
-The large-icon element contains the name of a file
-containing a large (32 x 32) icon image. The file
-name is a relative path within the web application's
-war file.
-
-The image may be either in the JPEG or GIF format.
-The icon can be used by tools.
-
-Used in: icon
-
-Example:
-
-<large-icon>employee-service-icon32x32.jpg</large-icon>
--->
-<!ELEMENT large-icon (#PCDATA)>
-
-<!--
-The listener element indicates the deployment properties for a web
-application listener bean.
-
-Used in: web-app
--->
-<!ELEMENT listener (listener-class)>
-
-<!--
-The listener-class element declares a class in the application must be
-registered as a web application listener bean. The value is the fully qualified classname of the listener class.
-
-
-Used in: listener
--->
-<!ELEMENT listener-class (#PCDATA)>
-
-<!--
-The load-on-startup element indicates that this servlet should be
-loaded (instantiated and have its init() called) on the startup
-of the web application. The optional contents of
-these element must be an integer indicating the order in which
-the servlet should be loaded. If the value is a negative integer,
-or the element is not present, the container is free to load the
-servlet whenever it chooses. If the value is a positive integer
-or 0, the container must load and initialize the servlet as the
-application is deployed. The container must guarantee that
-servlets marked with lower integers are loaded before servlets
-marked with higher integers. The container may choose the order
-of loading of servlets with the same load-on-start-up value.
-
-Used in: servlet
--->
-<!ELEMENT load-on-startup (#PCDATA)>
-
-<!--
-
-The local element contains the fully-qualified name of the
-enterprise bean's local interface.
-
-Used in: ejb-local-ref
-
--->
-<!ELEMENT local (#PCDATA)>
-
-<!--
-
-The local-home element contains the fully-qualified name of the
-enterprise bean's local home interface.
-
-Used in: ejb-local-ref
--->
-<!ELEMENT local-home (#PCDATA)>
-
-<!--
-The location element contains the location of the resource in the web
-application relative to the root of the web application. The value of
-the location must have a leading `/'.
-
-Used in: error-page
--->
-<!ELEMENT location (#PCDATA)>
-
-<!--
-The login-config element is used to configure the authentication
-method that should be used, the realm name that should be used for
-this application, and the attributes that are needed by the form login
-mechanism.
-
-Used in: web-app
--->
-<!ELEMENT login-config (auth-method?, realm-name?, form-login-config?)>
-
-<!--
-The mime-mapping element defines a mapping between an extension
-and a mime type.
-
-Used in: web-app
--->
-<!ELEMENT mime-mapping (extension, mime-type)>
-
-<!--
-The mime-type element contains a defined mime type. example:
-"text/plain"
-
-Used in: mime-mapping
--->
-<!ELEMENT mime-type (#PCDATA)>
-
-<!--
-The param-name element contains the name of a parameter. Each parameter
-name must be unique in the web application.
-
-
-Used in: context-param, init-param
--->
-<!ELEMENT param-name (#PCDATA)>
-
-<!--
-The param-value element contains the value of a parameter.
-
-Used in: context-param, init-param
--->
-<!ELEMENT param-value (#PCDATA)>
-
-<!--
-The realm name element specifies the realm name to use in HTTP
-Basic authorization.
-
-Used in: login-config
--->
-<!ELEMENT realm-name (#PCDATA)>
-
-<!--
-The remote element contains the fully-qualified name of the enterprise
-bean's remote interface.
-
-Used in: ejb-ref
-
-Example:
-
-<remote>com.wombat.empl.EmployeeService</remote>
--->
-<!ELEMENT remote (#PCDATA)>
-
-<!--
-The res-auth element specifies whether the web application code signs
-on programmatically to the resource manager, or whether the Container
-will sign on to the resource manager on behalf of the web application. In the
-latter case, the Container uses information that is supplied by the
-Deployer.
-
-The value of this element must be one of the two following:
-
-<res-auth>Application</res-auth>
-<res-auth>Container</res-auth>
-
-Used in: resource-ref
--->
-<!ELEMENT res-auth (#PCDATA)>
-
-<!--
-The res-ref-name element specifies the name of a resource manager
-connection factory reference.  The name is a JNDI name relative to the
-java:comp/env context.  The name must be unique within a web application.
-
-Used in: resource-ref
--->
-<!ELEMENT res-ref-name (#PCDATA)>
-
-<!--
-The res-sharing-scope element specifies whether connections obtained
-through the given resource manager connection factory reference can be
-shared. The value of this element, if specified, must be one of the
-two following:
-
-<res-sharing-scope>Shareable</res-sharing-scope>
-<res-sharing-scope>Unshareable</res-sharing-scope>
-
-The default value is Shareable.
-
-Used in: resource-ref
--->
-<!ELEMENT res-sharing-scope (#PCDATA)>
-
-<!--
-The res-type element specifies the type of the data source. The type
-is specified by the fully qualified Java language class or interface
-expected to be implemented by the data source.
-
-Used in: resource-ref
--->
-<!ELEMENT res-type (#PCDATA)>
-
-<!--
-The resource-env-ref element contains a declaration of a web application's
-reference to an administered object associated with a resource
-in the web application's environment.  It consists of an optional
-description, the resource environment reference name, and an
-indication of the resource environment reference type expected by
-the web application code.
-
-Used in: web-app
-
-Example:
-
-<resource-env-ref>
-    <resource-env-ref-name>jms/StockQueue</resource-env-ref-name>
-    <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
-</resource-env-ref>
--->
-<!ELEMENT resource-env-ref (description?, resource-env-ref-name,
-resource-env-ref-type)>
-
-<!--
-The resource-env-ref-name element specifies the name of a resource
-environment reference; its value is the environment entry name used in
-the web application code.  The name is a JNDI name relative to the
-java:comp/env context and must be unique within a web application.
-
-Used in: resource-env-ref
--->
-<!ELEMENT resource-env-ref-name (#PCDATA)>
-
-<!--
-The resource-env-ref-type element specifies the type of a resource
-environment reference.  It is the fully qualified name of a Java
-language class or interface.
-
-Used in: resource-env-ref
--->
-<!ELEMENT resource-env-ref-type (#PCDATA)>
-
-<!--
-The resource-ref element contains a declaration of a web application's
-reference to an external resource. It consists of an optional
-description, the resource manager connection factory reference name,
-the indication of the resource manager connection factory type
-expected by the web application code, the type of authentication
-(Application or Container), and an optional specification of the
-shareability of connections obtained from the resource (Shareable or
-Unshareable).
-
-Used in: web-app
-
-Example:
-
-    <resource-ref>
-<res-ref-name>jdbc/EmployeeAppDB</res-ref-name>
-<res-type>javax.sql.DataSource</res-type>
-<res-auth>Container</res-auth>
-<res-sharing-scope>Shareable</res-sharing-scope>
-    </resource-ref>
--->
-<!ELEMENT resource-ref (description?, res-ref-name, res-type, res-auth,
-res-sharing-scope?)>
-
-<!--
-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
--->
-<!ELEMENT role-link (#PCDATA)>
-
-<!--
-The role-name element contains the name of a security role.
-
-The name must conform to the lexical rules for an NMTOKEN.
-
-Used in: auth-constraint, run-as, security-role, security-role-ref
--->
-<!ELEMENT role-name (#PCDATA)>
-
-<!--
-The run-as element specifies the run-as identity to be used for the
-execution of the web application. It contains an optional description, and
-the name of a security role.
-
-Used in: servlet
--->
-<!ELEMENT run-as (description?, role-name)>
-
-<!--
-The security-constraint element is used to associate security
-constraints with one or more web resource collections
-
-Used in: web-app
--->
-<!ELEMENT security-constraint (display-name?, web-resource-collection+,
-auth-constraint?, user-data-constraint?)>
-
-<!--
-The security-role element contains the definition of a security
-role. The definition consists of an optional description of the
-security role, and the security role name.
-
-Used in: web-app
-
-Example:
-
-    <security-role>
-<description>
-    This role includes all employees who are authorized
-    to access the employee service application.
-</description>
-<role-name>employee</role-name>
-    </security-role>
--->
-<!ELEMENT security-role (description?, role-name)>
-
-<!--
-The security-role-ref element contains the declaration of a security
-role reference in the web application's code. 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: servlet
-
--->
-<!ELEMENT security-role-ref (description?, role-name, role-link?)>
-
-<!--
-The servlet element contains the declarative data of a
-servlet. If a jsp-file is specified and the load-on-startup element is
-present, then the JSP should be precompiled and loaded.
-
-Used in: web-app
--->
-<!ELEMENT servlet (icon?, servlet-name, display-name?, description?,
-(servlet-class|jsp-file), init-param*, load-on-startup?, run-as?, security-role-ref*)>
-
-<!--
-The servlet-class element contains the fully qualified class name
-of the servlet.
-
-Used in: servlet
--->
-<!ELEMENT servlet-class (#PCDATA)>
-
-<!--
-The servlet-mapping element defines a mapping between a servlet
-and a url pattern
-
-Used in: web-app
--->
-<!ELEMENT servlet-mapping (servlet-name, url-pattern)>
-
-<!--
-The servlet-name element contains the canonical name of the
-servlet. Each servlet name is unique within the web application.
-
-Used in: filter-mapping, servlet, servlet-mapping
--->
-<!ELEMENT servlet-name (#PCDATA)>
-
-<!--
-The session-config element defines the session parameters for
-this web application.
-
-Used in: web-app
--->
-<!ELEMENT session-config (session-timeout?)>
-
-<!--
-The session-timeout element defines the default session timeout
-interval for all sessions created in this web application. The
-specified timeout must be expressed in a whole number of minutes.
-If the timeout is 0 or less, the container ensures the default
-behaviour of sessions is never to time out.
-
-Used in: session-config
--->
-<!ELEMENT session-timeout (#PCDATA)>
-
-<!--
-The small-icon element contains the name of a file
-containing a small (16 x 16) icon image. The file
-name is a relative path within the web application's
-war file.
-
-The image may be either in the JPEG or GIF format.
-The icon can be used by tools.
-
-Used in: icon
-
-Example:
-
-<small-icon>employee-service-icon16x16.jpg</small-icon>
--->
-<!ELEMENT small-icon (#PCDATA)>
-
-<!--
-The taglib element is used to describe a JSP tag library.
-
-Used in: web-app
--->
-<!ELEMENT taglib (taglib-uri, taglib-location)>
-
-<!--
-the taglib-location element contains the location (as a resource
-relative to the root of the web application) where to find the Tag
-Libary Description file for the tag library.
-
-Used in: taglib
--->
-<!ELEMENT taglib-location (#PCDATA)>
-
-<!--
-The taglib-uri element describes a URI, relative to the location
-of the web.xml document, identifying a Tag Library used in the Web
-Application.
-
-Used in: taglib
--->
-<!ELEMENT taglib-uri (#PCDATA)>
-
-<!--
-The transport-guarantee element specifies that the communication
-between client and server should be NONE, INTEGRAL, or
-CONFIDENTIAL. NONE means that the application does not require any
-transport guarantees. A value of INTEGRAL means that the application
-requires that the data sent between the client and server be sent in
-such a way that it can't be changed in transit. CONFIDENTIAL means
-that the application 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
--->
-<!ELEMENT transport-guarantee (#PCDATA)>
-
-<!--
-The url-pattern element contains the url pattern of the mapping. Must
-follow the rules specified in Section 11.2 of the Servlet API
-Specification.
-
-Used in: filter-mapping, servlet-mapping, web-resource-collection
--->
-<!ELEMENT url-pattern (#PCDATA)>
-
-<!--
-The user-data-constraint element is used to indicate how data
-communicated between the client and container should be protected.
-
-Used in: security-constraint
--->
-<!ELEMENT user-data-constraint (description?, transport-guarantee)>
-
-<!--
-The web-resource-collection element is used to identify a subset
-of the resources and HTTP methods on those resources within a web
-application to which a security constraint applies. If no HTTP methods
-are specified, then the security constraint applies to all HTTP
-methods.
-
-Used in: security-constraint
--->
-<!ELEMENT web-resource-collection (web-resource-name, description?,
-url-pattern*, http-method*)>
-
-<!--
-The web-resource-name contains the name of this web resource
-collection.
-
-Used in: web-resource-collection
--->
-<!ELEMENT web-resource-name (#PCDATA)>
-
-<!--
-The welcome-file element contains file name to use as a default
-welcome file, such as index.html
-
-Used in: welcome-file-list
--->
-<!ELEMENT welcome-file (#PCDATA)>
-
-<!--
-The welcome-file-list contains an ordered list of welcome files
-elements.
-
-Used in: web-app
--->
-<!ELEMENT welcome-file-list (welcome-file+)>
-
-<!--
-The ID mechanism is to allow tools that produce additional deployment
-information (i.e., information beyond the standard deployment
-descriptor information) to store the non-standard information in a
-separate file, and easily refer from these tool-specific files to the
-information in the standard deployment descriptor.
-
-Tools are not allowed to add the non-standard information into the
-standard deployment descriptor.
--->
-
-<!ATTLIST auth-constraint id ID #IMPLIED>
-<!ATTLIST auth-method id ID #IMPLIED>
-<!ATTLIST context-param id ID #IMPLIED>
-<!ATTLIST description id ID #IMPLIED>
-<!ATTLIST display-name id ID #IMPLIED>
-<!ATTLIST distributable id ID #IMPLIED>
-<!ATTLIST ejb-link id ID #IMPLIED>
-<!ATTLIST ejb-local-ref id ID #IMPLIED>
-<!ATTLIST ejb-ref id ID #IMPLIED>
-<!ATTLIST ejb-ref-name id ID #IMPLIED>
-<!ATTLIST ejb-ref-type id ID #IMPLIED>
-<!ATTLIST env-entry id ID #IMPLIED>
-<!ATTLIST env-entry-name id ID #IMPLIED>
-<!ATTLIST env-entry-type id ID #IMPLIED>
-<!ATTLIST env-entry-value id ID #IMPLIED>
-<!ATTLIST error-code id ID #IMPLIED>
-<!ATTLIST error-page id ID #IMPLIED>
-<!ATTLIST exception-type id ID #IMPLIED>
-<!ATTLIST extension id ID #IMPLIED>
-<!ATTLIST filter id ID #IMPLIED>
-<!ATTLIST filter-class id ID #IMPLIED>
-<!ATTLIST filter-mapping id ID #IMPLIED>
-<!ATTLIST filter-name id ID #IMPLIED>
-<!ATTLIST form-error-page id ID #IMPLIED>
-<!ATTLIST form-login-config id ID #IMPLIED>
-<!ATTLIST form-login-page id ID #IMPLIED>
-<!ATTLIST home id ID #IMPLIED>
-<!ATTLIST http-method id ID #IMPLIED>
-<!ATTLIST icon id ID #IMPLIED>
-<!ATTLIST init-param id ID #IMPLIED>
-<!ATTLIST jsp-file id ID #IMPLIED>
-<!ATTLIST large-icon id ID #IMPLIED>
-<!ATTLIST listener id ID #IMPLIED>
-<!ATTLIST listener-class id ID #IMPLIED>
-<!ATTLIST load-on-startup id ID #IMPLIED>
-<!ATTLIST local id ID #IMPLIED>
-<!ATTLIST local-home id ID #IMPLIED>
-<!ATTLIST location id ID #IMPLIED>
-<!ATTLIST login-config id ID #IMPLIED>
-<!ATTLIST mime-mapping id ID #IMPLIED>
-<!ATTLIST mime-type id ID #IMPLIED>
-<!ATTLIST param-name id ID #IMPLIED>
-<!ATTLIST param-value id ID #IMPLIED>
-<!ATTLIST realm-name id ID #IMPLIED>
-<!ATTLIST remote id ID #IMPLIED>
-<!ATTLIST res-auth id ID #IMPLIED>
-<!ATTLIST res-ref-name id ID #IMPLIED>
-<!ATTLIST res-sharing-scope id ID #IMPLIED>
-<!ATTLIST res-type id ID #IMPLIED>
-<!ATTLIST resource-env-ref id ID #IMPLIED>
-<!ATTLIST resource-env-ref-name id ID #IMPLIED>
-<!ATTLIST resource-env-ref-type id ID #IMPLIED>
-<!ATTLIST resource-ref id ID #IMPLIED>
-<!ATTLIST role-link id ID #IMPLIED>
-<!ATTLIST role-name id ID #IMPLIED>
-<!ATTLIST run-as id ID #IMPLIED>
-<!ATTLIST security-constraint id ID #IMPLIED>
-<!ATTLIST security-role id ID #IMPLIED>
-<!ATTLIST security-role-ref id ID #IMPLIED>
-<!ATTLIST servlet id ID #IMPLIED>
-<!ATTLIST servlet-class id ID #IMPLIED>
-<!ATTLIST servlet-mapping id ID #IMPLIED>
-<!ATTLIST servlet-name id ID #IMPLIED>
-<!ATTLIST session-config id ID #IMPLIED>
-<!ATTLIST session-timeout id ID #IMPLIED>
-<!ATTLIST small-icon id ID #IMPLIED>
-<!ATTLIST taglib id ID #IMPLIED>
-<!ATTLIST taglib-location id ID #IMPLIED>
-<!ATTLIST taglib-uri id ID #IMPLIED>
-<!ATTLIST transport-guarantee id ID #IMPLIED>
-<!ATTLIST url-pattern id ID #IMPLIED>
-<!ATTLIST user-data-constraint id ID #IMPLIED>
-<!ATTLIST web-app id ID #IMPLIED>
-<!ATTLIST web-resource-collection id ID #IMPLIED>
-<!ATTLIST web-resource-name id ID #IMPLIED>
-<!ATTLIST welcome-file id ID #IMPLIED>
-<!ATTLIST welcome-file-list id ID #IMPLIED>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/impl/BaseJaxbTestSuite.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/impl/BaseJaxbTestSuite.java b/pluto-container/src/test/java/org/apache/pluto/container/impl/BaseJaxbTestSuite.java
new file mode 100644
index 0000000..57e2350
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/impl/BaseJaxbTestSuite.java
@@ -0,0 +1,36 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.impl;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+@RunWith(Suite.class)
+@SuiteClasses({JaxbReadTest168NC.class, JaxbReadTest168Gen.class,
+   JaxbReadTest286NC.class, JaxbReadTest286Gen.class,
+   JaxbReadTest362Gen.class})
+public class BaseJaxbTestSuite {
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxBDescriptorServiceImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxBDescriptorServiceImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxBDescriptorServiceImplTest.java
deleted file mode 100644
index e5da097..0000000
--- a/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxBDescriptorServiceImplTest.java
+++ /dev/null
@@ -1,468 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.impl;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.xml.parsers.ParserConfigurationException;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
-import org.apache.pluto.container.om.portlet.PortletDefinition;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.xml.sax.SAXException;
-
-/**
- * Testclass for testing jaxb xml 2 java binding (portlet.xml)
- * @author <a href="mailto:chrisra@cs.uni-jena.de">Christian Raschka</a>
- */
-public class JaxBDescriptorServiceImplTest extends TestCase{
-	
-	private StringBuffer xmlBegin286 = new StringBuffer();
-    private StringBuffer xmlBegin286NoNamespaceURI = new StringBuffer();
-	private StringBuffer portlet286 = new StringBuffer();
-	private StringBuffer attrs286 = new StringBuffer();
-	private StringBuffer xmlEnd = new StringBuffer();
-	
-	private StringBuffer xmlBegin168 = new StringBuffer();
-    private StringBuffer xmlBegin168NoNamespaceURI = new StringBuffer();
-	private StringBuffer portlet168 = new StringBuffer();
-	private StringBuffer attrs168 = new StringBuffer();
-
-    private StringBuffer portlet286NoCache = new StringBuffer();
-    private StringBuffer portlet168NoCache = new StringBuffer();
-    private StringBuffer portletNoCache = new StringBuffer();
-
-    PortletAppDescriptorServiceImpl jaxb = new PortletAppDescriptorServiceImpl();
-
-	/**
-	 * @throws java.lang.Exception
-	 */
-	@Before
-	public void setUp() throws Exception {
-		xmlBegin286.append("" +
-				"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
-				"<portlet-app id=\"id1\"\n" +
-				"xmlns=\"http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd\"\n" +
-				"version=\"2.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
-				"xmlns:portlet=\"http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd\"\n" +
-				"xsi:schemaLocation=\"http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd\n" +
-				"http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd\">\n ");
-        xmlBegin286NoNamespaceURI.append("" +
-                           "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
-                           "<portlet-app id=\"id1\" version=\"2.0\">");
-		portlet286.append(""+
-				"<portlet id=\"id2\">\n" +
-				"<description xml:lang=\"de\">description</description>\n" +
-				"<portlet-name>portlet286</portlet-name>\n" +
-				"<display-name xml:lang=\"de\">display-name</display-name>\n" +
-				"<portlet-class>portlet-class</portlet-class>\n" +
-				"<init-param id=\"init1\">\n" +
-				"<description xml:lang=\"de\">description</description>\n" +
-				"<name>name</name>\n" +
-				"<value>value</value>\n" +
-				"</init-param>\n" +
-				"<expiration-cache>100</expiration-cache>\n" +
-				"<cache-scope>private</cache-scope>\n" +
-				" <supports id=\"sup1\">\n" +
-				"<mime-type>mime-type</mime-type>\n" +
-				"<portlet-mode>portlet-mode</portlet-mode>\n" +
-				"</supports>\n" +
-				" <supports id=\"sup2\">\n" +
-				"<mime-type>mime-type2</mime-type>\n" +
-				"<portlet-mode>portlet-mode2</portlet-mode>\n" +
-				"</supports>\n" +
-				" <supports id=\"sup3\">\n" +
-				"<mime-type>mime-type3</mime-type>\n" +
-				"<portlet-mode>portlet-mode3</portlet-mode>\n" +
-				"</supports>\n" +
-				"<supported-locale>supported-locale</supported-locale>\n" +
-				"<resource-bundle>resource-bundle</resource-bundle>\n" +
-				"<portlet-info id=\"info1\">\n" +
-				"<title>title</title>\n" +
-				"<short-title>short-title</short-title>\n" +
-				"<keywords>keywords</keywords>\n" +
-				"</portlet-info>\n" +
-				"<portlet-preferences id=\"prefs\">\n" +
-				"<preference id=\"pref1\">\n" +
-				"<name>name</name>\n" +
-				"<value>value</value>\n" +
-				"<read-only>true</read-only>\n" +
-				"</preference>\n" +
-				"<preferences-validator>preferences-validator</preferences-validator>\n" +
-				"</portlet-preferences>\n" +
-				"<security-role-ref id=\"sec1\">\n" +
-				"<description xml:lang=\"de\">description</description>\n" +
-				"<role-name>NMTOKEN</role-name>\n" +
-				"<role-link>role-link</role-link>\n" +
-				"</security-role-ref>\n" +
-				"<supported-processing-event><name>supported-processing-event</name></supported-processing-event>\n" +
-				"<supported-publishing-event><qname xmlns:x=\"http://test.com\">supported-publishing-event</qname></supported-publishing-event>\n" +
-				"<supported-public-render-parameter>supported-public-render-parameter</supported-public-render-parameter>\n" +
-				"<container-runtime-option><name>Runtime-Option</name><value>true</value></container-runtime-option>\n" +
-				"</portlet>\n" );
-		attrs286.append("" + 
-				"<custom-portlet-mode id=\"mode1\">\n" +
-			    "<description xml:lang=\"de\">description</description>\n" +
-			    "<portlet-mode>portlet-mode</portlet-mode>\n" +
-			  "</custom-portlet-mode>\n" +
-			  "<custom-window-state id=\"state1\">\n" +
-			   "<description xml:lang=\"de\">description</description>\n" +
-			    "<window-state>window-state</window-state>\n" +
-			  "</custom-window-state>\n" +
-			  "<user-attribute id=\"att1\">\n" +
-			    "<description xml:lang=\"de\">description</description>\n" +
-			    "<name>name</name>\n" +
-			  "</user-attribute>\n" +
-			  "<security-constraint id=\"cons1\">\n" +
-			    "<display-name xml:lang=\"de\">display-name</display-name>\n" +
-			    "<portlet-collection>\n" +
-			     "<portlet-name>portlet-name</portlet-name>\n" +
-			   "</portlet-collection>\n" +
-			    "<user-data-constraint id=\"data1\">\n" +
-			      "<description xml:lang=\"de\">description</description>\n" +
-			      "<transport-guarantee>NONE</transport-guarantee>\n" +
-			    "</user-data-constraint>\n" +
-			  "</security-constraint>\n" +
-			  "<resource-bundle>resource-bundle</resource-bundle>\n" +
-			  "<filter>\n" +
-			    "<description xml:lang=\"de\">description</description>\n" +
-			    "<display-name xml:lang=\"de\">display-name</display-name>\n" +
-			    "<filter-name>filter-name</filter-name>\n" +
-			    "<filter-class>filter-class</filter-class>\n" +
-			    "<lifecycle>lifecycle</lifecycle>\n" +
-			    "<init-param id=\"init2\">\n" +
-			      "<description xml:lang=\"de\">description</description>\n" +
-			      "<name>name</name>\n" +
-			      "<value>value</value>\n" +
-			    "</init-param>\n" +
-			  "</filter>\n" +
-			  "<filter-mapping>\n" +
-			    "<filter-name>filter-name</filter-name>\n" +
-			    "<portlet-name>portlet-name</portlet-name>\n" +			   
-			  "</filter-mapping>\n" +
-			  "<event-definition id=\"event1\">\n" +
-			    "<description xml:lang=\"de\">description</description>\n" +
-			    "<name>QName</name>\n" +
-			    "<alias>QName</alias>\n" +
-			    "<value-type>java-class</value-type>\n" +
-			  "</event-definition>\n" +
-			  "<public-render-parameter id=\"public1\">\n" +
-			    "<description xml:lang=\"de\">description</description>\n" +
-			    "<identifier>identifier</identifier>\n" +
-			    "<qname>QName</qname>\n" +
-			  "</public-render-parameter>\n" +
-			  "<public-render-parameter id=\"public2\">\n" +
-			    "<description xml:lang=\"de\">description2</description>\n" +
-			    "<identifier>identifier2</identifier>\n" +
-			    "<name>Name</name>\n" +
-			  "</public-render-parameter>\n" +
-			  "<container-runtime-option><name>Runtime-Option-Portlet-App</name><value>false</value></container-runtime-option>\n" +
-			  "" );
-		xmlEnd.append("" +
-				"</portlet-app>" );
-		
-		// test old jsr 168 portlet.xml
-		xmlBegin168.append("" +
-				"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
-				"<portlet-app id=\"id1\"\n" +
-				"xmlns=\"http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd\"\n" +
-				"version=\"1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
-				"xmlns:portlet=\"http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd\"\n" +
-				"xsi:schemaLocation=\"http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd\n" +
-				"http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd\">\n ");
-        xmlBegin168NoNamespaceURI.append("" +
-                           "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
-                           "<portlet-app id=\"id1\" version=\"1.0\">");
-		portlet168.append(""+
-				"<portlet id=\"id2\">\n" +
-				"<description xml:lang=\"de\">description</description>\n" +
-				"<portlet-name>portlet168</portlet-name>\n" +
-				"<display-name xml:lang=\"de\">display-name</display-name>\n" +
-				"<portlet-class>portlet-class</portlet-class>\n" +
-				"<init-param id=\"init1\">\n" +
-				"<description xml:lang=\"de\">description</description>\n" +
-				"<name>name</name>\n" +
-				"<value>value</value>\n" +
-				"</init-param>\n" +
-				"<expiration-cache>50</expiration-cache>\n" +
-				" <supports id=\"sup1\">\n" +
-				"<mime-type>mime-type</mime-type>\n" +
-				"<portlet-mode>portlet-mode</portlet-mode>\n" +
-				"</supports>\n" +
-				" <supports id=\"sup2\">\n" +
-				"<mime-type>mime-type2</mime-type>\n" +
-				"<portlet-mode>portlet-mode2</portlet-mode>\n" +
-				"</supports>\n" +
-				" <supports id=\"sup3\">\n" +
-				"<mime-type>mime-type3</mime-type>\n" +
-				"<portlet-mode>portlet-mode3</portlet-mode>\n" +
-				"</supports>\n" +
-				"<supported-locale>supported-locale</supported-locale>\n" +
-				"<resource-bundle>resource-bundle</resource-bundle>\n" +
-				"<portlet-info id=\"info1\">\n" +
-				"<title>title</title>\n" +
-				"<short-title>short-title</short-title>\n" +
-				"<keywords>keywords</keywords>\n" +
-				"</portlet-info>\n" +
-				"<portlet-preferences id=\"prefs\">\n" +
-				"<preference id=\"pref1\">\n" +
-				"<name>name</name>\n" +
-				"<value>value</value>\n" +
-				"<read-only>true</read-only>\n" +
-				"</preference>\n" +
-				"<preferences-validator>preferences-validator</preferences-validator>\n" +
-				"</portlet-preferences>\n" +
-				"<security-role-ref id=\"sec1\">\n" +
-				"<description xml:lang=\"de\">description</description>\n" +
-				"<role-name>NMTOKEN</role-name>\n" +
-				"<role-link>role-link</role-link>\n" +
-				"</security-role-ref>\n" +
-				"</portlet>\n" );
-		attrs168.append("" + 
-				"<custom-portlet-mode id=\"mode1\">\n" +
-			    "<description xml:lang=\"de\">description</description>\n" +
-			    "<portlet-mode>portlet-mode</portlet-mode>\n" +
-			  "</custom-portlet-mode>\n" +
-			  "<custom-window-state id=\"state1\">\n" +
-			   "<description xml:lang=\"de\">description</description>\n" +
-			    "<window-state>window-state</window-state>\n" +
-			  "</custom-window-state>\n" +
-			  "<user-attribute id=\"att1\">\n" +
-			    "<description xml:lang=\"de\">description</description>\n" +
-			    "<name>name</name>\n" +
-			  "</user-attribute>\n" +
-			  "<security-constraint id=\"cons1\">\n" +
-			    "<display-name xml:lang=\"de\">display-name</display-name>\n" +
-			    "<portlet-collection>\n" +
-			     "<portlet-name>portlet-name</portlet-name>\n" +
-			   "</portlet-collection>\n" +
-			    "<user-data-constraint id=\"data1\">\n" +
-			      "<description xml:lang=\"de\">description</description>\n" +
-			      "<transport-guarantee>NONE</transport-guarantee>\n" +
-			    "</user-data-constraint>\n" +
-			  "</security-constraint>\n" +
-		"" );
-
-        portletNoCache.append(
-            "<portlet>"+
-            "<description>AboutPortletDescription</description>"+
-            "<portlet-name>AboutPortlet</portlet-name>"+
-            "<display-name>About Portlet</display-name>"+
-            "<display-name xml:lang=\"fr\">About Portlet</display-name>"+
-            "<portlet-class>org.apache.pluto.driver.portlets.AboutPortlet</portlet-class>"+
-            "        <init-param>\n" +
-            "            <description>a</description>\n" +
-            "            <name>b</name>\n" +
-            "            <value>v</value>\n" +
-            "        </init-param>" +
-            "<supports>"+
-            "<mime-type>text/html</mime-type>"+
-            "<portlet-mode>VIEW</portlet-mode>"+
-            "<portlet-mode>EDIT</portlet-mode>"+
-            "<portlet-mode>HELP</portlet-mode>"+
-            "</supports>"+
-            "<supported-locale>en</supported-locale>"+
-            "<portlet-info>"+
-            "<title>About Apache Pluto</title>"+
-            "</portlet-info>"+
-            "</portlet>"
-            );
-
-        portlet286NoCache.append( xmlBegin286 ).append( portletNoCache ).append( attrs286 ).append( xmlEnd );
-        portlet168NoCache.append( xmlBegin168 ).append( portletNoCache ).append( attrs168 ).append( xmlEnd );
-    }
-
-	/**
-	 * @throws java.lang.Exception
-	 */
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	/**
-	 * Test method for {@link org.apache.pluto.descriptors.services.jaxb.JaxBDescriptorServiceImpl#read(java.net.URL)}.
-	 */
-	@Test
-	public void testRead() {
-		
-		try {
-			
-			StringBuffer xml286 = new StringBuffer()
-	    	.append(xmlBegin286).append(portlet286)
-	    	.append(attrs286).append(xmlEnd);
-			
-			StringBuffer xml168 = new StringBuffer()
-			.append(xmlBegin168).append(portlet168)
-			.append(attrs168).append(xmlEnd);
-			
-	        InputStream in = new ByteArrayInputStream(xml286.toString().getBytes());
-	        
-			PortletApplicationDefinition portletApp286 = jaxb.read("test", "/test", in);
-			
-			in = new ByteArrayInputStream(xml168.toString().getBytes());
-			PortletApplicationDefinition portletApp168 = jaxb.read("test", "/test", in);
-			
-			validatePortletApp168AndPortletApp286(portletApp168, portletApp286);
-			
-		} catch (IOException e) {
-			fail("exception was thrown: " + e);
-		}
-		
-	}
-
-    /**
-     * Test method for {@link org.apache.pluto.descriptors.services.jaxb.JaxBDescriptorServiceImpl#read(java.net.URL)}
-     * with descriptors not having namespace.
-     * @throws ParserConfigurationException 
-     * @throws SAXException 
-     */
-    @Test
-    public void testReadNoNamespaceURI() throws IOException, ParserConfigurationException, SAXException {
-        
-        try {
-            
-            StringBuffer xml286NoNamespaceURI = new StringBuffer()
-            .append(xmlBegin286NoNamespaceURI).append(portlet286)
-            .append(attrs286).append(xmlEnd);
-            
-            StringBuffer xml168NoNamespaceURI = new StringBuffer()
-            .append(xmlBegin168NoNamespaceURI).append(portlet168)
-            .append(attrs168).append(xmlEnd);
-            
-            InputStream in = new ByteArrayInputStream(xml286NoNamespaceURI.toString().getBytes());
-            
-            PortletApplicationDefinition portletApp286NoNamespaceURI = jaxb.read("test", "/test", in);
-            
-            in = new ByteArrayInputStream(xml168NoNamespaceURI.toString().getBytes());
-            PortletApplicationDefinition portletApp168NoNamespaceURI = jaxb.read("test", "/test", in);
-            
-            validatePortletApp168AndPortletApp286(portletApp168NoNamespaceURI, portletApp286NoNamespaceURI);
-            
-        } catch (IOException e) {
-            fail("exception was thrown: " + e);
-        }
-        
-    }
-    
-    /**
-     * Validates if portlet has the right params for {@link #testRead()} and {@link #testReadNoNamespaceURI()}.
-     * @param portletApp168
-     * @param portletApp286
-     * @throws IOException
-     */
-    private void validatePortletApp168AndPortletApp286(PortletApplicationDefinition portletApp168, PortletApplicationDefinition portletApp286) throws IOException {
-        // test jsr168 compliant portlets
-        PortletDefinition portlet168 = (PortletDefinition)portletApp168.getPortlets().get(0);
-        assertTrue(portlet168.getExpirationCache()==50);
-        assertEquals(portlet168.getPortletName(),"portlet168");
-        assertEquals(portlet168.getInitParams().get(0).getParamValue(),"value");
-        assertEquals(portlet168.getSecurityRoleRefs().get(0).getRoleLink(), "role-link");
-        assertEquals(portletApp168.getCustomPortletModes().get(0).getPortletMode(), "portlet-mode");
-        assertEquals(portletApp168.getCustomWindowStates().get(0).getWindowState(), "window-state");
-        assertEquals(portletApp168.getUserAttributes().get(0).getName(), "name" );
-        assertEquals(portletApp168.getSecurityConstraints().get(0).getPortletNames().get(0), "portlet-name");
-        assertEquals(portlet168.getExpirationCache(), 50);
-        // id (isn't supported yet)
-//      assertFalse(portletApp.getId().equals("id2"));
-//      assertTrue(portletApp.getId().equals("id1"));
-        
-        jaxb.write(portletApp168, System.out);
-        // portlet id
-        PortletDefinition portlet286 = (PortletDefinition)portletApp286.getPortlets().get(0);
-//      assertTrue(portlet1.getId().equals("id2"));
-        
-        // portlet class
-        assertTrue(portlet286.getPortletClass().equals("portlet-class"));
-        
-        // portlet info
-        // id isn't supported yet
-//      assertTrue(portlet1.getPortletInfo().getId().equals("info1"));
-        assertTrue(portlet286.getPortletInfo().getTitle().equals("title"));
-        
-        assertEquals("supports size should be 3", 3, portlet286.getSupports().size());
-        
-        assertEquals(portletApp286.getCustomPortletModes().get(0).getPortletMode(), "portlet-mode");
-        assertEquals(portletApp286.getCustomWindowStates().get(0).getWindowState(), "window-state");
-        assertEquals(portletApp286.getUserAttributes().get(0).getName(), "name" );
-        assertEquals(portletApp286.getSecurityConstraints().get(0).getPortletNames().get(0), "portlet-name");
-        assertEquals(portletApp286.getEventDefinitions().get(0).getValueType(), "java-class");
-//      assertEquals(portletApp286.getRender().get(0).getName(), "QName");
-        assertEquals(portletApp286.getFilters().get(0).getLifecycles().get(0), "lifecycle");
-        assertEquals(portletApp286.getFilterMappings().get(0).getPortletNames().get(0), "portlet-name");
-        assertEquals(portletApp286.getResourceBundle(), "resource-bundle");
-        assertEquals(portletApp286.getVersion(), "2.0");
-        
-        // test container runtime options
-        assertEquals(portletApp286.getContainerRuntimeOptions().size(),1);
-        assertEquals(portletApp286.getContainerRuntimeOptions().get(0).getName(),"Runtime-Option-Portlet-App");
-        assertEquals(portletApp286.getContainerRuntimeOptions().get(0).getValues().get(0),"false");
-        
-        assertEquals(portlet286.getContainerRuntimeOptions().size(),1);
-        assertEquals(portlet286.getContainerRuntimeOptions().get(0).getName(),"Runtime-Option");
-        assertEquals(portlet286.getContainerRuntimeOptions().get(0).getValues().get(0),"true");
-        assertEquals(portlet286.getExpirationCache(), 100);
-        
-        jaxb.write(portletApp286, System.out);
-    }
-
-	/**
-	 * Test method for {@link org.apache.pluto.descriptors.services.jaxb.JaxBDescriptorServiceImpl#writePortletApp(com.sun.java.xml.ns.portlet.portlet_app_2_0_xsd.PortletAppType, java.io.OutputStream)}.
-	 */
-	@Test
-	public void testWrite() {
-		//fail("Not yet implemented");
-	}
-	
-	public void testReadNullDescriptor() {
-		try {
-			Assert.assertNull("Null descriptor did not return null", jaxb.read("test", "/test", null));
-			fail("exception should be thrown");
-		} catch (IOException ioe){
-			
-		}
-    }
-
-    public void testParseNoExpirationCache168() throws IOException {
-        InputStream inputStream = new ByteArrayInputStream(portlet168NoCache.toString().getBytes());
-        PortletApplicationDefinition portletDD = jaxb.read( "test", "/test", inputStream );
-
-        assertEquals( "1.0", portletDD.getVersion() );
-        assertEquals( 1, portletDD.getPortlets().size() );
-
-        PortletDefinition pd = (PortletDefinition) portletDD.getPortlets().get( 0 );
-        assertEquals( pd.getExpirationCache(), 0 );
-    }
-
-    public void testParseNoExpirationCache286() throws IOException {
-        InputStream inputStream = new ByteArrayInputStream(portlet286NoCache.toString().getBytes());
-        PortletApplicationDefinition portletDD = jaxb.read( "test", "/test", inputStream );
-
-        assertEquals( "2.0", portletDD.getVersion() );
-        assertEquals( 1, portletDD.getPortlets().size() );
-
-        PortletDefinition pd = (PortletDefinition) portletDD.getPortlets().get( 0 );
-        assertEquals( pd.getExpirationCache(), 0 );
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxbReadTest168Gen.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxbReadTest168Gen.java b/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxbReadTest168Gen.java
new file mode 100644
index 0000000..3da7f6c
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxbReadTest168Gen.java
@@ -0,0 +1,98 @@
+/*  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.
+ */
+
+package org.apache.pluto.container.impl;
+
+import static org.junit.Assert.*;
+
+import java.io.InputStream;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Unmarshaller;
+
+import org.apache.pluto.container.om.portlet10.impl.PortletAppType;
+import org.apache.pluto.container.om.portlet10.impl.PortletType;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Low-level test to read a deployment descriptor
+ */
+public class JaxbReadTest168Gen {
+
+   private static final String XML_FILE     = "org/apache/pluto/container/om/portlet/portlet168Generated.xml";
+   private static final String JAXB_CONTEXT = "org.apache.pluto.container.om.portlet10.impl:"
+                                                  + "org.apache.pluto.container.om.portlet20.impl:"
+                                                  + "org.apache.pluto.container.om.portlet30.impl";
+
+   PortletAppType    portletApp;
+
+   @Before
+   public void setUp() throws Exception {
+
+      try {
+         JAXBContext cntxt = JAXBContext.newInstance(JAXB_CONTEXT);
+         InputStream in = this.getClass().getClassLoader().getResourceAsStream(XML_FILE);
+         Unmarshaller um = cntxt.createUnmarshaller();
+         JAXBElement<?> jel = (JAXBElement<?>) um.unmarshal(in);
+         assertNotNull(jel.getValue());
+         System.out.println("===> Object type: "
+               + jel.getValue().getClass().getCanonicalName());
+         assertTrue(jel.getValue() instanceof PortletAppType);
+         portletApp = (PortletAppType) jel.getValue();
+      } catch (Exception e) {
+         System.out.println("\nException during setup: " + e.getMessage()
+               + "\n");
+         throw e;
+      }
+   }
+
+   @Test
+   public void portlet168Generated() throws Exception {
+      assertEquals(portletApp.getPortlet().size(), 1);
+      PortletType portlet = portletApp.getPortlet().get(0);
+      assertNotNull(portlet);
+      
+      assertEquals("portlet168", portlet.getPortletName().getValue());
+      assertEquals(1, portlet.getDisplayName().size());
+      assertEquals("display-name", portlet.getDisplayName().get(0).getValue());
+      assertEquals(0, portlet.getDisplayName().get(0).getLang().compareTo("de"));
+      
+      // Check out the init parameter
+      assertEquals(1, portlet.getInitParam().size());
+      assertEquals(1, portlet.getInitParam().get(0).getDescription().size());
+      assertEquals(0, portlet.getInitParam().get(0).getDescription().get(0).getLang().compareTo("de"));
+      assertEquals(0, portlet.getInitParam().get(0).getDescription().get(0).getValue().compareTo("description"));
+      assertEquals("name", portlet.getInitParam().get(0).getName().getValue());
+      assertEquals("value", portlet.getInitParam().get(0).getValue().getValue());
+      
+      // test expiration cache value
+      assertNotNull(portlet.getExpirationCache());
+      assertTrue(portlet.getExpirationCache().getValue() == 50);
+
+      // check for some stuff from the portlet application
+      assertEquals("portlet-mode", portletApp.getCustomPortletMode().get(0).getPortletMode().getValue());
+      assertEquals("window-state", portletApp.getCustomWindowState().get(0).getWindowState().getValue());
+      assertEquals("name", portletApp.getUserAttribute().get(0).getName().getValue());
+      assertEquals("portlet.name", portletApp.getSecurityConstraint().get(0)
+            .getPortletCollection().getPortletName().get(0).getValue());
+   }
+   
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxbReadTest168NC.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxbReadTest168NC.java b/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxbReadTest168NC.java
new file mode 100644
index 0000000..5d0a63e
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxbReadTest168NC.java
@@ -0,0 +1,101 @@
+/*  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.
+ */
+
+package org.apache.pluto.container.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.InputStream;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Unmarshaller;
+
+import org.apache.pluto.container.om.portlet10.impl.PortletAppType;
+import org.apache.pluto.container.om.portlet10.impl.PortletType;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Low-level test to read a deployment descriptor
+ */
+public class JaxbReadTest168NC {
+
+   private static final String XML_FILE     = "org/apache/pluto/container/om/portlet/portlet168NoCache.xml";
+   private static final String JAXB_CONTEXT = "org.apache.pluto.container.om.portlet10.impl:"
+                                                  + "org.apache.pluto.container.om.portlet20.impl:"
+                                                  + "org.apache.pluto.container.om.portlet30.impl";
+
+   PortletAppType    portletApp;
+
+   @Before
+   public void setUp() throws Exception {
+
+      try {
+         JAXBContext cntxt = JAXBContext.newInstance(JAXB_CONTEXT);
+         InputStream in = this.getClass().getClassLoader().getResourceAsStream(XML_FILE);
+         Unmarshaller um = cntxt.createUnmarshaller();
+         JAXBElement<?> jel = (JAXBElement<?>) um.unmarshal(in);
+         assertNotNull(jel.getValue());
+         System.out.println("===> Object type: "
+               + jel.getValue().getClass().getCanonicalName());
+         assertTrue(jel.getValue() instanceof PortletAppType);
+         portletApp = (PortletAppType) jel.getValue();
+      } catch (Exception e) {
+         System.out.println("\nException during setup: " + e.getMessage()
+               + "\n");
+         throw e;
+      }
+   }
+
+   @Test
+   public void test1() throws Exception {
+      assertEquals(portletApp.getPortlet().size(), 1);
+      PortletType portlet = portletApp.getPortlet().get(0);
+      assertNotNull(portlet);
+      
+      assertEquals("AboutPortlet", portlet.getPortletName().getValue());
+      
+      // Check out the init parameter
+      assertEquals(1, portlet.getInitParam().size());
+      assertEquals(1, portlet.getInitParam().get(0).getDescription().size());
+      assertEquals(0, portlet.getInitParam().get(0).getDescription().get(0)
+            .getLang().compareTo("de"));
+      assertEquals(0, portlet.getInitParam().get(0).getDescription().get(0)
+            .getValue().compareTo("a"));
+      assertEquals("b", portlet.getInitParam().get(0).getName().getValue());
+      assertEquals("v", portlet.getInitParam().get(0).getValue().getValue());
+      
+      // test (non-existent) expiration cache value
+      assertNull(portlet.getExpirationCache());
+
+      // check for some stuff from the portlet application
+      assertEquals("portlet-mode", portletApp.getCustomPortletMode().get(0).getPortletMode().getValue());
+      assertEquals("window-state", portletApp.getCustomWindowState().get(0).getWindowState().getValue());
+      assertEquals("name", portletApp.getUserAttribute().get(0).getName().getValue());
+      assertEquals("portlet-name", portletApp.getSecurityConstraint().get(0)
+            .getPortletCollection().getPortletName().get(0).getValue());
+
+      assertEquals(portletApp.getVersion() ,  "1.0");
+  
+   }
+   
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxbReadTest286Gen.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxbReadTest286Gen.java b/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxbReadTest286Gen.java
new file mode 100644
index 0000000..d5201ce
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxbReadTest286Gen.java
@@ -0,0 +1,138 @@
+/*  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.
+ */
+
+package org.apache.pluto.container.impl;
+
+import static org.junit.Assert.*;
+
+import java.io.InputStream;
+import java.util.List;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Unmarshaller;
+
+import org.apache.pluto.container.om.portlet.impl.fixtures.TestPortlet;
+import org.apache.pluto.container.om.portlet20.impl.ContainerRuntimeOptionType;
+import org.apache.pluto.container.om.portlet20.impl.InitParamType;
+import org.apache.pluto.container.om.portlet20.impl.PortletAppType;
+import org.apache.pluto.container.om.portlet20.impl.PortletType;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Low-level test to read a deployment descriptor
+ */
+public class JaxbReadTest286Gen {
+
+   private static final String XML_FILE     = "org/apache/pluto/container/om/portlet/portlet286Generated.xml";
+   private static final String JAXB_CONTEXT = "org.apache.pluto.container.om.portlet10.impl:"
+                                                  + "org.apache.pluto.container.om.portlet20.impl:"
+                                                  + "org.apache.pluto.container.om.portlet30.impl";
+
+   PortletAppType    portletApp;
+
+   @Before
+   public void setUp() throws Exception {
+
+      try {
+         JAXBContext cntxt = JAXBContext.newInstance(JAXB_CONTEXT);
+         InputStream in = this.getClass().getClassLoader().getResourceAsStream(XML_FILE);
+         Unmarshaller um = cntxt.createUnmarshaller();
+         JAXBElement<?> jel = (JAXBElement<?>) um.unmarshal(in);
+         assertNotNull(jel.getValue());
+         System.out.println("===> Object type: "
+               + jel.getValue().getClass().getCanonicalName());
+         assertTrue(jel.getValue() instanceof PortletAppType);
+         portletApp = (PortletAppType) jel.getValue();
+      } catch (Exception e) {
+         System.out.println("\nException during setup: " + e.getMessage()
+               + "\n");
+         throw e;
+      }
+   }
+
+   @Test
+   public void portlet286Generated() throws Exception {
+      assertEquals(portletApp.getPortlet().size(), 1);
+      PortletType portlet = portletApp.getPortlet().get(0);
+      assertNotNull(portlet);
+      
+      assertEquals("portlet286", portlet.getPortletName().getValue());
+      assertEquals(1, portlet.getDisplayName().size());
+      assertEquals("display-name", portlet.getDisplayName().get(0).getValue());
+      assertEquals(0, portlet.getDisplayName().get(0).getLang().compareTo("de"));
+      
+      // Check out the init parameter
+      List<InitParamType> params = portlet.getInitParam();
+      assertEquals(2, params.size());
+      InitParamType param = null;
+      for (InitParamType p : portlet.getInitParam()) {
+         if (p.getName().getValue().equals("name")) {
+            param = p;
+            break;
+         }
+      }
+      assertNotNull(param);
+      assertEquals(1, param.getDescription().size());
+      assertEquals(0, param.getDescription().get(0).getLang().compareTo("de"));
+      assertEquals(0, param.getDescription().get(0).getValue().compareTo("description"));
+      assertEquals("value", param.getValue().getValue());
+      
+      // test expiration cache value
+      assertNotNull(portlet.getExpirationCache());
+      assertTrue(portlet.getExpirationCache().getValue() == 50);
+
+      // check for some stuff from the portlet application
+      assertEquals("portlet-mode", portletApp.getCustomPortletMode().get(0).getPortletMode().getValue());
+      assertEquals("window-state", portletApp.getCustomWindowState().get(0).getWindowState().getValue());
+      assertEquals("name", portletApp.getUserAttribute().get(0).getName().getValue());
+      assertEquals("portlet.name", portletApp.getSecurityConstraint().get(0)
+            .getPortletCollection().getPortletName().get(0).getValue());
+      
+      // Some additional stuff from old test suite
+      assertTrue(portlet.getPortletClass().equals(TestPortlet.class.getCanonicalName()));
+      assertTrue(portlet.getPortletInfo().getTitle().getValue().equals("title"));
+      assertEquals( "supports size should be 3", 3, portlet.getSupports().size());
+      
+      assertEquals("portlet.name", portletApp.getSecurityConstraint().get(0).getPortletCollection().getPortletName().get(0).getValue());
+      assertEquals("org.apache.pluto.container.om.portlet.impl.fixtures.TestEventType", portletApp.getEventDefinition().get(0).getValueType());
+      assertEquals("lifecycle", portletApp.getFilter().get(0).getLifecycle().get(0));
+      assertEquals("portlet286", portletApp.getFilterMapping().get(0).getPortletName().get(0).getValue());
+      assertEquals("org.apache.portal.ResourceBundle", portletApp.getResourceBundle().getValue());
+      assertEquals("2.0", portletApp.getVersion());
+      
+      // test container runtime options
+      assertEquals(1, portletApp.getContainerRuntimeOption().size());
+      assertEquals("Runtime-Option-Portlet-App", portletApp.getContainerRuntimeOption().get(0).getName().getValue());
+      assertEquals("false", portletApp.getContainerRuntimeOption().get(0).getValue().get(0).getValue());
+      
+      assertEquals(2, portlet.getContainerRuntimeOption().size());
+      ContainerRuntimeOptionType opt = null;
+      for (ContainerRuntimeOptionType c : portlet.getContainerRuntimeOption()) {
+         if (c.getName().getValue().equalsIgnoreCase("Runtime-Option1")) {
+            opt = c;
+         }
+      }
+      assertNotNull(opt);
+      assertEquals("true", opt.getValue().get(0).getValue());
+
+   }
+   
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxbReadTest286NC.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxbReadTest286NC.java b/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxbReadTest286NC.java
new file mode 100644
index 0000000..232eb37
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxbReadTest286NC.java
@@ -0,0 +1,99 @@
+/*  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.
+ */
+
+package org.apache.pluto.container.impl;
+
+import static org.junit.Assert.*;
+
+import java.io.InputStream;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Unmarshaller;
+
+import org.apache.pluto.container.om.portlet20.impl.PortletAppType;
+import org.apache.pluto.container.om.portlet20.impl.PortletType;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Low-level test to read a deployment descriptor
+ */
+public class JaxbReadTest286NC {
+
+   private static final String XML_FILE     = "org/apache/pluto/container/om/portlet/portlet286NoCache.xml";
+   private static final String JAXB_CONTEXT = "org.apache.pluto.container.om.portlet10.impl:"
+                                                  + "org.apache.pluto.container.om.portlet20.impl:"
+                                                  + "org.apache.pluto.container.om.portlet30.impl";
+
+   PortletAppType    portletApp;
+
+   @Before
+   public void setUp() throws Exception {
+
+      try {
+         JAXBContext cntxt = JAXBContext.newInstance(JAXB_CONTEXT);
+         InputStream in = this.getClass().getClassLoader().getResourceAsStream(XML_FILE);
+         Unmarshaller um = cntxt.createUnmarshaller();
+         JAXBElement<?> jel = (JAXBElement<?>) um.unmarshal(in);
+         assertNotNull(jel.getValue());
+         System.out.println("===> Object type: "
+               + jel.getValue().getClass().getCanonicalName());
+         assertTrue(jel.getValue() instanceof PortletAppType);
+         portletApp = (PortletAppType) jel.getValue();
+      } catch (Exception e) {
+         System.out.println("\nException during setup: " + e.getMessage()
+               + "\n");
+         throw e;
+      }
+   }
+
+   @Test
+   public void test1() throws Exception {
+      assertEquals(portletApp.getPortlet().size(), 1);
+      PortletType portlet = portletApp.getPortlet().get(0);
+      assertNotNull(portlet);
+      
+      assertEquals("AboutPortlet", portlet.getPortletName().getValue());
+      
+      // Check out the init parameter
+      assertEquals(1, portlet.getInitParam().size());
+      assertEquals(1, portlet.getInitParam().get(0).getDescription().size());
+      assertEquals(0, portlet.getInitParam().get(0).getDescription().get(0)
+            .getLang().compareTo("de"));
+      assertEquals(0, portlet.getInitParam().get(0).getDescription().get(0)
+            .getValue().compareTo("a"));
+      assertEquals("b", portlet.getInitParam().get(0).getName().getValue());
+      assertEquals("v", portlet.getInitParam().get(0).getValue().getValue());
+      
+      // test (non-existent) expiration cache value
+      assertNull(portlet.getExpirationCache());
+
+      // check for some stuff from the portlet application
+      assertEquals("portlet-mode", portletApp.getCustomPortletMode().get(0).getPortletMode().getValue());
+      assertEquals("window-state", portletApp.getCustomWindowState().get(0).getWindowState().getValue());
+      assertEquals("name", portletApp.getUserAttribute().get(0).getName().getValue());
+      assertEquals("portlet-name", portletApp.getSecurityConstraint().get(0)
+            .getPortletCollection().getPortletName().get(0).getValue());
+
+      assertEquals(portletApp.getVersion() ,  "2.0");
+  
+   }
+   
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxbReadTest362Gen.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxbReadTest362Gen.java b/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxbReadTest362Gen.java
new file mode 100644
index 0000000..a9dbc46
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/impl/JaxbReadTest362Gen.java
@@ -0,0 +1,121 @@
+/*  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.
+ */
+
+package org.apache.pluto.container.impl;
+
+import static org.junit.Assert.*;
+
+import java.io.InputStream;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Unmarshaller;
+
+import org.apache.pluto.container.om.portlet30.impl.PortletAppType;
+import org.apache.pluto.container.om.portlet30.impl.PortletType;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Low-level test to read a deployment descriptor
+ */
+public class JaxbReadTest362Gen {
+
+   private static final String XML_FILE     = "org/apache/pluto/container/om/portlet/portlet362Generated.xml";
+   private static final String JAXB_CONTEXT = "org.apache.pluto.container.om.portlet10.impl:"
+                                                  + "org.apache.pluto.container.om.portlet20.impl:"
+                                                  + "org.apache.pluto.container.om.portlet30.impl";
+
+   PortletAppType    portletApp;
+
+   @Before
+   public void setUp() throws Exception {
+
+      try {
+         JAXBContext cntxt = JAXBContext.newInstance(JAXB_CONTEXT);
+         InputStream in = this.getClass().getClassLoader().getResourceAsStream(XML_FILE);
+         Unmarshaller um = cntxt.createUnmarshaller();
+         JAXBElement<?> jel = (JAXBElement<?>) um.unmarshal(in);
+         assertNotNull(jel.getValue());
+         System.out.println("===> Object type: "
+               + jel.getValue().getClass().getCanonicalName());
+         assertTrue(jel.getValue() instanceof PortletAppType);
+         portletApp = (PortletAppType) jel.getValue();
+      } catch (Exception e) {
+         System.out.println("\nException during setup: " + e.getMessage()
+               + "\n");
+         throw e;
+      }
+   }
+
+   @Test
+   public void portlet362Generated() throws Exception {
+      assertEquals(portletApp.getPortlet().size(), 1);
+      PortletType portlet = portletApp.getPortlet().get(0);
+      assertNotNull(portlet);
+      
+      assertEquals("portlet362", portlet.getPortletName().getValue());
+      assertEquals(1, portlet.getDisplayName().size());
+      assertEquals("display-name", portlet.getDisplayName().get(0).getValue());
+      assertEquals(0, portlet.getDisplayName().get(0).getLang().compareTo("de"));
+      
+      // Check out the init parameter
+      assertEquals(2, portlet.getInitParam().size());
+      assertEquals(1, portlet.getInitParam().get(0).getDescription().size());
+      assertEquals(0, portlet.getInitParam().get(0).getDescription().get(0)
+            .getLang().compareTo("de"));
+      assertEquals(0, portlet.getInitParam().get(0).getDescription().get(0)
+            .getValue().compareTo("description"));
+      assertEquals("name", portlet.getInitParam().get(0).getName().getValue());
+      assertEquals("value", portlet.getInitParam().get(0).getValue().getValue());
+      
+      // test expiration cache value
+      assertNotNull(portlet.getExpirationCache());
+      assertTrue(portlet.getExpirationCache().getValue() == 50);
+
+      // check for some stuff from the portlet application
+      assertEquals("portlet-mode", portletApp.getCustomPortletMode().get(0).getPortletMode().getValue());
+      assertEquals("window-state", portletApp.getCustomWindowState().get(0).getWindowState().getValue());
+      assertEquals("name", portletApp.getUserAttribute().get(0).getName().getValue());
+      assertEquals("portlet362", portletApp.getSecurityConstraint().get(0)
+            .getPortletCollection().getPortletName().get(0).getValue());
+      
+      // Some additional stuff from old test suite
+      assertTrue(portlet.getPortletClass().equals("org.apache.pluto.container.om.portlet.impl.fixtures.TestPortlet"));
+      assertTrue(portlet.getPortletInfo().getTitle().getValue().equals("title"));
+      assertEquals( "supports size should be 3", 3, portlet.getSupports().size());
+      
+      assertEquals("org.apache.pluto.container.om.portlet.impl.fixtures.TestEventType", portletApp.getEventDefinition().get(0).getValueType());
+      assertEquals("lifecycle", portletApp.getFilter().get(0).getLifecycle().get(0));
+      assertEquals("portlet362", portletApp.getFilterMapping().get(0).getPortletName().get(0).getValue());
+      assertEquals("org.apache.portal.ResourceBundle", portletApp.getResourceBundle().getValue());
+      assertEquals("3.0", portletApp.getVersion());
+      
+      // test container runtime options
+      assertEquals(1, portletApp.getContainerRuntimeOption().size());
+      assertEquals("Runtime-Option-Portlet-App", portletApp.getContainerRuntimeOption().get(0).getName().getValue());
+      assertEquals("false", portletApp.getContainerRuntimeOption().get(0).getValue().get(0).getValue());
+      
+      assertEquals(2, portlet.getContainerRuntimeOption().size());
+      assertEquals("Runtime-Option1", portlet.getContainerRuntimeOption().get(0).getName().getValue());
+      assertEquals("true", portlet.getContainerRuntimeOption().get(0).getValue().get(0).getValue());
+
+   }
+   
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/fixtures/TestEventType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/fixtures/TestEventType.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/fixtures/TestEventType.java
new file mode 100644
index 0000000..3bb77aa
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/fixtures/TestEventType.java
@@ -0,0 +1,28 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl.fixtures;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class TestEventType {
+
+}


[21/38] portals-pluto git commit: Added CDI dependency using Weld as the CDI implementation. Changed configuration to install the Weld CDI jar in the Tomcat conf/lib directory along with the SLF4J API and implementation jars.

Posted by ms...@apache.org.
Added CDI dependency using Weld as the CDI implementation. Changed
configuration to install the Weld CDI jar in the Tomcat conf/lib directory
along with the SLF4J API and implementation jars.


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/094449e1
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/094449e1
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/094449e1

Branch: refs/heads/V3Prototype
Commit: 094449e13e49eb4ef765738d4568c23f521574ab
Parents: 0b1bf06
Author: Scott Nicklous <ms...@apache.org>
Authored: Thu Nov 12 17:07:59 2015 +0100
Committer: Scott Nicklous <ms...@apache.org>
Committed: Thu Nov 12 17:07:59 2015 +0100

----------------------------------------------------------------------
 .../pluto/maven/AbstractManagementMojo.java     | 381 +++++++++----------
 .../pluto/maven/InstallationDependency.java     |  23 +-
 .../src/main/resources/versions.properties      |   2 +
 pluto-portal/pom.xml                            |   4 +-
 pom.xml                                         |   8 +
 5 files changed, 219 insertions(+), 199 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/094449e1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/AbstractManagementMojo.java
----------------------------------------------------------------------
diff --git a/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/AbstractManagementMojo.java b/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/AbstractManagementMojo.java
index e177475..f1496f3 100644
--- a/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/AbstractManagementMojo.java
+++ b/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/AbstractManagementMojo.java
@@ -1,193 +1,188 @@
-/*
- * 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.
- */
-package org.apache.pluto.maven;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.artifact.resolver.ArtifactResolver;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.pluto.util.install.InstallationConfig;
-import org.apache.pluto.util.install.PortalInstaller;
-import org.apache.pluto.util.install.PortalInstallerFactory;
-import org.apache.pluto.util.install.ServerConfig;
-
-/**
- * Abstract Mojo for installation tasks.
- *
- * @since 07/29/2005
- */
-public abstract class AbstractManagementMojo extends AbstractPlutoMojo {
-
-    /**
-     * @parameter expression="${domain}"
-     */
-    protected String domain = "PlutoDomain";
-
-    /**
-     * @parameter expression="${server}"
-     */
-    protected String server = "PlutoServer";
-
-    /**
-     * @parameter expression="${host}"
-     */
-    protected String host = "localhost";
-
-    /**
-     * @parameter expression="${port}"
-     */
-    protected int port;
-
-    /**
-     * @component
-     */
-    protected ArtifactFactory artifactFactory;
-
-    /**
-     * @component
-     */
-    protected ArtifactResolver artifactResolver;
-
-    /**
-     * @parameter expression="${localRepository}
-     */
-    protected ArtifactRepository artifactRepository;
-
-    /**
-     * @parameter expression="${project.remoteArtifactRepositories}"
-     */
-    protected List remoteRepositories;
-
-    /**
-     * @parameter expression="${ctx}" default-value="pluto"
-     *
-     */
-    protected String portalContext;
-
-    /**
-     * @parameter expression="${pom.currentVersion} default="1.0-SNAPSHOT"
-     */
-    protected String version;
-
-    /**
-     *  at parameter expression="${portletApps}"
-     */
-    protected Map portletApps = new HashMap();
-
-    protected AbstractManagementMojo() {
-    	// Do nothing.
-    }
-
-    protected List getSharedDependencies() throws ArtifactNotFoundException, ArtifactResolutionException {
-       return getDependencies(InstallationDependency.getSharedDependencies());
-    }
-
-    protected List getEndorsedDependencies() throws ArtifactNotFoundException, ArtifactResolutionException {
-       return getDependencies(InstallationDependency.getEndorsedDependencies());
-    }
-
-    private List getDependencies(Collection artifacts) throws ArtifactNotFoundException, ArtifactResolutionException {
-        List list = new ArrayList();
-        Iterator it = artifacts.iterator();
-        while(it.hasNext()) {
-            InstallationDependency dep = (InstallationDependency)it.next();
-            Artifact artifact = artifactFactory.createArtifactWithClassifier(
-                    dep.getGroupId(), dep.getArtifactId(), dep.getVersion(), dep.getType(), null
-            );
-
-            artifactResolver.resolve(artifact, remoteRepositories, artifactRepository);
-            if(artifact.getFile() == null) {
-                getLog().warn("Unable to find file for artifact: "+artifact.getArtifactId());
-            }
-
-            list.add(artifact.getFile());
-        }
-        return list;
-    }
-
-    protected ServerConfig getServerConfig() {
-        ServerConfig config = new ServerConfig();
-        config.setDomain(domain);
-        config.setHost(host);
-        config.setPort(port);
-        config.setServer(server);
-        return config;
-    }
-
-    protected PortalInstaller getHandler() {
-        return PortalInstallerFactory.getAppServerHandler(installationDirectory);
-    }
-
-    protected InstallationConfig createInstallationConfig() throws ArtifactNotFoundException, ArtifactResolutionException {
-        InstallationConfig config = new InstallationConfig();
-        config.setInstallationDirectory(installationDirectory);
-        config.setPortalContextPath(portalContext);
-        config.setPortalApplication(getPortalApplication());
-        config.setPortletApplications(getPortletApplications());
-        config.setEndorsedDependencies(getEndorsedDependencies());
-        config.setSharedDependencies(getSharedDependencies());
-        config.setServerConfig(getServerConfig());
-        return config;
-    }
-
-    private File getPortalApplication() throws ArtifactNotFoundException, ArtifactResolutionException  {
-        InstallationDependency dep = InstallationDependency.PORTAL;
-        Artifact artifact = artifactFactory.createBuildArtifact(
-           dep.getGroupId(), dep.getArtifactId(), dep.getVersion(), dep.getType()
-        );
-        artifactResolver.resolve(artifact, remoteRepositories, artifactRepository);
-        return artifact.getFile();
-    }
-
-    private Map getPortletApplications() throws ArtifactNotFoundException, ArtifactResolutionException {
-        Map files = new HashMap();
-        InstallationDependency dep = InstallationDependency.TESTSUITE;
-        Artifact artifact = artifactFactory.createBuildArtifact(
-                dep.getGroupId(), dep.getArtifactId(), dep.getVersion(), dep.getType()
-        );
-        artifactResolver.resolve(artifact, remoteRepositories, artifactRepository);
-
-        files.put("testsuite", artifact.getFile());
-        /*
-        Iterator apps = portletApps.iterator();
-        while(apps.hasNext()) {
-            //files.add(artifactFactory.createBuildArtifact(
-            //    InstallMojo.GROUP_ID, apps.next().toString(), version, "war"
-            //).getFile());
-        }
-        */
-        return files;
-    }
-
-    protected void doValidate() throws Exception {
-        if(installationDirectory == null || !installationDirectory.exists()) {
-            throw new MojoExecutionException("A valid installation directory must be provided in order to install pluto.");
-
-        }
-    }
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.maven;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
+import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.artifact.resolver.ArtifactResolver;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.pluto.util.install.InstallationConfig;
+import org.apache.pluto.util.install.PortalInstaller;
+import org.apache.pluto.util.install.PortalInstallerFactory;
+import org.apache.pluto.util.install.ServerConfig;
+
+/**
+ * Abstract Mojo for installation tasks.
+ *
+ * @since 07/29/2005
+ */
+public abstract class AbstractManagementMojo extends AbstractPlutoMojo {
+
+    /**
+     * @parameter expression="${domain}"
+     */
+    protected String domain = "PlutoDomain";
+
+    /**
+     * @parameter expression="${server}"
+     */
+    protected String server = "PlutoServer";
+
+    /**
+     * @parameter expression="${host}"
+     */
+    protected String host = "localhost";
+
+    /**
+     * @parameter expression="${port}"
+     */
+    protected int port;
+
+    /**
+     * @component
+     */
+    protected ArtifactFactory artifactFactory;
+
+    /**
+     * @component
+     */
+    protected ArtifactResolver artifactResolver;
+
+    /**
+     * @parameter expression="${localRepository}
+     */
+    protected ArtifactRepository artifactRepository;
+
+    /**
+     * @parameter expression="${project.remoteArtifactRepositories}"
+     */
+    protected List<File> remoteRepositories;
+
+    /**
+     * @parameter expression="${ctx}" default-value="pluto"
+     *
+     */
+    protected String portalContext;
+
+    /**
+     * @parameter expression="${pom.currentVersion} default="1.0-SNAPSHOT"
+     */
+    protected String version;
+
+    protected AbstractManagementMojo() {
+    	// Do nothing.
+    }
+
+    protected List<File> getSharedDependencies() throws ArtifactNotFoundException, ArtifactResolutionException {
+       return getDependencies(InstallationDependency.getSharedDependencies());
+    }
+
+    protected List<File> getEndorsedDependencies() throws ArtifactNotFoundException, ArtifactResolutionException {
+       return getDependencies(InstallationDependency.getEndorsedDependencies());
+    }
+
+    private List<File> getDependencies(Collection<InstallationDependency> artifacts) throws ArtifactNotFoundException, ArtifactResolutionException {
+        List<File> list = new ArrayList<File>();
+        Iterator<InstallationDependency> it = artifacts.iterator();
+        while(it.hasNext()) {
+            InstallationDependency dep = it.next();
+            Artifact artifact = artifactFactory.createArtifactWithClassifier(
+                    dep.getGroupId(), dep.getArtifactId(), dep.getVersion(), dep.getType(), null
+            );
+
+            artifactResolver.resolve(artifact, remoteRepositories, artifactRepository);
+            if(artifact.getFile() == null) {
+                getLog().warn("Unable to find file for artifact: "+artifact.getArtifactId());
+            }
+
+            list.add(artifact.getFile());
+        }
+        return list;
+    }
+
+    protected ServerConfig getServerConfig() {
+        ServerConfig config = new ServerConfig();
+        config.setDomain(domain);
+        config.setHost(host);
+        config.setPort(port);
+        config.setServer(server);
+        return config;
+    }
+
+    protected PortalInstaller getHandler() {
+        return PortalInstallerFactory.getAppServerHandler(installationDirectory);
+    }
+
+    protected InstallationConfig createInstallationConfig() throws ArtifactNotFoundException, ArtifactResolutionException {
+        InstallationConfig config = new InstallationConfig();
+        config.setInstallationDirectory(installationDirectory);
+        config.setPortalContextPath(portalContext);
+        config.setPortalApplication(getPortalApplication());
+        config.setPortletApplications(getPortletApplications());
+        config.setEndorsedDependencies(getEndorsedDependencies());
+        config.setSharedDependencies(getSharedDependencies());
+        config.setServerConfig(getServerConfig());
+        return config;
+    }
+
+    private File getPortalApplication() throws ArtifactNotFoundException, ArtifactResolutionException  {
+        InstallationDependency dep = InstallationDependency.PORTAL;
+        Artifact artifact = artifactFactory.createBuildArtifact(
+           dep.getGroupId(), dep.getArtifactId(), dep.getVersion(), dep.getType()
+        );
+        artifactResolver.resolve(artifact, remoteRepositories, artifactRepository);
+        return artifact.getFile();
+    }
+
+    private Map<String, File> getPortletApplications() throws ArtifactNotFoundException, ArtifactResolutionException {
+        Map<String, File> files = new HashMap<String, File>();
+        InstallationDependency dep = InstallationDependency.TESTSUITE;
+        Artifact artifact = artifactFactory.createBuildArtifact(
+                dep.getGroupId(), dep.getArtifactId(), dep.getVersion(), dep.getType()
+        );
+        artifactResolver.resolve(artifact, remoteRepositories, artifactRepository);
+
+        files.put("testsuite", artifact.getFile());
+        /*
+        Iterator apps = portletApps.iterator();
+        while(apps.hasNext()) {
+            //files.add(artifactFactory.createBuildArtifact(
+            //    InstallMojo.GROUP_ID, apps.next().toString(), version, "war"
+            //).getFile());
+        }
+        */
+        return files;
+    }
+
+    protected void doValidate() throws Exception {
+        if(installationDirectory == null || !installationDirectory.exists()) {
+            throw new MojoExecutionException("A valid installation directory must be provided in order to install pluto.");
+
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/094449e1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/InstallationDependency.java
----------------------------------------------------------------------
diff --git a/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/InstallationDependency.java b/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/InstallationDependency.java
index af3a309..5854075 100644
--- a/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/InstallationDependency.java
+++ b/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/InstallationDependency.java
@@ -50,6 +50,18 @@ class InstallationDependency {
         new InstallationDependency("org.apache.portals.pluto", "portlet-api", 
                 VERSION_PROPERTIES.getProperty("portals.portlet-api.version"));
 
+    public static final InstallationDependency CDI_IMPL =
+        new InstallationDependency("org.jboss.weld.servlet", "weld-servlet", 
+                VERSION_PROPERTIES.getProperty("cdi.version"));
+
+    public static final InstallationDependency SLF4J_API =
+        new InstallationDependency("org.slf4j", "slf4j-api", 
+                VERSION_PROPERTIES.getProperty("slf4j.version"));
+
+    public static final InstallationDependency SLF4J_IMPL =
+        new InstallationDependency("org.slf4j", "slf4j-jdk14", 
+                VERSION_PROPERTIES.getProperty("slf4j.version"));
+
     public static final InstallationDependency CONTAINER_API =
         new InstallationDependency("org.apache.portals.pluto", "pluto-container-api", 
                 VERSION_PROPERTIES.getProperty("pluto.version"));
@@ -127,8 +139,8 @@ class InstallationDependency {
  
     
 
-    private static final List ENDORSED = new ArrayList();
-    private static final List SHARED = new ArrayList();
+    private static final List<InstallationDependency> ENDORSED = new ArrayList<InstallationDependency>();
+    private static final List<InstallationDependency> SHARED = new ArrayList<InstallationDependency>();
 
     static {
         SHARED.add(PORTLET_API);
@@ -136,14 +148,17 @@ class InstallationDependency {
         SHARED.add(CONTAINER_DRIVER_API);
         SHARED.add(TAGLIB);
         SHARED.add(CCPP_API);
+        SHARED.add(CDI_IMPL);
+        SHARED.add(SLF4J_API);
+        SHARED.add(SLF4J_IMPL);
     }
 
 
-    public static Collection getEndorsedDependencies() {
+    public static Collection<InstallationDependency> getEndorsedDependencies() {
         return Collections.unmodifiableCollection(ENDORSED);
     }
 
-    public static Collection getSharedDependencies() {
+    public static Collection<InstallationDependency> getSharedDependencies() {
         return Collections.unmodifiableCollection(SHARED);
     }
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/094449e1/maven-pluto-plugin/src/main/resources/versions.properties
----------------------------------------------------------------------
diff --git a/maven-pluto-plugin/src/main/resources/versions.properties b/maven-pluto-plugin/src/main/resources/versions.properties
index 1270d21..7175c33 100644
--- a/maven-pluto-plugin/src/main/resources/versions.properties
+++ b/maven-pluto-plugin/src/main/resources/versions.properties
@@ -22,6 +22,8 @@
 portals.portlet-api.version=${portals.portlet-api.version}
 servlet-api.version=${servlet-api.version}
 jsp-api.version=${jsp-api.version}
+cdi.version=${cdi.version}
+slf4j.version=${slf4j.version}
 jstl.version=${jstl.version}
 taglibs.standard.version=${taglibs.standard.version}
 xerces.version=${xerces.version}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/094449e1/pluto-portal/pom.xml
----------------------------------------------------------------------
diff --git a/pluto-portal/pom.xml b/pluto-portal/pom.xml
index 0b94a43..8364b94 100644
--- a/pluto-portal/pom.xml
+++ b/pluto-portal/pom.xml
@@ -120,12 +120,12 @@
     <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
-       <scope>${dependency.scope}</scope>
+       <scope>provided</scope>
     </dependency>
 	 <dependency>
 	 	<groupId>org.slf4j</groupId>
       <artifactId>slf4j-jdk14</artifactId>
-	 	<scope>${dependency.scope}</scope>
+	 	<scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/094449e1/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 79aa290..d262334 100644
--- a/pom.xml
+++ b/pom.xml
@@ -276,6 +276,7 @@ generate mailto links. -->
     <junit.version>4.12</junit.version>
     <jmock.version>1.2.0</jmock.version>
     <xmlunit.version>1.1</xmlunit.version>
+    <cdi.version>2.3.1.Final</cdi.version>
 
     <!-- The following properties are not directly used as maven
 dependencies, they're used by the maven pluto plugin for
@@ -351,6 +352,13 @@ TODO: Check if we need all of them. -->
           </exclusion>
         </exclusions>
       </dependency>
+      
+      <!-- CDI Library -->
+      <dependency>
+          <groupId>org.jboss.weld.servlet</groupId>
+          <artifactId>weld-servlet</artifactId>
+          <version>${}</version>
+      </dependency>      
 
       <!--  CCPP Libraries -->
       <dependency>


[31/38] portals-pluto git commit: First step in implementation of header phase support. Initial, incomplete implementation of HeaderRequestImpl, HeaderResponseImpl and th associated contexts. Completed invocation path.

Posted by ms...@apache.org.
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/65c0050b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/FilterChainImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/FilterChainImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/FilterChainImpl.java
index 1fb7746..55c928e 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/FilterChainImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/FilterChainImpl.java
@@ -1,189 +1,233 @@
-/*
- * 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.
- */
-package org.apache.pluto.driver.services.container;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.EventPortlet;
-import javax.portlet.EventRequest;
-import javax.portlet.EventResponse;
-import javax.portlet.Portlet;
-import javax.portlet.PortletContext;
-import javax.portlet.PortletException;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.ResourceRequest;
-import javax.portlet.ResourceResponse;
-import javax.portlet.ResourceServingPortlet;
-import javax.portlet.filter.ActionFilter;
-import javax.portlet.filter.EventFilter;
-import javax.portlet.filter.FilterChain;
-import javax.portlet.filter.RenderFilter;
-import javax.portlet.filter.ResourceFilter;
-
-import org.apache.pluto.container.om.portlet.Filter;
-
-/**
- * A <code>FilterChain</code> is an object provided by the portlet container
- * to the developer giving a view into the invocation chain of a
- * filtered request for a portlet. Filters use the <code>FilterChain</code>
- * to invoke the next filter in the chain, or if the calling filter is the
- * last filter in the chain, to invoke the portlet at the end of the chain.
- *@since 29/05/2007
- *@version 2.0
- */
-public class FilterChainImpl implements FilterChain {
-
-    private List<Filter> filterList = new ArrayList<Filter>();
-    private String lifeCycle;
-    Portlet portlet;
-    EventPortlet eventPortlet;
-    ResourceServingPortlet resourceServingPortlet;
-    ClassLoader loader;
-    PortletContext portletContext;
-    int filterListIndex = 0;
-
-    public FilterChainImpl(String lifeCycle){
-        this.lifeCycle = lifeCycle;
-    }
-    public void processFilter(EventRequest req, EventResponse res, EventPortlet eventPortlet, PortletContext portletContext) throws IOException, PortletException{
-        this.eventPortlet = eventPortlet;
-        this.loader = Thread.currentThread().getContextClassLoader();
-        this.portletContext = portletContext;
-        doFilter(req,res);
-    }
-    public void processFilter(ResourceRequest req, ResourceResponse res, ResourceServingPortlet resourceServingPortlet, PortletContext portletContext) throws IOException, PortletException{
-        this.resourceServingPortlet = resourceServingPortlet;
-        this.loader = Thread.currentThread().getContextClassLoader();
-        this.portletContext = portletContext;
-        doFilter(req,res);
-    }
-
-    public void processFilter(ActionRequest req, ActionResponse res, Portlet portlet, PortletContext portletContext) throws IOException, PortletException{
-        this.portlet = portlet;
-        this.loader = Thread.currentThread().getContextClassLoader();
-        this.portletContext = portletContext;
-        doFilter(req,res);
-    }
-
-    public void processFilter(RenderRequest req, RenderResponse res, Portlet portlet, PortletContext portletContext) throws IOException, PortletException{
-        this.portlet = portlet;
-        this.loader = Thread.currentThread().getContextClassLoader();
-        this.portletContext = portletContext;
-        doFilter(req, res);
-    }
-
-    public void addFilter(Filter filter){
-        filterList.add(filter);
-    }
-
-    public void doFilter(ActionRequest request, ActionResponse response) throws IOException, PortletException {
-        if (filterListIndex <filterList.size()){
-            Filter filter = filterList.get(filterListIndex);
-            filterListIndex++;
-            try {
-                ActionFilter actionFilter = (ActionFilter) loader.loadClass(filter.getFilterClass()).newInstance();
-                FilterConfigImpl filterConfig = new FilterConfigImpl(filter.getFilterName(),filter.getInitParams(),portletContext);
-                actionFilter.init(filterConfig);
-                actionFilter.doFilter(request, response, this);
-                actionFilter.destroy();
-            } catch (InstantiationException e) {
-                e.printStackTrace();
-            } catch (IllegalAccessException e) {
-                e.printStackTrace();
-            } catch (ClassNotFoundException e) {
-                e.printStackTrace();
-            }
-        }
-        else{
-            portlet.processAction(request, response);
-        }
-    }
-
-    public void doFilter(EventRequest request, EventResponse response) throws IOException, PortletException {
-        if (filterListIndex <filterList.size()){
-            Filter filter = filterList.get(filterListIndex);
-            filterListIndex++;
-            try {
-                EventFilter eventFilter = (EventFilter) loader.loadClass(filter.getFilterClass()).newInstance();
-                FilterConfigImpl filterConfig = new FilterConfigImpl(filter.getFilterName(),filter.getInitParams(),portletContext);
-                eventFilter.init(filterConfig);
-                eventFilter.doFilter(request, response, this);
-                eventFilter.destroy();
-            } catch (InstantiationException e) {
-                e.printStackTrace();
-            } catch (IllegalAccessException e) {
-                e.printStackTrace();
-            } catch (ClassNotFoundException e) {
-                e.printStackTrace();
-            }
-        }
-        else{
-            eventPortlet.processEvent(request, response);
-        }
-    }
-
-    public void doFilter(RenderRequest request, RenderResponse response) throws IOException, PortletException {
-        if (filterListIndex <filterList.size()){
-            Filter filter = filterList.get(filterListIndex);
-            filterListIndex++;
-            try {
-                RenderFilter renderFilter = (RenderFilter) loader.loadClass(filter.getFilterClass()).newInstance();
-                FilterConfigImpl filterConfig = new FilterConfigImpl(filter.getFilterName(),filter.getInitParams(),portletContext);
-                renderFilter.init(filterConfig);
-                renderFilter.doFilter(request, response, this);
-                renderFilter.destroy();
-            } catch (InstantiationException e) {
-                e.printStackTrace();
-            } catch (IllegalAccessException e) {
-                e.printStackTrace();
-            } catch (ClassNotFoundException e) {
-                e.printStackTrace();
-            }
-        }
-        else{
-            portlet.render(request, response);
-        }
-    }
-
-    public void doFilter(ResourceRequest request, ResourceResponse response) throws IOException, PortletException {
-        if (filterListIndex <filterList.size()){
-            Filter filter = filterList.get(filterListIndex);
-            filterListIndex++;
-            try {
-                ResourceFilter resourceFilter = (ResourceFilter) loader.loadClass(filter.getFilterClass()).newInstance();
-                FilterConfigImpl filterConfig = new FilterConfigImpl(filter.getFilterName(),filter.getInitParams(),portletContext);
-                resourceFilter.init(filterConfig);
-                resourceFilter.doFilter(request, response, this);
-                resourceFilter.destroy();
-            } catch (InstantiationException e) {
-                e.printStackTrace();
-            } catch (IllegalAccessException e) {
-                e.printStackTrace();
-            } catch (ClassNotFoundException e) {
-                e.printStackTrace();
-            }
-        }
-        else{
-            resourceServingPortlet.serveResource(request, response);
-        }
-    }
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.driver.services.container;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.EventPortlet;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.HeaderPortlet;
+import javax.portlet.HeaderRequest;
+import javax.portlet.HeaderResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.portlet.ResourceServingPortlet;
+import javax.portlet.filter.ActionFilter;
+import javax.portlet.filter.EventFilter;
+import javax.portlet.filter.FilterChain;
+import javax.portlet.filter.HeaderFilter;
+import javax.portlet.filter.HeaderFilterChain;
+import javax.portlet.filter.RenderFilter;
+import javax.portlet.filter.ResourceFilter;
+
+import org.apache.pluto.container.om.portlet.Filter;
+
+/**
+ * A <code>FilterChain</code> is an object provided by the portlet container to the developer giving a view into the
+ * invocation chain of a filtered request for a portlet. Filters use the <code>FilterChain</code> to invoke the next
+ * filter in the chain, or if the calling filter is the last filter in the chain, to invoke the portlet at the end of
+ * the chain.
+ * 
+ * @since 29/05/2007
+ * @version 2.0
+ */
+public class FilterChainImpl implements FilterChain, HeaderFilterChain {
+
+   private List<Filter>   filterList      = new ArrayList<Filter>();
+   @SuppressWarnings("unused")
+   private String         lifeCycle;
+   Portlet                portlet;
+   EventPortlet           eventPortlet;
+   ResourceServingPortlet resourceServingPortlet;
+   HeaderPortlet          headerPortlet;
+   ClassLoader            loader;
+   PortletContext         portletContext;
+   int                    filterListIndex = 0;
+
+   public FilterChainImpl(String lifeCycle) {
+      this.lifeCycle = lifeCycle;
+   }
+
+   public void processFilter(EventRequest req, EventResponse res, EventPortlet eventPortlet,
+         PortletContext portletContext) throws IOException, PortletException {
+      this.eventPortlet = eventPortlet;
+      this.loader = Thread.currentThread().getContextClassLoader();
+      this.portletContext = portletContext;
+      doFilter(req, res);
+   }
+
+   public void processFilter(ResourceRequest req, ResourceResponse res, ResourceServingPortlet resourceServingPortlet,
+         PortletContext portletContext) throws IOException, PortletException {
+      this.resourceServingPortlet = resourceServingPortlet;
+      this.loader = Thread.currentThread().getContextClassLoader();
+      this.portletContext = portletContext;
+      doFilter(req, res);
+   }
+
+   public void processFilter(ActionRequest req, ActionResponse res, Portlet portlet, PortletContext portletContext)
+         throws IOException, PortletException {
+      this.portlet = portlet;
+      this.loader = Thread.currentThread().getContextClassLoader();
+      this.portletContext = portletContext;
+      doFilter(req, res);
+   }
+
+   public void processFilter(RenderRequest req, RenderResponse res, Portlet portlet, PortletContext portletContext)
+         throws IOException, PortletException {
+      this.portlet = portlet;
+      this.loader = Thread.currentThread().getContextClassLoader();
+      this.portletContext = portletContext;
+      doFilter(req, res);
+   }
+
+   public void processFilter(HeaderRequest req, HeaderResponse res, HeaderPortlet portlet, PortletContext portletContext)
+         throws IOException, PortletException {
+      this.headerPortlet = portlet;
+      this.loader = Thread.currentThread().getContextClassLoader();
+      this.portletContext = portletContext;
+      doFilter(req, res);
+   }
+
+   public void addFilter(Filter filter) {
+      filterList.add(filter);
+   }
+
+   public void doFilter(ActionRequest request, ActionResponse response) throws IOException, PortletException {
+      if (filterListIndex < filterList.size()) {
+         Filter filter = filterList.get(filterListIndex);
+         filterListIndex++;
+         try {
+            ActionFilter actionFilter = (ActionFilter) loader.loadClass(filter.getFilterClass()).newInstance();
+            FilterConfigImpl filterConfig = new FilterConfigImpl(filter.getFilterName(), filter.getInitParams(),
+                  portletContext);
+            actionFilter.init(filterConfig);
+            actionFilter.doFilter(request, response, this);
+            actionFilter.destroy();
+         } catch (InstantiationException e) {
+            e.printStackTrace();
+         } catch (IllegalAccessException e) {
+            e.printStackTrace();
+         } catch (ClassNotFoundException e) {
+            e.printStackTrace();
+         }
+      } else {
+         portlet.processAction(request, response);
+      }
+   }
+
+   public void doFilter(EventRequest request, EventResponse response) throws IOException, PortletException {
+      if (filterListIndex < filterList.size()) {
+         Filter filter = filterList.get(filterListIndex);
+         filterListIndex++;
+         try {
+            EventFilter eventFilter = (EventFilter) loader.loadClass(filter.getFilterClass()).newInstance();
+            FilterConfigImpl filterConfig = new FilterConfigImpl(filter.getFilterName(), filter.getInitParams(),
+                  portletContext);
+            eventFilter.init(filterConfig);
+            eventFilter.doFilter(request, response, this);
+            eventFilter.destroy();
+         } catch (InstantiationException e) {
+            e.printStackTrace();
+         } catch (IllegalAccessException e) {
+            e.printStackTrace();
+         } catch (ClassNotFoundException e) {
+            e.printStackTrace();
+         }
+      } else {
+         eventPortlet.processEvent(request, response);
+      }
+   }
+
+   public void doFilter(RenderRequest request, RenderResponse response) throws IOException, PortletException {
+      if (filterListIndex < filterList.size()) {
+         Filter filter = filterList.get(filterListIndex);
+         filterListIndex++;
+         try {
+            RenderFilter renderFilter = (RenderFilter) loader.loadClass(filter.getFilterClass()).newInstance();
+            FilterConfigImpl filterConfig = new FilterConfigImpl(filter.getFilterName(), filter.getInitParams(),
+                  portletContext);
+            renderFilter.init(filterConfig);
+            renderFilter.doFilter(request, response, this);
+            renderFilter.destroy();
+         } catch (InstantiationException e) {
+            e.printStackTrace();
+         } catch (IllegalAccessException e) {
+            e.printStackTrace();
+         } catch (ClassNotFoundException e) {
+            e.printStackTrace();
+         }
+      } else {
+         portlet.render(request, response);
+      }
+   }
+
+   public void doFilter(HeaderRequest request, HeaderResponse response) throws IOException, PortletException {
+      if (filterListIndex < filterList.size()) {
+         Filter filter = filterList.get(filterListIndex);
+         filterListIndex++;
+         try {
+            HeaderFilter headerFilter = (HeaderFilter) loader.loadClass(filter.getFilterClass()).newInstance();
+            FilterConfigImpl filterConfig = new FilterConfigImpl(filter.getFilterName(), filter.getInitParams(),
+                  portletContext);
+            headerFilter.init(filterConfig);
+            headerFilter.doFilter(request, response, this);
+            headerFilter.destroy();
+         } catch (InstantiationException e) {
+            e.printStackTrace();
+         } catch (IllegalAccessException e) {
+            e.printStackTrace();
+         } catch (ClassNotFoundException e) {
+            e.printStackTrace();
+         }
+      } else {
+         headerPortlet.renderHeaders(request, response);
+      }
+   }
+
+   public void doFilter(ResourceRequest request, ResourceResponse response) throws IOException, PortletException {
+      if (filterListIndex < filterList.size()) {
+         Filter filter = filterList.get(filterListIndex);
+         filterListIndex++;
+         try {
+            ResourceFilter resourceFilter = (ResourceFilter) loader.loadClass(filter.getFilterClass()).newInstance();
+            FilterConfigImpl filterConfig = new FilterConfigImpl(filter.getFilterName(), filter.getInitParams(),
+                  portletContext);
+            resourceFilter.init(filterConfig);
+            resourceFilter.doFilter(request, response, this);
+            resourceFilter.destroy();
+         } catch (InstantiationException e) {
+            e.printStackTrace();
+         } catch (IllegalAccessException e) {
+            e.printStackTrace();
+         } catch (ClassNotFoundException e) {
+            e.printStackTrace();
+         }
+      } else {
+         resourceServingPortlet.serveResource(request, response);
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/65c0050b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/FilterManagerImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/FilterManagerImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/FilterManagerImpl.java
index 49f0acb..0d28f45 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/FilterManagerImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/FilterManagerImpl.java
@@ -1,146 +1,156 @@
-/*
- * 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.
- */
-package org.apache.pluto.driver.services.container;
-
-import java.io.IOException;
-import java.util.List;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.EventPortlet;
-import javax.portlet.EventRequest;
-import javax.portlet.EventResponse;
-import javax.portlet.Portlet;
-import javax.portlet.PortletContext;
-import javax.portlet.PortletException;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.ResourceRequest;
-import javax.portlet.ResourceResponse;
-import javax.portlet.ResourceServingPortlet;
-
-import org.apache.pluto.container.FilterManager;
-import org.apache.pluto.container.PortletWindow;
-import org.apache.pluto.container.om.portlet.Filter;
-import org.apache.pluto.container.om.portlet.FilterMapping;
-import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
-import org.apache.pluto.container.om.portlet.PortletDefinition;
-
-
-/**
- * Manage the initialization and doFilter {@link FilterChainImpl} for the filter which are
- * declareted in the deployment descriptor.
- * @since 05/29/2007
- * @version 2.0
- */
-public class FilterManagerImpl implements FilterManager{
-    private FilterChainImpl filterchain;
-    private PortletApplicationDefinition portletApp;
-    private String portletName;
-    private String lifeCycle;
-
-    public FilterManagerImpl(PortletWindow portletWindow, String lifeCycle) {
-        final PortletDefinition pd = portletWindow.getPortletDefinition();
-        this.portletApp = pd.getApplication();
-        this.portletName =  pd.getPortletName();
-        this.lifeCycle = lifeCycle;
-        filterchain = new FilterChainImpl(lifeCycle);
-        initFilterChain();
-    }
-
-    private void initFilterChain(){
-        List<? extends FilterMapping> filterMappingList = portletApp.getFilterMappings();
-        if (filterMappingList!= null){
-            for (FilterMapping filterMapping : filterMappingList) {
-                if (isFilter(filterMapping, portletName)){
-                    //the filter is specified for the portlet, check the filter for the lifecycle
-                    List<? extends Filter> filterList = portletApp.getFilters();
-                    for (Filter filter : filterList) {
-                        //search for the filter in the filter
-                        if (filter.getFilterName().equals(filterMapping.getFilterName())){
-                            //check the lifecycle
-                            if (isLifeCycle(filter, lifeCycle)){
-                                //the filter match to the portlet and has the specified lifecycle -> add to chain
-                                filterchain.addFilter(filter);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * @see org.apache.pluto.container.FilterManager#processFilter(javax.portlet.EventRequest, javax.portlet.EventResponse, javax.portlet.EventPortlet, javax.portlet.PortletContext)
-     */
-    public void processFilter(EventRequest req, EventResponse res, EventPortlet eventPortlet,PortletContext portletContext)throws PortletException, IOException{
-        filterchain.processFilter(req, res, eventPortlet, portletContext);
-    }
-
-    /**
-     * @see org.apache.pluto.container.FilterManager#processFilter(javax.portlet.ResourceRequest, javax.portlet.ResourceResponse, javax.portlet.ResourceServingPortlet, javax.portlet.PortletContext)
-     */
-    public void processFilter(ResourceRequest req, ResourceResponse res, ResourceServingPortlet resourceServingPortlet,PortletContext portletContext)throws PortletException, IOException{
-        filterchain.processFilter(req, res, resourceServingPortlet, portletContext);
-    }
-
-    /**
-     * @see org.apache.pluto.container.FilterManager#processFilter(javax.portlet.RenderRequest, javax.portlet.RenderResponse, javax.portlet.Portlet, javax.portlet.PortletContext)
-     */
-    public void processFilter(RenderRequest req, RenderResponse res, Portlet portlet,PortletContext portletContext) throws PortletException, IOException{
-        filterchain.processFilter(req, res, portlet, portletContext);
-    }
-
-    /**
-     * @see org.apache.pluto.container.FilterManager#processFilter(javax.portlet.ActionRequest, javax.portlet.ActionResponse, javax.portlet.Portlet, javax.portlet.PortletContext)
-     */
-    public void processFilter(ActionRequest req, ActionResponse res, Portlet portlet,PortletContext portletContext) throws PortletException, IOException{
-        filterchain.processFilter(req, res, portlet, portletContext);
-    }
-
-    private boolean isLifeCycle(Filter filter, String lifeCycle){
-        List <String> lifeCyclesList = filter.getLifecycles();
-        for (String string : lifeCyclesList) {
-            if (string.equals(lifeCycle))
-                return true;
-        }
-        return false;
-    }
-
-    private boolean isFilter(FilterMapping filterMapping,String portletName){
-        List <String> portletNamesList = filterMapping.getPortletNames();
-        for (String portletNameFromFilterList : portletNamesList) {
-            if (portletNameFromFilterList.endsWith("*")){
-                if (portletNameFromFilterList.length()==1){
-                    //if name contains only *
-                    return true;
-                }
-                portletNameFromFilterList = portletNameFromFilterList.substring(0, portletNameFromFilterList.length()-1);
-                if (portletName.length()>= portletNameFromFilterList.length()){
-                    if (portletName.substring(0, portletNameFromFilterList.length()).equals(portletNameFromFilterList)){
-                        return true;
-                    }
-                }
-            }
-            else if (portletNameFromFilterList.equals(portletName))
-                return true;
-        }
-        return false;
-    }
-
-
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.driver.services.container;
+
+import java.io.IOException;
+import java.util.List;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.EventPortlet;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.HeaderPortlet;
+import javax.portlet.HeaderRequest;
+import javax.portlet.HeaderResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.portlet.ResourceServingPortlet;
+
+import org.apache.pluto.container.FilterManager;
+import org.apache.pluto.container.PortletWindow;
+import org.apache.pluto.container.om.portlet.Filter;
+import org.apache.pluto.container.om.portlet.FilterMapping;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.PortletDefinition;
+
+
+/**
+ * Manage the initialization and doFilter {@link FilterChainImpl} for the filter which are
+ * declared in the deployment descriptor.
+ * @since 05/29/2007
+ * @version 2.0
+ */
+public class FilterManagerImpl implements FilterManager{
+    private FilterChainImpl filterchain;
+    private PortletApplicationDefinition portletApp;
+    private String portletName;
+    private String lifeCycle;
+
+    public FilterManagerImpl(PortletWindow portletWindow, String lifeCycle) {
+        final PortletDefinition pd = portletWindow.getPortletDefinition();
+        this.portletApp = pd.getApplication();
+        this.portletName =  pd.getPortletName();
+        this.lifeCycle = lifeCycle;
+        filterchain = new FilterChainImpl(lifeCycle);
+        initFilterChain();
+    }
+
+    private void initFilterChain(){
+        List<? extends FilterMapping> filterMappingList = portletApp.getFilterMappings();
+        if (filterMappingList!= null){
+            for (FilterMapping filterMapping : filterMappingList) {
+                if (isFilter(filterMapping, portletName)){
+                    //the filter is specified for the portlet, check the filter for the lifecycle
+                    List<? extends Filter> filterList = portletApp.getFilters();
+                    for (Filter filter : filterList) {
+                        //search for the filter in the filter
+                        if (filter.getFilterName().equals(filterMapping.getFilterName())){
+                            //check the lifecycle
+                            if (isLifeCycle(filter, lifeCycle)){
+                                //the filter match to the portlet and has the specified lifecycle -> add to chain
+                                filterchain.addFilter(filter);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * @see org.apache.pluto.container.FilterManager#processFilter(javax.portlet.EventRequest, javax.portlet.EventResponse, javax.portlet.EventPortlet, javax.portlet.PortletContext)
+     */
+    public void processFilter(EventRequest req, EventResponse res, EventPortlet eventPortlet,PortletContext portletContext)throws PortletException, IOException{
+        filterchain.processFilter(req, res, eventPortlet, portletContext);
+    }
+
+    /**
+     * @see org.apache.pluto.container.FilterManager#processFilter(javax.portlet.ResourceRequest, javax.portlet.ResourceResponse, javax.portlet.ResourceServingPortlet, javax.portlet.PortletContext)
+     */
+    public void processFilter(ResourceRequest req, ResourceResponse res, ResourceServingPortlet resourceServingPortlet,PortletContext portletContext)throws PortletException, IOException{
+        filterchain.processFilter(req, res, resourceServingPortlet, portletContext);
+    }
+
+    /**
+     * @see org.apache.pluto.container.FilterManager#processFilter(javax.portlet.RenderRequest, javax.portlet.RenderResponse, javax.portlet.Portlet, javax.portlet.PortletContext)
+     */
+    public void processFilter(RenderRequest req, RenderResponse res, Portlet portlet,PortletContext portletContext) throws PortletException, IOException{
+        filterchain.processFilter(req, res, portlet, portletContext);
+    }
+
+    /**
+     * @see org.apache.pluto.container.FilterManager#processFilter(javax.portlet.RenderRequest, javax.portlet.HeaderResponse, javax.portlet.HeaderPortlet, javax.portlet.PortletContext)
+     */
+    public void processFilter(HeaderRequest req, HeaderResponse res, HeaderPortlet portlet,PortletContext portletContext) throws PortletException, IOException{
+        filterchain.processFilter(req, res, portlet, portletContext);
+    }
+
+    /**
+     * @see org.apache.pluto.container.FilterManager#processFilter(javax.portlet.ActionRequest, javax.portlet.ActionResponse, javax.portlet.Portlet, javax.portlet.PortletContext)
+     */
+    public void processFilter(ActionRequest req, ActionResponse res, Portlet portlet,PortletContext portletContext) throws PortletException, IOException{
+        filterchain.processFilter(req, res, portlet, portletContext);
+    }
+
+    private boolean isLifeCycle(Filter filter, String lifeCycle){
+        List <String> lifeCyclesList = filter.getLifecycles();
+        for (String string : lifeCyclesList) {
+            if (string.equals(lifeCycle))
+                return true;
+        }
+        return false;
+    }
+
+    private boolean isFilter(FilterMapping filterMapping,String portletName){
+        List <String> portletNamesList = filterMapping.getPortletNames();
+        for (String portletNameFromFilterList : portletNamesList) {
+            if (portletNameFromFilterList.endsWith("*")){
+                if (portletNameFromFilterList.length()==1){
+                    //if name contains only *
+                    return true;
+                }
+                portletNameFromFilterList = portletNameFromFilterList.substring(0, portletNameFromFilterList.length()-1);
+                if (portletName.length()>= portletNameFromFilterList.length()){
+                    if (portletName.substring(0, portletNameFromFilterList.length()).equals(portletNameFromFilterList)){
+                        return true;
+                    }
+                }
+            }
+            else if (portletNameFromFilterList.equals(portletName))
+                return true;
+        }
+        return false;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/65c0050b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletHeaderResponseContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletHeaderResponseContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletHeaderResponseContextImpl.java
new file mode 100644
index 0000000..5825be5
--- /dev/null
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletHeaderResponseContextImpl.java
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+package org.apache.pluto.driver.services.container;
+
+import java.util.Collection;
+
+import javax.portlet.PortletMode;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.pluto.container.PortletContainer;
+import org.apache.pluto.container.PortletHeaderResponseContext;
+import org.apache.pluto.container.PortletWindow;
+import org.apache.pluto.driver.AttributeKeys;
+
+/**
+ * @version $Id$
+ *
+ */
+public class PortletHeaderResponseContextImpl extends PortletMimeResponseContextImpl implements
+                PortletHeaderResponseContext
+{
+    public PortletHeaderResponseContextImpl(PortletContainer container, HttpServletRequest containerRequest,
+                                            HttpServletResponse containerResponse, PortletWindow window)
+    {
+        super(container, containerRequest, containerResponse, window);
+    }
+
+    public void setNextPossiblePortletModes(Collection<PortletMode> portletModes)
+    {
+        // not supported
+    }
+
+    public void setTitle(String title)
+    {
+        if (!isClosed())
+        {
+            getServletRequest().setAttribute(AttributeKeys.PORTLET_TITLE, title);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/65c0050b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextServiceImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextServiceImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextServiceImpl.java
index 2425d82..c744243 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextServiceImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextServiceImpl.java
@@ -22,6 +22,7 @@ import javax.servlet.http.HttpServletResponse;
 import org.apache.pluto.container.PortletActionResponseContext;
 import org.apache.pluto.container.PortletContainer;
 import org.apache.pluto.container.PortletEventResponseContext;
+import org.apache.pluto.container.PortletHeaderResponseContext;
 import org.apache.pluto.container.PortletRenderResponseContext;
 import org.apache.pluto.container.PortletRequestContext;
 import org.apache.pluto.container.PortletRequestContextService;
@@ -76,6 +77,20 @@ public class PortletRequestContextServiceImpl implements PortletRequestContextSe
         return new PortletRenderResponseContextImpl(container, containerRequest, containerResponse, window);
     }
 
+    public PortletRequestContext getPortletHeaderRequestContext(PortletContainer container, HttpServletRequest containerRequest,
+                                                                HttpServletResponse containerResponse, PortletWindow window)
+    {
+        return new PortletRequestContextImpl(container, containerRequest, containerResponse, window, false);
+    }
+
+    public PortletHeaderResponseContext getPortletHeaderResponseContext(PortletContainer container,
+                                                                        HttpServletRequest containerRequest,
+                                                                        HttpServletResponse containerResponse,
+                                                                        PortletWindow window)
+    {
+        return new PortletHeaderResponseContextImpl(container, containerRequest, containerResponse, window);
+    }
+
     public PortletResourceRequestContext getPortletResourceRequestContext(PortletContainer container,
                                                                           HttpServletRequest containerRequest,
                                                                           HttpServletResponse containerResponse,

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/65c0050b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java
index 8de18c3..868dc20 100644
--- a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java
@@ -27,18 +27,17 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.apache.pluto.container.PortletContainer;
 import org.apache.pluto.container.PortletContainerException;
 import org.apache.pluto.driver.core.PortalRequestContext;
 import org.apache.pluto.driver.core.PortletWindowImpl;
 import org.apache.pluto.driver.services.portal.PageConfig;
 import org.apache.pluto.driver.services.portal.PortletWindowConfig;
-import org.apache.pluto.driver.services.portal.RenderConfigService;
 import org.apache.pluto.driver.url.PortalURL;
 import org.apache.pluto.driver.url.PortalURL.URLType;
 import org.apache.pluto.driver.util.PageState;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * The controller servlet used to drive the Portal Driver. All requests mapped
@@ -216,10 +215,19 @@ public class PortalDriverServlet extends HttpServlet {
          request.setAttribute(AttributeKeys.CURRENT_PAGE, pageConfig);
          String uri = (pageConfig.getUri() != null) ? pageConfig.getUri() : DEFAULT_PAGE_URI;
          
+         // Execute header request for each portlet on the page
+         
+         if (LOG.isDebugEnabled()) {
+            LOG.debug("Executing header requests for target portlets.");
+         }
+
+         doHeaders(request, response, portalURL);
+         
          if (LOG.isDebugEnabled()) {
             LOG.debug("Dispatching to: " + uri);
          }
          
+         // Dispatch to the JSP that aggregates the page.
          RequestDispatcher dispatcher = request.getRequestDispatcher(uri);
          dispatcher.forward(request, response);
          
@@ -246,4 +254,18 @@ public class PortalDriverServlet extends HttpServlet {
          throws ServletException, IOException {
       doGet(request, response);
    }
+   
+   
+   private void doHeaders(HttpServletRequest req, HttpServletResponse resp, PortalURL purl) {
+      
+      for (String pid : purl.getPortletIds()) {
+         PortletWindowConfig wcfg = PortletWindowConfig.fromId(pid); 
+         PortletWindowImpl pwin = new PortletWindowImpl(container, wcfg, purl);
+         try {
+            container.doHeader(pwin, req, resp);
+         } catch (Exception e) {
+            
+         }
+      }
+   }
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/65c0050b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DefaultPortletInvokerService.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DefaultPortletInvokerService.java b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DefaultPortletInvokerService.java
index 32c097f..a46a4e5 100644
--- a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DefaultPortletInvokerService.java
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DefaultPortletInvokerService.java
@@ -22,6 +22,8 @@ import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
 import javax.portlet.EventRequest;
 import javax.portlet.EventResponse;
+import javax.portlet.HeaderRequest;
+import javax.portlet.HeaderResponse;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequest;
 import javax.portlet.PortletResponse;
@@ -97,10 +99,26 @@ public class DefaultPortletInvokerService implements PortletInvokerService {
     }
 
     /**
+     * Invoke the portlet with a header request.
+     *
+     * @param request  header request used for the invocation.
+     * @param response header response used for the invocation.
+     * @see PortletServlet3
+     * @see javax.portlet.Portlet#header(javax.portlet.headerRequest,javax.portlet.headerResponse)
+     */
+    public void header(PortletRequestContext context, HeaderRequest request, HeaderResponse response, FilterManager filterManager)
+    throws IOException, PortletException, PortletContainerException {
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Performing header Invocation");
+        }
+        invoke(context, request, response, filterManager, PortletInvokerService.METHOD_HEADER);
+    }
+
+    /**
      * Invoke the portlet with a render request.
      *
-     * @param request  action request used for the invocation.
-     * @param response action response used for the invocation.
+     * @param request  render request used for the invocation.
+     * @param response render response used for the invocation.
      * @see PortletServlet3
      * @see javax.portlet.Portlet#render(javax.portlet.RenderRequest,javax.portlet.RenderResponse)
      */
@@ -115,8 +133,8 @@ public class DefaultPortletInvokerService implements PortletInvokerService {
     /**
      * Invoke the portlet with a render request.
      *
-     * @param request  action request used for the invocation.
-     * @param response action response used for the invocation.
+     * @param request  event request used for the invocation.
+     * @param response event response used for the invocation.
      * @see PortletServlet3
      * @see javax.portlet.Portlet#render(javax.portlet.RenderRequest,javax.portlet.RenderResponse)
      */

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/65c0050b/portlet-api/src/main/java/javax/portlet/PortletRequest.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/PortletRequest.java b/portlet-api/src/main/java/javax/portlet/PortletRequest.java
index 1ec5121..9581cdf 100644
--- a/portlet-api/src/main/java/javax/portlet/PortletRequest.java
+++ b/portlet-api/src/main/java/javax/portlet/PortletRequest.java
@@ -206,6 +206,17 @@ public interface PortletRequest extends PortletState
   /**
    * String identifier for the portlet render lifecycle phase. In this
    * phase the portlet request and response are from type
+   * <code>HeaderRequest</code> and <code>HeaderResponse</code>.
+   * <p>
+   * The value of the constant is <code>HEADER_PHASE</code>.
+   * 
+   * @since 3.0
+   */
+  public static final String HEADER_PHASE = "HEADER_PHASE";
+  
+  /**
+   * String identifier for the portlet render lifecycle phase. In this
+   * phase the portlet request and response are from type
    * <code>RenderRequest</code> and <code>RenderResponse</code>.
    * <p>
    * The value of the constant is <code>RENDER_PHASE</code>.


[13/38] portals-pluto git commit: Replaced code that reads the deployment descriptor with an implementation that can be better extended to add v3.0 support. Added test cases. Uses jaxb binding classes that are generated at compile time.

Posted by ms...@apache.org.
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR362ConfigurationProcessor.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR362ConfigurationProcessor.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR362ConfigurationProcessor.java
new file mode 100644
index 0000000..d23afc2
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR362ConfigurationProcessor.java
@@ -0,0 +1,895 @@
+/*  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.
+ */
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import javax.portlet.Portlet;
+import javax.portlet.PortletURLGenerationListener;
+import javax.portlet.PreferencesValidator;
+import javax.portlet.filter.PortletFilter;
+import javax.xml.XMLConstants;
+import javax.xml.bind.JAXBElement;
+import javax.xml.namespace.QName;
+
+import org.apache.pluto.container.om.portlet.ContainerRuntimeOption;
+import org.apache.pluto.container.om.portlet.CustomPortletMode;
+import org.apache.pluto.container.om.portlet.CustomWindowState;
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.DisplayName;
+import org.apache.pluto.container.om.portlet.EventDefinition;
+import org.apache.pluto.container.om.portlet.EventDefinitionReference;
+import org.apache.pluto.container.om.portlet.Filter;
+import org.apache.pluto.container.om.portlet.FilterMapping;
+import org.apache.pluto.container.om.portlet.InitParam;
+import org.apache.pluto.container.om.portlet.Listener;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.PortletDefinition;
+import org.apache.pluto.container.om.portlet.PortletInfo;
+import org.apache.pluto.container.om.portlet.Preference;
+import org.apache.pluto.container.om.portlet.Preferences;
+import org.apache.pluto.container.om.portlet.PublicRenderParameter;
+import org.apache.pluto.container.om.portlet.SecurityConstraint;
+import org.apache.pluto.container.om.portlet.SecurityRoleRef;
+import org.apache.pluto.container.om.portlet.Supports;
+import org.apache.pluto.container.om.portlet.UserDataConstraint;
+import org.apache.pluto.container.om.portlet30.impl.ContainerRuntimeOptionType;
+import org.apache.pluto.container.om.portlet30.impl.CustomPortletModeType;
+import org.apache.pluto.container.om.portlet30.impl.CustomWindowStateType;
+import org.apache.pluto.container.om.portlet30.impl.DescriptionType;
+import org.apache.pluto.container.om.portlet30.impl.DisplayNameType;
+import org.apache.pluto.container.om.portlet30.impl.EventDefinitionReferenceType;
+import org.apache.pluto.container.om.portlet30.impl.EventDefinitionType;
+import org.apache.pluto.container.om.portlet30.impl.FilterMappingType;
+import org.apache.pluto.container.om.portlet30.impl.FilterType;
+import org.apache.pluto.container.om.portlet30.impl.InitParamType;
+import org.apache.pluto.container.om.portlet30.impl.ListenerType;
+import org.apache.pluto.container.om.portlet30.impl.MimeTypeType;
+import org.apache.pluto.container.om.portlet30.impl.PortletAppType;
+import org.apache.pluto.container.om.portlet30.impl.PortletCollectionType;
+import org.apache.pluto.container.om.portlet30.impl.PortletInfoType;
+import org.apache.pluto.container.om.portlet30.impl.PortletModeType;
+import org.apache.pluto.container.om.portlet30.impl.PortletNameType;
+import org.apache.pluto.container.om.portlet30.impl.PortletPreferencesType;
+import org.apache.pluto.container.om.portlet30.impl.PortletType;
+import org.apache.pluto.container.om.portlet30.impl.PreferenceType;
+import org.apache.pluto.container.om.portlet30.impl.PublicRenderParameterType;
+import org.apache.pluto.container.om.portlet30.impl.SecurityConstraintType;
+import org.apache.pluto.container.om.portlet30.impl.SecurityRoleRefType;
+import org.apache.pluto.container.om.portlet30.impl.SupportedLocaleType;
+import org.apache.pluto.container.om.portlet30.impl.SupportsType;
+import org.apache.pluto.container.om.portlet30.impl.UserAttributeType;
+import org.apache.pluto.container.om.portlet30.impl.UserDataConstraintType;
+import org.apache.pluto.container.om.portlet30.impl.ValueType;
+import org.apache.pluto.container.om.portlet30.impl.WindowStateType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Processes configuration for JSR 168 portlet app.
+ * 
+ * @author Scott Nicklous
+ * 
+ */
+public class JSR362ConfigurationProcessor extends ConfigurationProcessor {
+
+   /** Logger. */
+   private static final Logger          LOG     = LoggerFactory
+                                                      .getLogger(JSR362ConfigurationProcessor.class);
+   // private static final boolean isDebug = LOG.isDebugEnabled();
+   private static final boolean         isTrace = LOG.isTraceEnabled();
+
+   private PortletApplicationDefinition pad;
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see
+    * org.apache.pluto.container.om.portlet.impl.jsr168.ConfigurationProcessor
+    * #process(javax.xml.bind.JAXBElement)
+    */
+   @Override
+   public PortletApplicationDefinition process(JAXBElement<?> rootElement)
+         throws IllegalArgumentException {
+      pad = new PortletApplicationDefinitionImpl();
+
+      // make sure we were called properly
+      assert (rootElement != null);
+      assert (rootElement.getValue() instanceof PortletAppType);
+
+      PortletAppType app = (PortletAppType) rootElement.getValue();
+
+      // handle string values
+
+      pad.setId(app.getId());
+
+      if ((app.getVersion() == null) || !app.getVersion().equals("3.0")) {
+         String warning = "Bad version. Expected 3.0, was: " + app.getVersion();
+         LOG.warn(warning);
+         throw new IllegalArgumentException(warning);
+      }
+      pad.setVersion(app.getVersion());
+
+      if (isTrace) {
+         StringBuilder txt = new StringBuilder();
+         txt.append("Reading portlet DD. ");
+         txt.append("Version: ");
+         txt.append(app.getVersion());
+         txt.append(", ID: ");
+         txt.append(app.getId());
+         LOG.trace(txt.toString());
+      }
+
+      if (app.getDefaultNamespace() != null
+            && !app.getDefaultNamespace().equals("")) {
+         pad.setDefaultNamespace(app.getDefaultNamespace());
+      } else {
+         pad.setDefaultNamespace(XMLConstants.NULL_NS_URI);
+      }
+
+      if (app.getResourceBundle() != null
+            && app.getResourceBundle().getValue() != null
+            && !app.getResourceBundle().getValue().equals("")) {
+         pad.setResourceBundle(app.getResourceBundle().getValue());
+      }
+
+      for (EventDefinition ed : handleEventDefs(app.getEventDefinition())) {
+         pad.addEventDefinition(ed);
+      }
+
+      for (PublicRenderParameter prp : handlePRPs(app
+            .getPublicRenderParameter())) {
+         pad.addPublicRenderParameter(prp);
+      }
+      
+      for (ContainerRuntimeOption cro : handleRTOptions(app.getContainerRuntimeOption())) {
+         pad.addContainerRuntimeOption(cro);
+      }
+
+      handleCPM(app.getCustomPortletMode());
+      handleCWS(app.getCustomWindowState());
+      handleSC(app.getSecurityConstraint());
+      handleUA(app.getUserAttribute());
+      handleListeners(app.getListener());
+      handleFilters(app.getFilter());
+      handlePortlets(app.getPortlet());
+      handleFilterMappings(app.getFilterMapping());
+
+      return pad;
+   }
+
+   /**
+    * DisplayNames
+    */
+   private List<DisplayName> handleDisplayNames(List<DisplayNameType> dispNames) {
+      ArrayList<DisplayName> list = new ArrayList<DisplayName>();
+      for (DisplayNameType dispName : dispNames) {
+
+         if (dispName.getValue() == null) {
+            String warning = "Bad display name - no display name value; will be ignored. continuing ...";
+            LOG.warn(warning);
+            continue;
+         }
+
+         Locale loc = deriveLocale(dispName.getLang());
+
+         DisplayNameImpl d = new DisplayNameImpl(loc, dispName.getValue());
+         list.add(d);
+      }
+      return list;
+   }
+
+   /**
+    * Descriptions
+    */
+   private List<Description> handleDescriptions(List<DescriptionType> descs) {
+      ArrayList<Description> list = new ArrayList<Description>();
+      for (DescriptionType desc : descs) {
+
+         if (desc.getValue() == null) {
+            String warning = "Bad description - no description value; will be ignored. continuing ...";
+            LOG.warn(warning);
+            continue;
+         }
+
+         Locale loc = deriveLocale(desc.getLang());
+
+         DescriptionImpl d = new DescriptionImpl(loc, desc.getValue());
+         list.add(d);
+      }
+      return list;
+   }
+
+   /**
+    * User attributes
+    */
+   private void handleUA(List<UserAttributeType> uats) {
+      for (UserAttributeType uat : uats) {
+
+         // validate data
+         if ((uat.getName() == null) || (uat.getName().getValue() == null)) {
+            String warning = "Bad user attribute will be ignored. Name was null. Continuing ...";
+            LOG.warn(warning);
+            continue;
+         }
+
+         // set up the user attribute
+         UserAttributeImpl attr = new UserAttributeImpl(uat.getName()
+               .getValue());
+         for (Description desc : handleDescriptions(uat.getDescription())) {
+            attr.addDescription(desc);
+         }
+
+         // add it to the model
+         pad.addUserAttribute(attr);
+
+      }
+   }
+
+   /**
+    * Filters
+    */
+   private void handleFilters(List<FilterType> args) {
+      for (FilterType item : args) {
+
+         // validate data
+         if ((item.getFilterName() == null)
+               || (item.getFilterClass() == null)) {
+            String warning = "Bad Filter definition. name or class was null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+         String clsName = item.getFilterClass();
+         if (clsName != null && !clsName.equals("")) {
+            checkValidClass(clsName, PortletFilter.class,
+                  "Bad filter definition. Filter class is invalid: ");
+         }
+
+         // set up the custom portlet mode
+         Filter newitem = new FilterImpl(item.getFilterName());
+         newitem.setFilterClass(item.getFilterClass());
+         for (InitParam ip : handleInitParam(item.getInitParam())) {
+            newitem.addInitParam(ip);
+         }
+         for (String lc : item.getLifecycle()) {
+            newitem.addLifecycle(lc);
+         }
+         for (Description desc : handleDescriptions(item.getDescription())) {
+            newitem.addDescription(desc);
+         }
+         for (DisplayName dispName : handleDisplayNames(item.getDisplayName())) {
+            newitem.addDisplayName(dispName);
+         }
+
+         // add it to the model
+         pad.addFilter(newitem);
+
+      }
+   }
+
+   /**
+    * FilterMappings
+    */
+   private void handleFilterMappings(List<FilterMappingType> args) {
+      for (FilterMappingType item : args) {
+
+         // validate data
+         String fname = item.getFilterName();
+         if ((fname == null) || (item.getPortletName().size() == 0)) {
+            String warning = "Bad FilterMapping definition. Filter name or portlet name is null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+         if (pad.getFilter(fname) == null) {
+            String warning = "Bad FilterMapping definition. Filter definition not found: " + fname;
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+         
+         // set up the filter mapping
+         FilterMapping newitem = new FilterMappingImpl(fname);
+         for (PortletNameType pnt : item.getPortletName()) {
+            String pname = pnt.getValue();
+            if (pad.getPortlet(pname) == null) {
+               String warning = "Bad FilterMapping definition. Portlet definition not found: " + pname;
+               LOG.warn(warning);
+               throw new IllegalArgumentException(warning);
+            }
+            newitem.addPortletName(pname);
+         }
+
+         // add it to the model
+         pad.addFilterMapping(newitem);
+
+      }
+   }
+
+   /**
+    * Listeners
+    */
+   private void handleListeners(List<ListenerType> args) {
+      for (ListenerType item : args) {
+
+         // validate data
+         if (item.getListenerClass() == null) {
+            String warning = "Bad Listener definition. Class was null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+         String clsName = item.getListenerClass();
+         if (clsName != null && !clsName.equals("")) {
+            checkValidClass(clsName, PortletURLGenerationListener.class,
+                  "Bad listener definition. Listener class is invalid: ");
+         }
+
+         // set up the custom portlet mode
+         Listener newitem = new ListenerImpl(item.getListenerClass());
+         for (Description desc : handleDescriptions(item.getDescription())) {
+            newitem.addDescription(desc);
+         }
+         for (DisplayName dispName : handleDisplayNames(item.getDisplayName())) {
+            newitem.addDisplayName(dispName);
+         }
+         
+         // add it to the model
+         pad.addListener(newitem);
+
+      }
+   }
+
+   /**
+    * Custom portlet modes
+    */
+   private void handleCPM(List<CustomPortletModeType> cpms) {
+      for (CustomPortletModeType cpm : cpms) {
+
+         // validate data
+         if ((cpm.getPortletMode() == null)
+               || (cpm.getPortletMode().getValue() == null)) {
+            String warning = "Bad custom portlet mode. Mode was null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         } else {
+            String val = cpm.getPortletMode().getValue();
+            if (val.equalsIgnoreCase("view") || val.equalsIgnoreCase("edit")
+                  || val.equalsIgnoreCase("help")) {
+               String warning = "Bad custom portlet mode. Mode was: " + val;
+               LOG.warn(warning);
+               throw new IllegalArgumentException(warning);
+            }
+         }
+
+         // set up the custom portlet mode
+         CustomPortletMode pm = new CustomPortletModeImpl(cpm.getPortletMode()
+               .getValue());
+         for (Description desc : handleDescriptions(cpm.getDescription())) {
+            pm.addDescription(desc);
+         }
+         boolean isPortalManaged = true; // default is true
+         if (cpm.getPortalManaged() != null
+               && cpm.getPortalManaged().value() != null) {
+            isPortalManaged = cpm.getPortalManaged().value()
+                  .equalsIgnoreCase("true");
+         }
+         pm.setPortalManaged(isPortalManaged);
+
+         // add it to the model
+         pad.addCustomPortletMode(pm);
+
+      }
+   }
+
+   /**
+    * Custom window states
+    */
+   private void handleCWS(List<CustomWindowStateType> cwss) {
+      for (CustomWindowStateType cws : cwss) {
+
+         // validate data
+         if ((cws.getWindowState() == null)
+               || (cws.getWindowState().getValue() == null)) {
+            String warning = "Bad custom portlet mode. Mode was null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         } else {
+            String val = cws.getWindowState().getValue();
+            if (val.equalsIgnoreCase("view") || val.equalsIgnoreCase("edit")
+                  || val.equalsIgnoreCase("help")) {
+               String warning = "Bad custom portlet mode. Mode was: " + val;
+               LOG.warn(warning);
+               throw new IllegalArgumentException(warning);
+            }
+         }
+
+         // set up the custom portlet mode
+         CustomWindowState ws = new CustomWindowStateImpl(cws.getWindowState()
+               .getValue());
+         for (Description desc : handleDescriptions(cws.getDescription())) {
+            ws.addDescription(desc);
+         }
+
+         // add it to the model
+         pad.addCustomWindowState(ws);
+
+      }
+
+   }
+
+   /**
+    * Security constraints
+    */
+   private void handleSC(List<SecurityConstraintType> scs) {
+      for (SecurityConstraintType sc : scs) {
+
+         // validate data
+         PortletCollectionType pct = sc.getPortletCollection();
+         if ((pct == null) || (pct.getPortletName() == null)
+               || (pct.getPortletName().size() == 0)) {
+            String warning = "Portlet collection is empty.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         } else {
+            for (PortletNameType pnt : pct.getPortletName()) {
+               if (!isValidIdentifier(pnt.getValue())) {
+                  String warning = "Bad portlet name: " + pnt.getValue();
+                  LOG.warn(warning);
+                  throw new IllegalArgumentException(warning);
+               }
+            }
+         }
+
+         UserDataConstraintType udc = sc.getUserDataConstraint();
+         if ((udc == null) || (udc.getTransportGuarantee() == null)
+               || (udc.getTransportGuarantee().value() == null)) {
+            String warning = "User data constraint contains null value.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+
+         // set up the user data constraint
+         UserDataConstraint newudc = new UserDataConstraintImpl(udc
+               .getTransportGuarantee().value());
+         for (Description desc : handleDescriptions(udc.getDescription())) {
+            newudc.addDescription(desc);
+         }
+
+         // set up the security constraint
+         SecurityConstraint newsc = new SecurityConstraintImpl(newudc);
+         for (DisplayName dispName : handleDisplayNames(sc.getDisplayName())) {
+            newsc.addDisplayName(dispName);
+         }
+         for (PortletNameType portletName : pct.getPortletName()) {
+            newsc.addPortletName(portletName.getValue());
+         }
+
+         // add it to the model
+         pad.addSecurityConstraint(newsc);
+
+      }
+   }
+
+   private List<Supports> handleSupports(List<SupportsType> sts) {
+      ArrayList<Supports> newSupps = new ArrayList<Supports>();
+      for (SupportsType st : sts) {
+
+         // validate Mime type & portlet mode
+         MimeTypeType mtt = st.getMimeType();
+         if (mtt == null || mtt.getValue() == null) {
+            String warning = "Null Mime type, ignoring Supports block.";
+            LOG.warn(warning);
+            continue;
+         }
+         List<PortletModeType> pmlist = st.getPortletMode();
+         if (pmlist.size() == 0) {
+            String info = "No portlet modes found in Supports block.";
+            LOG.info(info);
+         }
+         List<WindowStateType> wslist = st.getWindowState();
+         if (wslist.size() == 0) {
+            String info = "No window states found in Supports block.";
+            LOG.info(info);
+         }
+
+         // set up Supports
+         Supports sup = new SupportsImpl(mtt.getValue());
+         for (PortletModeType item : pmlist) {
+            sup.addPortletMode(item.getValue());
+         }
+         for (WindowStateType item : wslist) {
+            sup.addWindowState(item.getValue());
+         }
+
+         // add to model
+         newSupps.add(sup);
+
+      }
+      return newSupps;
+   }
+
+   /**
+    * Init parameters
+    */
+   private List<InitParam> handleInitParam(List<InitParamType> parms) {
+      ArrayList<InitParam> newParms = new ArrayList<InitParam>();
+      for (InitParamType parm : parms) {
+
+         // validate data
+         if ((parm.getName() == null) || (parm.getName().getValue() == null)) {
+            String warning = "Bad init parameter. Parameter name was null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+
+         // set up the init parameter
+         String name = parm.getName().getValue();
+         String value = parm.getValue().getValue();
+         InitParam newp = new InitParamImpl(name, value);
+         for (Description desc : handleDescriptions(parm.getDescription())) {
+            newp.addDescription(desc);
+         }
+
+         newParms.add(newp);
+      }
+      return newParms;
+   }
+
+   /**
+    * Portlet preferences
+    */
+   private List<Preference> handlePreferences(List<PreferenceType> args) {
+      ArrayList<Preference> list = new ArrayList<Preference>();
+      for (PreferenceType item : args) {
+
+         // validate data
+         if ((item.getName() == null) || (item.getName().getValue() == null)) {
+            String warning = "Bad portlet preference. Ppreference name was null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+
+         // set up the preference
+         String name = item.getName().getValue();
+         List<ValueType> vals = item.getValue();
+         ArrayList<String> lines = new ArrayList<String>(16);
+         for (ValueType vt : vals) {
+            lines.add(vt.getValue());
+         }
+         boolean isRO = (item.getReadOnly().value().equalsIgnoreCase("true"));
+
+         Preference pref = new PreferenceImpl(name, isRO, lines);
+         list.add(pref);
+      }
+      return list;
+   }
+
+   private List<ContainerRuntimeOption> handleRTOptions(
+         List<ContainerRuntimeOptionType> args) {
+      ArrayList<ContainerRuntimeOption> list = new ArrayList<ContainerRuntimeOption>();
+      for (ContainerRuntimeOptionType arg : args) {
+
+         // validate data
+         if ((arg.getName() == null) || (arg.getName().getValue() == null)
+               || arg.getName().getValue().equals("")) {
+            String warning = "Bad container runtime option. Name was null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+
+         // set up the runtime option
+         String name = arg.getName().getValue();
+         List<ValueType> vals = arg.getValue();
+         ArrayList<String> lines = new ArrayList<String>(16);
+         for (ValueType vt : vals) {
+            lines.add(vt.getValue());
+         }
+
+         ContainerRuntimeOption item = new ContainerRuntimeOptionImpl(name,
+               lines);
+         list.add(item);
+
+      }
+      return list;
+   }
+
+   /**
+    * Security role references
+    */
+   private List<SecurityRoleRef> handleSecRoleRef(List<SecurityRoleRefType> args) {
+      ArrayList<SecurityRoleRef> list = new ArrayList<SecurityRoleRef>();
+      for (SecurityRoleRefType item : args) {
+
+         // validate data
+         if ((item.getRoleName() == null) || (item.getRoleLink() == null)
+               || (item.getRoleLink().getValue() == null)) {
+            String warning = "Bad security role reference. Name or link was null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+
+         // set up the role ref
+         String name = item.getRoleName();
+         String link = item.getRoleLink().getValue();
+         SecurityRoleRef srr = new SecurityRoleRefImpl(name);
+         srr.setRoleLink(link);
+         for (Description desc : handleDescriptions(item.getDescription())) {
+            srr.addDescription(desc);
+         }
+
+         list.add(srr);
+      }
+      return list;
+   }
+
+   /**
+    * Event definition references - supported publishing events & supported
+    * processing events
+    */
+   private List<EventDefinitionReference> handleEventDefRefs(
+         List<EventDefinitionReferenceType> args) {
+      ArrayList<EventDefinitionReference> list = new ArrayList<EventDefinitionReference>();
+      for (EventDefinitionReferenceType item : args) {
+
+         // validate data
+         if ((item.getName() == null) && (item.getQname() == null)) {
+            String warning = "Bad Even definition reference. Name and QName are null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+
+         // prepare the qname
+         String name = item.getName();
+         QName qname = item.getQname();
+         if (qname == null) {
+            qname = new QName(pad.getDefaultNamespace(), name);
+         }
+
+         if (pad.getEventDefinition(qname) == null) {
+            String warning = "Bad Event definition reference. No event definition found for qname: "
+                  + qname;
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+
+         // set up the event def ref
+         EventDefinitionReference newedr = new EventDefinitionReferenceImpl(
+               qname);
+
+         list.add(newedr);
+      }
+      return list;
+   }
+
+   /**
+    * Event definitions
+    */
+   private List<EventDefinition> handleEventDefs(List<EventDefinitionType> args) {
+      ArrayList<EventDefinition> list = new ArrayList<EventDefinition>();
+      for (EventDefinitionType item : args) {
+
+         // validate data
+         if ((item.getName() == null) && (item.getQname() == null)) {
+            String warning = "Bad Event definition. Name and QName are null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+         String clsName = item.getValueType();
+         if (clsName != null && !clsName.equals("")) {
+            checkValidClass(clsName, null,
+                  "Bad Event definition. Payload type is invalid: ");
+         }
+
+         // prepare the qname
+         String name = item.getName();
+         QName qname = item.getQname();
+         if (qname == null) {
+            qname = new QName(pad.getDefaultNamespace(), name);
+         }
+
+         // set up the event definition
+         EventDefinition newed = new EventDefinitionImpl(qname);
+         if (clsName != null && clsName.length() > 0) {
+            newed.setValueType(clsName);
+         }
+         for (Description desc : handleDescriptions(item.getDescription())) {
+            newed.addDescription(desc);
+         }
+         for (QName qn : item.getAlias()) {
+            newed.addAlias(qn);
+         }
+
+         list.add(newed);
+      }
+      return list;
+   }
+
+   private List<PublicRenderParameter> handlePRPs(
+         List<PublicRenderParameterType> args) {
+      ArrayList<PublicRenderParameter> list = new ArrayList<PublicRenderParameter>();
+      for (PublicRenderParameterType item : args) {
+
+         // validate data
+         if ((item.getName() == null) && (item.getQname() == null)) {
+            String warning = "Bad public render parameter definition. Name and QName are null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+         String id = item.getIdentifier();
+         if ((id == null) || (id.length() == 0)) {
+            String warning = "Bad public render parameter definition. Identifier is null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+
+         // prepare the qname
+         String name = item.getName();
+         QName qname = item.getQname();
+         if (qname == null) {
+            qname = new QName(pad.getDefaultNamespace(), name);
+         }
+
+         // set up the prp definition
+         PublicRenderParameter newprp = new PublicRenderParameterImpl(qname, id);
+         for (Description desc : handleDescriptions(item.getDescription())) {
+            newprp.addDescription(desc);
+         }
+         for (QName qn : item.getAlias()) {
+            newprp.addAlias(qn);
+         }
+
+         list.add(newprp);
+      }
+      return list;
+
+   }
+
+   /**
+    * Handle Portlets
+    */
+   private void handlePortlets(List<PortletType> portlets) {
+      for (PortletType portlet : portlets) {
+
+         // validate portlet name & class
+         String warning;
+         String pn = portlet.getPortletName().getValue();
+         if (!isValidIdentifier(pn)) {
+            warning = "Bad portlet name: " + pn;
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+
+         String clsName = portlet.getPortletClass();
+         checkValidClass(clsName, Portlet.class, "Bad portlet class: ");
+
+         // set up portlet definition
+
+         PortletDefinition pd = new PortletDefinitionImpl(pn, pad);
+         pd.setPortletClass(portlet.getPortletClass());
+
+         if (portlet.getResourceBundle() != null) {
+            pd.setResourceBundle(portlet.getResourceBundle().getValue());
+         }
+
+         if (portlet.getExpirationCache() != null) {
+            pd.setExpirationCache(portlet.getExpirationCache().getValue());
+         }
+
+         if (portlet.getCacheScope() != null) {
+            pd.setCacheScope(portlet.getCacheScope().getValue());
+         }
+
+         for (DisplayName dispName : handleDisplayNames(portlet
+               .getDisplayName())) {
+            pd.addDisplayName(dispName);
+         }
+
+         for (Description desc : handleDescriptions(portlet.getDescription())) {
+            pd.addDescription(desc);
+         }
+
+         for (Supports s : handleSupports(portlet.getSupports())) {
+            pd.addSupports(s);
+         }
+
+         PortletInfoType pit = portlet.getPortletInfo();
+         if (pit != null) {
+            if (pit.getTitle().getValue() == null) {
+               warning = "Portlet info section does not contain title. Ingoring ...";
+               LOG.warn(warning);
+            } else {
+               String title, st = null, kw = null;
+               title = pit.getTitle().getValue();
+               if (pit.getShortTitle() != null) {
+                  st = pit.getShortTitle().getValue();
+               }
+               if (pit.getKeywords() != null) {
+                  kw = pit.getKeywords().getValue();
+               }
+               PortletInfo info = new PortletInfoImpl(title, kw, st);
+               pd.setPortletInfo(info);
+            }
+         }
+
+         for (SupportedLocaleType slt : portlet.getSupportedLocale()) {
+            pd.addSupportedLocale(slt.getValue());
+         }
+
+         for (InitParam ip : handleInitParam(portlet.getInitParam())) {
+            pd.addInitParam(ip);
+         }
+
+         PortletPreferencesType prefs = portlet.getPortletPreferences();
+         if (prefs != null) {
+            Preferences newprefs = new PreferencesImpl();
+
+            clsName = prefs.getPreferencesValidator();
+            checkValidClass(clsName, PreferencesValidator.class,
+                  "Bad portlet preferences validator class: ");
+
+            newprefs.setPreferencesValidator(clsName);
+            for (Preference p : handlePreferences(prefs.getPreference())) {
+               newprefs.addPreference(p);
+            }
+            pd.setPortletPreferences(newprefs);
+         }
+
+         for (SecurityRoleRef srr : handleSecRoleRef(portlet
+               .getSecurityRoleRef())) {
+            pd.addSecurityRoleRef(srr);
+         }
+
+         for (ContainerRuntimeOption cro : handleRTOptions(portlet
+               .getContainerRuntimeOption())) {
+            pd.addContainerRuntimeOption(cro);
+         }
+
+         for (String prp : portlet.getSupportedPublicRenderParameter()) {
+            boolean ok = false;
+            for (PublicRenderParameter prpdef : pad.getPublicRenderParameters()) {
+               if (prpdef.getIdentifier().equals(prp)) {
+                  ok = true;
+               }
+            }
+            if (!ok) {
+               warning = "Public render parameter definition not found for: " + prp;
+               LOG.warn(warning);
+               throw new IllegalArgumentException(warning);
+            }
+            pd.addSupportedPublicRenderParameter(prp);
+         }
+
+         // Supported processing events
+         for (EventDefinitionReference edr : handleEventDefRefs(portlet
+               .getSupportedProcessingEvent())) {
+            pd.addSupportedProcessingEvent(edr);
+         }
+
+         // Supported publishing events
+         for (EventDefinitionReference edr : handleEventDefRefs(portlet
+               .getSupportedPublishingEvent())) {
+            pd.addSupportedPublishingEvent(edr);
+         }
+
+         pad.addPortlet(pd);
+
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ListenerImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ListenerImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ListenerImpl.java
new file mode 100644
index 0000000..499979f
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ListenerImpl.java
@@ -0,0 +1,141 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.DisplayName;
+import org.apache.pluto.container.om.portlet.Listener;
+
+/**
+ * A single event declaration
+ * 
+ * @author Scott Nicklous
+ */
+public class ListenerImpl implements Listener {
+   
+   private final List<Description> descs = new ArrayList<Description>();
+   private final List<DisplayName> dispNames = new ArrayList<DisplayName>();
+   private String listenerClass = "";
+
+   
+   /**
+    * Copy constructor
+    * 
+    * @param lis
+    */
+   public ListenerImpl(Listener lis) {
+      for (Description desc : lis.getDescriptions()) {
+         descs.add(new DescriptionImpl(desc));
+      }
+      for (DisplayName disp : lis.getDisplayNames()) {
+         dispNames.add(new DisplayNameImpl(disp));
+      }
+      listenerClass = lis.getListenerClass();
+   }
+   
+   /**
+    * Constructor
+    * @param fn   Listener name
+    */
+   public ListenerImpl(String cls) {
+      this.listenerClass = cls;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Listener#getDescription(java.util.Locale)
+    */
+   @Override
+   public Description getDescription(Locale locale) {
+      Description ret = null;
+      for (Description item : descs) {
+         if (item.getLocale().equals(locale)) {
+            ret = new DescriptionImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Listener#getDescriptions()
+    */
+   @Override
+   public List<Description> getDescriptions() {
+      return new ArrayList<Description>(descs);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Listener#addDescription(org.apache.pluto.container.om.portlet.Description)
+    */
+   @Override
+   public void addDescription(Description desc) {
+      descs.add(desc);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Listener#getDisplayName(java.util.Locale)
+    */
+   @Override
+   public DisplayName getDisplayName(Locale locale) {
+      DisplayName ret = null;
+      for (DisplayName item : dispNames) {
+         if (item.getLocale().equals(locale)) {
+            ret = new DisplayNameImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Listener#getDisplayNames()
+    */
+   @Override
+   public List<DisplayName> getDisplayNames() {
+      return new ArrayList<DisplayName>(dispNames);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Listener#addDisplayName(org.apache.pluto.container.om.portlet.DisplayName)
+    */
+   @Override
+   public void addDisplayName(DisplayName desc) {
+      dispNames.add(desc);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Listener#getListenerClass()
+    */
+   @Override
+   public String getListenerClass() {
+      return listenerClass;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Listener#setListenerClass(java.lang.String)
+    */
+   @Override
+   public void setListenerClass(String filterClass) {
+      listenerClass = filterClass;
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PortletApplicationDefinitionImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PortletApplicationDefinitionImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PortletApplicationDefinitionImpl.java
new file mode 100644
index 0000000..0adaf53
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PortletApplicationDefinitionImpl.java
@@ -0,0 +1,489 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.pluto.container.om.portlet.ContainerRuntimeOption;
+import org.apache.pluto.container.om.portlet.CustomPortletMode;
+import org.apache.pluto.container.om.portlet.CustomWindowState;
+import org.apache.pluto.container.om.portlet.EventDefinition;
+import org.apache.pluto.container.om.portlet.Filter;
+import org.apache.pluto.container.om.portlet.FilterMapping;
+import org.apache.pluto.container.om.portlet.Listener;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.PortletDefinition;
+import org.apache.pluto.container.om.portlet.PublicRenderParameter;
+import org.apache.pluto.container.om.portlet.SecurityConstraint;
+import org.apache.pluto.container.om.portlet.UserAttribute;
+
+/**
+ * Portlet application definition
+ * 
+ * @author Scott Nicklous
+ */
+public class PortletApplicationDefinitionImpl implements
+      PortletApplicationDefinition {
+
+   private String id;
+   private String name;
+   private String contextPath;
+   private String version;
+   private String resourceBundle;
+   private String defaultNamespace;
+   
+   private final List<PublicRenderParameter> prps = new ArrayList<PublicRenderParameter>();
+   private final List<PortletDefinition> portlets = new ArrayList<PortletDefinition>();
+   private final List<EventDefinition> events =     new ArrayList<EventDefinition>();
+   private final List<CustomPortletMode> cpms =     new ArrayList<CustomPortletMode>();
+   private final List<CustomWindowState> cwss =     new ArrayList<CustomWindowState>();
+   private final List<UserAttribute> uattrs =       new ArrayList<UserAttribute>();
+   private final List<Filter> filters =             new ArrayList<Filter>();
+   private final List<FilterMapping> fmaps =        new ArrayList<FilterMapping>();
+   private final List<ContainerRuntimeOption> cros = new ArrayList<ContainerRuntimeOption>();
+   
+   // for the locale - encoding mappings from the web.xml
+   private final Map<Locale, String> localemap = new HashMap<Locale, String>();
+   
+   private final ArrayList<Listener> listeners = new ArrayList<Listener>();
+   private final ArrayList<SecurityConstraint> constraints = new ArrayList<SecurityConstraint>();
+
+   /**
+    * Default constructor
+    */
+   public PortletApplicationDefinitionImpl() {
+   }
+
+   /**
+    * Copy constructor. This class is written such that the accessors copy the 
+    * objects being returned, so the return values can be directly used in the
+    * copy constructor.
+    * 
+    * @param pad     The portlet application definition
+    */
+   public PortletApplicationDefinitionImpl(PortletApplicationDefinition pad) {
+      this.contextPath = pad.getContextPath();
+      this.id = pad.getId();
+      this.name = pad.getName();
+      this.version = pad.getVersion();
+      this.resourceBundle = pad.getResourceBundle();
+      this.defaultNamespace = pad.getDefaultNamespace();
+
+      for (PortletDefinition pd : pad.getPortlets()) {
+         portlets.add(pd);
+      }
+      for (EventDefinition item : pad.getEventDefinitions()) {
+         events.add(item);
+      }
+      for (PublicRenderParameter prp : pad.getPublicRenderParameters()) {
+         prps.add(prp);
+      }
+      for (CustomPortletMode cpm : pad.getCustomPortletModes()) {
+         cpms.add(cpm);
+      }
+      for (CustomWindowState item : pad.getCustomWindowStates()) {
+         cwss.add(item);
+      }
+      for (UserAttribute ua : pad.getUserAttributes()) {
+         uattrs.add(ua);
+      }
+      for (Filter f : pad.getFilters()) {
+         filters.add(f);
+      }
+      for (FilterMapping fm : pad.getFilterMappings()) {
+         fmaps.add(fm);
+      }
+      for (ContainerRuntimeOption cro : pad.getContainerRuntimeOptions()) {
+         cros.add(cro);
+      }
+      
+      localemap.putAll(pad.getLocaleEncodingMappings());
+      
+      if (pad.getListeners() != null) {
+         for (Listener l : pad.getListeners()) {
+            listeners.add(new ListenerImpl(l));
+         }
+      }
+      constraints.addAll(pad.getSecurityConstraints());
+      
+   }
+   
+   public String getId() {
+      return id;
+   }
+
+   public void setId(String id) {
+      this.id = id;
+   }
+   
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletApplicationDefinition#getName()
+    */
+   @Override
+   public String getName() {
+      return name;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletApplicationDefinition#setName(java.lang.String)
+    */
+   @Override
+   public void setName(String name) {
+      this.name = name;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletApplicationDefinition#getContextPath()
+    */
+   @Override
+   public String getContextPath() {
+      return contextPath;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletApplicationDefinition#setContextPath(java.lang.String)
+    */
+   @Override
+   public void setContextPath(String contextPath) {
+      this.contextPath = contextPath;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletApplicationDefinition#getVersion()
+    */
+   @Override
+   public String getVersion() {
+      return version;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletApplicationDefinition#setVersion(java.lang.String)
+    */
+   @Override
+   public void setVersion(String version) {
+      this.version = version;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletApplicationDefinition#getResourceBundle()
+    */
+   @Override
+   public String getResourceBundle() {
+      return resourceBundle;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletApplicationDefinition#setResourceBundle(java.lang.String)
+    */
+   @Override
+   public void setResourceBundle(String resourceBundle) {
+      this.resourceBundle = resourceBundle;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletApplicationDefinition#getDefaultNamespace()
+    */
+   @Override
+   public String getDefaultNamespace() {
+      return defaultNamespace;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletApplicationDefinition#setDefaultNamespace(java.lang.String)
+    */
+   @Override
+   public void setDefaultNamespace(String defaultNamespace) {
+      this.defaultNamespace = defaultNamespace;
+   }
+
+   @Override
+   public PortletDefinition getPortlet(String portletName) {
+      PortletDefinition pd = null;
+      for (PortletDefinition item : portlets) {
+         if (item.getPortletName().equals(portletName)) {
+            pd = new PortletDefinitionImpl(item);
+         }
+      }
+      return pd;
+   }
+
+   @Override
+   public List<PortletDefinition> getPortlets() {
+      ArrayList<PortletDefinition> ret = new ArrayList<PortletDefinition>();
+      for (PortletDefinition pd : portlets) {
+         ret.add(new PortletDefinitionImpl(pd));
+      }
+      return ret;
+   }
+
+   @Override
+   public void addPortlet(PortletDefinition pd) {
+      portlets.add( pd);
+   }
+
+   @Override
+   public List<EventDefinition> getEventDefinitions() {
+      ArrayList<EventDefinition> items = new ArrayList<EventDefinition>();
+      for (EventDefinition item : events) {
+         items.add(new EventDefinitionImpl(item));
+      }
+      return items;
+   }
+
+   @Override
+   public EventDefinition getEventDefinition(QName qn) {
+      EventDefinition ret = null;
+      for (EventDefinition item : events) {
+         if (item.getQName().equals(qn)) {
+            ret = new EventDefinitionImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   @Override
+   public void addEventDefinition(EventDefinition ed) {
+      events.add(ed);
+   }
+
+   @Override
+   public PublicRenderParameter getPublicRenderParameter(String identifier) {
+      PublicRenderParameter ret = null;
+      for (PublicRenderParameter prp : prps) {
+         if (prp.getIdentifier().equals(identifier)) {
+            ret = new PublicRenderParameterImpl(prp);
+         }
+      }
+      return ret;
+   }
+
+   @Override
+   public List<PublicRenderParameter> getPublicRenderParameters() {
+      ArrayList<PublicRenderParameter> items = new ArrayList<PublicRenderParameter>();
+      for (PublicRenderParameter item : prps) {
+         items.add(new PublicRenderParameterImpl(item));
+      }
+      return items;
+   }
+
+   @Override
+   public void addPublicRenderParameter(PublicRenderParameter prp) {
+      prps.add(prp);
+   }
+
+   @Override
+   public CustomPortletMode getCustomPortletMode(String arg) {
+      CustomPortletMode ret = null;
+      for (CustomPortletMode item : cpms) {
+         if (item.getPortletMode().equals(arg)) {
+            ret = new CustomPortletModeImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   @Override
+   public List<CustomPortletMode> getCustomPortletModes() {
+      ArrayList<CustomPortletMode> items = new ArrayList<CustomPortletMode>();
+      for (CustomPortletMode item : cpms) {
+         items.add(new CustomPortletModeImpl(item));
+      }
+      return items;
+   }
+
+   @Override
+   public void addCustomPortletMode(CustomPortletMode cpm) {
+      cpms.add(cpm);
+   }
+
+   @Override
+   public CustomWindowState getCustomWindowState(String arg) {
+      CustomWindowState ret = null;
+      for (CustomWindowState item : cwss) {
+         if (item.getWindowState().equals(arg)) {
+            ret = new CustomWindowStateImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   @Override
+   public List<CustomWindowState> getCustomWindowStates() {
+      ArrayList<CustomWindowState> items = new ArrayList<CustomWindowState>();
+      for (CustomWindowState item : cwss) {
+         items.add(new CustomWindowStateImpl(item));
+      }
+      return items;
+   }
+
+   @Override
+   public void addCustomWindowState(CustomWindowState cws) {
+      cwss.add(cws);
+   }
+
+   @Override
+   public UserAttribute getUserAttribute(String arg) {
+      UserAttribute ret = null;
+      for (UserAttribute item : uattrs) {
+         if (item.getName().equals(arg)) {
+            ret = new UserAttributeImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   @Override
+   public List<UserAttribute> getUserAttributes() {
+      ArrayList<UserAttribute> items = new ArrayList<UserAttribute>();
+      for (UserAttribute item : uattrs) {
+         items.add(new UserAttributeImpl(item));
+      }
+      return items;
+   }
+
+   @Override
+   public void addUserAttribute(UserAttribute ua) {
+      uattrs.add(ua);
+   }
+
+   @Override
+   public Filter getFilter(String arg) {
+      Filter ret = null;
+      for (Filter item : filters) {
+         if (item.getFilterName().equals(arg)) {
+            ret = new FilterImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   @Override
+   public List<Filter> getFilters() {
+      ArrayList<Filter> items = new ArrayList<Filter>();
+      for (Filter item : filters) {
+         items.add(new FilterImpl(item));
+      }
+      return items;
+   }
+
+   @Override
+   public void addFilter(Filter filter) {
+      filters.add(filter);
+   }
+
+   @Override
+   public FilterMapping getFilterMapping(String arg) {
+      FilterMapping ret = null;
+      for (FilterMapping item : fmaps) {
+         if (item.getFilterName().equals(arg)) {
+            ret = new FilterMappingImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   @Override
+   public List<FilterMapping> getFilterMappings() {
+      ArrayList<FilterMapping> items = new ArrayList<FilterMapping>();
+      for (FilterMapping item : fmaps) {
+         items.add(new FilterMappingImpl(item));
+      }
+      return items;
+   }
+
+   @Override
+   public void addFilterMapping(FilterMapping fm) {
+      fmaps.add(fm);
+   }
+
+   @Override
+   public ContainerRuntimeOption getContainerRuntimeOption(String arg) {
+      ContainerRuntimeOption ret = null;
+      for (ContainerRuntimeOption item : cros) {
+         if (item.getName().equals(arg)) {
+            ret = new ContainerRuntimeOptionImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   @Override
+   public List<ContainerRuntimeOption> getContainerRuntimeOptions() {
+      ArrayList<ContainerRuntimeOption> items = new ArrayList<ContainerRuntimeOption>();
+      for (ContainerRuntimeOption item : cros) {
+         items.add(new ContainerRuntimeOptionImpl(item));
+      }
+      return items;
+   }
+
+   @Override
+   public void addContainerRuntimeOption(ContainerRuntimeOption cro) {
+      cros.add(cro);
+   }
+
+   @Override
+   public List<Listener> getListeners() {
+      ArrayList<Listener> list = new ArrayList<Listener>();
+      for (Listener l : listeners) {
+         list.add(new ListenerImpl(l));
+      }
+      return list;
+   }
+
+   @Override
+   public void addListener(Listener listener) {
+      listeners.add(listener);
+   }
+
+   @Override
+   public List<SecurityConstraint> getSecurityConstraints() {
+      ArrayList<SecurityConstraint> scs = new ArrayList<SecurityConstraint>();
+      for (SecurityConstraint sc : constraints) {
+         scs.add(new SecurityConstraintImpl(sc));
+      }
+      return scs;
+   }
+
+   @Override
+   public void addSecurityConstraint(SecurityConstraint sc) {
+      constraints.add(sc);
+   }
+
+   @Override
+   public Map<Locale, String> getLocaleEncodingMappings() {
+      Map<Locale, String> lem = new HashMap<Locale, String>();
+      for (Locale l : localemap.keySet()) {
+         lem.put((Locale) l.clone(), localemap.get(l));
+      }
+      return lem;
+   }
+
+   @Override
+   public void addLocaleEncodingMapping(Locale locale, String encoding) {
+      localemap.put(locale, encoding);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PortletDefinitionImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PortletDefinitionImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PortletDefinitionImpl.java
new file mode 100644
index 0000000..16b1c03
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PortletDefinitionImpl.java
@@ -0,0 +1,488 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.ContainerRuntimeOption;
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.DisplayName;
+import org.apache.pluto.container.om.portlet.EventDefinitionReference;
+import org.apache.pluto.container.om.portlet.InitParam;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.PortletDefinition;
+import org.apache.pluto.container.om.portlet.PortletInfo;
+import org.apache.pluto.container.om.portlet.Preferences;
+import org.apache.pluto.container.om.portlet.SecurityRoleRef;
+import org.apache.pluto.container.om.portlet.Supports;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class PortletDefinitionImpl implements PortletDefinition {
+   
+   private PortletApplicationDefinition pad;
+   
+   private String portletName;
+   private String portletClass;
+   private String resourceBundle;
+   private String cacheScope;
+   
+   private int expirationCache;
+   
+   private PortletInfo info;
+   private Preferences prefs;
+   
+   private final List<String> supportedLocales = new ArrayList<String>();
+   private final List<String> pubParms = new ArrayList<String>();
+   
+   private final List<Description> descs = new ArrayList<Description>();
+   private final List<DisplayName> dispNames = new ArrayList<DisplayName>();
+
+   private final List<EventDefinitionReference> proEvtRefs = new ArrayList<EventDefinitionReference>();
+   private final List<EventDefinitionReference> pubEvtRefs =  new ArrayList<EventDefinitionReference>();
+
+   private final List<ContainerRuntimeOption> crtOptions = new ArrayList<ContainerRuntimeOption>();
+   
+   private final List<InitParam> iparms = new ArrayList<InitParam>(); 
+   private final List<SecurityRoleRef> secRefs = new ArrayList<SecurityRoleRef>(); 
+   private final List<Supports> supps = new ArrayList<Supports>(); 
+
+   /**
+    * Copy constructor
+    * @param pd   The portlet definition
+    */
+   public PortletDefinitionImpl(PortletDefinition pd) {
+      this.pad = pd.getApplication();        // intentionally not copied
+      this.portletName = pd.getPortletName();
+      this.portletClass = pd.getPortletClass();
+      this.resourceBundle = pd.getResourceBundle();
+      this.cacheScope = pd.getCacheScope();
+      this.expirationCache = pd.getExpirationCache();
+      
+      PortletInfo pi = pd.getPortletInfo();
+      this.info = (pi == null) ? null : new PortletInfoImpl(pi);
+      
+      Preferences prefs = pd.getPortletPreferences();
+      this.prefs = (prefs == null) ? null : new PreferencesImpl(prefs);
+      
+      this.supportedLocales.addAll(pd.getSupportedLocales());
+      this.pubParms.addAll(pd.getSupportedPublicRenderParameters());
+      
+      for (Description d : pd.getDescriptions()) {
+         this.descs.add(new DescriptionImpl(d));
+      }
+      for (DisplayName dn : pd.getDisplayNames()) {
+         this.dispNames.add(new DisplayNameImpl(dn));
+      }
+      for (EventDefinitionReference edr : pd.getSupportedProcessingEvents()) {
+         this.proEvtRefs.add(
+               new EventDefinitionReferenceImpl(edr));
+      }
+      for (EventDefinitionReference edr : pd.getSupportedPublishingEvents()) {
+         this.pubEvtRefs.add(
+               new EventDefinitionReferenceImpl(edr));
+      }
+      for (ContainerRuntimeOption crt : pd.getContainerRuntimeOptions()) {
+         this.crtOptions.add(new ContainerRuntimeOptionImpl(crt));
+      }
+      for (InitParam ip : pd.getInitParams()) {
+         this.iparms.add(new InitParamImpl(ip));
+      }
+      for (SecurityRoleRef srr : pd.getSecurityRoleRefs()) {
+         this.secRefs.add(new SecurityRoleRefImpl(srr));
+      }
+      for (Supports s : pd.getSupports()) {
+         this.supps.add(new SupportsImpl(s));
+      }
+   }
+   
+   /**
+    * Constructor
+    * @param pn      portlet name
+    * @param pad     portlet application
+    */
+   public PortletDefinitionImpl(String pn, PortletApplicationDefinition pad) {
+      this.portletName = pn;
+      this.pad = pad;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getPortletName()
+    */
+   @Override
+   public String getPortletName() {
+      return portletName;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getApplication()
+    */
+   @Override
+   public PortletApplicationDefinition getApplication() {
+      return pad;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getInitParam(java.lang.String)
+    */
+   @Override
+   public InitParam getInitParam(String paramName) {
+      InitParam ret = null;
+      for (InitParam item : iparms) {
+         if (item.getParamName().equals(paramName)) {
+            ret = new InitParamImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getInitParams()
+    */
+   @Override
+   public List<InitParam> getInitParams() {
+      ArrayList<InitParam> ips = new ArrayList<InitParam>();
+      for (InitParam ip : iparms) {
+         ips.add(new InitParamImpl(ip));
+      }
+      return ips;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#addInitParam(java.lang.String)
+    */
+   @Override
+   public void addInitParam(InitParam ip) {
+      iparms.add(ip);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getPortletClass()
+    */
+   @Override
+   public String getPortletClass() {
+      return portletClass;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#setPortletClass(java.lang.String)
+    */
+   @Override
+   public void setPortletClass(String portletClass) {
+      this.portletClass = portletClass;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getPortletInfo()
+    */
+   @Override
+   public PortletInfo getPortletInfo() {
+      return (info != null) ? new PortletInfoImpl(info) : null;
+   }
+
+   @Override
+   public void setPortletInfo(PortletInfo info) {
+      this.info = info;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getPortletPreferences()
+    */
+   @Override
+   public Preferences getPortletPreferences() {
+      return (prefs != null) ? new PreferencesImpl(prefs) : null;
+   }
+
+   @Override
+   public void setPortletPreferences(Preferences prefs) {
+      this.prefs = prefs;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getSupportedProcessingEvents()
+    */
+   @Override
+   public List<EventDefinitionReference> getSupportedProcessingEvents() {
+      return new ArrayList<EventDefinitionReference>(proEvtRefs);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#addSupportedProcessingEvent(EventDefinitionReference)
+    */
+   @Override
+   public void addSupportedProcessingEvent(EventDefinitionReference edr) {
+      proEvtRefs.add(edr);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getSupportedPublishingEvents()
+    */
+   @Override
+   public List<EventDefinitionReference> getSupportedPublishingEvents() {
+      return new ArrayList<EventDefinitionReference>(pubEvtRefs);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#addSupportedPublishingEvent(javax.xml.namespace.QName)
+    */
+   @Override
+   public void addSupportedPublishingEvent(EventDefinitionReference edr) {
+      pubEvtRefs.add(edr);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getSupportedPublicRenderParameters()
+    */
+   @Override
+   public List<String> getSupportedPublicRenderParameters() {
+      return new ArrayList<String>(pubParms);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#addSupportedPublicRenderParameter(java.lang.String)
+    */
+   @Override
+   public void addSupportedPublicRenderParameter(String identifier) {
+      pubParms.add(identifier);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getResourceBundle()
+    */
+   @Override
+   public String getResourceBundle() {
+      return resourceBundle;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#setResourceBundle(java.lang.String)
+    */
+   @Override
+   public void setResourceBundle(String resourceBundle) {
+      this.resourceBundle = resourceBundle;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getSecurityRoleRef(java.lang.String)
+    */
+   @Override
+   public SecurityRoleRef getSecurityRoleRef(String roleName) {
+      SecurityRoleRef ret = null;
+      for (SecurityRoleRef item : secRefs) {
+         if (item.getRoleName().equals(roleName)) {
+            ret = new SecurityRoleRefImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getSecurityRoleRefs()
+    */
+   @Override
+   public List<SecurityRoleRef> getSecurityRoleRefs() {
+      return new ArrayList<SecurityRoleRef>(secRefs);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#addSecurityRoleRef(SecurityRoleRef)
+    */
+   @Override
+   public void addSecurityRoleRef(SecurityRoleRef srr) {
+      secRefs.add(srr);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getSupports(java.lang.String)
+    */
+   @Override
+   public Supports getSupports(String mimeType) {
+      Supports ret = null;
+      for (Supports item : supps) {
+         if (item.getMimeType().equals(mimeType)) {
+            ret = new SupportsImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getSupports()
+    */
+   @Override
+   public List<Supports> getSupports() {
+      return new ArrayList<Supports>(supps);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#addSupports(java.lang.String)
+    */
+   @Override
+   public void addSupports(Supports supp) {
+      supps.add(supp);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getDescription(java.util.Locale)
+    */
+   @Override
+   public Description getDescription(Locale locale) {
+      Description ret = null;
+      for (Description item : descs) {
+         if (item.getLocale().equals(locale)) {
+            ret = new DescriptionImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getDescriptions()
+    */
+   @Override
+   public List<Description> getDescriptions() {
+      return new ArrayList<Description>(descs);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#addDescription(org.apache.pluto.container.om.portlet.Description)
+    */
+   @Override
+   public void addDescription(Description desc) {
+      descs.add(desc);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getDisplayName(java.util.Locale)
+    */
+   @Override
+   public DisplayName getDisplayName(Locale locale) {
+      DisplayName ret = null;
+      for (DisplayName item : dispNames) {
+         if (item.getLocale().equals(locale)) {
+            ret = new DisplayNameImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getDisplayNames()
+    */
+   @Override
+   public List<DisplayName> getDisplayNames() {
+      return new ArrayList<DisplayName>(dispNames);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#addDisplayName(org.apache.pluto.container.om.portlet.DisplayName)
+    */
+   @Override
+   public void addDisplayName(DisplayName desc) {
+      dispNames.add(desc);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getSupportedLocales()
+    */
+   @Override
+   public List<String> getSupportedLocales() {
+      return new ArrayList<String>(supportedLocales);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#addSupportedLocale(java.lang.String)
+    */
+   @Override
+   public void addSupportedLocale(String lang) {
+      supportedLocales.add(lang);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getExpirationCache()
+    */
+   @Override
+   public int getExpirationCache() {
+      return expirationCache;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#setExpirationCache(int)
+    */
+   @Override
+   public void setExpirationCache(int expirationCache) {
+      this.expirationCache = expirationCache;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getCacheScope()
+    */
+   @Override
+   public String getCacheScope() {
+      return cacheScope;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#setCacheScope(java.lang.String)
+    */
+   @Override
+   public void setCacheScope(String cacheScope) {
+      this.cacheScope = cacheScope;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getContainerRuntimeOption(java.lang.String)
+    */
+   @Override
+   public ContainerRuntimeOption getContainerRuntimeOption(String name) {
+      ContainerRuntimeOption ret = null;
+      for (ContainerRuntimeOption item : crtOptions) {
+         if (item.getName().equals(name)) {
+            ret = new ContainerRuntimeOptionImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#getContainerRuntimeOptions()
+    */
+   @Override
+   public List<ContainerRuntimeOption> getContainerRuntimeOptions() {
+      ArrayList<ContainerRuntimeOption> crtos = new ArrayList<ContainerRuntimeOption>();
+      for (ContainerRuntimeOption crto : crtOptions) {
+         crtos.add(new ContainerRuntimeOptionImpl(crto));
+      }
+      return crtos;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletDefinition#addContainerRuntimeOption(java.lang.String)
+    */
+   @Override
+   public void addContainerRuntimeOption(ContainerRuntimeOption cro) {
+      crtOptions.add(new ContainerRuntimeOptionImpl(cro));
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PortletInfoImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PortletInfoImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PortletInfoImpl.java
new file mode 100644
index 0000000..11e58e9
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PortletInfoImpl.java
@@ -0,0 +1,106 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import org.apache.pluto.container.om.portlet.PortletInfo;
+
+/**
+ * Portlet info
+ * 
+ * @author Scott Nicklous
+ *
+ */
+public class PortletInfoImpl implements PortletInfo {
+   
+   private String title;
+   private String keywords;
+   private String sTitle;
+   
+   
+   /**
+    * Copy constructor 
+    */
+   public PortletInfoImpl(PortletInfo pi) {
+      title = pi.getTitle();
+      keywords = pi.getKeywords();
+      sTitle = pi.getShortTitle();
+   }
+   
+   /**
+    * Constructor
+    * @param ti      title
+    * @param kw      keywords
+    * @param sti     short title
+    */
+   public PortletInfoImpl(String ti, String kw, String sti) {
+      title = ti;
+      keywords = kw;
+      sTitle = sti;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletInfo#getTitle()
+    */
+   @Override
+   public String getTitle() {
+      return title;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletInfo#setTitle(java.lang.String)
+    */
+   @Override
+   public void setTitle(String title) {
+      this.title = title;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletInfo#getKeywords()
+    */
+   @Override
+   public String getKeywords() {
+      return keywords;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletInfo#setKeywords(java.lang.String)
+    */
+   @Override
+   public void setKeywords(String keywords) {
+      this.keywords = keywords;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletInfo#getShortTitle()
+    */
+   @Override
+   public String getShortTitle() {
+      return sTitle;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PortletInfo#setShortTitle(java.lang.String)
+    */
+   @Override
+   public void setShortTitle(String shortTitle) {
+      sTitle = shortTitle;
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PreferenceImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PreferenceImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PreferenceImpl.java
new file mode 100644
index 0000000..215c927
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PreferenceImpl.java
@@ -0,0 +1,104 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.pluto.container.om.portlet.Preference;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class PreferenceImpl implements Preference {
+   
+   private String name;
+   private boolean isReadOnly;
+   private final ArrayList<String> values = new ArrayList<String>();
+   
+   public PreferenceImpl() {
+      name = "";
+      isReadOnly = false;
+   }
+   
+   /**
+    * Copy constructor
+    * @param pi
+    */
+   public PreferenceImpl(Preference pi) {
+      this.name = pi.getName();
+      this.isReadOnly = pi.isReadOnly();
+      this.values.addAll(pi.getValues());
+   }
+   
+   /**
+    * Basic Constructor
+    * @param name
+    * @param isRO
+    * @param vals
+    */
+   public PreferenceImpl(String name, boolean isRO, List<String> vals) {
+      this.name = name;
+      this.isReadOnly = isRO;
+      values.addAll(vals);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Preference#getName()
+    */
+   @Override
+   public String getName() {
+      return name;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Preference#getValues()
+    */
+   @Override
+   public List<String> getValues() {
+      return new ArrayList<String>(values);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Preference#addValue(java.lang.String)
+    */
+   @Override
+   public void addValue(String value) {
+      values.add(value);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Preference#isReadOnly()
+    */
+   @Override
+   public boolean isReadOnly() {
+      return isReadOnly;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Preference#setReadOnly(boolean)
+    */
+   @Override
+   public void setReadOnly(boolean readOnly) {
+      isReadOnly = readOnly;
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PreferencesImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PreferencesImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PreferencesImpl.java
new file mode 100644
index 0000000..9ad60f1
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PreferencesImpl.java
@@ -0,0 +1,102 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+
+import org.apache.pluto.container.om.portlet.Preference;
+import org.apache.pluto.container.om.portlet.Preferences;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class PreferencesImpl implements Preferences {
+   
+   private final Map<String, Preference> prefs = new HashMap<String, Preference>();
+   private String prefVal;
+
+   /**
+    * Default constructor
+    */
+   public PreferencesImpl() {
+   }
+   
+   /**
+    * Copy constructor
+    * @param pr
+    */
+   public PreferencesImpl(Preferences pr) {
+      for (Preference pref : pr.getPortletPreferences()) {
+         prefs.put(pref.getName(), new PreferenceImpl(pref));
+      }
+      prefVal = pr.getPreferencesValidator();
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Preferences#getPortletPreference(java.lang.String)
+    */
+   @Override
+   public Preference getPortletPreference(String name) {
+      Preference pref = (prefs.get(name) == null) ? 
+            null : new PreferenceImpl(prefs.get(name));
+      return pref;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Preferences#getPortletPreferences()
+    */
+   @Override
+   public List<Preference> getPortletPreferences() {
+      ArrayList<Preference> rPrefs = new ArrayList<Preference>();
+      for (Preference pref : prefs.values()) {
+         rPrefs.add(new PreferenceImpl(pref));
+      }
+      return rPrefs;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Preferences#addPreference(org.apache.pluto.container.om.portlet.Preference)
+    */
+   @Override
+   public void addPreference(Preference pref) {
+      prefs.put(pref.getName(), new PreferenceImpl(pref));
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Preferences#getPreferencesValidator()
+    */
+   @Override
+   public String getPreferencesValidator() {
+      return prefVal;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Preferences#setPreferencesValidator(java.lang.String)
+    */
+   @Override
+   public void setPreferencesValidator(String preferencesValidator) {
+      prefVal = preferencesValidator;
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PublicRenderParameterImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PublicRenderParameterImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PublicRenderParameterImpl.java
new file mode 100644
index 0000000..2f23354
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/PublicRenderParameterImpl.java
@@ -0,0 +1,130 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import javax.xml.namespace.QName;
+
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.PublicRenderParameter;
+
+/**
+ * Public render parameters
+ * 
+ * @author Scott Nicklous
+ *
+ */
+public class PublicRenderParameterImpl implements PublicRenderParameter {
+   
+   private QName qname;
+   private String id;
+   private final List<QName> aliases = new ArrayList<QName>();
+   private final List<Description> descs = new ArrayList<Description>();
+
+   /**
+    * Copy constructor
+    * @param edi
+    */
+   public PublicRenderParameterImpl(PublicRenderParameter pri) {
+      QName priqn = pri.getQName();
+      this.qname = new QName(priqn.getNamespaceURI(), priqn.getLocalPart());
+      this.id = pri.getIdentifier();
+      for (QName qn : pri.getAliases()) {
+         this.aliases.add(new QName(qn.getNamespaceURI(), qn.getLocalPart()));
+      }
+      for (Description desc : pri.getDescriptions()) {
+         descs.add(new DescriptionImpl(desc));
+      }
+   }
+   
+   /**
+    * Basic constructor
+    */
+   public PublicRenderParameterImpl(QName qn, String id) {
+      this.qname = qn;
+      this.id = id;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PublicRenderParameter#getQName()
+    */
+   @Override
+   public QName getQName() {
+      return qname;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PublicRenderParameter#getIdentifier()
+    */
+   @Override
+   public String getIdentifier() {
+      return id;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PublicRenderParameter#getDescription(java.util.Locale)
+    */
+   @Override
+   public Description getDescription(Locale locale) {
+      Description ret = null;
+      for (Description desc : descs) {
+         if (desc.getLocale().equals(locale)) {
+            ret = desc;
+         }
+      }
+      return ret;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PublicRenderParameter#getDescriptions()
+    */
+   @Override
+   public List<Description> getDescriptions() {
+      return new ArrayList<Description>(descs);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PublicRenderParameter#addDescription(org.apache.pluto.container.om.portlet.Description)
+    */
+   @Override
+   public void addDescription(Description desc) {
+      descs.add(desc);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PublicRenderParameter#getAliases()
+    */
+   @Override
+   public List<QName> getAliases() {
+      return new ArrayList<QName>(aliases);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.PublicRenderParameter#addAlias(javax.xml.namespace.QName)
+    */
+   @Override
+   public void addAlias(QName qName) {
+      aliases.add(qName);
+   }
+
+}


[12/38] portals-pluto git commit: Replaced code that reads the deployment descriptor with an implementation that can be better extended to add v3.0 support. Added test cases. Uses jaxb binding classes that are generated at compile time.

Posted by ms...@apache.org.
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/SecurityConstraintImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/SecurityConstraintImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/SecurityConstraintImpl.java
new file mode 100644
index 0000000..bc6f53a
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/SecurityConstraintImpl.java
@@ -0,0 +1,117 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.DisplayName;
+import org.apache.pluto.container.om.portlet.SecurityConstraint;
+import org.apache.pluto.container.om.portlet.UserDataConstraint;
+
+/**
+ * Security Constraint
+ * 
+ * @author Scott Nicklous
+ *
+ */
+public class SecurityConstraintImpl implements SecurityConstraint {
+   
+   private UserDataConstraint udc;
+   private final List<DisplayName> dispNames = new ArrayList<DisplayName>();
+   private final ArrayList<String> portletNames = new ArrayList<String>();
+   
+   
+   /**
+    * Copy constructor
+    */
+   public SecurityConstraintImpl(SecurityConstraint sc) {
+      this.udc = sc.getUserDataConstraint();
+      for (DisplayName disp : sc.getDisplayNames()) {
+         dispNames.add(new DisplayNameImpl(disp));
+      }
+      for (String pn : sc.getPortletNames()) {
+         this.portletNames.add(new String(pn));
+      }
+   }
+
+   /**
+    * Constructor
+    */
+   public SecurityConstraintImpl(UserDataConstraint udc) {
+      this.udc = new UserDataConstraintImpl(udc);
+   }
+   
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.SecurityConstraint#getUserDataConstraint()
+    */
+   @Override
+   public UserDataConstraint getUserDataConstraint() {
+      return new UserDataConstraintImpl(udc);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.SecurityConstraint#getDisplayName(java.util.Locale)
+    */
+   @Override
+   public DisplayName getDisplayName(Locale locale) {
+      DisplayName ret = null;
+      for (DisplayName item : dispNames) {
+         if (item.getLocale().equals(locale)) {
+            ret = new DisplayNameImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.SecurityConstraint#getDisplayNames()
+    */
+   @Override
+   public List<DisplayName> getDisplayNames() {
+      return new ArrayList<DisplayName>(dispNames);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.SecurityConstraint#addDisplayName(org.apache.pluto.container.om.portlet.DisplayName)
+    */
+   @Override
+   public void addDisplayName(DisplayName desc) {
+      dispNames.add(desc);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.SecurityConstraint#getPortletNames()
+    */
+   @Override
+   public List<String> getPortletNames() {
+      return new ArrayList<String>(portletNames);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.SecurityConstraint#addPortletName(java.lang.String)
+    */
+   @Override
+   public void addPortletName(String portletName) {
+      portletNames.add(portletName);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/SecurityRoleRefImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/SecurityRoleRefImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/SecurityRoleRefImpl.java
new file mode 100644
index 0000000..4a3e0ba
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/SecurityRoleRefImpl.java
@@ -0,0 +1,115 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.SecurityRoleRef;
+
+/**
+ * A single event declaration
+ * 
+ * @author Scott Nicklous
+ */
+public class SecurityRoleRefImpl implements SecurityRoleRef {
+   
+   private String roleLink;
+   private String roleName;
+   private final List<Description> descs = new ArrayList<Description>();
+   
+   
+   /**
+    * Copy constructor
+    * @param srr
+    */
+   public SecurityRoleRefImpl(SecurityRoleRef srr) {
+      this.roleName = srr.getRoleName();
+      this.roleLink = srr.getRoleLink();
+      for (Description desc : srr.getDescriptions()) {
+         descs.add(new DescriptionImpl(desc));
+      }
+   }
+
+   /**
+    * Constructor
+    * @param roleName      Role name
+    */
+   public SecurityRoleRefImpl(String roleName) {
+      this.roleName = roleName;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.SecurityRoleRef#getRoleName()
+    */
+   @Override
+   public String getRoleName() {
+      return roleName;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.SecurityRoleRef#getRoleLink()
+    */
+   @Override
+   public String getRoleLink() {
+      return roleLink;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.SecurityRoleRef#setRoleLink(String)
+    */
+   @Override
+   public void setRoleLink(String roleLink) {
+      this.roleLink = roleLink;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.SecurityRoleRef#getDescription(java.util.Locale)
+    */
+   @Override
+   public Description getDescription(Locale locale) {
+      Description ret = null;
+      for (Description item : descs) {
+         if (item.getLocale().equals(locale)) {
+            ret = new DescriptionImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.SecurityRoleRef#getDescriptions()
+    */
+   @Override
+   public List<Description> getDescriptions() {
+      return new ArrayList<Description>(descs);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.SecurityRoleRef#addDescription(org.apache.pluto.container.om.portlet.Description)
+    */
+   @Override
+   public void addDescription(Description desc) {
+      descs.add(desc);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/SupportsImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/SupportsImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/SupportsImpl.java
new file mode 100644
index 0000000..366c103
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/SupportsImpl.java
@@ -0,0 +1,105 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.pluto.container.om.portlet.Supports;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class SupportsImpl implements Supports {
+   
+   private String mime;
+   private final ArrayList<String> portletModes = new ArrayList<String>();
+   private final ArrayList<String> windowStates = new ArrayList<String>();
+   
+   /**
+    * Copy constructor
+    */
+   public SupportsImpl(Supports sup) {
+      mime = sup.getMimeType();
+      for (String pm : sup.getPortletModes()) {
+         portletModes.add(pm);
+      }
+      for (String ws : sup.getWindowStates()) {
+         windowStates.add(ws);
+      }
+   }
+
+   /**
+    * Constructor
+    */
+   public SupportsImpl(String mt) {
+      mime = mt;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Supports#getMimeType()
+    */
+   @Override
+   public String getMimeType() {
+      return mime;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Supports#setMimeType(java.lang.String)
+    */
+   @Override
+   public void setMimeType(String mt) {
+      mime = mt;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Supports#getPortletModes()
+    */
+   @Override
+   public List<String> getPortletModes() {
+      return new ArrayList<String>(portletModes);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Supports#addPortletMode(java.lang.String)
+    */
+   @Override
+   public void addPortletMode(String portletMode) {
+      portletModes.add(portletMode);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Supports#getWindowStates()
+    */
+   @Override
+   public List<String> getWindowStates() {
+      return new ArrayList<String>(windowStates);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Supports#addWindowState(java.lang.String)
+    */
+   @Override
+   public void addWindowState(String windowState) {
+      windowStates.add(windowState);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/UserAttributeImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/UserAttributeImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/UserAttributeImpl.java
new file mode 100644
index 0000000..8431028
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/UserAttributeImpl.java
@@ -0,0 +1,97 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.UserAttribute;
+
+/**
+ * A single event declaration
+ * 
+ * @author Scott Nicklous
+ */
+public class UserAttributeImpl implements UserAttribute {
+   
+   private String name;
+   private final List<Description> descs = new ArrayList<Description>();
+   
+   
+   /**
+    * Copy constructor
+    * @param udc
+    */
+   public UserAttributeImpl(UserAttribute udc) {
+      this.name = udc.getName();
+      for (Description desc : udc.getDescriptions()) {
+         descs.add(new DescriptionImpl(desc));
+      }
+   }
+
+   /**
+    * Constructor
+    * @param name   UserAttribute name
+    */
+   public UserAttributeImpl(String name) {
+      this.name = name;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.UserAttribute#getUserAttributeName()
+    */
+   @Override
+   public String getName() {
+      return name;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.UserAttribute#getDescription(java.util.Locale)
+    */
+   @Override
+   public Description getDescription(Locale locale) {
+      Description ret = null;
+      for (Description item : descs) {
+         if (item.getLocale().equals(locale)) {
+            ret = new DescriptionImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.UserAttribute#getDescriptions()
+    */
+   @Override
+   public List<Description> getDescriptions() {
+      return new ArrayList<Description>(descs);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.UserAttribute#addDescription(org.apache.pluto.container.om.portlet.Description)
+    */
+   @Override
+   public void addDescription(Description desc) {
+      descs.add(desc);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/UserDataConstraintImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/UserDataConstraintImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/UserDataConstraintImpl.java
new file mode 100644
index 0000000..07aa5fd
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/UserDataConstraintImpl.java
@@ -0,0 +1,97 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.UserDataConstraint;
+
+/**
+ * A single event declaration
+ * 
+ * @author Scott Nicklous
+ */
+public class UserDataConstraintImpl implements UserDataConstraint {
+   
+   private String transportGuarantee;
+   private final List<Description> descs = new ArrayList<Description>();
+   
+   
+   /**
+    * Copy constructor
+    * @param udc
+    */
+   public UserDataConstraintImpl(UserDataConstraint udc) {
+      this.transportGuarantee = udc.getTransportGuarantee();
+      for (Description desc : udc.getDescriptions()) {
+         descs.add(new DescriptionImpl(desc));
+      }
+   }
+
+   /**
+    * Constructor
+    * @param fn   UserDataConstraint name
+    */
+   public UserDataConstraintImpl(String udc) {
+      this.transportGuarantee = udc;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.UserDataConstraint#getUserDataConstraintName()
+    */
+   @Override
+   public String getTransportGuarantee() {
+      return transportGuarantee;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.UserDataConstraint#getDescription(java.util.Locale)
+    */
+   @Override
+   public Description getDescription(Locale locale) {
+      Description ret = null;
+      for (Description item : descs) {
+         if (item.getLocale().equals(locale)) {
+            ret = new DescriptionImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.UserDataConstraint#getDescriptions()
+    */
+   @Override
+   public List<Description> getDescriptions() {
+      return new ArrayList<Description>(descs);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.UserDataConstraint#addDescription(org.apache.pluto.container.om.portlet.Description)
+    */
+   @Override
+   public void addDescription(Description desc) {
+      descs.add(desc);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/ContainerRuntimeOptionType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/ContainerRuntimeOptionType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/ContainerRuntimeOptionType.java
deleted file mode 100644
index c8e8e25..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/ContainerRuntimeOptionType.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet10.impl;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-/**
- * 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 <p>Java class
- * for container-runtime-optionType complex type. <p>The following schema fragment specifies the expected content
- * contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;container-runtime-optionType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}nameType&quot;/&gt;
- *         &lt;element name=&quot;value&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}valueType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "container-runtime-optionType", propOrder = { "name", "value" })
-public class ContainerRuntimeOptionType
-{
-    @XmlElement(required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    String name;
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    List<String> value;
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/CustomPortletModeType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/CustomPortletModeType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/CustomPortletModeType.java
deleted file mode 100644
index d0b0fcf..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/CustomPortletModeType.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet10.impl;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-/**
- * A custom portlet mode that one or more portlets in this portlet application supports. Used in: portlet-app <p>Java
- * class for custom-portlet-modeType complex type. <p>The following schema fragment specifies the expected content
- * contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;custom-portlet-modeType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;portlet-mode&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}portlet-modeType&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "custom-portlet-modeType", propOrder = { "description", "portletMode" })
-public class CustomPortletModeType
-{
-    @XmlElement(name = "description")
-    List<DescriptionType> description;
-    @XmlElement(name = "portlet-mode", required = true)
-    @XmlJavaTypeAdapter(value = CollapsedStringAdapter.class)
-    String portletMode;
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/CustomWindowStateType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/CustomWindowStateType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/CustomWindowStateType.java
deleted file mode 100644
index c4062a9..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/CustomWindowStateType.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet10.impl;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-/**
- * A custom window state that one or more portlets in this portlet application supports. Used in: portlet-app <p>Java
- * class for custom-window-stateType complex type. <p>The following schema fragment specifies the expected content
- * contained within this class.
- * 
- * <pre>
- * &lt;complexType name="custom-window-stateType">
- *   &lt;complexContent>
- *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       &lt;sequence>
- *         &lt;element name="description" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}descriptionType" maxOccurs="unbounded" minOccurs="0"/>
- *         &lt;element name="window-state" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}window-stateType"/>
- *       &lt;/sequence>
- *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     &lt;/restriction>
- *   &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "custom-window-stateType", propOrder = { "description", "windowState" })
-public class CustomWindowStateType
-{
-    @XmlElement(name = "description")
-    List<DescriptionType> description;
-    @XmlElement(name = "window-state", required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    String windowState;
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/DescriptionType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/DescriptionType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/DescriptionType.java
deleted file mode 100644
index d65b9c2..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/DescriptionType.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet10.impl;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlValue;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-/**
- * 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(“en”). Used in: init-param,
- * portlet, portlet-app, security-role <p>Java class for descriptionType complex type. <p>The following schema
- * fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name="descriptionType">
- *   &lt;simpleContent>
- *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
- *       &lt;attribute ref="{http://www.w3.org/XML/1998/namespace}lang"/>
- *     &lt;/extension>
- *   &lt;/simpleContent>
- * &lt;/complexType>
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "descriptionType", propOrder = { "value" })
-public class DescriptionType
-{
-    @XmlValue
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    String value;
-    @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace")
-    String lang = null;
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/DisplayNameType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/DisplayNameType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/DisplayNameType.java
deleted file mode 100644
index 7cd0313..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/DisplayNameType.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet10.impl;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlValue;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-/**
- * 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: ...
- * 
- * <pre>
- * &lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;display-name xmlns="http://www.w3.org/2001/XMLSchema" xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="en"&gt;Employee Self Service&lt;/display-name&gt;
- * </pre>
- * 
- * 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(“en”). <p>Java class for
- * display-nameType complex type. <p>The following schema fragment specifies the expected content contained within this
- * class.
- * 
- * <pre>
- * &lt;complexType name="display-nameType">
- *   &lt;simpleContent>
- *     &lt;extension base="&lt;http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd>string">
- *       &lt;attribute ref="{http://www.w3.org/XML/1998/namespace}lang"/>
- *     &lt;/extension>
- *   &lt;/simpleContent>
- * &lt;/complexType>
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "display-nameType", propOrder = { "value" })
-public class DisplayNameType
-{
-    @XmlValue
-    @XmlJavaTypeAdapter(value = CollapsedStringAdapter.class)
-    String value;
-    @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace")
-    String lang = null;
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/InitParamType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/InitParamType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/InitParamType.java
deleted file mode 100644
index e9ab049..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/InitParamType.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet10.impl;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-/**
- * The init-param element contains a name/value pair as an initialization param of the portlet Used in:portlet <p>Java
- * class for init-paramType complex type. <p>The following schema fragment specifies the expected content contained
- * within this class.
- * 
- * <pre>
- * &lt;complexType name="init-paramType">
- *   &lt;complexContent>
- *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       &lt;sequence>
- *         &lt;element name="description" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}descriptionType" maxOccurs="unbounded" minOccurs="0"/>
- *         &lt;element name="name" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}nameType"/>
- *         &lt;element name="value" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}valueType"/>
- *       &lt;/sequence>
- *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     &lt;/restriction>
- *   &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "init-paramType", propOrder = { "description", "name", "value" })
-public class InitParamType
-{
-    @XmlElement(name = "description")
-    List<DescriptionType> description;
-    @XmlElement(required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    String name;
-    @XmlElement(required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    String value;
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/ObjectFactory.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/ObjectFactory.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/ObjectFactory.java
deleted file mode 100644
index 2c82ab4..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/ObjectFactory.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet10.impl;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlElementDecl;
-import javax.xml.bind.annotation.XmlRegistry;
-import javax.xml.namespace.QName;
-
-/**
- * This object contains factory methods for each Java content interface and Java element interface generated in the
- * org.apache.pluto.descriptors.portlet10 package. <p>An ObjectFactory allows you to programatically construct new
- * instances of the Java representation for XML content. The Java representation of XML content can consist of schema
- * derived interfaces and classes representing the binding of schema type definitions, element declarations and model
- * groups. Factory methods for each of these are provided in this class.
- * 
- * @version $Id$
- */
-@XmlRegistry
-public class ObjectFactory
-{
-    private final static QName _PortletApp_QNAME = new QName("http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd",
-                                                             "portlet-app");
-
-    public ObjectFactory()
-    {
-    }
-
-    public PortletAppType createPortletApp()
-    {
-        return new PortletAppType();
-    }
-
-    @XmlElementDecl(namespace = "http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd", name = "portlet-app")
-    public JAXBElement<PortletAppType> createPortletApp(PortletAppType value)
-    {
-        return new JAXBElement<PortletAppType>(_PortletApp_QNAME, PortletAppType.class, null, value);
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PortletAppType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PortletAppType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PortletAppType.java
deleted file mode 100644
index 2723517..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PortletAppType.java
+++ /dev/null
@@ -1,471 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet10.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-import org.apache.pluto.container.om.portlet.CustomPortletMode;
-import org.apache.pluto.container.om.portlet.CustomWindowState;
-import org.apache.pluto.container.om.portlet.Description;
-import org.apache.pluto.container.om.portlet.DisplayName;
-import org.apache.pluto.container.om.portlet.InitParam;
-import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
-import org.apache.pluto.container.om.portlet.PortletDefinition;
-import org.apache.pluto.container.om.portlet.PortletInfo;
-import org.apache.pluto.container.om.portlet.Preference;
-import org.apache.pluto.container.om.portlet.Preferences;
-import org.apache.pluto.container.om.portlet.SecurityConstraint;
-import org.apache.pluto.container.om.portlet.SecurityRoleRef;
-import org.apache.pluto.container.om.portlet.Supports;
-import org.apache.pluto.container.om.portlet.UserAttribute;
-
-/**
- * <p>Java class for portlet-appType complex type.</p> <p>The following schema fragment specifies the expected
- * content contained within this class.</p>
- * 
- * <pre>
- * &lt;complexType name=&quot;portlet-appType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;portlet&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}portletType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;custom-portlet-mode&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}custom-portlet-modeType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;custom-window-state&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}custom-window-stateType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;user-attribute&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}user-attributeType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;security-constraint&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}security-constraintType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;version&quot; use=&quot;required&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}string&quot; /&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlRootElement(name = "portlet-app")
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "portlet-appType", propOrder = { "portlet", "customPortletMode", "customWindowState", "userAttribute",
-                                                "securityConstraint" })
-public class PortletAppType
-{
-    @XmlElement(name = "portlet")
-    List<PortletType> portlet;
-    @XmlElement(name = "custom-portlet-mode")
-    List<CustomPortletModeType> customPortletMode;
-    @XmlElement(name = "custom-window-state")
-    List<CustomWindowStateType> customWindowState;
-    @XmlElement(name = "user-attribute")
-    List<UserAttributeType> userAttribute;
-    @XmlElement(name = "security-constraint")
-    List<SecurityConstraintType> securityConstraint;
-    @XmlAttribute(required = true)
-    String version = PortletApplicationDefinition.JSR_168_VERSION;
-    
-    public PortletAppType()
-    {
-    }
-    
-    public PortletAppType(PortletApplicationDefinition app)
-    {
-        // downgrade
-        for (PortletDefinition pd : app.getPortlets())
-        {
-            if (portlet == null)
-            {
-                portlet = new ArrayList<PortletType>();
-            }
-            PortletType pt = new PortletType();
-            downgradePortlet(pd, pt);
-            portlet.add(pt);            
-        }
-        for (CustomPortletMode cpm : app.getCustomPortletModes())
-        {
-            if (customPortletMode == null)
-            {
-                customPortletMode = new ArrayList<CustomPortletModeType>();
-            }
-            CustomPortletModeType cpmt = new CustomPortletModeType();
-            cpmt.portletMode = cpm.getPortletMode();
-            for (Description d : cpm.getDescriptions())
-            {
-                if (cpmt.description == null)
-                {
-                    cpmt.description = new ArrayList<DescriptionType>();
-                }
-                DescriptionType dt = new DescriptionType();
-                dt.lang = d.getLang();
-                dt.value = d.getDescription();
-                cpmt.description.add(dt);
-            }
-        }
-        for (CustomWindowState cws : app.getCustomWindowStates())
-        {
-            if (customWindowState == null)
-            {
-                customWindowState = new ArrayList<CustomWindowStateType>();
-            }
-            CustomWindowStateType cwst = new CustomWindowStateType();
-            cwst.windowState = cws.getWindowState();
-            for (Description d : cws.getDescriptions())
-            {
-                if (cwst.description == null)
-                {
-                    cwst.description = new ArrayList<DescriptionType>();
-                }
-                DescriptionType dt = new DescriptionType();
-                dt.lang = d.getLang();
-                dt.value = d.getDescription();
-                cwst.description.add(dt);
-            }
-        }
-    }
-    
-    public PortletApplicationDefinition upgrade()
-    {
-        PortletApplicationDefinition app = new org.apache.pluto.container.om.portlet20.impl.PortletAppType();
-        app.setVersion(version);
-        if (portlet != null)
-        {
-            for (PortletType src : portlet)
-            {
-                PortletDefinition target = app.addPortlet(src.portletName);
-                upgradePortlet(src, target);
-            }
-        }
-        if (customPortletMode != null)
-        {
-            for (CustomPortletModeType src : customPortletMode)
-            {
-                CustomPortletMode target = app.addCustomPortletMode(src.portletMode);
-                if (src.description != null)
-                {
-                    for (DescriptionType d : src.description)
-                    {
-                        Description desc = target.addDescription(d.lang);
-                        desc.setDescription(d.value);
-                    }
-                }
-            }
-        }
-        if (customWindowState != null)
-        {
-            for (CustomWindowStateType src : customWindowState)
-            {
-                CustomWindowState target = app.addCustomWindowState(src.windowState);
-                if (src.description != null)
-                {
-                    for (DescriptionType d : src.description)
-                    {
-                        Description desc = target.addDescription(d.lang);
-                        desc.setDescription(d.value);
-                    }
-                }
-            }
-        }
-        if (userAttribute != null)
-        {
-            for (UserAttributeType src : userAttribute)
-            {
-                UserAttribute target = app.addUserAttribute(src.name);
-                if (src.description != null)
-                {
-                    for (DescriptionType d : src.description)
-                    {
-                        Description desc = target.addDescription(d.lang);
-                        desc.setDescription(d.value);
-                    }
-                }
-            }
-        }
-        if (securityConstraint != null)
-        {
-            for (SecurityConstraintType src : securityConstraint)
-            {
-                SecurityConstraint target = app.addSecurityConstraint(src.userDataConstraint.transportGuarantee);
-                if (src.displayName != null)
-                {
-                    for (DisplayNameType d : src.displayName)
-                    {
-                        DisplayName dname = target.addDisplayName(d.lang);
-                        dname.setDisplayName(d.value);
-                    }
-                }
-                if (src.portletCollection != null && src.portletCollection.portletName != null)
-                {
-                    for (String pname : src.portletCollection.portletName)
-                    {
-                        target.addPortletName(pname);
-                    }
-                }
-            }
-        }
-        return app;
-    }
-    
-    private void downgradePortlet(PortletDefinition src, PortletType target)
-    {
-        for (Description d : src.getDescriptions())
-        {
-            if (target.description == null)
-            {
-                target.description = new ArrayList<DescriptionType>();
-            }
-            DescriptionType dt = new DescriptionType();
-            dt.lang = d.getLang();
-            dt.value = d.getDescription();
-            target.description.add(dt);
-        }
-        for (DisplayName d : src.getDisplayNames())
-        {
-            if (target.displayName == null)
-            {
-                target.displayName = new ArrayList<DisplayNameType>();
-            }
-            DisplayNameType dnt = new DisplayNameType();
-            dnt.lang = d.getLang();
-            dnt.value = d.getDisplayName();
-            target.displayName.add(dnt);
-        }
-        target.portletClass = src.getPortletClass();
-        if (src.getExpirationCache() != 0)
-        {
-            target.expirationCache = new Integer(src.getExpirationCache());
-        }
-        for (InitParam p : src.getInitParams())
-        {
-            if (target.initParam == null)
-            {
-                target.initParam = new ArrayList<InitParamType>();
-            }
-            InitParamType pt = new InitParamType();
-            pt.name = p.getParamName();
-            pt.value = p.getParamValue();
-            for (Description d : p.getDescriptions())
-            {
-                if (pt.description == null)
-                {
-                    pt.description = new ArrayList<DescriptionType>();
-                }
-                DescriptionType dt = new DescriptionType();
-                dt.lang = d.getLang();
-                dt.value = d.getDescription();
-                pt.description.add(dt);
-            }
-            target.initParam.add(pt);
-        }
-        for (Supports s : src.getSupports())
-        {
-            if (target.supports == null)
-            {
-                target.supports = new ArrayList<SupportsType>();
-            }
-            SupportsType st = new SupportsType();
-            st.mimeType = s.getMimeType();
-            for (String name : s.getPortletModes())
-            {
-                if (st.portletMode == null)
-                {
-                    st.portletMode = new ArrayList<String>();
-                }
-                st.portletMode.add(name);
-            }
-            target.supports.add(st);
-        }
-        for (String lang : src.getSupportedLocales())
-        {
-            if (target.supportedLocale == null)
-            {
-                target.supportedLocale = new ArrayList<String>();
-            }
-            target.supportedLocale.add(lang);
-        }
-        target.resourceBundle = src.getResourceBundle();
-        PortletInfoType pit = new PortletInfoType();
-        pit.title = src.getPortletInfo().getTitle();
-        pit.shortTitle = src.getPortletInfo().getShortTitle();
-        pit.keywords = src.getPortletInfo().getKeywords();
-        if (pit.title != null || pit.shortTitle != null || pit.keywords != null)
-        {
-            target.portletInfo = pit;
-        }
-        PortletPreferencesType ppt = new PortletPreferencesType();
-        ppt.preferencesValidator = src.getPortletPreferences().getPreferencesValidator();
-        for (Preference p : src.getPortletPreferences().getPortletPreferences())
-        {
-            if (ppt.preference == null)
-            {
-                ppt.preference = new ArrayList<PreferenceType>();                
-            }
-            PreferenceType pt = new PreferenceType();
-            pt.name = p.getName();
-            pt.readOnly = p.isReadOnly() ? Boolean.TRUE : null;
-            for (String value : p.getValues())
-            {
-                if (pt.value == null)
-                {
-                    pt.value = new ArrayList<String>();
-                }
-                pt.value.add(value);
-            }
-            ppt.preference.add(pt);
-        }
-        if (ppt.preferencesValidator != null || ppt.preference != null)
-        {
-            target.portletPreferences = ppt;
-        }
-        for (SecurityRoleRef srr : src.getSecurityRoleRefs())
-        {
-            if (target.securityRoleRef == null)
-            {
-                target.securityRoleRef = new ArrayList<SecurityRoleRefType>();                
-            }
-            SecurityRoleRefType srrt = new SecurityRoleRefType();
-            srrt.roleName = srr.getRoleName();
-            srrt.roleLink = srr.getRoleLink();
-            for (Description d : srr.getDescriptions())
-            {
-                if (srrt.description == null)
-                {
-                    srrt.description = new ArrayList<DescriptionType>();
-                }
-                DescriptionType dt = new DescriptionType();
-                dt.lang = d.getLang();
-                dt.value = d.getDescription();
-                srrt.description.add(dt);
-            }
-            target.securityRoleRef.add(srrt);
-        }
-    }
-    
-    private void upgradePortlet(PortletType src, PortletDefinition target)
-    {
-        if (src.description != null)
-        {
-            for (DescriptionType d : src.description)
-            {
-                Description desc = target.addDescription(d.lang);
-                desc.setDescription(d.value);
-            }
-        }
-        if (src.displayName != null)
-        {
-            for (DisplayNameType d : src.displayName)
-            {
-                DisplayName dname = target.addDisplayName(d.lang);
-                dname.setDisplayName(d.value);
-            }
-        }
-        target.setPortletClass(src.portletClass);
-        if (src.expirationCache != null)
-        {
-            target.setExpirationCache(src.expirationCache.intValue());
-        }
-        if (src.initParam != null)
-        {
-            for (InitParamType p : src.initParam)
-            {
-                InitParam param = target.addInitParam(p.name);
-                param.setParamValue(p.value);
-                if (p.description != null)
-                {
-                    for (DescriptionType d : p.description)
-                    {
-                        Description desc = param.addDescription(d.lang);
-                        desc.setDescription(d.value);
-                    }
-                }
-            }
-        }
-        if (src.supports != null)
-        {
-            for (SupportsType st : src.supports)
-            {
-                Supports s = target.addSupports(st.mimeType);
-                if (st.portletMode != null)
-                {
-                    for (String mode : st.portletMode)
-                    {
-                        s.addPortletMode(mode);
-                    }
-                }
-            }
-        }
-        if (src.supportedLocale != null)
-        {
-            for (String lang : src.supportedLocale)
-            {
-                target.addSupportedLocale(lang);
-            }
-        }
-        target.setResourceBundle(src.resourceBundle);
-        if (src.portletInfo != null)
-        {
-            PortletInfo pi = target.getPortletInfo();
-            pi.setTitle(src.portletInfo.title);
-            pi.setShortTitle(src.portletInfo.shortTitle);
-            pi.setKeywords(src.portletInfo.keywords);
-        }
-        if (src.portletPreferences != null)
-        {
-            Preferences prefs = target.getPortletPreferences();
-            prefs.setPreferencesValidator(src.portletPreferences.preferencesValidator);
-            if (src.portletPreferences.preference != null)
-            {
-                for (PreferenceType p : src.portletPreferences.preference)
-                {
-                    Preference pref = prefs.addPreference(p.name);
-                    if (p.value != null)
-                    {
-                        for (String value : p.value)
-                        {
-                            pref.addValue(value);
-                        }
-                    }
-                    if (p.readOnly != null)
-                    {
-                        pref.setReadOnly(p.readOnly.booleanValue());
-                    }
-                }
-            }
-        }
-        if (src.securityRoleRef != null)
-        {
-            for (SecurityRoleRefType rrt : src.securityRoleRef)
-            {
-                SecurityRoleRef srr = target.addSecurityRoleRef(rrt.roleName);
-                srr.setRoleLink(rrt.roleLink);
-                if (rrt.description != null)
-                {
-                    for (DescriptionType d : rrt.description)
-                    {
-                        Description desc = srr.addDescription(d.lang);
-                        desc.setDescription(d.value);
-                    }
-                }
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PortletCollectionType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PortletCollectionType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PortletCollectionType.java
deleted file mode 100644
index d404025..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PortletCollectionType.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet10.impl;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-/**
- * 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 <p>Java class for portlet-collectionType complex type. <p>The
- * following schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name="portlet-collectionType">
- *   &lt;complexContent>
- *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       &lt;sequence>
- *         &lt;element name="portlet-name" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}portlet-nameType" maxOccurs="unbounded"/>
- *       &lt;/sequence>
- *     &lt;/restriction>
- *   &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "portlet-collectionType", propOrder = { "portletName" })
-public class PortletCollectionType
-{
-    @XmlElement(name = "portlet-name", required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    List<String> portletName;
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PortletInfoType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PortletInfoType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PortletInfoType.java
deleted file mode 100644
index 00e622e..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PortletInfoType.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet10.impl;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-/**
- * <p>Java class for portlet-infoType complex type. <p>The following schema fragment specifies the expected content
- * contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;portlet-infoType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;title&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}titleType&quot;/&gt;
- *         &lt;element name=&quot;short-title&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}short-titleType&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;keywords&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}keywordsType&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "portlet-infoType", propOrder = { "title", "shortTitle", "keywords" })
-public class PortletInfoType
-{
-    @XmlElement(name = "title")
-    @XmlJavaTypeAdapter(value = CollapsedStringAdapter.class)
-    String title;
-    @XmlElement(name = "short-title")
-    @XmlJavaTypeAdapter(value = CollapsedStringAdapter.class)
-    String shortTitle;
-    @XmlElement(name = "keywords")
-    @XmlJavaTypeAdapter(value = CollapsedStringAdapter.class)
-    String keywords;
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PortletPreferencesType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PortletPreferencesType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PortletPreferencesType.java
deleted file mode 100644
index 3918f7f..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PortletPreferencesType.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet10.impl;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * Portlet persistent preference store. Used in: portlet <p>Java class for portlet-preferencesType complex type. <p>The
- * following schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name="portlet-preferencesType">
- *   &lt;complexContent>
- *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       &lt;sequence>
- *         &lt;element name="preference" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}preferenceType" maxOccurs="unbounded" minOccurs="0"/>
- *         &lt;element name="preferences-validator" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}preferences-validatorType" minOccurs="0"/>
- *       &lt;/sequence>
- *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     &lt;/restriction>
- *   &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "portlet-preferencesType", propOrder = { "preference", "preferencesValidator" })
-public class PortletPreferencesType
-{
-    @XmlElement(name = "preference")
-    List<PreferenceType> preference;
-    @XmlElement(name = "preferences-validator")
-    String preferencesValidator;
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PortletType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PortletType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PortletType.java
deleted file mode 100644
index 50c8b82..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PortletType.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet10.impl;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-/**
- * The portlet element contains the declarative data of a portlet. Used in: portlet-app <p>Java class for portletType
- * complex type. <p>The following schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;portletType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;portlet-name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}portlet-nameType&quot;/&gt;
- *         &lt;element name=&quot;display-name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}display-nameType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;portlet-class&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}portlet-classType&quot;/&gt;
- *         &lt;element name=&quot;init-param&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}init-paramType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;expiration-cache&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}expiration-cacheType&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;supports&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}supportsType&quot; maxOccurs=&quot;unbounded&quot;/&gt;
- *         &lt;element name=&quot;supported-locale&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}supported-localeType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;choice&gt;
- *           &lt;sequence&gt;
- *             &lt;element name=&quot;resource-bundle&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}resource-bundleType&quot;/&gt;
- *             &lt;element name=&quot;portlet-info&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}portlet-infoType&quot; minOccurs=&quot;0&quot;/&gt;
- *           &lt;/sequence&gt;
- *           &lt;element name=&quot;portlet-info&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}portlet-infoType&quot;/&gt;
- *         &lt;/choice&gt;
- *         &lt;element name=&quot;portlet-preferences&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}portlet-preferencesType&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;security-role-ref&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}security-role-refType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "portletType", propOrder = { "description", "portletName", "displayName", "portletClass", "initParam",
-                                            "expirationCache", "supports", "supportedLocale", "resourceBundle",
-                                            "portletInfo", "portletPreferences", "securityRoleRef" })
-public class PortletType
-{
-    @XmlElement(name = "description")
-    List<DescriptionType> description;
-    @XmlElement(name = "portlet-name", required = true)
-    @XmlJavaTypeAdapter(value = CollapsedStringAdapter.class)
-    String portletName;
-    @XmlElement(name = "display-name")
-    List<DisplayNameType> displayName;
-    @XmlElement(name = "portlet-class", required = true)
-    @XmlJavaTypeAdapter(value = CollapsedStringAdapter.class)
-    String portletClass;
-    @XmlElement(name = "init-param")
-    List<InitParamType> initParam;
-    @XmlElement(name = "expiration-cache")
-    Integer expirationCache;
-    @XmlElement(required = true)
-    List<SupportsType> supports;
-    @XmlElement(name = "supported-locale")
-    @XmlJavaTypeAdapter(value = CollapsedStringAdapter.class)
-    List<String> supportedLocale;
-    @XmlElement(name = "resource-bundle")
-    @XmlJavaTypeAdapter(value = CollapsedStringAdapter.class)
-    String resourceBundle;
-    @XmlElement(name = "portlet-info")
-    PortletInfoType portletInfo;
-    @XmlElement(name = "portlet-preferences")
-    PortletPreferencesType portletPreferences;
-    @XmlElement(name = "security-role-ref")
-    List<SecurityRoleRefType> securityRoleRef;
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PreferenceType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PreferenceType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PreferenceType.java
deleted file mode 100644
index 0c69c78..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/PreferenceType.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet10.impl;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-/**
- * Persistent preference values that may be used for customization and personalization by the portlet. Used in:
- * portlet-preferences <p>Java class for preferenceType complex type. <p>The following schema fragment specifies the
- * expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name="preferenceType">
- *   &lt;complexContent>
- *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       &lt;sequence>
- *         &lt;element name="name" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}nameType"/>
- *         &lt;element name="value" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}valueType" maxOccurs="unbounded" minOccurs="0"/>
- *         &lt;element name="read-only" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}read-onlyType" minOccurs="0"/>
- *       &lt;/sequence>
- *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     &lt;/restriction>
- *   &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "preferenceType", propOrder = { "name", "value", "readOnly" })
-public class PreferenceType
-{
-    @XmlElement(required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    String name;
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    List<String> value;
-    @XmlElement(name = "read-only")
-    Boolean readOnly;
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/SecurityConstraintType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/SecurityConstraintType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/SecurityConstraintType.java
deleted file mode 100644
index 68ee7ba..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/SecurityConstraintType.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet10.impl;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * The security-constraintType is used to associate intended security constraints with one or more portlets. Used in:
- * portlet-app <p>Java class for security-constraintType complex type. <p>The following schema fragment specifies the
- * expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name="security-constraintType">
- *   &lt;complexContent>
- *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       &lt;sequence>
- *         &lt;element name="display-name" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}display-nameType" maxOccurs="unbounded" minOccurs="0"/>
- *         &lt;element name="portlet-collection" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}portlet-collectionType"/>
- *         &lt;element name="user-data-constraint" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}user-data-constraintType"/>
- *       &lt;/sequence>
- *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     &lt;/restriction>
- *   &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "security-constraintType", propOrder = { "displayName", "portletCollection", "userDataConstraint" })
-public class SecurityConstraintType
-{
-    @XmlElement(name = "display-name")
-    List<DisplayNameType> displayName;
-    @XmlElement(name = "portlet-collection", required = true)
-    PortletCollectionType portletCollection;
-    @XmlElement(name = "user-data-constraint", required = true)
-    UserDataConstraintType userDataConstraint;
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/SecurityRoleRefType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/SecurityRoleRefType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/SecurityRoleRefType.java
deleted file mode 100644
index 319f1de..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/SecurityRoleRefType.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet10.impl;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-/**
- * 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 <p>Java class for security-role-refType complex type. <p>The following schema fragment specifies the
- * expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name="security-role-refType">
- *   &lt;complexContent>
- *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       &lt;sequence>
- *         &lt;element name="description" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}descriptionType" maxOccurs="unbounded" minOccurs="0"/>
- *         &lt;element name="role-name" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}role-nameType"/>
- *         &lt;element name="role-link" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}role-linkType" minOccurs="0"/>
- *       &lt;/sequence>
- *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     &lt;/restriction>
- *   &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- * 
- * @version $Id$
-*/
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "security-role-refType", propOrder = { "description", "roleName", "roleLink" })
-public class SecurityRoleRefType
-{
-    @XmlElement(name = "description")
-    List<DescriptionType> description;
-    @XmlElement(name = "role-name", required = true)
-    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
-    String roleName;
-    @XmlElement(name = "role-link")
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    String roleLink;
-}


[18/38] portals-pluto git commit: Fixed defects in portlet war deployment code

Posted by ms...@apache.org.
Fixed defects in portlet war deployment code


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/802dadb4
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/802dadb4
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/802dadb4

Branch: refs/heads/V3Prototype
Commit: 802dadb4624ab5e0969598c03933f5cc59e65545
Parents: 54db276
Author: Scott Nicklous <ms...@apache.org>
Authored: Tue Oct 27 12:39:51 2015 +0100
Committer: Scott Nicklous <ms...@apache.org>
Committed: Tue Oct 27 12:39:51 2015 +0100

----------------------------------------------------------------------
 pluto-container/pom.xml                         |   3 +
 .../om/portlet/impl/ConfigurationHolder.java    |  32 +-
 .../impl/JSR286ConfigurationProcessor.java      |   2 +-
 .../src/main/webapp/WEB-INF/portlet.xml         | 150 ++++-----
 .../util/assemble/file/FileAssemblerTest.java   | 210 ++++++------
 .../assemble/file/assembled.webServlet23.xml    | 125 +++++++
 .../util/assemble/file/portletWebServlet23.xml  | 325 +++++++++++++++++++
 .../pluto/util/assemble/file/webServlet23.xml   |  78 +++++
 8 files changed, 757 insertions(+), 168 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/802dadb4/pluto-container/pom.xml
----------------------------------------------------------------------
diff --git a/pluto-container/pom.xml b/pluto-container/pom.xml
index 26ed23b..e3129c0 100644
--- a/pluto-container/pom.xml
+++ b/pluto-container/pom.xml
@@ -128,6 +128,9 @@
                <instructions>
                   <Export-Package>org.apache.pluto.container.impl,
                      org.apache.pluto.container.om.portlet.impl,
+                     org.apache.pluto.container.om.portlet10.impl,
+                     org.apache.pluto.container.om.portlet20.impl,
+                     org.apache.pluto.container.om.portlet30.impl,
                      org.apache.pluto.container.util
                   </Export-Package>
                </instructions>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/802dadb4/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java
index bd0fcb1..f547bd2 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java
@@ -120,7 +120,37 @@ public class ConfigurationHolder {
    public void processPortletDD(InputStream stream)
          throws IOException, IllegalArgumentException, JAXBException, XMLStreamException {
 
-      JAXBContext cntxt = JAXBContext.newInstance(JAXB_CONTEXT);
+      if (isDebug) {
+         StringBuilder txt = new StringBuilder(128);
+         txt.append("Info about classloaders:");
+         ClassLoader mycl = this.getClass().getClassLoader();
+         ClassLoader jaxbcl = JAXBContext.class.getClassLoader();
+         ClassLoader ofcl = org.apache.pluto.container.om.portlet20.impl.ObjectFactory.class.getClassLoader();
+         ClassLoader syscl = null;
+         try {syscl = ClassLoader.getSystemClassLoader();} catch(Exception e) {}
+         txt.append("\nmy classloader: ").append((mycl != null) ? mycl.toString() : "null");
+         txt.append("\njaxb classloader: ").append((jaxbcl != null) ? jaxbcl.toString() : "null");
+         txt.append("\nof classloader: ").append((ofcl != null) ? ofcl.toString() : "null");
+         txt.append("\nsys classloader: ").append((syscl != null) ? syscl.toString() : "null");
+         Class<?> myof = null;
+         Class<?> jaxbof = null;
+         Class<?> ofof = null;
+         Class<?> sysof = null;
+         String clsName = "org.apache.pluto.container.om.portlet20.impl.ObjectFactory";
+         try {myof = mycl.loadClass(clsName);} catch(Exception e) {}
+         try {jaxbof = jaxbcl.loadClass(clsName);} catch(Exception e) {}
+         try {ofof = ofcl.loadClass(clsName);} catch(Exception e) {}
+         try {sysof = syscl.loadClass(clsName);} catch(Exception e) {}
+         txt.append("\nNow attempting to load: ").append(clsName);
+         txt.append("\nMycl loaded: ").append(myof != null);
+         txt.append("\nJaxbofcl loaded: ").append(jaxbof != null);
+         txt.append("\nOfcl loaded: ").append(ofof != null);
+         txt.append("\nSyscl loaded: ").append(sysof != null);
+         LOG.debug(txt.toString());
+      }
+      
+      ClassLoader mycl = this.getClass().getClassLoader();
+      JAXBContext cntxt = JAXBContext.newInstance(JAXB_CONTEXT, mycl);
 
       Unmarshaller um = cntxt.createUnmarshaller();
       XMLInputFactory xif = XMLInputFactory.newFactory();

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/802dadb4/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR286ConfigurationProcessor.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR286ConfigurationProcessor.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR286ConfigurationProcessor.java
index 0f32ad0..565efed 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR286ConfigurationProcessor.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR286ConfigurationProcessor.java
@@ -311,7 +311,7 @@ public class JSR286ConfigurationProcessor extends ConfigurationProcessor {
             if (pad.getPortlet(pname) == null) {
                String warning = "Bad FilterMapping definition. Portlet definition not found: " + pname;
                LOG.warn(warning);
-               throw new IllegalArgumentException(warning);
+//               throw new IllegalArgumentException(warning);
             }
             newitem.addPortletName(pname);
          }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/802dadb4/pluto-portal/src/main/webapp/WEB-INF/portlet.xml
----------------------------------------------------------------------
diff --git a/pluto-portal/src/main/webapp/WEB-INF/portlet.xml b/pluto-portal/src/main/webapp/WEB-INF/portlet.xml
index adb3c0a..4d0c433 100644
--- a/pluto-portal/src/main/webapp/WEB-INF/portlet.xml
+++ b/pluto-portal/src/main/webapp/WEB-INF/portlet.xml
@@ -1,75 +1,75 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-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.
--->
-<portlet-app
-    xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
-    version="1.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
-                        http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
-  
-  <portlet>
-    <description>AboutPortletDescription</description>
-    <portlet-name>AboutPortlet</portlet-name>
-    <display-name>About Portlet</display-name>
-    <portlet-class>org.apache.pluto.driver.portlets.AboutPortlet</portlet-class>
-    <supports>
-      <mime-type>text/html</mime-type>
-      <portlet-mode>VIEW</portlet-mode>
-      <portlet-mode>EDIT</portlet-mode>
-      <portlet-mode>HELP</portlet-mode>
-    </supports>
-    <portlet-info>
-      <title>About Apache Pluto</title>
-    </portlet-info>
-  </portlet>
-  
-  <portlet>
-    <description>AdminPortletDescription</description>
-    <portlet-name>AdminPortlet</portlet-name>
-    <display-name>Admin Portlet</display-name>
-    <portlet-class>org.apache.pluto.driver.portlets.AdminPortlet</portlet-class>
-    <supports>
-      <mime-type>text/html</mime-type>
-      <portlet-mode>VIEW</portlet-mode>
-      <portlet-mode>EDIT</portlet-mode>
-      <portlet-mode>HELP</portlet-mode>
-    </supports>
-    <portlet-info>
-      <title>Apache Pluto Portal Admin</title>
-    </portlet-info>
-  </portlet>
-
-    <portlet>
-        <description>Used to administer pluto pages</description>
-        <portlet-name>PlutoPageAdmin</portlet-name>
-        <display-name>Pluto Page Administration Portlet</display-name>
-        <portlet-class>org.apache.pluto.driver.portlets.PageAdminPortlet</portlet-class>
-        <supports>
-            <mime-type>text/html</mime-type>
-            <portlet-mode>VIEW</portlet-mode>
-            <portlet-mode>HELP</portlet-mode>
-        </supports>
-        <portlet-info>
-            <title>Pluto Page Administrator</title>
-        </portlet-info>
-    </portlet>  
-</portlet-app>
-
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+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.
+-->
+<portlet-app
+    xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+    version="2.0" 
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
+                        http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
+  
+  <portlet>
+    <description>AboutPortletDescription</description>
+    <portlet-name>AboutPortlet</portlet-name>
+    <display-name>About Portlet</display-name>
+    <portlet-class>org.apache.pluto.driver.portlets.AboutPortlet</portlet-class>
+    <supports>
+      <mime-type>text/html</mime-type>
+      <portlet-mode>VIEW</portlet-mode>
+      <portlet-mode>EDIT</portlet-mode>
+      <portlet-mode>HELP</portlet-mode>
+    </supports>
+    <portlet-info>
+      <title>About Apache Pluto</title>
+    </portlet-info>
+  </portlet>
+  
+  <portlet>
+    <description>AdminPortletDescription</description>
+    <portlet-name>AdminPortlet</portlet-name>
+    <display-name>Admin Portlet</display-name>
+    <portlet-class>org.apache.pluto.driver.portlets.AdminPortlet</portlet-class>
+    <supports>
+      <mime-type>text/html</mime-type>
+      <portlet-mode>VIEW</portlet-mode>
+      <portlet-mode>EDIT</portlet-mode>
+      <portlet-mode>HELP</portlet-mode>
+    </supports>
+    <portlet-info>
+      <title>Apache Pluto Portal Admin</title>
+    </portlet-info>
+  </portlet>
+
+    <portlet>
+        <description>Used to administer pluto pages</description>
+        <portlet-name>PlutoPageAdmin</portlet-name>
+        <display-name>Pluto Page Administration Portlet</display-name>
+        <portlet-class>org.apache.pluto.driver.portlets.PageAdminPortlet</portlet-class>
+        <supports>
+            <mime-type>text/html</mime-type>
+            <portlet-mode>VIEW</portlet-mode>
+            <portlet-mode>HELP</portlet-mode>
+        </supports>
+        <portlet-info>
+            <title>Pluto Page Administrator</title>
+        </portlet-info>
+    </portlet>  
+</portlet-app>
+
+

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/802dadb4/pluto-util/src/test/java/org/apache/pluto/util/assemble/file/FileAssemblerTest.java
----------------------------------------------------------------------
diff --git a/pluto-util/src/test/java/org/apache/pluto/util/assemble/file/FileAssemblerTest.java b/pluto-util/src/test/java/org/apache/pluto/util/assemble/file/FileAssemblerTest.java
index bbef8d1..f116d23 100644
--- a/pluto-util/src/test/java/org/apache/pluto/util/assemble/file/FileAssemblerTest.java
+++ b/pluto-util/src/test/java/org/apache/pluto/util/assemble/file/FileAssemblerTest.java
@@ -1,91 +1,119 @@
-/*
- * 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.
- */
-package org.apache.pluto.util.assemble.file;
-
-import java.io.File;
-import java.io.FileReader;
-import java.net.URL;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.pluto.util.assemble.AssemblerConfig;
-import org.apache.pluto.util.assemble.ResourceEntityResolver;
-import org.custommonkey.xmlunit.XMLTestCase;
-import org.custommonkey.xmlunit.XMLUnit;
-
-/**
- * @version $Revision$
- */
-public class FileAssemblerTest extends XMLTestCase {
-
-    private File webXmlFile;
-    private File portletXmlFile;
-    private File assembledWebXmlFile;
-
-    protected void setUp() throws Exception {
-        XMLUnit.setIgnoreWhitespace(true);
-        XMLUnit.setControlEntityResolver( new ResourceEntityResolver() );
-        XMLUnit.setTestEntityResolver( new ResourceEntityResolver() );
-
-        final URL webXmlUrl = this.getClass().getResource("/org/apache/pluto/util/assemble/file/web.xml");
-        this.webXmlFile = new File(webXmlUrl.getFile());
-
-        final URL portletXmlUrl = this.getClass().getResource("/org/apache/pluto/util/assemble/file/portlet.xml");
-        this.portletXmlFile = new File(portletXmlUrl.getFile());
-
-        final URL assembledWebXmlUrl = this.getClass().getResource("/org/apache/pluto/util/assemble/file/assembled.web.xml");
-        this.assembledWebXmlFile = new File(assembledWebXmlUrl.getFile());
-    }
-
-    protected void tearDown() throws Exception {
-        this.webXmlFile = null;
-        this.portletXmlFile = null;
-    }
-
-    public void testAssembleToNewDirectory() throws Exception {
-        AssemblerConfig config = new AssemblerConfig();
-
-        final File webXmlFileDest = File.createTempFile(this.webXmlFile.getName() + ".", ".xml");
-        webXmlFileDest.deleteOnExit();
-
-        config.setWebappDescriptor(this.webXmlFile);
-        config.setPortletDescriptor(this.portletXmlFile);
-        config.setDestination(webXmlFileDest);
-
-        FileAssembler assembler = new FileAssembler();
-        assembler.assemble(config);
-
-        assertXMLEqual(new FileReader(this.assembledWebXmlFile), new FileReader(webXmlFileDest));
-    }
-
-    public void testAssembleOverSelf() throws Exception {
-        AssemblerConfig config = new AssemblerConfig();
-
-        final File webXmlFileCopy = File.createTempFile(this.webXmlFile.getName() + ".", ".source.xml");
-        webXmlFileCopy.deleteOnExit();
-
-        FileUtils.copyFile(this.webXmlFile, webXmlFileCopy);
-
-        config.setWebappDescriptor(webXmlFileCopy);
-        config.setPortletDescriptor(this.portletXmlFile);
-        config.setDestination(webXmlFileCopy);
-
-        FileAssembler assembler = new FileAssembler();
-        assembler.assemble(config);
-
-        assertXMLEqual(new FileReader(this.assembledWebXmlFile), new FileReader(webXmlFileCopy));
-    }
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.util.assemble.file;
+
+import java.io.File;
+import java.io.FileReader;
+import java.net.URL;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.pluto.util.assemble.AssemblerConfig;
+import org.apache.pluto.util.assemble.ResourceEntityResolver;
+import org.custommonkey.xmlunit.XMLTestCase;
+import org.custommonkey.xmlunit.XMLUnit;
+
+/**
+ * @version $Revision$
+ */
+public class FileAssemblerTest extends XMLTestCase {
+
+    private File webXmlFile;
+    private File web23XmlFile;
+    private File portletXmlFile;
+    private File portlet23XmlFile;
+    private File assembledWebXmlFile;
+    private File assembledWeb23XmlFile;
+
+    protected void setUp() throws Exception {
+        XMLUnit.setIgnoreWhitespace(true);
+        XMLUnit.setControlEntityResolver( new ResourceEntityResolver() );
+        XMLUnit.setTestEntityResolver( new ResourceEntityResolver() );
+
+        final URL webXmlUrl = this.getClass().getResource("/org/apache/pluto/util/assemble/file/web.xml");
+        this.webXmlFile = new File(webXmlUrl.getFile());
+
+        final URL web23XmlUrl = this.getClass().getResource("/org/apache/pluto/util/assemble/file/webServlet23.xml");
+        this.web23XmlFile = new File(web23XmlUrl.getFile());
+
+        final URL portletXmlUrl = this.getClass().getResource("/org/apache/pluto/util/assemble/file/portlet.xml");
+        this.portletXmlFile = new File(portletXmlUrl.getFile());
+
+        final URL portlet23XmlUrl = this.getClass().getResource("/org/apache/pluto/util/assemble/file/portletWebServlet23.xml");
+        this.portlet23XmlFile = new File(portlet23XmlUrl.getFile());
+
+        final URL assembledWebXmlUrl = this.getClass().getResource("/org/apache/pluto/util/assemble/file/assembled.web.xml");
+        this.assembledWebXmlFile = new File(assembledWebXmlUrl.getFile());
+
+        final URL assembledWeb23XmlUrl = this.getClass().getResource("/org/apache/pluto/util/assemble/file/assembled.webServlet23.xml");
+        this.assembledWeb23XmlFile = new File(assembledWeb23XmlUrl.getFile());
+    }
+
+    protected void tearDown() throws Exception {
+        this.webXmlFile = null;
+        this.portletXmlFile = null;
+    }
+
+    public void testAssembleToNewDirectory() throws Exception {
+        AssemblerConfig config = new AssemblerConfig();
+
+        final File webXmlFileDest = File.createTempFile(this.webXmlFile.getName() + ".", ".xml");
+        webXmlFileDest.deleteOnExit();
+
+        config.setWebappDescriptor(this.webXmlFile);
+        config.setPortletDescriptor(this.portletXmlFile);
+        config.setDestination(webXmlFileDest);
+
+        FileAssembler assembler = new FileAssembler();
+        assembler.assemble(config);
+
+        assertXMLEqual(new FileReader(this.assembledWebXmlFile), new FileReader(webXmlFileDest));
+    }
+
+    public void testAssembleWeb23ToNewDirectory() throws Exception {
+        AssemblerConfig config = new AssemblerConfig();
+
+        final File webXmlFileDest = File.createTempFile(this.web23XmlFile.getName() + ".", ".xml");
+        webXmlFileDest.deleteOnExit();
+
+        config.setWebappDescriptor(this.web23XmlFile);
+        config.setPortletDescriptor(this.portlet23XmlFile);
+        config.setDestination(webXmlFileDest);
+
+        FileAssembler assembler = new FileAssembler();
+        assembler.assemble(config);
+
+        assertXMLEqual(new FileReader(this.assembledWeb23XmlFile), new FileReader(webXmlFileDest));
+    }
+
+    public void testAssembleOverSelf() throws Exception {
+        AssemblerConfig config = new AssemblerConfig();
+
+        final File webXmlFileCopy = File.createTempFile(this.webXmlFile.getName() + ".", ".source.xml");
+        webXmlFileCopy.deleteOnExit();
+
+        FileUtils.copyFile(this.webXmlFile, webXmlFileCopy);
+
+        config.setWebappDescriptor(webXmlFileCopy);
+        config.setPortletDescriptor(this.portletXmlFile);
+        config.setDestination(webXmlFileCopy);
+
+        FileAssembler assembler = new FileAssembler();
+        assembler.assemble(config);
+
+        assertXMLEqual(new FileReader(this.assembledWebXmlFile), new FileReader(webXmlFileCopy));
+    }
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/802dadb4/pluto-util/src/test/resources/org/apache/pluto/util/assemble/file/assembled.webServlet23.xml
----------------------------------------------------------------------
diff --git a/pluto-util/src/test/resources/org/apache/pluto/util/assemble/file/assembled.webServlet23.xml b/pluto-util/src/test/resources/org/apache/pluto/util/assemble/file/assembled.webServlet23.xml
new file mode 100644
index 0000000..65830e3
--- /dev/null
+++ b/pluto-util/src/test/resources/org/apache/pluto/util/assemble/file/assembled.webServlet23.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+--><!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+  
+  <display-name>Pluto Testsuite</display-name>
+  
+  <context-param>
+    <param-name>test-parameter-name</param-name>
+    <param-value>test-parameter-val</param-value>
+  </context-param>
+  
+  <context-param>
+    <param-name>parameter-name</param-name>
+    <param-value>parameter-value</param-value>
+  </context-param>
+  
+  <!-- Companion Servlet Definitions ======================================= -->
+  
+  <servlet>
+    <servlet-name>ExternalAppScopedAttributeTest_Servlet</servlet-name>
+    <servlet-class>org.apache.pluto.testsuite.test.ExternalAppScopedAttributeTest$CompanionServlet</servlet-class>
+  </servlet>
+  
+  <servlet>
+    <servlet-name>DispatcherRenderParameterTest_Servlet</servlet-name>
+    <servlet-class>org.apache.pluto.testsuite.test.DispatcherRenderParameterTest$CompanionServlet</servlet-class>
+  </servlet>
+  
+  <servlet>
+    <servlet-name>DispatcherRequestTest_Servlet</servlet-name>
+    <servlet-class>org.apache.pluto.testsuite.test.DispatcherRequestTest$CompanionServlet</servlet-class>
+  </servlet>
+<servlet>
+<servlet-name>TestPortlet1</servlet-name>
+<servlet-class>org.apache.pluto.container.driver.PortletServlet</servlet-class>
+<init-param>
+<param-name>portlet-name</param-name>
+<param-value>TestPortlet1</param-value>
+</init-param>
+<load-on-startup>1</load-on-startup>
+</servlet>
+<servlet>
+<servlet-name>TestPortlet2</servlet-name>
+<servlet-class>org.apache.pluto.container.driver.PortletServlet</servlet-class>
+<init-param>
+<param-name>portlet-name</param-name>
+<param-value>TestPortlet2</param-value>
+</init-param>
+<load-on-startup>1</load-on-startup>
+</servlet>
+<servlet>
+<servlet-name>286TestPortlet</servlet-name>
+<servlet-class>org.apache.pluto.container.driver.PortletServlet</servlet-class>
+<init-param>
+<param-name>portlet-name</param-name>
+<param-value>286TestPortlet</param-value>
+</init-param>
+<load-on-startup>1</load-on-startup>
+</servlet>
+<servlet>
+<servlet-name>286TestCompanionPortlet</servlet-name>
+<servlet-class>org.apache.pluto.container.driver.PortletServlet</servlet-class>
+<init-param>
+<param-name>portlet-name</param-name>
+<param-value>286TestCompanionPortlet</param-value>
+</init-param>
+<load-on-startup>1</load-on-startup>
+</servlet>
+  
+  
+  <!-- Companion Servlet Mappings ========================================== -->
+  
+  <servlet-mapping>
+    <servlet-name>ExternalAppScopedAttributeTest_Servlet</servlet-name>
+    <url-pattern>/test/ExternalAppScopedAttributeTest_Servlet</url-pattern>
+  </servlet-mapping>
+  
+  <servlet-mapping>
+    <servlet-name>DispatcherRenderParameterTest_Servlet</servlet-name>
+    <url-pattern>/test/DispatcherRenderParameterTest_Servlet</url-pattern>
+  </servlet-mapping>
+  
+  <servlet-mapping>
+    <servlet-name>DispatcherRequestTest_Servlet</servlet-name>
+    <url-pattern>/test/DispatcherRequestTest_Servlet/*</url-pattern>
+  </servlet-mapping>
+<servlet-mapping>
+<servlet-name>TestPortlet1</servlet-name>
+<url-pattern>/PlutoInvoker/TestPortlet1</url-pattern>
+</servlet-mapping>
+<servlet-mapping>
+<servlet-name>TestPortlet2</servlet-name>
+<url-pattern>/PlutoInvoker/TestPortlet2</url-pattern>
+</servlet-mapping>
+<servlet-mapping>
+<servlet-name>286TestPortlet</servlet-name>
+<url-pattern>/PlutoInvoker/286TestPortlet</url-pattern>
+</servlet-mapping>
+<servlet-mapping>
+<servlet-name>286TestCompanionPortlet</servlet-name>
+<url-pattern>/PlutoInvoker/286TestCompanionPortlet</url-pattern>
+</servlet-mapping>
+  
+  <security-role>
+    <role-name>tomcat</role-name>
+  </security-role>
+  
+</web-app>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/802dadb4/pluto-util/src/test/resources/org/apache/pluto/util/assemble/file/portletWebServlet23.xml
----------------------------------------------------------------------
diff --git a/pluto-util/src/test/resources/org/apache/pluto/util/assemble/file/portletWebServlet23.xml b/pluto-util/src/test/resources/org/apache/pluto/util/assemble/file/portletWebServlet23.xml
new file mode 100644
index 0000000..48ef23f
--- /dev/null
+++ b/pluto-util/src/test/resources/org/apache/pluto/util/assemble/file/portletWebServlet23.xml
@@ -0,0 +1,325 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+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.
+-->
+<!-- FIXME: schema location points to temp location of portlet spec -->
+<portlet-app
+    xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+    version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
+                        http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
+  
+  <!-- Test Portlet #1 ===================================================== -->
+  
+  <portlet>
+    
+    <description>TestSuiteDescription</description>
+    <portlet-name>TestPortlet1</portlet-name>
+    <display-name>Test Portlet #1</display-name>
+    <portlet-class>org.apache.pluto.testsuite.TestPortlet</portlet-class>
+    
+    <init-param>
+      <name>config</name>
+      <value>/WEB-INF/testsuite-config.xml</value>
+    </init-param>
+    <init-param>
+      <name>dummyName</name>
+      <value>dummyValue</value>
+    </init-param>
+    
+    <expiration-cache>-1</expiration-cache>
+    
+    <supports>
+      <mime-type>text/html</mime-type>
+      <portlet-mode>VIEW</portlet-mode>
+      <portlet-mode>EDIT</portlet-mode>
+      <portlet-mode>HELP</portlet-mode>
+    </supports>
+    
+    <supported-locale>en</supported-locale>        
+    <supported-locale>de</supported-locale>
+    
+    <portlet-info>
+      <title>Test Portlet #1</title>
+      <short-title>Test #1</short-title>
+      <keywords>Test,Testing</keywords>
+    </portlet-info>
+    
+    <portlet-preferences>
+      <preference>
+        <name>dummyName</name>
+        <value>dummyValue</value>
+        <read-only>false</read-only>
+      </preference>
+      <preference>
+        <name>dummyName2</name>
+        <value>dummyValue2</value>
+      </preference>
+      <preference>
+        <name>readonly</name>
+        <value>readonly</value>
+        <read-only>true</read-only>
+      </preference>
+      <preference>
+        <name>nameWithNoValue</name>
+      </preference>
+      <preferences-validator>org.apache.pluto.testsuite.validator.PreferencesValidatorImpl</preferences-validator>
+    </portlet-preferences>
+    
+    <security-role-ref>
+      <role-name>plutoTestRole</role-name>
+      <role-link>tomcat</role-link>
+    </security-role-ref>
+  
+  </portlet>
+  
+  
+  
+  <!-- Test Portlet #2 ===================================================== -->
+  
+   <portlet>
+    
+    <description>TestSuiteDescription</description>
+    <portlet-name>TestPortlet2</portlet-name>
+    <display-name>Test Portlet #2</display-name>
+    <portlet-class>org.apache.pluto.testsuite.TestPortlet</portlet-class>
+    
+    <init-param>
+      <name>config</name>
+      <value>/WEB-INF/testsuite-2-config.xml</value>
+    </init-param>
+    <init-param>
+      <name>dummyName</name>
+      <value>dummyValue</value>
+    </init-param>
+    
+    <expiration-cache>-1</expiration-cache>
+    
+    <supports>
+      <mime-type>text/html</mime-type>
+      <portlet-mode>VIEW</portlet-mode>
+      <portlet-mode>EDIT</portlet-mode>
+      <portlet-mode>HELP</portlet-mode>
+    </supports>
+    
+    <supported-locale>en</supported-locale>
+    <supported-locale>de</supported-locale>
+    <resource-bundle>TestPortlet</resource-bundle>
+    
+    <portlet-preferences >
+      <preference>
+        <name>dummyName</name>
+        <value>dummyValue</value>
+        <read-only>false</read-only>
+      </preference>
+      <preference>
+        <name>dummyName2</name>
+        <value>dummyValue2</value>
+      </preference>
+      <preference>
+        <name>readonly</name>
+        <value>readonly</value>
+        <read-only>true</read-only>
+      </preference>
+      <preference>
+        <name>nameWithNoValue</name>
+      </preference>
+      <preferences-validator>org.apache.pluto.testsuite.validator.PreferencesValidatorImpl2</preferences-validator>
+    </portlet-preferences>
+    
+    <security-role-ref>
+      <role-name>plutoTestRole</role-name>
+      <role-link>tomcat</role-link>
+    </security-role-ref>
+    
+  </portlet>
+
+  <!-- JSR 286 Compatibility Test Portlet -->
+  
+  <portlet>
+    
+    <description>JSR 286 Compatibility Tests</description>
+    <portlet-name>286TestPortlet</portlet-name>
+    <display-name>JSR 286 Test Portlet</display-name>
+    <portlet-class>org.apache.pluto.testsuite.TestPortlet</portlet-class>
+    
+    <init-param>
+      <name>config</name>
+      <value>/WEB-INF/testsuite-286-config.xml</value>
+    </init-param>
+    
+    <expiration-cache>-1</expiration-cache>
+    
+    <supports>
+      <mime-type>text/html</mime-type>
+      <portlet-mode>VIEW</portlet-mode>
+      <portlet-mode>EDIT</portlet-mode>
+      <portlet-mode>HELP</portlet-mode>
+    </supports>
+        
+    <portlet-info>
+      <title>286 Test Portlet</title>
+      <short-title>286 Tests</short-title>
+      <keywords>JSR 286,Tests</keywords>
+    </portlet-info>
+    
+    <supported-processing-event>
+      <name>trigger-event-phase</name>
+    </supported-processing-event>
+
+    <supported-processing-event>
+      <name>event-with-complex-value</name>
+    </supported-processing-event>
+    
+    <supported-processing-event>
+      <name>event-with-simple-value</name>
+    </supported-processing-event>
+    
+    <supported-publishing-event>
+      <name>trigger-event-phase</name>
+    </supported-publishing-event>
+    
+    <supported-publishing-event>
+      <name>event-with-simple-value</name>
+    </supported-publishing-event>
+    
+    <supported-publishing-event>
+      <name>event-with-complex-value</name>
+    </supported-publishing-event>
+
+   <supported-publishing-event>
+      <qname xmlns:pluto="http://portals.apache.org/pluto/altns">event-with-qname</qname>
+   </supported-publishing-event>
+    
+    <supported-public-render-parameter>public-render-param1</supported-public-render-parameter>
+
+  </portlet>
+
+  <portlet>
+    
+    <description>JSR 286 Test Portlet Companion</description>
+    <portlet-name>286TestCompanionPortlet</portlet-name>
+    <portlet-class>
+        org.apache.pluto.testsuite.test.jsr286.TestCompanionPortlet
+    </portlet-class>
+    
+    <supports>
+      <mime-type>text/html</mime-type>
+      <portlet-mode>VIEW</portlet-mode>
+    </supports>
+    
+    <portlet-info>
+      <title>286 Test Portlet Companion</title>
+      <short-title>286 Test Companion</short-title>
+      <keywords>JSR 286,Tests</keywords>
+    </portlet-info>
+    
+    <supported-processing-event>
+      <name>event-with-simple-value</name>
+    </supported-processing-event>
+    
+    <supported-processing-event>
+      <name>event-with-complex-value</name>
+    </supported-processing-event>
+
+   <supported-processing-event>
+      <qname xmlns:pluto="http://portals.apache.org/pluto/altns">event-with-qname</qname>
+   </supported-processing-event>
+    
+    <supported-public-render-parameter>public-render-param1</supported-public-render-parameter>
+
+  </portlet>
+
+  <filter>
+  
+    <description>
+        This filter should be applied both the JSR 286
+        test portlet as well as its helper portlet.
+    </description>
+    
+    <display-name>Wildcard Mapped Filter</display-name>
+      
+    <filter-name>WildcardMappedFilter</filter-name>
+    <filter-class>org.apache.pluto.testsuite.test.jsr286.filter.WildcardMappedFilter</filter-class>
+    
+    <lifecycle>ACTION_PHASE</lifecycle>
+    <lifecycle>RENDER_PHASE</lifecycle>
+    <lifecycle>EVENT_PHASE</lifecycle>
+    <lifecycle>RESOURCE_PHASE</lifecycle>
+  
+  </filter>
+
+  <filter>
+    
+    <description>
+        This filter implements portlet filter methods for all four
+        lifecycle phases and is used in the various portlet filter tests.
+    </description>
+    
+    <display-name>Test Portlet Filter</display-name>
+    
+    <filter-name>TestFilter</filter-name>
+    <filter-class>org.apache.pluto.testsuite.test.jsr286.filter.TestFilter</filter-class>
+  
+    <lifecycle>ACTION_PHASE</lifecycle>
+    <lifecycle>RENDER_PHASE</lifecycle>
+    <lifecycle>EVENT_PHASE</lifecycle>
+    <lifecycle>RESOURCE_PHASE</lifecycle>
+    
+  </filter>
+
+  <filter-mapping>
+    <filter-name>WildcardMappedFilter</filter-name>
+    <portlet-name>286*</portlet-name>
+  </filter-mapping>
+
+  <filter-mapping>
+    <filter-name>TestFilter</filter-name>
+    <portlet-name>286TestPortlet</portlet-name>
+  </filter-mapping>
+
+  <!-- JSR 286 Portlet Coordination Definitions -->
+
+  <default-namespace>http://portals.apache.org/pluto/testsuite</default-namespace>
+  
+  <event-definition>
+   <name>trigger-event-phase</name>
+   <value-type>java.lang.String</value-type>
+  </event-definition>
+
+  <event-definition>
+    <name>event-with-simple-value</name>
+    <value-type>java.lang.String</value-type>
+  </event-definition>
+
+  <event-definition>
+    <name>event-with-complex-value</name>
+    <value-type>org.apache.pluto.testsuite.test.jsr286.event.ComposedObject</value-type>
+  </event-definition>
+  
+  <event-definition>
+   <qname xmlns:pluto="http://portals.apache.org/pluto/altns">event-with-qname</qname>
+   <value-type>java.lang.Integer</value-type>   
+  </event-definition>
+
+  <public-render-parameter>
+   <identifier>public-render-param1</identifier>
+   <qname xmlns:pluto="http://portals.apache.org/pluto/altns">public-render-param1</qname>
+  </public-render-parameter>
+
+</portlet-app>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/802dadb4/pluto-util/src/test/resources/org/apache/pluto/util/assemble/file/webServlet23.xml
----------------------------------------------------------------------
diff --git a/pluto-util/src/test/resources/org/apache/pluto/util/assemble/file/webServlet23.xml b/pluto-util/src/test/resources/org/apache/pluto/util/assemble/file/webServlet23.xml
new file mode 100644
index 0000000..f3eefa2
--- /dev/null
+++ b/pluto-util/src/test/resources/org/apache/pluto/util/assemble/file/webServlet23.xml
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!DOCTYPE web-app PUBLIC
+    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+    "http://java.sun.com/dtd/web-app_2_3.dtd">
+<!--
+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.
+-->
+<web-app>
+  
+  <display-name>Pluto Testsuite</display-name>
+  
+  <context-param>
+    <param-name>test-parameter-name</param-name>
+    <param-value>test-parameter-val</param-value>
+  </context-param>
+  
+  <context-param>
+    <param-name>parameter-name</param-name>
+    <param-value>parameter-value</param-value>
+  </context-param>
+  
+  <!-- Companion Servlet Definitions ======================================= -->
+  
+  <servlet>
+    <servlet-name>ExternalAppScopedAttributeTest_Servlet</servlet-name>
+    <servlet-class>org.apache.pluto.testsuite.test.ExternalAppScopedAttributeTest$CompanionServlet</servlet-class>
+  </servlet>
+  
+  <servlet>
+    <servlet-name>DispatcherRenderParameterTest_Servlet</servlet-name>
+    <servlet-class>org.apache.pluto.testsuite.test.DispatcherRenderParameterTest$CompanionServlet</servlet-class>
+  </servlet>
+  
+  <servlet>
+    <servlet-name>DispatcherRequestTest_Servlet</servlet-name>
+    <servlet-class>org.apache.pluto.testsuite.test.DispatcherRequestTest$CompanionServlet</servlet-class>
+  </servlet>
+  
+  
+  <!-- Companion Servlet Mappings ========================================== -->
+  
+  <servlet-mapping>
+    <servlet-name>ExternalAppScopedAttributeTest_Servlet</servlet-name>
+    <url-pattern>/test/ExternalAppScopedAttributeTest_Servlet</url-pattern>
+  </servlet-mapping>
+  
+  <servlet-mapping>
+    <servlet-name>DispatcherRenderParameterTest_Servlet</servlet-name>
+    <url-pattern>/test/DispatcherRenderParameterTest_Servlet</url-pattern>
+  </servlet-mapping>
+  
+  <servlet-mapping>
+    <servlet-name>DispatcherRequestTest_Servlet</servlet-name>
+    <url-pattern>/test/DispatcherRequestTest_Servlet/*</url-pattern>
+  </servlet-mapping>
+  
+  <security-role>
+    <role-name>tomcat</role-name>
+  </security-role>
+  
+</web-app>
+


[35/38] portals-pluto git commit: completed implementation of header phase.

Posted by ms...@apache.org.
completed implementation of header phase.


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/d11dcc5a
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/d11dcc5a
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/d11dcc5a

Branch: refs/heads/V3Prototype
Commit: d11dcc5a9706720e36c3c4c19a6c1310e1608b43
Parents: 8f9bca1
Author: Scott Nicklous <ms...@apache.org>
Authored: Wed Nov 25 15:28:10 2015 +0100
Committer: Scott Nicklous <ms...@apache.org>
Committed: Wed Nov 25 15:28:10 2015 +0100

----------------------------------------------------------------------
 .../main/java/basic/portlet/HeaderPortlet.java  |  17 +-
 .../src/main/webapp/WEB-INF/jsp/view-hdp.jsp    |   7 +-
 pluto-container-api/pom.xml                     | 107 +++---
 .../org/apache/pluto/container/HeaderData.java  | 297 +++++++++++++++-
 .../container/impl/PortletResponseImpl.java     |   7 +-
 .../PortletMimeResponseContextImpl.java         | 348 ++++++++++---------
 .../container/PortletResponseContextImpl.java   | 157 ++++-----
 .../pluto/driver/PortalDriverServlet.java       |  18 +
 .../main/java/javax/portlet/GenericPortlet.java |   1 -
 .../main/java/javax/portlet/PortletRequest.java |   2 +
 10 files changed, 634 insertions(+), 327 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/d11dcc5a/PortletV3Demo/src/main/java/basic/portlet/HeaderPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/HeaderPortlet.java b/PortletV3Demo/src/main/java/basic/portlet/HeaderPortlet.java
index 3270287..03cb0bc 100644
--- a/PortletV3Demo/src/main/java/basic/portlet/HeaderPortlet.java
+++ b/PortletV3Demo/src/main/java/basic/portlet/HeaderPortlet.java
@@ -41,6 +41,7 @@ import javax.portlet.RenderResponse;
 import javax.portlet.RenderURL;
 import javax.portlet.ResourceRequest;
 import javax.portlet.ResourceResponse;
+import javax.servlet.http.Cookie;
 
 import org.w3c.dom.Element;
 
@@ -58,7 +59,7 @@ public class HeaderPortlet extends GenericPortlet {
    @Override
    public void renderHeaders(HeaderRequest req, HeaderResponse resp) throws PortletException, IOException {
       
-      if (LOGGER.isLoggable(Level.FINE)) {
+      if (isDebug) {
          StringBuilder txt = new StringBuilder(128);
          txt.append("Doing the headers. ");
          txt.append("portal ctx prop names: ");
@@ -77,13 +78,25 @@ public class HeaderPortlet extends GenericPortlet {
       String contextRoot = req.getContextPath();
       link.setAttribute("href", contextRoot + "/resources/css/styles.css");
       resp.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, link);
+      
+      // Add cookies
+      Cookie c = new Cookie(this.getPortletName(), "something special");
+      c.setMaxAge(60);
+      resp.addProperty(c);
+      c = new Cookie("Author", "Scott");
+      c.setComment("test cookie");
+      resp.addProperty(c);
+
+      // Set header
+      resp.setProperty("Portlet", this.getPortletName());
+      resp.setProperty("Portal", "Pluto");
 
    }
 
    @Override
    protected void doView(RenderRequest req, RenderResponse resp) throws PortletException, IOException {
       
-      if (LOGGER.isLoggable(Level.FINE)) {
+      if (isDebug) {
          StringBuilder txt = new StringBuilder(128);
          txt.append("Rendering. ");
          txt.append("RENDER_PART: ");

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/d11dcc5a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-hdp.jsp
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-hdp.jsp b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-hdp.jsp
index 95d4e44..71deb87 100644
--- a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-hdp.jsp
+++ b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-hdp.jsp
@@ -27,6 +27,11 @@ limitations under the License.
 <h3>V3 Header Portlet</h3><hr/>
 <p>
 Portlet to demo the V3 header request functionality. The portlet uses a CSS class that sets a border and
-background color.
+background color. The corresponding style sheet is set through the PortletResponse#addProperty(String, Element)
+method. 
+</p>
+<p>
+Character encoding: <%=renderResponse.getCharacterEncoding() %>, 
+Content type: <%=renderResponse.getContentType() %>
 </p>
 </div>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/d11dcc5a/pluto-container-api/pom.xml
----------------------------------------------------------------------
diff --git a/pluto-container-api/pom.xml b/pluto-container-api/pom.xml
index 0adb571..d976f2a 100644
--- a/pluto-container-api/pom.xml
+++ b/pluto-container-api/pom.xml
@@ -1,56 +1,57 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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.portals.pluto</groupId>
-    <artifactId>pluto</artifactId>
-    <version>3.0-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>pluto-container-api</artifactId>
-  <packaging>bundle</packaging>
-  <name>Apache Pluto Container API</name>
-
-  <dependencies>
-    <!-- Specification Libraries =========================================== -->
-    <dependency>
+<!-- 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.portals.pluto</groupId>
-      <artifactId>portlet-api</artifactId>
-      <version>${project.version}</version>
-      <scope>provided</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.tomcat</groupId>
-      <artifactId>tomcat-servlet-api</artifactId>
-      <scope>provided</scope>
-    </dependency>
-
-    <!--  CCPP Libraries -->
-    <dependency>
-      <groupId>javax.ccpp</groupId>
-      <artifactId>ccpp</artifactId>
-      <scope>provided</scope>
-    </dependency>
-
-  </dependencies>
+      <artifactId>pluto</artifactId>
+      <version>3.0-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>pluto-container-api</artifactId>
+   <packaging>bundle</packaging>
+   <name>Apache Pluto Container API</name>
+
+   <dependencies>
+      <!-- Specification Libraries =========================================== -->
+      <dependency>
+         <groupId>org.apache.portals.pluto</groupId>
+         <artifactId>portlet-api</artifactId>
+         <version>${project.version}</version>
+         <scope>provided</scope>
+      </dependency>
+
+      <dependency>
+         <groupId>org.apache.tomcat</groupId>
+         <artifactId>tomcat-servlet-api</artifactId>
+         <scope>provided</scope>
+      </dependency>
+
+      <!-- CCPP Libraries -->
+      <dependency>
+         <groupId>javax.ccpp</groupId>
+         <artifactId>ccpp</artifactId>
+         <scope>provided</scope>
+      </dependency>
+
+      <!-- Other Support Libraries =========================================== -->
+      <dependency>
+         <groupId>org.slf4j</groupId>
+         <artifactId>slf4j-api</artifactId>
+         <scope>provided</scope>
+      </dependency>
+
+   </dependencies>
 </project>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/d11dcc5a/pluto-container-api/src/main/java/org/apache/pluto/container/HeaderData.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/HeaderData.java b/pluto-container-api/src/main/java/org/apache/pluto/container/HeaderData.java
index 8283739..b7a7756 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/HeaderData.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/HeaderData.java
@@ -16,27 +16,304 @@
  *  under the License.
  */
 
-
 package org.apache.pluto.container;
 
+import java.io.ByteArrayOutputStream;
+import java.io.PrintWriter;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.servlet.http.Cookie;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.DOMException;
+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;
+
 /**
- * This class is a holder for the HTTP header data, cookies, and header section markup 
- * provided by the portlet during header phase execution. 
+ * This class is a holder for the HTTP header data, cookies, and header section markup provided by the portlet during
+ * header phase execution. Handles
  * 
  * @author Scott Nicklous
- *
+ * 
  */
 public class HeaderData {
 
-   private String headSectionMarkup = "";
+   /** Logger. */
+   private static final Logger       LOG                = LoggerFactory.getLogger(HeaderData.class);
+   private static final boolean      isDebug            = LOG.isDebugEnabled();
+
+   // for document processing
+   private DocumentBuilder           docBuilder         = null;
+   private Document                  doc                = null;
+   private Element                   root               = null;
+   private static final String       ROOT_ELEMENT       = "rootElement";
+   private static final String       ROOT_ELEMENT_START = "<rootElement>";
+   private static final String       ROOT_ELEMENT_END   = "</rootElement>";
+   private static final String       ROOT_ELEMENT_REGEX = "(?:\\s*)</{0,1}" + ROOT_ELEMENT + ">(?:\\s*)";
+
+   private static final Set<String>  allowedTags        = new HashSet<String>(Arrays.asList(new String[] { "META",
+         "LINK", "STYLE", "SCRIPT", "NOSCRIPT"         }));
+
+   private List<Cookie>              cookies            = new ArrayList<Cookie>();
+   private Map<String, List<String>> httpHeaders        = new HashMap<String, List<String>>();
+   private int                       bufferSize         = 128;
+   private ByteArrayOutputStream     baoStream          = null;
+   private StringWriter              sWriter            = null;
+   private PrintWriter               pWriter            = null;
+
+   public void resetBuffer() {
+      if (baoStream != null) {
+         baoStream.reset();
+      }
+      if (pWriter != null) {
+         sWriter = new StringWriter(bufferSize);
+         pWriter = new PrintWriter(sWriter);
+      }
+   }
+
+   public void reset() {
+      resetBuffer();
+      httpHeaders.clear();
+      cookies.clear();
+   }
+
+   public PrintWriter getWriter() {
+      if (baoStream != null) {
+         throw new IllegalStateException("getWriter may not be called after getPortletOutputStream.");
+      }
+      if (pWriter == null) {
+         sWriter = new StringWriter(bufferSize);
+         pWriter = new PrintWriter(sWriter);
+      }
+      return pWriter;
+   }
+
+   public ByteArrayOutputStream getBaoStream() {
+      if (sWriter != null) {
+         throw new IllegalStateException("getPortletOutputStream may not be called after getWriter.");
+      }
+      if (baoStream == null) {
+         baoStream = new ByteArrayOutputStream(bufferSize);
+      }
+      return baoStream;
+   }
+
+   public int getBufferSize() {
+      return bufferSize;
+   }
+
+   public void setBufferSize(int bufferSize) {
+      this.bufferSize = bufferSize;
+   }
 
    public String getHeadSectionMarkup() {
-      return headSectionMarkup;
+
+      // First add the markup that was generated by adding elements, then add markup written to the
+      // output stream.
+
+      StringBuilder txt = new StringBuilder(128);
+      txt.append(getTags(doc));
+
+      String src = null;
+      if (sWriter != null) {
+         src = sWriter.toString();
+      } else if (baoStream != null) {
+         src = baoStream.toString();
+      }
+
+      if (src != null) {
+         StringBuilder sb = new StringBuilder(128);
+         sb.append(ROOT_ELEMENT_START);
+         sb.append(src);
+         sb.append(ROOT_ELEMENT_END);
+
+         StringReader sr = new StringReader(sb.toString());
+         InputSource is = new InputSource(sr);
+         Document adoc;
+
+         try {
+            adoc = docBuilder.parse(is);
+
+            // verify that all tags are allowed
+            Element aroot = adoc.getDocumentElement();
+            NodeList nodes = aroot.getChildNodes();
+            for (int ii = 0; ii < nodes.getLength(); ii++) {
+               Node node = nodes.item(ii);
+
+               // check for valid node type
+               int type = node.getNodeType();
+               if (type != Node.COMMENT_NODE && type != Node.TEXT_NODE && type != Node.ELEMENT_NODE) {
+
+                  StringBuilder err = new StringBuilder(128);
+                  err.append("Ignoring invalid node type from output stream: ");
+                  err.append(type);
+                  err.append(", node name: ").append(node.getNodeName());
+                  LOG.warn(err.toString());
+                  aroot.removeChild(node);
+                  continue;
+               }
+
+               // a text node may only contain white space
+               if (type == Node.TEXT_NODE) {
+                  String text = ((Text) node).getWholeText();
+
+                  if (!text.matches("^\\s*$")) {
+                     StringBuilder err = new StringBuilder(128);
+                     err.append("Ignoring invalid text node from output stream: ");
+                     err.append(node.getNodeValue());
+                     err.append(", node name: ").append(node.getNodeName());
+                     LOG.warn(err.toString());
+                     aroot.removeChild(node);
+                     continue;
+                  }
+
+               }
+
+               // an element node must be one of the allowed tags
+               if (type == Node.ELEMENT_NODE) {
+                  String name = ((Element) node).getTagName();
+
+                  if (!allowedTags.contains(name.toUpperCase())) {
+                     StringBuilder err = new StringBuilder(128);
+                     err.append("Ignoring invalid tag from output stream: ");
+                     err.append(name);
+                     err.append(", node name: ").append(node.getNodeName());
+                     LOG.warn(err.toString());
+                     aroot.removeChild(node);
+                     continue;
+                  }
+
+               }
+            }
+
+            txt.append("\n<!-- markup from portlet output stream -->");
+            txt.append(getTags(adoc));
+         } catch (Exception e) {
+            StringBuilder err = new StringBuilder();
+            err.append("Problem parsing portlet output data: ");
+            err.append(e.toString());
+            LOG.warn(err.toString());
+         }
+
+      }
+
+      return txt.toString();
+   }
+
+   public List<Cookie> getCookies() {
+      return cookies;
+   }
+
+   public void addCookie(Cookie cookie) {
+      cookies.add(cookie);
+   }
+
+   public Map<String, List<String>> getHttpHeaders() {
+      return httpHeaders;
    }
 
-   public void setHeadSectionMarkup(String headSectionMarkup) {
-      this.headSectionMarkup = headSectionMarkup;
+   public void addHttpHeader(String name, String value) {
+      if (!httpHeaders.containsKey(name)) {
+         ArrayList<String> vals = new ArrayList<String>(2);
+         httpHeaders.put(name, vals);
+      }
+      httpHeaders.get(name).add(value);
    }
-   
-   
+
+   public void setHttpHeader(String name, String value) {
+      ArrayList<String> vals = new ArrayList<String>(Arrays.asList(new String[] { value }));
+      httpHeaders.put(name, vals);
+   }
+
+   public void addHeaderTag(Element e) {
+      String tag = e.getTagName().toUpperCase();
+      if (allowedTags.contains(tag)) {
+         // If element was created with createElement, root will be initialized
+         if (root != null) {
+            root.appendChild(e);
+         }
+      } else {
+         StringBuilder txt = new StringBuilder(128);
+         txt.append("Ignoring element with disallowed tag name: ").append(tag);
+         txt.append(", allowed tags: ").append(allowedTags.toString());
+         LOG.warn(txt.toString());
+      }
+   }
+
+   public Element createElement(String tagName) {
+      try {
+         if (doc == null) {
+            DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
+            docBuilder = dbfac.newDocumentBuilder();
+            doc = docBuilder.newDocument();
+            root = doc.createElement(ROOT_ELEMENT);
+            doc.appendChild(root);
+         }
+         return doc.createElement(tagName);
+      } catch (ParserConfigurationException e) {
+         throw new DOMException((short) 0, "Initialization failure");
+      }
+   }
+
+   /**
+    * returns a string containing any tags that should go into the document head section.
+    * 
+    * @return String containing the tags, or the empty string if no tags are available.
+    */
+   private String getTags(Document doc) {
+      String tags = "";
+      if (doc != null) {
+         DOMSource src = new DOMSource(doc);
+         StringWriter sw = new StringWriter();
+         StreamResult res = new StreamResult(sw);
+         try {
+
+            Transformer trans = TransformerFactory.newInstance().newTransformer();
+            trans.setOutputProperty(OutputKeys.INDENT, "yes");
+            trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+            trans.setOutputProperty(OutputKeys.METHOD, "html");
+
+            trans.transform(src, res);
+
+            tags = sw.toString().replaceAll(ROOT_ELEMENT_REGEX, "");
+
+         } catch (Exception e) {
+            StringBuilder txt = new StringBuilder();
+            txt.append("Error converting tags to string. Exception: ");
+            txt.append(e.toString());
+            LOG.warn(txt.toString());
+         }
+      }
+
+      if (isDebug) {
+         StringBuilder sb = new StringBuilder();
+         sb.append("returning tags: ");
+         sb.append((tags.length() > 0) ? "\n" + tags : "");
+         LOG.debug(sb.toString());
+      }
+
+      return tags;
+   }
+
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/d11dcc5a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletResponseImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletResponseImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletResponseImpl.java
index 1834455..a7f7e36 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletResponseImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletResponseImpl.java
@@ -18,12 +18,14 @@ package org.apache.pluto.container.impl;
 
 import java.util.Enumeration;
 
+import javax.portlet.MimeResponse;
 import javax.portlet.PortalContext;
 import javax.portlet.PortletMode;
 import javax.portlet.PortletResponse;
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
 import org.apache.pluto.container.PortletContainer;
 import org.apache.pluto.container.PortletResponseContext;
 import org.apache.pluto.container.PortletWindow;
@@ -128,8 +130,9 @@ public abstract class PortletResponseImpl implements PortletResponse
 
     public void addProperty(String key, Element element)
     {
-        ArgumentUtility.validateNotEmpty("key", key);
-        responseContext.addProperty(key, element);
+       ArgumentUtility.validateNotEmpty("key", key);
+       ArgumentUtility.validateNotNull("element", element);
+       responseContext.addProperty(key, element);
     }
 
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/d11dcc5a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletMimeResponseContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletMimeResponseContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletMimeResponseContextImpl.java
index 2c458bc..9e1a0d4 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletMimeResponseContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletMimeResponseContextImpl.java
@@ -32,178 +32,186 @@ import org.apache.pluto.container.util.PrintWriterServletOutputStream;
 
 /**
  * @version $Id$
- *
+ * 
  */
-public abstract class PortletMimeResponseContextImpl extends PortletResponseContextImpl implements PortletMimeResponseContext
-{
-    private static class CacheControlImpl implements CacheControl
-    {
-        private String eTag;
-        private int expirationTime;
-        private boolean publicScope;
-        private boolean cachedContent;
-        
-        public CacheControlImpl()
-        {
-        }
-
-        public boolean useCachedContent()
-        {
-            return cachedContent;
-        }
-
-        public String getETag()
-        {
-            return this.eTag;
-        }
-
-        public int getExpirationTime()
-        {
-            return expirationTime;
-        }
-
-        public boolean isPublicScope()
-        {
-            return publicScope;
-        }
-
-        public void setETag(String eTag)
-        {
-            this.eTag = eTag;
-        }
-
-        public void setExpirationTime(int expirationTime)
-        {
-            this.expirationTime = expirationTime;
-        }
-
-        public void setPublicScope(boolean publicScope)
-        {
-            this.publicScope = publicScope;
-        }
-
-        public void setUseCachedContent(boolean cachedContent)
-        {
-            this.cachedContent = cachedContent;
-        }
-    }
-    
-    private CacheControl cacheControl;
-    private OutputStream outputStream;
-    
-    public PortletMimeResponseContextImpl(PortletContainer container, HttpServletRequest containerRequest,
-                                          HttpServletResponse containerResponse, PortletWindow window)
-    {
-        super(container, containerRequest, containerResponse, window);
-    }
-    
-    public void close()
-    {
-        cacheControl = null;
-        outputStream = null;
-        super.close();
-    }
-
-    public void flushBuffer() throws IOException
-    {
-        if (!isClosed())
-        {
-            getServletResponse().flushBuffer();
-        }
-    }
-
-    public int getBufferSize()
-    {
-        return getServletResponse().getBufferSize();
-    }
-
-    public CacheControl getCacheControl()
-    {
-        if (isClosed())
-        {
-            return null;
-        }
-        if (cacheControl == null)
-        {
-            cacheControl = new CacheControlImpl();
-        }
-        return cacheControl;
-    }
-
-    public String getCharacterEncoding()
-    {
-        return isClosed() ? null : getServletResponse().getCharacterEncoding();
-    }
-
-    public String getContentType()
-    {
-        return isClosed() ? null : getServletResponse().getContentType();
-    }
-
-    public Locale getLocale()
-    {
-        return isClosed() ? null : getServletResponse().getLocale();
-    }
-
-    public OutputStream getOutputStream() throws IOException, IllegalStateException
-    {
-        if (isClosed())
-        {
-            return null;
-        }
-        if (outputStream == null)
-        {
-            try
-            {
-                outputStream = getServletResponse().getOutputStream();
-            }
-            catch (IllegalStateException e)
-            {
-                // handle situation where underlying ServletResponse its getWriter()
-                // has been called already anyway: return a wrapped PrintWriter in that case
-                outputStream = new PrintWriterServletOutputStream(getServletResponse().getWriter(),
-                                                                   getServletResponse().getCharacterEncoding());
+public abstract class PortletMimeResponseContextImpl extends PortletResponseContextImpl implements
+      PortletMimeResponseContext {
+   private static class CacheControlImpl implements CacheControl {
+      private String  eTag;
+      private int     expirationTime;
+      private boolean publicScope;
+      private boolean cachedContent;
+
+      public CacheControlImpl() {
+      }
+
+      public boolean useCachedContent() {
+         return cachedContent;
+      }
+
+      public String getETag() {
+         return this.eTag;
+      }
+
+      public int getExpirationTime() {
+         return expirationTime;
+      }
+
+      public boolean isPublicScope() {
+         return publicScope;
+      }
+
+      public void setETag(String eTag) {
+         this.eTag = eTag;
+      }
+
+      public void setExpirationTime(int expirationTime) {
+         this.expirationTime = expirationTime;
+      }
+
+      public void setPublicScope(boolean publicScope) {
+         this.publicScope = publicScope;
+      }
+
+      public void setUseCachedContent(boolean cachedContent) {
+         this.cachedContent = cachedContent;
+      }
+   }
+
+   private CacheControl cacheControl;
+   private OutputStream outputStream;
+
+   public PortletMimeResponseContextImpl(PortletContainer container, HttpServletRequest containerRequest,
+         HttpServletResponse containerResponse, PortletWindow window) {
+      super(container, containerRequest, containerResponse, window);
+   }
+
+   public void close() {
+      cacheControl = null;
+      outputStream = null;
+      super.close();
+   }
+
+   public void flushBuffer() throws IOException {
+      if (!isClosed() && !isSetPropsAllowed()) {
+         getServletResponse().flushBuffer();
+      }
+   }
+
+   public int getBufferSize() {
+      if (isSetPropsAllowed()) {
+         // header request
+         return headerData.getBufferSize();
+      } else {
+         // render or resource request
+         return getServletResponse().getBufferSize();
+      }
+   }
+
+   public CacheControl getCacheControl() {
+      if (isClosed()) {
+         return null;
+      }
+      if (cacheControl == null) {
+         cacheControl = new CacheControlImpl();
+      }
+      return cacheControl;
+   }
+
+   public String getCharacterEncoding() {
+      return isClosed() ? null : getServletResponse().getCharacterEncoding();
+   }
+
+   public String getContentType() {
+      return isClosed() ? null : getServletResponse().getContentType();
+   }
+
+   public Locale getLocale() {
+      return isClosed() ? null : getServletResponse().getLocale();
+   }
+
+   public OutputStream getOutputStream() throws IOException, IllegalStateException {
+      if (isClosed()) {
+         return null;
+      }
+      if (isSetPropsAllowed()) {
+         // header request
+         return headerData.getBaoStream();
+      } else {
+         // render or resource request
+         if (outputStream == null) {
+            try {
+               outputStream = getServletResponse().getOutputStream();
+            } catch (IllegalStateException e) {
+               // handle situation where underlying ServletResponse its getWriter()
+               // has been called already anyway: return a wrapped PrintWriter in that case
+               outputStream = new PrintWriterServletOutputStream(getServletResponse().getWriter(), getServletResponse()
+                     .getCharacterEncoding());
             }
-        }
-        return outputStream;
-    }
-
-    public PrintWriter getWriter() throws IOException, IllegalStateException
-    {
-        return isClosed() ? null : getServletResponse().getWriter();
-    }
-
-    public boolean isCommitted()
-    {
-        return getServletResponse().isCommitted();
-    }
-
-    public void reset()
-    {
-        getServletResponse().reset();
-    }
-
-    public void resetBuffer()
-    {
-        if (!isClosed())
-        {
+         }
+         return outputStream;
+      }
+   }
+
+   public PrintWriter getWriter() throws IOException, IllegalStateException {
+      if (isClosed()) {
+         return null;
+      }
+      if (isSetPropsAllowed()) {
+         // header request
+         return headerData.getWriter();
+      } else {
+         // render or resource request
+         return getServletResponse().getWriter();
+      }
+   }
+
+   public boolean isCommitted() {
+      if (isSetPropsAllowed()) {
+         // header request
+         return false;
+      } else {
+         return getServletResponse().isCommitted();
+      }
+   }
+
+   public void reset() {
+      if (!isClosed()) {
+         if (isSetPropsAllowed()) {
+            // header request
+            headerData.reset();
+         } else {
+            getServletResponse().reset();
+         }
+      }
+   }
+
+   public void resetBuffer() {
+      if (!isClosed()) {
+         if (isSetPropsAllowed()) {
+            // header request
+            headerData.resetBuffer();
+         } else {
             getServletResponse().resetBuffer();
-        }
-    }
-
-    public void setBufferSize(int size)
-    {
-        if (!isClosed())
-        {
+         }
+      }
+   }
+
+   public void setBufferSize(int size) {
+      if (!isClosed()) {
+         if (isSetPropsAllowed()) {
+            // header request
+            headerData.setBufferSize(size);
+         } else {
+            // render or resource request
             getServletResponse().setBufferSize(size);
-        }
-    }
-
-    public void setContentType(String contentType)
-    {
-        if (!isClosed())
-        {
-            getServletResponse().setContentType(contentType);
-        }
-    }
+         }
+      }
+   }
+
+   public void setContentType(String contentType) {
+      if (!isClosed()) {
+         getServletResponse().setContentType(contentType);
+      }
+   }
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/d11dcc5a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
index 491a539..0e60f50 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
@@ -19,21 +19,14 @@ package org.apache.pluto.driver.services.container;
 import static javax.portlet.PortletRequest.HEADER_PHASE;
 import static javax.portlet.PortletRequest.RENDER_PHASE;
 
-import java.io.StringWriter;
+import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Set;
 
+import javax.portlet.MimeResponse;
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
 
 import org.apache.pluto.container.HeaderData;
 import org.apache.pluto.container.PortletContainer;
@@ -47,7 +40,6 @@ import org.apache.pluto.driver.url.PortalURL;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
 /**
@@ -58,7 +50,6 @@ public abstract class PortletResponseContextImpl implements PortletResponseConte
 
    /** Logger. */
    private static final Logger      LOG               = LoggerFactory.getLogger(PortletResponseContextImpl.class);
-   private static final boolean     isDebug           = LOG.isDebugEnabled();
 
    private PortletContainer         container;
    private HttpServletRequest       containerRequest;
@@ -74,20 +65,18 @@ public abstract class PortletResponseContextImpl implements PortletResponseConte
    private String                   lifecycle;
    private boolean                  isSetPropsAllowed = false;
 
-   private Document                 doc               = null;
-   private Element                  root              = null;
-   private static final String      ROOT_ELEMENT      = "rootElement";
-   private static final Set<String> allowedTags       = new HashSet<String>();
-   static {
-      allowedTags.add("META");
-      allowedTags.add("LINK");
-      allowedTags.add("STYLE");
-      allowedTags.add("SCRIPT");
-      allowedTags.add("NOSCRIPT");
-   }
+   private static final Set<String> disallowedHeaders = new HashSet<String>(Arrays.asList(new String[] {
+         "ACCEPT-PATCH", "ACCEPT-RANGES", "AGE", "ALLOW", "CACHE-CONTROL", "CONNECTION", "CONTENT-DISPOSITION",
+         "CONTENT-ENCODING", "CONTENT-LANGUAGE", "CONTENT-LENGTH", "CONTENT-LOCATION", "CONTENT-MD5", "CONTENT-RANGE",
+         "CONTENT-TYPE", "DATE", "ETAG", "EXPIRES", "LAST-MODIFIED", "LINK", "LOCATION", "P3P", "PRAGMA",
+         "PROXY-AUTHENTICATE", "PUBLIC-KEY-PINS", "REFRESH", "RETRY-AFTER", "SERVER", "SET-COOKIE", "STATUS",
+         "STRICT-TRANSPORT-SECURITY", "TRAILER", "TRANSFER-ENCODING", "UPGRADE", "VARY", "VIA", "WWW-AUTHENTICATE",
+         "X-FRAME-OPTIONS"                           }));
+
+   private final static String VALID_HEADER_CHARS = "^[a-zA-Z0-9!#$%&'*+-.^_`|~]+$";
    
    // holder for the header data
-   protected HeaderData headerData = new HeaderData();
+   protected HeaderData             headerData        = new HeaderData();
 
    public PortletResponseContextImpl(PortletContainer container, HttpServletRequest containerRequest,
          HttpServletResponse containerResponse, PortletWindow window) {
@@ -113,57 +102,15 @@ public abstract class PortletResponseContextImpl implements PortletResponseConte
    public void setPropsAllowed(boolean isSetPropsAllowed) {
       this.isSetPropsAllowed = isSetPropsAllowed;
    }
-   
+
    /**
     * returns the header data provided by the portlet during header phase execution.
     */
    @Override
    public HeaderData getHeaderData() {
-      headerData.setHeadSectionMarkup(getTags());
       return headerData;
    }
 
-   /**
-    * returns a string containing any tags that should go into the document head section.
-    * 
-    * @return String containing the tags, or the empty string if no tags are available.
-    */
-   private String getTags() {
-      String tags = "";
-      if (doc != null) {
-         DOMSource src = new DOMSource(doc);
-         StringWriter sw = new StringWriter();
-         StreamResult res = new StreamResult(sw);
-         try {
-
-            Transformer trans = TransformerFactory.newInstance().newTransformer();
-            trans.setOutputProperty(OutputKeys.INDENT, "yes");
-            trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
-            trans.setOutputProperty(OutputKeys.METHOD, "html");
-
-            trans.transform(src, res);
-
-            String regex = "(?:\\s*)</{0,1}" + ROOT_ELEMENT + ">(?:\\s*)";
-            tags = sw.toString().replaceAll(regex, "");
-
-         } catch (Exception e) {
-            StringBuilder txt = new StringBuilder();
-            txt.append("Error converting tags to string. Exception: ");
-            txt.append(e.toString());
-            LOG.warn(txt.toString());
-         }
-      }
-
-      if (isDebug) {
-         StringBuilder sb = new StringBuilder();
-         sb.append("returning tags: ");
-         sb.append((tags.length()>0) ? "\n" + tags : "");
-         LOG.debug(sb.toString());
-      }
-
-      return tags;
-   }
-
    protected PortalURL getPortalURL() {
       return portalURL;
    }
@@ -182,8 +129,8 @@ public abstract class PortletResponseContextImpl implements PortletResponseConte
    }
 
    public void addProperty(Cookie cookie) {
-      if (!isClosed()) {
-         servletResponse.addCookie(cookie);
+      if (!isClosed() && isSetPropsAllowed) {
+         headerData.addCookie(cookie);
       }
    }
 
@@ -191,34 +138,47 @@ public abstract class PortletResponseContextImpl implements PortletResponseConte
     * saves elements for adding to the head section markup if header request or render request
     */
    public void addProperty(String key, Element element) {
-      if (!isClosed() && isSetPropsAllowed && element != null && root != null) {
-         if (lifecycle.equals(RENDER_PHASE) || lifecycle.equals(HEADER_PHASE)) {
-            String tag = element.getTagName().toUpperCase();
-            if (allowedTags.contains(tag)) {
-               root.appendChild(element);
+      if (!key.equals(MimeResponse.MARKUP_HEAD_ELEMENT)) {
+         StringBuilder txt = new StringBuilder(128);
+         txt.append("Ignoring attempt to add document head element with key: ").append(key);
+         txt.append(" rather than the required: ").append(MimeResponse.MARKUP_HEAD_ELEMENT);
+         LOG.warn(txt.toString());
+      } else {
+         if (!isClosed() && isSetPropsAllowed && element != null) {
+            if (lifecycle.equals(RENDER_PHASE) || lifecycle.equals(HEADER_PHASE)) {
+               headerData.addHeaderTag(element);
             }
          }
       }
    }
 
    public void addProperty(String key, String value) {
-      // not supported
+      if (value == null) {
+         StringBuilder txt = new StringBuilder(128);
+         txt.append("Ignoring attempt to add property with null value. Key: ").append(key);
+         LOG.warn(txt.toString());
+      } else if (!key.matches(VALID_HEADER_CHARS)) {
+         StringBuilder txt = new StringBuilder(128);
+         txt.append("Ignoring attempt to add key containing disallowed characters. Key: ").append(key);
+         txt.append(", value: ").append(value);
+        LOG.warn(txt.toString());
+      } else {
+         // header names are case insensitive
+         if (disallowedHeaders.contains(key.toUpperCase())) {
+            StringBuilder txt = new StringBuilder(128);
+            txt.append("Ignoring disallowed HTTP header: ").append(key);
+            txt.append(" with value: ").append(value);
+            LOG.warn(txt.toString());
+         } else {
+            if (!isClosed() && isSetPropsAllowed) {
+               headerData.addHttpHeader(key, value);
+            }
+         }
+      }
    }
 
    public Element createElement(String tagName) throws DOMException {
-
-      try {
-         if (doc == null) {
-            DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
-            DocumentBuilder docBuilder = dbfac.newDocumentBuilder();
-            doc = docBuilder.newDocument();
-            root = doc.createElement(ROOT_ELEMENT);
-            doc.appendChild(root);
-         }
-         return doc.createElement(tagName);
-      } catch (ParserConfigurationException e) {
-         throw new DOMException((short) 0, "Initialization failure");
-      }
+      return headerData.createElement(tagName);
    }
 
    public void close() {
@@ -259,7 +219,28 @@ public abstract class PortletResponseContextImpl implements PortletResponseConte
    }
 
    public void setProperty(String key, String value) {
-      // not supported
+      if (value == null) {
+         StringBuilder txt = new StringBuilder(128);
+         txt.append("Ignoring attempt to add property with null value. Key: ").append(key);
+         LOG.warn(txt.toString());
+      } else if (!key.matches(VALID_HEADER_CHARS)) {
+         StringBuilder txt = new StringBuilder(128);
+         txt.append("Ignoring attempt to add key containing disallowed characters. Key: ").append(key);
+         txt.append(", value: ").append(value);
+         LOG.warn(txt.toString());
+      } else {
+         // header names are case insensitive
+         if (disallowedHeaders.contains(key.toUpperCase())) {
+            StringBuilder txt = new StringBuilder(128);
+            txt.append("Ignoring disallowed HTTP header: ").append(key);
+            txt.append(" with value: ").append(value);
+            LOG.warn(txt.toString());
+         } else {
+            if (!isClosed() && isSetPropsAllowed) {
+               headerData.setHttpHeader(key, value);
+            }
+         }
+      }
    }
 
    public ResourceURLProvider getResourceURLProvider() {

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/d11dcc5a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java
index ddc6c63..21326ae 100644
--- a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java
@@ -20,12 +20,14 @@ import java.io.IOException;
 import java.io.Writer;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequest;
 import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
+import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -282,7 +284,23 @@ public class PortalDriverServlet extends HttpServlet {
             }
             
             if (hd != null) {
+               
+               // handle markup for document head section
                markup.append(hd.getHeadSectionMarkup()).append("\n");
+               
+               // add the cookies to the response
+               List<Cookie> cookies = hd.getCookies();
+               for (Cookie c : cookies) {
+                  resp.addCookie(c);
+               }
+               
+               // Add the HTTP headers to the response
+               Map<String, List<String>> headers = hd.getHttpHeaders();
+               for (String name : headers.keySet()) {
+                  for (String val : headers.get(name)) {
+                     resp.addHeader(name, val);
+                  }
+               }
             }
             
          } catch (PortletContainerException ex) {

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/d11dcc5a/portlet-api/src/main/java/javax/portlet/GenericPortlet.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/GenericPortlet.java b/portlet-api/src/main/java/javax/portlet/GenericPortlet.java
index 79b7ca9..05c93f1 100644
--- a/portlet-api/src/main/java/javax/portlet/GenericPortlet.java
+++ b/portlet-api/src/main/java/javax/portlet/GenericPortlet.java
@@ -217,7 +217,6 @@ public abstract class GenericPortlet implements Portlet, PortletConfig, EventPor
 	 * Version 3 portlets should override this method to set HTTP headers, cookies, and
 	 * to provide markup for the overall document <code>HEAD</code> section.
 	 */
-	@Override
    public void renderHeaders(HeaderRequest request, HeaderResponse response) throws PortletException, java.io.IOException {
    }
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/d11dcc5a/portlet-api/src/main/java/javax/portlet/PortletRequest.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/PortletRequest.java b/portlet-api/src/main/java/javax/portlet/PortletRequest.java
index 9581cdf..f2998f7 100644
--- a/portlet-api/src/main/java/javax/portlet/PortletRequest.java
+++ b/portlet-api/src/main/java/javax/portlet/PortletRequest.java
@@ -204,11 +204,13 @@ public interface PortletRequest extends PortletState
   public static final String EVENT_PHASE = "EVENT_PHASE";
   
   /**
+   * <div class="changed_added_3_0">
    * String identifier for the portlet render lifecycle phase. In this
    * phase the portlet request and response are from type
    * <code>HeaderRequest</code> and <code>HeaderResponse</code>.
    * <p>
    * The value of the constant is <code>HEADER_PHASE</code>.
+   * </div>
    * 
    * @since 3.0
    */


[26/38] portals-pluto git commit: Integrated latest version of the portlet API 3.0. Made necessary minor adaptations the Pluto code and demo portlets to make the previously available funtionality work. For the partial action request, changed implementati

Posted by ms...@apache.org.
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/URLFactory.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/URLFactory.java b/portlet-api/src/main/java/javax/portlet/annotations/URLFactory.java
new file mode 100644
index 0000000..b060750
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/URLFactory.java
@@ -0,0 +1,197 @@
+/*  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.
+ */
+
+
+package javax.portlet.annotations;
+
+import javax.portlet.ActionURL;
+import javax.portlet.MimeResponse.Copy;
+import javax.portlet.RenderURL;
+import javax.portlet.ResourceURL;
+
+/**
+ * <div class='changed_added_3_0'>
+ * Interface that allows URLs to be generated. 
+ * The functionality is based on methods from <code>MimeResponse</code>.
+ * <p>
+ * A URLFactory object can only be obtained through injection.
+ * <p>
+ * Example:
+ * <div class='codebox'>      
+ * {@literal @}Inject<br/>   
+ * private URLFactory urlFactory;
+ * </div>                    
+ * </div>
+ * 
+ * @see javax.portlet.MimeResponse MimeResponse
+ */
+public interface URLFactory {
+
+   /**
+    * Creates an action URL targeting the portlet.
+    * Action URLs are used to create forms or links that, when triggered,
+    * update the portlet state in a non-idempotent manner.
+    * <p> 
+    * If a request is triggered by the URL, it results in
+    * an action request.
+    * <p>
+    * The <code>copyParameters</code> argument specifies whether render parameters
+    * from the current request are to be copied to the URL.
+    * <p>
+    * The returned URL can be further extended by adding portlet-specific action
+    * parameters, portlet mode, and window state.
+    * If no additional portlet mode, window
+    * state or security modifier is set on the URL, the values from the
+    * current render or resource request are preserved.
+    * <p>
+    * Public render parameters do not need to be explicitly added to the returned 
+    * action URL, unless the public render parameter value is to be changed. 
+    * Any public render parameters associated with 
+    * the portlet will automatically be available during action request 
+    * processing resulting from activation of the URL. 
+    * <p>
+    * If a public render parameter value is set or removed on an action URL, 
+    * then the public render parameter will be set to the new value or 
+    * removed when the URL is activated.
+    * 
+    * @see javax.portlet.MimeResponse#createActionURL() createActionURL
+    * @see javax.portlet.MimeResponse.Copy
+    * 
+    * @param   copyParameters    Specifies if parameters are to be copied to the URL
+    * 
+    * @return a portlet action URL, or <code>null</code> if the current request
+    * is neither a <code>RenderRequest</code> nor a <code>ResourceRequest</code>
+    */
+   public ActionURL createActionURL(Copy copyParameters);
+
+   
+   /**
+    * Creates a render URL targeting the portlet. 
+    * Render URLs cause idempotent requests that move the portlet to a 
+    * new view state, for example, to view a different page of data. 
+    * <p> 
+    * If a request is triggered by the URL, it results in
+    * a render request.
+    * <p>
+    * The <code>copyParameters</code> argument specifies whether render parameters
+    * from the current request are to be copied to the URL.
+    * <p>
+    * The returned URL can be further extended by adding portlet-specific render
+    * parameters, portlet mode, and window state.
+    * If no portlet mode, window
+    * state or security modifier is set on the URL, the values from the
+    * current render or resource request are preserved.
+    * <p>
+    * Public render parameters do not need to be explicitly added to the returned 
+    * render URL, unless the public render parameter value is to be changed. 
+    * Any public render parameters associated with 
+    * the portlet will automatically be available during render request processing resulting
+    * from activation of the URL.
+    * <p>
+    * If a public render parameter value is set or removed on a render URL, then the public 
+    * render parameter will be set to the new value or removed when the URL is activated.
+    * 
+    * @see javax.portlet.MimeResponse#createRenderURL() createRenderURL
+    * @see javax.portlet.MimeResponse.Copy
+    * 
+    * @param   copyParameters    Specifies if parameters are to be copied to the URL
+    * 
+    * @return a portlet render URL, or <code>null</code> if the current request
+     * is neither a <code>RenderRequest</code> nor a <code>ResourceRequest</code>
+    */
+   public RenderURL createRenderURL(Copy copyParameters);
+   
+   
+   /**
+     * Creates a resource URL targeting the portlet. 
+     * Resource URLs are used to trigger requests for content that applies
+     * to the current portlet view state.
+     * <p>
+     * If a request is triggered by the <code>ResourceURL</code>, it results in a serve
+     * resource request of the <code>ResourceServingPortlet</code> interface.
+     * <p>
+     * The security settings can be changed for the URL. If the security settings are
+     * not explicitly set, the values governing the current request 
+     * are preserved. 
+     * The current
+     * render parameters, portlet mode, and window state are preserved 
+     * depending on the cacheability setting for the returned resource URL.
+     * <p>
+     * If cacheability is set to <code>PORTLET</code> or <code>PAGE</code>, the values of the render
+     * parameters, portlet mode, and window state are preserved. 
+     * Otherwise, they will not be preserved.
+     * <p>
+     * If allowed by the cacheability setting, public and private render 
+     * parameters are added to the URL with their current values.
+     * The render parameter values cannot be changed on the URL. 
+     * <p>
+     * The URL can be further extended by adding portlet-specific resource
+     * parameters. 
+     * <p>
+     * The URL will contain the current 
+     * cacheability setting of the parent resource by default. 
+     * If no parent resource is available, <code>PAGE</code> is the default.
+     * 
+     * @see javax.portlet.MimeResponse#createResourceURL() createResourceURL
+     * 
+     * @return a portlet resource URL, or <code>null</code> if the current request
+     * is neither a <code>RenderRequest</code> nor a <code>ResourceRequest</code>
+     */
+   public ResourceURL createResourceURL();
+
+   /**
+     * Returns the encoded URL of the resource, like servlets, JSPs, images and
+     * other static files, at the given path.
+     * <p>
+     * Portlets should encode all resource URLs pointing to resources in the
+     * portlet application via this method in order to ensure that they get
+     * served via the portal application.
+     * <p>
+     * Some portal/portlet-container implementation may require those URLs to
+     * contain implementation specific data encoded in it. Because of that,
+     * portlets should use this method to create such URLs.
+     * <p>
+     * The <code>encodeURL</code> method may include the session ID and other
+     * portal/portlet-container specific information into the URL. If encoding
+     * is not needed, it returns the URL unchanged.
+     * <p>
+     * Portlet developer should be aware that the returned URL might not be a well formed
+     * URL but a special token at the time the portlet is generating its content. 
+     * Thus portlets should not add additional parameters on the resulting URL or 
+     * expect to be able to parse the URL. As a result, the outcome of the encodeURL 
+     * call may be different than calling encodeURL in the servlet world.
+     * 
+     * @param path
+     *            the URI path to the resource. This must be either an absolute
+     *            URL (e.g.
+     *            <code>http://my.co/myportal/mywebap/myfolder/myresource.gif</code>)
+     *            or a full path URI (e.g.
+     *            <code>/myportal/mywebap/myfolder/myresource.gif</code>).
+     * 
+     * @exception java.lang.IllegalArgumentException
+     *                if path doesn't have a leading slash or is not an absolute
+     *                URL
+     * 
+     * @see javax.portlet.PortletResponse#encodeURL(String) encodeURL(String)
+     * 
+     * @return the encoded resource URL as string, may not be a valid URL
+     */
+
+   public String encodeURL(String path);
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/UserAttribute.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/UserAttribute.java b/portlet-api/src/main/java/javax/portlet/annotations/UserAttribute.java
new file mode 100644
index 0000000..7ef185c
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/UserAttribute.java
@@ -0,0 +1,61 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * This annotation is used within composite portlet configuration annotations to
+ * represent a single user attribute.
+ * It cannot be used as a stand-alone portlet annotation.
+ * </div>
+ */
+@Retention(RUNTIME) @Target({ANNOTATION_TYPE})
+public @interface UserAttribute {
+   
+   /**
+    * <div class='container-change'>
+    * The user attribute name.
+    * </div>
+    * 
+    * @return  The public render parameter identifier
+    */
+   String      name();
+   
+   /**
+    * <div class='container-change'>
+    * Provides locale-specific text describing the user attribute for use by the portal application or by tools.
+    * </div>
+    * 
+    * @return  The user attribute description
+    */
+   LocaleString[]      description() default {};
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/WindowId.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/WindowId.java b/portlet-api/src/main/java/javax/portlet/annotations/WindowId.java
new file mode 100644
index 0000000..fc5a027
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/WindowId.java
@@ -0,0 +1,57 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Qualifier that specifies the window ID for injection.
+ * <p>
+ * The injection target type must be <code>String</code>.
+ * <p>
+ * This annotation may only be used in <code>{@literal @}RequestScoped</code> or
+ * <code>{@literal @}PortletStateScoped</code> beans.
+ * <p>
+ * Example:
+ * <div class='codebox'>      
+ * {@literal @}Inject {@literal @}WindowId<br/>   
+ * private String windowId;
+ * </div>                    
+ * </div>
+ * 
+ * @see javax.portlet.PortletRequest#getWindowID() getWindowID
+ */
+
+@Qualifier @Retention(RUNTIME) @Target({METHOD, FIELD, PARAMETER})
+public @interface WindowId {
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/package-info.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/package-info.java b/portlet-api/src/main/java/javax/portlet/annotations/package-info.java
new file mode 100644
index 0000000..aa7cb4c
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/package-info.java
@@ -0,0 +1,316 @@
+/*  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.
+ */
+
+/**
+ * <span class="changed_added_3_0">
+ * This describes a proposed extension for the JSR 362 Portlet Specification 3.0
+ * public API to exploit CDI capabilities in portlets. 
+ * </span>
+ * <h4>Overview</h4>
+ * <p>
+ * The annotation-oriented API provides new capabilities in several areas.
+ * </p>
+ * <ul class='nospace'>
+ * <li>
+ * It allows portlet configuration declarations to be performed through use of
+ * annotations.
+ * The goal is to reduce or remove the need to write a portlet deployment descriptor 
+ * in most instances.
+ * <p>
+ * The developer can choose between providing configuration data through annotations or 
+ * through the portlet deployment descriptor.
+ * If the same type of information is provided through both annotations and the deployment
+ * descriptor, the information from the deployment descriptor has precedence. 
+ * </li>
+ * <li>
+ * It allows portlets to be written as CDI beans.
+ * Such portlets can make use of standard CDI features such as interceptors, 
+ * decorators, and dependency injection.
+ * <p>
+ * Bean portlet methods must carry with one of the following annotations:
+ * {@link javax.portlet.annotations.ActionMethod}, 
+ * {@link javax.portlet.annotations.EventMethod}, 
+ * {@link javax.portlet.annotations.HeaderMethod}, 
+ * {@link javax.portlet.annotations.RenderMethod}, 
+ * {@link javax.portlet.annotations.ServeResourceMethod}, or 
+ * {@link javax.portlet.annotations.PortletResources}.
+ * <p>
+ * Bean portlet methods can be contained in any valid bean class. 
+ * The class needs not implement any portlet-specific interface or extend a portlet class. 
+ * However, each bean portlet method has method signature requirements that 
+ * must be fulfilled.
+ * Please see the annotation descriptions.
+ * </li>
+ * <li>
+ * It provides new custom scopes for portlet artifacts.
+ * <ul class='nospace'>
+ * <li>
+ * Using the scope annotation
+ * {@link javax.portlet.annotations.PortletSessionScoped} 
+ * associates the bean lifecycle with the portlet session.
+ * </li>
+ * <li>
+ * Using the scope annotation
+ * {@link javax.portlet.annotations.PortletStateScoped} 
+ * associates the bean lifecycle with the portlet state, which conceptually is stored 
+ * on the URL.
+ * If you use PortletStateScoped beans, your bean state will be automatically stored as
+ * render parameters for the portlet setting the state.      
+ * </li>
+ * </ul>
+ * </li>
+ * <li>
+ * It allows portlet artifacts such as portlet request filters, URL generation listeners,
+ * and preference validators to be implemented as CDI beans.
+ * <p>
+ * Please see the following annotation descriptions:
+ * {@link javax.portlet.annotations.PortletRequestFilter},
+ * {@link javax.portlet.annotations.PortletURLGenerationListener}, and
+ * {@link javax.portlet.annotations.PreferencesValidator}.
+ * </ul>
+ * <h4>Injectable Portlet Artifacts</h4>
+ * <p>
+ * In addition to the annotations, this package provides producer methods that allow
+ * many portlet artifacts to be injected into your code as beans.
+ * The following table describes the beans that are available for injection.
+ * </p>
+ * <p>
+ * <span style="font-weight:bold; text-decoration:underline;">Note:</span> 
+ * Most of these beans are dependent on the portlet request being executed, but could not themselves 
+ * be declared as {@literal @}RequestScoped due to technical limitations. 
+ * These beans should be used within enclosing beans that are either
+ * {@literal @}PortletStateScoped or {@literal @}RequestScoped to allow the portlet container to properly manage 
+ * the lifecycle of the injected object.
+ * The required enclosing bean scope is noted in the table.
+ * <table class='ovtable' width='100%'>
+ * <thead>
+ * <tr>
+ * <th width="15%">Object</th>
+ * <th width="40%">Description</th>
+ * <th width="15%">Enclosing Bean Scope</th>
+ * <th width="30%">Annotation Example</th>
+ * </tr>
+ * </thead>
+ * <tbody>
+ * <!-- ************* -->
+ * <tr>
+ * <td>PortletConfig</td>
+ * <td>The PortletConfig object. Use qualifier {@literal @}BeanPortlet for disambiguation.</td>
+ * <td>Any</td>
+ * <td>
+ * <div class='codebox'>
+ * {@literal @}Inject {@literal @}BeanPortlet<br/>
+ * private PortletConfig portletConfig;
+ * </div>
+ * </td>
+ * </tr>
+ * <!-- ************* -->
+ * <tr>
+ * <td>PortletRequest</td>
+ * <td>The PortletRequest object.</td>
+ * <td>Any</td>
+ * <td>
+ * <div class='codebox'>
+ * {@literal @}Inject<br/>
+ * private PortletRequest request;
+ * </div>
+ * </td>
+ * </tr>
+ * <!-- ************* -->
+ * <tr>
+ * <td>PortletResponse</td>
+ * <td>The PortletResponse object.</td>
+ * <td>Any</td>
+ * <td>
+ * <div class='codebox'>
+ * {@literal @}Inject<br/>
+ * private PortletResponse request;
+ * </div>
+ * </td>
+ * </tr>
+ * <!-- ************* -->
+ * <tr>
+ * <td>PortletPreferences</td>
+ * <td>The PortletPreferences object.</td>
+ * <td>Any</td>
+ * <td>
+ * <div class='codebox'>
+ * {@literal @}Inject<br/>
+ * private PortletPreferences preferences;
+ * </div>
+ * </td>
+ * </tr>
+ * <!-- ************* -->
+ * <tr>
+ * <td>PortletSession</td>
+ * <td>The PortletSession object.</td>
+ * <td>Any</td>
+ * <td>
+ * <div class='codebox'>
+ * {@literal @}Inject<br/>
+ * private PortletSession session;
+ * </div>
+ * </td>
+ * </tr>
+ * <!-- ************* -->
+ * <tr>
+ * <td>URLFactory</td>
+ * <td>Provides methods for creating URLs.
+ * See {@link javax.portlet.annotations.URLFactory URLFactory}.
+ * </td>
+ * <td>Any</td>
+ * <td>
+ * <div class='codebox'>
+ * {@literal @}Inject<br/>
+ * private URLFactory urlFactory;
+ * </div>
+ * </td>
+ * </tr>
+ * <!-- ************* -->
+ * <tr>
+ * <td>PortletMode</td>
+ * <td>The PortletMode object.
+ * </td>
+ * <td>
+ * {@literal @}RequestScoped
+ * or
+ * {@literal @}PortletStateScoped
+ * </td>
+ * <td>
+ * <div class='codebox'>
+ * {@literal @}Inject<br/>
+ * private PortletMode mode;
+ * </div>
+ * </td>
+ * </tr>
+ * <!-- ************* -->
+ * <tr>
+ * <td>WindowState</td>
+ * <td>The WindowState object.
+ * </td>
+ * <td>
+ * {@literal @}RequestScoped
+ * or
+ * {@literal @}PortletStateScoped
+ * </td>
+ * <td>
+ * <div class='codebox'>
+ * {@literal @}Inject<br/>
+ * private WindowState windowState;
+ * </div>
+ * </td>
+ * </tr>
+ * <!-- ************* -->
+ * <tr>
+ * <td>Cookies[]</td>
+ * <td>An array of Cookies set for the portlet.
+ * See {@link javax.portlet.PortletRequest#getCookies() getCookies}.
+ * </td>
+ * <td>
+ * {@literal @}RequestScoped
+ * or
+ * {@literal @}PortletStateScoped
+ * </td>
+ * <td>
+ * <div class='codebox'>
+ * {@literal @}Inject<br/>
+ * private Cookies[] cookies;
+ * </div>
+ * </td>
+ * </tr>
+ * <!-- ************* -->
+ * <tr>
+ * <td>Locale</td>
+ * <td>The Locale object.
+ * See {@link javax.portlet.PortletRequest#getLocale() getLocale}.
+ * </td>
+ * <td>
+ * {@literal @}RequestScoped
+ * or
+ * {@literal @}PortletStateScoped
+ * </td>
+ * <td>
+ * <div class='codebox'>
+ * {@literal @}Inject<br/>
+ * private Locale locale;
+ * </div>
+ * </td>
+ * </tr>
+ * <!-- ************* -->
+ * <tr>
+ * <td>Locales[]</td>
+ * <td>An array of supported Locales for the portlet.
+ * See {@link javax.portlet.PortletRequest#getLocales() getLocales}.
+ * </td>
+ * <td>
+ * {@literal @}RequestScoped
+ * or
+ * {@literal @}PortletStateScoped
+ * </td>
+ * <td>
+ * <div class='codebox'>
+ * {@literal @}Inject<br/>
+ * private Locales[] locales;
+ * </div>
+ * </td>
+ * </tr>
+ * </tbody>
+ * </table>
+ * <h4>Using the {@literal @}PortletStateScoped Annotation</h4>
+ * <p>
+ * The {@literal @}PortletStateScoped Annotation allows portlet render parameters
+ * to be treated as beans.
+ * The bean state is stored as a portlet render parameter.
+ * The annotation documentation for 
+ * {@link  javax.portlet.annotations.PortletStateScoped PortletStateScoped}
+ * describes the necessary prerequisites.
+ * </p>
+ * <p>
+ * The <code>paramName</code> element in the annotation can be used to provide a 
+ * parameter name for storing the bean.
+ * This element can also be left empty, in which case the portlet container will 
+ * generate a parameter name.
+ * </p>
+ * <p>
+ * When resource URLs are generated, {@literal @}PortletStateScoped beans valid for the
+ * current request are automatically stored on the URL as render parameters.
+ * When creating render or action URLs, {@literal @}PortletStateScoped beans can be
+ * automatically stored on the URL with the state valid for the current request by
+ * using the appropriate option with the <code>URLFactory</code>
+ * {@link  javax.portlet.annotations.URLFactory#createActionURL createActionURL} and
+ * {@link  javax.portlet.annotations.URLFactory#createRenderURL createRenderURL}
+ * methods.
+ * </p>
+ * <p>
+ * However, you might want to set a modified {@literal @}PortletStateScoped bean value
+ * on your URL.
+ * You can do this using the <code>PortletURL</code> interface
+ * {@link  javax.portlet.PortletURL#setBeanParameter setBeanParameter}
+ * method.
+ * You can create a new bean, set the fields as desired, and use the 
+ * <code>setBeanParameter</code> method to set the new bean on the URL.
+ * </p>
+ * <p>
+ * <span style="font-weight:bold; text-decoration:underline;">Tip:</span> 
+ * It might be useful to provide your {@literal @}PortletStateScoped
+ * bean with a copy constructor <b>in addition to</b> the required default constructor.
+ * You could then create a new {@literal @}PortletStateScoped bean based on the 
+ * current state of the injected bean and then update the fields on the new bean as required.
+ * </p>
+ */
+package javax.portlet.annotations;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/filter/ActionRequestWrapper.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/filter/ActionRequestWrapper.java b/portlet-api/src/main/java/javax/portlet/filter/ActionRequestWrapper.java
index 41fb116..237cd76 100644
--- a/portlet-api/src/main/java/javax/portlet/filter/ActionRequestWrapper.java
+++ b/portlet-api/src/main/java/javax/portlet/filter/ActionRequestWrapper.java
@@ -1,155 +1,90 @@
-/*  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.
- */
-
-/*
- * This source code implements specifications defined by the Java
- * Community Process. In order to remain compliant with the specification
- * DO NOT add / change / or delete method signatures!
- */
-
-package javax.portlet.filter;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-
-import javax.portlet.ActionParameters;
-import javax.portlet.ActionRequest;
-import javax.portlet.PortletParameters;
-
-/**
- * <span class="changed_modified_3_0">The</span> 
- * <code>ActionRequestWrapper</code> provides a convenient 
- * implementation of the <code>ActionRequest</code> interface 
- * that can be subclassed by developers wishing to adapt the request.
- * This class implements the Wrapper or Decorator pattern. 
- * Methods default to calling through to the wrapped request object.
- *
- * @since 2.0
- * @see ActionRequest
- */
-public class ActionRequestWrapper extends PortletRequestWrapper implements ActionRequest {
-
-    ActionRequest request;
-    
-    /**
-     * Creates an <code>ActionRequest</code> adaptor 
-     * wrapping the given request object.
-     * 
-     * @param request  the action request to wrap
-     * @throws java.lang.IllegalArgumentException if the request is <code>null</code>
-     */
-    public ActionRequestWrapper(ActionRequest request) {
-        super(request);
-        this.request = request;
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getCharacterEncoding()</code> on the wrapped request object.
-     */
-    public String getCharacterEncoding() {      
-        return request.getCharacterEncoding();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getContentLength()</code> on the wrapped request object.
-     */
-    public int getContentLength() {
-        return request.getContentLength();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getContentType()</code> on the wrapped request object.
-     */
-    public String getContentType() {
-        return request.getContentType();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPortletInputStream()</code> on the wrapped request object.
-     */
-    public InputStream getPortletInputStream() throws IOException {
-        return request.getPortletInputStream();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getReader()</code> on the wrapped request object.
-     */
-    public BufferedReader getReader() throws UnsupportedEncodingException,
-            IOException {
-        return request.getReader();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>setCharacterEncoding(String enc)</code> 
-     * on the wrapped request object.
-     */
-    public void setCharacterEncoding(String enc)
-            throws UnsupportedEncodingException {
-       request.setCharacterEncoding(enc);
-    }
-
-
-    /**
-     * Return the wrapped request object.
-     * 
-     * @return the wrapped request
-     */
-    public ActionRequest getRequest() {
-        return request;
-    }
-
-    /**
-     * Sets the request object being wrapped.
-     * 
-     * @param request the request to set
-     * @throws java.lang.IllegalArgumentException   if the request is null.
-     */
-    public void setRequest(ActionRequest request) {
-    	if ( request == null)
-    		throw new java.lang.IllegalArgumentException("Request is null");
-
-        this.request = request;
-    }
-
-    /**
-     *  The default behavior of this method is to call 
-     * <code>getMethod()</code> on the wrapped request object.
-     */
-    public String getMethod() {
-        return request.getMethod();
-    }
-
-    /**
-     * <div class="changed_added_3_0">
-     *  The default behavior of this method is to call 
-     * <code>getActionParameters()</code> on the wrapped request object.
-     * </div>
-     */
-   public ActionParameters getActionParameters() {
-      return request.getActionParameters();
-   }
-
-}
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import javax.portlet.ActionParameters;
+import javax.portlet.ActionRequest;
+
+/**
+ * <span class="changed_modified_3_0">The</span> 
+ * <code>ActionRequestWrapper</code> provides a convenient 
+ * implementation of the <code>ActionRequest</code> interface 
+ * that can be subclassed by developers wishing to adapt the request.
+ * This class implements the Wrapper or Decorator pattern. 
+ * Methods default to calling through to the wrapped request object.
+ *
+ * @since 2.0
+ * @see ActionRequest
+ */
+public class ActionRequestWrapper extends ClientDataRequestWrapper implements ActionRequest {
+
+   ActionRequest request;
+
+   /**
+    * Creates an <code>ActionRequest</code> adaptor 
+    * wrapping the given request object.
+    * 
+    * @param request  the action request to wrap
+    * @throws java.lang.IllegalArgumentException if the request is <code>null</code>
+    */
+   public ActionRequestWrapper(ActionRequest request) {
+      super(request);
+      this.request = request;
+   }
+
+   /**
+    * Return the wrapped request object.
+    * 
+    * @return the wrapped request
+    */
+   public ActionRequest getRequest() {
+      return request;
+   }
+
+   /**
+    * Sets the request object being wrapped.
+    * 
+    * @param request the request to set
+    * @throws java.lang.IllegalArgumentException   if the request is null.
+    */
+   public void setRequest(ActionRequest request) {
+      if ( request == null) {
+         throw new java.lang.IllegalArgumentException("Request is null");
+      }
+      super.setRequest(request);
+      this.request = request;
+   }
+
+   /**
+    * <div class="changed_added_3_0">
+    *  The default behavior of this method is to call 
+    * <code>getActionParameters()</code> on the wrapped request object.
+    * </div>
+    */
+   public ActionParameters getActionParameters() {
+      return request.getActionParameters();
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/filter/ActionResponseWrapper.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/filter/ActionResponseWrapper.java b/portlet-api/src/main/java/javax/portlet/filter/ActionResponseWrapper.java
index 6542d82..4ad1be0 100644
--- a/portlet-api/src/main/java/javax/portlet/filter/ActionResponseWrapper.java
+++ b/portlet-api/src/main/java/javax/portlet/filter/ActionResponseWrapper.java
@@ -1,209 +1,106 @@
-/*  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.
- */
-
-/*
- * This source code implements specifications defined by the Java
- * Community Process. In order to remain compliant with the specification
- * DO NOT add / change / or delete method signatures!
- */
-
-package javax.portlet.filter;
-
-import java.io.IOException;
-import java.util.Map;
-
-import javax.portlet.ActionResponse;
-import javax.portlet.MutablePortletParameters;
-import javax.portlet.MutableRenderParameters;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletModeException;
-import javax.portlet.WindowState;
-import javax.portlet.WindowStateException;
-import javax.xml.namespace.QName;
-
-/**
- * <span class="changed_modified_3_0">The</span> 
- * <code>ActionResponseWrapper</code> provides a convenient 
- * implementation of the <code>ActionResponse</code> interface 
- * that can be subclassed by developers wishing to adapt the response.
- * This class implements the Wrapper or Decorator pattern. 
- * Methods default to calling through to the wrapped response object.
- *
- * @since 2.0
- * @see ActionResponse
- */
-public class ActionResponseWrapper extends PortletResponseWrapper implements ActionResponse {
-
-   ActionResponse response;
-    
-    /**
-     * Creates an <code>ActionResponse</code> adaptor 
-     * wrapping the given response object.
-     * 
-     * @param response  the action response to wrap
-     * @throws java.lang.IllegalArgumentException if the response is <code>null</code>
-     */
-    public ActionResponseWrapper(ActionResponse response) {
-    	super(response);
-    	this.response = response;
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>sendRedirect(location)</code> on the wrapped response object.
-     */
-    public void sendRedirect(String location) throws IOException {
-        response.sendRedirect(location);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>sendRedirect(location, renderUrlParamName)</code> on the wrapped response object.
-     */
-    public void sendRedirect(String location, String renderUrlParamName) throws IOException {
-        response.sendRedirect(location, renderUrlParamName);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>setEvent(name, value)</code> on the wrapped response object.
-     */
-    public void setEvent(QName name, java.io.Serializable value) {
-        response.setEvent(name, value);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>setPortletMode(portletMode)</code> on the wrapped response object.
-     */
-    public void setPortletMode(PortletMode portletMode)
-            throws PortletModeException {
-        response.setPortletMode(portletMode);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>setRenderParameter(key, value)</code> on the wrapped response object.
-     */
-    @Deprecated
-    public void setRenderParameter(String key, String value) {
-        response.setRenderParameter(key, value);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>setRenderParameter(key, value)</code> on the wrapped response object.
-     */
-    @Deprecated
-    public void setRenderParameter(String key, String... values) {
-        response.setRenderParameter(key, values);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>setRenderParameters(parameters)</code> on the wrapped response object.
-     */
-    @Deprecated
-    public void setRenderParameters(Map<String, String[]> parameters) {
-        response.setRenderParameters(parameters);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>setWindowState(windowState)</code> on the wrapped response object.
-     */
-    public void setWindowState(WindowState windowState)
-            throws WindowStateException {
-        response.setWindowState(windowState);
-    }
-
-     /**
-     * Return the wrapped response object.
-     * 
-     * @return the wrapped response
-     */
-    public ActionResponse getResponse() {
-        return response;
-    }
-
-    /**
-     * Sets the response object being wrapped.
-     * 
-     * @param response the response to set
-     * @throws java.lang.IllegalArgumentException   if the response is null.
-     */
-    public void setResponse(ActionResponse response) {
-    	if ( response == null)
-    		throw new java.lang.IllegalArgumentException("Response is null");
-
-    	this.response = response;
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPortletMode()</code> on the wrapped response object.
-     */
-    public PortletMode getPortletMode() {
-        return response.getPortletMode();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getRenderParameterMap()</code> on the wrapped response object.
-     */
-    @Deprecated
-    public Map<String, String[]> getRenderParameterMap() {
-        return response.getRenderParameterMap();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getWindowState()</code> on the wrapped response object.
-     */
-    public WindowState getWindowState() {
-        return response.getWindowState();
-    }
-
-    /**
-     *  The default behavior of this method is to call 
-     * <code>setEvent()</code> on the wrapped response object.
-     */
-	public void setEvent(String name, java.io.Serializable value) {
-		response.setEvent(name, value);
-	}
-
-    /**
-     *  The default behavior of this method is to call 
-     * <code>removePublicRenderParameter()</code> on the wrapped response object.
-     */
-	@Deprecated
-	public void removePublicRenderParameter(String name) {
-		response.removePublicRenderParameter(name);		
-	}
-
-   /**
-    * <div class="changed_added_3_0">
-    *  The default behavior of this method is to call 
-    * <code>getRenderParameter()</code> on the wrapped response object.
-    * </div>
-    */
-   public MutableRenderParameters getRenderParameters() {
-      return response.getRenderParameters();
-   }
-
-}
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import java.io.IOException;
+
+import javax.portlet.ActionResponse;
+import javax.portlet.MimeResponse.Copy;
+import javax.portlet.RenderURL;
+
+/**
+ * <span class="changed_modified_3_0">The</span> 
+ * <code>ActionResponseWrapper</code> provides a convenient 
+ * implementation of the <code>ActionResponse</code> interface 
+ * that can be subclassed by developers wishing to adapt the response.
+ * This class implements the Wrapper or Decorator pattern. 
+ * Methods default to calling through to the wrapped response object.
+ *
+ * @since 2.0
+ * @see ActionResponse
+ */
+public class ActionResponseWrapper extends StateAwareResponseWrapper implements ActionResponse {
+
+   ActionResponse response;
+
+   /**
+    * Creates an <code>ActionResponse</code> adaptor 
+    * wrapping the given response object.
+    * 
+    * @param response  the action response to wrap
+    * @throws java.lang.IllegalArgumentException if the response is <code>null</code>
+    */
+   public ActionResponseWrapper(ActionResponse response) {
+      super(response);
+      this.response = response;
+   }
+
+   /**
+    * Return the wrapped response object.
+    * 
+    * @return the wrapped response
+    */
+   public ActionResponse getResponse() {
+      return response;
+   }
+
+   /**
+    * Sets the response object being wrapped.
+    * 
+    * @param response the response to set
+    * @throws java.lang.IllegalArgumentException   if the response is null.
+    */
+   public void setResponse(ActionResponse response) {
+      if ( response == null) {
+         throw new java.lang.IllegalArgumentException("Response is null");
+      }
+      super.setResponse(response);
+      this.response = response;
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>sendRedirect(location)</code> on the wrapped response object.
+    */
+   public void sendRedirect(String location) throws IOException {
+      response.sendRedirect(location);
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>sendRedirect(location, renderUrlParamName)</code> on the wrapped response object.
+    */
+   public void sendRedirect(String location, String renderUrlParamName) throws IOException {
+      response.sendRedirect(location, renderUrlParamName);
+   }
+
+   /**
+    * call wrapped object.
+    */
+   public RenderURL getRedirectURL(Copy option) throws IllegalStateException {
+      return response.getRedirectURL(option);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/filter/ClientDataRequestWrapper.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/filter/ClientDataRequestWrapper.java b/portlet-api/src/main/java/javax/portlet/filter/ClientDataRequestWrapper.java
new file mode 100644
index 0000000..ad0114d
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/filter/ClientDataRequestWrapper.java
@@ -0,0 +1,125 @@
+/*  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.
+ */
+
+
+package javax.portlet.filter;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+
+import javax.portlet.ClientDataRequest;
+
+/**
+ * <div class="changed_added_3_0">
+ * The <code>ClientDataRequestWrapper</code> provides a convenient 
+ * implementation of the <code>ClientDataRequest</code> interface 
+ * that can be subclassed by developers wishing to adapt the request.
+ * This class implements the Wrapper or Decorator pattern. 
+ * Methods default to calling through to the wrapped request object.
+ * </div>
+ */
+public class ClientDataRequestWrapper extends PortletRequestWrapper implements
+ClientDataRequest {
+
+   ClientDataRequest request;
+
+   /**
+    * @param request
+    */
+   public ClientDataRequestWrapper(ClientDataRequest request) {
+      super(request);
+      this.request = request;
+   }
+
+   /**
+    * Return the wrapped request object.
+    * 
+    * @return the wrapped request
+    */
+   public ClientDataRequest getRequest() {
+      return request;
+   }
+
+   /**
+    * Sets the request object being wrapped.
+    * 
+    * @param request the request to set
+    * @throws java.lang.IllegalArgumentException   if the request is null.
+    */
+   public void setRequest(ClientDataRequest request) {
+      if ( request == null) {
+         throw new java.lang.IllegalArgumentException("Request is null");
+      }
+      super.setRequest(request);
+      this.request = request;
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.ClientDataRequest#getPortletInputStream()
+    */
+   public InputStream getPortletInputStream() throws IOException {
+      return request.getPortletInputStream();
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.ClientDataRequest#setCharacterEncoding(java.lang.String)
+    */
+   public void setCharacterEncoding(String enc)
+         throws UnsupportedEncodingException {
+      request.setCharacterEncoding(enc);
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.ClientDataRequest#getReader()
+    */
+   public BufferedReader getReader() throws UnsupportedEncodingException,
+   IOException {
+      return request.getReader();
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.ClientDataRequest#getCharacterEncoding()
+    */
+   public String getCharacterEncoding() {
+      return request.getCharacterEncoding();
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.ClientDataRequest#getContentType()
+    */
+   public String getContentType() {
+      return request.getContentType();
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.ClientDataRequest#getContentLength()
+    */
+   public int getContentLength() {
+      return request.getContentLength();
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.ClientDataRequest#getMethod()
+    */
+   public String getMethod() {
+      return request.getMethod();
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/filter/EventRequestWrapper.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/filter/EventRequestWrapper.java b/portlet-api/src/main/java/javax/portlet/filter/EventRequestWrapper.java
index d13b014..d035974 100644
--- a/portlet-api/src/main/java/javax/portlet/filter/EventRequestWrapper.java
+++ b/portlet-api/src/main/java/javax/portlet/filter/EventRequestWrapper.java
@@ -1,96 +1,98 @@
-/*  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.
- */
-
-/*
- * This source code implements specifications defined by the Java
- * Community Process. In order to remain compliant with the specification
- * DO NOT add / change / or delete method signatures!
- */
-
-package javax.portlet.filter;
-
-import javax.portlet.Event;
-import javax.portlet.EventRequest;
-
-/**
- * The <code>EventRequestWrapper</code> provides a convenient 
- * implementation of the <code>EventRequest</code> interface 
- * that can be subclassed by developers wishing to adapt the request.
- * This class implements the Wrapper or Decorator pattern. 
- * Methods default to calling through to the wrapped request object.
- *
- * @since 2.0
- * @see EventRequest
- */
-public class EventRequestWrapper extends PortletRequestWrapper implements EventRequest {
-
-    EventRequest request;
-    
-    
-    /**
-     * Creates an <code>EventRequest</code> adaptor 
-     * wrapping the given request object.
-     * 
-     * @param request  the event request to wrap
-     * @throws java.lang.IllegalArgumentException if the request is <code>null</code>
-     */
-    public EventRequestWrapper(EventRequest request) {
-    	super(request);
-    	this.request = request;
-    }
-
-    /**
-     * Return the wrapped request object.
-     * 
-     * @return the wrapped request
-     */
-    public EventRequest getRequest() {
-        return request;
-    }
-
-    /**
-     * Sets the request object being wrapped.
-     * 
-     * @param request the request to set
-     * @throws java.lang.IllegalArgumentException   if the request is null.
-     */
-    public void setRequest(EventRequest request) {
-    	if ( request == null)
-    		throw new java.lang.IllegalArgumentException("Request is null");
-
-        this.request = request;
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getEvent()</code> on the wrapped request object.
-     */
-    public Event getEvent() {
-        return request.getEvent();
-    }
-
-    /**
-     *  The default behavior of this method is to call 
-     * <code>getMethod()</code> on the wrapped request object.
-     */
-    public String getMethod() {
-        return request.getMethod();
-    }
-
-
-}
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import javax.portlet.Event;
+import javax.portlet.EventRequest;
+
+/**
+ * <span class="changed_modified_3_0">The</span> 
+ * <code>EventRequestWrapper</code> provides a convenient 
+ * implementation of the <code>EventRequest</code> interface 
+ * that can be subclassed by developers wishing to adapt the request.
+ * This class implements the Wrapper or Decorator pattern. 
+ * Methods default to calling through to the wrapped request object.
+ *
+ * @since 2.0
+ * @see EventRequest
+ */
+public class EventRequestWrapper extends PortletRequestWrapper implements EventRequest {
+
+   EventRequest request;
+
+
+   /**
+    * Creates an <code>EventRequest</code> adaptor 
+    * wrapping the given request object.
+    * 
+    * @param request  the event request to wrap
+    * @throws java.lang.IllegalArgumentException if the request is <code>null</code>
+    */
+   public EventRequestWrapper(EventRequest request) {
+      super(request);
+      this.request = request;
+   }
+
+   /**
+    * Return the wrapped request object.
+    * 
+    * @return the wrapped request
+    */
+   public EventRequest getRequest() {
+      return request;
+   }
+
+   /**
+    * Sets the request object being wrapped.
+    * 
+    * @param request the request to set
+    * @throws java.lang.IllegalArgumentException   if the request is null.
+    */
+   public void setRequest(EventRequest request) {
+      if ( request == null) {
+         throw new java.lang.IllegalArgumentException("Request is null");
+      }
+      super.setRequest(request);
+      this.request = request;
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getEvent()</code> on the wrapped request object.
+    */
+   public Event getEvent() {
+      return request.getEvent();
+   }
+
+   /**
+    *  The default behavior of this method is to call 
+    * <code>getMethod()</code> on the wrapped request object.
+    */
+   public String getMethod() {
+      return request.getMethod();
+   }
+
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/filter/EventResponseWrapper.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/filter/EventResponseWrapper.java b/portlet-api/src/main/java/javax/portlet/filter/EventResponseWrapper.java
index dc38240..1831a29 100644
--- a/portlet-api/src/main/java/javax/portlet/filter/EventResponseWrapper.java
+++ b/portlet-api/src/main/java/javax/portlet/filter/EventResponseWrapper.java
@@ -1,204 +1,89 @@
-/*  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.
- */
-
-/*
- * This source code implements specifications defined by the Java
- * Community Process. In order to remain compliant with the specification
- * DO NOT add / change / or delete method signatures!
- */
-
-package javax.portlet.filter;
-
-import java.util.Map;
-
-import javax.portlet.EventRequest;
-import javax.portlet.EventResponse;
-import javax.portlet.MutablePortletParameters;
-import javax.portlet.MutableRenderParameters;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletModeException;
-import javax.portlet.WindowState;
-import javax.portlet.WindowStateException;
-import javax.xml.namespace.QName;
-
-/**
- * <span class="changed_modified_3_0">The</span> 
- * <code>EventResponseWrapper</code> provides a convenient 
- * implementation of the <code>EventResponse</code> interface 
- * that can be subclassed by developers wishing to adapt the response.
- * This class implements the Wrapper or Decorator pattern. 
- * Methods default to calling through to the wrapped response object.
- *
- * @since 2.0
- * @see EventResponse
- */
-
-public class EventResponseWrapper extends PortletResponseWrapper implements EventResponse {
-
-    EventResponse response;
-     
-     /**
-      * Creates an <code>EventResponse</code> adaptor 
-      * wrapping the given response object.
-      * 
-      * @param response  the event response to wrap
-      * @throws java.lang.IllegalArgumentException if the response is <code>null</code>
-      */
-     public EventResponseWrapper(EventResponse response) {
-    	 super(response);
-         this.response = response;
-     }
-
-     /**
-      * The default behavior of this method is to call 
-      * <code>setEvent(name, value)</code> on the wrapped response object.
-      */
-     public void setEvent(QName name, java.io.Serializable value) {
-         response.setEvent(name, value);
-     }
-
-     /**
-      * The default behavior of this method is to call 
-      * <code>setPortletMode(portletMode)</code> on the wrapped response object.
-      */
-     public void setPortletMode(PortletMode portletMode)
-             throws PortletModeException {
-         response.setPortletMode(portletMode);
-     }
-
-     /**
-      * The default behavior of this method is to call 
-      * <code>setRenderParameter(key, value)</code> on the wrapped response object.
-      */
-     @Deprecated
-     public void setRenderParameter(String key, String value) {
-         response.setRenderParameter(key, value);
-     }
-
-     /**
-      * The default behavior of this method is to call 
-      * <code>setRenderParameter(key, value)</code> on the wrapped response object.
-      */
-     
-     @Deprecated
-     public void setRenderParameter(String key, String ... values) {
-         response.setRenderParameter(key, values);
-     }
-
-     /**
-      * The default behavior of this method is to call 
-      * <code>setRenderParameters(parameters)</code> on the wrapped response object.
-      */
-     @Deprecated
-     public void setRenderParameters(Map<String, String[]> parameters) {
-         response.setRenderParameters(parameters);
-     }
-
-     /**
-      * The default behavior of this method is to call 
-      * <code>setWindowState(windowState)</code> on the wrapped response object.
-      */
-     public void setWindowState(WindowState windowState)
-             throws WindowStateException {
-         response.setWindowState(windowState);
-     }
-
-     /**
-      * Return the wrapped response object.
-      * 
-      * @return the wrapped response
-      */
-     public EventResponse getResponse() {
-         return response;
-     }
-
-     /**
-      * Sets the response object being wrapped.
-      * 
-      * @param response the response to set
-      * @throws java.lang.IllegalArgumentException   if the response is null.
-      */
-     public void setResponse(EventResponse response) {
-	    	if ( response == null)
-	    		throw new java.lang.IllegalArgumentException("Response is null");
-
-	    	this.response = response;
-     }
-
-     /**
-      * The default behavior of this method is to call 
-      * <code>getPortletMode()</code> on the wrapped response object.
-      */
-     public PortletMode getPortletMode() {
-         return response.getPortletMode();
-     }
-
-     /**
-      * The default behavior of this method is to call 
-      * <code>getRenderParameterMap()</code> on the wrapped response object.
-      */
-     @Deprecated
-     public Map<String, String[]> getRenderParameterMap() {
-         return response.getRenderParameterMap();
-     }
-
-     /**
-      * The default behavior of this method is to call 
-      * <code>getWindowState()</code> on the wrapped response object.
-      */
-     public WindowState getWindowState() {
-         return response.getWindowState();
-     }
-
-     /**
-      *  The default behavior of this method is to call 
-      * <code>setRenderParameters()</code> on the wrapped response object.
-      */
-     @Deprecated
-     public void setRenderParameters(EventRequest request) {
-         response.setRenderParameters(request);         
-     }
-
-     /**
-      *  The default behavior of this method is to call 
-      * <code>setEvent()</code> on the wrapped response object.
-      */
- 	public void setEvent(String name, java.io.Serializable value) {
- 		response.setEvent(name, value);
- 	}
- 	
-    /**
-     *  The default behavior of this method is to call 
-     * <code>removePublicRenderParameter()</code> on the wrapped response object.
-     */
- 	@Deprecated
-	public void removePublicRenderParameter(String name) {
-		response.removePublicRenderParameter(name);		
-	}
-
-   /**
-    * <div class="changed_added_3_0">
-    *  The default behavior of this method is to call 
-    * <code>getRenderParameter()</code> on the wrapped response object.
-    * </div>
-    */
-   public MutableRenderParameters getRenderParameters() {
-      return response.getRenderParameters();
-   }
-
-}
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+
+/**
+ * <span class="changed_modified_3_0">The</span> 
+ * <code>EventResponseWrapper</code> provides a convenient 
+ * implementation of the <code>EventResponse</code> interface 
+ * that can be subclassed by developers wishing to adapt the response.
+ * This class implements the Wrapper or Decorator pattern. 
+ * Methods default to calling through to the wrapped response object.
+ *
+ * @since 2.0
+ * @see EventResponse
+ */
+
+public class EventResponseWrapper extends StateAwareResponseWrapper implements EventResponse {
+
+   EventResponse response;
+
+   /**
+    * Creates an <code>EventResponse</code> adaptor 
+    * wrapping the given response object.
+    * 
+    * @param response  the event response to wrap
+    * @throws java.lang.IllegalArgumentException if the response is <code>null</code>
+    */
+   public EventResponseWrapper(EventResponse response) {
+      super(response);
+      this.response = response;
+   }
+
+   /**
+    * Return the wrapped response object.
+    * 
+    * @return the wrapped response
+    */
+   public EventResponse getResponse() {
+      return response;
+   }
+
+   /**
+    * Sets the response object being wrapped.
+    * 
+    * @param response the response to set
+    * @throws java.lang.IllegalArgumentException   if the response is null.
+    */
+   public void setResponse(EventResponse response) {
+      if ( response == null) {
+         throw new java.lang.IllegalArgumentException("Response is null");
+      }
+      super.setResponse(response);
+      this.response = response;
+   }
+
+   /**
+    *  The default behavior of this method is to call 
+    * <code>setRenderParameters()</code> on the wrapped response object.
+    */
+   @Deprecated
+   public void setRenderParameters(EventRequest request) {
+      response.setRenderParameters(request);         
+   }
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/filter/HeaderFilter.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/filter/HeaderFilter.java b/portlet-api/src/main/java/javax/portlet/filter/HeaderFilter.java
new file mode 100644
index 0000000..6e95b60
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/filter/HeaderFilter.java
@@ -0,0 +1,113 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import java.io.IOException;
+
+import javax.portlet.HeaderRequest;
+import javax.portlet.HeaderResponse;
+import javax.portlet.PortletException;
+
+/**
+ * <div class="changed_added_3_0">
+ * The <code>HeaderFilter</code> is an object that performs filtering 
+ * tasks on either the header request to a portlet, or on the header response from 
+ * a portlet, or both.
+ * <p>
+ * Filters perform filtering in the <code>doFilter</code> method. Every Filter has 
+ * access to a <code>FilterConfig</code> object from which it can obtain 
+ * its initialization parameters, a reference to the PortletContext 
+ * which it can use, for example, to load resources needed for filtering tasks.
+ * <p>
+ * Filters are configured in the portlet deployment descriptor of a 
+ * portlet application.
+ * </div> 
+ * 
+ * @since 2.0
+ */
+public interface HeaderFilter extends PortletFilter {
+
+    /**
+     * The <code>doFilter</code> method of the Filter is called by the 
+     * portlet container each time a header request/response pair is passed 
+     * through the chain due to a client request for a portlet method 
+     * at the end of the chain. 
+     * <p>
+     * The <code>FilterChain</code> passed in to this method allows 
+     * the Filter to pass on the header request and response to the next 
+     * component in the chain.
+     * <p>
+     * The <code>doFilter</code> method of a filter will typically be implemented 
+     * following this or some subset of the following pattern:
+     * <ul>
+     *  <li>The method examines the request information.</li>
+     *  <li>The method may wrap the request object passed in to 
+     *      its doFilter method with a customized implementation 
+     *      the request wrapper <code>HeaderRequestWrapper</code> 
+     *      in order to modify request data.</li>
+     *  <li>The method may wrap the response object passed in to its 
+     *      <code>doFilter</code> method with a customized implementation 
+     *      of the response wrapper <code>HeaderResponseWrapper</code> 
+     *      to modify response data.</li>
+     *  <li>The filter may invoke the next component in the filter chain. 
+     *      The next component may be another filter, or if the filter 
+     *      making the invocation is the last filter configured in the 
+     *      deployment descriptor for this chain, the next component 
+     *      is the target method of the portlet. The invocation of the 
+     *      next component is effected by calling the <code>doFilter</code>
+     *      method on the <code>FilterChain</code> object, and passing in 
+     *      the request and response with which it was called or passing 
+     *      in wrapped versions it may have created. 
+     *      The filter chain's implementation of the <code>doFilter</code> 
+     *      method, provided by the portlet container, must locate the 
+     *      next component in the filter chain and invoke its <code>doFilter</code>
+     *      method, passing in the appropriate request and response objects. 
+     *      Alternatively, the filter chain can block the request by not 
+     *      making the call to invoke the next component, leaving the filter 
+     *      responsible for filling out the response object.</li>
+     *  <li>After invocation of the next filter in the chain, the filter 
+     *      may examine the response data.</li>
+     *  <li>Alternatively, the filter may have thrown an exception to 
+     *      indicate an error in processing. If the filter throws an 
+     *      <code>UnavailableException</code> during its <code>doFilter</code> 
+     *      processing, the portlet container must not attempt continued 
+     *      processing down the filter chain. It may choose to retry the 
+     *      whole chain at a later time if the exception is not marked permanent.</li>
+     *  <li>When the last filter in the chain has been invoked, the next 
+     *      component accessed is the target method on the portlet at 
+     *      the end of the chain.</li>
+     * </ul>
+     * 
+     * @param request  the current header request 
+     * @param response  the current header response 
+     * @param chain  the remaining filter chain
+     * @throws IOException  if an IO error occurred in the filter processing
+     * @throws PortletException  if a portlet exception occurred in the filter processing
+     */
+    public void doFilter(HeaderRequest request, HeaderResponse response,
+                         HeaderFilterChain chain)
+     throws IOException, PortletException;
+        
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/filter/HeaderFilterChain.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/filter/HeaderFilterChain.java b/portlet-api/src/main/java/javax/portlet/filter/HeaderFilterChain.java
new file mode 100644
index 0000000..1cb907f
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/filter/HeaderFilterChain.java
@@ -0,0 +1,61 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import java.io.IOException;
+
+import javax.portlet.PortletException;
+import javax.portlet.HeaderRequest;
+import javax.portlet.HeaderResponse;
+
+/**
+ * <div class="changed_added_3_0">
+ * A <code>HeaderFilterChain</code> object is provided by the portlet container 
+ * to give a view into the invocation chain of a 
+ * filtered header request for a portlet. Filters use the <code>HeaderFilterChain</code> 
+ * to invoke the next filter in the chain, or if the calling filter is the 
+ * last filter in the chain, to invoke the portlet at the end of the chain.
+ * </div>
+ *
+ * @since 3.0
+ */
+public interface HeaderFilterChain {
+    
+    /**
+     * Causes the next filter in the chain to be invoked, 
+     * or if the calling filter is the last filter in the chain, 
+     * causes the portlet at the end of the chain to be invoked.
+     * 
+     * @param request  the current header request. 
+     * @param response  the current header response.
+     *  
+     * @throws IOException  if an IO error occurred in the filter processing
+     * @throws PortletException  if a portlet exception occurred in the filter processing
+     */
+    public void doFilter(HeaderRequest request, HeaderResponse response)
+     throws IOException, PortletException;
+
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/filter/HeaderRequestWrapper.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/filter/HeaderRequestWrapper.java b/portlet-api/src/main/java/javax/portlet/filter/HeaderRequestWrapper.java
new file mode 100644
index 0000000..5334907
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/filter/HeaderRequestWrapper.java
@@ -0,0 +1,80 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import javax.portlet.HeaderRequest;
+
+/**
+ * <div class="changed_added_3_0">
+ * The <code>HeaderRequestWrapper</code> provides a convenient 
+ * implementation of the <code>HeaderRequest</code> interface 
+ * that can be subclassed by developers wishing to adapt the request.
+ * This class implements the Wrapper or Decorator pattern. 
+ * Methods default to calling through to the wrapped request object.
+ * </div>
+ *
+ * @since 2.0
+ * @see HeaderRequest
+ */
+public class HeaderRequestWrapper extends RenderRequestWrapper implements HeaderRequest {
+
+    HeaderRequest request;
+    
+    /**
+     * Creates an <code>HeaderRequest</code> adaptor 
+     * wrapping the given request object.
+     * 
+     * @param request  the render request to wrap
+     * @throws java.lang.IllegalArgumentException if the request is <code>null</code>
+     */
+    public HeaderRequestWrapper(HeaderRequest request) {
+    	super(request);
+    	this.request = request;
+    }
+
+    /**
+     * Return the wrapped request object.
+     * 
+     * @return the wrapped request
+     */
+    public HeaderRequest getRequest() {
+       return request;
+    }
+
+    /**
+     * Sets the request object being wrapped.
+     * 
+     * @param request the request to set
+     * @throws java.lang.IllegalArgumentException   if the request is null.
+     */
+    public void setRequest(HeaderRequest request) {
+       if ( request == null) {
+          throw new java.lang.IllegalArgumentException("Request is null");
+       }
+       super.setRequest(request);
+       this.request = request;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/filter/HeaderResponseWrapper.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/filter/HeaderResponseWrapper.java b/portlet-api/src/main/java/javax/portlet/filter/HeaderResponseWrapper.java
new file mode 100644
index 0000000..bccd50d
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/filter/HeaderResponseWrapper.java
@@ -0,0 +1,76 @@
+/*  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.
+ */
+
+
+package javax.portlet.filter;
+
+import javax.portlet.HeaderResponse;
+
+/**
+ * <div class="changed_added_3_0">
+ * The <code>HeaderResponseWrapper</code> provides a convenient 
+ * implementation of the <code>HeaderResponse</code> interface 
+ * that can be subclassed by developers wishing to adapt the Response.
+ * This class implements the Wrapper or Decorator pattern. 
+ * Methods default to calling through to the wrapped Response object.
+ * </div>
+ */
+public class HeaderResponseWrapper extends MimeResponseWrapper implements
+HeaderResponse {
+
+   HeaderResponse response;
+
+   /**
+    * @param response
+    */
+   public HeaderResponseWrapper(HeaderResponse response) {
+      super(response);
+      this.response = response;
+   }
+
+   /**
+    * Return the wrapped response object.
+    * 
+    * @return the wrapped response
+    */
+   public HeaderResponse getResponse() {
+      return response;
+   }
+
+   /**
+    * Sets the response object being wrapped.
+    * 
+    * @param response the response to set
+    * @throws java.lang.IllegalArgumentException   if the response is null.
+    */
+   public void setResponse(HeaderResponse response) {
+      if ( response == null) {
+         throw new java.lang.IllegalArgumentException("Response is null");
+      }
+      super.setResponse(response);
+      this.response = response;
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.HeaderResponse#setTitle(java.lang.String)
+    */
+   public void setTitle(String title) {
+      response.setTitle(title);
+   }
+
+}


[20/38] portals-pluto git commit: moved pluto servlet version to 3.1. removed some debugging code

Posted by ms...@apache.org.
moved pluto servlet version to 3.1. removed some debugging code


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/0b1bf068
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/0b1bf068
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/0b1bf068

Branch: refs/heads/V3Prototype
Commit: 0b1bf0683eb002d3c5fa05076b61b677cf44edbf
Parents: 536c860
Author: Scott Nicklous <ms...@apache.org>
Authored: Fri Oct 30 10:36:16 2015 +0100
Committer: Scott Nicklous <ms...@apache.org>
Committed: Fri Oct 30 10:36:16 2015 +0100

----------------------------------------------------------------------
 .../om/portlet/impl/ConfigurationHolder.java    | 29 --------------------
 pluto-portal/src/main/webapp/WEB-INF/web.xml    | 17 ++++--------
 2 files changed, 5 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/0b1bf068/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java
index 51fdab9..f93904e 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java
@@ -120,35 +120,6 @@ public class ConfigurationHolder {
     */
    public void processPortletDD(InputStream stream)
          throws IOException, IllegalArgumentException, JAXBException, XMLStreamException {
-
-      if (isDebug) {
-         StringBuilder txt = new StringBuilder(128);
-         txt.append("Info about classloaders:");
-         ClassLoader mycl = this.getClass().getClassLoader();
-         ClassLoader jaxbcl = JAXBContext.class.getClassLoader();
-         ClassLoader ofcl = org.apache.pluto.container.om.portlet20.impl.ObjectFactory.class.getClassLoader();
-         ClassLoader syscl = null;
-         try {syscl = ClassLoader.getSystemClassLoader();} catch(Exception e) {}
-         txt.append("\nmy classloader: ").append((mycl != null) ? mycl.toString() : "null");
-         txt.append("\njaxb classloader: ").append((jaxbcl != null) ? jaxbcl.toString() : "null");
-         txt.append("\nof classloader: ").append((ofcl != null) ? ofcl.toString() : "null");
-         txt.append("\nsys classloader: ").append((syscl != null) ? syscl.toString() : "null");
-         Class<?> myof = null;
-         Class<?> jaxbof = null;
-         Class<?> ofof = null;
-         Class<?> sysof = null;
-         String clsName = "org.apache.pluto.container.om.portlet20.impl.ObjectFactory";
-         try {myof = mycl.loadClass(clsName);} catch(Exception e) {}
-         try {jaxbof = jaxbcl.loadClass(clsName);} catch(Exception e) {}
-         try {ofof = ofcl.loadClass(clsName);} catch(Exception e) {}
-         try {sysof = syscl.loadClass(clsName);} catch(Exception e) {}
-         txt.append("\nNow attempting to load: ").append(clsName);
-         txt.append("\nMycl loaded: ").append(myof != null);
-         txt.append("\nJaxbofcl loaded: ").append(jaxbof != null);
-         txt.append("\nOfcl loaded: ").append(ofof != null);
-         txt.append("\nSyscl loaded: ").append(sysof != null);
-         LOG.debug(txt.toString());
-      }
       
       ClassLoader mycl = this.getClass().getClassLoader();
       JAXBContext cntxt = JAXBContext.newInstance(JAXB_CONTEXT, mycl);

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/0b1bf068/pluto-portal/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/pluto-portal/src/main/webapp/WEB-INF/web.xml b/pluto-portal/src/main/webapp/WEB-INF/web.xml
index 7db86e3..60fdba0 100644
--- a/pluto-portal/src/main/webapp/WEB-INF/web.xml
+++ b/pluto-portal/src/main/webapp/WEB-INF/web.xml
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<web-app version="3.0"
-  xmlns="http://java.sun.com/xml/ns/javaee"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
-  http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
+<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
+         http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
+         version="3.1">
 <!-- 
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
@@ -55,13 +55,6 @@ limitations under the License.
     <display-name>Pluto Portal Driver</display-name>
     <servlet-name>plutoPortalDriver</servlet-name>
     <servlet-class>org.apache.pluto.driver.PortalDriverServlet</servlet-class>
-<!--  we'll probably want to implement multipart support in a different manner.   
-    <multipart-config>
-        <max-file-size>10485760</max-file-size>
-        <max-request-size>20971520</max-request-size>
-        <file-size-threshold>5242880</file-size-threshold>
-    </multipart-config>
--->
   </servlet>
 
   <servlet>


[25/38] portals-pluto git commit: Integrated latest version of the portlet API 3.0. Made necessary minor adaptations the Pluto code and demo portlets to make the previously available funtionality work. For the partial action request, changed implementati

Posted by ms...@apache.org.
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/filter/MimeResponseWrapper.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/filter/MimeResponseWrapper.java b/portlet-api/src/main/java/javax/portlet/filter/MimeResponseWrapper.java
new file mode 100644
index 0000000..0ebf65e
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/filter/MimeResponseWrapper.java
@@ -0,0 +1,223 @@
+/*  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.
+ */
+
+
+package javax.portlet.filter;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.Locale;
+
+import javax.portlet.ActionURL;
+import javax.portlet.CacheControl;
+import javax.portlet.MimeResponse;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderURL;
+import javax.portlet.ResourceURL;
+
+/**
+ * <div class="changed_added_3_0">
+ * The <code>MimeResponseWrapper</code> provides a convenient 
+ * implementation of the <code>MimeResponse</code> interface 
+ * that can be subclassed by developers wishing to adapt the response.
+ * This class implements the Wrapper or Decorator pattern. 
+ * Methods default to calling through to the wrapped response object.
+ * </div>
+ */
+public class MimeResponseWrapper extends PortletResponseWrapper implements
+MimeResponse {
+
+   MimeResponse response;
+
+   /**
+    * @param response
+    */
+   public MimeResponseWrapper(MimeResponse response) {
+      super(response);
+      this.response = response;
+   }
+
+   /**
+    * Return the wrapped response object.
+    * 
+    * @return the wrapped response
+    */
+   public MimeResponse getResponse() {
+      return response;
+   }
+
+   /**
+    * Sets the response object being wrapped.
+    * 
+    * @param response the response to set
+    * @throws java.lang.IllegalArgumentException   if the response is null.
+    */
+   public void setResponse(MimeResponse response) {
+      if ( response == null) {
+         throw new java.lang.IllegalArgumentException("Response is null");
+      }
+      super.setResponse(response);
+      this.response = response;
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>flushBuffer()</code> on the wrapped response object.
+    */ 
+   public void flushBuffer() throws IOException {
+      response.flushBuffer();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getBufferSize()</code> on the wrapped response object.
+    */
+   public int getBufferSize() {
+      return response.getBufferSize();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getCharacterEncoding()</code> on the wrapped response object.
+    */
+   public String getCharacterEncoding() {
+      return response.getCharacterEncoding();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getContentType()</code> on the wrapped response object.
+    */
+   public String getContentType() {
+      return response.getContentType();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getLocale()</code> on the wrapped response object.
+    */
+   public Locale getLocale() {
+      return response.getLocale();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getPortletOutputStream()</code> on the wrapped response object.
+    */
+   public OutputStream getPortletOutputStream() throws IOException {
+      return response.getPortletOutputStream();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getWriter()</code> on the wrapped response object.
+    */
+   public PrintWriter getWriter() throws IOException {
+      return response.getWriter();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>isCommitted()</code> on the wrapped response object.
+    */
+   public boolean isCommitted() {
+      return response.isCommitted();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>reset()</code> on the wrapped response object.
+    */
+   public void reset() {
+      response.reset();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>resetBuffer()</code> on the wrapped response object.
+    */
+   public void resetBuffer() {
+      response.resetBuffer();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>setBufferSize(size)</code> on the wrapped response object.
+    */
+   public void setBufferSize(int size) {
+      response.setBufferSize(size);
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getCacheControl()</code> on the wrapped response object.
+    */
+   public CacheControl getCacheControl() {
+      return response.getCacheControl();
+   }
+
+   /**
+    *  The default behavior of this method is to call 
+    * <code>createActionURL()</code> on the wrapped response object.
+    */
+   public <T extends PortletURL & ActionURL> T createActionURL() throws IllegalStateException {
+      return response.createActionURL();
+   }
+
+   /**
+    *  <span class="changed_added_3_0">The default behavior of this method is to call 
+    * <code>createActionURL(ParameterCopyOption)</code> on the wrapped response object.</span>
+    */
+   public ActionURL createActionURL(Copy option) throws IllegalStateException {
+      return response.createActionURL(option);
+   }
+
+   /**
+    *  The default behavior of this method is to call 
+    * <code>createRenderURL()</code> on the wrapped response object.
+    */
+   public <T extends PortletURL & RenderURL> T createRenderURL() throws IllegalStateException {
+      return response.createRenderURL();
+   }
+
+   /**
+    *  <span class="changed_added_3_0">The default behavior of this method is to call 
+    * <code>createRenderURL(ParameterCopyOption)</code> on the wrapped response object.</span>
+    */
+   public RenderURL createRenderURL(Copy option) throws IllegalStateException {
+      return response.createRenderURL(option);
+   }
+
+   /**
+    *  The default behavior of this method is to call 
+    * <code>createResourceURL()</code> on the wrapped response object.
+    */
+   public ResourceURL createResourceURL() throws IllegalStateException {
+      return response.createResourceURL();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>setContentType(type)</code> on the wrapped response object.
+    */
+   public void setContentType(String type) {
+      response.setContentType(type);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/filter/PortletRequestWrapper.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/filter/PortletRequestWrapper.java b/portlet-api/src/main/java/javax/portlet/filter/PortletRequestWrapper.java
index e198c2f..11cf811 100644
--- a/portlet-api/src/main/java/javax/portlet/filter/PortletRequestWrapper.java
+++ b/portlet-api/src/main/java/javax/portlet/filter/PortletRequestWrapper.java
@@ -1,422 +1,422 @@
-/*  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.
- */
-
-/*
- * This source code implements specifications defined by the Java
- * Community Process. In order to remain compliant with the specification
- * DO NOT add / change / or delete method signatures!
- */
-
-package javax.portlet.filter;
-
-import java.security.Principal;
-import java.util.Enumeration;
-import java.util.Locale;
-import java.util.Map;
-
-import javax.portlet.PortalContext;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletParameters;
-import javax.portlet.PortletPreferences;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletSession;
-import javax.portlet.RenderParameters;
-import javax.portlet.WindowState;
-import javax.servlet.http.Cookie;
-
-/**
- * <span class="changed_modified_3_0">The</span> 
- * <code>PortletRequestWrapper</code> provides a convenient 
- * implementation of the <code>PortletRequest</code> interface 
- * and is extended by other request wrappers.
- * This class implements the Wrapper or Decorator pattern. 
- * Methods default to calling through to the wrapped request object.
- *
- * @since 2.0
- * @see PortletRequest
- */
-public class PortletRequestWrapper implements PortletRequest {
-
-    PortletRequest request;
-    
-    /** 
-     * Require having a request for constructing
-    * the wrapper
-     */
-   
-   @SuppressWarnings("unused")
-    private PortletRequestWrapper() {
-    }
-    
-    
-    /**
-     * Creates an <code>PortletRequest</code> adaptor 
-     * wrapping the given request object.
-     * 
-     * @param request  the portlet request to wrap
-     * @throws java.lang.IllegalArgumentException if the request is <code>null</code>
-     */
-    public PortletRequestWrapper(PortletRequest request) {
-    	if ( request == null)
-    		throw new java.lang.IllegalArgumentException("Request is null");
-
-        this.request = request;
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getAttribute(String name)</code> on the wrapped request object.
-     */
-    public Object getAttribute(String name) {
-        return request.getAttribute(name);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getAttributeNames()</code> on the wrapped request object.
-     */
-    public Enumeration<String> getAttributeNames() {
-        return request.getAttributeNames();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getAuthType()</code> on the wrapped request object.
-     */
-    public String getAuthType() {
-        return request.getAuthType();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getContextPath()</code> on the wrapped request object.
-     */
-    public String getContextPath() {
-        return request.getContextPath();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getLocale()</code> on the wrapped request object.
-     */
-    public Locale getLocale() {
-        return request.getLocale();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getLocales()</code> on the wrapped request object.
-     */
-    public Enumeration<Locale> getLocales() {
-        return request.getLocales();
-    }
-
-    /**
-    * <div class="changed_modified_3_0"> 
-    * The default behavior of this method is to call 
-    * <code>getRenderParameters()</code> on the wrapped request object.
-    * </div>
-    */
-   public RenderParameters getRenderParameters() {
-      return request.getRenderParameters();
-   }
-
-   /**
-     * The default behavior of this method is to call 
-     * <code>getParameter(String name)</code> on the wrapped request object.
-     */
-   @Deprecated
-    public String getParameter(String name) {
-        return request.getParameter(name);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getParameterMap()</code> on the wrapped request object.
-     */
-   @Deprecated
-    public Map<String, String[]> getParameterMap() {
-        return request.getParameterMap();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getParameterNames()</code> on the wrapped request object.
-     */
-   @Deprecated
-    public Enumeration<String> getParameterNames() {
-        return request.getParameterNames();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getParameterValues(name)</code> on the wrapped request object.
-     */
-   @Deprecated
-    public String[] getParameterValues(String name) {
-        return request.getParameterValues(name);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPortalContext()</code> on the wrapped request object.
-     */
-    public PortalContext getPortalContext() {
-        return request.getPortalContext();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPortletMode()</code> on the wrapped request object.
-     */
-    public PortletMode getPortletMode() {
-        return request.getPortletMode();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPortletSession()</code> on the wrapped request object.
-     */
-    public PortletSession getPortletSession() {
-        return request.getPortletSession();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPortletSession(create)</code> on the wrapped request object.
-     */
-    public PortletSession getPortletSession(boolean create) {
-        return request.getPortletSession(create);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPreferences()</code> on the wrapped request object.
-     */
-    public PortletPreferences getPreferences() {
-        return request.getPreferences();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getProperteis(name)</code> on the wrapped request object.
-     */
-    public Enumeration<String> getProperties(String name) {
-        return request.getProperties(name);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getProperty(name)</code> on the wrapped request object.
-     */
-    public String getProperty(String name) {
-        return request.getProperty(name);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPropertyNames()</code> on the wrapped request object.
-     */
-    public Enumeration<String> getPropertyNames() {
-        return request.getPropertyNames();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getRemoteUser()</code> on the wrapped request object.
-     */
-    public String getRemoteUser() {
-        return request.getRemoteUser();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getRequestedSessionId()</code> on the wrapped request object.
-     */
-    public String getRequestedSessionId() {
-        return request.getRequestedSessionId();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getResponseContentType()</code> on the wrapped request object.
-     */
-    public String getResponseContentType() {
-        return request.getResponseContentType();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getResponseContentTypes()</code> on the wrapped request object.
-     */
-    public Enumeration<String> getResponseContentTypes() {
-        return request.getResponseContentTypes();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getScheme()</code> on the wrapped request object.
-     */
-    public String getScheme() {
-        return request.getScheme();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getServerName()</code> on the wrapped request object.
-     */
-    public String getServerName() {
-        return request.getServerName();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getServerPort()</code> on the wrapped request object.
-     */
-    public int getServerPort() {
-        return request.getServerPort();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getUserPrincipal()</code> on the wrapped request object.
-     */
-    public Principal getUserPrincipal() {
-        return request.getUserPrincipal();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getWindowId()</code> on the wrapped request object.
-     */
-    public String getWindowID() {
-        return request.getWindowID();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getWindowState()</code> on the wrapped request object.
-     */
-    public WindowState getWindowState() {
-        return request.getWindowState();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>isPortletModeAllowed(mode)</code> on the wrapped request object.
-     */
-    public boolean isPortletModeAllowed(PortletMode mode) {
-        return request.isPortletModeAllowed(mode);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>isRequestedSessionIdValid()</code> on the wrapped request object.
-     */
-    public boolean isRequestedSessionIdValid() {
-        return request.isRequestedSessionIdValid();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>isSecure()</code> on the wrapped request object.
-     */
-    public boolean isSecure() {
-        return request.isSecure();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>isUserInRole(role)</code> on the wrapped request object.
-     */
-    public boolean isUserInRole(String role) {
-        return request.isUserInRole(role);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>isWindowStateAllowed(state)</code> on the wrapped request object.
-     */
-    public boolean isWindowStateAllowed(WindowState state) {
-        return request.isWindowStateAllowed(state);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>removeAttribute(name)</code> on the wrapped request object.
-     */
-    public void removeAttribute(String name) {
-        request.removeAttribute(name);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>setAttribute(name, o)</code> on the wrapped request object.
-     */
-    public void setAttribute(String name, Object o) {
-        request.setAttribute(name, o);
-    }
-
-    /**
-     * Return the wrapped request object.
-     * 
-     * @return the wrapped request
-     */
-    public PortletRequest getRequest() {
-        return request;
-    }
-
-    /**
-     * Sets the request object being wrapped.
-     * 
-     * @param request the request to set
-     * @throws java.lang.IllegalArgumentException   if the request is null.
-     */
-    public void setRequest(PortletRequest request) {
-    	if ( request == null)
-    		throw new java.lang.IllegalArgumentException("Request is null");
-
-    	this.request = request;
-    }
-
-    /**
-     *  The default behavior of this method is to call 
-     * <code>getCookies()</code> on the wrapped request object.
-     */
-    public Cookie[] getCookies() {
-    	return request.getCookies();
-    }
-
-    /**
-     *  The default behavior of this method is to call 
-     * <code>getPrivateParameterMap()</code> on the wrapped request object.
-     */
-   @Deprecated 
-	public Map<String, String[]> getPrivateParameterMap() {
-		return request.getPrivateParameterMap();
-	}
-
-    /**
-     *  The default behavior of this method is to call 
-     * <code>getPublicParameterMap()</code> on the wrapped request object.
-     */
-   @Deprecated
-	public Map<String, String[]> getPublicParameterMap() {
-		return request.getPublicParameterMap();
-	}
-}
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import java.security.Principal;
+import java.util.Enumeration;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.portlet.PortalContext;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletSession;
+import javax.portlet.RenderParameters;
+import javax.portlet.WindowState;
+import javax.servlet.http.Cookie;
+
+/**
+ * <span class="changed_modified_3_0">The</span> 
+ * <code>PortletRequestWrapper</code> provides a convenient 
+ * implementation of the <code>PortletRequest</code> interface 
+ * and is extended by other request wrappers.
+ * This class implements the Wrapper or Decorator pattern. 
+ * Methods default to calling through to the wrapped request object.
+ *
+ * @since 2.0
+ * @see PortletRequest
+ */
+public class PortletRequestWrapper implements PortletRequest {
+
+   PortletRequest request;
+
+   /** 
+    * Require having a request for constructing
+    * the wrapper
+    */
+   
+   @SuppressWarnings("unused")
+   private PortletRequestWrapper() {
+   }
+
+
+   /**
+    * Creates an <code>PortletRequest</code> adaptor 
+    * wrapping the given request object.
+    * 
+    * @param request  the portlet request to wrap
+    * @throws java.lang.IllegalArgumentException if the request is <code>null</code>
+    */
+   public PortletRequestWrapper(PortletRequest request) {
+      if ( request == null)
+         throw new java.lang.IllegalArgumentException("Request is null");
+
+      this.request = request;
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getAttribute(String name)</code> on the wrapped request object.
+    */
+   public Object getAttribute(String name) {
+      return request.getAttribute(name);
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getAttributeNames()</code> on the wrapped request object.
+    */
+   public Enumeration<String> getAttributeNames() {
+      return request.getAttributeNames();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getAuthType()</code> on the wrapped request object.
+    */
+   public String getAuthType() {
+      return request.getAuthType();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getContextPath()</code> on the wrapped request object.
+    */
+   public String getContextPath() {
+      return request.getContextPath();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getLocale()</code> on the wrapped request object.
+    */
+   public Locale getLocale() {
+      return request.getLocale();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getLocales()</code> on the wrapped request object.
+    */
+   public Enumeration<Locale> getLocales() {
+      return request.getLocales();
+   }
+
+   /**
+    * <div class="changed_modified_3_0"> 
+    * The default behavior of this method is to call 
+    * <code>getRenderParameters()</code> on the wrapped request object.
+    * </div>
+    */
+   public RenderParameters getRenderParameters() {
+      return request.getRenderParameters();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getParameter(String name)</code> on the wrapped request object.
+    */
+   @Deprecated
+   public String getParameter(String name) {
+      return request.getParameter(name);
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getParameterMap()</code> on the wrapped request object.
+    */
+   @Deprecated
+   public Map<String, String[]> getParameterMap() {
+      return request.getParameterMap();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getParameterNames()</code> on the wrapped request object.
+    */
+   @Deprecated
+   public Enumeration<String> getParameterNames() {
+      return request.getParameterNames();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getParameterValues(name)</code> on the wrapped request object.
+    */
+   @Deprecated
+   public String[] getParameterValues(String name) {
+      return request.getParameterValues(name);
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getPortalContext()</code> on the wrapped request object.
+    */
+   public PortalContext getPortalContext() {
+      return request.getPortalContext();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getPortletMode()</code> on the wrapped request object.
+    */
+   public PortletMode getPortletMode() {
+      return request.getPortletMode();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getPortletSession()</code> on the wrapped request object.
+    */
+   public PortletSession getPortletSession() {
+      return request.getPortletSession();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getPortletSession(create)</code> on the wrapped request object.
+    */
+   public PortletSession getPortletSession(boolean create) {
+      return request.getPortletSession(create);
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getPreferences()</code> on the wrapped request object.
+    */
+   public PortletPreferences getPreferences() {
+      return request.getPreferences();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getProperteis(name)</code> on the wrapped request object.
+    */
+   public Enumeration<String> getProperties(String name) {
+      return request.getProperties(name);
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getProperty(name)</code> on the wrapped request object.
+    */
+   public String getProperty(String name) {
+      return request.getProperty(name);
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getPropertyNames()</code> on the wrapped request object.
+    */
+   public Enumeration<String> getPropertyNames() {
+      return request.getPropertyNames();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getRemoteUser()</code> on the wrapped request object.
+    */
+   public String getRemoteUser() {
+      return request.getRemoteUser();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getRequestedSessionId()</code> on the wrapped request object.
+    */
+   public String getRequestedSessionId() {
+      return request.getRequestedSessionId();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getResponseContentType()</code> on the wrapped request object.
+    */
+   public String getResponseContentType() {
+      return request.getResponseContentType();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getResponseContentTypes()</code> on the wrapped request object.
+    */
+   public Enumeration<String> getResponseContentTypes() {
+      return request.getResponseContentTypes();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getScheme()</code> on the wrapped request object.
+    */
+   public String getScheme() {
+      return request.getScheme();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getServerName()</code> on the wrapped request object.
+    */
+   public String getServerName() {
+      return request.getServerName();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getServerPort()</code> on the wrapped request object.
+    */
+   public int getServerPort() {
+      return request.getServerPort();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getUserPrincipal()</code> on the wrapped request object.
+    */
+   public Principal getUserPrincipal() {
+      return request.getUserPrincipal();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getWindowId()</code> on the wrapped request object.
+    */
+   public String getWindowID() {
+      return request.getWindowID();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getWindowState()</code> on the wrapped request object.
+    */
+   public WindowState getWindowState() {
+      return request.getWindowState();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>isPortletModeAllowed(mode)</code> on the wrapped request object.
+    */
+   public boolean isPortletModeAllowed(PortletMode mode) {
+      return request.isPortletModeAllowed(mode);
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>isRequestedSessionIdValid()</code> on the wrapped request object.
+    */
+   public boolean isRequestedSessionIdValid() {
+      return request.isRequestedSessionIdValid();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>isSecure()</code> on the wrapped request object.
+    */
+   public boolean isSecure() {
+      return request.isSecure();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>isUserInRole(role)</code> on the wrapped request object.
+    */
+   public boolean isUserInRole(String role) {
+      return request.isUserInRole(role);
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>isWindowStateAllowed(state)</code> on the wrapped request object.
+    */
+   public boolean isWindowStateAllowed(WindowState state) {
+      return request.isWindowStateAllowed(state);
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>removeAttribute(name)</code> on the wrapped request object.
+    */
+   public void removeAttribute(String name) {
+      request.removeAttribute(name);
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>setAttribute(name, o)</code> on the wrapped request object.
+    */
+   public void setAttribute(String name, Object o) {
+      request.setAttribute(name, o);
+   }
+
+   /**
+    * Return the wrapped request object.
+    * 
+    * @return the wrapped request
+    */
+   public PortletRequest getRequest() {
+      return request;
+   }
+
+   /**
+    * Sets the request object being wrapped.
+    * 
+    * @param request the request to set
+    * @throws java.lang.IllegalArgumentException   if the request is null.
+    */
+   public void setRequest(PortletRequest request) {
+      if ( request == null)
+         throw new java.lang.IllegalArgumentException("Request is null");
+
+      this.request = request;
+   }
+
+   /**
+    *  The default behavior of this method is to call 
+    * <code>getCookies()</code> on the wrapped request object.
+    */
+   public Cookie[] getCookies() {
+      return request.getCookies();
+   }
+
+   /**
+    *  The default behavior of this method is to call 
+    * <code>getPrivateParameterMap()</code> on the wrapped request object.
+    */
+   @Deprecated 
+   public Map<String, String[]> getPrivateParameterMap() {
+      return request.getPrivateParameterMap();
+   }
+
+   /**
+    *  The default behavior of this method is to call 
+    * <code>getPublicParameterMap()</code> on the wrapped request object.
+    */
+   @Deprecated
+   public Map<String, String[]> getPublicParameterMap() {
+      return request.getPublicParameterMap();
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/filter/PortletResponseWrapper.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/filter/PortletResponseWrapper.java b/portlet-api/src/main/java/javax/portlet/filter/PortletResponseWrapper.java
index b9df9ee..0fa5e25 100644
--- a/portlet-api/src/main/java/javax/portlet/filter/PortletResponseWrapper.java
+++ b/portlet-api/src/main/java/javax/portlet/filter/PortletResponseWrapper.java
@@ -1,144 +1,137 @@
-/*  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.
- */
-
-/*
- * This source code implements specifications defined by the Java
- * Community Process. In order to remain compliant with the specification
- * DO NOT add / change / or delete method signatures!
- */
-
-package javax.portlet.filter;
-
-import javax.portlet.PortletResponse;
-import javax.servlet.http.Cookie;
-
-/**
- * The <code>PortletResponseWrapper</code> provides a convenient 
- * implementation of the <code>PortletResponse</code> interface 
- * and is extended by other response wrappers.
- * This class implements the Wrapper or Decorator pattern. 
- * Methods default to calling through to the wrapped response object.
- *
- * @since 2.0
- * @see PortletResponse
- */
-public class PortletResponseWrapper implements PortletResponse {
-
-		PortletResponse response;
-	    
-	    /** 
-	     * Require having a response for constructing
-	     * the wrapper.
-	     *
-	     */
-	    private PortletResponseWrapper() {
-	    }
-	    
-	    /**
-	     * Creates an <code>ActionResponse</code> adaptor 
-	     * wrapping the given response object.
-	     * 
-	     * @param response  the action response to wrap
-	     * @throws java.lang.IllegalArgumentException if the response is <code>null</code>
-	     */
-	    public PortletResponseWrapper(PortletResponse response) {
-	    	if ( response == null)
-	    		throw new java.lang.IllegalArgumentException("Response is null");
-
-	        this.response = response;
-	    }
-
-	    /**
-	     * The default behavior of this method is to call 
-	     * <code>addProperty(key, value)</code> on the wrapped response object.
-	     */
-	    public void addProperty(String key, String value) {
-	        response.addProperty(key, value);
-	    }
-
-	    /**
-	     * The default behavior of this method is to call 
-	     * <code>encodeURL(path)</code> on the wrapped response object.
-	     */
-	    public String encodeURL(String path) {
-	        return response.encodeURL(path);
-	    }
-
-	    /**
-	     * The default behavior of this method is to call 
-	     * <code>getNamespace()</code> on the wrapped response object.
-	     */
-	    public String getNamespace() {
-	        return response.getNamespace();
-	    }
-
-	    /**
-	     * The default behavior of this method is to call 
-	     * <code>setProperty(key, value)</code> on the wrapped response object.
-	     */
-	    public void setProperty(String key, String value) {
-	        response.setProperty(key, value);
-	    }
-
-	    /**
-	     * Return the wrapped response object.
-	     * 
-	     * @return the wrapped response
-	     */
-	    public PortletResponse getResponse() {
-	        return response;
-	    }
-
-	    /**
-	     * Sets the response object being wrapped.
-	     * 
-	     * @param response the response to set
-	     * @throws java.lang.IllegalArgumentException   if the response is null.
-	     */
-	    public void setResponse(PortletResponse response) {
-	    	if ( response == null)
-	    		throw new java.lang.IllegalArgumentException("Response is null");
-
-	        this.response = response;
-	    }
-
-	    /**
-	     *  The default behavior of this method is to call 
-	     * <code>addProperty()</code> on the wrapped response object.
-	     */
-	    public void addProperty(String key, org.w3c.dom.Element element) {
-	        response.addProperty(key, element);
-	    }
-
-	    /**
-	     *  The default behavior of this method is to call 
-	     * <code>createElement()</code> on the wrapped response object.
-	     */
-	    public org.w3c.dom.Element createElement(String tagName) {
-	        return response.createElement(tagName);
-	    }
-
-	    /**
-	     *  The default behavior of this method is to call 
-	     * <code>addProperty()</code> on the wrapped response object.
-	     */
-	    public void addProperty(Cookie cookie) {
-	        response.addProperty(cookie);
-	    }
-
-}
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import javax.portlet.PortletResponse;
+import javax.servlet.http.Cookie;
+
+/**
+ * <span class="changed_modified_3_0">The</span> 
+ * <code>PortletResponseWrapper</code> provides a convenient 
+ * implementation of the <code>PortletResponse</code> interface 
+ * and is extended by other response wrappers.
+ * This class implements the Wrapper or Decorator pattern. 
+ * Methods default to calling through to the wrapped response object.
+ *
+ * @since 2.0
+ * @see PortletResponse
+ */
+public class PortletResponseWrapper implements PortletResponse {
+
+		PortletResponse response;
+	    
+	    /**
+	     * Creates an <code>ActionResponse</code> adaptor 
+	     * wrapping the given response object.
+	     * 
+	     * @param response  the action response to wrap
+	     * @throws java.lang.IllegalArgumentException if the response is <code>null</code>
+	     */
+	    public PortletResponseWrapper(PortletResponse response) {
+	    	if ( response == null)
+	    		throw new java.lang.IllegalArgumentException("Response is null");
+
+	        this.response = response;
+	    }
+
+	    /**
+	     * The default behavior of this method is to call 
+	     * <code>addProperty(key, value)</code> on the wrapped response object.
+	     */
+	    public void addProperty(String key, String value) {
+	        response.addProperty(key, value);
+	    }
+
+	    /**
+	     * The default behavior of this method is to call 
+	     * <code>encodeURL(path)</code> on the wrapped response object.
+	     */
+	    public String encodeURL(String path) {
+	        return response.encodeURL(path);
+	    }
+
+	    /**
+	     * The default behavior of this method is to call 
+	     * <code>getNamespace()</code> on the wrapped response object.
+	     */
+	    public String getNamespace() {
+	        return response.getNamespace();
+	    }
+
+	    /**
+	     * The default behavior of this method is to call 
+	     * <code>setProperty(key, value)</code> on the wrapped response object.
+	     */
+	    public void setProperty(String key, String value) {
+	        response.setProperty(key, value);
+	    }
+
+	    /**
+	     * Return the wrapped response object.
+	     * 
+	     * @return the wrapped response
+	     */
+	    public PortletResponse getResponse() {
+	        return response;
+	    }
+
+	    /**
+	     * Sets the response object being wrapped.
+	     * 
+	     * @param response the response to set
+	     * @throws java.lang.IllegalArgumentException   if the response is null.
+	     */
+	    public void setResponse(PortletResponse response) {
+	    	if ( response == null)
+	    		throw new java.lang.IllegalArgumentException("Response is null");
+
+	        this.response = response;
+	    }
+
+	    /**
+	     *  The default behavior of this method is to call 
+	     * <code>addProperty()</code> on the wrapped response object.
+	     */
+	    public void addProperty(String key, org.w3c.dom.Element element) {
+	        response.addProperty(key, element);
+	    }
+
+	    /**
+	     *  The default behavior of this method is to call 
+	     * <code>createElement()</code> on the wrapped response object.
+	     */
+	    public org.w3c.dom.Element createElement(String tagName) {
+	        return response.createElement(tagName);
+	    }
+
+	    /**
+	     *  The default behavior of this method is to call 
+	     * <code>addProperty()</code> on the wrapped response object.
+	     */
+	    public void addProperty(Cookie cookie) {
+	        response.addProperty(cookie);
+	    }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/filter/RenderRequestWrapper.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/filter/RenderRequestWrapper.java b/portlet-api/src/main/java/javax/portlet/filter/RenderRequestWrapper.java
index 1858feb..2506285 100644
--- a/portlet-api/src/main/java/javax/portlet/filter/RenderRequestWrapper.java
+++ b/portlet-api/src/main/java/javax/portlet/filter/RenderRequestWrapper.java
@@ -1,88 +1,90 @@
-/*  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.
- */
-
-/*
- * This source code implements specifications defined by the Java
- * Community Process. In order to remain compliant with the specification
- * DO NOT add / change / or delete method signatures!
- */
-
-package javax.portlet.filter;
-
-import javax.portlet.RenderRequest;
-
-/**
- * The <code>RenderRequestWrapper</code> provides a convenient 
- * implementation of the <code>RenderRequest</code> interface 
- * that can be subclassed by developers wishing to adapt the request.
- * This class implements the Wrapper or Decorator pattern. 
- * Methods default to calling through to the wrapped request object.
- *
- * @since 2.0
- * @see RenderRequest
- */
-public class RenderRequestWrapper extends PortletRequestWrapper implements RenderRequest {
-
-    RenderRequest request;
-    
-    /**
-     * Creates an <code>RenderRequest</code> adaptor 
-     * wrapping the given request object.
-     * 
-     * @param request  the render request to wrap
-     * @throws java.lang.IllegalArgumentException if the request is <code>null</code>
-     */
-    public RenderRequestWrapper(RenderRequest request) {
-    	super(request);
-    	this.request = request;
-    }
-
-    
-
-    /**
-     * Return the wrapped request object.
-     * 
-     * @return the wrapped request
-     */
-    public RenderRequest getRequest() {
-        return request;
-    }
-
-    /**
-     * Sets the request object being wrapped.
-     * 
-     * @param request the request to set
-     * @throws java.lang.IllegalArgumentException   if the request is null.
-     */
-    public void setRequest(RenderRequest request) {
-    	if ( request == null)
-    		throw new java.lang.IllegalArgumentException("Request is null");
-
-    	this.request = request;
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getETag()</code> on the wrapped request object.
-     */
-    public String getETag() {
-        return request.getETag();
-    }
-
-
-}
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import javax.portlet.RenderRequest;
+
+/**
+ * <span class="changed_modified_3_0">The</span> 
+ * <code>RenderRequestWrapper</code> provides a convenient 
+ * implementation of the <code>RenderRequest</code> interface 
+ * that can be subclassed by developers wishing to adapt the request.
+ * This class implements the Wrapper or Decorator pattern. 
+ * Methods default to calling through to the wrapped request object.
+ *
+ * @since 2.0
+ * @see RenderRequest
+ */
+public class RenderRequestWrapper extends PortletRequestWrapper implements RenderRequest {
+
+   RenderRequest request;
+
+   /**
+    * Creates an <code>RenderRequest</code> adaptor 
+    * wrapping the given request object.
+    * 
+    * @param request  the render request to wrap
+    * @throws java.lang.IllegalArgumentException if the request is <code>null</code>
+    */
+   public RenderRequestWrapper(RenderRequest request) {
+      super(request);
+      this.request = request;
+   }
+
+
+
+   /**
+    * Return the wrapped request object.
+    * 
+    * @return the wrapped request
+    */
+   public RenderRequest getRequest() {
+      return request;
+   }
+
+   /**
+    * Sets the request object being wrapped.
+    * 
+    * @param request the request to set
+    * @throws java.lang.IllegalArgumentException   if the request is null.
+    */
+   public void setRequest(RenderRequest request) {
+      if ( request == null) {
+         throw new java.lang.IllegalArgumentException("Request is null");
+      }
+      super.setRequest(request);
+      this.request = request;
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getETag()</code> on the wrapped request object.
+    */
+   public String getETag() {
+      return request.getETag();
+   }
+
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/filter/RenderResponseWrapper.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/filter/RenderResponseWrapper.java b/portlet-api/src/main/java/javax/portlet/filter/RenderResponseWrapper.java
index 26514ef..f5a518c 100644
--- a/portlet-api/src/main/java/javax/portlet/filter/RenderResponseWrapper.java
+++ b/portlet-api/src/main/java/javax/portlet/filter/RenderResponseWrapper.java
@@ -1,252 +1,99 @@
-/*  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.
- */
-
-/*
- * This source code implements specifications defined by the Java
- * Community Process. In order to remain compliant with the specification
- * DO NOT add / change / or delete method signatures!
- */
-
-package javax.portlet.filter;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.util.Collection;
-import java.util.Locale;
-
-import javax.portlet.ActionURL;
-import javax.portlet.CacheControl;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletURL;
-import javax.portlet.RenderResponse;
-import javax.portlet.RenderURL;
-import javax.portlet.ResourceURL;
-
-/**
- * <span class="changed_modified_3_0">The</span> <code>RenderResponseWrapper</code> provides a convenient 
- * implementation of the <code>RenderResponse</code> interface 
- * that can be subclassed by developers wishing to adapt the response.
- * This class implements the Wrapper or Decorator pattern. 
- * Methods default to calling through to the wrapped response object.
- *
- * @since 2.0
- * @see RenderResponse
- */
-
-public class RenderResponseWrapper extends PortletResponseWrapper implements RenderResponse {
-
-    RenderResponse response;
-    
-    /**
-     * Creates an <code>RenderResponse</code> adaptor 
-     * wrapping the given response object.
-     * 
-     * @param response  the event response to wrap
-     * @throws java.lang.IllegalArgumentException if the response is <code>null</code>
-     */
-    public RenderResponseWrapper(RenderResponse response) {
-    	super(response);
-    	this.response = response;
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>flushBuffer()</code> on the wrapped response object.
-     */ 
-    public void flushBuffer() throws IOException {
-        response.flushBuffer();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getBufferSize()</code> on the wrapped response object.
-     */
-    public int getBufferSize() {
-        return response.getBufferSize();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getCharacterEncoding()</code> on the wrapped response object.
-     */
-    public String getCharacterEncoding() {
-        return response.getCharacterEncoding();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getContentType()</code> on the wrapped response object.
-     */
-    public String getContentType() {
-        return response.getContentType();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getLocale()</code> on the wrapped response object.
-     */
-    public Locale getLocale() {
-        return response.getLocale();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPortletOutputStream()</code> on the wrapped response object.
-     */
-    public OutputStream getPortletOutputStream() throws IOException {
-        return response.getPortletOutputStream();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getWriter()</code> on the wrapped response object.
-     */
-    public PrintWriter getWriter() throws IOException {
-        return response.getWriter();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>isCommitted()</code> on the wrapped response object.
-     */
-    public boolean isCommitted() {
-        return response.isCommitted();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>reset()</code> on the wrapped response object.
-     */
-    public void reset() {
-        response.reset();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>resetBuffer()</code> on the wrapped response object.
-     */
-    public void resetBuffer() {
-        response.resetBuffer();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>setBufferSize(size)</code> on the wrapped response object.
-     */
-    public void setBufferSize(int size) {
-        response.setBufferSize(size);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>setContentType(type)</code> on the wrapped response object.
-     */
-    public void setContentType(String type) {
-        response.setContentType(type);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>setTitle(title)</code> on the wrapped response object.
-     */
-    public void setTitle(String title) {
-        response.setTitle(title);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getCacheControl()</code> on the wrapped response object.
-     */
-    public CacheControl getCacheControl() {
-        return response.getCacheControl();
-    }
-
-    /**
-     *  <span class="changed_modified_3_0">The</span> default behavior of this method is to call 
-     * <code>setNextPossiblePortletModes()</code> on the wrapped response object.
-     */
-    public void setNextPossiblePortletModes(Collection<? extends PortletMode> portletModes) {
-        response.setNextPossiblePortletModes(portletModes);
-    }
-
-    /**
-     * Return the wrapped response object.
-     * 
-     * @return the wrapped response
-     */
-    public RenderResponse getResponse() {
-        return response;
-    }
-
-    /**
-     * Sets the response object being wrapped.
-     * 
-     * @param response the response to set
-     * @throws java.lang.IllegalArgumentException   if the response is null.
-     */
-    public void setResponse(RenderResponse response) {
-	    	if ( response == null)
-	    		throw new java.lang.IllegalArgumentException("Response is null");
-
-	    	this.response = response;
-    }
-
-    /**
-     *  The default behavior of this method is to call 
-     * <code>createActionURL()</code> on the wrapped response object.
-     */
-    public ActionURL createActionURL() throws IllegalStateException {
-		return response.createActionURL();
-	}
-
-    /**
-     *  <span class="changed_added_3_0">The default behavior of this method is to call 
-     * <code>createActionURL(ParameterCopyOption)</code> on the wrapped response object.</span>
-     */
-    public ActionURL createActionURL(ParameterCopyOption option) throws IllegalStateException {
-       return response.createActionURL(option);
-    }
-
-    /**
-     *  The default behavior of this method is to call 
-     * <code>createRenderURL()</code> on the wrapped response object.
-     */
-    public RenderURL createRenderURL() throws IllegalStateException {
-		return response.createRenderURL();
-	}
-
-    /**
-     *  <span class="changed_added_3_0">The default behavior of this method is to call 
-     * <code>createRenderURL(ParameterCopyOption)</code> on the wrapped response object.</span>
-     */
-    public RenderURL createRenderURL(ParameterCopyOption option) throws IllegalStateException {
-       return response.createRenderURL(option);
-    }
-
-    /**
-     *  The default behavior of this method is to call 
-     * <code>createResourceURL()</code> on the wrapped response object.
-     */
-	public ResourceURL createResourceURL() throws IllegalStateException {
-		return response.createResourceURL();
-	}
-
-
-
-}
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import java.util.Collection;
+
+import javax.portlet.PortletMode;
+import javax.portlet.RenderResponse;
+
+/**
+ * <span class="changed_modified_3_0">The</span> <code>RenderResponseWrapper</code> provides a convenient 
+ * implementation of the <code>RenderResponse</code> interface 
+ * that can be subclassed by developers wishing to adapt the response.
+ * This class implements the Wrapper or Decorator pattern. 
+ * Methods default to calling through to the wrapped response object.
+ *
+ * @since 2.0
+ * @see RenderResponse
+ */
+
+public class RenderResponseWrapper extends MimeResponseWrapper implements RenderResponse {
+
+   RenderResponse response;
+
+   /**
+    * Creates an <code>RenderResponse</code> adaptor 
+    * wrapping the given response object.
+    * 
+    * @param response  the event response to wrap
+    * @throws java.lang.IllegalArgumentException if the response is <code>null</code>
+    */
+   public RenderResponseWrapper(RenderResponse response) {
+      super(response);
+      this.response = response;
+   }
+
+   /**
+    * Return the wrapped response object.
+    * 
+    * @return the wrapped response
+    */
+   public RenderResponse getResponse() {
+      return response;
+   }
+
+   /**
+    * Sets the response object being wrapped.
+    * 
+    * @param response the response to set
+    * @throws java.lang.IllegalArgumentException   if the response is null.
+    */
+   public void setResponse(RenderResponse response) {
+      if ( response == null) {
+         throw new java.lang.IllegalArgumentException("Response is null");
+      }
+      super.setResponse(response);
+      this.response = response;
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>setTitle(title)</code> on the wrapped response object.
+    */
+   @SuppressWarnings("deprecation")
+   public void setTitle(String title) {
+      response.setTitle(title);
+   }
+
+   /**
+    *  <span class="changed_modified_3_0">The</span> default behavior of this method is to call 
+    * <code>setNextPossiblePortletModes()</code> on the wrapped response object.
+    */
+   public void setNextPossiblePortletModes(Collection<? extends PortletMode> portletModes) {
+      response.setNextPossiblePortletModes(portletModes);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/filter/ResourceRequestWrapper.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/filter/ResourceRequestWrapper.java b/portlet-api/src/main/java/javax/portlet/filter/ResourceRequestWrapper.java
index 5c26e7b..50a5b86 100644
--- a/portlet-api/src/main/java/javax/portlet/filter/ResourceRequestWrapper.java
+++ b/portlet-api/src/main/java/javax/portlet/filter/ResourceRequestWrapper.java
@@ -1,197 +1,125 @@
-/*  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.
- */
-
-/*
- * This source code implements specifications defined by the Java
- * Community Process. In order to remain compliant with the specification
- * DO NOT add / change / or delete method signatures!
- */
-
-package javax.portlet.filter;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.Map;
-
-import javax.portlet.PortletParameters;
-import javax.portlet.ResourceParameters;
-import javax.portlet.ResourceRequest;
-
-/**
- * <span class="changed_modified_3_0">The</span>  
- * <code>ResourceRequestWrapper</code> provides a convenient 
- * implementation of the <code>ResourceRequest</code> interface 
- * that can be subclassed by developers wishing to adapt the request.
- * This class implements the Wrapper or Decorator pattern. 
- * Methods default to calling through to the wrapped request object.
- *
- * @since 2.0
- * @see ResourceRequest
- */
-public class ResourceRequestWrapper extends PortletRequestWrapper implements ResourceRequest {
-
-    ResourceRequest request;
-
-    /**
-     * Creates an <code>ResourceRequest</code> adaptor 
-     * wrapping the given request object.
-     * 
-     * @param request  the resource request to wrap
-     * @throws java.lang.IllegalArgumentException if the request is <code>null</code>
-     */
-    public ResourceRequestWrapper(ResourceRequest request) {
-    	super(request);
-    	this.request = request;
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPortletInputStream()</code> on the wrapped request object.
-     */
-    public InputStream getPortletInputStream() throws IOException {
-        return request.getPortletInputStream();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getReader()</code> on the wrapped request object.
-     */
-    public BufferedReader getReader() throws UnsupportedEncodingException,
-            IOException {
-        return request.getReader();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>setCharacterEncoding(String enc)</code> 
-     * on the wrapped request object.
-     */
-    public void setCharacterEncoding(String enc)
-            throws UnsupportedEncodingException {
-       request.setCharacterEncoding(enc);
-    }
-    
-
-    /**
-     * Return the wrapped request object.
-     * 
-     * @return the wrapped request
-     */
-    public ResourceRequest getRequest() {
-        return request;
-    }
-
-    /**
-     * Sets the request object being wrapped.
-     * 
-     * @param request the request to set
-     * @throws java.lang.IllegalArgumentException   if the request is null.
-     */
-    public void setRequest(ResourceRequest request) {
-    	if ( request == null)
-    		throw new java.lang.IllegalArgumentException("Request is null");
-
-    	this.request = request;
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getCharacterEncoding()</code> on the wrapped request object.
-     */
-    public String getCharacterEncoding() {      
-        return request.getCharacterEncoding();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getContentLength()</code> on the wrapped request object.
-     */
-    public int getContentLength() {
-        return request.getContentLength();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getContentType()</code> on the wrapped request object.
-     */
-    public String getContentType() {
-        return request.getContentType();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getETag()</code> on the wrapped request object.
-     */
-    public String getETag() {
-        return request.getETag();
-    }
-
-    /**
-     *  The default behavior of this method is to call 
-     * <code>getMethod()</code> on the wrapped request object.
-     */
-    public String getMethod() {
-        return request.getMethod();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getResourceID()</code> on the wrapped request object.
-     */
-    public String getResourceID() {
-        return request.getResourceID();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPrivateRenderParameterMap()</code> on the wrapped request object.
-     */
-   @Deprecated
-	public Map<String, String[]> getPrivateRenderParameterMap() {
-		return request.getPrivateRenderParameterMap();
-	}
-
-    /**
-     *  The default behavior of this method is to call 
-     * <code>getCacheability()</code> on the wrapped response object.
-     */
-    public String getCacheability() {
-        return request.getCacheability();
-    }
-
-   /**
-    * <div class="changed_modified_3_0">  
-    *  The default behavior of this method is to call 
-    * <code>getResourceParameters()</code> on the wrapped response object.
-    * </div>
-    */
-   public ResourceParameters getResourceParameters() {
-      return request.getResourceParameters();
-   }
-
-   /* (non-Javadoc)
-    * @see javax.portlet.ResourceRequest#getPageState()
-    */
-   public String getPageState() {
-      return request.getPageState();
-   }
-    
-
-}
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import java.util.Map;
+
+import javax.portlet.ResourceParameters;
+import javax.portlet.ResourceRequest;
+
+/**
+ * <span class="changed_modified_3_0">The</span>  
+ * <code>ResourceRequestWrapper</code> provides a convenient 
+ * implementation of the <code>ResourceRequest</code> interface 
+ * that can be subclassed by developers wishing to adapt the request.
+ * This class implements the Wrapper or Decorator pattern. 
+ * Methods default to calling through to the wrapped request object.
+ *
+ * @since 2.0
+ * @see ResourceRequest
+ */
+public class ResourceRequestWrapper extends ClientDataRequestWrapper implements ResourceRequest {
+
+   ResourceRequest request;
+
+   /**
+    * Creates an <code>ResourceRequest</code> adaptor 
+    * wrapping the given request object.
+    * 
+    * @param request  the resource request to wrap
+    * @throws java.lang.IllegalArgumentException if the request is <code>null</code>
+    */
+   public ResourceRequestWrapper(ResourceRequest request) {
+      super(request);
+      this.request = request;
+   }
+
+   /**
+    * Return the wrapped request object.
+    * 
+    * @return the wrapped request
+    */
+   public ResourceRequest getRequest() {
+      return request;
+   }
+
+   /**
+    * Sets the request object being wrapped.
+    * 
+    * @param request the request to set
+    * @throws java.lang.IllegalArgumentException   if the request is null.
+    */
+   public void setRequest(ResourceRequest request) {
+      if ( request == null) {
+         throw new java.lang.IllegalArgumentException("Request is null");
+      }
+      super.setRequest(request);
+      this.request = request;
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getETag()</code> on the wrapped request object.
+    */
+   public String getETag() {
+      return request.getETag();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getResourceID()</code> on the wrapped request object.
+    */
+   public String getResourceID() {
+      return request.getResourceID();
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>getPrivateRenderParameterMap()</code> on the wrapped request object.
+    */
+   @Deprecated
+   public Map<String, String[]> getPrivateRenderParameterMap() {
+      return request.getPrivateRenderParameterMap();
+   }
+
+   /**
+    *  The default behavior of this method is to call 
+    * <code>getCacheability()</code> on the wrapped response object.
+    */
+   public String getCacheability() {
+      return request.getCacheability();
+   }
+
+   /**
+    * <div class="changed_modified_3_0">  
+    *  The default behavior of this method is to call 
+    * <code>getResourceParameters()</code> on the wrapped response object.
+    * </div>
+    */
+   public ResourceParameters getResourceParameters() {
+      return request.getResourceParameters();
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/filter/ResourceResponseWrapper.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/filter/ResourceResponseWrapper.java b/portlet-api/src/main/java/javax/portlet/filter/ResourceResponseWrapper.java
index 8454fca..486ccb8 100644
--- a/portlet-api/src/main/java/javax/portlet/filter/ResourceResponseWrapper.java
+++ b/portlet-api/src/main/java/javax/portlet/filter/ResourceResponseWrapper.java
@@ -1,271 +1,120 @@
-/*  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.
- */
-
-/*
- * This source code implements specifications defined by the Java
- * Community Process. In order to remain compliant with the specification
- * DO NOT add / change / or delete method signatures!
- */
-
-package javax.portlet.filter;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.util.Locale;
-
-import javax.portlet.ActionURL;
-import javax.portlet.CacheControl;
-import javax.portlet.PortletURL;
-import javax.portlet.RenderURL;
-import javax.portlet.ResourceResponse;
-import javax.portlet.ResourceURL;
-
-/**
- * <span class="changed_modified_3_0">The</span>  
- * <code>ResourceResponseWrapper</code> provides a convenient 
- * implementation of the <code>ResourceResponse</code> interface 
- * that can be subclassed by developers wishing to adapt the response.
- * This class implements the Wrapper or Decorator pattern. 
- * Methods default to calling through to the wrapped response object.
- *
- * @since 2.0
- * @see ResourceResponse
- */
-
-public class ResourceResponseWrapper extends PortletResponseWrapper implements ResourceResponse {
-
-    ResourceResponse response;
-    
-    /**
-     * Creates an <code>ResourceResponse</code> adaptor 
-     * wrapping the given response object.
-     * 
-     * @param response  the event response to wrap
-     * @throws java.lang.IllegalArgumentException if the response is <code>null</code>
-     */
-    public ResourceResponseWrapper(ResourceResponse response) {
-    	super(response);
-    	this.response = response;
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>flushBuffer()</code> on the wrapped response object.
-     */ 
-    public void flushBuffer() throws IOException {
-        response.flushBuffer();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getBufferSize()</code> on the wrapped response object.
-     */
-    public int getBufferSize() {
-        return response.getBufferSize();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getCharacterEncoding()</code> on the wrapped response object.
-     */
-    public String getCharacterEncoding() {
-        return response.getCharacterEncoding();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getContentType()</code> on the wrapped response object.
-     */
-    public String getContentType() {
-        return response.getContentType();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getLocale()</code> on the wrapped response object.
-     */
-    public Locale getLocale() {
-        return response.getLocale();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPortletOutputStream()</code> on the wrapped response object.
-     */
-    public OutputStream getPortletOutputStream() throws IOException {
-        return response.getPortletOutputStream();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getWriter()</code> on the wrapped response object.
-     */
-    public PrintWriter getWriter() throws IOException {
-        return response.getWriter();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>isCommitted()</code> on the wrapped response object.
-     */
-    public boolean isCommitted() {
-        return response.isCommitted();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>reset()</code> on the wrapped response object.
-     */
-    public void reset() {
-        response.reset();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>resetBuffer()</code> on the wrapped response object.
-     */
-    public void resetBuffer() {
-        response.resetBuffer();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>setBufferSize(size)</code> on the wrapped response object.
-     */
-    public void setBufferSize(int size) {
-        response.setBufferSize(size);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>setContentType(type)</code> on the wrapped response object.
-     */
-    public void setContentType(String type) {
-        response.setContentType(type);
-    }
-
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getCacheControl()</code> on the wrapped response object.
-     */
-    public CacheControl getCacheControl() {
-        return response.getCacheControl();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>setCharacterEncoding(String charset)</code> on the wrapped response object.
-     */
-    public void setCharacterEncoding(String charset) {
-        response.setCharacterEncoding(charset);
-        return;
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>setLocale(Locale loc)</code> on the wrapped response object.
-     */
-    public void setLocale(Locale loc) {
-        response.setLocale(loc);
-        return;
-    }
-
-    /**
-     *  The default behavior of this method is to call 
-     * <code>setContentLength()</code> on the wrapped response object.
-     */
-    public void setContentLength(int len) {
-        response.setContentLength(len);
-    }
-
-    /**
-     * <div class="changed_added_3_0">
-     *  The default behavior of this method is to call 
-     * <code>setStatus()</code> on the wrapped response object.
-     * </div>
-     */
-    public void setStatus(int sc) {
-        response.setStatus(sc);
-    }
-
-    /**
-     * Return the wrapped response object.
-     * 
-     * @return the wrapped response
-     */
-    public ResourceResponse getResponse() {
-        return response;
-    }
-
-    /**
-     * Sets the response object being wrapped.
-     * 
-     * @param response the response to set
-     * @throws java.lang.IllegalArgumentException   if the response is null.
-     */
-    public void setResponse(ResourceResponse response) {
-	    	if ( response == null)
-	    		throw new java.lang.IllegalArgumentException("Response is null");
-
-	    	this.response = response;
-    }
-
-    /**
-     *  The default behavior of this method is to call 
-     * <code>createActionURL()</code> on the wrapped response object.
-     */
-    public ActionURL createActionURL() throws IllegalStateException {
-		return response.createActionURL();
-	}
-
-    /**
-     *  <span class="changed_added_3_0">The default behavior of this method is to call 
-     * <code>createActionURL(ParameterCopyOption)</code> on the wrapped response object.</span>
-     */
-    public ActionURL createActionURL(ParameterCopyOption option) throws IllegalStateException {
-       return response.createActionURL(option);
-    }
-
-    /**
-     *  The default behavior of this method is to call 
-     * <code>createRenderURL()</code> on the wrapped response object.
-     */
-    public RenderURL createRenderURL() throws IllegalStateException {
-		return response.createRenderURL();
-	}
-
-    /**
-     *  <span class="changed_added_3_0">The default behavior of this method is to call 
-     * <code>createRenderURL(ParameterCopyOption)</code> on the wrapped response object.</span>
-     */
-    public RenderURL createRenderURL(ParameterCopyOption option) throws IllegalStateException {
-       return response.createRenderURL(option);
-    }
-
-    /**
-     *  The default behavior of this method is to call 
-     * <code>createResourceURL()</code> on the wrapped response object.
-     */
-	public ResourceURL createResourceURL() throws IllegalStateException {
-		return response.createResourceURL();
-	}
-	
-
-}
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import java.util.Locale;
+
+import javax.portlet.ResourceResponse;
+
+/**
+ * <span class="changed_modified_3_0">The</span>  
+ * <code>ResourceResponseWrapper</code> provides a convenient 
+ * implementation of the <code>ResourceResponse</code> interface 
+ * that can be subclassed by developers wishing to adapt the response.
+ * This class implements the Wrapper or Decorator pattern. 
+ * Methods default to calling through to the wrapped response object.
+ *
+ * @since 2.0
+ * @see ResourceResponse
+ */
+
+public class ResourceResponseWrapper extends MimeResponseWrapper implements ResourceResponse {
+
+   ResourceResponse response;
+
+   /**
+    * Creates an <code>ResourceResponse</code> adaptor 
+    * wrapping the given response object.
+    * 
+    * @param response  the event response to wrap
+    * @throws java.lang.IllegalArgumentException if the response is <code>null</code>
+    */
+   public ResourceResponseWrapper(ResourceResponse response) {
+      super(response);
+      this.response = response;
+   }
+
+   /**
+    * Return the wrapped response object.
+    * 
+    * @return the wrapped response
+    */
+   public ResourceResponse getResponse() {
+      return response;
+   }
+
+   /**
+    * Sets the response object being wrapped.
+    * 
+    * @param response the response to set
+    * @throws java.lang.IllegalArgumentException   if the response is null.
+    */
+   public void setResponse(ResourceResponse response) {
+      if ( response == null) {
+         throw new java.lang.IllegalArgumentException("Response is null");
+      }
+      super.setResponse(response);
+      this.response = response;
+   }
+
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>setCharacterEncoding(String charset)</code> on the wrapped response object.
+    */
+   public void setCharacterEncoding(String charset) {
+      response.setCharacterEncoding(charset);
+      return;
+   }
+
+   /**
+    * The default behavior of this method is to call 
+    * <code>setLocale(Locale loc)</code> on the wrapped response object.
+    */
+   public void setLocale(Locale loc) {
+      response.setLocale(loc);
+      return;
+   }
+
+   /**
+    *  The default behavior of this method is to call 
+    * <code>setContentLength()</code> on the wrapped response object.
+    */
+   public void setContentLength(int len) {
+      response.setContentLength(len);
+   }
+
+   /**
+    * <div class="changed_added_3_0">
+    *  The default behavior of this method is to call 
+    * <code>setStatus()</code> on the wrapped response object.
+    * </div>
+    */
+   public void setStatus(int sc) {
+      response.setStatus(sc);
+   }
+
+
+}


[27/38] portals-pluto git commit: Integrated latest version of the portlet API 3.0. Made necessary minor adaptations the Pluto code and demo portlets to make the previously available funtionality work. For the partial action request, changed implementati

Posted by ms...@apache.org.
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/PortletConfiguration.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/PortletConfiguration.java b/portlet-api/src/main/java/javax/portlet/annotations/PortletConfiguration.java
new file mode 100644
index 0000000..58bc397
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/PortletConfiguration.java
@@ -0,0 +1,236 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Annotation for the portlet configuration. 
+ * Many of these configuration parameters also appear in
+ * the portlet deployment descriptor.
+ * <p>
+ * The portlet deployment descriptor can continue to be used. 
+ * Values of configuration parameters appearing in the deployment descriptor have 
+ * precedence over the corresponding values defined in the annotation.   
+ * </div>
+ */
+@Retention(RUNTIME) @Target({TYPE})
+public @interface PortletConfiguration {
+   
+   /**
+    * The portlet name for the annotated type.
+    * 
+    * @return  The portlet name
+    */
+   String   portletName();
+   
+   /**
+    * The portlet initialization parameters.
+    * 
+    * @return     An array of initialization parameters
+    */
+   InitParameter[] initParams() default {};
+   
+   /**
+    * The portlet container runtime options.
+    * 
+    * @return     An array of portlet runtime options
+    */
+   RuntimeOption[] runtimeOptions() default {};
+   
+   /**
+    * <div class='container-change'>
+    * The locales supported by the portlet.
+    * An array of String values, each of which represents a single locale.
+    * <p>
+    * The locale is specified as a language tag as defined in 
+    * IETF BCP 47, "Tags for Identifying Languages".
+    * </div>
+    * 
+    * @see     java.util.Locale
+    * @see     java.util.Locale#forLanguageTag forLanguageTag
+    * @see     <a href="https://tools.ietf.org/html/bcp47">IETF BCP 47</a>
+    * 
+    * @return  An array of language tag strings
+    */
+   String[]   supportedLocales() default {"en"};
+   
+   /**
+    * <div class='not-supported'>
+    * Locale specific static title for this portlet.
+    * </div>
+    * 
+    * @return The portlet title
+    */
+   LocaleString[]   title() default {};
+   
+   /**
+    * <div class='container-change'>
+    * Locale specific short version of the static title.
+    * </div>
+    * 
+    * @return The short title
+    */
+   LocaleString[]   shortTitle() default {};
+   
+   /**
+    * <div class='container-change'>
+    * The display-name type contains a locale-specific short name that is intended to be displayed by tools. 
+    * It is used by display-name elements. 
+    * The display name need not be unique.
+    * </div>
+    * 
+    * @return  The display name
+    */
+   LocaleString[]   displayName() default {};
+   
+   /**
+    * <div class='container-change'>
+    * The portlet description.
+    * It provides locale-specific text describing the portlet for use by the portal application or by tools.
+    * </div>
+    * 
+    * @return  The portlet description
+    */
+   LocaleString[]   description() default {};
+   
+   /**
+    * <div class='container-change'>
+    * Locale specific keywords associated with this portlet. 
+    * The keywords are separated by commas within the value of the 
+    * <code>LocaleString</code> array element.
+    * </div>
+    *
+    * @return  The keywords
+    */
+   LocaleString[]   keywords() default {};
+   
+   /**
+    * <div class='container-change'>
+    * The portlet preferences.
+    * </div>
+    * 
+    * @return     The portlet preferences
+    */
+   Preference[]  prefs() default {};
+   
+   /**
+    * <div class='container-change'>
+    * The public render parameter identifiers used by the portlet.
+    * </div>
+    * 
+    * @return     The array of public render parameters.
+    */
+   String[]  publicParams() default {};
+
+   /**
+    * <div class='container-change'>
+    * Defines the content types supported by the portlet along with
+    * the associated portlet modes and window states.
+    * </div>
+    * 
+    * @return     An array of content type support items
+    */
+   ContentTypeSupport[] contentTypes() default {@ContentTypeSupport};
+   
+   /**
+    * <div class='container-change'>
+    * The resource bundle name for this portlet.
+    * Name of the resource bundle containing the language specific 
+    * portlet information in different languages.
+    * <p>
+    * the file name is specified without 
+    * the language specific part (e.g. _en) or the file extension.
+    * </div>
+    * 
+    * @return     The resource bundle name
+    */
+   String   resourceBundle()  default "";
+   
+   /**
+    * <div class='container-change'>
+    * The supported portlet modes and window states.
+    * </div>
+    * 
+    * @return     The supported portlet modes and window states
+    */
+   Supports[] supports() default {};
+   
+   /**
+    * <div class='not-supported'>
+    * The cache scope, which defines whether generated portlet content is private
+    * for the user or can be shared across different users.
+    * <p>
+    * If this field is set to <code>TRUE</code>, cached information can be shared 
+    * between users. 
+    * Otherwise cached information will be considered private
+    * to the user.
+    * <p>
+    * This value is set before the annotated method is called.
+    * </div>
+    *  
+    * @return     The cache scope
+    */
+   boolean   cacheScopePublic() default false;
+   
+   /**
+    * <div class='not-supported'>
+    * Expiration-time defines the time in seconds after which the portlet output expires.
+    * A value of -1 indicates that the output never expires.
+    * <p>
+    * This value is set before the annotated method is called.
+    * </div>
+    *  
+    * @return     The expiration time
+    */
+   int   cacheExpirationTime() default 0;
+   
+   /**
+    * <div class='container-change'>
+    * The dependencies the portlet may have on external resources.
+    * The resources can represent client-side prerequisites such as JavaScript libraries
+    * or stylesheet resources that are shared among portlets.
+    * </div>
+    * 
+    * @return     The dependencies
+    */
+   Dependency[]      dependencies() default {};
+   
+   /**
+    * <div class='container-change'>
+    * The security role references. 
+    * </div>
+    * 
+    * @return  The security role references
+    */
+   SecurityRoleRef[]   roleRefs() default {};
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/PortletConfigurations.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/PortletConfigurations.java b/portlet-api/src/main/java/javax/portlet/annotations/PortletConfigurations.java
new file mode 100644
index 0000000..cf05926
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/PortletConfigurations.java
@@ -0,0 +1,51 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Annotation for configuration of multiple portlets.
+ * @see PortletConfiguration 
+ * </div>
+ */
+@Retention(RUNTIME) @Target({TYPE})
+public @interface PortletConfigurations {
+   
+   /**
+    * The portlet configurations. Each array entry contains the configuration
+    * for a single portlet.
+    * 
+    * @return     An array of portlet configurations
+    */
+   PortletConfiguration[] configurations();
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/PortletQName.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/PortletQName.java b/portlet-api/src/main/java/javax/portlet/annotations/PortletQName.java
new file mode 100644
index 0000000..3c5fccd
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/PortletQName.java
@@ -0,0 +1,92 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * This annotation is used within composite portlet configuration annotations to
+ * represent a QName for use in portlet event and public render parameter definitions.
+ * It cannot be used as a stand-alone portlet annotation.
+ * <p>
+ * The qname is specified as a string of the form 
+ * <code>namespace-name:local-part</code>, where
+ * <ul>
+ * <li>
+ * namespace-name is a URI specifying the namespace.
+ * </li>
+ * <li>
+ * local-part is a non-empty String.
+ * </li>
+ * </ul>
+ * </div>
+ * 
+ * @see     javax.xml.namespace.QName javax.xml.namespace.QName
+ * @see     <a href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#QName">W3C Qname definition</a>
+ */
+@Retention(RUNTIME) @Target({ANNOTATION_TYPE})
+public @interface PortletQName {
+   
+   /**
+    * The QName namespace URI.
+    * <p>
+    * If the QName namespace URI is empty, the default value is used. 
+    * The default value is taken from the following locations, specified in order of precedence:
+    * <ul>
+    * <li>
+    * The value defined in the {@literal <}default-namespace{@literal >} element in the portlet
+    * deployment descriptor.
+    * </li>
+    * <li>
+    * The value defined in the {@literal <}defaultNamespace{@literal >} element in the
+    * {@literal @}PortletApplication annotation.
+    * </li>
+    * <li>
+    * The value javax.xml.XMLConstants.NULL_NS_URI
+    * </li>
+    * </ul>
+    * 
+    * @return  The QName namespace URI.
+    * 
+    * @see PortletApplication#defaultNamespaceURI()
+    */
+   String      namespaceURI();
+   
+   /**
+    * The local part.
+    * <p>
+    * local-part should be a non-empty String.
+    * 
+    * @return  The qname local part.
+    */
+   String      localPart();
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/PortletRequestFilter.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/PortletRequestFilter.java b/portlet-api/src/main/java/javax/portlet/annotations/PortletRequestFilter.java
new file mode 100644
index 0000000..258aaed
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/PortletRequestFilter.java
@@ -0,0 +1,129 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Designates a portlet request filter class.
+ * The request filter performs filtering tasks on either the request to a portlet, 
+ * on the response from a portlet, or on both.
+ * <p>
+ * Request filters perform filtering in the doFilter method. 
+ * Every Filter has access to a FilterConfig object from which it can obtain its 
+ * initialization parameters and a reference to the PortletContext object.
+ * It can to load resources needed for filtering tasks through the PortletContext object.
+ * <p>
+ * Request filters can be applied to the Action phase, the Event phase, the Render phase 
+ * or the Resource phase depending on which of the filter interfaces the request filter class
+ * implements.  
+ * <p>
+ * The annotated type must implement one or more of the following interfaces:
+ * <ul>
+ * <li>javax.portlet.filter.PortletFilter</li>
+ * <li>javax.portlet.filter.ActionFilter</li>
+ * <li>javax.portlet.filter.EventFilter</li>
+ * <li>javax.portlet.filter.RenderFilter</li>
+ * <li>javax.portlet.filter.ResourceFilter</li>
+ * </ul>
+ * </div>
+ *    
+ * @see javax.portlet.filter.PortletFilter
+ * @see javax.portlet.filter.ActionFilter
+ * @see javax.portlet.filter.EventFilter
+ * @see javax.portlet.filter.RenderFilter
+ * @see javax.portlet.filter.ResourceFilter
+ *
+ */
+
+@Retention(RUNTIME) @Target({TYPE})
+public @interface PortletRequestFilter {
+   
+   /**
+    * <div class='not-supported'>
+    * The portlet names for which the request filter applies.
+    * <p>
+    * The annotated request filter can apply to multiple portlets within the portlet
+    * application. The names of the portlets to which the request filter applies must be 
+    * specified in this field.
+    * <p>
+    * A wildcard character '*' can be specified in the first portletName array element 
+    * to indicate that the request filter is to apply to all portlets in the portlet application.
+    * If specified, the wildcard character must appear alone in the first array element.
+    * </div>
+    * 
+    * @return     The portlet names
+    */
+   String[]   portletNames();
+   
+   /**
+    * <div class='not-supported'>
+    * The filter initialization parameters.
+    * </div>
+    * 
+    * @return     An array of initialization parameters
+    */
+   InitParameter[] initParams() default {};
+   
+   /**
+    * <div class='not-supported'>
+    * The display-name type contains a language-specific short name that is intended to be displayed by tools. 
+    * </div>
+    * 
+    * @return  The display name
+    */
+   LocaleString[]   displayName() default {};
+   
+   /**
+    * <div class='not-supported'>
+    * The portlet filter description
+    * providing locale-specific text describing the portlet filter for use by the portal application or by tools.
+    * </div>
+    * 
+    * @return  The portlet description
+    */
+   LocaleString[]   description() default {};
+   
+   /**
+    * <div class='not-supported'>
+    * The ordinal number for this annotated method.
+    * <p>
+    * The ordinal number determines the order of execution if multiple methods
+    * are annotated for a given request type.
+    * Annotated methods with a lower ordinal number are executed before methods with
+    * a higher ordinal number.
+    * </div>
+    * 
+    * @return     The ordinal number
+    */
+   int        ordinal() default 0;
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/PortletResources.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/PortletResources.java b/portlet-api/src/main/java/javax/portlet/annotations/PortletResources.java
new file mode 100644
index 0000000..232e000
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/PortletResources.java
@@ -0,0 +1,153 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Declares resources needed by one or more portlets in a portlet application. 
+ * The resources may be provided by the portlet for inclusion into the header section
+ * through the <code>GenericPortlet#doHeaders</code> method 
+ * or may represent dependencies on external resources.
+ * <p>
+ * The annotated method must have one of the following signatures:
+ * <ul>
+ * <li>
+ * <code>public void &lt;methodName&gt;(RenderRequest, RenderResponse)</code>
+ * <p>
+ * This corresponds to the <code>doHeaders</code> method. Output written through the
+ * render response object will be placed in the document <code>&lt;head&gt;</code> section.
+ * </li>   
+ * <li>
+ * <code>String &lt;methodName&gt;()</code>
+ * <p>
+ * The String returned by the method will be placed 
+ * in the document <code>&lt;head&gt;</code> section.
+ * </li>   
+ * </ul> 
+ * <p> 
+ * The method name can be freely selected.
+ * <p>
+ * The method declaration may contain a throws clause. Exceptions declared in the 
+ * throws clause should be of type {@link javax.portlet.PortletException} or
+ * {@link java.io.IOException}. 
+ * Checked exceptions of any other type will be caught, wrapped with a PortletException, 
+ * and rethrown.
+ * <p>
+ * This annotation may be applied to a type or to a method. 
+ * If applied to a type, it behaves as though it were applied to an empty 
+ * <code>doHeaders</code> method.  
+ * </div>
+ *    
+ * @see javax.portlet.GenericPortlet#doHeaders(javax.portlet.RenderRequest, javax.portlet.RenderResponse) doHeaders
+ */
+
+@Retention(RUNTIME) @Target({METHOD})
+public @interface PortletResources {
+   
+   /**
+    * <div class='container-change'>
+    * The portlet names for which the resources apply.
+    * <p>
+    * The annotated method can apply to multiple portlets within the portlet
+    * application. The names of the portlets to which the resources apply must be 
+    * specified in this field.
+    * <p>
+    * A wildcard character '*' can be specified in the first portletName array element 
+    * to indicate that the resource declarations are to apply to all portlets in 
+    * the portlet application.
+    * If specified, the wildcard character must appear alone in the first array element.
+    * </div>
+    * 
+    * @return     The portlet names
+    */
+   String[]   portletNames();
+   
+   /**
+    * <div class='container-change'>
+    * Sets the content type, or the MIME type, of content generated by the method.
+    * The content type will be set before the annotated method body is executed.
+    * <p>
+    * If this field is empty, no content type will be set.
+    * The portlet can then set the content type using the portlet API
+    * <code>RenderResponse#setContentType</code> method.
+    * </div>
+    * 
+    * @see        javax.portlet.RenderResponse#setContentType(String) RenderResponse#setContentType
+    * 
+    * @return     The content type
+    */
+   String   contentType() default "text/html";
+   
+   /**
+    * <div class='container-change'>
+    * Specifies a resource, such as a JSP, an HTML file, or a servlet, to be included.
+    * <p>
+    * The resource will be included using the 
+    * <code>PortletRequestDispatcher#include</code> method after the method body 
+    * has been executed.
+    * <p>
+    * If this field is empty, no resource will be included.
+    * </div>
+    * 
+    * @see        javax.portlet.PortletRequestDispatcher
+    * @see        javax.portlet.PortletRequestDispatcher#include(javax.portlet.PortletRequest, javax.portlet.PortletResponse) PortletRequestDispatcher#include
+    * 
+    * @return     The resource to be included
+    */
+   String   include() default "";
+   
+   /**
+    * <div class='container-change'>
+    * The dependencies the portlet may have on external resources.
+    * The resources can represent client-side prerequisites such as JavaScript libraries
+    * or stylesheet resources that are shared among portlets.
+    * </div>
+    * 
+    * @return     The dependencies
+    */
+   Dependency[]      dependencies() default {};
+   
+   /**
+    * <div class='container-change'>
+    * The ordinal number for this annotated method.
+    * <p>
+    * The ordinal number determines the order of execution if multiple methods
+    * are annotated.
+    * Annotated methods with a lower ordinal number are executed before methods with
+    * a higher ordinal number.
+    * </div>
+    * 
+    * @return     The ordinal number
+    */
+   int        ordinal() default 0;
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/PortletSerializable.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/PortletSerializable.java b/portlet-api/src/main/java/javax/portlet/annotations/PortletSerializable.java
new file mode 100644
index 0000000..0e1e20a
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/PortletSerializable.java
@@ -0,0 +1,84 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+/**
+ * <div class='changed_added_3_0'>
+ * This interface must be implemented by {@link PortletStateScoped} beans
+ * in order to allow the bean portlet container to intialize the bean at the
+ * beginning of a request and passivate the bean at the end of the request.
+ * <p>
+ * These methods are not intended to be called by application code.
+ * <p>
+ * A <code>{@literal @}PortletStateScoped</code> bean must be a valid bean; in particular,
+ * it must provide a default constructor or be constructable through an 
+ * <code>{@literal @}Produces</code> method or field.
+ * <p>
+ * Note that only changes made to the bean state during <code>ActionMethod</code>
+ * or <code>EventMethod</code> execution are stored in the portlet state.
+ * Changes made during <code>RenderMethod</code>, <code>ServeResourceMethod</code>,
+ * or <code>HeaderMethod</code> execution will not be available during subsequent requests.
+ * </div>
+ * 
+ * @see PortletStateScoped
+ */
+public interface PortletSerializable {
+   
+   /**
+    * The portlet bean container calls this method after {@link ActionMethod}
+    * or {@link EventMethod} execution to obtain the bean state.
+    * <p>
+    * The bean developer should take care to include all internal bean data in the
+    * returned state that is necessary for properly initializing the bean when the
+    * portlet bean container calls the 
+    * {@link PortletSerializable#deserialize(String[]) deserialize} method.
+    * <p>
+    * If no bean data has been set, this method should return an empty array or 
+    * <code>null</code> in order to avoid setting extraneous parameters.
+    * 
+    * @return     The bean state as a string array.
+    */
+   public String[]   serialize();
+   
+   /**
+    * The bean portlet container calls this method at the beginning of every portlet
+    * request method that uses the bean. 
+    * <p> 
+    * The string array portlet state data is the same array provided to the container
+    * by the {@link PortletSerializable#serialize() serialize} method.
+    * The bean should reconstruct its internal state during execution of this method.
+    * <p>
+    * If no data is available for the portlet, for example because because no 
+    * {@link ActionMethod} or {@link EventMethod} has been executed for the portlet, 
+    * the state parameter will be an empty array.
+    * <p>
+    * If the state array is empty, the bean implementation should provide approriate 
+    * default values for its internal variables.
+    *  
+    * @param state      The bean state as string array.
+    *                   The array will be empty if bean data has not yet been set.
+    */
+   public void       deserialize(String[] state); 
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/PortletSessionScoped.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/PortletSessionScoped.java b/portlet-api/src/main/java/javax/portlet/annotations/PortletSessionScoped.java
new file mode 100644
index 0000000..f10d83a
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/PortletSessionScoped.java
@@ -0,0 +1,76 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.NormalScope;
+import javax.portlet.PortletSession;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Provides a CDI custom scope that is scoped to the portlet session rather than to the
+ * servlet session.
+ * <p>
+ * Note that a portlet session scoped bean must implement 
+ * <code>java.io.Serializable</code>, since it will be stored in the portlet session.
+ * </div>
+ *
+ */
+
+@Retention(RUNTIME) 
+@Target({TYPE})
+@NormalScope(passivating=true)
+@Inherited
+@Documented
+public @interface PortletSessionScoped {
+   
+   /**
+    * The portlet scope into which the annotated bean is to be placed. Can be set to 
+    * the following values:
+    * <ul>
+    * <li>
+    * PortletSession.PORTLET_SCOPE - scopes the bean to the portlet session
+    * </li>
+    * <li>
+    * PortletSession.APPLICATION_SCOPED - Scopes the bean to the portlet application session.
+    * The effect of this scope is the same as using the CDI @SessionScoped annotation.
+    * </li>
+    * </ul>
+    * 
+    * @return The portlet scope
+    * 
+    * @see  PortletSession#PORTLET_SCOPE
+    * @see  PortletSession#APPLICATION_SCOPE
+    */
+   int value() default PortletSession.PORTLET_SCOPE;
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/PortletStateScoped.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/PortletStateScoped.java b/portlet-api/src/main/java/javax/portlet/annotations/PortletStateScoped.java
new file mode 100644
index 0000000..3c7d4a1
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/PortletStateScoped.java
@@ -0,0 +1,96 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.NormalScope;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Provides a CDI custom scope that is scoped to the portlet state. 
+ * The purpose of this scope is to allow portlet render parameters to be handled like
+ * beans.
+ * <p>
+ * If an <code>{@literal @}PortletStateScoped</code> bean is injected into a class containing 
+ * an <code>{@literal @}EventMethod</code> or an <code>{@literal @}ActionMethod</code>,
+ * the bean is associated with the corresponding portlet.
+ * The bean state is stored as a render parameter of the that portlet.
+ * <p>
+ * A bean annotated with this scope must implement the {@link PortletSerializable} 
+ * interface,
+ * which provides methods used by the portlet bean container to synchronize the bean
+ * according to the portlet state.
+ * <p>
+ * An <code>{@literal @}PortletStateScoped</code> bean is similar to an 
+ * <code>{@literal @}RequestScoped</code> bean in that a new instance is created at the
+ * beginning of each request.
+ * However, for <code>{@literal @}PortletStateScopedScoped</code> beans, the portlet bean 
+ * container calls the 
+ * {@link PortletSerializable#deserialize(String[]) PortletSerializable#deserialize}
+ * method at the beginning of each request to initialize the bean and the  
+ * {@link PortletSerializable#serialize() PortletSerializable#serialize} method
+ * at the end of an action request or event request to obtain the serialized bean data.
+ * <p>
+ * A <code>{@literal @}PortletStateScoped</code> bean must be a valid bean and
+ * must provide a default constructor.
+ * <p>
+ * Note that only changes made to the bean state during <code>ActionMethod</code>
+ * or <code>EventMethod</code> execution are stored in the portlet state.
+ * Changes made during <code>RenderMethod</code>, <code>ServeResourceMethod</code>,
+ * or <code>HeaderMethod</code> execution will not be available during subsequent requests.
+ * </div>
+ *
+ * @see PortletSerializable
+ */
+
+@Retention(RUNTIME) 
+@Target({TYPE})
+@NormalScope()
+@Inherited
+public @interface PortletStateScoped {
+   
+   /**
+    * The name of the render parameter under which the bean state is to be stored.
+    * <p>
+    * If the name is not specified through the annotation, the portlet container
+    * will assign a render parameter name.
+    * <p>
+    * If this element is a public render parameter identifier as declared in the 
+    * portlet application configuration,
+    * the render parameter represented by the annotated class will be treated as 
+    * a public render parameter.
+    *  
+    * @return  The parameter name
+    */
+   String   paramName() default "";
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/PortletURLGenerationListener.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/PortletURLGenerationListener.java b/portlet-api/src/main/java/javax/portlet/annotations/PortletURLGenerationListener.java
new file mode 100644
index 0000000..1ad3af0
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/PortletURLGenerationListener.java
@@ -0,0 +1,129 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Designates a portlet URL generation listener method.
+ * The listener method will be invoked before a URL of the corresponding type is
+ * generated.
+ * <p>
+ * The annotated method must have one of the following signatures:
+ * <p>
+ *    <code>public void &lt;methodName&gt;(ActionURL actionURL)</code>
+ * <p>   
+ * <p>
+ *    <code>public void &lt;methodName&gt;(RenderURL renderURL)</code>
+ * <p>   
+ * <p>
+ *    <code>public void &lt;methodName&gt;(ResourceURL resourceURL)</code>
+ * <p>   
+ * where the method name can be freely selected.
+ * </div>
+ *    
+ * @see javax.portlet.PortletURLGenerationListener
+ *
+ */
+
+@Retention(RUNTIME) @Target({METHOD})
+public @interface PortletURLGenerationListener {
+   
+   /**
+    * <div class='changed_added_3_0'>
+    * Needed for V2.0 portlets to discern between a Render URL and an Action URL
+    * since both are represented by the interface PortletURL.
+    * 
+    * Not needed for v3.0 portlets.
+    * </div>
+    */
+   public enum URLType {RENDER, ACTION, RESOURCE}
+   
+   /**
+    * The portlet names for which the listener applies.
+    * <p>
+    * The annotated listener method can apply to multiple portlets within the portlet
+    * application. The names of the portlets to which the listener applies must be 
+    * specified in this field.
+    * <p>
+    * A wildcard character '*' can be specified in the first portletName array element 
+    * to indicate that the listener is to apply to all portlets in the portlet application.
+    * If specified, the wildcard character must appear alone in the first array element.
+    * 
+    * @return     The portlet names
+    */
+   String[]    portletNames();
+   
+   /**
+    * The ordinal number for this annotated method.
+    * <p>
+    * The ordinal number determines the order of execution if multiple methods
+    * are annotated for a given URL type.
+    * Annotated methods with a lower ordinal number are executed before methods with
+    * a higher ordinal number.
+    * 
+    * @return     The ordinal number
+    */
+   int         ordinal() default 0;
+   
+   /**
+    * <div class='not-supported'>
+    * The display-name type contains a language-specific short name that is intended to be displayed by tools. 
+    * </div>
+    * 
+    * @return  The display name
+    */
+   LocaleString[]   displayName() default {};
+   
+   /**
+    * <div class='not-supported'>
+    * The portlet filter description
+    * providing locale-specific text describing the portlet filter for use by the portal application or by tools.
+    * </div>
+    * 
+    * @return  The portlet description
+    */
+   LocaleString[]   description() default {};
+   
+   /**
+    * The URL Type. 
+    * This field is needed for v2.0 portlets to discern between render URLs and 
+    * action URLs, since both are represented by the interface PortletURL.
+    * 
+    * Needs not be specified for ResourceURLs, as they are identified by the
+    * ResourceURL interface.
+    * 
+    * Not needed for v3.0 portlets
+    * 
+    * @return  The URL type
+    */
+   URLType     type() default URLType.RENDER;
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/Preference.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/Preference.java b/portlet-api/src/main/java/javax/portlet/annotations/Preference.java
new file mode 100644
index 0000000..1bfa5ca
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/Preference.java
@@ -0,0 +1,73 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * This annotation is used within composite portlet configuration annotations to
+ * represent a single portlet preference.
+ * It cannot be used as a stand-alone portlet annotation.
+ * </div>
+ */
+@Retention(RUNTIME) @Target({ANNOTATION_TYPE})
+public @interface Preference {
+   
+   /**
+    * The preference name.
+    * 
+    * @return  The preference name
+    */
+   String      name();
+   
+   /**
+    * The preference values array.
+    * 
+    * @return  The preference values.
+    */
+   String[]    values();
+   
+   /**
+    * Marks the preference as being read-only.
+    * 
+    * @return  The read-only flag
+    */
+   boolean     isReadOnly() default false;
+   
+   /**
+    * <div class='container-change'>
+    * Provides locale-specific text describing the portlet preference for use by the portal application or by tools.
+    * </div>
+    * 
+    * @return  The portlet preference description
+    */
+   LocaleString[]      description() default {};
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/PreferencesValidator.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/PreferencesValidator.java b/portlet-api/src/main/java/javax/portlet/annotations/PreferencesValidator.java
new file mode 100644
index 0000000..2fe4751
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/PreferencesValidator.java
@@ -0,0 +1,83 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Designates a preferences validator method.
+ * The PreferencesValidator allows validation of the set of portlet preferences 
+ * before they are stored in the persistent store.
+ * The validator method is invoked during execution of the 
+ * store method of the PortletPreferences. 
+ * <p>
+ * The annotated method must have the following signature:
+ * <p>
+ *    <code>public void &lt;methodName&gt;(PortletPreferences preferences) throws ValidatorException</code>
+ * <p>   
+ * where the method name can be freely selected.
+ * <p>
+ * </div>
+ *    
+ * @see javax.portlet.PreferencesValidator#validate(javax.portlet.PortletPreferences) PreferencesValidator#validate
+ *
+ */
+
+@Retention(RUNTIME) @Target({METHOD})
+public @interface PreferencesValidator {
+   
+   /**
+    * The portlet names for which the validator applies.
+    * <p>
+    * The annotated validator method can apply to multiple portlets within the portlet
+    * application. The names of the portlets to which the validator applies must be 
+    * specified in this field.
+    * <p>
+    * A wildcard character '*' can be specified in the first portletName array element 
+    * to indicate that the validator is to apply to all portlets in the portlet application.
+    * If specified, the wildcard character must appear alone in the first array element.
+    * 
+    * @return     The portlet names
+    */
+   String[]   portletNames();
+   
+   /**
+    * The ordinal number for this annotated method.
+    * <p>
+    * The ordinal number determines the order of execution if multiple methods
+    * are annotated.
+    * Annotated methods with a lower ordinal number are executed before methods with
+    * a higher ordinal number.
+    * 
+    * @return     The ordinal number
+    */
+   int        ordinal() default 0;
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/PublicRenderParameterDefinition.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/PublicRenderParameterDefinition.java b/portlet-api/src/main/java/javax/portlet/annotations/PublicRenderParameterDefinition.java
new file mode 100644
index 0000000..fed9df8
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/PublicRenderParameterDefinition.java
@@ -0,0 +1,93 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * This annotation is used within composite portlet configuration annotations to
+ * represent a single public render parameter.
+ * It cannot be used as a stand-alone portlet annotation.
+ * </div>
+ */
+@Retention(RUNTIME) @Target({ANNOTATION_TYPE})
+public @interface PublicRenderParameterDefinition {
+   
+   /**
+    * <div class='container-change'>
+    * The public render parameter identifier.
+    * <p>
+    * This identifier is used as the public render parameter name in the
+    * portlet parameter handling interfaces.
+    * <p>
+    * The public render parameter identifier must be unique within the portlet application. 
+    * </div>
+    * 
+    * @see     javax.portlet.PortletConfig#getPublicRenderParameterNames() PortletConfig#getPublicRenderParameterNames
+    * 
+    * @return  The public render parameter identifier
+    */
+   String      identifier();
+   
+   /**
+    * <div class='container-change'>
+    * The public render parameter Qname.
+    * <p>
+    * The public render parameter qname must be unique within the portlet application. 
+    * </div>
+    * 
+    * @see     javax.xml.namespace.QName
+    * @see     <a href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#QName">Qname definition</a>
+    * 
+    * @return  The qname
+    */
+   PortletQName   qname();
+   
+   /**
+    * <div class='container-change'>
+    * Provides locale-specific text describing the public render parameter for use by the portal application or by tools.
+    * </div>
+    * 
+    * @return  The public render parameter description
+    */
+   LocaleString[]      description() default {};
+   
+   /**
+    * <div class='container-change'>
+    * The display-name type contains a locale-specific short name that is intended to be displayed by tools. 
+    * It is used by display-name elements. 
+    * The display name need not be unique.
+    * </div>
+    * 
+    * @return  The display name
+    */
+   LocaleString[]   displayName() default {};
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/RenderMethod.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/RenderMethod.java b/portlet-api/src/main/java/javax/portlet/annotations/RenderMethod.java
new file mode 100644
index 0000000..7ccc463
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/RenderMethod.java
@@ -0,0 +1,143 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+package javax.portlet.annotations;
+
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Designates a method corresponding to the portlet API render method.
+ * The annotated method must have one of the following signatures:
+ * <p>
+ * The annotated method must have one of the following signatures:
+ * <ul>
+ * <li>
+ * <code>public void &lt;methodName&gt;(RenderRequest, RenderResponse)</code>
+ * <p>
+ * This corresponds to the <code>render</code> method.
+ * </li>   
+ * <li>
+ * <code>public String &lt;methodName&gt;()</code>
+ * <p>
+ * The String returned by the method will be written to the response unchanged. 
+ * </li>   
+ * <li>
+ * <code>public void &lt;methodName&gt;()</code>
+ * <p>
+ * Intended for use when only a resource include is needed. 
+ * </li>   
+ * </ul> 
+ * where the method name can be freely selected.
+ * <p>
+ * The method declaration may contain a throws clause. Exceptions declared in the 
+ * throws clause should be of type {@link javax.portlet.PortletException} or
+ * {@link java.io.IOException}. 
+ * Checked exceptions of any other type will be caught, wrapped with a PortletException, 
+ * and rethrown.
+ * </div>
+ * 
+ * @see     javax.portlet.Portlet#render(javax.portlet.RenderRequest, javax.portlet.RenderResponse) Portlet#render
+ *
+ */
+
+@Retention(RUNTIME) @Target({METHOD})
+public @interface RenderMethod {
+   
+   /**
+    * The portlet names for which the render method applies.
+    * <p>
+    * The annotated method can apply to multiple portlets within the portlet
+    * application. The names of the portlets to which the resources apply must be 
+    * specified in this field.
+    * <p>
+    * A wildcard character '*' can be specified in the first portletName array element 
+    * to indicate that the resource declarations are to apply to all portlets in 
+    * the portlet application.
+    * If specified, the wildcard character must appear alone in the first array element.
+    * 
+    * @return     The portlet names
+    */
+   String[]   portletNames();
+   
+   /**
+    * The portlet mode rendered by the annotated method.
+    * <p>
+    * If an portlet mode is specified, the bean enabler will dispatch Render requests with 
+    * matching portlet mode values to this method. 
+    * <p>
+    * If this field is empty, the method will be executed for all
+    * Render requests not dispatched by portlet mode to other RenderMethods.
+    * 
+    * @return     The portlet mode
+    */
+   String   portletMode() default "view";
+   
+   /**
+    * Sets the content type, or the MIME type, of content generated by the method.
+    * The content type will be set before the annotated method body is executed.
+    * <p>
+    * If this field is empty, no content type will be set.
+    * The portlet can then set the content type using the portlet API
+    * <code>RenderResponse#setContentType</code> method.
+    * 
+    * @see        javax.portlet.RenderResponse#setContentType(String) RenderResponse#setContentType
+    * 
+    * @return     The content type
+    */
+   String   contentType() default "text/html";
+   
+   /**
+    * Specifies a resource, such as a JSP, an HTML file, or a servlet to be included.
+    * <p>
+    * The resource will be included using the 
+    * <code>PortletRequestDispatcher#include</code> method after the method body 
+    * has been executed.
+    * <p>
+    * If this field is empty, no resource will be included.
+    * 
+    * @see        javax.portlet.PortletRequestDispatcher
+    * @see        javax.portlet.PortletRequestDispatcher#include(javax.portlet.PortletRequest, javax.portlet.PortletResponse) PortletRequestDispatcher#include
+    * 
+    * @return     The resource to be included
+    */
+   String   include() default "";
+   
+   /**
+    * The ordinal number for this annotated method.
+    * <p>
+    * The ordinal number determines the order of execution if multiple methods
+    * are annotated.
+    * Annotated methods with a lower ordinal number are executed before methods with
+    * a higher ordinal number.
+    * 
+    * @return     The ordinal number
+    */
+   int        ordinal() default 0;
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/RenderParam.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/RenderParam.java b/portlet-api/src/main/java/javax/portlet/annotations/RenderParam.java
new file mode 100644
index 0000000..3246fd3
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/RenderParam.java
@@ -0,0 +1,68 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.inject.Qualifier;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Qualifier that specifies an action parameter for injection.
+ * The parameter will be <code>null</code> if accessed during action 
+ * request execution.
+ * <p>
+ * The type of the injection target must be <code>String</code> or <code>String[]</code>.
+ * <p>
+ * This annotation may only be used in an <code>{@literal @}RequestScoped</code> or
+ * <code>{@literal @}PortletStateScoped</code> bean.
+ * <p>
+ * Example:
+ * <div class='codebox'>      
+ * {@literal @}Inject {@literal @}RenderParam("paramName")<br/>   
+ * private String param;
+ * </div>                    
+ * </div>
+ * 
+ * @see javax.portlet.PortletRequest#getParameter(String) getParameter
+ * @see javax.portlet.PortletRequest#getParameterValues(String) getParameterValues
+ */
+
+@Qualifier @Retention(RUNTIME) @Target({METHOD, FIELD, PARAMETER})
+public @interface RenderParam {
+   
+   /**
+    * The parameter name.
+    * 
+    * @return     The parameter name.
+    */
+   @Nonbinding String   value();
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/ResourceParam.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/ResourceParam.java b/portlet-api/src/main/java/javax/portlet/annotations/ResourceParam.java
new file mode 100644
index 0000000..5956c8a
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/ResourceParam.java
@@ -0,0 +1,77 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.inject.Qualifier;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Qualifier that specifies an resource parameter for injection.
+ * The parameter will be <code>null</code> if accessed outside of a serve resource method.
+ * <p>
+ * Note that this method will only return resource parameters, not render parameters.
+ * To access render parameters within a serve resource method, use the
+ * {@link RenderParam} annotation.
+ * However, if the specified name addresses both a resource parameter and a private render
+ * parameter, the injected bean will contain both sets of values, with the 
+ * render parameter entries following the resource parameter entries in the values array.
+ * <p>
+ * The type of the injection target must be <code>String</code> or <code>String[]</code>.
+ * <p>
+ * This annotation may only be used in <code>{@literal @}RequestScoped</code> or
+ * <code>{@literal @}PortletStateScoped</code> beans.
+ * <p>
+ * Example:
+ * <div class='codebox'>      
+ * {@literal @}Inject {@literal @}ResourceParam("paramName")<br/>   
+ * private String[] paramValues;
+ * </div>                    
+ * </div>
+ * 
+ * @see javax.portlet.PortletRequest#getParameter(String) getParameter
+ * @see javax.portlet.PortletRequest#getParameterValues(String) getParameterValues
+ * @see javax.portlet.ResourceRequest#getPrivateRenderParameterMap() getPrivateRenderParameterMap
+ * 
+ * @see RenderParam
+ */
+
+@Qualifier @Retention(RUNTIME) @Target({METHOD, FIELD, PARAMETER})
+public @interface ResourceParam {
+   
+   /**
+    * The parameter name.
+    * 
+    * @return     The parameter name.
+    */
+   @Nonbinding String   value();
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/RuntimeOption.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/RuntimeOption.java b/portlet-api/src/main/java/javax/portlet/annotations/RuntimeOption.java
new file mode 100644
index 0000000..98a8da0
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/RuntimeOption.java
@@ -0,0 +1,58 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * This annotation is used within composite portlet configuration annotations to
+ * represent portlet container runtime option name-value pairs.
+ * It cannot be used as a stand-alone portlet annotation.
+ * </div>
+ */
+@Retention(RUNTIME) @Target({ANNOTATION_TYPE})
+public @interface RuntimeOption {
+   
+   /**
+    * The container runtime option name.
+    * 
+    * @return     The parameter name
+    */
+   String   name();
+   
+   /**
+    * The container runtime options value
+    * 
+    * @return     The parameter value
+    */
+   String   value();
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/SecurityRoleRef.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/SecurityRoleRef.java b/portlet-api/src/main/java/javax/portlet/annotations/SecurityRoleRef.java
new file mode 100644
index 0000000..a371110
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/SecurityRoleRef.java
@@ -0,0 +1,61 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * This annotation is used within composite portlet configuration annotations to
+ * represent a single security role reference.
+ * It cannot be used as a stand-alone portlet annotation.
+ * </div>
+ */
+@Retention(RUNTIME) @Target({ANNOTATION_TYPE})
+public @interface SecurityRoleRef {
+   
+   /**
+    * <div class='container-change'>
+    * The role name.
+    * </div>
+    * 
+    * @return  The role name
+    */
+   String      roleName();
+   
+   /**
+    * <div class='container-change'>
+    * The application role that the role name is mapped to. 
+    * </div>
+    * 
+    * @return  The role link
+    */
+   String      roleLink() default "";
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/ServeResourceMethod.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/ServeResourceMethod.java b/portlet-api/src/main/java/javax/portlet/annotations/ServeResourceMethod.java
new file mode 100644
index 0000000..af64501
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/ServeResourceMethod.java
@@ -0,0 +1,157 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+package javax.portlet.annotations;
+
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Designates a method corresponding to the portlet API serveResource method.
+ * <p>
+ * The annotated method must have one of the following signatures:
+ * <ul>
+ * <li>
+ * <code>public void &lt;methodName&gt;(ResourceRequest, ResourceResponse)</code>
+ * <p>
+ * This corresponds to the <code>serveResource</code> method.
+ * </li>   
+ * <li>
+ * <code>public String &lt;methodName&gt;()</code>
+ * <p>
+ * The String returned by the method will be written to the response unchanged. 
+ * </li>   
+ * <li>
+ * <code>public void &lt;methodName&gt;()</code>
+ * <p>
+ * Intended for use when only a resource include is needed. 
+ * </li>   
+ * </ul> 
+ * where the method name can be freely selected.
+ * <p>
+ * The method declaration may contain a throws clause. Exceptions declared in the 
+ * throws clause should be of type {@link javax.portlet.PortletException} or
+ * {@link java.io.IOException}. 
+ * Checked exceptions of any other type will be caught, wrapped with a PortletException, 
+ * and rethrown.
+ * </div>
+ * 
+ * @see     javax.portlet.ResourceServingPortlet#serveResource(javax.portlet.ResourceRequest, javax.portlet.ResourceResponse) ResourceServingPortlet#serveResource
+ *
+ */
+
+@Retention(RUNTIME) @Target({METHOD})
+public @interface ServeResourceMethod {
+   
+   /**
+    * The portlet names for which the serve resource method applies.
+    * <p>
+    * The annotated method can apply to multiple portlets within the portlet
+    * application. The names of the portlets to which the resources apply must be 
+    * specified in this field.
+    * <p>
+    * A wildcard character '*' can be specified in the first portletName array element 
+    * to indicate that the resource declarations are to apply to all portlets in 
+    * the portlet application.
+    * If specified, the wildcard character must appear alone in the first array element.
+    * 
+    * @return     The portlet names
+    */
+   String[]   portletNames();
+   
+   /**
+    * The resource ID.
+    * <p>
+    * If a resource ID is specified, the bean enabler will dispatch Resource requests with 
+    * matching values of the resource ID to this method. 
+    * <p>
+    * If this field is empty, 
+    * the method will be executed for all Resource requests not dispatched 
+    * to other named ResourceMethods.
+    * 
+    * @return     The resource ID
+    */
+   String   resourceID() default "";
+   
+   /**
+    * Sets the character encoding for content generated by the annotated method.
+    * The character encoding will be set before the annotated method body is executed.
+    * <p>
+    * If this field is empty, the character encoding will not be set.
+    * The portlet can then set the character encoding using the portlet API
+    * <code>ResourceResponse#setCharacterEncoding</code> method.
+    * 
+    * @see        javax.portlet.ResourceResponse#setCharacterEncoding(String) ResourceResponse#setCharacterEncoding
+    * 
+    * @return     The character encoding
+    */
+   String   characterEncoding() default "UTF-8";
+   
+   /**
+    * Sets the content type, or the MIME type, of content generated by the method.
+    * The content type will be set before the annotated method body is executed.
+    * <p>
+    * If this field is empty, no content type will be set.
+    * The portlet can then set the content type using the portlet API
+    * <code>ResourceResponse#setContentType</code> method.
+    * 
+    * @see        javax.portlet.ResourceResponse#setContentType(String) ResourceResponse#setContentType
+    * 
+    * @return     The content type
+    */
+   String   contentType() default "text/html";
+   
+   /**
+    * Specifies a resource, such as a JSP, an HTML file, or a servlet, to be included.
+    * <p>
+    * The resource will be included using the 
+    * <code>PortletRequestDispatcher#include</code> method after the method body 
+    * has been executed.
+    * <p>
+    * If this field is empty, no resource will be included.
+    * 
+    * @see        javax.portlet.PortletRequestDispatcher
+    * @see        javax.portlet.PortletRequestDispatcher#include(javax.portlet.PortletRequest, javax.portlet.PortletResponse) PortletRequestDispatcher#include
+    * 
+    * @return     The resource to be included
+    */
+   String   include() default "";
+   
+   /**
+    * The ordinal number for this annotated method.
+    * <p>
+    * The ordinal number determines the order of execution if multiple methods
+    * are annotated.
+    * Annotated methods with a lower ordinal number are executed before methods with
+    * a higher ordinal number.
+    * 
+    * @return     The ordinal number
+    */
+   int        ordinal() default 0;
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/Supports.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/Supports.java b/portlet-api/src/main/java/javax/portlet/annotations/Supports.java
new file mode 100644
index 0000000..c9c0e37
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/Supports.java
@@ -0,0 +1,74 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * This annotation is used within composite portlet configuration annotations to
+ * specify the supported portlet modes and window states for a given locale.
+ * It cannot be used as a stand-alone portlet annotation.
+ * </div>
+ */
+@Retention(RUNTIME) @Target({ANNOTATION_TYPE})
+public @interface Supports {
+   
+   /**
+    * <div class='container-change'>
+    * The MIME type for the supported portlet modes and window
+    * states listed in this annotation, for example <code>"text{@literal /}html"</code>.
+    * <p>
+    * The MIME type may also contain the wildcard character '*', 
+    * for example <code>"text{@literal /}*"</code> or <code>"*{@literal /}*"</code>.
+    * </div>
+    * 
+    * @return  The mime type
+    */
+   String   mimeType() default "text/html";
+   
+   /**
+    * <div class='container-change'>
+    * The names of the supported portlet modes.
+    * </div>
+    * 
+    * @return  The supported portlet modes
+    */
+   String[]      portletModes() default "";
+   
+   /**
+    * <div class='container-change'>
+    * The names of the supported window states.
+    * </div>
+    * 
+    * @return  The supported window states
+    */
+   String[]      windowStates() default "";
+}


[04/38] portals-pluto git commit: Replaced code that reads the deployment descriptor with an implementation that can be better extended to add v3.0 support. Added test cases. Uses jaxb binding classes that are generated at compile time.

Posted by ms...@apache.org.
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/fixtures/TestFilter.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/fixtures/TestFilter.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/fixtures/TestFilter.java
new file mode 100644
index 0000000..cc50b01
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/fixtures/TestFilter.java
@@ -0,0 +1,50 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl.fixtures;
+
+import javax.portlet.PortletException;
+import javax.portlet.filter.FilterConfig;
+import javax.portlet.filter.PortletFilter;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class TestFilter implements PortletFilter {
+
+   /* (non-Javadoc)
+    * @see javax.portlet.filter.PortletFilter#destroy()
+    */
+   @Override
+   public void destroy() {
+      // TODO Auto-generated method stub
+
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.filter.PortletFilter#init(javax.portlet.filter.FilterConfig)
+    */
+   @Override
+   public void init(FilterConfig arg0) throws PortletException {
+      // TODO Auto-generated method stub
+
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/fixtures/TestListener.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/fixtures/TestListener.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/fixtures/TestListener.java
new file mode 100644
index 0000000..f8a1553
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/fixtures/TestListener.java
@@ -0,0 +1,28 @@
+package org.apache.pluto.container.om.portlet.impl.fixtures;
+
+import javax.portlet.ActionURL;
+import javax.portlet.PortletURLGenerationListener;
+import javax.portlet.RenderURL;
+import javax.portlet.ResourceURL;
+
+public class  TestListener implements PortletURLGenerationListener<RenderURL, ActionURL> {
+
+   @Override
+   public void filterActionURL(ActionURL arg0) {
+      // TODO Auto-generated method stub
+      
+   }
+
+   @Override
+   public void filterRenderURL(RenderURL arg0) {
+      // TODO Auto-generated method stub
+      
+   }
+
+   @Override
+   public void filterResourceURL(ResourceURL arg0) {
+      // TODO Auto-generated method stub
+      
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/fixtures/TestPortlet.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/fixtures/TestPortlet.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/fixtures/TestPortlet.java
new file mode 100644
index 0000000..63a7718
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/fixtures/TestPortlet.java
@@ -0,0 +1,64 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl.fixtures;
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class TestPortlet implements Portlet {
+
+   @Override
+   public void destroy() {
+      // TODO Auto-generated method stub
+      
+   }
+
+   @Override
+   public void init(PortletConfig arg0) throws PortletException {
+      // TODO Auto-generated method stub
+      
+   }
+
+   @Override
+   public void processAction(ActionRequest arg0, ActionResponse arg1)
+         throws PortletException, IOException {
+      // TODO Auto-generated method stub
+      
+   }
+
+   @Override
+   public void render(RenderRequest arg0, RenderResponse arg1)
+         throws PortletException, IOException {
+      // TODO Auto-generated method stub
+      
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/fixtures/TestPreferencesValidator.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/fixtures/TestPreferencesValidator.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/fixtures/TestPreferencesValidator.java
new file mode 100644
index 0000000..191633d
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/fixtures/TestPreferencesValidator.java
@@ -0,0 +1,37 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl.fixtures;
+
+import javax.portlet.PortletPreferences;
+import javax.portlet.PreferencesValidator;
+import javax.portlet.ValidatorException;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class TestPreferencesValidator implements PreferencesValidator {
+
+   @Override
+   public void validate(PortletPreferences arg0) throws ValidatorException {
+      
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/CustomPortletMode168ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/CustomPortletMode168ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/CustomPortletMode168ImplTest.java
new file mode 100644
index 0000000..436b1f4
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/CustomPortletMode168ImplTest.java
@@ -0,0 +1,128 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl.jsr168;
+
+import static org.junit.Assert.*;
+
+import java.io.InputStream;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.CustomPortletMode;
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.CustomPortletModeImpl;
+import org.apache.pluto.container.om.portlet.impl.DescriptionImpl;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class CustomPortletMode168ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet168Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+
+   /**
+    * @throws java.lang.Exception
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      InputStream in = PortletApplicationDefinition168ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.CustomPortletModeImpl#getPortletMode()}.
+    */
+   @Test
+   public void testGetPortletMode() {
+      CustomPortletMode cpm = pad.getCustomPortletMode("portlet-mode");
+      assertNotNull(cpm);
+      assertEquals(1, pad.getCustomPortletModes().size());
+      cpm = pad.getCustomPortletModes().get(0);
+      assertEquals("portlet-mode", cpm.getPortletMode());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.CustomPortletModeImpl#getDescription(java.util.Locale)}.
+    */
+   @Test
+   public void testGetDescription() {
+      assertEquals(1, pad.getCustomPortletModes().size());
+      CustomPortletMode cpm = pad.getCustomPortletModes().get(0);
+      Locale loc = new Locale("de");
+      Description d = cpm.getDescription(loc);
+      assertNotNull(d);
+      assertEquals("description", d.getDescription());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.CustomPortletModeImpl#getDescriptions()}.
+    */
+   @Test
+   public void testGetDescriptions() {
+      assertEquals(1, pad.getCustomPortletModes().size());
+      CustomPortletMode cpm = pad.getCustomPortletModes().get(0);
+      assertEquals("portlet-mode", cpm.getPortletMode());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.CustomPortletModeImpl#addDescription(org.apache.pluto.container.om.portlet.Description)}.
+    */
+   @Test
+   public void testAddDescription() {
+      assertEquals(1, pad.getCustomPortletModes().size());
+      CustomPortletMode cpm = 
+            new CustomPortletModeImpl(pad.getCustomPortletModes().get(0));
+      assertEquals(1, cpm.getDescriptions().size());
+      Locale loc = Locale.FRENCH;
+      String text = "Some description";
+      Description d = new DescriptionImpl(loc, text);
+      cpm.addDescription(d);
+      
+      List<Description> list = cpm.getDescriptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (Description desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDescription());
+         } else {
+            assertEquals("description", desc.getDescription());
+         }
+      }
+
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/CustomWindowState168ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/CustomWindowState168ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/CustomWindowState168ImplTest.java
new file mode 100644
index 0000000..46f1b7f
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/CustomWindowState168ImplTest.java
@@ -0,0 +1,128 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl.jsr168;
+
+import static org.junit.Assert.*;
+
+import java.io.InputStream;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.CustomWindowState;
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.CustomWindowStateImpl;
+import org.apache.pluto.container.om.portlet.impl.DescriptionImpl;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class CustomWindowState168ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet168Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+
+   /**
+    * @throws java.lang.Exception
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      InputStream in = PortletApplicationDefinition168ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.CustomWindowStateImpl#getWindowState()}.
+    */
+   @Test
+   public void testGetWindowState() {
+      CustomWindowState cws = pad.getCustomWindowState("window-state");
+      assertNotNull(cws);
+      assertEquals(1, pad.getCustomWindowStates().size());
+      cws = pad.getCustomWindowStates().get(0);
+      assertEquals("window-state", cws.getWindowState());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.CustomWindowStateImpl#getDescription(java.util.Locale)}.
+    */
+   @Test
+   public void testGetDescription() {
+      assertEquals(1, pad.getCustomWindowStates().size());
+      CustomWindowState cws = pad.getCustomWindowStates().get(0);
+      Locale loc = new Locale("de");
+      Description d = cws.getDescription(loc);
+      assertNotNull(d);
+      assertEquals("description", d.getDescription());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.CustomWindowStateImpl#getDescriptions()}.
+    */
+   @Test
+   public void testGetDescriptions() {
+      assertEquals(1, pad.getCustomWindowStates().size());
+      CustomWindowState cws = pad.getCustomWindowStates().get(0);
+      assertEquals("window-state", cws.getWindowState());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.CustomWindowStateImpl#addDescription(org.apache.pluto.container.om.portlet.Description)}.
+    */
+   @Test
+   public void testAddDescription() {
+      assertEquals(1, pad.getCustomWindowStates().size());
+      CustomWindowState cws = 
+            new CustomWindowStateImpl(pad.getCustomWindowStates().get(0));
+      assertEquals(1, cws.getDescriptions().size());
+      Locale loc = Locale.FRENCH;
+      String text = "Some description";
+      Description d = new DescriptionImpl(loc, text);
+      cws.addDescription(d);
+      
+      List<Description> list = cws.getDescriptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (Description desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDescription());
+         } else {
+            assertEquals("description", desc.getDescription());
+         }
+      }
+
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/PortletApplicationDefinition168ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/PortletApplicationDefinition168ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/PortletApplicationDefinition168ImplTest.java
new file mode 100644
index 0000000..316eccd
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/PortletApplicationDefinition168ImplTest.java
@@ -0,0 +1,113 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl.jsr168;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.InputStream;
+
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Junit test cases for JSR 168 portlet application definition.
+ * @author Scott Nicklous
+ *
+ */
+public class PortletApplicationDefinition168ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet168Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+
+   /**
+    * @throws java.lang.Exception
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      
+      InputStream in = PortletApplicationDefinition168ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.PortletApplicationDefinitionImpl#getId()}.
+    */
+   @Test
+   public void testGetSetId() {
+      String val = pad.getId();
+      assertNotNull(val);
+      assertEquals("id1", val);
+      pad.setId("42");
+      val = pad.getId();
+      assertNotNull(val);
+      assertEquals("42", val);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.PortletApplicationDefinitionImpl#getName()}.
+    */
+   @Test
+   public void testGetSetName() {
+      pad.setName("Bob");
+      String val = pad.getName();
+      assertNotNull(val);
+      assertEquals("Bob", val);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.PortletApplicationDefinitionImpl#getContextPath()}.
+    */
+   @Test
+   public void testSetGetContextPath() {
+      pad.setContextPath("Bob");
+      String val = pad.getContextPath();
+      assertNotNull(val);
+      assertEquals("Bob", val);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.PortletApplicationDefinitionImpl#getVersion()}.
+    */
+   @Test
+   public void testGetSetVersion() {
+      String val = pad.getVersion();
+      assertNotNull(val);
+      assertEquals("1.0", val);
+      pad.setVersion("42");
+      val = pad.getVersion();
+      assertNotNull(val);
+      assertEquals("42", val);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/PortletDefinition168ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/PortletDefinition168ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/PortletDefinition168ImplTest.java
new file mode 100644
index 0000000..34bbfc2
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/PortletDefinition168ImplTest.java
@@ -0,0 +1,426 @@
+package org.apache.pluto.container.om.portlet.impl.jsr168;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.InputStream;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.DisplayName;
+import org.apache.pluto.container.om.portlet.InitParam;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.PortletDefinition;
+import org.apache.pluto.container.om.portlet.PortletInfo;
+import org.apache.pluto.container.om.portlet.Preference;
+import org.apache.pluto.container.om.portlet.Preferences;
+import org.apache.pluto.container.om.portlet.SecurityRoleRef;
+import org.apache.pluto.container.om.portlet.Supports;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.DescriptionImpl;
+import org.apache.pluto.container.om.portlet.impl.DisplayNameImpl;
+import org.apache.pluto.container.om.portlet.impl.InitParamImpl;
+import org.apache.pluto.container.om.portlet.impl.PortletDefinitionImpl;
+import org.apache.pluto.container.om.portlet.impl.PortletInfoImpl;
+import org.apache.pluto.container.om.portlet.impl.PreferenceImpl;
+import org.apache.pluto.container.om.portlet.impl.PreferencesImpl;
+import org.apache.pluto.container.om.portlet.impl.SecurityRoleRefImpl;
+import org.apache.pluto.container.om.portlet.impl.SupportsImpl;
+import org.apache.pluto.container.om.portlet.impl.fixtures.TestPortlet;
+import org.apache.pluto.container.om.portlet.impl.fixtures.TestPreferencesValidator;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class PortletDefinition168ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet168Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+   
+   // Class under test
+   private PortletDefinition cut;
+
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      
+      InputStream in = PortletApplicationDefinition168ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+   
+   @Before
+   public void setUpBefore() throws Exception {
+      assertEquals(1, pad.getPortlets().size());
+      cut = new PortletDefinitionImpl(pad.getPortlets().get(0));
+   }
+
+   @Test
+   public void testGetPortletName() {
+      assertNotNull(cut.getPortletName());
+      assertEquals("portlet168", cut.getPortletName());
+   }
+
+   @Test
+   public void testGetApplication() {
+      assertNotNull(cut.getApplication());
+      assertTrue(cut.getApplication() instanceof PortletApplicationDefinition);
+   }
+
+   @Test
+   public void testGetInitParam() {
+      InitParam ip = cut.getInitParam("name");
+      assertNotNull(ip);
+      assertEquals("name", ip.getParamName());
+      assertEquals("value", ip.getParamValue());
+      assertEquals(1, ip.getDescriptions().size());
+      Locale loc = new Locale("de");
+      Description d = ip.getDescription(loc);
+      assertNotNull(d);
+      assertEquals("description", d.getDescription());
+   }
+
+   @Test
+   public void testGetInitParams() {
+      List<InitParam> ips = cut.getInitParams();
+      assertEquals(1, ips.size());
+      InitParam ip = ips.get(0);
+      assertNotNull(ip);
+      assertEquals("name", ip.getParamName());
+      assertEquals("value", ip.getParamValue());
+   }
+
+   @Test
+   public void testAddInitParam() {
+      String name = "Fred", value = "bowling";
+      InitParam newip = new InitParamImpl(name, value);
+      cut.addInitParam(newip);
+      
+      List<InitParam> ips = cut.getInitParams();
+      assertEquals(2, ips.size());
+      InitParam ip = cut.getInitParam(name);
+      assertNotNull(ip);
+      assertEquals(name, ip.getParamName());
+      assertEquals(value, ip.getParamValue());
+   }
+
+   @Test
+   public void testGetPortletClass() {
+      assertNotNull(cut.getPortletClass());
+      assertEquals(TestPortlet.class.getCanonicalName(), cut.getPortletClass());
+   }
+
+   @Test
+   public void testSetPortletClass() {
+      String text = "someClass";
+      cut.setPortletClass(text);
+      assertEquals(text, cut.getPortletClass());
+   }
+
+   @Test
+   public void testGetPortletInfo() {
+      PortletInfo info = cut.getPortletInfo();
+      assertNotNull(info);
+      assertEquals("title", info.getTitle());
+      assertEquals("short-title", info.getShortTitle());
+      assertEquals("keywords", info.getKeywords());
+   }
+
+   @Test
+   public void testSetPortletInfo() {
+      String ti = "t2", st = "st", kw = "kw";
+      PortletInfo i2 = new PortletInfoImpl(ti, kw, st);
+      cut.setPortletInfo(i2);
+
+      PortletInfo info = cut.getPortletInfo();
+      assertNotNull(info);
+      assertEquals(ti, info.getTitle());
+      assertEquals(st, info.getShortTitle());
+      assertEquals(kw, info.getKeywords());
+   }
+
+   @Test
+   public void testGetPortletPreferences() {
+      Preferences prefs = cut.getPortletPreferences();
+      assertNotNull(prefs);
+      assertEquals(TestPreferencesValidator.class.getCanonicalName(), prefs.getPreferencesValidator());
+      List<Preference> list = prefs.getPortletPreferences();
+      assertEquals(1, list.size());
+      Preference item = list.get(0);
+      assertEquals("name", item.getName());
+      List<String> vals = item.getValues();
+      assertEquals(1, vals.size());
+      assertEquals("value", vals.get(0));
+   }
+
+   @Test
+   public void testSetPortletPreferences() {
+      String validator = "validator";
+      String name = "prefName";
+      String[] vals = {"v1", "v2"};
+      Preferences prefs = new PreferencesImpl(cut.getPortletPreferences());
+      prefs.setPreferencesValidator(validator);
+      prefs.addPreference(new PreferenceImpl(name, true, Arrays.asList(vals)));
+      cut.setPortletPreferences(prefs);
+      
+      Preferences prefs2 = cut.getPortletPreferences();
+      assertNotNull(prefs2);
+      assertEquals(validator, prefs2.getPreferencesValidator());
+      List<Preference> list = prefs2.getPortletPreferences();
+      assertEquals(2, list.size());
+      Preference item = prefs2.getPortletPreference(name);
+      assertEquals(name, item.getName());
+      List<String> newvals = item.getValues();
+      assertEquals(2, newvals.size());
+      assertArrayEquals(vals, newvals.toArray());
+   }
+
+//    @Test  // JSR 286
+//    public void testGetSupportedProcessingEvents() {
+//       fail("Not yet implemented");
+//    }
+// 
+//    @Test  // JSR 286
+//    public void testAddSupportedProcessingEvent() {
+//       fail("Not yet implemented");
+//    }
+// 
+//    @Test  // JSR 286
+//    public void testGetSupportedPublishingEvents() {
+//       fail("Not yet implemented");
+//    }
+// 
+//    @Test  // JSR 286
+//    public void testAddSupportedPublishingEvent() {
+//       fail("Not yet implemented");
+//    }
+// 
+//    @Test  // JSR 286
+//    public void testGetSupportedPublicRenderParameters() {
+//       fail("Not yet implemented");
+//    }
+// 
+//    @Test  // JSR 286
+//    public void testAddSupportedPublicRenderParameter() {
+//       fail("Not yet implemented");
+//    }
+
+   @Test
+   public void testGetResourceBundle() {
+      assertNotNull(cut.getResourceBundle());
+      assertEquals("resource-bundle", cut.getResourceBundle());
+   }
+
+   @Test
+   public void testSetResourceBundle() {
+      String text = "newBundle";
+      cut.setResourceBundle(text);
+      assertNotNull(cut.getResourceBundle());
+      assertEquals(text, cut.getResourceBundle());
+   }
+
+   @Test
+   public void testGetSecurityRoleRef() {
+      SecurityRoleRef srr = cut.getSecurityRoleRef("NMTOKEN");
+      assertNotNull(srr);
+      assertEquals("NMTOKEN", srr.getRoleName());
+      assertEquals("role-link", srr.getRoleLink());
+   }
+
+   @Test
+   public void testGetSecurityRoleRefs() {
+      List<SecurityRoleRef> list = cut.getSecurityRoleRefs();
+      assertEquals(1, list.size());
+      SecurityRoleRef srr = list.get(0);
+      assertNotNull(srr);
+      assertEquals("NMTOKEN", srr.getRoleName());
+      assertEquals("role-link", srr.getRoleLink());
+      Description d = srr.getDescription(new Locale("de"));
+      assertNotNull(d);
+      assertEquals("description", d.getDescription());
+      
+   }
+
+   @Test
+   public void testAddSecurityRoleRef() {
+      String name = "RoleName";
+      String link = "RoleLink";
+      SecurityRoleRef srr = new SecurityRoleRefImpl(name);
+      srr.setRoleLink(link);
+      cut.addSecurityRoleRef(srr);
+
+      List<SecurityRoleRef> list = cut.getSecurityRoleRefs();
+      assertEquals(2, list.size());
+      srr = cut.getSecurityRoleRef(name);
+      assertNotNull(srr);
+      assertEquals(name, srr.getRoleName());
+      assertEquals(link, srr.getRoleLink());
+   }
+
+   @Test
+   public void testGetSupportsString() {
+      Supports s = cut.getSupports("mime-type2");
+      assertNotNull(s);
+   }
+
+   @Test
+   public void testGetSupports() {
+      List<Supports> list = cut.getSupports();
+      assertEquals(3, list.size());
+   }
+
+   @Test
+   public void testAddSupports() {
+      Supports s = new SupportsImpl("text/html");
+      cut.addSupports(s);
+      List<Supports> list = cut.getSupports();
+      assertEquals(4, list.size());
+      boolean ok = false;
+      for (Supports item : list) {
+         if (item.getMimeType().equals("text/html")) {
+            ok = true;
+            break;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   @Test
+   public void testGetDescription() {
+      Locale loc = new Locale("DE");
+      Description desc = cut.getDescription(loc);
+      assertNotNull(desc);
+      assertEquals("multi line description", desc.getDescription());
+   }
+
+   @Test
+   public void testGetDescriptions() {
+      List<Description> list = cut.getDescriptions();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("multi line description", list.get(0).getDescription());
+   }
+
+   @Test
+   public void testAddDescription() {
+      Locale loc = Locale.FRENCH;
+      String text = "Some description";
+      Description d = new DescriptionImpl(loc, text);
+      cut.addDescription(d);
+
+      List<Description> list = cut.getDescriptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (Description desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDescription());
+         } else {
+            assertEquals("multi line description", desc.getDescription());
+         }
+      }
+   }
+
+   @Test
+   public void testGetDisplayName() {
+      Locale loc = new Locale("DE");
+      DisplayName name = cut.getDisplayName(loc);
+      assertNotNull(name);
+      assertEquals("display-name", name.getDisplayName());
+   }
+
+   @Test
+   public void testGetDisplayNames() {
+      List<DisplayName> list = cut.getDisplayNames();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("display-name", list.get(0).getDisplayName());
+   }
+
+   @Test
+   public void testAddDisplayName() {
+      Locale loc = Locale.FRENCH;
+      String text = "Some display name";
+      DisplayName d = new DisplayNameImpl(loc, text);
+      cut.addDisplayName(d);
+
+      List<DisplayName> list = cut.getDisplayNames();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (DisplayName desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDisplayName());
+         } else {
+            assertEquals("display-name", desc.getDisplayName());
+         }
+      }
+   }
+
+   @Test
+   public void testGetSupportedLocales() {
+      List<String> list = cut.getSupportedLocales();
+      assertEquals(1, list.size());
+      assertTrue(list.contains("supported-locale"));
+   }
+
+   @Test
+   public void testAddSupportedLocale() {
+      String locname = "zh-cmn-Hans-CN";
+      cut.addSupportedLocale(locname);
+      
+      List<String> list = cut.getSupportedLocales();
+      assertEquals(2, list.size());
+      assertTrue(list.contains(locname));
+   }
+
+   @Test
+   public void testGetExpirationCache() {
+      assertNotNull(cut.getExpirationCache());
+      assertEquals(50, cut.getExpirationCache());
+   }
+
+   @Test
+   public void testSetExpirationCache() {
+      cut.setExpirationCache(100);
+      assertNotNull(cut.getExpirationCache());
+      assertEquals(100, cut.getExpirationCache());
+   }
+
+//    @Test  // JSR 286
+//    public void testGetCacheScope() {
+//       fail("Not yet implemented");
+//    }
+// 
+//    @Test  // JSR 286
+//    public void testSetCacheScope() {
+//       fail("Not yet implemented");
+//    }
+// 
+//    @Test  // JSR 286
+//    public void testGetContainerRuntimeOption() {
+//       fail("Not yet implemented");
+//    }
+// 
+//    @Test  // JSR 286
+//    public void testGetContainerRuntimeOptions() {
+//       fail("Not yet implemented");
+//    }
+// 
+//    @Test  // JSR 286
+//    public void testAddContainerRuntimeOption() {
+//       fail("Not yet implemented");
+//    }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/SecurityConstraint168ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/SecurityConstraint168ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/SecurityConstraint168ImplTest.java
new file mode 100644
index 0000000..fc261da
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/SecurityConstraint168ImplTest.java
@@ -0,0 +1,122 @@
+package org.apache.pluto.container.om.portlet.impl.jsr168;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.DisplayName;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.SecurityConstraint;
+import org.apache.pluto.container.om.portlet.UserDataConstraint;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.DisplayNameImpl;
+import org.apache.pluto.container.om.portlet.impl.SecurityConstraintImpl;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class SecurityConstraint168ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet168Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+   
+   private ArrayList<SecurityConstraint> constraints;
+   private SecurityConstraint constraint;
+
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      
+      InputStream in = PortletApplicationDefinition168ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+   
+   @Before
+   public void setUpBefore() throws Exception {
+      constraints = new ArrayList<SecurityConstraint>();
+      for (SecurityConstraint sc : pad.getSecurityConstraints()) {
+         // test the copy constructor
+         constraints.add(new SecurityConstraintImpl(sc));
+      }
+      assertEquals(1, constraints.size());
+      constraint = constraints.get(0);
+   }
+
+   @Test
+   // tests the UserDataConstraint as well
+   public void testGetUserDataConstraint() {
+      UserDataConstraint udc = constraint.getUserDataConstraint();
+      assertNotNull(udc);
+      
+   }
+
+   @Test
+   public void testGetDisplayName() {
+      Locale loc = new Locale("DE");
+      DisplayName name = constraint.getDisplayName(loc);
+      assertNotNull(name);
+      assertEquals("display-name", name.getDisplayName());
+   }
+
+   @Test
+   public void testGetDisplayNames() {
+      List<DisplayName> list = constraint.getDisplayNames();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("display-name", list.get(0).getDisplayName());
+   }
+
+   @Test
+   public void testAddDisplayName() {
+      Locale loc = Locale.FRENCH;
+      String text = "Some display name";
+      DisplayName d = new DisplayNameImpl(loc, text);
+      constraint.addDisplayName(d);
+
+      List<DisplayName> list = constraint.getDisplayNames();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (DisplayName desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDisplayName());
+         } else {
+            assertEquals("display-name", desc.getDisplayName());
+         }
+      }
+   }
+
+   @Test
+   public void testGetPortletNames() {
+      List<String> list = constraint.getPortletNames();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+   }
+
+   @Test
+   public void testAddPortletName() {
+      String text = "SomeName";
+      constraint.addPortletName(text);;
+
+      List<String> list = constraint.getPortletNames();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertTrue(list.contains(text));
+      assertTrue(list.contains("portlet.name"));
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/UserAttribute168ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/UserAttribute168ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/UserAttribute168ImplTest.java
new file mode 100644
index 0000000..327f465
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/UserAttribute168ImplTest.java
@@ -0,0 +1,133 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl.jsr168;
+
+import static org.junit.Assert.*;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.UserAttribute;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.DescriptionImpl;
+import org.apache.pluto.container.om.portlet.impl.UserAttributeImpl;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class UserAttribute168ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet168Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+   private        List<UserAttribute> attrs;
+   private        UserAttribute ua;
+
+   /**
+    * @throws java.lang.Exception
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      
+      InputStream in = PortletApplicationDefinition168ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+   
+   @Before
+   public void setUpBefore() throws Exception {
+      attrs = new ArrayList<UserAttribute>();
+      for (UserAttribute ua : pad.getUserAttributes()) {
+         attrs.add(new UserAttributeImpl(ua));
+      }
+      assertEquals(1, attrs.size());
+      ua = attrs.get(0);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.UserAttributeImpl#getName()}.
+    */
+   @Test
+   public void testGetName() {
+      assertEquals("name", ua.getName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.UserAttributeImpl#getDescription(java.util.Locale)}.
+    */
+   @Test
+   public void testGetDescription() {
+      Locale loc = new Locale("DE");
+      Description desc = ua.getDescription(loc);
+      assertNotNull(desc);
+      assertEquals("description", desc.getDescription());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.UserAttributeImpl#getDescriptions()}.
+    */
+   @Test
+   public void testGetDescriptions() {
+      List<Description> list = ua.getDescriptions();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("description", list.get(0).getDescription());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.UserAttributeImpl#addDescription(org.apache.pluto.container.om.portlet.Description)}.
+    */
+   @Test
+   public void testAddDescription() {
+      Locale loc = Locale.FRENCH;
+      String text = "Some description";
+      Description d = new DescriptionImpl(loc, text);
+      ua.addDescription(d);
+
+      List<Description> list = ua.getDescriptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (Description desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDescription());
+         } else {
+            assertEquals("description", desc.getDescription());
+         }
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/UserDataConstraint168ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/UserDataConstraint168ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/UserDataConstraint168ImplTest.java
new file mode 100644
index 0000000..7ce4d56
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr168/UserDataConstraint168ImplTest.java
@@ -0,0 +1,105 @@
+package org.apache.pluto.container.om.portlet.impl.jsr168;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.InputStream;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.SecurityConstraint;
+import org.apache.pluto.container.om.portlet.UserDataConstraint;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.DescriptionImpl;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class UserDataConstraint168ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet168Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+   private        UserDataConstraint udc;
+
+   /**
+    * @throws java.lang.Exception
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      
+      InputStream in = PortletApplicationDefinition168ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+   
+   @Before
+   public void setUpBefore() throws Exception {
+      assertEquals(1, pad.getSecurityConstraints().size());
+      SecurityConstraint sc = pad.getSecurityConstraints().get(0);
+      assertNotNull(sc);
+      assertNotNull(sc.getUserDataConstraint());
+      udc = sc.getUserDataConstraint();
+   }
+
+   @Test
+   public void testGetTransportGuarantee() {
+      assertEquals("NONE", udc.getTransportGuarantee());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.UserDataConstraintImpl#getDescription(java.util.Locale)}.
+    */
+   @Test
+   public void testGetDescription() {
+      Locale loc = new Locale("DE");
+      Description desc = udc.getDescription(loc);
+      assertNotNull(desc);
+      assertEquals("description", desc.getDescription());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.UserDataConstraintImpl#getDescriptions()}.
+    */
+   @Test
+   public void testGetDescriptions() {
+      List<Description> list = udc.getDescriptions();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("description", list.get(0).getDescription());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.UserDataConstraintImpl#addDescription(org.apache.pluto.container.om.portlet.Description)}.
+    */
+   @Test
+   public void testAddDescription() {
+      Locale loc = Locale.FRENCH;
+      String text = "Some description";
+      Description d = new DescriptionImpl(loc, text);
+      udc.addDescription(d);
+
+      List<Description> list = udc.getDescriptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (Description desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDescription());
+         } else {
+            assertEquals("description", desc.getDescription());
+         }
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/CustomPortletMode286ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/CustomPortletMode286ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/CustomPortletMode286ImplTest.java
new file mode 100644
index 0000000..f0d228d
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/CustomPortletMode286ImplTest.java
@@ -0,0 +1,140 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl.jsr286;
+
+import static org.junit.Assert.*;
+
+import java.io.InputStream;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.CustomPortletMode;
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.CustomPortletModeImpl;
+import org.apache.pluto.container.om.portlet.impl.DescriptionImpl;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class CustomPortletMode286ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet286Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+
+   /**
+    * @throws java.lang.Exception
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      InputStream in = CustomPortletMode286ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.CustomPortletModeImpl#getPortletMode()}.
+    */
+   @Test
+   public void testGetPortletMode() {
+      CustomPortletMode cpm = pad.getCustomPortletMode("portlet-mode");
+      assertNotNull(cpm);
+      assertEquals(1, pad.getCustomPortletModes().size());
+      cpm = pad.getCustomPortletModes().get(0);
+      assertEquals("portlet-mode", cpm.getPortletMode());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.CustomPortletModeImpl#isPortalManaged()}.
+    */
+   @Test
+   public void testGetIsPortalManaged() {
+      CustomPortletMode cpm = pad.getCustomPortletMode("portlet-mode");
+      assertNotNull(cpm);
+      assertEquals(1, pad.getCustomPortletModes().size());
+      cpm = pad.getCustomPortletModes().get(0);
+      assertFalse(cpm.isPortalManaged());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.CustomPortletModeImpl#getDescription(java.util.Locale)}.
+    */
+   @Test
+   public void testGetDescription() {
+      assertEquals(1, pad.getCustomPortletModes().size());
+      CustomPortletMode cpm = pad.getCustomPortletModes().get(0);
+      Locale loc = new Locale("de");
+      Description d = cpm.getDescription(loc);
+      assertNotNull(d);
+      assertEquals("description", d.getDescription());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.CustomPortletModeImpl#getDescriptions()}.
+    */
+   @Test
+   public void testGetDescriptions() {
+      assertEquals(1, pad.getCustomPortletModes().size());
+      CustomPortletMode cpm = pad.getCustomPortletModes().get(0);
+      assertEquals("portlet-mode", cpm.getPortletMode());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.CustomPortletModeImpl#addDescription(org.apache.pluto.container.om.portlet.Description)}.
+    */
+   @Test
+   public void testAddDescription() {
+      assertEquals(1, pad.getCustomPortletModes().size());
+      CustomPortletMode cpm = 
+            new CustomPortletModeImpl(pad.getCustomPortletModes().get(0));
+      assertEquals(1, cpm.getDescriptions().size());
+      Locale loc = Locale.FRENCH;
+      String text = "Some description";
+      Description d = new DescriptionImpl(loc, text);
+      cpm.addDescription(d);
+      
+      List<Description> list = cpm.getDescriptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (Description desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDescription());
+         } else {
+            assertEquals("description", desc.getDescription());
+         }
+      }
+
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/CustomWindowState286ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/CustomWindowState286ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/CustomWindowState286ImplTest.java
new file mode 100644
index 0000000..4985240
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/CustomWindowState286ImplTest.java
@@ -0,0 +1,128 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl.jsr286;
+
+import static org.junit.Assert.*;
+
+import java.io.InputStream;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.CustomWindowState;
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.CustomWindowStateImpl;
+import org.apache.pluto.container.om.portlet.impl.DescriptionImpl;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class CustomWindowState286ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet286Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+
+   /**
+    * @throws java.lang.Exception
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      InputStream in = CustomWindowState286ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.CustomWindowStateImpl#getWindowState()}.
+    */
+   @Test
+   public void testGetWindowState() {
+      CustomWindowState cws = pad.getCustomWindowState("window-state");
+      assertNotNull(cws);
+      assertEquals(1, pad.getCustomWindowStates().size());
+      cws = pad.getCustomWindowStates().get(0);
+      assertEquals("window-state", cws.getWindowState());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.CustomWindowStateImpl#getDescription(java.util.Locale)}.
+    */
+   @Test
+   public void testGetDescription() {
+      assertEquals(1, pad.getCustomWindowStates().size());
+      CustomWindowState cws = pad.getCustomWindowStates().get(0);
+      Locale loc = new Locale("de");
+      Description d = cws.getDescription(loc);
+      assertNotNull(d);
+      assertEquals("description", d.getDescription());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.CustomWindowStateImpl#getDescriptions()}.
+    */
+   @Test
+   public void testGetDescriptions() {
+      assertEquals(1, pad.getCustomWindowStates().size());
+      CustomWindowState cws = pad.getCustomWindowStates().get(0);
+      assertEquals("window-state", cws.getWindowState());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.CustomWindowStateImpl#addDescription(org.apache.pluto.container.om.portlet.Description)}.
+    */
+   @Test
+   public void testAddDescription() {
+      assertEquals(1, pad.getCustomWindowStates().size());
+      CustomWindowState cws = 
+            new CustomWindowStateImpl(pad.getCustomWindowStates().get(0));
+      assertEquals(1, cws.getDescriptions().size());
+      Locale loc = Locale.FRENCH;
+      String text = "Some description";
+      Description d = new DescriptionImpl(loc, text);
+      cws.addDescription(d);
+      
+      List<Description> list = cws.getDescriptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (Description desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDescription());
+         } else {
+            assertEquals("description", desc.getDescription());
+         }
+      }
+
+   }
+
+}


[08/38] portals-pluto git commit: Replaced code that reads the deployment descriptor with an implementation that can be better extended to add v3.0 support. Added test cases. Uses jaxb binding classes that are generated at compile time.

Posted by ms...@apache.org.
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PortletAppType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PortletAppType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PortletAppType.java
deleted file mode 100644
index 1a662ef..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PortletAppType.java
+++ /dev/null
@@ -1,551 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-import javax.xml.XMLConstants;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import javax.xml.namespace.QName;
-
-import org.apache.pluto.container.om.portlet.ContainerRuntimeOption;
-import org.apache.pluto.container.om.portlet.CustomPortletMode;
-import org.apache.pluto.container.om.portlet.CustomWindowState;
-import org.apache.pluto.container.om.portlet.EventDefinition;
-import org.apache.pluto.container.om.portlet.Filter;
-import org.apache.pluto.container.om.portlet.FilterMapping;
-import org.apache.pluto.container.om.portlet.Listener;
-import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
-import org.apache.pluto.container.om.portlet.PortletDefinition;
-import org.apache.pluto.container.om.portlet.PublicRenderParameter;
-import org.apache.pluto.container.om.portlet.SecurityConstraint;
-import org.apache.pluto.container.om.portlet.UserAttribute;
-
-/**
- * <p>Java class for portlet-appType complex type. <p>The following schema fragment specifies the expected content
- * contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;portlet-appType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;portlet&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portletType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;custom-portlet-mode&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}custom-portlet-modeType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;custom-window-state&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}custom-window-stateType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;user-attribute&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}user-attributeType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;security-constraint&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}security-constraintType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;resource-bundle&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}resource-bundleType&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;filter&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}filterType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;filter-mapping&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}filter-mappingType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;default-namespace&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}anyURI&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;event-definition&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}event-definitionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;public-render-parameter&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}public-render-parameterType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;listener&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}listenerType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;container-runtime-option&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}container-runtime-optionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;version&quot; use=&quot;required&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlRootElement(name = "portlet-app")
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "portlet-appType", propOrder = { "portlet", "customPortletMode", "customWindowState", "userAttribute",
-                                                "securityConstraint", "resourceBundle", "filter", "filterMapping",
-                                                "defaultNamespace", "eventDefinition", "publicRenderParameter",
-                                                "listener", "containerRuntimeOption" })
-public class PortletAppType implements PortletApplicationDefinition
-{
-    @XmlElement(name = "portlet")
-    protected List<PortletType> portlet;
-    @XmlElement(name = "custom-portlet-mode")
-    protected List<CustomPortletModeType> customPortletMode;
-    @XmlElement(name = "custom-window-state")
-    protected List<CustomWindowStateType> customWindowState;
-    @XmlElement(name = "user-attribute")
-    protected List<UserAttributeType> userAttribute;
-    @XmlElement(name = "security-constraint")
-    protected List<SecurityConstraintType> securityConstraint;
-    @XmlElement(name = "resource-bundle")
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String resourceBundle;
-    @XmlElement(name = "filter")
-    protected List<FilterType> filter;
-    @XmlElement(name = "filter-mapping")
-    protected List<FilterMappingType> filterMapping;
-    @XmlElement(name = "default-namespace")
-    @XmlSchemaType(name = "anyURI")
-    protected String defaultNamespace;
-    @XmlElement(name = "event-definition")
-    protected List<EventDefinitionType> eventDefinition;
-    @XmlElement(name = "public-render-parameter")
-    protected List<PublicRenderParameterType> publicRenderParameter;
-    @XmlElement(name = "listener")
-    protected List<ListenerType> listener;
-    @XmlElement(name = "container-runtime-option")
-    protected List<ContainerRuntimeOptionType> containerRuntimeOption;
-    @XmlAttribute(required = true)
-    protected String version;
-    
-    @XmlTransient
-    protected String name;
-    @XmlTransient
-    protected String contextPath;
-    @XmlTransient
-    protected Map<Locale, String> localeEncodingMappings;
-    
-    public String getName()
-    {
-        return name;
-    }
-    
-    public void setName(String name)
-    {
-        this.name = name;
-    }
-    
-    public String getContextPath()
-    {
-        return contextPath;
-    }
-    
-    public void setContextPath(String contextPath)
-    {
-        this.contextPath = contextPath;
-    }
-    
-    public PortletDefinition getPortlet(String portletName)
-    {
-        for (PortletDefinition pd : getPortlets())
-        {
-            if (pd.getPortletName().equals(portletName))
-            {
-                return pd;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends PortletDefinition> getPortlets()
-    {
-        if (portlet == null)
-        {
-            portlet = new ArrayList<PortletType>();
-        }
-        return portlet;
-    }
-    
-    public PortletDefinition addPortlet(String portletName)
-    {
-        if (getPortlet(portletName) != null)
-        {
-            throw new IllegalArgumentException("Portlet with name: "+portletName+" already defined");
-        }
-        PortletType p = new PortletType();
-        p.setPortletName(portletName);
-        p.setApplication(this);
-        portlet.add(p);
-        return p;
-    }
-
-    public CustomPortletMode getCustomPortletMode(String name)
-    {
-        for (CustomPortletMode cpm : getCustomPortletModes())
-        {
-            if (cpm.getPortletMode().equalsIgnoreCase(name))
-            {
-                return cpm;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends CustomPortletMode> getCustomPortletModes()
-    {
-        if (customPortletMode == null)
-        {
-            customPortletMode = new ArrayList<CustomPortletModeType>();
-        }
-        return customPortletMode;
-    }
-    
-    public CustomPortletMode addCustomPortletMode(String name)
-    {
-        if (getCustomPortletMode(name) != null)
-        {
-            throw new IllegalArgumentException("Custom PortletMode with mode name: "+name+" already defined");
-        }
-        CustomPortletModeType cpm = new CustomPortletModeType();
-        cpm.setPortletMode(name);
-        customPortletMode.add(cpm);
-        return cpm;        
-    }
-    
-    public CustomWindowState getCustomWindowState(String name)
-    {
-        for (CustomWindowState cws : getCustomWindowStates())
-        {
-            if (cws.getWindowState().equalsIgnoreCase(name))
-            {
-                return cws;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends CustomWindowState> getCustomWindowStates()
-    {
-        if (customWindowState == null)
-        {
-            customWindowState = new ArrayList<CustomWindowStateType>();
-        }
-        return customWindowState;
-    }
-    
-    public CustomWindowState addCustomWindowState(String name)
-    {
-        if (getCustomWindowState(name) != null)
-        {
-            throw new IllegalArgumentException("Custom WindowState with state name: "+name+" already defined");
-        }
-        CustomWindowStateType cws = new CustomWindowStateType();
-        cws.setWindowState(name);
-        customWindowState.add(cws);
-        return cws;        
-    }
-    
-    public UserAttribute getUserAttribute(String name)
-    {
-        for (UserAttribute ua : getUserAttributes())
-        {
-            if (ua.getName().equals(name))
-            {
-                return ua;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends UserAttribute> getUserAttributes()
-    {
-        if (userAttribute == null)
-        {
-            userAttribute = new ArrayList<UserAttributeType>();
-        }
-        return userAttribute;
-    }
-    
-    public UserAttribute addUserAttribute(String name)
-    {
-        if (getUserAttribute(name) != null)
-        {
-            throw new IllegalArgumentException("User attribute with name: "+name+" already defined");
-        }
-        UserAttributeType ua = new UserAttributeType();
-        ua.setName(name);
-        userAttribute.add(ua);
-        return ua;        
-    }
-    
-    public List<? extends SecurityConstraint> getSecurityConstraints()
-    {
-        if (securityConstraint == null)
-        {
-            securityConstraint = new ArrayList<SecurityConstraintType>();
-        }
-        return securityConstraint;
-    }
-    
-    public SecurityConstraint addSecurityConstraint(String transportGuarantee)
-    {
-        SecurityConstraintType sc = new SecurityConstraintType();
-        ((UserDataConstraintType)sc.getUserDataConstraint()).setTransportGuarantee(transportGuarantee);
-        getSecurityConstraints();
-        securityConstraint.add(sc);
-        return sc;        
-    }
-    
-    public String getResourceBundle()
-    {
-        return resourceBundle;
-    }
-
-    public void setResourceBundle(String value)
-    {
-        resourceBundle = value;
-    }
-    
-    public Filter getFilter(String name)
-    {
-        for (Filter f : getFilters())
-        {
-            if (f.getFilterName().equals(name))
-            {
-                return f;
-            }
-        }
-        return null;
-    }
-
-    public List<? extends Filter> getFilters()
-    {
-        if (filter == null)
-        {
-            filter = new ArrayList<FilterType>();
-        }
-        return filter;
-    }
-    
-    public Filter addFilter(String name)
-    {
-        if (getFilter(name) != null)
-        {
-            throw new IllegalArgumentException("Filter with name: "+name+" already defined");
-        }
-        FilterType f = new FilterType();
-        f.setFilterName(name);
-        filter.add(f);
-        return f;        
-    }
-    
-    public FilterMapping getFilterMapping(String name)
-    {
-        for (FilterMapping f : getFilterMappings())
-        {
-            if (f.getFilterName().equals(name))
-            {
-                return f;
-            }
-        }
-        return null;
-    }
-
-    public List<? extends FilterMapping> getFilterMappings()
-    {
-        if (filterMapping == null)
-        {
-            filterMapping = new ArrayList<FilterMappingType>();
-        }
-        return filterMapping;
-    }
-    
-    public FilterMapping addFilterMapping(String name)
-    {
-        if (getFilterMapping(name) != null)
-        {
-            throw new IllegalArgumentException("Filtermapping for filter: "+name+" already defined");
-        }
-        FilterMappingType fm = new FilterMappingType();
-        fm.setFilterName(name);
-        filterMapping.add(fm);
-        return fm;        
-    }
-    
-    public String getDefaultNamespace()
-    {
-        return defaultNamespace != null ? defaultNamespace : XMLConstants.NULL_NS_URI;
-    }
-
-    public void setDefaultNamespace(String value)
-    {
-        defaultNamespace = value;
-    }
-
-    public List<? extends EventDefinition> getEventDefinitions()
-    {
-        if (eventDefinition == null)
-        {
-            eventDefinition = new ArrayList<EventDefinitionType>();
-        }
-        return eventDefinition;
-    }
-    
-    public EventDefinition addEventDefinition(String name)
-    {
-        // TODO: check duplicates (complication: set of qname and name)
-        EventDefinitionType ed = new EventDefinitionType();
-        ed.setName(name);
-        eventDefinition.add(ed);
-        return ed;        
-    }
-    
-    public EventDefinition addEventDefinition(QName qname)
-    {
-        // TODO: check duplicates (complication: set of qname and name)
-        EventDefinitionType ed = new EventDefinitionType();
-        ed.setQName(qname);
-        eventDefinition.add(ed);
-        return ed;        
-    }
-    
-    public PublicRenderParameter getPublicRenderParameter(String identifier)
-    {
-        for (PublicRenderParameter prp : getPublicRenderParameters())
-        {
-            if (prp.getIdentifier().equals(identifier))
-            {
-                return prp;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends PublicRenderParameter> getPublicRenderParameters()
-    {
-        if (publicRenderParameter == null)
-        {
-            publicRenderParameter = new ArrayList<PublicRenderParameterType>();
-        }
-        return publicRenderParameter;
-    }
-    
-    public PublicRenderParameter addPublicRenderParameter(String name, String identifier)
-    {
-        if (getPublicRenderParameter(identifier) != null)
-        {
-            throw new IllegalArgumentException("PublicRenderParameter with identifier: "+identifier+" already defined");
-        }
-        // TODO: check duplicates on name|qname?
-        PublicRenderParameterType p = new PublicRenderParameterType();
-        p.setName(name);
-        p.setIdentifier(identifier);
-        publicRenderParameter.add(p);
-        return p;        
-    }
-    
-    public PublicRenderParameter addPublicRenderParameter(QName qname, String identifier)
-    {
-        if (getPublicRenderParameter(identifier) != null)
-        {
-            throw new IllegalArgumentException("PublicRenderParameter with identifier: "+identifier+" already defined");
-        }
-        // TODO: check duplicates on name|qname?
-        PublicRenderParameterType p = new PublicRenderParameterType();
-        p.setQName(qname);
-        p.setIdentifier(identifier);
-        publicRenderParameter.add(p);
-        return p;        
-    }
-    
-    public List<? extends Listener> getListeners()
-    {
-        if (listener == null)
-        {
-            listener = new ArrayList<ListenerType>();
-        }
-        return listener;
-    }
-    
-    public Listener addListener(String listenerClass)
-    {
-        for (Listener l : getListeners())
-        {
-            if (l.getListenerClass().equals(listenerClass))
-            {
-                throw new IllegalArgumentException("Listener of class: "+listenerClass+" already defined");
-            }
-        }
-        ListenerType l = new ListenerType();
-        l.setListenerClass(listenerClass);
-        listener.add(l);
-        return l;        
-    }
-    
-    public ContainerRuntimeOption getContainerRuntimeOption(String name)
-    {
-        for (ContainerRuntimeOption cro : getContainerRuntimeOptions())
-        {
-            if (cro.getName().equals(name))
-            {
-                return cro;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends ContainerRuntimeOption> getContainerRuntimeOptions()
-    {
-        if (containerRuntimeOption == null)
-        {
-            containerRuntimeOption = new ArrayList<ContainerRuntimeOptionType>();
-        }
-        return containerRuntimeOption;
-    }
-    
-    public ContainerRuntimeOption addContainerRuntimeOption(String name)
-    {
-        if (getContainerRuntimeOption(name) != null)
-        {
-            throw new IllegalArgumentException("Container runtime option with name: "+name+" already defined");
-        }
-        ContainerRuntimeOptionType cro = new ContainerRuntimeOptionType();
-        cro.setName(name);
-        containerRuntimeOption.add(cro);
-        return cro;        
-    }
-    
-    public String getVersion()
-    {
-        return version;
-    }
-
-    public void setVersion(String value)
-    {
-        if (JSR_168_VERSION.equals(value) 
-            || JSR_286_VERSION.equals(value) 
-            || JSR_362_VERSION.equals(value))
-        {
-            version = value;
-        }
-        else
-        {
-            throw new IllegalArgumentException("Application descriptor version: "+value+" unsupported.");
-        }
-    }
-    
-    public Map<Locale, String> getLocaleEncodingMappings()
-    {
-        if (localeEncodingMappings == null)
-        {
-            localeEncodingMappings = new HashMap<Locale,String>();
-        }
-        return localeEncodingMappings;
-    }
-    
-    public void addLocaleEncodingMapping(Locale locale, String encoding)
-    {
-        getLocaleEncodingMappings().put(locale, encoding);
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PortletCollectionType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PortletCollectionType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PortletCollectionType.java
deleted file mode 100644
index db6ca0b..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PortletCollectionType.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-/**
- * 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 <p>Java class for portlet-collectionType complex type. <p>The
- * following schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;portlet-collectionType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;portlet-name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-nameType&quot; maxOccurs=&quot;unbounded&quot;/&gt;
- *       &lt;/sequence&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "portlet-collectionType", propOrder = { "portletName" })
-public class PortletCollectionType
-{
-    @XmlElement(name = "portlet-name", required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected List<String> portletName;
-
-    public List<String> getPortletNames()
-    {
-        if (portletName == null)
-        {
-            portletName = new ArrayList<String>();
-        }
-        return portletName;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PortletInfoType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PortletInfoType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PortletInfoType.java
deleted file mode 100644
index 16c33e5..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PortletInfoType.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.PortletInfo;
-
-/**
- * <p>Java class for portlet-infoType complex type. <p>The following schema fragment specifies the expected content
- * contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;portlet-infoType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;title&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}titleType&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;short-title&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}short-titleType&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;keywords&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}keywordsType&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "portlet-infoType", propOrder = { "title", "shortTitle", "keywords" })
-public class PortletInfoType implements PortletInfo
-{
-    @XmlElement (name = "title")
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String title;
-    @XmlElement(name = "short-title")
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String shortTitle;
-    @XmlElement(name = "keywords")
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String keywords;
-
-    public String getTitle()
-    {
-        return title;
-    }
-
-    public void setTitle(String value)
-    {
-        title = value;
-    }
-
-    public String getShortTitle()
-    {
-        return shortTitle;
-    }
-
-    public void setShortTitle(String value)
-    {
-        shortTitle = value;
-    }
-
-    public String getKeywords()
-    {
-        return keywords;
-    }
-
-    public void setKeywords(String value)
-    {
-        keywords = value;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PortletPreferencesType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PortletPreferencesType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PortletPreferencesType.java
deleted file mode 100644
index 9e4625e..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PortletPreferencesType.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-import org.apache.pluto.container.om.portlet.Preference;
-import org.apache.pluto.container.om.portlet.Preferences;
-
-/**
- * Portlet persistent preference store. Used in: portlet <p>Java class for portlet-preferencesType complex type. <p>The
- * following schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;portlet-preferencesType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;preference&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}preferenceType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;preferences-validator&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}preferences-validatorType&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "portlet-preferencesType", propOrder = { "preference", "preferencesValidator" })
-public class PortletPreferencesType implements Preferences
-{
-    @XmlElement(name = "preference")
-    protected List<PreferenceType> preference;
-    @XmlElement(name = "preferences-validator")
-    protected String preferencesValidator;
-
-    public Preference getPortletPreference(String name)
-    {
-        for (Preference p : getPortletPreferences())
-        {
-            if (p.getName().equals(name))
-            {
-                return p;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Preference> getPortletPreferences()
-    {
-        if (preference == null)
-        {
-            preference = new ArrayList<PreferenceType>();
-        }
-        return preference;
-    }
-    
-    public Preference addPreference(String name)
-    {
-        if (getPortletPreference(name) != null)
-        {
-            throw new IllegalArgumentException("Portlet preference with name: "+name+" already defined");
-        }
-        PreferenceType pref = new PreferenceType();
-        pref.setName(name);
-        preference.add(pref);
-        return pref;        
-    }
-    
-    public String getPreferencesValidator()
-    {
-        return preferencesValidator;
-    }
-
-    public void setPreferencesValidator(String value)
-    {
-        preferencesValidator = value;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PortletType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PortletType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PortletType.java
deleted file mode 100644
index 5989eea..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PortletType.java
+++ /dev/null
@@ -1,521 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.Unmarshaller;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import javax.xml.namespace.QName;
-
-import org.apache.pluto.container.om.portlet.ContainerRuntimeOption;
-import org.apache.pluto.container.om.portlet.Description;
-import org.apache.pluto.container.om.portlet.DisplayName;
-import org.apache.pluto.container.om.portlet.EventDefinitionReference;
-import org.apache.pluto.container.om.portlet.InitParam;
-import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
-import org.apache.pluto.container.om.portlet.PortletDefinition;
-import org.apache.pluto.container.om.portlet.PortletInfo;
-import org.apache.pluto.container.om.portlet.Preferences;
-import org.apache.pluto.container.om.portlet.SecurityRoleRef;
-import org.apache.pluto.container.om.portlet.Supports;
-
-/**
- * The portlet element contains the declarative data of a portlet. Used in: portlet-app <p>Java class for portletType
- * complex type. <p>The following schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;portletType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;portlet-name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-nameType&quot;/&gt;
- *         &lt;element name=&quot;display-name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}display-nameType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;portlet-class&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-classType&quot;/&gt;
- *         &lt;element name=&quot;init-param&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}init-paramType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;expiration-cache&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}expiration-cacheType&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;cache-scope&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}cache-scopeType&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;supports&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}supportsType&quot; maxOccurs=&quot;unbounded&quot;/&gt;
- *         &lt;element name=&quot;supported-locale&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}supported-localeType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;resource-bundle&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}resource-bundleType&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;portlet-info&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-infoType&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;portlet-preferences&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-preferencesType&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;security-role-ref&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}security-role-refType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;supported-processing-event&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}event-definition-referenceType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;supported-publishing-event&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}event-definition-referenceType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;supported-public-render-parameter&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;container-runtime-option&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}container-runtime-optionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "portletType", propOrder = { "description", "portletName", "displayName", "portletClass", "initParam",
-                                            "expirationCache", "cacheScope", "supports", "supportedLocale",
-                                            "resourceBundle", "portletInfo", "portletPreferences", "securityRoleRef",
-                                            "supportedProcessingEvent", "supportedPublishingEvent",
-                                            "supportedPublicRenderParameter", "containerRuntimeOption" })
-public class PortletType implements PortletDefinition
-{
-    @XmlElement(name = "description")
-    protected List<DescriptionType> description;
-    @XmlElement(name = "portlet-name", required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String portletName;
-    @XmlElement(name = "display-name")
-    protected List<DisplayNameType> displayName;
-    @XmlElement(name = "portlet-class", required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String portletClass;
-    @XmlElement(name = "init-param")
-    protected List<InitParamType> initParam;
-    @XmlElement(name = "expiration-cache")
-    protected Integer expirationCache;
-    @XmlElement(name = "cache-scope")
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String cacheScope;
-    @XmlElement(required = true)
-    protected List<SupportsType> supports;
-    @XmlElement(name = "supported-locale")
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected List<String> supportedLocale;
-    @XmlElement(name = "resource-bundle")
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String resourceBundle;
-    @XmlElement(name = "portlet-info")
-    protected PortletInfoType portletInfo;
-    @XmlElement(name = "portlet-preferences")
-    protected PortletPreferencesType portletPreferences;
-    @XmlElement(name = "security-role-ref")
-    protected List<SecurityRoleRefType> securityRoleRef;
-    @XmlElement(name = "supported-processing-event")
-    protected List<EventDefinitionReferenceType> supportedProcessingEvent;
-    @XmlElement(name = "supported-publishing-event")
-    protected List<EventDefinitionReferenceType> supportedPublishingEvent;
-    @XmlElement(name = "supported-public-render-parameter")
-    protected List<String> supportedPublicRenderParameter;
-    @XmlElement(name = "container-runtime-option")
-    protected List<ContainerRuntimeOptionType> containerRuntimeOption;
-    
-    @XmlTransient
-    private PortletApplicationDefinition application;
-    
-    public PortletType()
-    {
-    }
-    
-    public PortletApplicationDefinition getApplication()
-    {
-        return application;
-    }
-    
-    public void setApplication(PortletApplicationDefinition app)
-    {
-        this.application = app;
-    }
-
-    public Description getDescription(Locale locale)
-    {
-        for (Description d : getDescriptions())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Description> getDescriptions()
-    {
-        if (description == null)
-        {
-            description = new ArrayList<DescriptionType>();
-        }
-        return description;
-    }
-    
-    public Description addDescription(String lang)
-    {
-        DescriptionType d = new DescriptionType();
-        d.setLang(lang);
-        if (getDescription(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
-        }
-        getDescriptions();
-        description.add(d);
-        return d;
-    }
-
-    public DisplayName getDisplayName(Locale locale)
-    {
-        for (DisplayName d : getDisplayNames())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends DisplayName> getDisplayNames()
-    {
-        if (displayName == null)
-        {
-            displayName = new ArrayList<DisplayNameType>();
-        }
-        return displayName;
-    }
-    
-    public DisplayName addDisplayName(String lang)
-    {
-        DisplayNameType d = new DisplayNameType();
-        d.setLang(lang);
-        if (getDisplayName(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("DisplayName for language: "+d.getLocale()+" already defined");
-        }
-        getDisplayNames();
-        displayName.add(d);
-        return d;
-    }
-
-    public String getPortletName()
-    {
-        return portletName;
-    }
-
-    public void setPortletName(String value)
-    {
-        portletName = value;
-    }
-
-    public String getPortletClass()
-    {
-        return portletClass;
-    }
-
-    public void setPortletClass(String value)
-    {
-        portletClass = value;
-    }
-
-    public InitParam getInitParam(String name)
-    {
-        for (InitParam param : getInitParams())
-        {
-            if (param.getParamName().equals(name))
-            {
-                return param;
-            }
-        }
-        return null;
-    }
-
-    public List<? extends InitParam> getInitParams()
-    {
-        if (initParam == null)
-        {
-            initParam = new ArrayList<InitParamType>();
-        }
-        return initParam;
-    }
-    
-    public InitParam addInitParam(String paramName)
-    {
-        if (getInitParam(paramName) != null)
-        {
-            throw new IllegalArgumentException("Init parameter: "+paramName+" already defined");
-        }
-        InitParamType param = new InitParamType();
-        param.setParamName(paramName);
-        getInitParams();
-        initParam.add(param);
-        return param;
-    }
-    
-    public int getExpirationCache()
-    {
-        return expirationCache != null ? expirationCache.intValue() : 0;
-    }
-
-    public void setExpirationCache(int value)
-    {
-        expirationCache = new Integer(value);
-    }
-
-    /**
-     * 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 across users. The default value if not present is "private".
-     */
-    public String getCacheScope()
-    {
-        return cacheScope != null ? cacheScope : "private";
-    }
-
-    public void setCacheScope(String cacheScope)
-    {
-        this.cacheScope = cacheScope;
-    }
-
-    public Supports getSupports(String mimeType)
-    {
-        for (Supports s : getSupports())
-        {
-            if (s.getMimeType().equals(mimeType))
-            {
-                return s;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Supports> getSupports()
-    {
-        if (supports == null)
-        {
-            supports = new ArrayList<SupportsType>();
-        }
-        return supports;
-    }
-    
-    public Supports addSupports(String mimeType)
-    {
-        if (getSupports(mimeType) != null)
-        {
-            throw new IllegalArgumentException("Supports for mime type: "+mimeType+" already defined");
-        }
-        SupportsType s = new SupportsType();
-        s.setMimeType(mimeType);
-        supports.add(s);
-        return s;        
-    }
-    
-    public List<String> getSupportedLocales()
-    {
-        if (supportedLocale == null)
-        {
-            supportedLocale = new ArrayList<String>();
-        }
-        return supportedLocale;
-    }
-    
-    public void addSupportedLocale(String lang)
-    {
-        for (String l : getSupportedLocales())
-        {
-            if (l.equals(lang))
-            {
-                throw new IllegalArgumentException("Supported locale: "+lang+" already defined");
-            }
-        }
-        supportedLocale.add(lang);    
-    }
-
-    public String getResourceBundle()
-    {
-        return resourceBundle;
-    }
-
-    public void setResourceBundle(String value)
-    {
-        resourceBundle = value;
-    }
-
-    public PortletInfo getPortletInfo()
-    {
-        if (portletInfo == null)
-        {
-            portletInfo = new PortletInfoType();
-        }
-        return portletInfo;
-    }
-
-    public Preferences getPortletPreferences()
-    {
-        if (portletPreferences == null)
-        {
-            portletPreferences = new PortletPreferencesType();
-        }
-        return portletPreferences;
-    }
-    
-    public SecurityRoleRef getSecurityRoleRef(String roleName)
-    {
-        for (SecurityRoleRef ref : getSecurityRoleRefs())
-        {
-            if (ref.getRoleName().equals(roleName))
-            {
-                return ref;
-            }
-        }
-        return null;
-    }
-
-    public List<? extends SecurityRoleRef> getSecurityRoleRefs()
-    {
-        if (securityRoleRef == null)
-        {
-            securityRoleRef = new ArrayList<SecurityRoleRefType>();
-        }
-        return securityRoleRef;
-    }
-    
-    public SecurityRoleRef addSecurityRoleRef(String roleName)
-    {
-        if (getSecurityRoleRef(roleName) != null)
-        {
-            throw new IllegalArgumentException("Security role reference for role: "+roleName+" already defined");
-        }
-        SecurityRoleRefType srr = new SecurityRoleRefType();
-        srr.setRoleName(roleName);
-        securityRoleRef.add(srr);
-        return srr;        
-    }
-    
-    public List<? extends EventDefinitionReference> getSupportedProcessingEvents()
-    {
-        if (supportedProcessingEvent == null)
-        {
-            supportedProcessingEvent = new ArrayList<EventDefinitionReferenceType>();            
-        }
-        return supportedProcessingEvent;
-    }
-
-    public EventDefinitionReference addSupportedProcessingEvent(QName qname)
-    {
-        // TODO: check duplicates
-        getSupportedProcessingEvents();
-        EventDefinitionReferenceType edr = new EventDefinitionReferenceType();
-        edr.setQName(qname);
-        supportedProcessingEvent.add(edr);
-        return edr;
-    }
-    
-    public EventDefinitionReference addSupportedProcessingEvent(String name)
-    {
-        // TODO check duplicates
-        getSupportedProcessingEvents();
-        EventDefinitionReferenceType edr = new EventDefinitionReferenceType();
-        edr.setName(name);
-        supportedProcessingEvent.add(edr);
-        return edr;
-    }
-        
-    public List<? extends EventDefinitionReference> getSupportedPublishingEvents()
-    {
-        if (supportedPublishingEvent == null)
-        {
-            supportedPublishingEvent = new ArrayList<EventDefinitionReferenceType>();            
-        }
-        return supportedPublishingEvent;
-    }
-
-    public EventDefinitionReference addSupportedPublishingEvent(QName qname)
-    {
-        // TODO: check duplicates
-        getSupportedPublishingEvents();
-        EventDefinitionReferenceType edr = new EventDefinitionReferenceType();
-        edr.setQName(qname);
-        supportedPublishingEvent.add(edr);
-        return edr;
-    }
-    
-    public EventDefinitionReference addSupportedPublishingEvent(String name)
-    {
-        // TODO check duplicates
-        getSupportedPublishingEvents();
-        EventDefinitionReferenceType edr = new EventDefinitionReferenceType();
-        edr.setName(name);
-        supportedPublishingEvent.add(edr);
-        return edr;
-    }
-        
-    public List<String> getSupportedPublicRenderParameters()
-    {
-        if (supportedPublicRenderParameter == null)
-        {
-            supportedPublicRenderParameter = new ArrayList<String>();
-        }
-        return supportedPublicRenderParameter;
-    }
-    
-    public void addSupportedPublicRenderParameter(String identifier)
-    {
-        for (String ident : getSupportedPublicRenderParameters())
-        {
-            if (ident.equals(identifier))
-            {
-                throw new IllegalArgumentException("Support for public render parameter with identifier: "+identifier+" already defined");
-            }
-        }
-        supportedPublicRenderParameter.add(identifier);
-    }
-
-    public ContainerRuntimeOption getContainerRuntimeOption(String name)
-    {
-        for (ContainerRuntimeOption cro : getContainerRuntimeOptions())
-        {
-            if (cro.getName().equals(name))
-            {
-                return cro;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends ContainerRuntimeOption> getContainerRuntimeOptions()
-    {
-        if (containerRuntimeOption == null)
-        {
-            containerRuntimeOption = new ArrayList<ContainerRuntimeOptionType>();
-        }
-        return containerRuntimeOption;
-    }
-    
-    public ContainerRuntimeOption addContainerRuntimeOption(String name)
-    {
-        if (getContainerRuntimeOption(name) != null)
-        {
-            throw new IllegalArgumentException("Container runtime option with name: "+name+" already defined");
-        }
-        ContainerRuntimeOptionType cro = new ContainerRuntimeOptionType();
-        cro.setName(name);
-        containerRuntimeOption.add(cro);
-        return cro;        
-    }
-    
-    public void afterUnmarshal(Unmarshaller u, Object parent) {
-        application = (PortletApplicationDefinition)parent;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PreferenceType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PreferenceType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PreferenceType.java
deleted file mode 100644
index daa0b54..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PreferenceType.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.Preference;
-
-/**
- * Persistent preference values that may be used for customization and personalization by the portlet. Used in:
- * portlet-preferences <p>Java class for preferenceType complex type. <p>The following schema fragment specifies the
- * expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;preferenceType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}nameType&quot;/&gt;
- *         &lt;element name=&quot;value&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}valueType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;read-only&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}read-onlyType&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "preferenceType", propOrder = { "name", "value", "readOnly" })
-public class PreferenceType implements Preference
-{
-    @XmlElement(required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String name;
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected List<String> value;
-    @XmlElement(name = "read-only")
-    protected Boolean readOnly;
-
-    public String getName()
-    {
-        return name;
-    }
-
-    public void setName(String value)
-    {
-        name = value;
-    }
-
-    public List<String> getValues()
-    {
-        if (value == null)
-        {
-            value = new ArrayList<String>();
-        }
-        return value;
-    }
-    
-    public void addValue(String value)
-    {
-        getValues().add(value);
-    }
-
-    public boolean isReadOnly()
-    {
-        return readOnly != null ? readOnly.booleanValue() : false;
-    }
-
-    public void setReadOnly(boolean value)
-    {
-        readOnly = value ? Boolean.TRUE : Boolean.FALSE;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PublicRenderParameterType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PublicRenderParameterType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PublicRenderParameterType.java
deleted file mode 100644
index 21e42a7..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/PublicRenderParameterType.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import javax.xml.namespace.QName;
-
-import org.apache.pluto.container.om.portlet.Description;
-import org.apache.pluto.container.om.portlet.PublicRenderParameter;
-
-/**
- * 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 parameter in the portlet code. Used in:
- * portlet-app <p>Java class for public-render-parameterType complex type. <p>The following schema fragment specifies
- * the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;public-render-parameterType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;identifier&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot;/&gt;
- *         &lt;choice&gt;
- *           &lt;element name=&quot;qname&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}QName&quot;/&gt;
- *           &lt;element name=&quot;name&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}NCName&quot;/&gt;
- *         &lt;/choice&gt;
- *         &lt;element name=&quot;alias&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}QName&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "public-render-parameterType", propOrder = { "description", "identifier", "qname", "name", "alias" })
-public class PublicRenderParameterType implements PublicRenderParameter
-{
-    @XmlElement(name = "description")
-    protected List<DescriptionType> description;
-    @XmlElement(required = true)
-    protected String identifier;
-    protected QName qname;
-    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
-    @XmlSchemaType(name = "NCName")
-    protected String name;
-    protected List<QName> alias;
-
-    public Description getDescription(Locale locale)
-    {
-        for (Description d : getDescriptions())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Description> getDescriptions()
-    {
-        if (description == null)
-        {
-            description = new ArrayList<DescriptionType>();
-        }
-        return description;
-    }
-    
-    public Description addDescription(String lang)
-    {
-        DescriptionType d = new DescriptionType();
-        d.setLang(lang);
-        if (getDescription(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
-        }
-        getDescriptions();
-        description.add(d);
-        return d;
-    }
-
-    public String getIdentifier()
-    {
-        return identifier;
-    }
-
-    public void setIdentifier(String value)
-    {
-        identifier = value;
-    }
-
-    public QName getQName()
-    {
-        return qname;
-    }
-
-    public void setQName(QName value)
-    {
-        qname = value;
-        name = null;
-    }
-
-    public String getName()
-    {
-        return name;
-    }
-
-    public void setName(String value)
-    {
-        name = value;
-        qname = null;
-    }
-
-    public List<QName> getAliases()
-    {
-        if (alias == null)
-        {
-            alias = new ArrayList<QName>();
-        }
-        return alias;
-    }
-
-    public void addAlias(QName alias)
-    {
-        // TODO: check duplicates
-        getAliases().add(alias);
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/SecurityConstraintType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/SecurityConstraintType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/SecurityConstraintType.java
deleted file mode 100644
index c7377ba..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/SecurityConstraintType.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-import org.apache.pluto.container.om.portlet.DisplayName;
-import org.apache.pluto.container.om.portlet.SecurityConstraint;
-import org.apache.pluto.container.om.portlet.UserDataConstraint;
-
-/**
- * The security-constraintType is used to associate intended security constraints with one or more portlets. Used in:
- * portlet-app <p>Java class for security-constraintType complex type. <p>The following schema fragment specifies the
- * expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;security-constraintType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;display-name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}display-nameType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;portlet-collection&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-collectionType&quot;/&gt;
- *         &lt;element name=&quot;user-data-constraint&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}user-data-constraintType&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "security-constraintType", propOrder = { "displayName", "portletCollection", "userDataConstraint" })
-public class SecurityConstraintType implements SecurityConstraint
-{
-    @XmlElement(name = "display-name")
-    protected List<DisplayNameType> displayName;
-    @XmlElement(name = "portlet-collection", required = true)
-    protected PortletCollectionType portletCollection;
-    @XmlElement(name = "user-data-constraint", required = true)
-    protected UserDataConstraintType userDataConstraint;
-
-    public DisplayName getDisplayName(Locale locale)
-    {
-        for (DisplayName d : getDisplayNames())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends DisplayName> getDisplayNames()
-    {
-        if (displayName == null)
-        {
-            displayName = new ArrayList<DisplayNameType>();
-        }
-        return displayName;
-    }
-    
-    public DisplayName addDisplayName(String lang)
-    {
-        DisplayNameType d = new DisplayNameType();
-        d.setLang(lang);
-        if (getDisplayName(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("DisplayName for language: "+d.getLocale()+" already defined");
-        }
-        getDisplayNames();
-        displayName.add(d);
-        return d;
-    }
-
-    public List<String> getPortletNames()
-    {
-        if (portletCollection == null)
-        {
-            portletCollection = new PortletCollectionType();
-        }
-        return portletCollection.getPortletNames();
-    }
-    
-    public void addPortletName(String portletName)
-    {
-        for (String name : getPortletNames())
-        {
-            if (name.equals(portletName))
-            {
-                throw new IllegalArgumentException("Portlet name: "+name+" already defined");
-            }
-        }
-        portletCollection.getPortletNames().add(portletName);        
-    }
-
-    public UserDataConstraint getUserDataConstraint()
-    {
-        if (userDataConstraint == null)
-        {
-            userDataConstraint = new UserDataConstraintType();
-        }
-        return userDataConstraint;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/SecurityRoleRefType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/SecurityRoleRefType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/SecurityRoleRefType.java
deleted file mode 100644
index 0b1b693..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/SecurityRoleRefType.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.Description;
-import org.apache.pluto.container.om.portlet.SecurityRoleRef;
-
-/**
- * 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 <p>Java class for security-role-refType complex type. <p>The following schema fragment specifies the
- * expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;security-role-refType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;role-name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}role-nameType&quot;/&gt;
- *         &lt;element name=&quot;role-link&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}role-linkType&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
-*/
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "security-role-refType", propOrder = { "description", "roleName", "roleLink" })
-public class SecurityRoleRefType implements SecurityRoleRef
-{
-    @XmlElement(name = "description")
-    protected List<DescriptionType> description;
-    @XmlElement(name = "role-name", required = true)
-    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
-    protected String roleName;
-    @XmlElement(name = "role-link")
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String roleLink;
-
-    public Description getDescription(Locale locale)
-    {
-        for (Description d : getDescriptions())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Description> getDescriptions()
-    {
-        if (description == null)
-        {
-            description = new ArrayList<DescriptionType>();
-        }
-        return description;
-    }
-    
-    public Description addDescription(String lang)
-    {
-        DescriptionType d = new DescriptionType();
-        d.setLang(lang);
-        if (getDescription(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
-        }
-        getDescriptions();
-        description.add(d);
-        return d;
-    }
-
-    public String getRoleName()
-    {
-        return roleName;
-    }
-
-    public void setRoleName(String value)
-    {
-        roleName = value;
-    }
-
-    public String getRoleLink()
-    {
-        return roleLink;
-    }
-
-    public void setRoleLink(String value)
-    {
-        roleLink = value;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/SupportsType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/SupportsType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/SupportsType.java
deleted file mode 100644
index 2771dd5..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/SupportsType.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.Supports;
-
-/**
- * Supports indicates the portlet modes a portlet supports for a specific content type. All portlets must support the
- * view mode. Used in: portlet <p>Java class for supportsType complex type. <p>The following schema fragment specifies
- * the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;supportsType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;mime-type&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}mime-typeType&quot;/&gt;
- *         &lt;element name=&quot;portlet-mode&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-modeType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;window-state&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}window-stateType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "supportsType", propOrder = { "mimeType", "portletMode", "windowState" })
-public class SupportsType implements Supports
-{
-    @XmlElement(name = "mime-type", required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String mimeType;
-    @XmlElement(name = "portlet-mode")
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected List<String> portletMode;
-    @XmlElement(name = "window-state")
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected List<String> windowState;
-
-    public String getMimeType()
-    {
-        return mimeType;
-    }
-
-    public void setMimeType(String value)
-    {
-        mimeType = value;
-    }
-
-    public List<String> getPortletModes()
-    {
-        if (portletMode == null)
-        {
-            portletMode = new ArrayList<String>();
-        }
-        return portletMode;
-    }
-    
-    public void addPortletMode(String name)
-    {
-        for (String mode : getPortletModes())
-        {
-            if (mode.equals(name))
-            {
-                throw new IllegalArgumentException("Portlet mode: "+name+" already defined");
-            }
-        }
-        portletMode.add(name);
-    }
-
-    public List<String> getWindowStates()
-    {
-        if (windowState == null)
-        {
-            windowState = new ArrayList<String>();
-        }
-        return windowState;
-    }
-
-    public void addWindowState(String name)
-    {
-        for (String state : getWindowStates())
-        {
-            if (state.equals(name))
-            {
-                throw new IllegalArgumentException("Window state: "+name+" already defined");
-            }
-        }
-        windowState.add(name);
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/UserAttributeType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/UserAttributeType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/UserAttributeType.java
deleted file mode 100644
index 27fd61f..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/UserAttributeType.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.Description;
-import org.apache.pluto.container.om.portlet.UserAttribute;
-
-/**
- * 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 <p>Java class
- * for user-attributeType complex type. <p>The following schema fragment specifies the expected content contained
- * within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;user-attributeType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}nameType&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "user-attributeType", propOrder = { "description", "name" })
-public class UserAttributeType implements UserAttribute
-{
-    @XmlElement(name = "description")
-    protected List<DescriptionType> description;
-    @XmlElement(required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String name;
-
-    public Description getDescription(Locale locale)
-    {
-        for (Description d : getDescriptions())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Description> getDescriptions()
-    {
-        if (description == null)
-        {
-            description = new ArrayList<DescriptionType>();
-        }
-        return description;
-    }
-    
-    public Description addDescription(String lang)
-    {
-        DescriptionType d = new DescriptionType();
-        d.setLang(lang);
-        if (getDescription(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
-        }
-        getDescriptions();
-        description.add(d);
-        return d;
-    }
-
-    public String getName()
-    {
-        return name;
-    }
-
-    public void setName(String value)
-    {
-        name = value;
-    }
-}


[36/38] portals-pluto git commit: Completed implementation of header phase demo portlet. Fixed some bugs in the pluto header phase implementation.

Posted by ms...@apache.org.
Completed implementation of header phase demo portlet. Fixed some bugs in
the pluto header phase implementation.


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/6dd6b872
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/6dd6b872
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/6dd6b872

Branch: refs/heads/V3Prototype
Commit: 6dd6b87226de02f4a4f06e877ad9249bb07e5a34
Parents: d11dcc5
Author: Scott Nicklous <ms...@apache.org>
Authored: Thu Nov 26 17:50:53 2015 +0100
Committer: Scott Nicklous <ms...@apache.org>
Committed: Thu Nov 26 17:50:53 2015 +0100

----------------------------------------------------------------------
 PortletHubDemo/pom.xml                          |  26 +-
 PortletHubDemo/src/main/webapp/WEB-INF/web.xml  |   2 +-
 PortletV3Demo/pom.xml                           |  22 -
 .../main/java/basic/portlet/HeaderPortlet.java  |  14 +-
 .../webapp/WEB-INF/jsp/headSectionMarkup.jsp    |  57 ++
 .../src/main/webapp/WEB-INF/jsp/view-hdp.jsp    |   5 +
 .../org/apache/pluto/container/HeaderData.java  |  40 +-
 .../impl/HttpServletPortletResponseWrapper.java |   8 +-
 .../impl/PortletRequestDispatcherImpl.java      | 550 ++++++++++---------
 .../PortletMimeResponseContextImpl.java         |  16 +-
 .../container/PortletResponseContextImpl.java   |  12 +
 11 files changed, 415 insertions(+), 337 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6dd6b872/PortletHubDemo/pom.xml
----------------------------------------------------------------------
diff --git a/PortletHubDemo/pom.xml b/PortletHubDemo/pom.xml
index 60b0379..b64acf1 100644
--- a/PortletHubDemo/pom.xml
+++ b/PortletHubDemo/pom.xml
@@ -60,8 +60,8 @@
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-compiler-plugin</artifactId>
             <configuration>
-               <source>1.6</source>
-               <target>1.6</target>
+               <source>1.7</source>
+               <target>1.7</target>
             </configuration>
          </plugin>
          <plugin>
@@ -106,30 +106,8 @@
                  <artifactId>maven-war-plugin</artifactId>
                  <configuration>
                    <archiveClasses>false</archiveClasses>
-                   <webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
                  </configuration>
                </plugin>
-               <!-- bind 'pluto:assemble' goal to 'generate-resources' lifecycle -->
-               <plugin>
-                  <groupId>org.apache.portals.pluto</groupId>
-                  <artifactId>maven-pluto-plugin</artifactId>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.portals.pluto</groupId>
-                        <artifactId>pluto-util</artifactId>
-                        <version>${project.version}</version>
-                        <scope>runtime</scope>
-                     </dependency>
-                  </dependencies>
-                  <executions>
-                     <execution>
-                        <phase>generate-resources</phase>
-                        <goals>
-                           <goal>assemble</goal>
-                        </goals>
-                     </execution>
-                  </executions>
-               </plugin>
                <!-- workaround for war processing of m-r-r-plugin causing the generated NOTICE and LICENSE file to be put under WEB-INF/classes/META-INF -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6dd6b872/PortletHubDemo/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/PortletHubDemo/src/main/webapp/WEB-INF/web.xml b/PortletHubDemo/src/main/webapp/WEB-INF/web.xml
index 5cf9329..ae832b5 100644
--- a/PortletHubDemo/src/main/webapp/WEB-INF/web.xml
+++ b/PortletHubDemo/src/main/webapp/WEB-INF/web.xml
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-	<display-name>PRP Resource Portlet</display-name>
+	<display-name>V3 Portlet Hub Demo Portlet</display-name>
 </web-app>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6dd6b872/PortletV3Demo/pom.xml
----------------------------------------------------------------------
diff --git a/PortletV3Demo/pom.xml b/PortletV3Demo/pom.xml
index a957244..3c23fdc 100644
--- a/PortletV3Demo/pom.xml
+++ b/PortletV3Demo/pom.xml
@@ -106,30 +106,8 @@
                  <artifactId>maven-war-plugin</artifactId>
                  <configuration>
                    <archiveClasses>false</archiveClasses>
-                   <webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
                  </configuration>
                </plugin>
-               <!-- bind 'pluto:assemble' goal to 'generate-resources' lifecycle -->
-               <plugin>
-                  <groupId>org.apache.portals.pluto</groupId>
-                  <artifactId>maven-pluto-plugin</artifactId>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.portals.pluto</groupId>
-                        <artifactId>pluto-util</artifactId>
-                        <version>${project.version}</version>
-                        <scope>runtime</scope>
-                     </dependency>
-                  </dependencies>
-                  <executions>
-                     <execution>
-                        <phase>generate-resources</phase>
-                        <goals>
-                           <goal>assemble</goal>
-                        </goals>
-                     </execution>
-                  </executions>
-               </plugin>
                <!-- workaround for war processing of m-r-r-plugin causing the generated NOTICE and LICENSE file to be put under WEB-INF/classes/META-INF -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6dd6b872/PortletV3Demo/src/main/java/basic/portlet/HeaderPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/HeaderPortlet.java b/PortletV3Demo/src/main/java/basic/portlet/HeaderPortlet.java
index 03cb0bc..95df1af 100644
--- a/PortletV3Demo/src/main/java/basic/portlet/HeaderPortlet.java
+++ b/PortletV3Demo/src/main/java/basic/portlet/HeaderPortlet.java
@@ -19,14 +19,13 @@
 package basic.portlet;
 
 import java.io.IOException;
+import java.io.PrintWriter;
 import java.util.Collections;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import javax.portlet.ActionParameters;
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
-import javax.portlet.ActionURL;
 import javax.portlet.GenericPortlet;
 import javax.portlet.HeaderRequest;
 import javax.portlet.HeaderResponse;
@@ -35,19 +34,14 @@ import javax.portlet.PortalContext;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequest;
 import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.RenderParameters;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
-import javax.portlet.RenderURL;
 import javax.portlet.ResourceRequest;
 import javax.portlet.ResourceResponse;
 import javax.servlet.http.Cookie;
 
 import org.w3c.dom.Element;
 
-import static javax.portlet.MimeResponse.Copy.*;
-import static basic.portlet.Constants.*;
-
 /**
  * Portlet for testing the redirect funtionality, including the new getRedirectURL API.
  */
@@ -91,6 +85,12 @@ public class HeaderPortlet extends GenericPortlet {
       resp.setProperty("Portlet", this.getPortletName());
       resp.setProperty("Portal", "Pluto");
 
+      PrintWriter writer = resp.getWriter();
+      writer.println("<!-- before JSP include -->");
+      PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/headSectionMarkup.jsp");
+      rd.include(req, resp);
+      writer.println("<!-- after JSP include -->");
+
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6dd6b872/PortletV3Demo/src/main/webapp/WEB-INF/jsp/headSectionMarkup.jsp
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/headSectionMarkup.jsp b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/headSectionMarkup.jsp
new file mode 100644
index 0000000..d15ad53
--- /dev/null
+++ b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/headSectionMarkup.jsp
@@ -0,0 +1,57 @@
+<%--
+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.
+--%>
+<%@ page session="false" %>
+<%@ taglib uri="http://xmlns.jcp.org/portlet_3_0"  prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+<portlet:defineObjects />
+
+<!-- This jsp generates markup for the document head section -->
+   
+<meta name="description" content="Portlet Hub Demo Portlet">
+<style>
+<!--
+.markupSection {
+   padding: 5px;
+   background-color: #DDFFDD;
+   border: thin solid #22EE88;
+}
+-->
+</style>
+   
+<script type="text/javascript">
+(function () {
+   'use strict';
+   var cdiv = '<portlet:namespace/>cookieDiv',
+
+bootstrap = function () {
+   var cookies = document.cookie.split(';'), ii, markup;
+   markup = '<p>Current Cookies:</p>';
+   for (ii = 0; ii < cookies.length; ii++) {
+      markup += cookies[ii] + '<br/>';
+   }
+   document.getElementById(cdiv).innerHTML=markup;
+};
+   
+// execute when document has been loaded 
+window.addEventListener('load', bootstrap, false);
+}());
+</script>
+
+<p>Hi</p>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6dd6b872/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-hdp.jsp
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-hdp.jsp b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-hdp.jsp
index 71deb87..d78f9b4 100644
--- a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-hdp.jsp
+++ b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-hdp.jsp
@@ -34,4 +34,9 @@ method.
 Character encoding: <%=renderResponse.getCharacterEncoding() %>, 
 Content type: <%=renderResponse.getContentType() %>
 </p>
+<p>
+The following section shows cookie information inserted by JavaScript code that was added to the 
+output stream during the header phase processing.
+</p>
+<div  class='markupSection' id='<portlet:namespace/>cookieDiv'></div>
 </div>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6dd6b872/pluto-container-api/src/main/java/org/apache/pluto/container/HeaderData.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/HeaderData.java b/pluto-container-api/src/main/java/org/apache/pluto/container/HeaderData.java
index b7a7756..6209f5d 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/HeaderData.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/HeaderData.java
@@ -29,6 +29,8 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import javax.servlet.http.Cookie;
 import javax.xml.parsers.DocumentBuilder;
@@ -72,8 +74,8 @@ public class HeaderData {
    private static final String       ROOT_ELEMENT_END   = "</rootElement>";
    private static final String       ROOT_ELEMENT_REGEX = "(?:\\s*)</{0,1}" + ROOT_ELEMENT + ">(?:\\s*)";
 
-   private static final Set<String>  allowedTags        = new HashSet<String>(Arrays.asList(new String[] { "META",
-         "LINK", "STYLE", "SCRIPT", "NOSCRIPT"         }));
+   private static final Set<String>  allowedTags        = new HashSet<String>(Arrays.asList(new String[] { 
+         "META", "LINK", "STYLE", "SCRIPT", "NOSCRIPT"         }));
 
    private List<Cookie>              cookies            = new ArrayList<Cookie>();
    private Map<String, List<String>> httpHeaders        = new HashMap<String, List<String>>();
@@ -83,6 +85,9 @@ public class HeaderData {
    private PrintWriter               pWriter            = null;
 
    public void resetBuffer() {
+      if (isDebug) {
+         LOG.debug("Resetting buffer.");
+      }
       if (baoStream != null) {
          baoStream.reset();
       }
@@ -106,6 +111,9 @@ public class HeaderData {
          sWriter = new StringWriter(bufferSize);
          pWriter = new PrintWriter(sWriter);
       }
+      if (isDebug) {
+         LOG.debug("returning writer.");
+      }
       return pWriter;
    }
 
@@ -116,6 +124,9 @@ public class HeaderData {
       if (baoStream == null) {
          baoStream = new ByteArrayOutputStream(bufferSize);
       }
+      if (isDebug) {
+         LOG.debug("returning output stream.");
+      }
       return baoStream;
    }
 
@@ -143,10 +154,31 @@ public class HeaderData {
       }
 
       if (src != null) {
-         StringBuilder sb = new StringBuilder(128);
+         StringBuffer sb = new StringBuffer(128);
          sb.append(ROOT_ELEMENT_START);
-         sb.append(src);
+         
+         // need to do some preprocessing on the input text to avoid placing a burden on the 
+         // portlet developer. Goals:
+         //    * allow meta and link tags with or without a closing slash
+         //    * allow use of unescaped angle brackets within script tag
+
+         // make the parser eat link & meta tags with or without closing slash.
+         src = src.replaceAll("(<(?:meta|link).*?[^/])>", "$1/>");
+         
+         // convert < brackets within script tags to corresponding entities
+         
+         Pattern pat = Pattern.compile("(?s)" +             // multiline mode 
+                                       "(?<=<script)" +     // 0-width lookbehind; script start tag
+                                       "(.*?)" +            // non-greedy content of tag
+                                       "(?=</script)");     // 0-width lookahead: script end tag
+         Matcher mat = pat.matcher(src);
+         while (mat.find()) {
+            mat.appendReplacement(sb, mat.group().replaceAll("<", "&lt;"));
+         }
+         mat.appendTail(sb);
+
          sb.append(ROOT_ELEMENT_END);
+         LOG.debug(sb.toString());
 
          StringReader sr = new StringReader(sb.toString());
          InputSource is = new InputSource(sr);

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6dd6b872/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletResponseWrapper.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletResponseWrapper.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletResponseWrapper.java
index 6b93fda..c5a269e 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletResponseWrapper.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletResponseWrapper.java
@@ -54,7 +54,13 @@ public class HttpServletPortletResponseWrapper extends HttpServletResponseWrappe
         super(response);
         this.portletResponse = portletResponse;
         this.lifecyclePhase = (String)portletRequest.getAttribute(PortletRequest.LIFECYCLE_PHASE);
-        this.mimeResponse = PortletRequest.RENDER_PHASE.equals(lifecyclePhase) || PortletRequest.RESOURCE_PHASE.equals(lifecyclePhase) ? (MimeResponse)portletResponse : null;
+        MimeResponse mr = null;
+        if (PortletRequest.RENDER_PHASE.equals(lifecyclePhase) || 
+            PortletRequest.RESOURCE_PHASE.equals(lifecyclePhase) ||
+            PortletRequest.HEADER_PHASE.equals(lifecyclePhase)) {
+           mr = (MimeResponse)portletResponse;
+        }
+        this.mimeResponse = mr;
         this.forwarded = !included;
         this.included = included;
     }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6dd6b872/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestDispatcherImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestDispatcherImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestDispatcherImpl.java
index 7261e70..2ef980c 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestDispatcherImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestDispatcherImpl.java
@@ -1,270 +1,280 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.impl;
-
-import java.io.IOException;
-import java.util.Map;
-
-import javax.portlet.MimeResponse;
-import javax.portlet.PortletConfig;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.PortletResponse;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequestWrapper;
-import javax.servlet.http.HttpServletResponseWrapper;
-import javax.servlet.http.HttpSession;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.pluto.container.PortletInvokerService;
-import org.apache.pluto.container.PortletRequestContext;
-
-/**
- * Implementation of the <code>PortletRequestDispatcher</code> interface.
- * The portlet request dispatcher is used to dispatch <b>PortletRequest</b> and
- * <b>PortletResponse</b> to a URI.
- * 
- */
-public class PortletRequestDispatcherImpl implements PortletRequestDispatcher, RequestDispatcher
-{	
-    /** Logger. */
-    private static final Logger LOG = LoggerFactory.getLogger(PortletRequestDispatcherImpl.class);
-    
-    // Private Member Variables ------------------------------------------------
-    
-    /** The nested servlet request dispatcher instance. */
-    private RequestDispatcher requestDispatcher;
-    private boolean namedDispatch;
-    
-    
-    // Constructors ------------------------------------------------------------
-    
-    /**
-     * Creates an instance. This constructor should be called to construct a
-     * portlet request dispatcher.
-     * @param requestDispatcher  the servlet request dispatcher.
-     * @param namedDispatch true if requestDispatcher is a named dispatcher 
-     * @see javax.portlet.PortletContext#getNamedDispatcher(String)
-     * @see javax.portlet.PortletContext#getRequestDispatcher(String)
-     */
-    public PortletRequestDispatcherImpl(RequestDispatcher requestDispatcher, boolean namedDispatch)
-    {
-        this.requestDispatcher = requestDispatcher;
-        this.namedDispatch = namedDispatch;
-    	
-        if (LOG.isDebugEnabled())
-        {
-        	LOG.debug("Request dispatcher created.");
-        }
-    }
-    
-    private static HttpServletPortletRequestWrapper getWrappedRequest(ServletRequest request)
-    {
-        HttpServletPortletRequestWrapper req = null;
-        
-        do
-        {
-            if (request instanceof HttpServletPortletRequestWrapper)
-            {
-                req = (HttpServletPortletRequestWrapper)request;
-            }
-            else if (request instanceof HttpServletRequestWrapper)
-            {
-                request = ((HttpServletRequestWrapper)request).getRequest();
-            }
-            else
-            {
-                request = null;
-            }                
-        }
-        while (request != null && req == null);
-        return req;
-    }
-
-    private static HttpServletPortletResponseWrapper getWrappedResponse(ServletResponse response)
-    {
-        HttpServletPortletResponseWrapper res = null;
-        
-        do
-        {
-            if (response instanceof HttpServletPortletResponseWrapper)
-            {
-                res = (HttpServletPortletResponseWrapper)response;
-            }
-            else if (response instanceof HttpServletResponseWrapper)
-            {
-                response = ((HttpServletResponseWrapper)response).getResponse();
-            }
-            else
-            {
-                response = null;
-            }                
-        }
-        while (response != null && res == null);
-        return res;
-    }
-    
-    private void doDispatch(PortletRequest request, PortletResponse response, boolean included) throws PortletException, IOException
-    {
-        boolean needsFlushAfterForward = false;
-        if (!included)
-        {
-            String lifecyclePhase = (String)request.getAttribute(PortletRequest.LIFECYCLE_PHASE);
-            if (PortletRequest.RENDER_PHASE.equals(lifecyclePhase) || PortletRequest.RESOURCE_PHASE.equals(lifecyclePhase))
-            {
-                needsFlushAfterForward = true;
-                ((MimeResponse)response).resetBuffer();
-            }
-        }
-        
-        PortletRequestContext requestContext = (PortletRequestContext)request.getAttribute(PortletInvokerService.REQUEST_CONTEXT);
-        HttpSession session = null;
-        
-        // PLT.10.4.3. Proxied session is created and passed if javax.portlet.servletDefaultSessionScope == PORTLET_SCOPE
-        if (isPortletScopeSessionConfigured(requestContext))
-        {
-            String portletWindowId = requestContext.getPortletWindow().getId().getStringId();
-            session = ServletPortletSessionProxy.createProxy(requestContext.getServletRequest(), portletWindowId);
-        }
-        
-        HttpServletPortletRequestWrapper req = new HttpServletPortletRequestWrapper(requestContext.getServletRequest(), 
-                                                                                    requestContext.getServletContext(),
-                                                                                    session,
-                                                                                    request,
-                                                                                    included,
-                                                                                    namedDispatch);
-        HttpServletPortletResponseWrapper res = new HttpServletPortletResponseWrapper(requestContext.getServletResponse(),
-                                                                                      request,
-                                                                                      response,
-                                                                                      included);
-        try
-        {
-            request.setAttribute(PortletInvokerService.PORTLET_CONFIG, requestContext.getPortletConfig());
-            request.setAttribute(PortletInvokerService.PORTLET_REQUEST, request);
-            request.setAttribute(PortletInvokerService.PORTLET_RESPONSE, response);
-            
-            if (!included && req.isForwardingPossible())
-            {
-                requestDispatcher.forward(req, res);
-            }
-            else
-            {
-                // need to "fake" the forward using an include
-                requestDispatcher.include(req, res);
-            }
-            if (needsFlushAfterForward)
-            {
-                ((MimeResponse)response).flushBuffer();
-            }
-        }
-        catch (ServletException sex)
-        {
-            if (sex.getRootCause() != null)
-            {
-                throw new PortletException(sex.getRootCause());
-            } 
-            throw new PortletException(sex);
-        }
-        finally
-        {
-            request.removeAttribute(PortletInvokerService.PORTLET_CONFIG);
-            request.removeAttribute(PortletInvokerService.PORTLET_REQUEST);
-            request.removeAttribute(PortletInvokerService.PORTLET_RESPONSE);
-        }
-    }
-    
-    private boolean isPortletScopeSessionConfigured(PortletRequestContext requestContext)
-    {
-        boolean portletScopeSessionConfigured = false;
-        
-        PortletConfig portletConfig = requestContext.getPortletConfig();
-        Map<String, String []> containerRuntimeOptions = portletConfig.getContainerRuntimeOptions();
-        String [] values = containerRuntimeOptions.get("javax.portlet.servletDefaultSessionScope");
-        
-        if (values != null && values.length > 0)
-        {
-            portletScopeSessionConfigured = "PORTLET_SCOPE".equals(values[0]);
-        }
-        
-        return portletScopeSessionConfigured;
-    }
-
-    // PortletRequestDispatcher Impl -------------------------------------------
-   
-    public void forward(PortletRequest request, PortletResponse response) throws PortletException, IOException
-    {
-        doDispatch(request, response, false);
-    }
-    
-	public void include(PortletRequest request, PortletResponse response) throws PortletException, IOException
-	{
-	    doDispatch(request, response, true);
-	}
-	
-	public void include(RenderRequest request, RenderResponse response) throws PortletException, IOException
-	{
-	    doDispatch(request, response, true);
-    }
-	
-    // Nested RequestDispatcher Impl -------------------------------------------
-	
-    public void forward(ServletRequest request, ServletResponse response) throws ServletException, IOException
-    {
-        HttpServletPortletRequestWrapper req = getWrappedRequest(request);
-        HttpServletPortletResponseWrapper res = getWrappedResponse(response);
-        res.resetBuffer();
-        
-        // cache the current dispatch state
-        boolean forwarded = req.isForwarded();
-        boolean namedDispatch = req.isNamedDispatch();
-        Map<String,Object> pathAttributeValues = req.getPathAttributeValues();
-        HttpServletPortletRequestWrapper.PathMethodValues pathMethodValues = req.getInitPathMethodValues();
-        
-        // (re)initialize the request wrapper to a nested forward
-        req.setNestedForward();
-        try
-        {
-            if (req.isForwardingPossible())
-            {
-                requestDispatcher.forward(request, response);
-            }
-            else
-            {
-                // need to "fake" the forward using an include
-                requestDispatcher.include(request, response);
-            }
-        }
-        finally
-        {
-            // restore the previously cached dispatch state
-            req.restoreFromNestedForward(forwarded, namedDispatch, pathMethodValues, pathAttributeValues);
-        }
-    }
-
-    public void include(ServletRequest request, ServletResponse response) throws ServletException, IOException
-    {
-        // no need for special handling on a nested dispatcher include: just calling the wrapped servlet dispatcher
-        requestDispatcher.include(request, response);
-    }
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.container.impl;
+
+import java.io.IOException;
+import java.util.Map;
+
+import javax.portlet.MimeResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.PortletResponse;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpServletResponseWrapper;
+import javax.servlet.http.HttpSession;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.pluto.container.PortletInvokerService;
+import org.apache.pluto.container.PortletRequestContext;
+
+/**
+ * Implementation of the <code>PortletRequestDispatcher</code> interface.
+ * The portlet request dispatcher is used to dispatch <b>PortletRequest</b> and
+ * <b>PortletResponse</b> to a URI.
+ * 
+ */
+public class PortletRequestDispatcherImpl implements PortletRequestDispatcher, RequestDispatcher
+{	
+    /** Logger. */
+    private static final Logger LOG = LoggerFactory.getLogger(PortletRequestDispatcherImpl.class);
+    private final static boolean isDebug = LOG.isDebugEnabled();
+    
+    // Private Member Variables ------------------------------------------------
+    
+    /** The nested servlet request dispatcher instance. */
+    private RequestDispatcher requestDispatcher;
+    private boolean namedDispatch;
+    
+    
+    // Constructors ------------------------------------------------------------
+    
+    /**
+     * Creates an instance. This constructor should be called to construct a
+     * portlet request dispatcher.
+     * @param requestDispatcher  the servlet request dispatcher.
+     * @param namedDispatch true if requestDispatcher is a named dispatcher 
+     * @see javax.portlet.PortletContext#getNamedDispatcher(String)
+     * @see javax.portlet.PortletContext#getRequestDispatcher(String)
+     */
+    public PortletRequestDispatcherImpl(RequestDispatcher requestDispatcher, boolean namedDispatch)
+    {
+        this.requestDispatcher = requestDispatcher;
+        this.namedDispatch = namedDispatch;
+    	
+        if (LOG.isDebugEnabled())
+        {
+        	LOG.debug("Request dispatcher created.");
+        }
+    }
+    
+    private static HttpServletPortletRequestWrapper getWrappedRequest(ServletRequest request)
+    {
+        HttpServletPortletRequestWrapper req = null;
+        
+        do
+        {
+            if (request instanceof HttpServletPortletRequestWrapper)
+            {
+                req = (HttpServletPortletRequestWrapper)request;
+            }
+            else if (request instanceof HttpServletRequestWrapper)
+            {
+                request = ((HttpServletRequestWrapper)request).getRequest();
+            }
+            else
+            {
+                request = null;
+            }                
+        }
+        while (request != null && req == null);
+        return req;
+    }
+
+    private static HttpServletPortletResponseWrapper getWrappedResponse(ServletResponse response)
+    {
+        HttpServletPortletResponseWrapper res = null;
+        
+        do
+        {
+            if (response instanceof HttpServletPortletResponseWrapper)
+            {
+                res = (HttpServletPortletResponseWrapper)response;
+            }
+            else if (response instanceof HttpServletResponseWrapper)
+            {
+                response = ((HttpServletResponseWrapper)response).getResponse();
+            }
+            else
+            {
+                response = null;
+            }                
+        }
+        while (response != null && res == null);
+        return res;
+    }
+    
+    private void doDispatch(PortletRequest request, PortletResponse response, boolean included) throws PortletException, IOException
+    {
+        boolean needsFlushAfterForward = false;
+        if (!included)
+        {
+            String lifecyclePhase = (String)request.getAttribute(PortletRequest.LIFECYCLE_PHASE);
+            if (PortletRequest.RENDER_PHASE.equals(lifecyclePhase) || PortletRequest.RESOURCE_PHASE.equals(lifecyclePhase))
+            {
+                needsFlushAfterForward = true;
+                ((MimeResponse)response).resetBuffer();
+            }
+        }
+        
+        PortletRequestContext requestContext = (PortletRequestContext)request.getAttribute(PortletInvokerService.REQUEST_CONTEXT);
+        HttpSession session = null;
+        
+        // PLT.10.4.3. Proxied session is created and passed if javax.portlet.servletDefaultSessionScope == PORTLET_SCOPE
+        if (isPortletScopeSessionConfigured(requestContext))
+        {
+            String portletWindowId = requestContext.getPortletWindow().getId().getStringId();
+            session = ServletPortletSessionProxy.createProxy(requestContext.getServletRequest(), portletWindowId);
+        }
+        
+        HttpServletPortletRequestWrapper req = new HttpServletPortletRequestWrapper(requestContext.getServletRequest(), 
+                                                                                    requestContext.getServletContext(),
+                                                                                    session,
+                                                                                    request,
+                                                                                    included,
+                                                                                    namedDispatch);
+        HttpServletPortletResponseWrapper res = new HttpServletPortletResponseWrapper(requestContext.getServletResponse(),
+                                                                                      request,
+                                                                                      response,
+                                                                                      included);
+        try
+        {
+            request.setAttribute(PortletInvokerService.PORTLET_CONFIG, requestContext.getPortletConfig());
+            request.setAttribute(PortletInvokerService.PORTLET_REQUEST, request);
+            request.setAttribute(PortletInvokerService.PORTLET_RESPONSE, response);
+            
+            if (!included && req.isForwardingPossible())
+            {
+                requestDispatcher.forward(req, res);
+            }
+            else
+            {
+                // need to "fake" the forward using an include
+                requestDispatcher.include(req, res);
+            }
+            if (needsFlushAfterForward)
+            {
+                ((MimeResponse)response).flushBuffer();
+            }
+        }
+        catch (ServletException sex)
+        {
+            if (sex.getRootCause() != null)
+            {
+                throw new PortletException(sex.getRootCause());
+            } 
+            throw new PortletException(sex);
+        }
+        finally
+        {
+            request.removeAttribute(PortletInvokerService.PORTLET_CONFIG);
+            request.removeAttribute(PortletInvokerService.PORTLET_REQUEST);
+            request.removeAttribute(PortletInvokerService.PORTLET_RESPONSE);
+        }
+    }
+    
+    private boolean isPortletScopeSessionConfigured(PortletRequestContext requestContext)
+    {
+        boolean portletScopeSessionConfigured = false;
+        
+        PortletConfig portletConfig = requestContext.getPortletConfig();
+        Map<String, String []> containerRuntimeOptions = portletConfig.getContainerRuntimeOptions();
+        String [] values = containerRuntimeOptions.get("javax.portlet.servletDefaultSessionScope");
+        
+        if (values != null && values.length > 0)
+        {
+            portletScopeSessionConfigured = "PORTLET_SCOPE".equals(values[0]);
+        }
+        
+        return portletScopeSessionConfigured;
+    }
+
+    // PortletRequestDispatcher Impl -------------------------------------------
+   
+    public void forward(PortletRequest request, PortletResponse response) throws PortletException, IOException
+    {
+       if (isDebug) {
+          LOG.debug("Doing request dispatcher forward for portlet request.");
+       }
+        doDispatch(request, response, false);
+    }
+    
+	public void include(PortletRequest request, PortletResponse response) throws PortletException, IOException
+	{
+	   if (isDebug) {
+         LOG.debug("Doing request dispatcher include for portlet request.");
+      }
+	    doDispatch(request, response, true);
+	}
+	
+	public void include(RenderRequest request, RenderResponse response) throws PortletException, IOException
+	{
+      if (isDebug) {
+         LOG.debug("Doing request dispatcher include for render request.");
+      }
+	    doDispatch(request, response, true);
+    }
+	
+    // Nested RequestDispatcher Impl -------------------------------------------
+	
+    public void forward(ServletRequest request, ServletResponse response) throws ServletException, IOException
+    {
+        HttpServletPortletRequestWrapper req = getWrappedRequest(request);
+        HttpServletPortletResponseWrapper res = getWrappedResponse(response);
+        res.resetBuffer();
+        
+        // cache the current dispatch state
+        boolean forwarded = req.isForwarded();
+        boolean namedDispatch = req.isNamedDispatch();
+        Map<String,Object> pathAttributeValues = req.getPathAttributeValues();
+        HttpServletPortletRequestWrapper.PathMethodValues pathMethodValues = req.getInitPathMethodValues();
+        
+        // (re)initialize the request wrapper to a nested forward
+        req.setNestedForward();
+        try
+        {
+            if (req.isForwardingPossible())
+            {
+                requestDispatcher.forward(request, response);
+            }
+            else
+            {
+                // need to "fake" the forward using an include
+                requestDispatcher.include(request, response);
+            }
+        }
+        finally
+        {
+            // restore the previously cached dispatch state
+            req.restoreFromNestedForward(forwarded, namedDispatch, pathMethodValues, pathAttributeValues);
+        }
+    }
+
+    public void include(ServletRequest request, ServletResponse response) throws ServletException, IOException
+    {
+        // no need for special handling on a nested dispatcher include: just calling the wrapped servlet dispatcher
+        requestDispatcher.include(request, response);
+    }
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6dd6b872/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletMimeResponseContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletMimeResponseContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletMimeResponseContextImpl.java
index 9e1a0d4..ffbdc2d 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletMimeResponseContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletMimeResponseContextImpl.java
@@ -93,13 +93,13 @@ public abstract class PortletMimeResponseContextImpl extends PortletResponseCont
    }
 
    public void flushBuffer() throws IOException {
-      if (!isClosed() && !isSetPropsAllowed()) {
+      if (!isClosed() && !isHeaderBufferActive()) {
          getServletResponse().flushBuffer();
       }
    }
 
    public int getBufferSize() {
-      if (isSetPropsAllowed()) {
+      if (isHeaderBufferActive()) {
          // header request
          return headerData.getBufferSize();
       } else {
@@ -134,7 +134,7 @@ public abstract class PortletMimeResponseContextImpl extends PortletResponseCont
       if (isClosed()) {
          return null;
       }
-      if (isSetPropsAllowed()) {
+      if (isHeaderBufferActive()) {
          // header request
          return headerData.getBaoStream();
       } else {
@@ -157,7 +157,7 @@ public abstract class PortletMimeResponseContextImpl extends PortletResponseCont
       if (isClosed()) {
          return null;
       }
-      if (isSetPropsAllowed()) {
+      if (isHeaderBufferActive()) {
          // header request
          return headerData.getWriter();
       } else {
@@ -167,7 +167,7 @@ public abstract class PortletMimeResponseContextImpl extends PortletResponseCont
    }
 
    public boolean isCommitted() {
-      if (isSetPropsAllowed()) {
+      if (isHeaderBufferActive()) {
          // header request
          return false;
       } else {
@@ -177,7 +177,7 @@ public abstract class PortletMimeResponseContextImpl extends PortletResponseCont
 
    public void reset() {
       if (!isClosed()) {
-         if (isSetPropsAllowed()) {
+         if (isHeaderBufferActive()) {
             // header request
             headerData.reset();
          } else {
@@ -188,7 +188,7 @@ public abstract class PortletMimeResponseContextImpl extends PortletResponseCont
 
    public void resetBuffer() {
       if (!isClosed()) {
-         if (isSetPropsAllowed()) {
+         if (isHeaderBufferActive()) {
             // header request
             headerData.resetBuffer();
          } else {
@@ -199,7 +199,7 @@ public abstract class PortletMimeResponseContextImpl extends PortletResponseCont
 
    public void setBufferSize(int size) {
       if (!isClosed()) {
-         if (isSetPropsAllowed()) {
+         if (isHeaderBufferActive()) {
             // header request
             headerData.setBufferSize(size);
          } else {

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6dd6b872/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
index 0e60f50..c59784b 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletResponseContextImpl.java
@@ -18,6 +18,7 @@ package org.apache.pluto.driver.services.container;
 
 import static javax.portlet.PortletRequest.HEADER_PHASE;
 import static javax.portlet.PortletRequest.RENDER_PHASE;
+import static javax.portlet.PortletRequest.RESOURCE_PHASE;
 
 import java.util.Arrays;
 import java.util.HashSet;
@@ -102,6 +103,17 @@ public abstract class PortletResponseContextImpl implements PortletResponseConte
    public void setPropsAllowed(boolean isSetPropsAllowed) {
       this.isSetPropsAllowed = isSetPropsAllowed;
    }
+   
+   /**
+    * Returns <code>true</code> if markup written to the portlet output stream should 
+    * land in the document head section.
+    *  
+    * @return  <code>true</code> if the header buffer is active
+    */
+   public boolean isHeaderBufferActive() {
+      return isSetPropsAllowed && !lifecycle.equals(RESOURCE_PHASE);
+   }
+
 
    /**
     * returns the header data provided by the portlet during header phase execution.


[03/38] portals-pluto git commit: Replaced code that reads the deployment descriptor with an implementation that can be better extended to add v3.0 support. Added test cases. Uses jaxb binding classes that are generated at compile time.

Posted by ms...@apache.org.
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/PortletApplicationDefinition286ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/PortletApplicationDefinition286ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/PortletApplicationDefinition286ImplTest.java
new file mode 100644
index 0000000..b88f09b
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/PortletApplicationDefinition286ImplTest.java
@@ -0,0 +1,652 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl.jsr286;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.pluto.container.om.portlet.ContainerRuntimeOption;
+import org.apache.pluto.container.om.portlet.CustomPortletMode;
+import org.apache.pluto.container.om.portlet.CustomWindowState;
+import org.apache.pluto.container.om.portlet.EventDefinition;
+import org.apache.pluto.container.om.portlet.Filter;
+import org.apache.pluto.container.om.portlet.FilterMapping;
+import org.apache.pluto.container.om.portlet.Listener;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.PortletDefinition;
+import org.apache.pluto.container.om.portlet.PublicRenderParameter;
+import org.apache.pluto.container.om.portlet.SecurityConstraint;
+import org.apache.pluto.container.om.portlet.UserAttribute;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.ContainerRuntimeOptionImpl;
+import org.apache.pluto.container.om.portlet.impl.CustomPortletModeImpl;
+import org.apache.pluto.container.om.portlet.impl.CustomWindowStateImpl;
+import org.apache.pluto.container.om.portlet.impl.EventDefinitionImpl;
+import org.apache.pluto.container.om.portlet.impl.FilterImpl;
+import org.apache.pluto.container.om.portlet.impl.FilterMappingImpl;
+import org.apache.pluto.container.om.portlet.impl.ListenerImpl;
+import org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl;
+import org.apache.pluto.container.om.portlet.impl.PortletDefinitionImpl;
+import org.apache.pluto.container.om.portlet.impl.PublicRenderParameterImpl;
+import org.apache.pluto.container.om.portlet.impl.SecurityConstraintImpl;
+import org.apache.pluto.container.om.portlet.impl.UserAttributeImpl;
+import org.apache.pluto.container.om.portlet.impl.UserDataConstraintImpl;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Junit test cases for JSR 168 portlet application definition.
+ * @author Scott Nicklous
+ *
+ */
+public class PortletApplicationDefinition286ImplTest {
+
+   private static final String  WEBDDPKG         = "org/apache/pluto/container/om/portlet/";
+   private static final String  WEBDD31          = "webApp31simple.xml";
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet286Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+   private static ConfigurationHolder cfp;
+   
+   // class under test; cloned new for each test
+   private  PortletApplicationDefinition cut;
+
+   /**
+    * @throws java.lang.Exception
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      
+      InputStream in = PortletApplicationDefinition286ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+   
+   @Before
+   public void setUpBefore() throws Exception {
+      cut = new PortletApplicationDefinitionImpl(pad);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.PortletApplicationDefinitionImpl#getId()}.
+    */
+   @Test
+   public void testGetSetId() {
+      String val = pad.getId();
+      assertNotNull(val);
+      assertEquals("id1", val);
+      pad.setId("42");
+      val = pad.getId();
+      assertNotNull(val);
+      assertEquals("42", val);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.PortletApplicationDefinitionImpl#getName()}.
+    */
+   @Test
+   public void testGetSetName() {
+      pad.setName("Bob");
+      String val = pad.getName();
+      assertNotNull(val);
+      assertEquals("Bob", val);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.PortletApplicationDefinitionImpl#getContextPath()}.
+    */
+   @Test
+   public void testSetGetContextPath() {
+      pad.setContextPath("Bob");
+      String val = pad.getContextPath();
+      assertNotNull(val);
+      assertEquals("Bob", val);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.PortletApplicationDefinitionImpl#getVersion()}.
+    */
+   @Test
+   public void testGetSetVersion() {
+      String val = pad.getVersion();
+      assertNotNull(val);
+      assertEquals("2.0", val);
+      pad.setVersion("42");
+      val = pad.getVersion();
+      assertNotNull(val);
+      assertEquals("42", val);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getResourceBundle()}.
+    */
+   @Test
+   public void testGetSetResourceBundle() {
+      String val = pad.getResourceBundle();
+      String txt = "com.ibm.portal.ResourceBundle";
+      assertNotNull(val);
+      assertEquals("org.apache.portal.ResourceBundle", val);
+      pad.setResourceBundle(txt);
+      val = pad.getResourceBundle();
+      assertNotNull(val);
+      assertEquals(txt, val);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getDefaultNamespace()}.
+    */
+   @Test
+   public void testGetSetDefaultNamespace() {
+      String val = pad.getDefaultNamespace();
+      String txt = "https://www.ibm.com/";
+      assertNotNull(val);
+      assertEquals("https://www.apache.org/", val);
+      pad.setDefaultNamespace(txt);
+      val = pad.getDefaultNamespace();
+      assertNotNull(val);
+      assertEquals(txt, val);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getPortlet(java.lang.String)}.
+    */
+   @Test
+   public void testGetPortlet() {
+      PortletDefinition pd = pad.getPortlet("portlet286");
+      assertNotNull(pd);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getPortlets()}.
+    */
+   @Test
+   public void testGetPortlets() {
+      List<PortletDefinition> list = cut.getPortlets();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("portlet286", list.get(0).getPortletName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addPortlet(org.apache.pluto.container.om.portlet.PortletDefinition)}.
+    */
+   @Test
+   public void testAddPortlet() {
+      String newPN = "newPortlet";
+      PortletDefinition pd = new PortletDefinitionImpl(newPN, cut);
+      cut.addPortlet(pd);
+      
+      List<PortletDefinition> list = cut.getPortlets();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      boolean ok = false;
+      for (PortletDefinition item : list) {
+         if (item.getPortletName().equals(newPN)) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+  }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getEventDefinitions()}.
+    */
+   @Test
+   public void testGetEventDefinitions() {
+      List<EventDefinition> list = cut.getEventDefinitions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      boolean ok = false;
+      QName qn = new QName("https://www.apache.org/", "supported-processing-event");
+      for (EventDefinition item : list) {
+         if (item.getQName().equals(qn)) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getEventDefinition(javax.xml.namespace.QName)}.
+    */
+   @Test
+   public void testGetEventDefinition() {
+      QName qn = new QName("https://www.apache.org/", "supported-processing-event");
+      EventDefinition item = cut.getEventDefinition(qn);
+      assertNotNull(item);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addEventDefinition(org.apache.pluto.container.om.portlet.EventDefinition)}.
+    */
+   @Test
+   public void testAddEventDefinition() {
+      QName qn = new QName("https://www.ibm.com/", "some-other-event");
+      EventDefinition ed = new EventDefinitionImpl(qn);
+      cut.addEventDefinition(ed);
+
+      List<EventDefinition> list = cut.getEventDefinitions();
+      assertNotNull(list);
+      assertEquals(3, list.size());
+      boolean ok = false;
+      for (EventDefinition item : list) {
+         if (item.getQName().equals(qn)) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getPublicRenderParameter(java.lang.String)}.
+    */
+   @Test
+   public void testGetPublicRenderParameter() {
+      String prpid = "supported-public-render-parameter";
+      PublicRenderParameter prp = cut.getPublicRenderParameter(prpid);
+      assertNotNull(prp);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getPublicRenderParameters()}.
+    */
+   @Test
+   public void testGetPublicRenderParameters() {
+      String prpid = "supported-public-render-parameter";
+      List<PublicRenderParameter> prps = cut.getPublicRenderParameters();
+      assertNotNull(prps);
+      assertEquals(2, prps.size());
+      assertEquals(prpid, prps.get(0).getIdentifier());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addPublicRenderParameter(org.apache.pluto.container.om.portlet.PublicRenderParameter)}.
+    */
+   @Test
+   public void testAddPublicRenderParameter() {
+      String prpid = "newprp";
+      QName qn = new QName("https://www.ibm.com/", "some-other-prp");
+      PublicRenderParameter prp = new PublicRenderParameterImpl(qn, prpid);
+      cut.addPublicRenderParameter(prp);
+      
+      List<PublicRenderParameter> prps = cut.getPublicRenderParameters();
+      assertNotNull(prps);
+      assertEquals(3, prps.size());
+      assertEquals(prpid, prps.get(2).getIdentifier());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getCustomPortletMode(java.lang.String)}.
+    */
+   @Test
+   public void testGetCustomPortletMode() {
+      String newItem = "portlet-mode";
+      CustomPortletMode item = cut.getCustomPortletMode(newItem);
+      assertNotNull(item);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getCustomPortletModes()}.
+    */
+   @Test
+   public void testGetCustomPortletModes() {
+      String newItem = "portlet-mode";
+      List<CustomPortletMode> list = cut.getCustomPortletModes();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals(newItem, list.get(0).getPortletMode());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addCustomPortletMode(org.apache.pluto.container.om.portlet.CustomPortletMode)}.
+    */
+   @Test
+   public void testAddCustomPortletMode() {
+      String newItem = "newMode";
+      CustomPortletMode prp = new CustomPortletModeImpl(newItem);
+      cut.addCustomPortletMode(prp);
+      
+      List<CustomPortletMode> list = cut.getCustomPortletModes();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals(newItem, list.get(1).getPortletMode());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getCustomWindowState(java.lang.String)}.
+    */
+   @Test
+   public void testGetCustomWindowState() {
+      String newItem = "window-state";
+      CustomWindowState item = cut.getCustomWindowState(newItem);
+      assertNotNull(item);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getCustomWindowStates()}.
+    */
+   @Test
+   public void testGetCustomWindowStates() {
+      String newItem = "window-state";
+      List<CustomWindowState> list = cut.getCustomWindowStates();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals(newItem, list.get(0).getWindowState());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addCustomWindowState(org.apache.pluto.container.om.portlet.CustomWindowState)}.
+    */
+   @Test
+   public void testAddCustomWindowState() {
+      String newItem = "newMode";
+      CustomWindowState prp = new CustomWindowStateImpl(newItem);
+      cut.addCustomWindowState(prp);
+      
+      List<CustomWindowState> list = cut.getCustomWindowStates();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals(newItem, list.get(1).getWindowState());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getUserAttribute(java.lang.String)}.
+    */
+   @Test
+   public void testGetUserAttribute() {
+      String newItem = "name";
+      UserAttribute item = cut.getUserAttribute(newItem);
+      assertNotNull(item);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getUserAttributes()}.
+    */
+   @Test
+   public void testGetUserAttributes() {
+      String newItem = "name";
+      List<UserAttribute> list = cut.getUserAttributes();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals(newItem, list.get(0).getName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addUserAttribute(org.apache.pluto.container.om.portlet.UserAttribute)}.
+    */
+   @Test
+   public void testAddUserAttribute() {
+      String newItem = "newAttr";
+      UserAttribute prp = new UserAttributeImpl(newItem);
+      cut.addUserAttribute(prp);
+      
+      List<UserAttribute> list = cut.getUserAttributes();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals(newItem, list.get(1).getName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getFilter(java.lang.String)}.
+    */
+   @Test
+   public void testGetFilter() {
+      String newItem = "filter-name";
+      Filter item = cut.getFilter(newItem);
+      assertNotNull(item);
+      Filter filter = cut.getFilters().get(0);
+      assertEquals("org.apache.pluto.container.om.portlet.impl.fixtures.TestFilter", 
+            filter.getFilterClass());
+      assertEquals("description", filter.getDescription(new Locale("de")).getDescription());
+      assertEquals("display-name", filter.getDisplayName(new Locale("de")).getDisplayName());
+      assertEquals("lifecycle", filter.getLifecycles().get(0));
+      assertEquals("value", filter.getInitParam("name").getParamValue());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getFilters()}.
+    */
+   @Test
+   public void testGetFilters() {
+      String newItem = "filter-name";
+      List<Filter> list = cut.getFilters();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals(newItem, list.get(0).getFilterName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addFilter(org.apache.pluto.container.om.portlet.Filter)}.
+    */
+   @Test
+   public void testAddFilter() {
+      String newItem = "newFilter";
+      Filter prp = new FilterImpl(newItem);
+      cut.addFilter(prp);
+      
+      List<Filter> list = cut.getFilters();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals(newItem, list.get(1).getFilterName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getFilterMapping(java.lang.String)}.
+    */
+   @Test
+   public void testGetFilterMapping() {
+      String newItem = "filter-name";
+      FilterMapping item = cut.getFilterMapping(newItem);
+      assertNotNull(item);
+      assertEquals(1, item.getPortletNames().size());
+      assertEquals("portlet286", item.getPortletNames().get(0));
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getFilterMappings()}.
+    */
+   @Test
+   public void testGetFilterMappings() {
+      String newItem = "filter-name";
+      List<FilterMapping> list = cut.getFilterMappings();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals(newItem, list.get(0).getFilterName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addFilterMapping(org.apache.pluto.container.om.portlet.FilterMapping)}.
+    */
+   @Test
+   public void testAddFilterMapping() {
+      String newItem = "newFilter";
+      FilterMapping prp = new FilterMappingImpl(newItem);
+      cut.addFilterMapping(prp);
+      
+      List<FilterMapping> list = cut.getFilterMappings();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals(newItem, list.get(1).getFilterName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getContainerRuntimeOption(java.lang.String)}.
+    */
+   @Test
+   public void testGetContainerRuntimeOption() {
+      String newItem = "Runtime-Option-Portlet-App";
+      ContainerRuntimeOption item = cut.getContainerRuntimeOption(newItem);
+      assertNotNull(item);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getContainerRuntimeOptions()}.
+    */
+   @Test
+   public void testGetContainerRuntimeOptions() {
+      String newItem = "Runtime-Option-Portlet-App";
+      List<ContainerRuntimeOption> list = cut.getContainerRuntimeOptions();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals(newItem, list.get(0).getName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addContainerRuntimeOption(org.apache.pluto.container.om.portlet.ContainerRuntimeOption)}.
+    */
+   @Test
+   public void testAddContainerRuntimeOption() {
+      String newItem = "newRTO";
+      String[] newvals = {"v1", "v2"}; 
+      ContainerRuntimeOption item = new ContainerRuntimeOptionImpl(newItem, Arrays.asList(newvals));
+      cut.addContainerRuntimeOption(item);
+      
+      List<ContainerRuntimeOption> list = cut.getContainerRuntimeOptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals(newItem, list.get(1).getName());
+      assertArrayEquals(newvals, list.get(1).getValues().toArray());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getListeners()}.
+    */
+   @Test
+   public void testGetListeners() {
+      List<Listener> list = cut.getListeners();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("org.apache.pluto.container.om.portlet.impl.fixtures.TestListener", list.get(0).getListenerClass());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addListener(org.apache.pluto.container.om.portlet.Listener)}.
+    */
+   @Test
+   public void testAddListener() {
+      String clsName = "org.apache.pluto.container.om.portlet.impl.fixtures.DifferentListener";
+      Listener newitem = new ListenerImpl(clsName);
+      cut.addListener(newitem);
+      
+      List<Listener> list = cut.getListeners();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals(clsName, list.get(1).getListenerClass());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getSecurityConstraints()}.
+    */
+   @Test
+   public void testGetSecurityConstraints() {
+      List<SecurityConstraint> list = cut.getSecurityConstraints();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("NONE", list.get(0).getUserDataConstraint().getTransportGuarantee());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addSecurityConstraint(org.apache.pluto.container.om.portlet.SecurityConstraint)}.
+    */
+   @Test
+   public void testAddSecurityConstraint() {
+      SecurityConstraint seco = new SecurityConstraintImpl(new UserDataConstraintImpl("CONFIDENTIAL"));
+      cut.addSecurityConstraint(seco);
+      
+      List<SecurityConstraint> list = cut.getSecurityConstraints();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals("CONFIDENTIAL", list.get(1).getUserDataConstraint().getTransportGuarantee());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getLocaleEncodingMappings()}.
+    * @throws Exception 
+    */
+   @Test
+   public void testGetLocaleEncodingMappings() throws Exception {
+      String file = WEBDDPKG + WEBDD31;
+      InputStream in = this.getClass().getClassLoader().getResourceAsStream(file);
+      
+      try {
+         cfp.processWebDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+
+      Map<Locale, String> localemap = pad.getLocaleEncodingMappings();
+      assertEquals(2, localemap.size());
+      ArrayList<Locale> testlocs = new ArrayList<Locale>(Arrays.asList(new Locale[]{
+            Locale.forLanguageTag("de"), Locale.forLanguageTag("ja") }));
+      String[] testencs = {"UTF-8", "Shift_JIS"};
+      for (Locale loc : localemap.keySet()) {
+         assertTrue(testlocs.contains(loc));
+         int ind = testlocs.indexOf(loc);
+         assertEquals(testencs[ind], localemap.get(loc));
+      }
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addLocaleEncodingMapping(java.util.Locale, java.lang.String)}.
+    */
+   @Test
+   public void testAddLocaleEncodingMapping() {
+      ArrayList<Locale> testlocs = new ArrayList<Locale>(Arrays.asList(new Locale[]{
+            Locale.forLanguageTag("de"), Locale.forLanguageTag("ja") }));
+      String[] testencs = {"UTF-8", "Shift_JIS"};
+      for (Locale loc : testlocs) {
+         int ind = testlocs.indexOf(loc);
+         cut.addLocaleEncodingMapping(loc, testencs[ind]);
+      }
+      
+      Map<Locale, String> localemap = cut.getLocaleEncodingMappings();
+      assertEquals(2, localemap.size());
+      for (Locale loc : localemap.keySet()) {
+         assertTrue(testlocs.contains(loc));
+         int ind = testlocs.indexOf(loc);
+         assertEquals(testencs[ind], localemap.get(loc));
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/PortletDefinition286ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/PortletDefinition286ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/PortletDefinition286ImplTest.java
new file mode 100644
index 0000000..d8fb572
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/PortletDefinition286ImplTest.java
@@ -0,0 +1,538 @@
+package org.apache.pluto.container.om.portlet.impl.jsr286;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.InputStream;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Locale;
+
+import javax.xml.namespace.QName;
+
+import org.apache.pluto.container.om.portlet.ContainerRuntimeOption;
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.DisplayName;
+import org.apache.pluto.container.om.portlet.EventDefinitionReference;
+import org.apache.pluto.container.om.portlet.InitParam;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.PortletDefinition;
+import org.apache.pluto.container.om.portlet.PortletInfo;
+import org.apache.pluto.container.om.portlet.Preference;
+import org.apache.pluto.container.om.portlet.Preferences;
+import org.apache.pluto.container.om.portlet.SecurityRoleRef;
+import org.apache.pluto.container.om.portlet.Supports;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.ContainerRuntimeOptionImpl;
+import org.apache.pluto.container.om.portlet.impl.DescriptionImpl;
+import org.apache.pluto.container.om.portlet.impl.DisplayNameImpl;
+import org.apache.pluto.container.om.portlet.impl.EventDefinitionReferenceImpl;
+import org.apache.pluto.container.om.portlet.impl.InitParamImpl;
+import org.apache.pluto.container.om.portlet.impl.PortletDefinitionImpl;
+import org.apache.pluto.container.om.portlet.impl.PortletInfoImpl;
+import org.apache.pluto.container.om.portlet.impl.PreferenceImpl;
+import org.apache.pluto.container.om.portlet.impl.PreferencesImpl;
+import org.apache.pluto.container.om.portlet.impl.SecurityRoleRefImpl;
+import org.apache.pluto.container.om.portlet.impl.SupportsImpl;
+import org.apache.pluto.container.om.portlet.impl.fixtures.TestPortlet;
+import org.apache.pluto.container.om.portlet.impl.fixtures.TestPreferencesValidator;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class PortletDefinition286ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet286Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+   
+   // Class under test
+   private PortletDefinition cut;
+
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      
+      InputStream in = PortletDefinition286ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+   
+   @Before
+   public void setUpBefore() throws Exception {
+      assertEquals(1, pad.getPortlets().size());
+      cut = new PortletDefinitionImpl(pad.getPortlets().get(0));
+   }
+
+   @Test
+   public void testGetPortletName() {
+      assertNotNull(cut.getPortletName());
+      assertEquals("portlet286", cut.getPortletName());
+   }
+
+   @Test
+   public void testGetApplication() {
+      assertNotNull(cut.getApplication());
+      assertTrue(cut.getApplication() instanceof PortletApplicationDefinition);
+   }
+
+   @Test
+   public void testGetInitParam() {
+      InitParam ip = cut.getInitParam("name");
+      assertNotNull(ip);
+      assertEquals("name", ip.getParamName());
+      assertEquals("value", ip.getParamValue());
+      assertEquals(1, ip.getDescriptions().size());
+      Locale loc = new Locale("de");
+      Description d = ip.getDescription(loc);
+      assertNotNull(d);
+      assertEquals("description", d.getDescription());
+   }
+
+   @Test
+   public void testGetInitParamNullValue() {
+      InitParam ip = cut.getInitParam("nullValueParam");
+      assertNotNull(ip);
+      assertEquals("nullValueParam", ip.getParamName());
+      assertEquals("", ip.getParamValue());
+   }
+
+   @Test
+   public void testGetInitParams() {
+      List<InitParam> ips = cut.getInitParams();
+      assertEquals(2, ips.size());
+      boolean ok = false;
+      for (InitParam ip : ips) {
+         if (ip.getParamName().equals("name") && ip.getParamValue().equals("value")) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   @Test
+   public void testAddInitParam() {
+      String name = "Fred", value = "bowling";
+      InitParam newip = new InitParamImpl(name, value);
+      cut.addInitParam(newip);
+      
+      List<InitParam> ips = cut.getInitParams();
+      assertEquals(3, ips.size());
+      InitParam ip = cut.getInitParam(name);
+      assertNotNull(ip);
+      assertEquals(name, ip.getParamName());
+      assertEquals(value, ip.getParamValue());
+   }
+
+   @Test
+   public void testGetPortletClass() {
+      assertNotNull(cut.getPortletClass());
+      assertEquals(TestPortlet.class.getCanonicalName(), cut.getPortletClass());
+   }
+
+   @Test
+   public void testSetPortletClass() {
+      String text = "someClass";
+      cut.setPortletClass(text);
+      assertEquals(text, cut.getPortletClass());
+   }
+
+   @Test
+   public void testGetPortletInfo() {
+      PortletInfo info = cut.getPortletInfo();
+      assertNotNull(info);
+      assertEquals("title", info.getTitle());
+      assertEquals("short-title", info.getShortTitle());
+      assertEquals("keywords", info.getKeywords());
+   }
+
+   @Test
+   public void testSetPortletInfo() {
+      String ti = "t2", st = "st", kw = "kw";
+      PortletInfo i2 = new PortletInfoImpl(ti, kw, st);
+      cut.setPortletInfo(i2);
+
+      PortletInfo info = cut.getPortletInfo();
+      assertNotNull(info);
+      assertEquals(ti, info.getTitle());
+      assertEquals(st, info.getShortTitle());
+      assertEquals(kw, info.getKeywords());
+   }
+
+   @Test
+   public void testGetPortletPreferences() {
+      Preferences prefs = cut.getPortletPreferences();
+      assertNotNull(prefs);
+      assertEquals(TestPreferencesValidator.class.getCanonicalName(), prefs.getPreferencesValidator());
+      List<Preference> list = prefs.getPortletPreferences();
+      assertEquals(1, list.size());
+      Preference item = list.get(0);
+      assertEquals("name", item.getName());
+      List<String> vals = item.getValues();
+      assertEquals(1, vals.size());
+      assertEquals("value", vals.get(0));
+   }
+
+   @Test
+   public void testSetPortletPreferences() {
+      String validator = "validator";
+      String name = "prefName";
+      String[] vals = {"v1", "v2"};
+      Preferences prefs = new PreferencesImpl(cut.getPortletPreferences());
+      prefs.setPreferencesValidator(validator);
+      prefs.addPreference(new PreferenceImpl(name, true, Arrays.asList(vals)));
+      cut.setPortletPreferences(prefs);
+      
+      Preferences prefs2 = cut.getPortletPreferences();
+      assertNotNull(prefs2);
+      assertEquals(validator, prefs2.getPreferencesValidator());
+      List<Preference> list = prefs2.getPortletPreferences();
+      assertEquals(2, list.size());
+      Preference item = prefs2.getPortletPreference(name);
+      assertEquals(name, item.getName());
+      List<String> newvals = item.getValues();
+      assertEquals(2, newvals.size());
+      assertArrayEquals(vals, newvals.toArray());
+   }
+
+   @Test  // JSR 286
+   public void testGetSupportedProcessingEvents() {
+      List<EventDefinitionReference> list = cut.getSupportedProcessingEvents();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      boolean ok = false;
+      QName qn = new QName("https://www.apache.org/", "supported-processing-event");
+      for (EventDefinitionReference item : list) {
+         if (item.getQualifiedName().equals(qn)) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   @Test  // JSR 286
+   public void testAddSupportedProcessingEvent() {
+      QName qn = new QName("https://www.ibm.com/", "some-other-event");
+      EventDefinitionReference edr = new EventDefinitionReferenceImpl(qn);
+      cut.addSupportedProcessingEvent(edr);
+      
+      List<EventDefinitionReference> list = cut.getSupportedProcessingEvents();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      boolean ok = false;
+      for (EventDefinitionReference item : list) {
+         if (item.getQualifiedName().equals(qn)) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   @Test  // JSR 286
+   public void testGetSupportedPublishingEvents() {
+      List<EventDefinitionReference> list = cut.getSupportedPublishingEvents();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      boolean ok = false;
+      QName qn = new QName("http://test.com", "supported-publishing-event");
+      for (EventDefinitionReference item : list) {
+         QName aqn = item.getQualifiedName();
+         if (aqn.equals(qn)) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   @Test  // JSR 286
+   public void testAddSupportedPublishingEvent() {
+      QName qn = new QName("https://www.ibm.com/", "some-other-event");
+      EventDefinitionReference edr = new EventDefinitionReferenceImpl(qn);
+      cut.addSupportedPublishingEvent(edr);
+      
+      List<EventDefinitionReference> list = cut.getSupportedPublishingEvents();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      boolean ok = false;
+      for (EventDefinitionReference item : list) {
+         if (item.getQualifiedName().equals(qn)) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   @Test  // JSR 286
+   public void testGetSupportedPublicRenderParameters() {
+      List<String> list = cut.getSupportedPublicRenderParameters();
+      String prp = "supported-public-render-parameter";
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertTrue(list.contains(prp));
+   }
+
+   @Test  // JSR 286
+   public void testAddSupportedPublicRenderParameter() {
+      String newprp = "some-prp";
+      cut.addSupportedPublicRenderParameter(newprp);
+      List<String> list = cut.getSupportedPublicRenderParameters();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertTrue(list.contains(newprp));
+   }
+
+   @Test
+   public void testGetResourceBundle() {
+      assertNotNull(cut.getResourceBundle());
+      assertEquals("resource-bundle", cut.getResourceBundle());
+   }
+
+   @Test
+   public void testSetResourceBundle() {
+      String text = "newBundle";
+      cut.setResourceBundle(text);
+      assertNotNull(cut.getResourceBundle());
+      assertEquals(text, cut.getResourceBundle());
+   }
+
+   @Test
+   public void testGetSecurityRoleRef() {
+      SecurityRoleRef srr = cut.getSecurityRoleRef("NMTOKEN");
+      assertNotNull(srr);
+      assertEquals("NMTOKEN", srr.getRoleName());
+      assertEquals("role-link", srr.getRoleLink());
+   }
+
+   @Test
+   public void testGetSecurityRoleRefs() {
+      List<SecurityRoleRef> list = cut.getSecurityRoleRefs();
+      assertEquals(1, list.size());
+      SecurityRoleRef srr = list.get(0);
+      assertNotNull(srr);
+      assertEquals("NMTOKEN", srr.getRoleName());
+      assertEquals("role-link", srr.getRoleLink());
+      Description d = srr.getDescription(new Locale("de"));
+      assertNotNull(d);
+      assertEquals("description", d.getDescription());
+      
+   }
+
+   @Test
+   public void testAddSecurityRoleRef() {
+      String name = "RoleName";
+      String link = "RoleLink";
+      SecurityRoleRef srr = new SecurityRoleRefImpl(name);
+      srr.setRoleLink(link);
+      cut.addSecurityRoleRef(srr);
+
+      List<SecurityRoleRef> list = cut.getSecurityRoleRefs();
+      assertEquals(2, list.size());
+      srr = cut.getSecurityRoleRef(name);
+      assertNotNull(srr);
+      assertEquals(name, srr.getRoleName());
+      assertEquals(link, srr.getRoleLink());
+   }
+
+   @Test
+   public void testGetSupportsString() {
+      Supports s = cut.getSupports("mime-type2");
+      assertNotNull(s);
+      assertTrue(s.getPortletModes().contains("portlet-mode2"));
+   }
+
+   @Test
+   public void testGetSupportsMode() {
+      Supports s = cut.getSupports("mime-type2");
+      assertNotNull(s);
+      assertTrue(s.getPortletModes().contains("portlet-mode2"));
+   }
+
+   @Test
+   public void testGetSupportsState() {
+      Supports s = cut.getSupports("mime-type3");
+      assertNotNull(s);
+      assertTrue(s.getWindowStates().contains("window-state3"));
+   }
+
+   @Test
+   public void testGetSupports() {
+      List<Supports> list = cut.getSupports();
+      assertEquals(3, list.size());
+   }
+
+   @Test
+   public void testAddSupports() {
+      Supports s = new SupportsImpl("text/html");
+      cut.addSupports(s);
+      List<Supports> list = cut.getSupports();
+      assertEquals(4, list.size());
+      boolean ok = false;
+      for (Supports item : list) {
+         if (item.getMimeType().equals("text/html")) {
+            ok = true;
+            break;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   @Test
+   public void testGetDescription() {
+      Locale loc = new Locale("DE");
+      Description desc = cut.getDescription(loc);
+      assertNotNull(desc);
+      assertEquals("multi line description", desc.getDescription());
+   }
+
+   @Test
+   public void testGetDescriptions() {
+      List<Description> list = cut.getDescriptions();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("multi line description", list.get(0).getDescription());
+   }
+
+   @Test
+   public void testAddDescription() {
+      Locale loc = Locale.FRENCH;
+      String text = "Some description";
+      Description d = new DescriptionImpl(loc, text);
+      cut.addDescription(d);
+
+      List<Description> list = cut.getDescriptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (Description desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDescription());
+         } else {
+            assertEquals("multi line description", desc.getDescription());
+         }
+      }
+   }
+
+   @Test
+   public void testGetDisplayName() {
+      Locale loc = new Locale("DE");
+      DisplayName name = cut.getDisplayName(loc);
+      assertNotNull(name);
+      assertEquals("display-name", name.getDisplayName());
+   }
+
+   @Test
+   public void testGetDisplayNames() {
+      List<DisplayName> list = cut.getDisplayNames();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("display-name", list.get(0).getDisplayName());
+   }
+
+   @Test
+   public void testAddDisplayName() {
+      Locale loc = Locale.FRENCH;
+      String text = "Some display name";
+      DisplayName d = new DisplayNameImpl(loc, text);
+      cut.addDisplayName(d);
+
+      List<DisplayName> list = cut.getDisplayNames();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (DisplayName desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDisplayName());
+         } else {
+            assertEquals("display-name", desc.getDisplayName());
+         }
+      }
+   }
+
+   @Test
+   public void testGetSupportedLocales() {
+      List<String> list = cut.getSupportedLocales();
+      assertEquals(1, list.size());
+      assertTrue(list.contains("supported-locale"));
+   }
+
+   @Test
+   public void testAddSupportedLocale() {
+      String locname = "zh-cmn-Hans-CN";
+      cut.addSupportedLocale(locname);
+      
+      List<String> list = cut.getSupportedLocales();
+      assertEquals(2, list.size());
+      assertTrue(list.contains(locname));
+   }
+
+   @Test
+   public void testGetExpirationCache() {
+      assertNotNull(cut.getExpirationCache());
+      assertEquals(50, cut.getExpirationCache());
+   }
+
+   @Test
+   public void testSetExpirationCache() {
+      cut.setExpirationCache(100);
+      assertNotNull(cut.getExpirationCache());
+      assertEquals(100, cut.getExpirationCache());
+   }
+
+   @Test  // JSR 286
+   public void testGetCacheScope() {
+      assertNotNull(cut.getCacheScope());
+      assertEquals("private", cut.getCacheScope());
+   }
+
+   @Test  // JSR 286
+   public void testSetCacheScope() {
+      String cs = "whatever";
+      cut.setCacheScope(cs);
+      assertNotNull(cut.getCacheScope());
+      assertEquals(cs, cut.getCacheScope());
+   }
+
+   @Test  // JSR 286
+   public void testGetContainerRuntimeOption() {
+      ContainerRuntimeOption rto = cut.getContainerRuntimeOption("Runtime-Option1");
+      assertNotNull(rto);
+      assertEquals(1, rto.getValues().size());
+      assertTrue(rto.getValues().get(0).equalsIgnoreCase("true"));
+   }
+
+   @Test  // JSR 286
+   public void testGetContainerRuntimeOptions() {
+      List<ContainerRuntimeOption> list = cut.getContainerRuntimeOptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      boolean ok = false;
+      for (ContainerRuntimeOption item : list) {
+         if (item.getName().equalsIgnoreCase("Runtime-Option2") && 
+               item.getValues().size() == 1 && item.getValues().get(0).equalsIgnoreCase("value2")) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   @Test  // JSR 286
+   public void testAddContainerRuntimeOption() {
+      String name = "NewRTO";
+      String[] vals = {"v1", "v2", "v3"};
+      ContainerRuntimeOption cro = new ContainerRuntimeOptionImpl(name, Arrays.asList(vals));
+      cut.addContainerRuntimeOption(cro);
+      
+      ContainerRuntimeOption newcro = cut.getContainerRuntimeOption(name);
+      assertNotNull(newcro);
+      assertArrayEquals(vals, newcro.getValues().toArray());
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/SecurityConstraint286ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/SecurityConstraint286ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/SecurityConstraint286ImplTest.java
new file mode 100644
index 0000000..a48c370
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/SecurityConstraint286ImplTest.java
@@ -0,0 +1,122 @@
+package org.apache.pluto.container.om.portlet.impl.jsr286;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.DisplayName;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.SecurityConstraint;
+import org.apache.pluto.container.om.portlet.UserDataConstraint;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.DisplayNameImpl;
+import org.apache.pluto.container.om.portlet.impl.SecurityConstraintImpl;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class SecurityConstraint286ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet286Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+   
+   private ArrayList<SecurityConstraint> constraints;
+   private SecurityConstraint constraint;
+
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      
+      InputStream in = SecurityConstraint286ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+   
+   @Before
+   public void setUpBefore() throws Exception {
+      constraints = new ArrayList<SecurityConstraint>();
+      for (SecurityConstraint sc : pad.getSecurityConstraints()) {
+         // test the copy constructor
+         constraints.add(new SecurityConstraintImpl(sc));
+      }
+      assertEquals(1, constraints.size());
+      constraint = constraints.get(0);
+   }
+
+   @Test
+   // tests the UserDataConstraint as well
+   public void testGetUserDataConstraint() {
+      UserDataConstraint udc = constraint.getUserDataConstraint();
+      assertNotNull(udc);
+      
+   }
+
+   @Test
+   public void testGetDisplayName() {
+      Locale loc = new Locale("DE");
+      DisplayName name = constraint.getDisplayName(loc);
+      assertNotNull(name);
+      assertEquals("display-name", name.getDisplayName());
+   }
+
+   @Test
+   public void testGetDisplayNames() {
+      List<DisplayName> list = constraint.getDisplayNames();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("display-name", list.get(0).getDisplayName());
+   }
+
+   @Test
+   public void testAddDisplayName() {
+      Locale loc = Locale.FRENCH;
+      String text = "Some display name";
+      DisplayName d = new DisplayNameImpl(loc, text);
+      constraint.addDisplayName(d);
+
+      List<DisplayName> list = constraint.getDisplayNames();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (DisplayName desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDisplayName());
+         } else {
+            assertEquals("display-name", desc.getDisplayName());
+         }
+      }
+   }
+
+   @Test
+   public void testGetPortletNames() {
+      List<String> list = constraint.getPortletNames();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+   }
+
+   @Test
+   public void testAddPortletName() {
+      String text = "SomeName";
+      constraint.addPortletName(text);;
+
+      List<String> list = constraint.getPortletNames();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertTrue(list.contains(text));
+      assertTrue(list.contains("portlet.name"));
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/StandAloneContainerRuntimeOptionImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/StandAloneContainerRuntimeOptionImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/StandAloneContainerRuntimeOptionImplTest.java
new file mode 100644
index 0000000..8210ae4
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/StandAloneContainerRuntimeOptionImplTest.java
@@ -0,0 +1,98 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl.jsr286;
+
+import static org.junit.Assert.*;
+
+import java.util.Arrays;
+
+import org.apache.pluto.container.om.portlet.ContainerRuntimeOption;
+import org.apache.pluto.container.om.portlet.impl.ContainerRuntimeOptionImpl;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class StandAloneContainerRuntimeOptionImplTest {
+   
+   private static final String NAME = "name";
+   private static final String VAL3 = "v3";
+   private static final String[] VALS = {"v1", "v2"}; 
+   private static final String[] VALS3 = {"v1", "v2", "v3"}; 
+   
+   private ContainerRuntimeOption cro;
+
+   /**
+    * @throws java.lang.Exception
+    */
+   @Before
+   public void setUp() throws Exception {
+      cro = new ContainerRuntimeOptionImpl(NAME, Arrays.asList(VALS));
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.ContainerRuntimeOptionImpl#ContainerRuntimeOptionImpl(java.lang.String, java.util.List)}.
+    */
+   @Test
+   public void testContainerRuntimeOptionImplStringListOfString() {
+      assertEquals(NAME, cro.getName());
+      assertArrayEquals(VALS, cro.getValues().toArray());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.ContainerRuntimeOptionImpl#ContainerRuntimeOptionImpl(org.apache.pluto.container.om.portlet.ContainerRuntimeOption)}.
+    */
+   @Test
+   public void testContainerRuntimeOptionImplContainerRuntimeOption() {
+      ContainerRuntimeOption cro2 = new ContainerRuntimeOptionImpl(cro);
+      assertEquals(NAME, cro2.getName());
+      assertArrayEquals(VALS, cro2.getValues().toArray());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.ContainerRuntimeOptionImpl#getName()}.
+    */
+   @Test
+   public void testGetName() {
+      assertEquals(NAME, cro.getName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.ContainerRuntimeOptionImpl#getValues()}.
+    */
+   @Test
+   public void testGetValues() {
+      assertArrayEquals(VALS, cro.getValues().toArray());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.ContainerRuntimeOptionImpl#addValue(java.lang.String)}.
+    */
+   @Test
+   public void testAddValue() {
+      ContainerRuntimeOption cro2 = new ContainerRuntimeOptionImpl(cro);
+      cro.addValue(VAL3);
+      assertArrayEquals(VALS3, cro.getValues().toArray());
+      assertArrayEquals(VALS, cro2.getValues().toArray());
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/UserAttribute286ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/UserAttribute286ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/UserAttribute286ImplTest.java
new file mode 100644
index 0000000..1d7e3c3
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/UserAttribute286ImplTest.java
@@ -0,0 +1,133 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl.jsr286;
+
+import static org.junit.Assert.*;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.UserAttribute;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.DescriptionImpl;
+import org.apache.pluto.container.om.portlet.impl.UserAttributeImpl;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class UserAttribute286ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet286Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+   private        List<UserAttribute> attrs;
+   private        UserAttribute ua;
+
+   /**
+    * @throws java.lang.Exception
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      
+      InputStream in = UserAttribute286ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+   
+   @Before
+   public void setUpBefore() throws Exception {
+      attrs = new ArrayList<UserAttribute>();
+      for (UserAttribute ua : pad.getUserAttributes()) {
+         attrs.add(new UserAttributeImpl(ua));
+      }
+      assertEquals(1, attrs.size());
+      ua = attrs.get(0);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.UserAttributeImpl#getName()}.
+    */
+   @Test
+   public void testGetName() {
+      assertEquals("name", ua.getName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.UserAttributeImpl#getDescription(java.util.Locale)}.
+    */
+   @Test
+   public void testGetDescription() {
+      Locale loc = new Locale("DE");
+      Description desc = ua.getDescription(loc);
+      assertNotNull(desc);
+      assertEquals("description", desc.getDescription());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.UserAttributeImpl#getDescriptions()}.
+    */
+   @Test
+   public void testGetDescriptions() {
+      List<Description> list = ua.getDescriptions();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("description", list.get(0).getDescription());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.UserAttributeImpl#addDescription(org.apache.pluto.container.om.portlet.Description)}.
+    */
+   @Test
+   public void testAddDescription() {
+      Locale loc = Locale.FRENCH;
+      String text = "Some description";
+      Description d = new DescriptionImpl(loc, text);
+      ua.addDescription(d);
+
+      List<Description> list = ua.getDescriptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (Description desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDescription());
+         } else {
+            assertEquals("description", desc.getDescription());
+         }
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/UserDataConstraint286ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/UserDataConstraint286ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/UserDataConstraint286ImplTest.java
new file mode 100644
index 0000000..fae0813
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr286/UserDataConstraint286ImplTest.java
@@ -0,0 +1,105 @@
+package org.apache.pluto.container.om.portlet.impl.jsr286;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.InputStream;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.SecurityConstraint;
+import org.apache.pluto.container.om.portlet.UserDataConstraint;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.DescriptionImpl;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class UserDataConstraint286ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet286Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+   private        UserDataConstraint udc;
+
+   /**
+    * @throws java.lang.Exception
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      
+      InputStream in = UserDataConstraint286ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+   
+   @Before
+   public void setUpBefore() throws Exception {
+      assertEquals(1, pad.getSecurityConstraints().size());
+      SecurityConstraint sc = pad.getSecurityConstraints().get(0);
+      assertNotNull(sc);
+      assertNotNull(sc.getUserDataConstraint());
+      udc = sc.getUserDataConstraint();
+   }
+
+   @Test
+   public void testGetTransportGuarantee() {
+      assertEquals("NONE", udc.getTransportGuarantee());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.UserDataConstraintImpl#getDescription(java.util.Locale)}.
+    */
+   @Test
+   public void testGetDescription() {
+      Locale loc = new Locale("DE");
+      Description desc = udc.getDescription(loc);
+      assertNotNull(desc);
+      assertEquals("description", desc.getDescription());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.UserDataConstraintImpl#getDescriptions()}.
+    */
+   @Test
+   public void testGetDescriptions() {
+      List<Description> list = udc.getDescriptions();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("description", list.get(0).getDescription());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.UserDataConstraintImpl#addDescription(org.apache.pluto.container.om.portlet.Description)}.
+    */
+   @Test
+   public void testAddDescription() {
+      Locale loc = Locale.FRENCH;
+      String text = "Some description";
+      Description d = new DescriptionImpl(loc, text);
+      udc.addDescription(d);
+
+      List<Description> list = udc.getDescriptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (Description desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDescription());
+         } else {
+            assertEquals("description", desc.getDescription());
+         }
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/CustomPortletMode362ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/CustomPortletMode362ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/CustomPortletMode362ImplTest.java
new file mode 100644
index 0000000..e78d3b9
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/CustomPortletMode362ImplTest.java
@@ -0,0 +1,140 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl.jsr362;
+
+import static org.junit.Assert.*;
+
+import java.io.InputStream;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.CustomPortletMode;
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.CustomPortletModeImpl;
+import org.apache.pluto.container.om.portlet.impl.DescriptionImpl;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class CustomPortletMode362ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet362Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+
+   /**
+    * @throws java.lang.Exception
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      InputStream in = CustomPortletMode362ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.CustomPortletModeImpl#getPortletMode()}.
+    */
+   @Test
+   public void testGetPortletMode() {
+      CustomPortletMode cpm = pad.getCustomPortletMode("portlet-mode");
+      assertNotNull(cpm);
+      assertEquals(1, pad.getCustomPortletModes().size());
+      cpm = pad.getCustomPortletModes().get(0);
+      assertEquals("portlet-mode", cpm.getPortletMode());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.CustomPortletModeImpl#isPortalManaged()}.
+    */
+   @Test
+   public void testGetIsPortalManaged() {
+      CustomPortletMode cpm = pad.getCustomPortletMode("portlet-mode");
+      assertNotNull(cpm);
+      assertEquals(1, pad.getCustomPortletModes().size());
+      cpm = pad.getCustomPortletModes().get(0);
+      assertFalse(cpm.isPortalManaged());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.CustomPortletModeImpl#getDescription(java.util.Locale)}.
+    */
+   @Test
+   public void testGetDescription() {
+      assertEquals(1, pad.getCustomPortletModes().size());
+      CustomPortletMode cpm = pad.getCustomPortletModes().get(0);
+      Locale loc = new Locale("de");
+      Description d = cpm.getDescription(loc);
+      assertNotNull(d);
+      assertEquals("description", d.getDescription());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.CustomPortletModeImpl#getDescriptions()}.
+    */
+   @Test
+   public void testGetDescriptions() {
+      assertEquals(1, pad.getCustomPortletModes().size());
+      CustomPortletMode cpm = pad.getCustomPortletModes().get(0);
+      assertEquals("portlet-mode", cpm.getPortletMode());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.CustomPortletModeImpl#addDescription(org.apache.pluto.container.om.portlet.Description)}.
+    */
+   @Test
+   public void testAddDescription() {
+      assertEquals(1, pad.getCustomPortletModes().size());
+      CustomPortletMode cpm = 
+            new CustomPortletModeImpl(pad.getCustomPortletModes().get(0));
+      assertEquals(1, cpm.getDescriptions().size());
+      Locale loc = Locale.FRENCH;
+      String text = "Some description";
+      Description d = new DescriptionImpl(loc, text);
+      cpm.addDescription(d);
+      
+      List<Description> list = cpm.getDescriptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (Description desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDescription());
+         } else {
+            assertEquals("description", desc.getDescription());
+         }
+      }
+
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/CustomWindowState362ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/CustomWindowState362ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/CustomWindowState362ImplTest.java
new file mode 100644
index 0000000..3c591d1
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/CustomWindowState362ImplTest.java
@@ -0,0 +1,128 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl.jsr362;
+
+import static org.junit.Assert.*;
+
+import java.io.InputStream;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.CustomWindowState;
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.CustomWindowStateImpl;
+import org.apache.pluto.container.om.portlet.impl.DescriptionImpl;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class CustomWindowState362ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet362Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+
+   /**
+    * @throws java.lang.Exception
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      InputStream in = CustomWindowState362ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.CustomWindowStateImpl#getWindowState()}.
+    */
+   @Test
+   public void testGetWindowState() {
+      CustomWindowState cws = pad.getCustomWindowState("window-state");
+      assertNotNull(cws);
+      assertEquals(1, pad.getCustomWindowStates().size());
+      cws = pad.getCustomWindowStates().get(0);
+      assertEquals("window-state", cws.getWindowState());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.CustomWindowStateImpl#getDescription(java.util.Locale)}.
+    */
+   @Test
+   public void testGetDescription() {
+      assertEquals(1, pad.getCustomWindowStates().size());
+      CustomWindowState cws = pad.getCustomWindowStates().get(0);
+      Locale loc = new Locale("de");
+      Description d = cws.getDescription(loc);
+      assertNotNull(d);
+      assertEquals("description", d.getDescription());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.CustomWindowStateImpl#getDescriptions()}.
+    */
+   @Test
+   public void testGetDescriptions() {
+      assertEquals(1, pad.getCustomWindowStates().size());
+      CustomWindowState cws = pad.getCustomWindowStates().get(0);
+      assertEquals("window-state", cws.getWindowState());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.CustomWindowStateImpl#addDescription(org.apache.pluto.container.om.portlet.Description)}.
+    */
+   @Test
+   public void testAddDescription() {
+      assertEquals(1, pad.getCustomWindowStates().size());
+      CustomWindowState cws = 
+            new CustomWindowStateImpl(pad.getCustomWindowStates().get(0));
+      assertEquals(1, cws.getDescriptions().size());
+      Locale loc = Locale.FRENCH;
+      String text = "Some description";
+      Description d = new DescriptionImpl(loc, text);
+      cws.addDescription(d);
+      
+      List<Description> list = cws.getDescriptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (Description desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDescription());
+         } else {
+            assertEquals("description", desc.getDescription());
+         }
+      }
+
+   }
+
+}


[15/38] portals-pluto git commit: Replaced code that reads the deployment descriptor with an implementation that can be better extended to add v3.0 support. Added test cases. Uses jaxb binding classes that are generated at compile time.

Posted by ms...@apache.org.
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletAppDescriptorServiceImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletAppDescriptorServiceImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletAppDescriptorServiceImpl.java
index f7876a8..11cfbc4 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletAppDescriptorServiceImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletAppDescriptorServiceImpl.java
@@ -44,6 +44,7 @@ import javax.xml.xpath.XPathFactory;
 
 import org.apache.pluto.container.PortletAppDescriptorService;
 import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
@@ -51,318 +52,83 @@ import org.xml.sax.EntityResolver;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 
-/** 
- *  JAXB implementation of the xml2java binding
- *  @author <a href="mailto:chrisra@cs.uni-jena.de">Christian Raschka</a>
+/**
+ * Service that reads the portlet deployment descriptor.
  */
 
-public class PortletAppDescriptorServiceImpl implements PortletAppDescriptorService{
-    
-    private static class WebAppDtdEntityResolver implements EntityResolver {
-        public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
-        {
-            if (systemId.equals("http://java.sun.com/dtd/web-app_2_3.dtd"))
-            {
-                return new InputSource(getClass().getResourceAsStream("web-app_2_3.dtd"));
-            }
-            return null;
-        }
-    }
+public class PortletAppDescriptorServiceImpl implements
+      PortletAppDescriptorService {
+
+   private PortletApplicationDefinition pad        = null;
+   private ConfigurationHolder          confHolder = new ConfigurationHolder();
+
+   public PortletAppDescriptorServiceImpl() {
+   }
+
+   /**
+    * Read the Web Application Deployment Descriptor.
+    * 
+    * @return WebAppDD instance representing the descriptor.
+    * @throws java.io.IOException
+    */
+   public PortletApplicationDefinition read(String name, String contextPath,
+         InputStream in) throws IOException {
+      if (in == null) {
+         throw new IOException("Cannot read from a null InputStream");
+      }
+
+      // read the deployment descriptor
+      try {
+         confHolder.processPortletDD(in);
+         pad = confHolder.getPad();
+      } catch (XMLStreamException | IllegalArgumentException | JAXBException e) {
+         final IOException ioe = new IOException(e.getLocalizedMessage());
+         ioe.initCause(e);
+         throw ioe;
+      }
+
+      pad.setName(name);
+      pad.setContextPath(contextPath);
+
+      return pad;
+   }
+
+   public void mergeWebDescriptor(PortletApplicationDefinition pa,
+         InputStream webDescriptor) throws Exception {
+      
+      confHolder = new ConfigurationHolder(pa);
+      confHolder.processWebDD(webDescriptor);
+   }
+
+   /**
+    * Write the deployment descriptor.
+    * 
+    * @param app
+    * @throws java.io.IOException
+    */
+   public void write(PortletApplicationDefinition app, OutputStream out) throws IOException {
+//       try {
+//          final Object src;
+//          if (PortletApplicationDefinition.JSR_168_VERSION.equals(app
+//                .getVersion())) {
+//             // src = new
+//             // org.apache.pluto.container.om.portlet10.impl.PortletAppType(app);
+//          } else {
+//             src = app;
+//          }
+//          final Marshaller marshaller = this.jaxbContext.createMarshaller();
+//          marshaller.setEventHandler(new DefaultValidationEventHandler());
+//          marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+//          // marshaller.marshal(src,out);
+//       } catch (JAXBException jaxbEx) {
+//          final IOException ioe = new IOException(jaxbEx.getMessage());
+//          ioe.initCause(jaxbEx);
+//          throw ioe;
+//       } catch (Exception me) {
+//          final IOException ioe = new IOException(me.getLocalizedMessage());
+//          ioe.initCause(me);
+//          throw ioe;
+//       }
+   }
 
-    private static class NamespaceOverridingStreamReaderDelegate extends StreamReaderDelegate {
-        private String adjustedNamespaceURI = null;
-
-        private NamespaceOverridingStreamReaderDelegate(XMLStreamReader reader) {
-            super(reader);
-        }
-
-        @Override
-        public int next() throws XMLStreamException
-        {
-            int eventCode = super.next();
-            if (eventCode == XMLEvent.START_ELEMENT && "portlet-app".equals(getLocalName()))
-            {
-                String version = getAttributeValue(null, "version");
-                if ("1.0".equals(version))
-                {
-                    adjustedNamespaceURI = "http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd";
-                }
-                else if ("2.0".equals(version))
-                {
-                    adjustedNamespaceURI = "http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd";
-                }
-                else if ("3.0".equals(version))
-                {
-                    adjustedNamespaceURI = "http://xmlns.jcp.org/xml/ns/portlet";
-                }
-            }
-            return eventCode;
-        }
-
-        @Override
-        public String getNamespaceURI()
-        {
-            String namespaceURI = super.getNamespaceURI();
-            return (namespaceURI != null ? namespaceURI : adjustedNamespaceURI);
-        }
-    }
-
-    private static class XPathNamespaceContext implements NamespaceContext
-    {
-        private String namespaceURI;
-        private String prefix;
-        
-        public XPathNamespaceContext(String prefix)
-        {
-            this(prefix,XMLConstants.XML_NS_URI);
-        }
-
-        public XPathNamespaceContext(String prefix, String namespaceURI)
-        {
-            this.prefix = prefix;
-            this.namespaceURI = namespaceURI;
-        }
-
-        public String getNamespaceURI(String prefix)
-        {
-            if (prefix == null)
-            {
-                throw new NullPointerException("Null prefix");
-            }
-            else if (this.prefix.equals(prefix))
-            {
-                return namespaceURI;
-            }
-            else if ("xml".equals(prefix))
-            {
-                return XMLConstants.XML_NS_URI;
-            }
-            return XMLConstants.NULL_NS_URI;
-        }
-
-        public String getPrefix(String namespaceURI)
-        {
-            throw new UnsupportedOperationException();
-        }
-
-        public Iterator<?> getPrefixes(String namespaceURI)
-        {
-            throw new UnsupportedOperationException();
-        }
-    }
-
-    public static Locale convertStringToLocale(String lang)
-    {
-        if (lang == null)
-        {
-            return null;
-        }
-        String country = "";
-        String variant = "";
-        String[] localeArray = LOCALE_SPLIT.split(lang);
-        for (int i = 0; i < localeArray.length; i++)
-        {
-            if (i == 0)
-            {
-                lang = localeArray[i];
-            }
-            else if (i == 1)
-            {
-                country = localeArray[i];
-            }
-            else if (i == 2)
-            {
-                variant = localeArray[i];
-            }
-        }
-        return new Locale(lang, country, variant);
-    }    
-    
-    private static final Pattern LOCALE_SPLIT = Pattern.compile("[-|_]");
-    private static final String NAMESPACE_PREFIX = "xp";
-    
-    private final JAXBContext jaxbContext;
-
-    public PortletAppDescriptorServiceImpl() {
-        ClassLoader containerClassLoader = PortletAppDescriptorServiceImpl.class.getClassLoader();
-        try {
-            jaxbContext = JAXBContext.newInstance(org.apache.pluto.container.om.portlet10.impl.ObjectFactory.class.getPackage().getName() + ":" +
-                                                  org.apache.pluto.container.om.portlet20.impl.ObjectFactory.class.getPackage().getName() + ":" +
-                                                  org.apache.pluto.container.om.portlet30.impl.ObjectFactory.class.getPackage().getName(), 
-                                                  containerClassLoader);
-        }
-        catch (JAXBException e) {
-            throw new IllegalStateException("Failed to initialize JAXBContext for reading and writing portlet descriptors", e);
-        }
-    }
-    
-    /**
-     * Read the Web Application Deployment Descriptor.
-     *
-     * @return WebAppDD instance representing the descriptor.
-     * @throws java.io.IOException
-     */
-    public PortletApplicationDefinition read(String name, String contextPath, InputStream in) throws IOException 
-    {
-        if (in == null) {
-            throw new IOException("Cannot read from a null InputStream");
-        }
-        
-        final XMLInputFactory xmlInputFactory = getXmlInputFactory();
-        
-        //Generate an xml stream reader for the input stream 
-        final XMLStreamReader streamReader;
-        try {
-            streamReader = xmlInputFactory.createXMLStreamReader(in);
-        }
-        catch (XMLStreamException e) {
-            final IOException ioe = new IOException(e.getLocalizedMessage());
-            ioe.initCause(e);
-            throw ioe;
-        }
-        
-        //Wrap the stream reader to make sure the namespace gets setup correctly
-        final XMLStreamReader delegatingStreamReader = new NamespaceOverridingStreamReaderDelegate(streamReader);
-
-        //Unmarshall the stream
-        final JAXBElement<?> app;
-        try {
-            final Unmarshaller unmarshaller = this.jaxbContext.createUnmarshaller();
-            unmarshaller.setEventHandler(new DefaultValidationEventHandler());
-            app = (JAXBElement<?>) unmarshaller.unmarshal(delegatingStreamReader);
-        }
-        catch (JAXBException e) {
-            final IOException ioe = new IOException(e.getMessage());
-            ioe.initCause(e);
-            throw ioe;
-        }
-
-        PortletApplicationDefinition pad = null;
-        if (app.getValue() instanceof org.apache.pluto.container.om.portlet10.impl.PortletAppType)
-        {
-             pad = ((org.apache.pluto.container.om.portlet10.impl.PortletAppType)app.getValue()).upgrade();
-        }      
-        else
-        {
-            pad = (PortletApplicationDefinition)app.getValue();
-        }
-        
-        pad.setName(name);
-        pad.setContextPath(contextPath);
-        
-        return pad;
-    }
-
-    public void mergeWebDescriptor(PortletApplicationDefinition pa, InputStream webDescriptor) throws Exception
-    {
-        final DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
-        documentBuilderFactory.setNamespaceAware(true);
-        final DocumentBuilder builder = documentBuilderFactory.newDocumentBuilder();
-        builder.setEntityResolver(new WebAppDtdEntityResolver());
-        
-        final Document document = builder.parse(webDescriptor);
-        final Element root = document.getDocumentElement();
-        final String namespace = root.getNamespaceURI();
-
-        final XPathFactory xpathFactory = XPathFactory.newInstance();
-        final XPath xpath = xpathFactory.newXPath();
-        
-        String prefix;
-        if(namespace!= null && namespace.length() > 0)
-        {
-            prefix = NAMESPACE_PREFIX+":";
-            xpath.setNamespaceContext(new XPathNamespaceContext(NAMESPACE_PREFIX, namespace));
-        }
-        else
-        {
-            prefix = XMLConstants.DEFAULT_NS_PREFIX;
-            xpath.setNamespaceContext(new XPathNamespaceContext(XMLConstants.DEFAULT_NS_PREFIX));
-        }
-        
-        NodeList nodes;
-        NodeList children;
-        Element element;
-
-        // retrieve locale-encoding-mapping
-        nodes = (NodeList)xpath.evaluate("/"+prefix+"web-app/"+prefix+"locale-encoding-mapping-list/"+prefix+"locale-encoding-mapping", document, XPathConstants.NODESET);
-        if (nodes != null)
-        {
-            String locale;
-            String encoding;
-            
-            for (int i = 0, nsize = nodes.getLength(); i < nsize; i++)
-            {
-                element = (Element)nodes.item(i);
-                children = element.getElementsByTagName("locale");
-                if (children != null && children.getLength() != 0)
-                {
-                    locale = children.item(0).getTextContent().trim();
-                    if (locale.length() > 0)
-                    {
-                        
-                        children = element.getElementsByTagName("encoding");
-                        if (children != null && children.getLength() != 0)
-                        {
-                            encoding = children.item(0).getTextContent().trim();
-                            if (encoding.length() > 0)
-                            {
-                                pa.getLocaleEncodingMappings().put(convertStringToLocale(locale), encoding);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Write the deployment descriptor.
-     * @param app
-     * @throws java.io.IOException
-     */
-    public void write(PortletApplicationDefinition app, OutputStream out) throws IOException {
-        try {
-            final Object src;
-            if (PortletApplicationDefinition.JSR_168_VERSION.equals(app.getVersion()))
-            {                
-                src = new org.apache.pluto.container.om.portlet10.impl.PortletAppType(app);
-            }
-            else
-            {
-                src = app;
-            }
-            final Marshaller marshaller = this.jaxbContext.createMarshaller();
-            marshaller.setEventHandler(new DefaultValidationEventHandler());
-            marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
-            marshaller.marshal(src,out);
-        }
-        catch (JAXBException jaxbEx){
-            final IOException ioe = new IOException(jaxbEx.getMessage());
-            ioe.initCause(jaxbEx);
-            throw ioe;
-        }
-        catch(Exception me) {
-            final IOException ioe = new IOException(me.getLocalizedMessage());
-            ioe.initCause(me);
-            throw ioe;
-        }
-    }
-    
-    protected XMLInputFactory getXmlInputFactory() {
-        final ClassLoader portalClassLoader = this.getClass().getClassLoader();
-        final Thread currentThread = Thread.currentThread();
-        final ClassLoader contextClassLoader = currentThread.getContextClassLoader();
-        
-        if (portalClassLoader == contextClassLoader) {
-            return XMLInputFactory.newInstance();
-        }
-        
-        try {
-            currentThread.setContextClassLoader(portalClassLoader);
-            return XMLInputFactory.newInstance();
-        }
-        finally {
-            currentThread.setContextClassLoader(contextClassLoader);
-        }
-    }
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java
new file mode 100644
index 0000000..bd0fcb1
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationHolder.java
@@ -0,0 +1,190 @@
+/*  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.
+ */
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class processes the web app deployment descriptor and the portlet
+ * deployment descriptor files.
+ * 
+ * 
+ * @author Scott Nicklous
+ * 
+ */
+public class ConfigurationHolder {
+
+   private PortletApplicationDefinition   pad = null;
+   private ConfigurationProcessor         jcp = null;
+
+
+   /** Logger. */
+   private static final Logger          LOG          = LoggerFactory
+                                                           .getLogger(ConfigurationHolder.class);
+   private static final boolean         isDebug      = LOG.isDebugEnabled();
+
+   private static final String          JAXB_CONTEXT = "org.apache.pluto.container.om.portlet10.impl:"
+                                                           + "org.apache.pluto.container.om.portlet20.impl:"
+                                                           + "org.apache.pluto.container.om.portlet30.impl";
+
+   
+   /**
+    * Default constructor
+    */
+   public ConfigurationHolder() {
+      this.pad = new PortletApplicationDefinitionImpl();
+   }
+   /**
+    * Constructor
+    * 
+    * @param pad
+    */
+   public ConfigurationHolder(PortletApplicationDefinition pad) {
+      this.pad = pad;
+   }
+
+   /**
+    * returns the finished portlet application definition
+    * 
+    * @return  the portlet application definition
+    */
+   public PortletApplicationDefinition getPad() {
+      return pad;
+   }
+
+   /**
+    * Sets the portlet application definition to be processed
+    * 
+    * @param pad
+    */
+   public void setPad(PortletApplicationDefinition pad) {
+      this.pad = pad;
+   }
+
+   /**
+    * Processes the portlet deployment descriptor represented by the given input
+    * stream.
+    * <p>
+    * The data is merged into an existing configuration data structure if one is
+    * provided. This capability is used by version 3 portlets for merging config
+    * data from the files into config data that has been read from annotations.
+    * <p>
+    * If no existing configuration data is provides, or if a version 1.0 or
+    * version 2.0 deployment descriptor is being processed, a new configuration
+    * data structure is created.
+    * <p>
+    * The class also performs validity checking and throws exceptions for
+    * invalid data. To maintain compatibility with the earlier Pluto
+    * implementation, an <code>IllegalArgumentException</code> is thrown in such
+    * cases.
+    * 
+    * 
+    * @param stream
+    *           Input stream pointing to deployment descriptor
+    * @return The resulting portlet application definition
+    * @throws IOException
+    *            If an I/O error occurs
+    * @throws IllegalArgumentException
+    *            If data validation fails
+    * @throws XMLStreamException 
+    */
+   public void processPortletDD(InputStream stream)
+         throws IOException, IllegalArgumentException, JAXBException, XMLStreamException {
+
+      JAXBContext cntxt = JAXBContext.newInstance(JAXB_CONTEXT);
+
+      Unmarshaller um = cntxt.createUnmarshaller();
+      XMLInputFactory xif = XMLInputFactory.newFactory();
+      XMLStreamReader xsr = xif.createXMLStreamReader(stream);
+      JAXBElement<?> jel = (JAXBElement<?>) um.unmarshal(xsr);
+
+      if (jel == null) {
+         String warning = "Nothing could be unmarshalled. Stream didn't produce object";
+         LOG.warn(warning);
+         throw new IOException(warning);
+      }
+
+      if (isDebug) {
+         StringBuilder txt = new StringBuilder();
+         txt.append("Unmarshalled stream. ===> Object type: ");
+         txt.append(jel.getValue().getClass().getCanonicalName());
+         LOG.debug(txt.toString());
+      }
+      
+      if (jel.getValue() instanceof 
+            org.apache.pluto.container.om.portlet10.impl.PortletAppType) {
+
+         // Ignore existing config data for 1.0 portlets 
+         pad = new PortletApplicationDefinitionImpl();
+         jcp = new JSR168ConfigurationProcessor();
+         
+      } else if (jel.getValue() instanceof 
+            org.apache.pluto.container.om.portlet20.impl.PortletAppType) {
+         
+         // Ignore existing config data for 2.0 portlets
+         pad = new PortletApplicationDefinitionImpl();
+         jcp = new JSR286ConfigurationProcessor();
+         
+      } else if (jel.getValue() instanceof 
+            org.apache.pluto.container.om.portlet30.impl.PortletAppType) {
+
+         // for v3, let config data from DD overwrite existing data from annotations
+         if (pad == null) {
+            pad = new PortletApplicationDefinitionImpl();
+         }
+         jcp = new JSR362ConfigurationProcessor();
+         
+      } else {
+         String warning = "Unknown application type: " + 
+               jel.getValue().getClass().getCanonicalName();
+         LOG.warn(warning);
+         throw new IOException(warning);
+      }
+
+      pad = jcp.process(jel);
+
+   }
+   
+   /**
+    * extracts the locale-encoding mapping from the web deployment descriptor
+    * 
+    * @param in   Input stream for the web DD
+    * @throws Exception 
+    */
+   public void processWebDD(InputStream in) throws Exception {
+      if (jcp == null) {
+         jcp = new JSR286ConfigurationProcessor();
+      }
+      jcp.processWebDD(in, pad);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationProcessor.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationProcessor.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationProcessor.java
new file mode 100644
index 0000000..455f9e9
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationProcessor.java
@@ -0,0 +1,161 @@
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.io.InputStream;
+import java.util.Arrays;
+import java.util.Locale;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpression;
+import javax.xml.xpath.XPathFactory;
+
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public abstract class ConfigurationProcessor {
+   
+   
+   /** Logger. */
+   private static final Logger LOG = LoggerFactory
+         .getLogger(ConfigurationProcessor.class);
+   
+
+   /**
+    * Traverses the portlet deployment descriptor tree and returns the data in
+    * the form of a portlet application definition.
+    * 
+    * @param rootElement
+    *           Root element of portlet DD tree
+    * @return The parsed portlet application definition
+    * @throws IllegalArgumentException
+    *            If there is a data validation error
+    */
+   public abstract PortletApplicationDefinition process(
+         JAXBElement<?> rootElement) throws IllegalArgumentException;
+
+   /**
+    * Handle the locale the old-fashioned way (v1 & v2)
+    */
+   protected Locale deriveLocale(String lang) {
+      Locale locale = Locale.ENGLISH;
+      if (lang != null) {
+         if (lang.contains("_") == true) {
+
+            // tolerate underscores to support old portlets
+            String[] parts = lang.split("_");
+            if (parts.length == 2) {
+               locale = new Locale(parts[0], parts[1]);
+            } else {
+               locale = new Locale(parts[0], parts[1], parts[2]);
+            }
+
+         } else {
+            locale = Locale.forLanguageTag(lang);     //BCP47
+         }
+      }
+      return locale;
+   }
+
+   /**
+    * Check if input string is valid java identifier
+    * 
+    * @param id
+    * @return
+    */
+   protected boolean isValidIdentifier(String id) {
+      char[] chars = id.toCharArray();
+      if (!Character.isJavaIdentifierStart(chars[0])) {
+         return false;
+      }
+      for (char c : Arrays.copyOfRange(chars, 1, chars.length)) {
+         if (!Character.isJavaIdentifierPart(c) && (c != '.')) {
+            return false;
+         }
+      }
+      return true;
+   }
+
+   /**
+    * checks if class name is valid by trying to load it. If the optional
+    * argument <code>assignable</code> is provided, the method will check if the
+    * class can be assigned.
+    * 
+    * @param clsName
+    *           Class name string from configuration
+    * @param assignable
+    *           Interface to which the class should be assignable
+    * @param msg
+    *           Error message used when exception is thrown.
+    */
+   protected void checkValidClass(String clsName, Class<?> assignable, String msg) {
+   
+      StringBuilder txt = new StringBuilder(128);
+      txt.append(msg);
+      txt.append(clsName);
+      if (!isValidIdentifier(clsName)) {
+         txt.append(". Invalid java identifier.");
+         LOG.warn(txt.toString());
+         throw new IllegalArgumentException(txt.toString());
+      }
+   
+      // Make sure the class can be loaded
+      Class<?> valClass = null;
+      try {
+         ClassLoader cl = this.getClass().getClassLoader();
+         valClass = cl.loadClass(clsName);
+         if (assignable != null && !assignable.isAssignableFrom(valClass)) {
+            txt.append(". Specified class is not a ");
+            txt.append(assignable.getCanonicalName());
+            throw new Exception();
+         }
+      } catch (Exception e) {
+         LOG.warn(txt.toString());
+         throw new IllegalArgumentException(txt.toString(), e);
+      }
+   }
+   
+   /**
+    * Reads web app deployment descriptor to extract the locale - encoding mappings 
+    * 
+    * @param in            Input stream for DD
+    * @param pad           Portlet application definition to be updated
+    * @throws Exception    If there is a parsing problem
+    */
+   public void processWebDD(InputStream in, PortletApplicationDefinition pad) throws Exception {
+
+      // set up document
+      DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
+      final DocumentBuilder builder = fact.newDocumentBuilder();
+      final Document document = builder.parse(in);
+      final Element root = document.getDocumentElement();
+
+      // Generate xpath queries
+      final XPathFactory xpathFactory = XPathFactory.newInstance();
+      final XPath xpath = xpathFactory.newXPath();
+      final XPathExpression GET_LIST = 
+            xpath.compile("//locale-encoding-mapping-list/locale-encoding-mapping");
+      final XPathExpression GET_LOC = xpath.compile("locale/text()");
+      final XPathExpression GET_ENC = xpath.compile("encoding/text()");
+
+      // get list of locale - encoding mappings and process them
+      NodeList nodes = (NodeList) GET_LIST.evaluate(root,
+            XPathConstants.NODESET);
+
+      for (int jj = 0; jj < nodes.getLength(); jj++) {
+         Node node = nodes.item(jj);
+         String locstr = (String) GET_LOC.evaluate(node, XPathConstants.STRING);
+         String encstr = (String) GET_ENC.evaluate(node, XPathConstants.STRING);
+         Locale locale = deriveLocale(locstr);
+         pad.addLocaleEncodingMapping(locale, encstr);
+      }
+   }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ContainerRuntimeOptionImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ContainerRuntimeOptionImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ContainerRuntimeOptionImpl.java
new file mode 100644
index 0000000..a99616f
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ContainerRuntimeOptionImpl.java
@@ -0,0 +1,81 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.pluto.container.om.portlet.ContainerRuntimeOption;
+
+/**
+ * Represents a single container runtime option
+ * 
+ * @author Scott Nicklous
+ *
+ */
+public class ContainerRuntimeOptionImpl implements ContainerRuntimeOption {
+   
+   private String name;
+   private final ArrayList<String> values = new ArrayList<String>();
+   
+   /**
+    * Constructs container rt options object
+    * @param name    Runtime option name
+    * @param vals    Runtime option value
+    */
+   public ContainerRuntimeOptionImpl(String name, List<String> vals) {
+      this.name = name;
+      values.addAll(vals);
+   }
+   
+   /**
+    * Copy constructor
+    * @param croi
+    */
+   public ContainerRuntimeOptionImpl(ContainerRuntimeOption croi) {
+      this.name = croi.getName();
+      values.addAll(croi.getValues());
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.ContainerRuntimeOption#getName()
+    */
+   @Override
+   public String getName() {
+      return name;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.ContainerRuntimeOption#getValues()
+    */
+   @Override
+   public List<String> getValues() {
+      return new ArrayList<String>(values);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.ContainerRuntimeOption#addValue(java.lang.String)
+    */
+   @Override
+   public void addValue(String value) {
+      values.add(value);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/CustomPortletModeImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/CustomPortletModeImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/CustomPortletModeImpl.java
new file mode 100644
index 0000000..ad3a3ad
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/CustomPortletModeImpl.java
@@ -0,0 +1,124 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.CustomPortletMode;
+import org.apache.pluto.container.om.portlet.Description;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class CustomPortletModeImpl implements CustomPortletMode {
+   
+   private String pm;
+   private boolean managed;
+   private final List<Description> descs = new ArrayList<Description>();
+
+   /**
+    * constructor
+    */
+   public CustomPortletModeImpl(String cpm) {
+      pm = cpm;
+      managed = true;
+   }
+   
+   /**
+    * Copy constructor
+    */
+   public CustomPortletModeImpl(CustomPortletMode cpm) {
+      pm = cpm.getPortletMode();
+      managed = cpm.isPortalManaged();
+      for (Description desc : cpm.getDescriptions()) {
+         descs.add(new DescriptionImpl(desc));
+      }
+   }
+   
+   /**
+    * Constructor
+    * @param pm      portlet mode name
+    * @param mngd    portal managed flag
+    * @param descs   description map
+    */
+   public CustomPortletModeImpl(String pm, boolean mngd, List<Description> descs) {
+      this.pm = pm;
+      this.managed = mngd;
+      this.descs.addAll(descs);
+   }
+   
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.CustomPortletMode#getPortletMode()
+    */
+   @Override
+   public String getPortletMode() {
+      return pm;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.CustomPortletMode#isPortalManaged()
+    */
+   @Override
+   public boolean isPortalManaged() {
+      return managed;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.CustomPortletMode#setPortalManaged(boolean)
+    */
+   @Override
+   public void setPortalManaged(boolean portalManaged) {
+      managed = portalManaged;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.CustomPortletMode#getDescription(java.util.Locale)
+    */
+   @Override
+   public Description getDescription(Locale locale) {
+      Description ret = null;
+      for (Description item : descs) {
+         if (item.getLocale().equals(locale)) {
+            ret = new DescriptionImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.CustomPortletMode#getDescriptions()
+    */
+   @Override
+   public List<Description> getDescriptions() {
+      return new ArrayList<Description>(descs);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.CustomPortletMode#addDescription(Description)
+    */
+   @Override
+   public void addDescription(Description desc) {
+      descs.add(desc);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/CustomWindowStateImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/CustomWindowStateImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/CustomWindowStateImpl.java
new file mode 100644
index 0000000..0c6d311
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/CustomWindowStateImpl.java
@@ -0,0 +1,104 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.CustomWindowState;
+import org.apache.pluto.container.om.portlet.Description;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class CustomWindowStateImpl implements CustomWindowState {
+   
+   private String ws;
+   private final List<Description> descs = new ArrayList<Description>();
+
+   /**
+    * constructor
+    */
+   public CustomWindowStateImpl(String cws) {
+      ws = cws;
+   }
+   
+   /**
+    * Copy constructor
+    */
+   public CustomWindowStateImpl(CustomWindowState cws) {
+      ws = cws.getWindowState();
+      for (Description desc : cws.getDescriptions()) {
+         descs.add(new DescriptionImpl(desc));
+      }
+   }
+   
+   /**
+    * Constructor
+    * @param ws      portlet mode name
+    * @param mngd    portal managed flag
+    * @param descs   description map
+    */
+   public CustomWindowStateImpl(String ws, List<Description> descs) {
+      this.ws = ws;
+      this.descs.addAll(descs);
+   }
+   
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.CustomWindowState#getWindowState()
+    */
+   @Override
+   public String getWindowState() {
+      return ws;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.CustomWindowState#getDescription(java.util.Locale)
+    */
+   @Override
+   public Description getDescription(Locale locale) {
+      Description ret = null;
+      for (Description item : descs) {
+         if (item.getLocale().equals(locale)) {
+            ret = new DescriptionImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.CustomWindowState#getDescriptions()
+    */
+   @Override
+   public List<Description> getDescriptions() {
+      return new ArrayList<Description>(descs);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.CustomWindowState#addDescription(Description)
+    */
+   @Override
+   public void addDescription(Description desc) {
+      descs.add(desc);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/DescriptionImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/DescriptionImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/DescriptionImpl.java
new file mode 100644
index 0000000..dd7c258
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/DescriptionImpl.java
@@ -0,0 +1,100 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.Description;
+
+/**
+ * A single locale-specific description
+ * 
+ * @author Scott Nicklous
+ *
+ */
+public class DescriptionImpl implements Description {
+   
+   private Locale locale;
+   private String desc;
+   
+   /**
+    * default: lang = english
+    */
+   public DescriptionImpl() {
+      locale = Locale.ENGLISH;
+      desc = "";
+   }
+   
+   /**
+    * Constructor
+    * @param locale     Locale language tag according to BCP 47
+    * @param disp       description string
+    */
+   public DescriptionImpl(Locale locale, String desc) {
+      this.locale = locale;
+      this.desc = desc;
+   }
+   
+   /**
+    * Copy constructor
+    */
+   public DescriptionImpl(Description di) {
+      this.locale = (Locale) di.getLocale().clone();
+      this.desc = di.getDescription();
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Description#getLang()
+    */
+   @Override
+   public String getLang() {
+      return locale.toLanguageTag();
+   }
+   
+   @Override
+   public void setLang(String lang) {
+      this.locale = Locale.forLanguageTag(lang);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Description#getDescription()
+    */
+   @Override
+   public String getDescription() {
+      return desc;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Description#setDescription(java.lang.String)
+    */
+   @Override
+   public void setDescription(String description) {
+      desc = description;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Description#getLocale()
+    */
+   @Override
+   public Locale getLocale() {
+      return Locale.forLanguageTag(locale.toLanguageTag());
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/DisplayNameImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/DisplayNameImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/DisplayNameImpl.java
new file mode 100644
index 0000000..89171a2
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/DisplayNameImpl.java
@@ -0,0 +1,95 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.DisplayName;
+
+/**
+ * A single locale-specific display name
+ * 
+ * @author Scott Nicklous
+ *
+ */
+public class DisplayNameImpl implements DisplayName {
+   
+   private Locale locale;
+   private String disp;
+   
+   /**
+    * default: lang = english
+    */
+   public DisplayNameImpl() {
+      locale = Locale.ENGLISH;
+      disp = "";
+   }
+   
+   /**
+    * Constructor
+    * @param locale     Locale language tag according to BCP 47
+    * @param disp       description string
+    */
+   public DisplayNameImpl(Locale locale, String desc) {
+      this.locale = locale;
+      this.disp = desc;
+   }
+   
+   /**
+    * Copy constructor
+    */
+   public DisplayNameImpl(DisplayName di) {
+      this.locale = (Locale) di.getLocale().clone();
+      this.disp = di.getDisplayName();
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.DisplayName#getLang()
+    */
+   @Override
+   public String getLang() {
+      return locale.toLanguageTag();
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.DisplayName#getDisplayName()
+    */
+   @Override
+   public String getDisplayName() {
+      return disp;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.DisplayName#setDisplayName(java.lang.String)
+    */
+   @Override
+   public void setDisplayName(String description) {
+      disp = description;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.DisplayName#getLocale()
+    */
+   @Override
+   public Locale getLocale() {
+      return (Locale) locale.clone();
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/EventDefinitionImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/EventDefinitionImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/EventDefinitionImpl.java
new file mode 100644
index 0000000..d932fbf
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/EventDefinitionImpl.java
@@ -0,0 +1,179 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import javax.xml.namespace.QName;
+
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.DisplayName;
+import org.apache.pluto.container.om.portlet.EventDefinition;
+
+/**
+ * A single event declaration
+ * 
+ * @author Scott Nicklous
+ */
+public class EventDefinitionImpl implements EventDefinition {
+   
+   private QName qn;
+   private final ArrayList<QName> aliases = new ArrayList<QName>();
+   private final List<Description> descs = new ArrayList<Description>();
+   private final List<DisplayName> dispNames = new ArrayList<DisplayName>();
+   private String valType = "";
+
+   /**
+    * Copy constructor
+    * @param edi
+    */
+   public EventDefinitionImpl(EventDefinition edi) {
+      this.qn = new QName(edi.getQName().getNamespaceURI(), edi.getQName().getLocalPart());
+      this.valType = edi.getValueType();
+      for (QName qn : edi.getAliases()) {
+         this.aliases.add(new QName(qn.getNamespaceURI(), qn.getLocalPart()));
+      }
+      for (Description desc : edi.getDescriptions()) {
+         descs.add(new DescriptionImpl(desc));
+      }
+      for (DisplayName disp : edi.getDisplayNames()) {
+         dispNames.add(new DisplayNameImpl(disp));
+      }
+   }
+   
+   /**
+    * Basic constructor
+    * @param qn
+    */
+   public EventDefinitionImpl(QName qn) {
+      this.qn = qn;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.EventDefinition#getQName()
+    */
+   @Override
+   public QName getQName() {
+      return qn;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.EventDefinition#setQName(javax.xml.namespace.QName)
+    */
+   @Override
+   public void setQName(QName qn) {
+      this.qn = qn;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.EventDefinition#getAliases()
+    */
+   @Override
+   public List<QName> getAliases() {
+      return new ArrayList<QName>(aliases);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.EventDefinition#addAlias(javax.xml.namespace.QName)
+    */
+   @Override
+   public void addAlias(QName qName) {
+      aliases.add(qName);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.EventDefinition#getDescription(java.util.Locale)
+    */
+   @Override
+   public Description getDescription(Locale locale) {
+      Description ret = null;
+      for (Description item : descs) {
+         if (item.getLocale().equals(locale)) {
+            ret = new DescriptionImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.EventDefinition#getDescriptions()
+    */
+   @Override
+   public List<Description> getDescriptions() {
+      return new ArrayList<Description>(descs);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.EventDefinition#addDescription(org.apache.pluto.container.om.portlet.Description)
+    */
+   @Override
+   public void addDescription(Description desc) {
+      descs.add(desc);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.EventDefinition#getDisplayName(java.util.Locale)
+    */
+   @Override
+   public DisplayName getDisplayName(Locale locale) {
+      DisplayName ret = null;
+      for (DisplayName item : dispNames) {
+         if (item.getLocale().equals(locale)) {
+            ret = new DisplayNameImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.EventDefinition#getDisplayNames()
+    */
+   @Override
+   public List<DisplayName> getDisplayNames() {
+      return new ArrayList<DisplayName>(dispNames);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.EventDefinition#addDisplayName(org.apache.pluto.container.om.portlet.DisplayName)
+    */
+   @Override
+   public void addDisplayName(DisplayName desc) {
+      dispNames.add(desc);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.EventDefinition#getValueType()
+    */
+   @Override
+   public String getValueType() {
+      return valType;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.EventDefinition#setValueType(java.lang.String)
+    */
+   @Override
+   public void setValueType(String valueType) {
+      valType = valueType;
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/EventDefinitionReferenceImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/EventDefinitionReferenceImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/EventDefinitionReferenceImpl.java
new file mode 100644
index 0000000..bcdc4b3
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/EventDefinitionReferenceImpl.java
@@ -0,0 +1,70 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import javax.xml.namespace.QName;
+
+import org.apache.pluto.container.om.portlet.EventDefinitionReference;
+
+/**
+ * Reference to an event definition
+ * 
+ * @author Scott Nicklous
+ *
+ */
+public class EventDefinitionReferenceImpl implements EventDefinitionReference {
+
+   private QName qname;
+
+   
+   /**
+    * Copy Constructor
+    * @param edri
+    */
+   public EventDefinitionReferenceImpl(EventDefinitionReference edri) {
+      QName qn = edri.getQualifiedName();
+      this.qname = new QName(qn.getNamespaceURI(), qn.getLocalPart());
+   }
+   
+   /**
+    * Constructor
+    * @param qname
+    */
+   public EventDefinitionReferenceImpl(QName qname) {
+      this.qname = qname;
+   }
+   
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.EventDefinitionReference#getQualifiedName()
+    */
+   @Override
+   public QName getQualifiedName() {
+      return qname;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.EventDefinitionReference#setQualifiedName(javax.xml.namespace.QName)
+    */
+   @Override
+   public void setQualifiedName(QName qn) {
+      this.qname = qn;
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/FilterImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/FilterImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/FilterImpl.java
new file mode 100644
index 0000000..6f3d53d
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/FilterImpl.java
@@ -0,0 +1,194 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.DisplayName;
+import org.apache.pluto.container.om.portlet.Filter;
+import org.apache.pluto.container.om.portlet.InitParam;
+
+/**
+ * A single event declaration
+ * 
+ * @author Scott Nicklous
+ */
+public class FilterImpl implements Filter {
+   
+   private final String filterName;
+   private final ArrayList<String> lifecycles = new ArrayList<String>();
+   private final List<Description> descs = new ArrayList<Description>();
+   private final List<DisplayName> dispNames = new ArrayList<DisplayName>();
+   private final Map<String, InitParam> initParams = new HashMap<String, InitParam>();
+   private String fclass = "";
+   
+   
+   /**
+    * Copy constructor
+    * @param fi
+    */
+   public FilterImpl(Filter fi) {
+      this.filterName = fi.getFilterName();
+      this.fclass = fi.getFilterClass();
+      
+      for (String lc : fi.getLifecycles()) {
+         this.lifecycles.add(new String(lc));
+      }
+      for (Description desc : fi.getDescriptions()) {
+         descs.add(new DescriptionImpl(desc));
+      }
+      for (DisplayName disp : fi.getDisplayNames()) {
+         dispNames.add(new DisplayNameImpl(disp));
+      }
+      for (InitParam ip : fi.getInitParams()) {
+         this.initParams.put(ip.getParamName(), new InitParamImpl(ip));
+      }
+
+   }
+
+   /**
+    * Constructor
+    * @param fn   Filter name
+    */
+   public FilterImpl(String fn) {
+      this.filterName = fn;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Filter#getFilterName()
+    */
+   @Override
+   public String getFilterName() {
+      return filterName;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Filter#getLifecycles()
+    */
+   @Override
+   public List<String> getLifecycles() {
+      return new ArrayList<String>(lifecycles);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Filter#addAlias(javax.xml.namespace.QName)
+    */
+   @Override
+   public void addLifecycle(String lc) {
+      lifecycles.add(lc);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Filter#getDescription(java.util.Locale)
+    */
+   @Override
+   public Description getDescription(Locale locale) {
+      Description ret = null;
+      for (Description item : descs) {
+         if (item.getLocale().equals(locale)) {
+            ret = new DescriptionImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Filter#getDescriptions()
+    */
+   @Override
+   public List<Description> getDescriptions() {
+      return new ArrayList<Description>(descs);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Filter#addDescription(org.apache.pluto.container.om.portlet.Description)
+    */
+   @Override
+   public void addDescription(Description desc) {
+      descs.add(desc);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Filter#getDisplayName(java.util.Locale)
+    */
+   @Override
+   public DisplayName getDisplayName(Locale locale) {
+      DisplayName ret = null;
+      for (DisplayName item : dispNames) {
+         if (item.getLocale().equals(locale)) {
+            ret = new DisplayNameImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Filter#getDisplayNames()
+    */
+   @Override
+   public List<DisplayName> getDisplayNames() {
+      return new ArrayList<DisplayName>(dispNames);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Filter#addDisplayName(org.apache.pluto.container.om.portlet.DisplayName)
+    */
+   @Override
+   public void addDisplayName(DisplayName desc) {
+      dispNames.add(desc);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Filter#getFilterClass()
+    */
+   @Override
+   public String getFilterClass() {
+      return fclass;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.Filter#setFilterClass(java.lang.String)
+    */
+   @Override
+   public void setFilterClass(String filterClass) {
+      fclass = filterClass;
+   }
+
+   @Override
+   public InitParam getInitParam(String paramName) {
+      return initParams.get(paramName);
+   }
+
+   @Override
+   public List<InitParam> getInitParams() {
+      return new ArrayList<InitParam>(initParams.values());
+   }
+
+   @Override
+   public void addInitParam(InitParam ip) {
+      initParams.put(ip.getParamName(),  ip);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/FilterMappingImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/FilterMappingImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/FilterMappingImpl.java
new file mode 100644
index 0000000..2b46787
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/FilterMappingImpl.java
@@ -0,0 +1,78 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.pluto.container.om.portlet.FilterMapping;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class FilterMappingImpl implements FilterMapping {
+   
+   private String filterName;
+   
+   ArrayList<String> portletNames = new ArrayList<String>();
+   
+   /**
+    * Copy constructor
+    * @param fm
+    */
+   public FilterMappingImpl(FilterMapping fm) {
+      this.filterName = fm.getFilterName();
+      this.portletNames.addAll(fm.getPortletNames());
+   }
+   
+   /**
+    * Constructor
+    * @param filterName the filter name
+    */
+   public FilterMappingImpl(String filterName) {
+      this.filterName = filterName;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.FilterMapping#getFilterName()
+    */
+   @Override
+   public String getFilterName() {
+      return filterName;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.FilterMapping#getPortletNames()
+    */
+   @Override
+   public List<String> getPortletNames() {
+      return new ArrayList<String>(portletNames);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.FilterMapping#addPortletName(java.lang.String)
+    */
+   @Override
+   public void addPortletName(String portletName) {
+      portletNames.add(portletName);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/InitParamImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/InitParamImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/InitParamImpl.java
new file mode 100644
index 0000000..ab9b310
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/InitParamImpl.java
@@ -0,0 +1,118 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.InitParam;
+
+/**
+ * Init parameters for filters and portlets
+ * 
+ * @author Scott Nicklous
+ *
+ */
+public class InitParamImpl implements InitParam {
+   
+   private String name;
+   private String value;
+   private final List<Description> descs = new ArrayList<Description>();
+   
+   /**
+    * Copy Constructor
+    * 
+    * @param ipi
+    */
+   public InitParamImpl(InitParam ipi) {
+      name = ipi.getParamName();
+      value = ipi.getParamValue();
+      for (Description desc : ipi.getDescriptions()) {
+         descs.add(new DescriptionImpl(desc));
+      }
+   }
+   
+   /**
+    * Constructor
+    * @param name    init parameter name
+    * @param value   init parameter value
+    */
+   public InitParamImpl(String name, String value) {
+      this.name = name;
+      this.value = value;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.InitParam#getParamName()
+    */
+   @Override
+   public String getParamName() {
+      return name;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.InitParam#getParamValue()
+    */
+   @Override
+   public String getParamValue() {
+      return value;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.InitParam#setParamValue(java.lang.String)
+    */
+   @Override
+   public void setParamValue(String paramValue) {
+      this.value = paramValue;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.InitParam#getDescription(java.util.Locale)
+    */
+   @Override
+   public Description getDescription(Locale locale) {
+      Description ret = null;
+      for (Description item : descs) {
+         if (item.getLocale().equals(locale)) {
+            ret = new DescriptionImpl(item);
+         }
+      }
+      return ret;
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.InitParam#getDescriptions()
+    */
+   @Override
+   public List<Description> getDescriptions() {
+      return new ArrayList<Description>(descs);
+   }
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.InitParam#addDescription(org.apache.pluto.container.om.portlet.Description)
+    */
+   @Override
+   public void addDescription(Description desc) {
+      descs.add(desc);
+   }
+
+}


[09/38] portals-pluto git commit: Replaced code that reads the deployment descriptor with an implementation that can be better extended to add v3.0 support. Added test cases. Uses jaxb binding classes that are generated at compile time.

Posted by ms...@apache.org.
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/UserDataConstraintType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/UserDataConstraintType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/UserDataConstraintType.java
deleted file mode 100644
index dccacc2..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/UserDataConstraintType.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.Description;
-import org.apache.pluto.container.om.portlet.UserDataConstraint;
-
-/**
- * The user-data-constraintType is used to indicate how data communicated between the client and portlet should be
- * protected. Used in: security-constraint <p>Java class for user-data-constraintType complex type. <p>The following
- * schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;user-data-constraintType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;transport-guarantee&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}transport-guaranteeType&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "user-data-constraintType", propOrder = { "description", "transportGuarantee" })
-public class UserDataConstraintType implements UserDataConstraint
-{
-    @XmlElement(name = "description")
-    protected List<DescriptionType> description;
-    @XmlElement(name = "transport-guarantee", required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String transportGuarantee;
-
-    public Description getDescription(Locale locale)
-    {
-        for (Description d : getDescriptions())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Description> getDescriptions()
-    {
-        if (description == null)
-        {
-            description = new ArrayList<DescriptionType>();
-        }
-        return description;
-    }
-    
-    public Description addDescription(String lang)
-    {
-        DescriptionType d = new DescriptionType();
-        d.setLang(lang);
-        if (getDescription(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
-        }
-        getDescriptions();
-        description.add(d);
-        return d;
-    }
-
-    public String getTransportGuarantee()
-    {
-        return transportGuarantee;
-    }
-
-    public void setTransportGuarantee(String value)
-    {
-        transportGuarantee = value;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/package-info.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/package-info.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/package-info.java
deleted file mode 100644
index 6796276..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/package-info.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.
- * 
- * @version $Id$
- */
-@javax.xml.bind.annotation.XmlSchema(namespace = "http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
-package org.apache.pluto.container.om.portlet20.impl;
-

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/ContainerRuntimeOptionType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/ContainerRuntimeOptionType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/ContainerRuntimeOptionType.java
deleted file mode 100644
index 0f75ef3..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/ContainerRuntimeOptionType.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.ContainerRuntimeOption;
-
-/**
- * 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 <p>Java class
- * for container-runtime-optionType complex type. <p>The following schema fragment specifies the expected content
- * contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;container-runtime-optionType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}nameType&quot;/&gt;
- *         &lt;element name=&quot;value&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}valueType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "container-runtime-optionType", propOrder = { "name", "value" })
-public class ContainerRuntimeOptionType implements ContainerRuntimeOption
-{
-    @XmlElement(required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String name;
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected List<String> value;
-
-    public String getName()
-    {
-        return name;
-    }
-
-    public void setName(String value)
-    {
-        name = value;
-    }
-
-    public List<String> getValues()
-    {
-        if (value == null)
-        {
-            value = new ArrayList<String>();
-        }
-        return value;
-    }
-
-    public void addValue(String value)
-    {
-        getValues().add(value);
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/CustomPortletModeType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/CustomPortletModeType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/CustomPortletModeType.java
deleted file mode 100644
index 6499712..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/CustomPortletModeType.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.CustomPortletMode;
-import org.apache.pluto.container.om.portlet.Description;
-
-/**
- * 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 <p>Java class for custom-portlet-modeType complex type.
- * <p>The following schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;custom-portlet-modeType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;portlet-mode&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-modeType&quot;/&gt;
- *         &lt;element name=&quot;portal-managed&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portal-managedType&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "custom-portlet-modeType", propOrder = { "description", "portletMode", "portalManaged" })
-public class CustomPortletModeType implements CustomPortletMode
-{
-    @XmlElement(name = "description")
-    protected List<DescriptionType> description;
-    @XmlElement(name = "portlet-mode", required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String portletMode;
-    @XmlElement(name = "portal-managed")
-    protected Boolean portalManaged;
-    
-    public Description getDescription(Locale locale)
-    {
-        for (Description d : getDescriptions())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Description> getDescriptions()
-    {
-        if (description == null)
-        {
-            description = new ArrayList<DescriptionType>();
-        }
-        return description;
-    }
-    
-    public Description addDescription(String lang)
-    {
-        DescriptionType d = new DescriptionType();
-        d.setLang(lang);
-        if (getDescription(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
-        }
-        getDescriptions();
-        description.add(d);
-        return d;
-    }
-
-    public String getPortletMode()
-    {
-        return portletMode != null ? portletMode.toLowerCase() : null;
-    }
-
-    public void setPortletMode(String value)
-    {
-        portletMode = value.toLowerCase();
-    }
-
-    public boolean isPortalManaged()
-    {
-        return portalManaged != null ? portalManaged.booleanValue() : true;
-    }
-
-    public void setPortalManaged(boolean value)
-    {
-        portalManaged = value ? Boolean.TRUE : Boolean.FALSE;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/CustomWindowStateType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/CustomWindowStateType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/CustomWindowStateType.java
deleted file mode 100644
index 80a1c92..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/CustomWindowStateType.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.CustomWindowState;
-import org.apache.pluto.container.om.portlet.Description;
-
-/**
- * A custom window state that one or more portlets in this portlet application supports. Used in: portlet-app <p>Java
- * class for custom-window-stateType complex type. <p>The following schema fragment specifies the expected content
- * contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;custom-window-stateType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;window-state&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}window-stateType&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "custom-window-stateType", propOrder = { "description", "windowState" })
-public class CustomWindowStateType implements CustomWindowState
-{
-    @XmlElement(name = "description")
-    protected List<DescriptionType> description;
-    @XmlElement(name = "window-state", required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String windowState;
-
-    public Description getDescription(Locale locale)
-    {
-        for (Description d : getDescriptions())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Description> getDescriptions()
-    {
-        if (description == null)
-        {
-            description = new ArrayList<DescriptionType>();
-        }
-        return description;
-    }
-    
-    public Description addDescription(String lang)
-    {
-        DescriptionType d = new DescriptionType();
-        d.setLang(lang);
-        if (getDescription(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
-        }
-        getDescriptions();
-        description.add(d);
-        return d;
-    }
-
-    public String getWindowState()
-    {
-        return windowState != null ? windowState.toLowerCase() : null;
-    }
-
-    public void setWindowState(String value)
-    {
-        windowState = value.toLowerCase();
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/DescriptionType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/DescriptionType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/DescriptionType.java
deleted file mode 100644
index 6c86768..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/DescriptionType.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlValue;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.Description;
-
-/**
- * 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(“en�?). Used in: init-param,
- * portlet, portlet-app, security-role <p>Java class for descriptionType complex type. <p>The following schema
- * fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;descriptionType&quot;&gt;
- *   &lt;simpleContent&gt;
- *     &lt;extension base=&quot;&lt;http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd&gt;string&quot;&gt;
- *       &lt;attribute ref=&quot;{http://www.w3.org/XML/1998/namespace}lang&quot;/&gt;
- *     &lt;/extension&gt;
- *   &lt;/simpleContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "descriptionType", propOrder = { "value" })
-public class DescriptionType implements Description
-{
-    @XmlValue
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String value;
-    @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace")
-    protected String lang = null;
-    @XmlTransient
-    protected Locale locale;
-
-    public String getDescription()
-    {
-        return value;
-    }
-
-    public void setDescription(String value)
-    {
-        this.value = value;
-    }
-
-    public String getLang()
-    {
-        return lang == null ? Locale.ENGLISH.toString() : lang;
-    }
-
-    public void setLang(String value)
-    {
-        lang = value;
-        deriveLocale();
-    }
-    
-    public Locale getLocale()
-    {
-        return locale == null ? deriveLocale() : locale;
-    }
-    
-    protected Locale deriveLocale()
-    {
-        Locale locale = null;
-        String lang = this.getLang();
-        if (lang != null)
-        {
-            String country = "";
-            String variant = "";
-            String[] localeArray = lang.split("[-|_]");
-            for (int i = 0; i < localeArray.length; i++)
-            {
-                if (i == 0)
-                {
-                    lang = localeArray[i];
-                }
-                else if (i == 1)
-                {
-                    country = localeArray[i];
-                }
-                else if (i == 2)
-                {
-                    variant = localeArray[i];
-                }
-            }
-            locale = new Locale(lang, country, variant);
-        }
-        return this.locale = locale;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/DisplayNameType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/DisplayNameType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/DisplayNameType.java
deleted file mode 100644
index ae3fbbd..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/DisplayNameType.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlValue;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.DisplayName;
-
-/**
- * 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: ...
- * 
- * <pre>
- * &lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;display-name xmlns="http://www.w3.org/2001/XMLSchema" xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="en"&gt;Employee Self Service&lt;/display-name&gt;
- * </pre>
- * 
- * 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(“en�?). <p>Java class for
- * display-nameType complex type. <p>The following schema fragment specifies the expected content contained within this
- * class.
- * 
- * <pre>
- * &lt;complexType name=&quot;display-nameType&quot;&gt;
- *   &lt;simpleContent&gt;
- *     &lt;extension base=&quot;&lt;http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd&gt;string&quot;&gt;
- *       &lt;attribute ref=&quot;{http://www.w3.org/XML/1998/namespace}lang&quot;/&gt;
- *     &lt;/extension&gt;
- *   &lt;/simpleContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "display-nameType", propOrder = { "value" })
-public class DisplayNameType implements DisplayName
-{
-    @XmlValue
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String value;
-    @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace")
-    protected String lang = null;
-    @XmlTransient
-    protected Locale locale;
-
-    public String getDisplayName()
-    {
-        return value;
-    }
-
-    public void setDisplayName(String value)
-    {
-        this.value = value;
-    }
-
-    public String getLang()
-    {
-        return lang == null ? Locale.ENGLISH.toString() : lang;
-    }
-
-    public void setLang(String value)
-    {
-        lang = value;
-    }
-
-    public Locale getLocale()
-    {
-        return locale == null ? deriveLocale() : locale;
-    }
-    
-    protected Locale deriveLocale()
-    {
-        Locale locale = null;
-        String lang = this.getLang();
-        if (lang != null)
-        {
-            String country = "";
-            String variant = "";
-            String[] localeArray = lang.split("[-|_]");
-            for (int i = 0; i < localeArray.length; i++)
-            {
-                if (i == 0)
-                {
-                    lang = localeArray[i];
-                }
-                else if (i == 1)
-                {
-                    country = localeArray[i];
-                }
-                else if (i == 2)
-                {
-                    variant = localeArray[i];
-                }
-            }
-            locale = new Locale(lang, country, variant);
-        }
-        return this.locale = locale;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/EventDefinitionReferenceType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/EventDefinitionReferenceType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/EventDefinitionReferenceType.java
deleted file mode 100644
index 81679fa..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/EventDefinitionReferenceType.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import javax.xml.namespace.QName;
-
-import org.apache.pluto.container.om.portlet.EventDefinitionReference;
-
-/**
- * The event-definition-referenceType is used to reference events declared with the event-definition element at
- * application level. Used in: portlet <p>Java class for event-definition-referenceType complex type. <p>The following
- * schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;event-definition-referenceType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;choice&gt;
- *         &lt;element name=&quot;qname&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}QName&quot;/&gt;
- *         &lt;element name=&quot;name&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}NCName&quot;/&gt;
- *       &lt;/choice&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "event-definition-referenceType", propOrder = { "qname", "name" })
-public class EventDefinitionReferenceType implements EventDefinitionReference
-{
-    protected QName qname;
-    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
-    @XmlSchemaType(name = "NCName")
-    protected String name;
-
-    public QName getQName()
-    {
-        return qname;
-    }
-
-    public void setQName(QName value)
-    {
-        qname = value;
-        name = null;
-    }
-
-    public String getName()
-    {
-        return name;
-    }
-
-    public void setName(String value)
-    {
-        name = value;
-        qname = null;
-    }
-
-    public QName getQualifiedName(String defaultNamespace)
-    {
-        return qname != null ? qname : name != null ? new QName(defaultNamespace, name) : null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/EventDefinitionType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/EventDefinitionType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/EventDefinitionType.java
deleted file mode 100644
index 237fff4..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/EventDefinitionType.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import javax.xml.namespace.QName;
-
-import org.apache.pluto.container.om.portlet.Description;
-import org.apache.pluto.container.om.portlet.EventDefinition;
-
-/**
- * The event-definitionType is used to declare events the portlet can either 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 <p>Java class
- * for event-definitionType complex type. <p>The following schema fragment specifies the expected content contained
- * within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;event-definitionType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;choice&gt;
- *           &lt;element name=&quot;qname&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}QName&quot;/&gt;
- *           &lt;element name=&quot;name&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}NCName&quot;/&gt;
- *         &lt;/choice&gt;
- *         &lt;element name=&quot;alias&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}QName&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;value-type&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}fully-qualified-classType&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "event-definitionType", propOrder = { "description", "qname", "name", "alias", "valueType" })
-public class EventDefinitionType implements EventDefinition
-{
-    @XmlElement(name = "description")
-    protected List<DescriptionType> description;
-    protected QName qname;
-    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
-    @XmlSchemaType(name = "NCName")
-    protected String name;
-    protected List<QName> alias;
-    @XmlElement(name = "value-type")
-    protected String valueType;
-
-    public Description getDescription(Locale locale)
-    {
-        for (Description d : getDescriptions())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Description> getDescriptions()
-    {
-        if (description == null)
-        {
-            description = new ArrayList<DescriptionType>();
-        }
-        return description;
-    }
-    
-    public Description addDescription(String lang)
-    {
-        DescriptionType d = new DescriptionType();
-        d.setLang(lang);
-        if (getDescription(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
-        }
-        getDescriptions();
-        description.add(d);
-        return d;
-    }
-
-    public QName getQName()
-    {
-        return qname;
-    }
-
-    public void setQName(QName value)
-    {
-        qname = value;
-        name = null;
-    }
-
-    public String getName()
-    {
-        return name;
-    }
-
-    public void setName(String value)
-    {
-        name = value;
-        qname = null;
-    }
-
-    public List<QName> getAliases()
-    {
-        if (alias == null)
-        {
-            alias = new ArrayList<QName>();
-        }
-        return alias;
-    }
-    
-    public void addAlias(QName alias)
-    {
-        // TODO: check for duplicates
-        getAliases().add(alias);
-    }
-
-    public String getValueType()
-    {
-        return valueType;
-    }
-
-    public void setValueType(String value)
-    {
-        valueType = value;
-    }
-
-    public QName getQualifiedName(String defaultNamespace)
-    {
-        return qname != null ? qname : name != null ? new QName(defaultNamespace, name) : null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/FilterMappingType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/FilterMappingType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/FilterMappingType.java
deleted file mode 100644
index e2c7815..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/FilterMappingType.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.FilterMapping;
-
-/**
- * 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 <p>Java class for filter-mappingType
- * complex type. <p>The following schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;filter-mappingType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;filter-name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}filter-nameType&quot;/&gt;
- *         &lt;element name=&quot;portlet-name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-nameType&quot; maxOccurs=&quot;unbounded&quot;/&gt;
- *       &lt;/sequence&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "filter-mappingType", propOrder = { "filterName", "portletName" })
-public class FilterMappingType implements FilterMapping
-{
-    @XmlElement(name = "filter-name", required = true)
-    protected String filterName;
-    @XmlElement(name = "portlet-name", required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected List<String> portletName;
-
-    public String getFilterName()
-    {
-        return filterName;
-    }
-
-    public void setFilterName(String value)
-    {
-        filterName = value;
-    }
-
-    public List<String> getPortletNames()
-    {
-        if (portletName == null)
-        {
-            portletName = new ArrayList<String>();
-        }
-        return portletName;
-    }
-    
-    public void addPortletName(String name)
-    {
-        // TODO: check for duplicates
-        getPortletNames().add(name);
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/FilterType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/FilterType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/FilterType.java
deleted file mode 100644
index ff13368..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/FilterType.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-import org.apache.pluto.container.om.portlet.Description;
-import org.apache.pluto.container.om.portlet.DisplayName;
-import org.apache.pluto.container.om.portlet.Filter;
-import org.apache.pluto.container.om.portlet.InitParam;
-
-/**
- * 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 <p>Java class for
- * filterType complex type. <p>The following schema fragment specifies the expected content contained within this
- * class.
- * 
- * <pre>
- * &lt;complexType name=&quot;filterType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;display-name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}display-nameType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;filter-name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}filter-nameType&quot;/&gt;
- *         &lt;element name=&quot;filter-class&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}fully-qualified-classType&quot;/&gt;
- *         &lt;element name=&quot;lifecycle&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; maxOccurs=&quot;unbounded&quot;/&gt;
- *         &lt;element name=&quot;init-param&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}init-paramType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "filterType", propOrder = { "description", "displayName", "filterName", "filterClass", "lifecycle",
-                                           "initParam" })
-public class FilterType implements Filter
-{
-    @XmlElement(name = "description")
-    protected List<DescriptionType> description;
-    @XmlElement(name = "display-name")
-    protected List<DisplayNameType> displayName;
-    @XmlElement(name = "filter-name", required = true)
-    protected String filterName;
-    @XmlElement(name = "filter-class", required = true)
-    protected String filterClass;
-    @XmlElement(required = true)
-    protected List<String> lifecycle;
-    @XmlElement(name = "init-param")
-    protected List<InitParamType> initParam;
-
-    public Description getDescription(Locale locale)
-    {
-        for (Description d : getDescriptions())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Description> getDescriptions()
-    {
-        if (description == null)
-        {
-            description = new ArrayList<DescriptionType>();
-        }
-        return description;
-    }
-    
-    public Description addDescription(String lang)
-    {
-        DescriptionType d = new DescriptionType();
-        d.setLang(lang);
-        if (getDescription(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
-        }
-        getDescriptions();
-        description.add(d);
-        return d;
-    }
-
-    public DisplayName getDisplayName(Locale locale)
-    {
-        for (DisplayName d : getDisplayNames())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends DisplayName> getDisplayNames()
-    {
-        if (displayName == null)
-        {
-            displayName = new ArrayList<DisplayNameType>();
-        }
-        return displayName;
-    }
-    
-    public DisplayName addDisplayName(String lang)
-    {
-        DisplayNameType d = new DisplayNameType();
-        d.setLang(lang);
-        if (getDisplayName(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("DisplayName for language: "+d.getLocale()+" already defined");
-        }
-        getDisplayNames();
-        displayName.add(d);
-        return d;
-    }
-
-    public String getFilterName()
-    {
-        return filterName;
-    }
-
-    public void setFilterName(String value)
-    {
-        filterName = value;
-    }
-
-    public String getFilterClass()
-    {
-        return filterClass;
-    }
-
-    public void setFilterClass(String value)
-    {
-        filterClass = value;
-    }
-
-    public List<String> getLifecycles()
-    {
-        if (lifecycle == null)
-        {
-            lifecycle = new ArrayList<String>();
-        }
-        return lifecycle;
-    }
-    
-    public void addLifecycle(String name)
-    {
-        // TODO: check valid name and duplicates
-        getLifecycles().add(name);
-    }
-    
-    public InitParam getInitParam(String name)
-    {
-        for (InitParam param : getInitParams())
-        {
-            if (param.getParamName().equals(name))
-            {
-                return param;
-            }
-        }
-        return null;
-    }
-
-    public List<? extends InitParam> getInitParams()
-    {
-        if (initParam == null)
-        {
-            initParam = new ArrayList<InitParamType>();
-        }
-        return initParam;
-    }
-    
-    public InitParam addInitParam(String paramName)
-    {
-        if (getInitParam(paramName) != null)
-        {
-            throw new IllegalArgumentException("Init parameter: "+paramName+" already defined");
-        }
-        InitParamType param = new InitParamType();
-        param.setParamName(paramName);
-        getInitParams();
-        initParam.add(param);
-        return param;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/InitParamType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/InitParamType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/InitParamType.java
deleted file mode 100644
index f0fc42f..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/InitParamType.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.Description;
-import org.apache.pluto.container.om.portlet.InitParam;
-
-/**
- * The init-param element contains a name/value pair as an initialization param of the portlet Used in:portlet <p>Java
- * class for init-paramType complex type. <p>The following schema fragment specifies the expected content contained
- * within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;init-paramType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}nameType&quot;/&gt;
- *         &lt;element name=&quot;value&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}valueType&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "init-paramType", propOrder = { "description", "name", "value" })
-public class InitParamType implements InitParam
-{
-    @XmlElement(name = "description")
-    protected List<DescriptionType> description;
-    @XmlElement(required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String name;
-    @XmlElement(required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String value;
-
-    public Description getDescription(Locale locale)
-    {
-        for (Description d : getDescriptions())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Description> getDescriptions()
-    {
-        if (description == null)
-        {
-            description = new ArrayList<DescriptionType>();
-        }
-        return description;
-    }
-    
-    public Description addDescription(String lang)
-    {
-        DescriptionType d = new DescriptionType();
-        d.setLang(lang);
-        if (getDescription(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
-        }
-        getDescriptions();
-        description.add(d);
-        return d;
-    }
-
-    public String getParamName()
-    {
-        return name;
-    }
-
-    public void setParamName(String value)
-    {
-        name = value;
-    }
-
-    public String getParamValue()
-    {
-        return value;
-    }
-
-    public void setParamValue(String value)
-    {
-        this.value = value;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/ListenerType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/ListenerType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/ListenerType.java
deleted file mode 100644
index b98b3fb..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/ListenerType.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-import org.apache.pluto.container.om.portlet.Description;
-import org.apache.pluto.container.om.portlet.DisplayName;
-import org.apache.pluto.container.om.portlet.Listener;
-
-/**
- * The listenerType is used to declare listeners for this portlet application. Used in: portlet-app <p>Java class for
- * listenerType complex type. <p>The following schema fragment specifies the expected content contained within this
- * class.
- * 
- * <pre>
- * &lt;complexType name=&quot;listenerType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;display-name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}display-nameType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;listener-class&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}fully-qualified-classType&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "listenerType", propOrder = { "description", "displayName", "listenerClass" })
-public class ListenerType implements Listener
-{
-    @XmlElement(name = "description")
-    protected List<DescriptionType> description;
-    @XmlElement(name = "display-name")
-    protected List<DisplayNameType> displayName;
-    @XmlElement(name = "listener-class", required = true)
-    protected String listenerClass;
-
-    public Description getDescription(Locale locale)
-    {
-        for (Description d : getDescriptions())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Description> getDescriptions()
-    {
-        if (description == null)
-        {
-            description = new ArrayList<DescriptionType>();
-        }
-        return description;
-    }
-    
-    public Description addDescription(String lang)
-    {
-        DescriptionType d = new DescriptionType();
-        d.setLang(lang);
-        if (getDescription(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
-        }
-        getDescriptions();
-        description.add(d);
-        return d;
-    }
-
-    public DisplayName getDisplayName(Locale locale)
-    {
-        for (DisplayName d : getDisplayNames())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends DisplayName> getDisplayNames()
-    {
-        if (displayName == null)
-        {
-            displayName = new ArrayList<DisplayNameType>();
-        }
-        return displayName;
-    }
-    
-    public DisplayName addDisplayName(String lang)
-    {
-        DisplayNameType d = new DisplayNameType();
-        d.setLang(lang);
-        if (getDisplayName(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("DisplayName for language: "+d.getLocale()+" already defined");
-        }
-        getDisplayNames();
-        displayName.add(d);
-        return d;
-    }
-
-    public String getListenerClass()
-    {
-        return listenerClass;
-    }
-
-    public void setListenerClass(String value)
-    {
-        listenerClass = value;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/ObjectFactory.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/ObjectFactory.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/ObjectFactory.java
deleted file mode 100644
index b3edf02..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet30/impl/ObjectFactory.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet30.impl;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlElementDecl;
-import javax.xml.bind.annotation.XmlRegistry;
-import javax.xml.namespace.QName;
-
-/**
- * This object contains factory methods for each Java content interface and Java element interface generated in the
- * org.apache.pluto.descriptors.portlet30 package. <p>An ObjectFactory allows you to programatically construct new
- * instances of the Java representation for XML content. The Java representation of XML content can consist of schema
- * derived interfaces and classes representing the binding of schema type definitions, element declarations and model
- * groups. Factory methods for each of these are provided in this class.
- * 
- * @version $Id$
- */
-@XmlRegistry
-public class ObjectFactory
-{
-    private final static QName _PortletApp_QNAME = new QName("http://xmlns.jcp.org/xml/ns/portlet",
-                                                             "portlet-app");
-
-    public ObjectFactory()
-    {
-    }
-
-    public PortletAppType createPortletApp()
-    {
-        return new PortletAppType();
-    }
-
-    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/portlet", name = "portlet-app")
-    public JAXBElement<PortletAppType> createPortletApp(PortletAppType value)
-    {
-        return new JAXBElement<PortletAppType>(_PortletApp_QNAME, PortletAppType.class, null, value);
-    }
-}


[32/38] portals-pluto git commit: First step in implementation of header phase support. Initial, incomplete implementation of HeaderRequestImpl, HeaderResponseImpl and th associated contexts. Completed invocation path.

Posted by ms...@apache.org.
First step in implementation of header phase support. Initial, incomplete
implementation of HeaderRequestImpl, HeaderResponseImpl and th associated
contexts. Completed invocation path.


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/65c0050b
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/65c0050b
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/65c0050b

Branch: refs/heads/V3Prototype
Commit: 65c0050bb2abb44ad2ee51441a59c9b28c46b3bb
Parents: 29448a1
Author: Scott Nicklous <ms...@apache.org>
Authored: Fri Nov 20 14:52:29 2015 +0100
Committer: Scott Nicklous <ms...@apache.org>
Committed: Fri Nov 20 14:52:29 2015 +0100

----------------------------------------------------------------------
 .../apache/pluto/container/FilterManager.java   |  98 +--
 .../pluto/container/PortletContainer.java       |  16 +
 .../container/PortletEnvironmentService.java    | 111 +--
 .../container/PortletHeaderResponseContext.java |  30 +
 .../pluto/container/PortletInvokerService.java  |  15 +-
 .../container/PortletRequestContextService.java |   7 +
 .../pluto/container/driver/PortletServlet3.java | 799 +++++++++----------
 .../pluto/container/impl/HeaderRequestImpl.java |  40 +
 .../container/impl/HeaderResponseImpl.java      | 127 +++
 .../pluto/container/impl/MimeResponseImpl.java  |   2 +-
 .../container/impl/PortletContainerImpl.java    |  53 ++
 .../impl/PortletEnvironmentServiceImpl.java     | 189 +++--
 .../pluto/container/impl/RenderRequestImpl.java | 115 +--
 .../container/impl/RenderResponseImpl.java      |   7 +-
 .../services/container/FilterChainImpl.java     | 422 +++++-----
 .../services/container/FilterManagerImpl.java   | 302 +++----
 .../PortletHeaderResponseContextImpl.java       |  55 ++
 .../PortletRequestContextServiceImpl.java       |  15 +
 .../pluto/driver/PortalDriverServlet.java       |  28 +-
 .../container/DefaultPortletInvokerService.java |  26 +-
 .../main/java/javax/portlet/PortletRequest.java |  11 +
 21 files changed, 1462 insertions(+), 1006 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/65c0050b/pluto-container-api/src/main/java/org/apache/pluto/container/FilterManager.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/FilterManager.java b/pluto-container-api/src/main/java/org/apache/pluto/container/FilterManager.java
index 6ef1f8a..bc95ad7 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/FilterManager.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/FilterManager.java
@@ -1,47 +1,51 @@
-/*
- * 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.
- */
-package org.apache.pluto.container;
-
-import java.io.IOException;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.EventPortlet;
-import javax.portlet.EventRequest;
-import javax.portlet.EventResponse;
-import javax.portlet.Portlet;
-import javax.portlet.PortletContext;
-import javax.portlet.PortletException;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.ResourceRequest;
-import javax.portlet.ResourceResponse;
-import javax.portlet.ResourceServingPortlet;
-
-/**
- * Manage the initialization and doFilter for the filter which are
- * declareted in the deployment descriptor.
- * @since 05/29/2007
- * @version 2.0
- */
-public interface FilterManager {
-
-    void processFilter(ActionRequest req, ActionResponse res, Portlet portlet, PortletContext portletContext) throws PortletException, IOException;
-    void processFilter(RenderRequest req, RenderResponse res, Portlet portlet, PortletContext portletContext) throws PortletException, IOException;
-    void processFilter(ResourceRequest req, ResourceResponse res, ResourceServingPortlet resourceServingPortlet, PortletContext portletContext)throws PortletException, IOException;
-    void processFilter(EventRequest req, EventResponse res, EventPortlet eventPortlet, PortletContext portletContext)throws PortletException, IOException;
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.container;
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.EventPortlet;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.HeaderPortlet;
+import javax.portlet.HeaderRequest;
+import javax.portlet.HeaderResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.portlet.ResourceServingPortlet;
+
+/**
+ * Manage the initialization and doFilter for the filter which are
+ * declareted in the deployment descriptor.
+ * @since 05/29/2007
+ * @version 2.0
+ */
+public interface FilterManager {
+
+    void processFilter(ActionRequest req, ActionResponse res, Portlet portlet, PortletContext portletContext) throws PortletException, IOException;
+    void processFilter(HeaderRequest req, HeaderResponse res, HeaderPortlet portlet, PortletContext portletContext) throws PortletException, IOException;
+    void processFilter(RenderRequest req, RenderResponse res, Portlet portlet, PortletContext portletContext) throws PortletException, IOException;
+    void processFilter(ResourceRequest req, ResourceResponse res, ResourceServingPortlet resourceServingPortlet, PortletContext portletContext)throws PortletException, IOException;
+    void processFilter(EventRequest req, EventResponse res, EventPortlet eventPortlet, PortletContext portletContext)throws PortletException, IOException;
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/65c0050b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletContainer.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletContainer.java b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletContainer.java
index d96c066..8529654 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletContainer.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletContainer.java
@@ -63,6 +63,22 @@ public interface PortletContainer {
     void destroy() throws PortletContainerException;
 
     /**
+     * Calls the render headers method of the given portlet window.
+     * @param portletWindow the portlet Window
+     * @param request               the servlet request
+     * @param response              the servlet response
+     * @throws PortletException          if one portlet has trouble fulfilling
+     *                                   the request
+     * @throws IOException               if the streaming causes an I/O problem
+     * @throws PortletContainerException if the portlet container implementation
+     *                                   has trouble fulfilling the request
+     */
+    void doHeader(PortletWindow portletWindow,
+            HttpServletRequest request,
+            HttpServletResponse response)
+    throws PortletException, IOException, PortletContainerException;
+
+    /**
      * Calls the render method of the given portlet window.
      * @param portletWindow the portlet Window
      * @param request               the servlet request

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/65c0050b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletEnvironmentService.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletEnvironmentService.java b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletEnvironmentService.java
index be7c5c3..874bd5f 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletEnvironmentService.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletEnvironmentService.java
@@ -1,53 +1,58 @@
-/*
- * 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.
- */
-package org.apache.pluto.container;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.Event;
-import javax.portlet.EventRequest;
-import javax.portlet.EventResponse;
-import javax.portlet.PortletContext;
-import javax.portlet.PortletSession;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.ResourceRequest;
-import javax.portlet.ResourceResponse;
-import javax.servlet.http.HttpSession;
-
-
-/**
- * Factory Service for creating Portlet request, responses and session.
- *
- * @since 1.1.0
- */
-public interface PortletEnvironmentService
-{    
-    ActionRequest createActionRequest(PortletRequestContext requestContext, PortletActionResponseContext responseContext);
-    ActionResponse createActionResponse(PortletActionResponseContext responseContext);
-
-    EventRequest createEventRequest(PortletRequestContext requestContext, PortletEventResponseContext responseContext, Event event);
-    EventResponse createEventResponse(PortletEventResponseContext responseContext);
-    
-    RenderRequest createRenderRequest(PortletRequestContext requestContext, PortletRenderResponseContext responseContext);
-    RenderResponse createRenderResponse(PortletRenderResponseContext responseContext);
-    
-    ResourceRequest createResourceRequest(PortletResourceRequestContext requestContext, PortletResourceResponseContext responseContext);
-    ResourceResponse createResourceResponse(PortletResourceResponseContext responseContext, String requestCacheLevel);
-
-    PortletSession createPortletSession(PortletContext portletContext, PortletWindow portletWindow, HttpSession session);
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.container;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Event;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.HeaderRequest;
+import javax.portlet.HeaderResponse;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletSession;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.servlet.http.HttpSession;
+
+
+/**
+ * Factory Service for creating Portlet request, responses and session.
+ *
+ * @since 1.1.0
+ */
+public interface PortletEnvironmentService
+{    
+    ActionRequest createActionRequest(PortletRequestContext requestContext, PortletActionResponseContext responseContext);
+    ActionResponse createActionResponse(PortletActionResponseContext responseContext);
+
+    EventRequest createEventRequest(PortletRequestContext requestContext, PortletEventResponseContext responseContext, Event event);
+    EventResponse createEventResponse(PortletEventResponseContext responseContext);
+    
+    HeaderRequest createHeaderRequest(PortletRequestContext requestContext, PortletHeaderResponseContext responseContext);
+    HeaderResponse createHeaderResponse(PortletHeaderResponseContext responseContext);
+    
+    RenderRequest createRenderRequest(PortletRequestContext requestContext, PortletRenderResponseContext responseContext);
+    RenderResponse createRenderResponse(PortletRenderResponseContext responseContext);
+    
+    ResourceRequest createResourceRequest(PortletResourceRequestContext requestContext, PortletResourceResponseContext responseContext);
+    ResourceResponse createResourceResponse(PortletResourceResponseContext responseContext, String requestCacheLevel);
+
+    PortletSession createPortletSession(PortletContext portletContext, PortletWindow portletWindow, HttpSession session);
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/65c0050b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletHeaderResponseContext.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletHeaderResponseContext.java b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletHeaderResponseContext.java
new file mode 100644
index 0000000..397dd33
--- /dev/null
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletHeaderResponseContext.java
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+package org.apache.pluto.container;
+
+import java.util.Collection;
+
+import javax.portlet.PortletMode;
+
+/**
+ * @author Scott Nicklous
+ */
+public interface PortletHeaderResponseContext extends PortletMimeResponseContext
+{
+    void setTitle(String title);
+    void setNextPossiblePortletModes(Collection<PortletMode> portletModes);
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/65c0050b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletInvokerService.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletInvokerService.java b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletInvokerService.java
index 8b35a56..2dddf78 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletInvokerService.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletInvokerService.java
@@ -22,6 +22,8 @@ import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
 import javax.portlet.EventRequest;
 import javax.portlet.EventResponse;
+import javax.portlet.HeaderRequest;
+import javax.portlet.HeaderResponse;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequest;
 import javax.portlet.PortletResponse;
@@ -77,6 +79,14 @@ public interface PortletInvokerService {
     String METHOD_ID = "org.apache.pluto.core.method";
 
     /**
+     * The unique method identifier for header requests.  Header requests are
+     * requested through a call to the {@link PortletContainer#doHeader(org.apache.pluto.container.PortletWindow,
+     * javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}
+     * method.
+     */
+    Integer METHOD_HEADER = new Integer(101);
+
+    /**
      * The unique method identifier for render requests.  Render requests are
      * requested through a call to the {@link PortletContainer#doRender(org.apache.pluto.container.PortletWindow,
      * javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}
@@ -85,7 +95,7 @@ public interface PortletInvokerService {
     Integer METHOD_RENDER = new Integer(1);
 
     /**
-     * The unique method identifier for render requests.  Render requests are
+     * The unique method identifier for action requests.  Action requests are
      * requested through a call to the {@link PortletContainer#doAction(org.apache.pluto.container.PortletWindow,
      * javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}
      * method.
@@ -137,6 +147,9 @@ public interface PortletInvokerService {
     void render(PortletRequestContext ctx, RenderRequest req, RenderResponse res, FilterManager filterManager)
     throws IOException, PortletException, PortletContainerException;
 
+    void header(PortletRequestContext ctx, HeaderRequest req, HeaderResponse res, FilterManager filterManager)
+    throws IOException, PortletException, PortletContainerException;
+
     void serveResource(PortletRequestContext ctx, ResourceRequest req, ResourceResponse res, FilterManager filterManager)
     throws IOException, PortletException, PortletContainerException;
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/65c0050b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletRequestContextService.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletRequestContextService.java b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletRequestContextService.java
index 51bf95a..15643e6 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletRequestContextService.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletRequestContextService.java
@@ -38,6 +38,9 @@ public interface PortletRequestContextService
                                                                    PortletWindow window,
                                                                    String pageState);
 
+    PortletRequestContext getPortletHeaderRequestContext(PortletContainer container, HttpServletRequest containerRequest,
+                                                         HttpServletResponse containerResponse, PortletWindow window);
+
     PortletRequestContext getPortletRenderRequestContext(PortletContainer container, HttpServletRequest containerRequest,
                                                          HttpServletResponse containerResponse, PortletWindow window);
 
@@ -55,4 +58,8 @@ public interface PortletRequestContextService
     PortletRenderResponseContext getPortletRenderResponseContext(PortletContainer container,
                                                                  HttpServletRequest containerRequest,
                                                                  HttpServletResponse containerResponse, PortletWindow window);
+
+    PortletHeaderResponseContext getPortletHeaderResponseContext(PortletContainer container,
+                                                                 HttpServletRequest containerRequest,
+                                                                 HttpServletResponse containerResponse, PortletWindow window);
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/65c0050b/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet3.java
----------------------------------------------------------------------
diff --git a/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet3.java b/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet3.java
index 804f316..e8aaf53 100644
--- a/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet3.java
+++ b/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/PortletServlet3.java
@@ -25,6 +25,9 @@ import javax.portlet.ActionResponse;
 import javax.portlet.EventPortlet;
 import javax.portlet.EventRequest;
 import javax.portlet.EventResponse;
+import javax.portlet.HeaderPortlet;
+import javax.portlet.HeaderRequest;
+import javax.portlet.HeaderResponse;
 import javax.portlet.Portlet;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletException;
@@ -51,435 +54,393 @@ import org.apache.pluto.container.PortletResourceRequestContext;
 import org.apache.pluto.container.PortletResponseContext;
 import org.apache.pluto.container.PortletWindow;
 import org.apache.pluto.container.om.portlet.PortletDefinition;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
- * Portlet Invocation Servlet. This servlet recieves cross context requests from
- * the the container and services the portlet request for the specified method.
- *
+ * Portlet Invocation Servlet. This servlet recieves cross context requests from the the container and services the
+ * portlet request for the specified method.
+ * 
  * @version 1.1
  * @since 09/22/2004
  */
-public class PortletServlet3 extends HttpServlet
-{
-    private static final long serialVersionUID = -5096339022539360365L;
-    
-    /**
-     * Portlet name constant, needed by portlet container initializer
-     */
-    public static final String PORTLET_NAME = "portlet-name"; 
-
-
-    static class NullPortlet implements EventPortlet, ResourceServingPortlet, Portlet
-    {
-        public void processEvent(EventRequest arg0, EventResponse arg1)
-        throws PortletException, IOException
-        {
-        }
-
-        public void serveResource(ResourceRequest arg0, ResourceResponse arg1)
-        throws PortletException, IOException
-        {
-        }
-
-        public void destroy()
-        {
-        }
-
-        public void init(PortletConfig arg0) throws PortletException
-        {
-        }
-
-        public void processAction(ActionRequest arg0, ActionResponse arg1)
-        throws PortletException, IOException
-        {
-        }
-
-        public void render(RenderRequest arg0, RenderResponse arg1)
-        throws PortletException, IOException
-        {
-        }
-    }
-
-    // Private Member Variables ------------------------------------------------
-    /**
-     * The portlet name as defined in the portlet app descriptor.
-     */
-    private String portletName;
-
-    /**
-     * The portlet instance wrapped by this servlet.
-     */
-    private Portlet portlet;
-
-    /**
-     * The internal portlet context instance.
-     */
-    private DriverPortletContext portletContext;
-
-    /**
-     * The internal portlet config instance.
-     */
-    private DriverPortletConfig portletConfig;
-
-    /**
-     * The Event Portlet instance (the same object as portlet) wrapped by this
-     * servlet.
-     */
-    private EventPortlet eventPortlet;
-
-    /** The resource serving portlet instance wrapped by this servlet. */
-    private ResourceServingPortlet resourceServingPortlet;
-
-    private PortletContextService contextService;
-
-    private boolean started = false;
-    Timer   startTimer;
-
-    // HttpServlet Impl --------------------------------------------------------
-
-    public String getServletInfo()
-    {
-        return "Pluto PortletServlet3 [" + portletName + "]";
-    }
-
-    /**
-     * Initialize the portlet invocation servlet.
-     *
-     * @throws ServletException
-     *             if an error occurs while loading portlet.
-     */
-    public void init(ServletConfig config) throws ServletException
-    {
-
-        // Call the super initialization method.
-        super.init(config);
-
-        // Retrieve portlet name as defined as an initialization parameter.
-        portletName = getInitParameter(PORTLET_NAME);
-
-        started = false;
-
-        startTimer = new Timer(true);
-        final ServletContext servletContext = getServletContext();
-        final ClassLoader paClassLoader = Thread.currentThread().getContextClassLoader();
-        startTimer.schedule(new TimerTask()
-        {
-            public void run()
-            {
-                synchronized(servletContext)
-                {
-                    if (startTimer != null)
-                    {
-                        if (attemptRegistration(servletContext, paClassLoader ))
-                        {
-                            startTimer.cancel();
-                            startTimer = null;
-                        }
-                    }
-                }
-            }
-        }, 1, 10000);
-    }
-
-    protected boolean attemptRegistration(ServletContext context, ClassLoader paClassLoader)
-    {
-        if (PlutoServices.getServices() != null)
-        {
-            contextService = PlutoServices.getServices().getPortletContextService();
-            try
-            {
-                ServletConfig sConfig = getServletConfig();
-                if (sConfig == null)
-                {
-                    String msg = "Problem obtaining servlet configuration(getServletConfig() returns null).";
-                    context.log(msg);
-                    return true;
-                }
-
-                String applicationName = contextService.register(sConfig);
-                started = true;
-                portletContext = contextService.getPortletContext(applicationName);
-                portletConfig = contextService.getPortletConfig(applicationName, portletName);
-
-            }
-            catch (PortletContainerException ex)
-            {
-                context.log(ex.getMessage(),ex);
-                return true;
-            }
-
-            PortletDefinition portletDD = portletConfig.getPortletDefinition();
-
-            //          Create and initialize the portlet wrapped in the servlet.
-            try
-            {
-                Class<?> clazz = paClassLoader.loadClass((portletDD.getPortletClass()));
-                portlet = (Portlet) clazz.newInstance();
-                portlet.init(portletConfig);
-                initializeEventPortlet();
-                initializeResourceServingPortlet();
-                return true;
-            }
-            catch (Exception ex)
-            {
-                context.log(ex.getMessage(),ex);
-                // take out of service
-                portlet = null;
-                portletConfig = null;
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public void destroy()
-    {
-        synchronized(getServletContext())
-        {
-            if ( startTimer != null )
-            {
-                startTimer.cancel();
-                startTimer = null;
-            }
-            else if ( started && portletContext != null)
-            {
-                started = false;
-                contextService.unregister(portletContext);
-                if (portlet != null)
-                {
-                    try
-                    {
-                        portlet.destroy();
-                    }
-                    catch (Exception e)
-                    {
-                        // ignore
-                    }
-                    portlet = null;
-                }
+public class PortletServlet3 extends HttpServlet {
+   private static final long  serialVersionUID = -5096339022539360365L;
+   
+   /** Logger. */
+   private static final Logger LOG = LoggerFactory.getLogger(PortletServlet3.class);
+   private static final boolean isDebug = LOG.isDebugEnabled();
+   
+
+   /**
+    * Portlet name constant, needed by portlet container initializer
+    */
+   public static final String PORTLET_NAME     = "portlet-name";
+
+   private class NullPortlet implements EventPortlet, ResourceServingPortlet, Portlet, HeaderPortlet {
+      public void processEvent(EventRequest arg0, EventResponse arg1) throws PortletException, IOException {
+      }
+
+      public void serveResource(ResourceRequest arg0, ResourceResponse arg1) throws PortletException, IOException {
+      }
+
+      public void destroy() {
+      }
+
+      public void init(PortletConfig arg0) throws PortletException {
+      }
+
+      public void processAction(ActionRequest arg0, ActionResponse arg1) throws PortletException, IOException {
+      }
+
+      public void render(RenderRequest arg0, RenderResponse arg1) throws PortletException, IOException {
+      }
+
+      @Override
+      public void renderHeaders(HeaderRequest request, HeaderResponse response) throws PortletException, IOException {
+         if (isDebug) {
+            LOG.debug("NullPortlet renderHeaders! Portlet name: " + portletName);
+         }
+      }
+   }
+
+   // Private Member Variables ------------------------------------------------
+
+   /**
+    * The portlet name as defined in the portlet app descriptor.
+    */
+   private String                 portletName;
+
+   /**
+    * The portlet instance wrapped by this servlet.
+    */
+   private Portlet                portlet;
+
+   /**
+    * The internal portlet context instance.
+    */
+   private DriverPortletContext   portletContext;
+
+   /**
+    * The internal portlet config instance.
+    */
+   private DriverPortletConfig    portletConfig;
+
+   /**
+    * The Event Portlet instance (the same object as portlet) wrapped by this servlet.
+    */
+   private EventPortlet           eventPortlet;
+   
+   /**
+    * Header portlet instance
+    */
+   private HeaderPortlet          headerPortlet;
+
+   /** The resource serving portlet instance wrapped by this servlet. */
+   private ResourceServingPortlet resourceServingPortlet;
+
+   private PortletContextService  contextService;
+
+   private boolean                started = false;
+   Timer                          startTimer;
+
+   // HttpServlet Impl --------------------------------------------------------
+
+   public String getServletInfo() {
+      return "Pluto PortletServlet3 [" + portletName + "]";
+   }
+
+   /**
+    * Initialize the portlet invocation servlet.
+    * 
+    * @throws ServletException
+    *            if an error occurs while loading portlet.
+    */
+   public void init(ServletConfig config) throws ServletException {
+
+      // Call the super initialization method.
+      super.init(config);
+
+      // Retrieve portlet name as defined as an initialization parameter.
+      portletName = getInitParameter(PORTLET_NAME);
+
+      started = false;
+
+      startTimer = new Timer(true);
+      final ServletContext servletContext = getServletContext();
+      final ClassLoader paClassLoader = Thread.currentThread().getContextClassLoader();
+      startTimer.schedule(new TimerTask() {
+         public void run() {
+            synchronized (servletContext) {
+               if (startTimer != null) {
+                  if (attemptRegistration(servletContext, paClassLoader)) {
+                     startTimer.cancel();
+                     startTimer = null;
+                  }
+               }
             }
-            super.destroy();
-        }
-    }
-
-    protected void doGet(HttpServletRequest request,
-            HttpServletResponse response) throws ServletException, IOException
-            {
-        dispatch(request, response);
-            }
-
-    protected void doPost(HttpServletRequest request,
-            HttpServletResponse response) throws ServletException, IOException
-            {
-        dispatch(request, response);
-            }
-
-    protected void doPut(HttpServletRequest request,
-            HttpServletResponse response) throws ServletException, IOException
-            {
-        dispatch(request, response);
-            }
-
-    // Private Methods ---------------------------------------------------------
-
-    /**
-     * Dispatch the request to the appropriate portlet methods. This method
-     * assumes that the following attributes are set in the servlet request
-     * scope:
-     * <ul>
-     * <li>METHOD_ID: indicating which method to dispatch.</li>
-     * <li>PORTLET_REQUEST: the internal portlet request.</li>
-     * <li>PORTLET_RESPONSE: the internal portlet response.</li>
-     * </ul>
-     *
-     * @param request
-     *            the servlet request.
-     * @param response
-     *            the servlet response.
-     * @throws ServletException
-     * @throws IOException
-     */
-    private void dispatch(HttpServletRequest request,
-            HttpServletResponse response) throws ServletException, IOException
-            {
-        if (portlet == null)
-        {
-            throw new javax.servlet.UnavailableException("Portlet "+portletName+" unavailable");
-        }
-
-        // Retrieve attributes from the servlet request.
-        Integer methodId = (Integer) request.getAttribute(PortletInvokerService.METHOD_ID);
-
-        final PortletRequest portletRequest = (PortletRequest)request.getAttribute(PortletInvokerService.PORTLET_REQUEST);
-
-        final PortletResponse portletResponse = (PortletResponse)request.getAttribute(PortletInvokerService.PORTLET_RESPONSE);
-
-        final PortletRequestContext requestContext = (PortletRequestContext)portletRequest.getAttribute(PortletInvokerService.REQUEST_CONTEXT);
-        final PortletResponseContext responseContext = (PortletResponseContext)portletRequest.getAttribute(PortletInvokerService.RESPONSE_CONTEXT);
-
-        final FilterManager filterManager = (FilterManager)request.getAttribute(PortletInvokerService.FILTER_MANAGER);
-
-        request.removeAttribute(PortletInvokerService.METHOD_ID);
-        request.removeAttribute(PortletInvokerService.PORTLET_REQUEST);
-        request.removeAttribute(PortletInvokerService.PORTLET_RESPONSE);
-        request.removeAttribute(PortletInvokerService.FILTER_MANAGER);
-
-        requestContext.init(portletConfig, getServletContext(), request, response);
-        responseContext.init(request, response);
-
-        PortletWindow window = requestContext.getPortletWindow();
-
-        PortletInvocationEvent event = new PortletInvocationEvent(portletRequest, window, methodId.intValue());
-
-        notify(event, true, null);
-
-        // FilterManager filtermanager = (FilterManager) request.getAttribute(
-        // "filter-manager");
-
-        try
-        {
-
-            // The requested method is RENDER: call Portlet.render(..)
-            if (methodId == PortletInvokerService.METHOD_RENDER)
-            {
-                RenderRequest renderRequest = (RenderRequest) portletRequest;
-                RenderResponse renderResponse = (RenderResponse) portletResponse;
-                filterManager.processFilter(renderRequest, renderResponse,
-                        portlet, portletContext);
-            }
-
-            // The requested method is RESOURCE: call
-            // ResourceServingPortlet.serveResource(..)
-            else if (methodId == PortletInvokerService.METHOD_RESOURCE)
-            {
-                ResourceRequest resourceRequest = (ResourceRequest) portletRequest;
-
-                // if pageState != null, we're dealing with a Partial Action request, so
-                // store the page state string as a request attribute
-                PortletResourceRequestContext rc = (PortletResourceRequestContext) requestContext;
-                String ps = rc.getPageState();
-                if (ps != null) {
-                   resourceRequest.setAttribute(ResourceRequest.PAGE_STATE, ps);
-                }
-
-                ResourceResponse resourceResponse = (ResourceResponse) portletResponse;
-                filterManager.processFilter(resourceRequest, resourceResponse,
-                        resourceServingPortlet, portletContext);
+         }
+      }, 1, 10000);
+   }
+
+   protected boolean attemptRegistration(ServletContext context, ClassLoader paClassLoader) {
+      if (PlutoServices.getServices() != null) {
+         contextService = PlutoServices.getServices().getPortletContextService();
+         try {
+            ServletConfig sConfig = getServletConfig();
+            if (sConfig == null) {
+               String msg = "Problem obtaining servlet configuration(getServletConfig() returns null).";
+               context.log(msg);
+               return true;
             }
 
-            // The requested method is ACTION: call Portlet.processAction(..)
-            else if (methodId == PortletInvokerService.METHOD_ACTION)
-            {
-                ActionRequest actionRequest = (ActionRequest) portletRequest;
-                ActionResponse actionResponse = (ActionResponse) portletResponse;
-                filterManager.processFilter(actionRequest, actionResponse,
-                        portlet, portletContext);
-            }
-
-            // The request methode is Event: call Portlet.processEvent(..)
-            else if (methodId == PortletInvokerService.METHOD_EVENT)
-            {
-                EventRequest eventRequest = (EventRequest) portletRequest;
-                EventResponse eventResponse = (EventResponse) portletResponse;
-                filterManager.processFilter(eventRequest, eventResponse,
-                        eventPortlet, portletContext);
-            }
-            // The requested method is ADMIN: call handlers.
-            else if (methodId == PortletInvokerService.METHOD_ADMIN)
-            {
-                PortalAdministrationService pas = PlutoServices.getServices().getPortalAdministrationService();
-
-                for (AdministrativeRequestListener l : pas.getAdministrativeRequestListeners())
-                {
-                    l.administer(portletRequest, portletResponse);
-                }
-            }
-
-            // The requested method is LOAD: do nothing.
-            else if (methodId == PortletInvokerService.METHOD_LOAD)
-            {
-                // Do nothing.
-            }
-
-            notify(event, false, null);
-
-        }
-        catch (UnavailableException ex)
-        {
-            //
-            // if (e.isPermanent()) { throw new
-            // UnavailableException(e.getMessage()); } else { throw new
-            // UnavailableException(e.getMessage(), e.getUnavailableSeconds());
-            // }
-            //
-
-            // Portlet.destroy() isn't called by Tomcat, so we have to fix it.
-            try
-            {
-                portlet.destroy();
-            }
-            catch (Throwable th)
-            {
-                // Don't care for Exception
-                this.getServletContext().log("Error during portlet destroy.", th);
-            }
-            // take portlet out of service
+            String applicationName = contextService.register(sConfig);
+            started = true;
+            portletContext = contextService.getPortletContext(applicationName);
+            portletConfig = contextService.getPortletConfig(applicationName, portletName);
+
+         } catch (PortletContainerException ex) {
+            context.log(ex.getMessage(), ex);
+            return true;
+         }
+
+         PortletDefinition portletDD = portletConfig.getPortletDefinition();
+
+         // Create and initialize the portlet wrapped in the servlet.
+         try {
+            Class<?> clazz = paClassLoader.loadClass((portletDD.getPortletClass()));
+            portlet = (Portlet) clazz.newInstance();
+            portlet.init(portletConfig);
+            initializeEventPortlet();
+            initializeResourceServingPortlet();
+            initializeHeaderPortlet();
+            return true;
+         } catch (Exception ex) {
+            context.log(ex.getMessage(), ex);
+            // take out of service
             portlet = null;
-
-            // TODO: Handle everything as permanently for now.
-            throw new javax.servlet.UnavailableException(ex.getMessage());
-
-        }
-        catch (PortletException ex)
-        {
-            notify(event, false, ex);
-            throw new ServletException(ex);
-
-        }
+            portletConfig = null;
+            return true;
+         }
+      }
+      return false;
+   }
+
+   public void destroy() {
+      synchronized (getServletContext()) {
+         if (startTimer != null) {
+            startTimer.cancel();
+            startTimer = null;
+         } else if (started && portletContext != null) {
+            started = false;
+            contextService.unregister(portletContext);
+            if (portlet != null) {
+               try {
+                  portlet.destroy();
+               } catch (Exception e) {
+                  // ignore
+               }
+               portlet = null;
             }
-
-    protected void notify(PortletInvocationEvent event, boolean pre, Throwable e)
-    {
-        PortalAdministrationService pas = PlutoServices.getServices().getPortalAdministrationService();
-
-        for (PortletInvocationListener listener : pas.getPortletInvocationListeners())
-        {
-            if (pre)
-            {
-                listener.onBegin(event);
+         }
+         super.destroy();
+      }
+   }
+
+   protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+      dispatch(request, response);
+   }
+
+   protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+      dispatch(request, response);
+   }
+
+   protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+      dispatch(request, response);
+   }
+
+   // Private Methods ---------------------------------------------------------
+
+   /**
+    * Dispatch the request to the appropriate portlet methods. This method assumes that the following attributes are set
+    * in the servlet request scope:
+    * <ul>
+    * <li>METHOD_ID: indicating which method to dispatch.</li>
+    * <li>PORTLET_REQUEST: the internal portlet request.</li>
+    * <li>PORTLET_RESPONSE: the internal portlet response.</li>
+    * </ul>
+    * 
+    * @param request
+    *           the servlet request.
+    * @param response
+    *           the servlet response.
+    * @throws ServletException
+    * @throws IOException
+    */
+   private void dispatch(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+      if (portlet == null) {
+         throw new javax.servlet.UnavailableException("Portlet " + portletName + " unavailable");
+      }
+
+      // Retrieve attributes from the servlet request.
+      Integer methodId = (Integer) request.getAttribute(PortletInvokerService.METHOD_ID);
+
+      final PortletRequest portletRequest = (PortletRequest) request
+            .getAttribute(PortletInvokerService.PORTLET_REQUEST);
+
+      final PortletResponse portletResponse = (PortletResponse) request
+            .getAttribute(PortletInvokerService.PORTLET_RESPONSE);
+
+      final PortletRequestContext requestContext = (PortletRequestContext) portletRequest
+            .getAttribute(PortletInvokerService.REQUEST_CONTEXT);
+      final PortletResponseContext responseContext = (PortletResponseContext) portletRequest
+            .getAttribute(PortletInvokerService.RESPONSE_CONTEXT);
+
+      final FilterManager filterManager = (FilterManager) request.getAttribute(PortletInvokerService.FILTER_MANAGER);
+
+      request.removeAttribute(PortletInvokerService.METHOD_ID);
+      request.removeAttribute(PortletInvokerService.PORTLET_REQUEST);
+      request.removeAttribute(PortletInvokerService.PORTLET_RESPONSE);
+      request.removeAttribute(PortletInvokerService.FILTER_MANAGER);
+
+      requestContext.init(portletConfig, getServletContext(), request, response);
+      responseContext.init(request, response);
+
+      PortletWindow window = requestContext.getPortletWindow();
+
+      PortletInvocationEvent event = new PortletInvocationEvent(portletRequest, window, methodId.intValue());
+
+      notify(event, true, null);
+
+      // FilterManager filtermanager = (FilterManager) request.getAttribute(
+      // "filter-manager");
+
+      try {
+
+         // The requested method is RENDER: call Portlet.render(..)
+         if (methodId == PortletInvokerService.METHOD_RENDER) {
+            RenderRequest renderRequest = (RenderRequest) portletRequest;
+            RenderResponse renderResponse = (RenderResponse) portletResponse;
+            filterManager.processFilter(renderRequest, renderResponse, portlet, portletContext);
+         }
+
+         // The requested method is HEADER: call
+         // HeaderPortlet.renderHeaders(..)
+         else if (methodId == PortletInvokerService.METHOD_HEADER) {
+            HeaderRequest headerRequest = (HeaderRequest) portletRequest;
+            HeaderResponse headerResponse = (HeaderResponse) portletResponse;
+            filterManager.processFilter(headerRequest, headerResponse, headerPortlet, portletContext);
+         }
+
+         // The requested method is RESOURCE: call
+         // ResourceServingPortlet.serveResource(..)
+         else if (methodId == PortletInvokerService.METHOD_RESOURCE) {
+            ResourceRequest resourceRequest = (ResourceRequest) portletRequest;
+
+            // if pageState != null, we're dealing with a Partial Action request, so
+            // store the page state string as a request attribute
+            PortletResourceRequestContext rc = (PortletResourceRequestContext) requestContext;
+            String ps = rc.getPageState();
+            if (ps != null) {
+               resourceRequest.setAttribute(ResourceRequest.PAGE_STATE, ps);
             }
-            else if (e == null)
-            {
-                listener.onEnd(event);
-            }
-            else
-            {
-                listener.onError(event, e);
+
+            ResourceResponse resourceResponse = (ResourceResponse) portletResponse;
+            filterManager.processFilter(resourceRequest, resourceResponse, resourceServingPortlet, portletContext);
+         }
+
+         // The requested method is ACTION: call Portlet.processAction(..)
+         else if (methodId == PortletInvokerService.METHOD_ACTION) {
+            ActionRequest actionRequest = (ActionRequest) portletRequest;
+            ActionResponse actionResponse = (ActionResponse) portletResponse;
+            filterManager.processFilter(actionRequest, actionResponse, portlet, portletContext);
+         }
+
+         // The request methode is Event: call Portlet.processEvent(..)
+         else if (methodId == PortletInvokerService.METHOD_EVENT) {
+            EventRequest eventRequest = (EventRequest) portletRequest;
+            EventResponse eventResponse = (EventResponse) portletResponse;
+            filterManager.processFilter(eventRequest, eventResponse, eventPortlet, portletContext);
+         }
+         // The requested method is ADMIN: call handlers.
+         else if (methodId == PortletInvokerService.METHOD_ADMIN) {
+            PortalAdministrationService pas = PlutoServices.getServices().getPortalAdministrationService();
+
+            for (AdministrativeRequestListener l : pas.getAdministrativeRequestListeners()) {
+               l.administer(portletRequest, portletResponse);
             }
-        }
-    }
-
-    private void initializeEventPortlet()
-    {
-        if (portlet instanceof EventPortlet)
-        {
-            eventPortlet = (EventPortlet) portlet;
-        }
-        else
-        {
-            eventPortlet = new NullPortlet();
-        }
-    }
-
-    private void initializeResourceServingPortlet()
-    {
-        if (portlet instanceof ResourceServingPortlet)
-        {
-            resourceServingPortlet = (ResourceServingPortlet) portlet;
-        }
-        else
-        {
-            resourceServingPortlet = new NullPortlet();
-        }
-    }
+         }
+
+         // The requested method is LOAD: do nothing.
+         else if (methodId == PortletInvokerService.METHOD_LOAD) {
+            // Do nothing.
+         }
+
+         notify(event, false, null);
+
+      } catch (UnavailableException ex) {
+         //
+         // if (e.isPermanent()) { throw new
+         // UnavailableException(e.getMessage()); } else { throw new
+         // UnavailableException(e.getMessage(), e.getUnavailableSeconds());
+         // }
+         //
+
+         // Portlet.destroy() isn't called by Tomcat, so we have to fix it.
+         try {
+            portlet.destroy();
+         } catch (Throwable th) {
+            // Don't care for Exception
+            this.getServletContext().log("Error during portlet destroy.", th);
+         }
+         // take portlet out of service
+         portlet = null;
+
+         // TODO: Handle everything as permanently for now.
+         throw new javax.servlet.UnavailableException(ex.getMessage());
+
+      } catch (PortletException ex) {
+         notify(event, false, ex);
+         throw new ServletException(ex);
+
+      }
+   }
+
+   protected void notify(PortletInvocationEvent event, boolean pre, Throwable e) {
+      PortalAdministrationService pas = PlutoServices.getServices().getPortalAdministrationService();
+
+      for (PortletInvocationListener listener : pas.getPortletInvocationListeners()) {
+         if (pre) {
+            listener.onBegin(event);
+         } else if (e == null) {
+            listener.onEnd(event);
+         } else {
+            listener.onError(event, e);
+         }
+      }
+   }
+
+   private void initializeEventPortlet() {
+      if (portlet instanceof EventPortlet) {
+         eventPortlet = (EventPortlet) portlet;
+      } else {
+         eventPortlet = new NullPortlet();
+      }
+   }
+
+   private void initializeResourceServingPortlet() {
+      if (portlet instanceof ResourceServingPortlet) {
+         resourceServingPortlet = (ResourceServingPortlet) portlet;
+      } else {
+         resourceServingPortlet = new NullPortlet();
+      }
+   }
+
+   private void initializeHeaderPortlet() {
+      if (portlet instanceof HeaderPortlet) {
+         headerPortlet = (HeaderPortlet) portlet;
+      } else {
+         headerPortlet = new NullPortlet();
+      }
+   }
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/65c0050b/pluto-container/src/main/java/org/apache/pluto/container/impl/HeaderRequestImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/HeaderRequestImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/HeaderRequestImpl.java
new file mode 100644
index 0000000..81863c4
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/HeaderRequestImpl.java
@@ -0,0 +1,40 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.impl;
+
+import javax.portlet.HeaderRequest;
+import javax.portlet.PortletRequest;
+
+import org.apache.pluto.container.PortletHeaderResponseContext;
+import org.apache.pluto.container.PortletRenderResponseContext;
+import org.apache.pluto.container.PortletRequestContext;
+
+/**
+ * The header request.
+ * 
+ * @author Scott Nicklous
+ */
+public class HeaderRequestImpl extends RenderRequestImpl implements HeaderRequest {
+   
+   HeaderRequestImpl(PortletRequestContext requestContext, PortletHeaderResponseContext responseContext) {
+      super(requestContext, responseContext, PortletRequest.HEADER_PHASE);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/65c0050b/pluto-container/src/main/java/org/apache/pluto/container/impl/HeaderResponseImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/HeaderResponseImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/HeaderResponseImpl.java
new file mode 100644
index 0000000..37845ed
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/HeaderResponseImpl.java
@@ -0,0 +1,127 @@
+/*
+ * 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.
+ */
+package org.apache.pluto.container.impl;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import javax.portlet.HeaderResponse;
+import javax.portlet.PortletMode;
+import javax.portlet.RenderResponse;
+
+import org.apache.pluto.container.PortletHeaderResponseContext;
+import org.apache.pluto.container.PortletRenderResponseContext;
+import org.apache.pluto.container.util.ArgumentUtility;
+
+
+/**
+ * Implementation of the <code>javax.portlet.RenderResponse</code> interface.
+ * 
+ */
+@SuppressWarnings("unchecked")
+public class HeaderResponseImpl extends MimeResponseImpl implements HeaderResponse
+{	
+    
+    public HeaderResponseImpl(PortletHeaderResponseContext responseContext)
+    {
+        super(responseContext);
+    }
+    
+    /**
+     * Checks if the specified content type is valid (supported by the portlet).
+     * The specified content type should be a tripped mime type without any
+     * character encoding suffix.
+     * @param contentType  the content type to check.
+     * @return true if the content type is valid, false otherwise.
+     */
+    protected boolean isValidContentType(String contentType)
+    {
+        boolean valid = false;
+        for (String supportedType : getResponseContentTypes())
+        {
+            // Content type is supported by an exact match.
+            if (supportedType.equals(contentType))
+            {
+                valid = true;
+            }
+            // The supported type contains a wildcard.
+            else if (supportedType.indexOf("*") >= 0)
+            {
+                int index = supportedType.indexOf("/");
+                String supportedPrefix = supportedType.substring(0, index);
+                String supportedSuffix = supportedType.substring(index + 1);
+                index = contentType.indexOf("/");
+                String typePrefix = contentType.substring(0, index);
+                String typeSuffix = contentType.substring(index + 1);
+                // Check if the prefixes match AND the suffixes match.
+                if (supportedPrefix.equals("*") || supportedPrefix.equals(typePrefix))
+                {
+                    if (supportedSuffix.equals("*") || supportedSuffix.equals(typeSuffix))
+                    {
+                        valid = true;
+                    }
+                }
+            }
+        }
+        // Return the check result.
+        return valid;
+    }
+    
+    @Override
+    public void setContentType(String contentType)
+    {
+        ArgumentUtility.validateNotNull("contentType", contentType);
+        int index =contentType.indexOf(';');
+        if (index != -1)
+        {
+            contentType = contentType.substring(0, index);
+        }
+        contentType = contentType.trim();
+        if (!isValidContentType(contentType))
+        {
+            throw new IllegalArgumentException("Specified content type '" + contentType + "' is not supported.");
+        }
+        super.setContentType(contentType);
+    }
+    
+    public void setNextPossiblePortletModes(Collection<? extends PortletMode> portletModes)
+    {
+        ArgumentUtility.validateNotNull("portletModes", portletModes);
+        if (portletModes.isEmpty())
+        {
+            throw new IllegalArgumentException("At least one possible PortletMode should be specified.");            
+        }
+        ArrayList<PortletMode> modes = new ArrayList<PortletMode>();
+        for (PortletMode mode : portletModes)
+        {
+            if (isPortletModeAllowed(mode))
+            {
+                modes.add(mode);
+            }
+        }
+        if (modes.isEmpty())
+        {
+            modes.add(getPortletWindow().getPortletMode());
+        }
+        ((PortletHeaderResponseContext) responseContext).setNextPossiblePortletModes(modes);
+    }
+    
+    public void setTitle(String title)
+    {
+       ((PortletHeaderResponseContext) responseContext).setTitle(title);
+    }
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/65c0050b/pluto-container/src/main/java/org/apache/pluto/container/impl/MimeResponseImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/MimeResponseImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/MimeResponseImpl.java
index 8958cf9..ac0efe2 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/MimeResponseImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/MimeResponseImpl.java
@@ -46,7 +46,7 @@ public class MimeResponseImpl extends PortletResponseImpl implements
    private boolean                    committed;
    private String                     contentType;
 
-   private PortletMimeResponseContext responseContext;
+   protected PortletMimeResponseContext responseContext;
 
    public MimeResponseImpl(PortletMimeResponseContext responseContext) {
       super(responseContext);

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/65c0050b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java
index 69b7c3f..84b5146 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java
@@ -24,6 +24,8 @@ import javax.portlet.ActionResponse;
 import javax.portlet.Event;
 import javax.portlet.EventRequest;
 import javax.portlet.EventResponse;
+import javax.portlet.HeaderRequest;
+import javax.portlet.HeaderResponse;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequest;
 import javax.portlet.RenderRequest;
@@ -40,6 +42,7 @@ import org.apache.pluto.container.PortletContainer;
 import org.apache.pluto.container.PortletContainerException;
 import org.apache.pluto.container.PortletEnvironmentService;
 import org.apache.pluto.container.PortletEventResponseContext;
+import org.apache.pluto.container.PortletHeaderResponseContext;
 import org.apache.pluto.container.PortletInvokerService;
 import org.apache.pluto.container.PortletRenderResponseContext;
 import org.apache.pluto.container.PortletRequestContext;
@@ -120,6 +123,55 @@ public class PortletContainerImpl implements PortletContainer
 
 
     /**
+     * Performs Header request for the portlet associated with the specified portlet window.
+     * @param portletWindow  the portlet window.
+     * @param request  the servlet request.
+     * @param response  the servlet response.
+     * @throws IllegalStateException  if the container is not initialized.
+     * @throws PortletException
+     * @throws IOException
+     * @throws PortletContainerException
+     * 
+     * @see javax.portlet.Portlet#header(HeaderRequest, HeaderResponse)
+     */
+    @Override
+    public void doHeader(PortletWindow portletWindow,
+            HttpServletRequest request,
+            HttpServletResponse response)
+    throws PortletException, IOException, PortletContainerException
+    {
+        ensureInitialized();
+
+        debugWithName("Header request received for portlet: "
+                + portletWindow.getPortletDefinition().getPortletName());
+
+        PortletRequestContextService rcService = getContainerServices().getPortletRequestContextService();
+        PortletEnvironmentService envService = getContainerServices().getPortletEnvironmentService();
+        PortletInvokerService invoker = getContainerServices().getPortletInvokerService();
+
+        PortletRequestContext requestContext = rcService.getPortletHeaderRequestContext(this, request, response, portletWindow);
+        PortletHeaderResponseContext responseContext = rcService.getPortletHeaderResponseContext(this, request, response, portletWindow);
+        HeaderRequest portletRequest = envService.createHeaderRequest(requestContext, responseContext);
+        HeaderResponse portletResponse = envService.createHeaderResponse(responseContext);
+
+        FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.HEADER_PHASE);
+
+        try
+        {
+            invoker.header(requestContext, portletRequest, portletResponse, filterManager);
+            // Mark portlet interaction is completed: backend implementation can flush response state now
+            responseContext.close();
+        }
+        finally
+        {
+            responseContext.release();
+        }
+
+        debugWithName("Portlet header done for: " + portletWindow.getPortletDefinition().getPortletName());
+    }
+
+
+    /**
      * Renders the portlet associated with the specified portlet window.
      * @param portletWindow  the portlet window.
      * @param request  the servlet request.
@@ -131,6 +183,7 @@ public class PortletContainerImpl implements PortletContainer
      * 
      * @see javax.portlet.Portlet#render(RenderRequest, RenderResponse)
      */
+    @Override
     public void doRender(PortletWindow portletWindow,
             HttpServletRequest request,
             HttpServletResponse response)

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/65c0050b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletEnvironmentServiceImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletEnvironmentServiceImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletEnvironmentServiceImpl.java
index 8849fb2..f7e41a0 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletEnvironmentServiceImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletEnvironmentServiceImpl.java
@@ -1,89 +1,102 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.impl;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.Event;
-import javax.portlet.EventRequest;
-import javax.portlet.EventResponse;
-import javax.portlet.PortletContext;
-import javax.portlet.PortletSession;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.ResourceRequest;
-import javax.portlet.ResourceResponse;
-import javax.servlet.http.HttpSession;
-
-import org.apache.pluto.container.PortletActionResponseContext;
-import org.apache.pluto.container.PortletEnvironmentService;
-import org.apache.pluto.container.PortletEventResponseContext;
-import org.apache.pluto.container.PortletRenderResponseContext;
-import org.apache.pluto.container.PortletRequestContext;
-import org.apache.pluto.container.PortletResourceRequestContext;
-import org.apache.pluto.container.PortletResourceResponseContext;
-import org.apache.pluto.container.PortletWindow;
-
-public class PortletEnvironmentServiceImpl implements PortletEnvironmentService
-{
-    public ActionRequest createActionRequest(PortletRequestContext requestContext, PortletActionResponseContext responseContext)
-    {
-        return new ActionRequestImpl(requestContext, responseContext);
-    }
-
-    public ActionResponse createActionResponse(PortletActionResponseContext responseContext)
-    {
-        return new ActionResponseImpl(responseContext);
-    }
-
-    public EventRequest createEventRequest(PortletRequestContext requestContext, PortletEventResponseContext responseContext, Event event)
-    {
-        return new EventRequestImpl(requestContext, responseContext, event);
-    }
-
-    public EventResponse createEventResponse(PortletEventResponseContext responseContext)
-    {
-        return new EventResponseImpl(responseContext);
-    }
-
-    public PortletSession createPortletSession(PortletContext portletContext, PortletWindow portletWindow,
-                                               HttpSession session)
-    {
-        return new PortletSessionImpl(portletContext, portletWindow, session);
-    }
-
-    public RenderRequest createRenderRequest(PortletRequestContext requestContext, PortletRenderResponseContext responseContext)
-    {
-        return new RenderRequestImpl(requestContext, responseContext);
-    }
-
-    public RenderResponse createRenderResponse(PortletRenderResponseContext responseContext)
-    {
-        return new RenderResponseImpl(responseContext);
-    }
-
-    public ResourceRequest createResourceRequest(PortletResourceRequestContext requestContext, PortletResourceResponseContext responseContext)
-    {
-        return new ResourceRequestImpl(requestContext, responseContext);
-    }
-
-    public ResourceResponse createResourceResponse(PortletResourceResponseContext responseContext,
-                                                   String requestCacheLevel)
-    {
-        return new ResourceResponseImpl(responseContext, requestCacheLevel);
-    }
+/*
+ * 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.
+ */
+package org.apache.pluto.container.impl;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Event;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.HeaderRequest;
+import javax.portlet.HeaderResponse;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletSession;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.servlet.http.HttpSession;
+
+import org.apache.pluto.container.PortletActionResponseContext;
+import org.apache.pluto.container.PortletEnvironmentService;
+import org.apache.pluto.container.PortletEventResponseContext;
+import org.apache.pluto.container.PortletHeaderResponseContext;
+import org.apache.pluto.container.PortletRenderResponseContext;
+import org.apache.pluto.container.PortletRequestContext;
+import org.apache.pluto.container.PortletResourceRequestContext;
+import org.apache.pluto.container.PortletResourceResponseContext;
+import org.apache.pluto.container.PortletWindow;
+
+public class PortletEnvironmentServiceImpl implements PortletEnvironmentService
+{
+    public ActionRequest createActionRequest(PortletRequestContext requestContext, PortletActionResponseContext responseContext)
+    {
+        return new ActionRequestImpl(requestContext, responseContext);
+    }
+
+    public ActionResponse createActionResponse(PortletActionResponseContext responseContext)
+    {
+        return new ActionResponseImpl(responseContext);
+    }
+
+    public EventRequest createEventRequest(PortletRequestContext requestContext, PortletEventResponseContext responseContext, Event event)
+    {
+        return new EventRequestImpl(requestContext, responseContext, event);
+    }
+
+    public EventResponse createEventResponse(PortletEventResponseContext responseContext)
+    {
+        return new EventResponseImpl(responseContext);
+    }
+
+    public PortletSession createPortletSession(PortletContext portletContext, PortletWindow portletWindow,
+                                               HttpSession session)
+    {
+        return new PortletSessionImpl(portletContext, portletWindow, session);
+    }
+
+    public HeaderRequest createHeaderRequest(PortletRequestContext requestContext, PortletHeaderResponseContext responseContext)
+    {
+        return new HeaderRequestImpl(requestContext, responseContext);
+    }
+
+    public HeaderResponse createHeaderResponse(PortletHeaderResponseContext responseContext)
+    {
+        return new HeaderResponseImpl(responseContext);
+    }
+
+    public RenderRequest createRenderRequest(PortletRequestContext requestContext, PortletRenderResponseContext responseContext)
+    {
+        return new RenderRequestImpl(requestContext, responseContext);
+    }
+
+    public RenderResponse createRenderResponse(PortletRenderResponseContext responseContext)
+    {
+        return new RenderResponseImpl(responseContext);
+    }
+
+    public ResourceRequest createResourceRequest(PortletResourceRequestContext requestContext, PortletResourceResponseContext responseContext)
+    {
+        return new ResourceRequestImpl(requestContext, responseContext);
+    }
+
+    public ResourceResponse createResourceResponse(PortletResourceResponseContext responseContext,
+                                                   String requestCacheLevel)
+    {
+        return new ResourceResponseImpl(responseContext, requestCacheLevel);
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/65c0050b/pluto-container/src/main/java/org/apache/pluto/container/impl/RenderRequestImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/RenderRequestImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/RenderRequestImpl.java
index 821f85e..38e2fd6 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/RenderRequestImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/RenderRequestImpl.java
@@ -1,51 +1,64 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.impl;
-
-import javax.portlet.CacheControl;
-import javax.portlet.PortletRequest;
-import javax.portlet.RenderRequest;
-
-import org.apache.pluto.container.PortletRenderResponseContext;
-import org.apache.pluto.container.PortletRequestContext;
-
-/**
- * Implementation of the <code>javax.portlet.RenderRequest</code> interface.
- * 
- */
-public class RenderRequestImpl extends PortletRequestImpl implements RenderRequest 
-{
-    private CacheControl cacheControl;
-    
-    public RenderRequestImpl(PortletRequestContext requestContext, PortletRenderResponseContext responseContext) 
-    {
-        super(requestContext, responseContext, PortletRequest.RENDER_PHASE);
-        this.cacheControl = responseContext.getCacheControl();
-    }
-
-    @Override
-    public String getProperty(String name)
-    {
-        String result = getMimeRequestProperty(name, cacheControl);
-        return result != null ? result : super.getProperty(name);
-   }
-
-    public String getETag()
-    {
-        return cacheControl.getETag();
-    }
-}
+/*
+ * 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.
+ */
+package org.apache.pluto.container.impl;
+
+import javax.portlet.CacheControl;
+import javax.portlet.PortletRequest;
+import javax.portlet.RenderRequest;
+
+import org.apache.pluto.container.PortletMimeResponseContext;
+import org.apache.pluto.container.PortletRenderResponseContext;
+import org.apache.pluto.container.PortletRequestContext;
+
+/**
+ * Implementation of the <code>javax.portlet.RenderRequest</code> interface.
+ * 
+ */
+public class RenderRequestImpl extends PortletRequestImpl implements RenderRequest 
+{
+    private CacheControl cacheControl;
+    
+    public RenderRequestImpl(PortletRequestContext requestContext, PortletRenderResponseContext responseContext) 
+    {
+        super(requestContext, responseContext, PortletRequest.RENDER_PHASE);
+        this.cacheControl = responseContext.getCacheControl();
+    }
+    
+    /**
+     * For use in HeaderRequestImpl constructor.
+     * @param requestContext
+     * @param responseContext
+     * @param lifecyclePhase
+     */
+    public RenderRequestImpl(PortletRequestContext requestContext, PortletMimeResponseContext responseContext, String lifecyclePhase) 
+    {
+        super(requestContext, responseContext, lifecyclePhase);
+        this.cacheControl = responseContext.getCacheControl();
+    }
+
+    @Override
+    public String getProperty(String name)
+    {
+        String result = getMimeRequestProperty(name, cacheControl);
+        return result != null ? result : super.getProperty(name);
+   }
+
+    public String getETag()
+    {
+        return cacheControl.getETag();
+    }
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/65c0050b/pluto-container/src/main/java/org/apache/pluto/container/impl/RenderResponseImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/RenderResponseImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/RenderResponseImpl.java
index 04b41ea..7ed3d24 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/RenderResponseImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/RenderResponseImpl.java
@@ -30,14 +30,13 @@ import org.apache.pluto.container.util.ArgumentUtility;
  * Implementation of the <code>javax.portlet.RenderResponse</code> interface.
  * 
  */
+@SuppressWarnings("unchecked")
 public class RenderResponseImpl extends MimeResponseImpl implements RenderResponse
 {	
-    private PortletRenderResponseContext responseContext;
     
     public RenderResponseImpl(PortletRenderResponseContext responseContext)
     {
         super(responseContext);
-        this.responseContext = responseContext;
     }
     
     /**
@@ -116,11 +115,11 @@ public class RenderResponseImpl extends MimeResponseImpl implements RenderRespon
         {
             modes.add(getPortletWindow().getPortletMode());
         }
-        responseContext.setNextPossiblePortletModes(modes);
+        ((PortletRenderResponseContext) responseContext).setNextPossiblePortletModes(modes);
     }
     
     public void setTitle(String title)
     {
-        responseContext.setTitle(title);
+       ((PortletRenderResponseContext) responseContext).setTitle(title);
     }
 }


[16/38] portals-pluto git commit: Replaced code that reads the deployment descriptor with an implementation that can be better extended to add v3.0 support. Added test cases. Uses jaxb binding classes that are generated at compile time.

Posted by ms...@apache.org.
Replaced code that reads the deployment descriptor with an implementation
that can be better extended to add v3.0 support. Added test cases. Uses jaxb
binding classes that are generated at compile time.


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/bf15b331
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/bf15b331
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/bf15b331

Branch: refs/heads/V3Prototype
Commit: bf15b331ee77a3aa5956f1a4ddddac3a70d41b0d
Parents: 4bd6c63
Author: Scott Nicklous <ms...@apache.org>
Authored: Mon Oct 26 11:03:14 2015 +0100
Committer: Scott Nicklous <ms...@apache.org>
Committed: Mon Oct 26 11:06:49 2015 +0100

----------------------------------------------------------------------
 .../container/om/portlet/CustomPortletMode.java |   62 +-
 .../container/om/portlet/CustomWindowState.java |   56 +-
 .../pluto/container/om/portlet/Description.java |   57 +-
 .../container/om/portlet/EventDefinition.java   |   80 +-
 .../om/portlet/EventDefinitionReference.java    |   51 +-
 .../pluto/container/om/portlet/Filter.java      |   84 +-
 .../pluto/container/om/portlet/InitParam.java   |   62 +-
 .../pluto/container/om/portlet/Listener.java    |   65 +-
 .../portlet/PortletApplicationDefinition.java   |   98 +-
 .../container/om/portlet/PortletDefinition.java |  162 +-
 .../pluto/container/om/portlet/Preferences.java |   56 +-
 .../om/portlet/PublicRenderParameter.java       |   69 +-
 .../om/portlet/SecurityConstraint.java          |   62 +-
 .../container/om/portlet/SecurityRoleRef.java   |   62 +-
 .../pluto/container/om/portlet/Supports.java    |   59 +-
 .../container/om/portlet/UserAttribute.java     |   56 +-
 .../om/portlet/UserDataConstraint.java          |   64 +-
 pluto-container/pom.xml                         |  329 ++--
 .../impl/AbstractPortletConfigImpl.java         |    4 +-
 .../impl/PortletAppDescriptorServiceImpl.java   |  388 +---
 .../om/portlet/impl/ConfigurationHolder.java    |  190 ++
 .../om/portlet/impl/ConfigurationProcessor.java |  161 ++
 .../impl/ContainerRuntimeOptionImpl.java        |   81 +
 .../om/portlet/impl/CustomPortletModeImpl.java  |  124 ++
 .../om/portlet/impl/CustomWindowStateImpl.java  |  104 ++
 .../om/portlet/impl/DescriptionImpl.java        |  100 ++
 .../om/portlet/impl/DisplayNameImpl.java        |   95 +
 .../om/portlet/impl/EventDefinitionImpl.java    |  179 ++
 .../impl/EventDefinitionReferenceImpl.java      |   70 +
 .../container/om/portlet/impl/FilterImpl.java   |  194 ++
 .../om/portlet/impl/FilterMappingImpl.java      |   78 +
 .../om/portlet/impl/InitParamImpl.java          |  118 ++
 .../impl/JSR168ConfigurationProcessor.java      |  564 ++++++
 .../impl/JSR286ConfigurationProcessor.java      |  895 ++++++++++
 .../impl/JSR362ConfigurationProcessor.java      |  895 ++++++++++
 .../container/om/portlet/impl/ListenerImpl.java |  141 ++
 .../impl/PortletApplicationDefinitionImpl.java  |  489 ++++++
 .../om/portlet/impl/PortletDefinitionImpl.java  |  488 +++++
 .../om/portlet/impl/PortletInfoImpl.java        |  106 ++
 .../om/portlet/impl/PreferenceImpl.java         |  104 ++
 .../om/portlet/impl/PreferencesImpl.java        |  102 ++
 .../portlet/impl/PublicRenderParameterImpl.java |  130 ++
 .../om/portlet/impl/SecurityConstraintImpl.java |  117 ++
 .../om/portlet/impl/SecurityRoleRefImpl.java    |  115 ++
 .../container/om/portlet/impl/SupportsImpl.java |  105 ++
 .../om/portlet/impl/UserAttributeImpl.java      |   97 +
 .../om/portlet/impl/UserDataConstraintImpl.java |   97 +
 .../impl/ContainerRuntimeOptionType.java        |   60 -
 .../portlet10/impl/CustomPortletModeType.java   |   58 -
 .../portlet10/impl/CustomWindowStateType.java   |   58 -
 .../om/portlet10/impl/DescriptionType.java      |   58 -
 .../om/portlet10/impl/DisplayNameType.java      |   61 -
 .../om/portlet10/impl/InitParamType.java        |   62 -
 .../om/portlet10/impl/ObjectFactory.java        |   53 -
 .../om/portlet10/impl/PortletAppType.java       |  471 -----
 .../portlet10/impl/PortletCollectionType.java   |   54 -
 .../om/portlet10/impl/PortletInfoType.java      |   60 -
 .../portlet10/impl/PortletPreferencesType.java  |   54 -
 .../om/portlet10/impl/PortletType.java          |   97 -
 .../om/portlet10/impl/PreferenceType.java       |   61 -
 .../portlet10/impl/SecurityConstraintType.java  |   58 -
 .../om/portlet10/impl/SecurityRoleRefType.java  |   66 -
 .../om/portlet10/impl/SupportsType.java         |   59 -
 .../om/portlet10/impl/UserAttributeType.java    |   59 -
 .../portlet10/impl/UserDataConstraintType.java  |   58 -
 .../om/portlet10/impl/package-info.java         |   21 -
 .../impl/ContainerRuntimeOptionType.java        |   87 -
 .../portlet20/impl/CustomPortletModeType.java   |  121 --
 .../portlet20/impl/CustomWindowStateType.java   |  107 --
 .../om/portlet20/impl/DescriptionType.java      |  120 --
 .../om/portlet20/impl/DisplayNameType.java      |  122 --
 .../impl/EventDefinitionReferenceType.java      |   85 -
 .../om/portlet20/impl/EventDefinitionType.java  |  161 --
 .../om/portlet20/impl/FilterMappingType.java    |   88 -
 .../container/om/portlet20/impl/FilterType.java |  214 ---
 .../om/portlet20/impl/InitParamType.java        |  121 --
 .../om/portlet20/impl/ListenerType.java         |  142 --
 .../om/portlet20/impl/ObjectFactory.java        |   53 -
 .../om/portlet20/impl/PortletAppType.java       |  551 ------
 .../portlet20/impl/PortletCollectionType.java   |   64 -
 .../om/portlet20/impl/PortletInfoType.java      |   92 -
 .../portlet20/impl/PortletPreferencesType.java  |  101 --
 .../om/portlet20/impl/PortletType.java          |  521 ------
 .../om/portlet20/impl/PreferenceType.java       |   98 --
 .../impl/PublicRenderParameterType.java         |  156 --
 .../portlet20/impl/SecurityConstraintType.java  |  128 --
 .../om/portlet20/impl/SecurityRoleRefType.java  |  125 --
 .../om/portlet20/impl/SupportsType.java         |  118 --
 .../om/portlet20/impl/UserAttributeType.java    |  108 --
 .../portlet20/impl/UserDataConstraintType.java  |  107 --
 .../om/portlet20/impl/package-info.java         |   21 -
 .../impl/ContainerRuntimeOptionType.java        |   87 -
 .../portlet30/impl/CustomPortletModeType.java   |  121 --
 .../portlet30/impl/CustomWindowStateType.java   |  107 --
 .../om/portlet30/impl/DescriptionType.java      |  120 --
 .../om/portlet30/impl/DisplayNameType.java      |  122 --
 .../impl/EventDefinitionReferenceType.java      |   85 -
 .../om/portlet30/impl/EventDefinitionType.java  |  161 --
 .../om/portlet30/impl/FilterMappingType.java    |   88 -
 .../container/om/portlet30/impl/FilterType.java |  214 ---
 .../om/portlet30/impl/InitParamType.java        |  121 --
 .../om/portlet30/impl/ListenerType.java         |  142 --
 .../om/portlet30/impl/ObjectFactory.java        |   53 -
 .../om/portlet30/impl/PortletAppType.java       |  551 ------
 .../portlet30/impl/PortletCollectionType.java   |   64 -
 .../om/portlet30/impl/PortletInfoType.java      |   92 -
 .../portlet30/impl/PortletPreferencesType.java  |  101 --
 .../om/portlet30/impl/PortletType.java          |  521 ------
 .../om/portlet30/impl/PreferenceType.java       |   98 --
 .../impl/PublicRenderParameterType.java         |  156 --
 .../portlet30/impl/SecurityConstraintType.java  |  128 --
 .../om/portlet30/impl/SecurityRoleRefType.java  |  125 --
 .../om/portlet30/impl/SupportsType.java         |  118 --
 .../om/portlet30/impl/UserAttributeType.java    |  108 --
 .../portlet30/impl/UserDataConstraintType.java  |  107 --
 .../om/portlet30/impl/package-info.java         |   21 -
 .../pluto/container/impl/portlet-app_1_0.xsd    | 1259 +++++++------
 .../pluto/container/impl/portlet-app_2_0.xsd    | 1660 +++++++++---------
 .../pluto/container/impl/portlet-app_3_0.xsd    |    2 +-
 .../apache/pluto/container/impl/web-app_2_3.dtd | 1063 -----------
 .../pluto/container/impl/BaseJaxbTestSuite.java |   36 +
 .../impl/JaxBDescriptorServiceImplTest.java     |  468 -----
 .../container/impl/JaxbReadTest168Gen.java      |   98 ++
 .../pluto/container/impl/JaxbReadTest168NC.java |  101 ++
 .../container/impl/JaxbReadTest286Gen.java      |  138 ++
 .../pluto/container/impl/JaxbReadTest286NC.java |   99 ++
 .../container/impl/JaxbReadTest362Gen.java      |  121 ++
 .../om/portlet/impl/fixtures/TestEventType.java |   28 +
 .../om/portlet/impl/fixtures/TestFilter.java    |   50 +
 .../om/portlet/impl/fixtures/TestListener.java  |   28 +
 .../om/portlet/impl/fixtures/TestPortlet.java   |   64 +
 .../impl/fixtures/TestPreferencesValidator.java |   37 +
 .../jsr168/CustomPortletMode168ImplTest.java    |  128 ++
 .../jsr168/CustomWindowState168ImplTest.java    |  128 ++
 ...PortletApplicationDefinition168ImplTest.java |  113 ++
 .../jsr168/PortletDefinition168ImplTest.java    |  426 +++++
 .../jsr168/SecurityConstraint168ImplTest.java   |  122 ++
 .../impl/jsr168/UserAttribute168ImplTest.java   |  133 ++
 .../jsr168/UserDataConstraint168ImplTest.java   |  105 ++
 .../jsr286/CustomPortletMode286ImplTest.java    |  140 ++
 .../jsr286/CustomWindowState286ImplTest.java    |  128 ++
 ...PortletApplicationDefinition286ImplTest.java |  652 +++++++
 .../jsr286/PortletDefinition286ImplTest.java    |  538 ++++++
 .../jsr286/SecurityConstraint286ImplTest.java   |  122 ++
 ...tandAloneContainerRuntimeOptionImplTest.java |   98 ++
 .../impl/jsr286/UserAttribute286ImplTest.java   |  133 ++
 .../jsr286/UserDataConstraint286ImplTest.java   |  105 ++
 .../jsr362/CustomPortletMode362ImplTest.java    |  140 ++
 .../jsr362/CustomWindowState362ImplTest.java    |  128 ++
 ...PortletApplicationDefinition362ImplTest.java |  652 +++++++
 .../jsr362/PortletDefinition362ImplTest.java    |  538 ++++++
 .../jsr362/SecurityConstraint362ImplTest.java   |  122 ++
 ...tandAloneContainerRuntimeOptionImplTest.java |   98 ++
 .../impl/jsr362/UserAttribute362ImplTest.java   |  133 ++
 .../jsr362/UserDataConstraint362ImplTest.java   |  105 ++
 .../src/test/resources/META-INF/beans.xml       |   10 +
 .../container/om/portlet/portlet-app_2_0.xml    |  121 ++
 .../om/portlet/portlet168Generated.xml          |   80 +
 .../container/om/portlet/portlet168NoCache.xml  |   53 +
 .../om/portlet/portlet286Generated.xml          |  154 ++
 .../container/om/portlet/portlet286NoCache.xml  |   90 +
 .../om/portlet/portlet362Generated.xml          |  156 ++
 .../container/om/portlet/webApp23simple.xml     |   23 +
 .../container/om/portlet/webApp24simple.xml     |   24 +
 .../container/om/portlet/webApp25simple.xml     |   12 +
 .../container/om/portlet/webApp30simple.xml     |   30 +
 .../container/om/portlet/webApp31simple.xml     |   22 +
 pom.xml                                         |    6 +-
 168 files changed, 14819 insertions(+), 12816 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/CustomPortletMode.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/CustomPortletMode.java b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/CustomPortletMode.java
index 6e541d6..0a05e91 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/CustomPortletMode.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/CustomPortletMode.java
@@ -1,32 +1,32 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet;
-
-import java.util.List;
-import java.util.Locale;
-
-public interface CustomPortletMode {
-
-    String getPortletMode();
-    
-	boolean isPortalManaged();
-	void setPortalManaged(boolean portalManaged);
-
-	Description getDescription(Locale locale);
-	List<? extends Description> getDescriptions();
-	Description addDescription(String lang);
+/*
+ * 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.
+ */
+package org.apache.pluto.container.om.portlet;
+
+import java.util.List;
+import java.util.Locale;
+
+public interface CustomPortletMode {
+
+    String getPortletMode();
+    
+	boolean isPortalManaged();
+	void setPortalManaged(boolean portalManaged);
+
+	Description getDescription(Locale locale);
+	List<Description> getDescriptions();
+	void addDescription(Description desc);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/CustomWindowState.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/CustomWindowState.java b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/CustomWindowState.java
index 2d3ba3b..391b587 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/CustomWindowState.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/CustomWindowState.java
@@ -1,29 +1,29 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet;
-
-import java.util.List;
-import java.util.Locale;
-
-public interface CustomWindowState {
-
-    String getWindowState();
-
-    Description getDescription(Locale locale);
-	List<? extends Description> getDescriptions();
-    Description addDescription(String lang);
+/*
+ * 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.
+ */
+package org.apache.pluto.container.om.portlet;
+
+import java.util.List;
+import java.util.Locale;
+
+public interface CustomWindowState {
+
+    String getWindowState();
+
+    Description getDescription(Locale locale);
+	 List<Description> getDescriptions();
+    void addDescription(Description desc);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Description.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Description.java b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Description.java
index ff5f38f..9f3294c 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Description.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Description.java
@@ -1,29 +1,30 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet;
-
-import java.util.Locale;
-
-public interface Description {
-
-    String getLang();
-    
-	String getDescription();
-	void setDescription(String description);
-
-	Locale getLocale();
+/*
+ * 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.
+ */
+package org.apache.pluto.container.om.portlet;
+
+import java.util.Locale;
+
+public interface Description {
+
+    String getLang();
+   void setLang(String lang);
+    
+	String getDescription();
+	void setDescription(String description);
+
+	Locale getLocale();
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/EventDefinition.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/EventDefinition.java b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/EventDefinition.java
index 601dfdb..040fd8f 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/EventDefinition.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/EventDefinition.java
@@ -1,40 +1,42 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet;
-
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.namespace.QName;
-
-public interface EventDefinition
-{
-    QName getQName();
-    String getName();
-    
-	List<QName> getAliases();
-	void addAlias(QName qName);
-
-	Description getDescription(Locale locale);
-    List<? extends Description> getDescriptions();
-    Description addDescription(String lang);
-	
-	String getValueType();
-	void setValueType(String valueType);
-
-	QName getQualifiedName(String defaultNamespace);
+/*
+ * 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.
+ */
+package org.apache.pluto.container.om.portlet;
+
+import java.util.List;
+import java.util.Locale;
+
+import javax.xml.namespace.QName;
+
+public interface EventDefinition
+{
+    QName getQName();
+   void setQName(QName qn);
+    
+	List<QName> getAliases();
+	void addAlias(QName qName);
+
+	Description getDescription(Locale locale);
+   List<Description> getDescriptions();
+   void addDescription(Description desc);
+   DisplayName getDisplayName(Locale locale);
+   List<DisplayName> getDisplayNames();
+   void addDisplayName(DisplayName desc);
+	
+	String getValueType();
+	void setValueType(String valueType);
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/EventDefinitionReference.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/EventDefinitionReference.java b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/EventDefinitionReference.java
index f6ca059..db6d8ff 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/EventDefinitionReference.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/EventDefinitionReference.java
@@ -1,28 +1,25 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet;
-
-import javax.xml.namespace.QName;
-
-public interface EventDefinitionReference {
-
-	QName getQName();
-
-	String getName();	
-	
-	QName getQualifiedName(String defaultNamespace);	
+/*
+ * 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.
+ */
+package org.apache.pluto.container.om.portlet;
+
+import javax.xml.namespace.QName;
+
+public interface EventDefinitionReference {
+
+   QName getQualifiedName();	
+	void setQualifiedName(QName qn);	
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Filter.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Filter.java b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Filter.java
index 95e169a..d03f1be 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Filter.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Filter.java
@@ -1,43 +1,43 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet;
-
-import java.util.List;
-import java.util.Locale;
-
-public interface Filter {
-
-    String getFilterName();
-
-    Description getDescription(Locale locale);
-    List<? extends Description> getDescriptions();
-    Description addDescription(String lang);
-
-	DisplayName getDisplayName(Locale locale);
-	List<? extends DisplayName> getDisplayNames();
-	DisplayName addDisplayName(String lang);
-
-	String getFilterClass();
-	void setFilterClass(String filterClass);
-
-	InitParam getInitParam(String paramName);
-	List<? extends InitParam> getInitParams();
-	InitParam addInitParam(String paramName);
-
-	List<String> getLifecycles();
-	void addLifecycle(String lifecycle);
+/*
+ * 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.
+ */
+package org.apache.pluto.container.om.portlet;
+
+import java.util.List;
+import java.util.Locale;
+
+public interface Filter {
+
+    String getFilterName();
+
+    Description getDescription(Locale locale);
+   List<Description> getDescriptions();
+   void addDescription(Description desc);
+
+	DisplayName getDisplayName(Locale locale);
+   List<DisplayName> getDisplayNames();
+   void addDisplayName(DisplayName dn);
+
+	String getFilterClass();
+	void setFilterClass(String filterClass);
+
+	InitParam getInitParam(String paramName);
+   List<InitParam> getInitParams();
+   void addInitParam(InitParam ip);
+
+	List<String> getLifecycles();
+	void addLifecycle(String lifecycle);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/InitParam.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/InitParam.java b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/InitParam.java
index b9669ad..a331b58 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/InitParam.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/InitParam.java
@@ -1,32 +1,32 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet;
-
-import java.util.List;
-import java.util.Locale;
-
-public interface InitParam {
-
-	String getParamName();
-
-	String getParamValue();
-	void setParamValue(String paramValue);
-
-	Description getDescription(Locale locale);
-    List<? extends Description> getDescriptions();
-    Description addDescription(String lang);
+/*
+ * 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.
+ */
+package org.apache.pluto.container.om.portlet;
+
+import java.util.List;
+import java.util.Locale;
+
+public interface InitParam {
+
+   String getParamName();
+
+   String getParamValue();
+   void setParamValue(String paramValue);
+
+   Description getDescription(Locale locale);
+   List<Description> getDescriptions();
+   void addDescription(Description desc);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Listener.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Listener.java b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Listener.java
index 0d4a9bb..c1e7fdf 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Listener.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Listener.java
@@ -1,33 +1,34 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet;
-
-import java.util.List;
-import java.util.Locale;
-
-public interface Listener {
-    
-    String getListenerClass();
-
-    Description getDescription(Locale locale);
-    List<? extends Description> getDescriptions();
-    Description addDescription(String lang);
-	
-	DisplayName getDisplayName(Locale locale);
-    List<? extends DisplayName> getDisplayNames();
-    DisplayName addDisplayName(String lang);
+/*
+ * 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.
+ */
+package org.apache.pluto.container.om.portlet;
+
+import java.util.List;
+import java.util.Locale;
+
+public interface Listener {
+    
+   String getListenerClass();
+   void setListenerClass(String cls);
+
+   Description getDescription(Locale locale);
+   List<Description> getDescriptions();
+   void addDescription(Description desc);
+   
+   DisplayName getDisplayName(Locale locale);
+   List<DisplayName> getDisplayNames();
+   void addDisplayName(DisplayName dispName);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/PortletApplicationDefinition.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/PortletApplicationDefinition.java b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/PortletApplicationDefinition.java
index 8f98611..80b3d76 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/PortletApplicationDefinition.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/PortletApplicationDefinition.java
@@ -24,68 +24,70 @@ import javax.xml.namespace.QName;
 
 public interface PortletApplicationDefinition {
 
-    String JSR_168_VERSION = "1.0";
-    String JSR_286_VERSION = "2.0";
-    String JSR_362_VERSION = "3.0";
+   String JSR_168_VERSION = "1.0";
+   String JSR_286_VERSION = "2.0";
+   String JSR_362_VERSION = "3.0";
 
-    String getName();
-    void setName(String name);
+   String getName();
+   void setName(String name);
+
+   String getId();
+   void setId(String id);
     
-    String getContextPath();
-    void setContextPath(String contextPath);
+   String getContextPath();
+   void setContextPath(String contextPath);
     
-    PortletDefinition getPortlet(String portletName);
-	List<? extends PortletDefinition> getPortlets();
-	PortletDefinition addPortlet(String name);
-	
-	List<? extends EventDefinition> getEventDefinitions();
-	EventDefinition addEventDefinition(String name);
-    EventDefinition addEventDefinition(QName qname);
+   PortletDefinition getPortlet(String portletName);
+   List<PortletDefinition> getPortlets();
+   void addPortlet(PortletDefinition pd);
+   
+   List<EventDefinition> getEventDefinitions();
+   EventDefinition getEventDefinition(QName qn);
+   void addEventDefinition(EventDefinition ed);
 
-	PublicRenderParameter getPublicRenderParameter(String identifier);
-	List<? extends PublicRenderParameter> getPublicRenderParameters();
-	PublicRenderParameter addPublicRenderParameter(String name, String identifier);
-    PublicRenderParameter addPublicRenderParameter(QName qname, String identifier);
+   PublicRenderParameter getPublicRenderParameter(String identifier);
+   List<PublicRenderParameter> getPublicRenderParameters();
+   void addPublicRenderParameter(PublicRenderParameter prp);
 
-	String getVersion();
-	void setVersion(String version);
+   String getVersion();
+   void setVersion(String version);
 
-	CustomPortletMode getCustomPortletMode(String name);
-	List<? extends CustomPortletMode> getCustomPortletModes();
-	CustomPortletMode addCustomPortletMode(String name);
+   CustomPortletMode getCustomPortletMode(String name);
+   List<CustomPortletMode> getCustomPortletModes();
+   void addCustomPortletMode(CustomPortletMode cpm);
 
-    CustomWindowState getCustomWindowState(String name);
-	List<? extends CustomWindowState> getCustomWindowStates();
-	CustomWindowState addCustomWindowState(String name);
+   CustomWindowState getCustomWindowState(String name);
+   List<CustomWindowState> getCustomWindowStates();
+   void addCustomWindowState(CustomWindowState cws);
 
-	UserAttribute getUserAttribute(String name);
-	List<? extends UserAttribute> getUserAttributes();
-	UserAttribute addUserAttribute(String name);
+   UserAttribute getUserAttribute(String name);
+   List<UserAttribute> getUserAttributes();
+   void addUserAttribute(UserAttribute ua);
 
-	List<? extends SecurityConstraint> getSecurityConstraints();
-	SecurityConstraint addSecurityConstraint(String transportGuarantee);
+   List<SecurityConstraint> getSecurityConstraints();
+   void addSecurityConstraint(SecurityConstraint sc);
 
-	String getResourceBundle();
-	void setResourceBundle(String resourceBundle);
+   String getResourceBundle();
+   void setResourceBundle(String resourceBundle);
 
-	Filter getFilter(String filterName);
-	List<? extends Filter> getFilters();
-	Filter addFilter(String filterName);
+   Filter getFilter(String filterName);
+   List<Filter> getFilters();
+   void addFilter(Filter filter);
 
-	FilterMapping getFilterMapping(String filterName);
-	List<? extends FilterMapping> getFilterMappings();
-	FilterMapping addFilterMapping(String filterName);
+   FilterMapping getFilterMapping(String filterName);
+   List<FilterMapping> getFilterMappings();
+   void addFilterMapping(FilterMapping fm);
 
-	List<? extends Listener> getListeners();
-	Listener addListener(String listenerClass);
+   List<Listener> getListeners();
+   void addListener(Listener listener);
 
-	String getDefaultNamespace();
-	void setDefaultNamespace(String defaultNamespace);
+   String getDefaultNamespace();
+   void setDefaultNamespace(String defaultNamespace);
 
-	ContainerRuntimeOption getContainerRuntimeOption(String name);
-	List<? extends ContainerRuntimeOption> getContainerRuntimeOptions();
-	ContainerRuntimeOption addContainerRuntimeOption(String name);
+   ContainerRuntimeOption getContainerRuntimeOption(String name);
+   List<ContainerRuntimeOption> getContainerRuntimeOptions();
+   void addContainerRuntimeOption(ContainerRuntimeOption cro);
 
-    Map<Locale, String> getLocaleEncodingMappings();
-    void addLocaleEncodingMapping(Locale locale, String encoding);
+   Map<Locale, String> getLocaleEncodingMappings();
+   void addLocaleEncodingMapping(Locale locale, String encoding);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/PortletDefinition.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/PortletDefinition.java b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/PortletDefinition.java
index 2a17249..8d3250c 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/PortletDefinition.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/PortletDefinition.java
@@ -1,83 +1,81 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet;
-
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.namespace.QName;
-
-public interface PortletDefinition {
-    
-    String getPortletName();
-
-    PortletApplicationDefinition getApplication();
-
-    InitParam getInitParam(String paramName);
-	List<? extends InitParam> getInitParams();
-	InitParam addInitParam(String paramName);
-	
-	String getPortletClass();
-	void setPortletClass(String portletClass);
-
-	PortletInfo getPortletInfo();
-
-	Preferences getPortletPreferences();
-
-    List<? extends EventDefinitionReference> getSupportedProcessingEvents();
-    EventDefinitionReference addSupportedProcessingEvent(QName qname);
-    EventDefinitionReference addSupportedProcessingEvent(String name);
-    
-    List<? extends EventDefinitionReference> getSupportedPublishingEvents();
-    EventDefinitionReference addSupportedPublishingEvent(QName qname);
-    EventDefinitionReference addSupportedPublishingEvent(String name);
-
-	List<String> getSupportedPublicRenderParameters();
-	void addSupportedPublicRenderParameter(String identifier);
-
-	String getResourceBundle();
-	void setResourceBundle(String resourceBundle);
-
-	SecurityRoleRef getSecurityRoleRef(String roleName);
-	List<? extends SecurityRoleRef> getSecurityRoleRefs();
-	SecurityRoleRef addSecurityRoleRef(String roleName);
-
-	Supports getSupports(String mimeType);
-	List<? extends Supports> getSupports();
-	Supports addSupports(String mimeType);
-
-	Description getDescription(Locale locale);
-    List<? extends Description> getDescriptions();
-    Description addDescription(String lang);
-
-	DisplayName getDisplayName(Locale locale);
-    List<? extends DisplayName> getDisplayNames();
-    DisplayName addDisplayName(String lang);
-
-	List<String> getSupportedLocales();
-	void addSupportedLocale(String lang);
-
-	int getExpirationCache();
-    void setExpirationCache(int expirationCache);
-
-	String getCacheScope();
-	void setCacheScope(String cacheScope);
-
-	ContainerRuntimeOption getContainerRuntimeOption(String name);
-	List<? extends ContainerRuntimeOption> getContainerRuntimeOptions();
-	ContainerRuntimeOption addContainerRuntimeOption(String name);
+/*
+ * 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.
+ */
+package org.apache.pluto.container.om.portlet;
+
+import java.util.List;
+import java.util.Locale;
+
+public interface PortletDefinition {
+    
+   String getPortletName();
+
+   PortletApplicationDefinition getApplication();
+
+   InitParam getInitParam(String paramName);
+   List<InitParam> getInitParams();
+   void addInitParam(InitParam ip);
+   
+   String getPortletClass();
+   void setPortletClass(String portletClass);
+
+   PortletInfo getPortletInfo();
+   void setPortletInfo(PortletInfo info);
+
+   Preferences getPortletPreferences();
+   void setPortletPreferences(Preferences prefs);
+
+   List<EventDefinitionReference> getSupportedProcessingEvents();
+   void addSupportedProcessingEvent(EventDefinitionReference edr);
+    
+   List<EventDefinitionReference> getSupportedPublishingEvents();
+   void addSupportedPublishingEvent(EventDefinitionReference edr);
+
+   List<String> getSupportedPublicRenderParameters();
+   void addSupportedPublicRenderParameter(String identifier);
+
+   String getResourceBundle();
+   void setResourceBundle(String resourceBundle);
+
+   SecurityRoleRef getSecurityRoleRef(String roleName);
+   List<SecurityRoleRef> getSecurityRoleRefs();
+   void addSecurityRoleRef(SecurityRoleRef srr);
+
+   Supports getSupports(String mimeType);
+   List<Supports> getSupports();
+   void addSupports(Supports supps);
+
+   Description getDescription(Locale locale);
+   List<Description> getDescriptions();
+   void addDescription(Description desc);
+
+   DisplayName getDisplayName(Locale locale);
+   List<DisplayName> getDisplayNames();
+   void addDisplayName(DisplayName dn);
+
+   List<String> getSupportedLocales();
+   void addSupportedLocale(String lang);
+
+   int getExpirationCache();
+   void setExpirationCache(int expirationCache);
+
+   String getCacheScope();
+   void setCacheScope(String cacheScope);
+
+   ContainerRuntimeOption getContainerRuntimeOption(String name);
+   List<ContainerRuntimeOption> getContainerRuntimeOptions();
+   void addContainerRuntimeOption(ContainerRuntimeOption cro);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Preferences.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Preferences.java b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Preferences.java
index 6c05fdd..25e8393 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Preferences.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Preferences.java
@@ -1,29 +1,29 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet;
-
-import java.util.List;
-
-public interface Preferences {
-
-    Preference getPortletPreference(String name);
-	List<? extends Preference> getPortletPreferences();
-	Preference addPreference(String name);
-
-	String getPreferencesValidator();
-	void setPreferencesValidator(String preferencesValidator);
+/*
+ * 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.
+ */
+package org.apache.pluto.container.om.portlet;
+
+import java.util.List;
+
+public interface Preferences {
+
+   Preference getPortletPreference(String name);
+   List<Preference> getPortletPreferences();
+   void addPreference(Preference pref);
+
+   String getPreferencesValidator();
+   void setPreferencesValidator(String preferencesValidator);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/PublicRenderParameter.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/PublicRenderParameter.java b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/PublicRenderParameter.java
index 711a8df..7c0297e 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/PublicRenderParameter.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/PublicRenderParameter.java
@@ -1,36 +1,35 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet;
-
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.namespace.QName;
-
-public interface PublicRenderParameter {
-
-    QName getQName();
-    String getName();
-    String getIdentifier();
-
-    Description getDescription(Locale locale);
-    List<? extends Description> getDescriptions();
-    Description addDescription(String lang);
-
-	List<QName> getAliases();
-	void addAlias(QName alias);
+/*
+ * 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.
+ */
+package org.apache.pluto.container.om.portlet;
+
+import java.util.List;
+import java.util.Locale;
+
+import javax.xml.namespace.QName;
+
+public interface PublicRenderParameter {
+
+   QName getQName();
+   String getIdentifier();
+
+   Description getDescription(Locale locale);
+   List<Description> getDescriptions();
+   void addDescription(Description desc);
+
+   List<QName> getAliases();
+   void addAlias(QName alias);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/SecurityConstraint.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/SecurityConstraint.java b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/SecurityConstraint.java
index 3aa1e23..caa9e0f 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/SecurityConstraint.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/SecurityConstraint.java
@@ -1,32 +1,32 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet;
-
-import java.util.List;
-import java.util.Locale;
-
-public interface SecurityConstraint {
-    
-    UserDataConstraint getUserDataConstraint();
-
-    DisplayName getDisplayName(Locale locale);
-    List<? extends DisplayName> getDisplayNames();
-    DisplayName addDisplayName(String lang);
-	
-    List<String> getPortletNames();
-    void addPortletName(String portletName);
+/*
+ * 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.
+ */
+package org.apache.pluto.container.om.portlet;
+
+import java.util.List;
+import java.util.Locale;
+
+public interface SecurityConstraint {
+    
+    UserDataConstraint getUserDataConstraint();
+
+    DisplayName getDisplayName(Locale locale);
+    List<DisplayName> getDisplayNames();
+    void addDisplayName(DisplayName dispName);
+	
+    List<String> getPortletNames();
+    void addPortletName(String portletName);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/SecurityRoleRef.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/SecurityRoleRef.java b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/SecurityRoleRef.java
index 0977dc0..64d30b7 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/SecurityRoleRef.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/SecurityRoleRef.java
@@ -1,32 +1,32 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet;
-
-import java.util.List;
-import java.util.Locale;
-
-public interface SecurityRoleRef {
-
-	String getRoleName();
-
-	String getRoleLink();
-	void setRoleLink(String roleLink);
-
-	Description getDescription(Locale locale);
-    List<? extends Description> getDescriptions();
-    Description addDescription(String lang);
+/*
+ * 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.
+ */
+package org.apache.pluto.container.om.portlet;
+
+import java.util.List;
+import java.util.Locale;
+
+public interface SecurityRoleRef {
+
+   String getRoleName();
+
+   String getRoleLink();
+   void setRoleLink(String roleLink);
+
+   Description getDescription(Locale locale);
+   List<Description> getDescriptions();
+   void addDescription(Description desc);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Supports.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Supports.java b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Supports.java
index e5f55d5..3b6ca55 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Supports.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/Supports.java
@@ -1,30 +1,31 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet;
-
-import java.util.List;
-
-public interface Supports {
-
-	String getMimeType();
-
-	List<String> getPortletModes();
-	void addPortletMode(String portletMode);
-
-	List<String> getWindowStates();
-    void addWindowState(String windowState);
+/*
+ * 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.
+ */
+package org.apache.pluto.container.om.portlet;
+
+import java.util.List;
+
+public interface Supports {
+
+   String getMimeType();
+   void setMimeType(String mt);
+
+   List<String> getPortletModes();
+   void addPortletMode(String portletMode);
+
+   List<String> getWindowStates();
+   void addWindowState(String windowState);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/UserAttribute.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/UserAttribute.java b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/UserAttribute.java
index 97e0d55..fe9ae34 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/UserAttribute.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/UserAttribute.java
@@ -1,29 +1,29 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet;
-
-import java.util.List;
-import java.util.Locale;
-
-public interface UserAttribute {
-    
-    String getName();
-
-    Description getDescription(Locale locale);
-    List<? extends Description> getDescriptions();
-    Description addDescription(String lang);
+/*
+ * 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.
+ */
+package org.apache.pluto.container.om.portlet;
+
+import java.util.List;
+import java.util.Locale;
+
+public interface UserAttribute {
+    
+    String getName();
+
+    Description getDescription(Locale locale);
+    List<Description> getDescriptions();
+    void addDescription(Description desc);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/UserDataConstraint.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/UserDataConstraint.java b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/UserDataConstraint.java
index 36f858a..b0c1028 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/UserDataConstraint.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/om/portlet/UserDataConstraint.java
@@ -1,33 +1,33 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet;
-
-import java.util.List;
-import java.util.Locale;
-
-public interface UserDataConstraint {
-
-	String NONE = "NONE";
-	String INTEGRAL = "INTEGRAL";
-	String CONFIDENTIAL = "CONFIDENTIAL";
-
-    String getTransportGuarantee();
-    
-	Description getDescription(Locale locale);
-    List<? extends Description> getDescriptions();
-    Description addDescription(String lang);
+/*
+ * 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.
+ */
+package org.apache.pluto.container.om.portlet;
+
+import java.util.List;
+import java.util.Locale;
+
+public interface UserDataConstraint {
+
+   String NONE = "NONE";
+   String INTEGRAL = "INTEGRAL";
+   String CONFIDENTIAL = "CONFIDENTIAL";
+
+   String getTransportGuarantee();
+    
+   Description getDescription(Locale locale);
+   List<Description> getDescriptions();
+   void addDescription(Description desc);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/pom.xml
----------------------------------------------------------------------
diff --git a/pluto-container/pom.xml b/pluto-container/pom.xml
index 437a0f3..26ed23b 100644
--- a/pluto-container/pom.xml
+++ b/pluto-container/pom.xml
@@ -1,166 +1,187 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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
+<!-- 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"
+>
 
-   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.portals.pluto</groupId>
-    <artifactId>pluto</artifactId>
-    <version>3.0-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>pluto-container</artifactId>
-  <packaging>bundle</packaging>
-  <name>Apache Pluto Portlet Container</name>
-  <description>The Apache Pluto portlet container.</description>
-
-  <dependencies>
-    <dependency>
+   <modelVersion>4.0.0</modelVersion>
+   <parent>
       <groupId>org.apache.portals.pluto</groupId>
-      <artifactId>pluto-container-api</artifactId>
-      <version>${project.version}</version>
-      <scope>provided</scope>
-    </dependency>
-
-    <!-- Other Support Libraries =========================================== -->
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-      <scope>compile</scope>
-    </dependency>
+      <artifactId>pluto</artifactId>
+      <version>3.0-SNAPSHOT</version>
+   </parent>
 
-    <!-- Specification Libraries =========================================== -->
-    <dependency>
-      <groupId>org.apache.portals.pluto</groupId>
-      <artifactId>portlet-api</artifactId>
-      <version>${project.version}</version>
-      <scope>provided</scope>
-    </dependency>
+   <artifactId>pluto-container</artifactId>
+   <packaging>bundle</packaging>
+   <name>Apache Pluto Portlet Container</name>
+   <description>The Apache Pluto portlet container.</description>
 
-    <dependency>
-      <groupId>org.apache.tomcat</groupId>
-      <artifactId>tomcat-servlet-api</artifactId>
-      <scope>provided</scope>
-    </dependency>
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.portals.pluto</groupId>
+         <artifactId>pluto-container-api</artifactId>
+         <version>${project.version}</version>
+         <scope>provided</scope>
+      </dependency>
 
-    <dependency>
-      <groupId>javax.xml.bind</groupId>
-      <artifactId>jaxb-api</artifactId>
-      <scope>${dependency.scope}</scope>
-    </dependency>
+      <!-- Other Support Libraries =========================================== -->
+      <dependency>
+         <groupId>org.slf4j</groupId>
+         <artifactId>slf4j-api</artifactId>
+         <scope>compile</scope>
+      </dependency>
 
-    <dependency>
-      <groupId>com.sun.xml.bind</groupId>
-      <artifactId>jaxb-impl</artifactId>
-      <scope>${dependency.scope}</scope>
-    </dependency>
-    <dependency>
-      <groupId>stax</groupId>
-      <artifactId>stax</artifactId>
-      <scope>${dependency.scope}</scope>
-      <exclusions>
-        <exclusion>
-          <groupId>stax</groupId>
-          <artifactId>stax-api</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
+      <!-- Specification Libraries =========================================== -->
+      <dependency>
+         <groupId>org.apache.portals.pluto</groupId>
+         <artifactId>portlet-api</artifactId>
+         <version>${project.version}</version>
+         <scope>provided</scope>
+      </dependency>
 
-    <!--  CCPP Libraries -->
-    <dependency>
-      <groupId>javax.ccpp</groupId>
-      <artifactId>ccpp</artifactId>
-      <scope>provided</scope>
-    </dependency>
+      <dependency>
+         <groupId>org.apache.tomcat</groupId>
+         <artifactId>tomcat-servlet-api</artifactId>
+         <scope>provided</scope>
+      </dependency>
 
-    <!-- Testing Libraries ================================================= -->
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-jdk14</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>jmock</groupId>
-      <artifactId>jmock</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>jmock</groupId>
-      <artifactId>jmock-cglib</artifactId>
-    </dependency>
-  </dependencies>
+      <!-- CCPP Libraries -->
+      <dependency>
+         <groupId>javax.ccpp</groupId>
+         <artifactId>ccpp</artifactId>
+         <scope>provided</scope>
+      </dependency>
 
-  <build>
-    <resources>
-      <resource>
-        <directory>src/main/resources</directory>
-        <filtering>true</filtering>
-      </resource>
-    </resources>
-    <testResources>
-      <testResource>
-        <directory>src/main/resources</directory>
-        <filtering>true</filtering>
-      </testResource>
-    </testResources>
+      <!-- Testing Libraries ================================================= -->
+      <dependency>
+         <groupId>org.slf4j</groupId>
+         <artifactId>slf4j-jdk14</artifactId>
+         <scope>test</scope>
+      </dependency>
+      <dependency>
+         <groupId>junit</groupId>
+         <artifactId>junit</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>jmock</groupId>
+         <artifactId>jmock</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>jmock</groupId>
+         <artifactId>jmock-cglib</artifactId>
+      </dependency>
+   </dependencies>
 
-    <plugins>
-      <!-- Surefire Plugin: Exec Tests ===================================== -->
-      <plugin>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <configuration>
-          <includes>
-            <include>**/*Test.java</include>
-          </includes>
-          <excludes>
-            <exclude>**/PlutoTestCase.java</exclude>
-          </excludes>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.rat</groupId>
-        <artifactId>apache-rat-plugin</artifactId>
-        <configuration>
-          <excludes>
-            <exclude>src/main/resources/org/apache/pluto/container/impl/portlet-app_1_0.xsd</exclude>
-            <exclude>src/main/resources/org/apache/pluto/container/impl/portlet-app_2_0.xsd</exclude>
-            <exclude>src/main/resources/org/apache/pluto/container/impl/web-app_2_3.dtd</exclude>
-          </excludes>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <configuration>
-          <instructions>
-            <Export-Package>org.apache.pluto.container.impl,
-              org.apache.pluto.container.om.portlet.impl,
-              org.apache.pluto.container.om.portlet10.impl,
-              org.apache.pluto.container.util
-            </Export-Package>
-          </instructions>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
+   <build>
+<!--   
+      <resources>
+         <resource>
+            <directory>src/main/resources</directory>
+            <filtering>true</filtering>
+         </resource>
+      </resources>
+      <testResources>
+         <testResource>
+            <directory>src/test/resources</directory>
+            <filtering>true</filtering>
+         </testResource>
+      </testResources>
+ --> 
+      <plugins>
+         <!-- Surefire Plugin: Exec Tests ===================================== -->
+         <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+               <includes>
+                  <include>**/*ImplTest.java</include>
+                  <include>**/*TestSuite.java</include>
+               </includes>
+               <excludes>
+                  <exclude>**/PlutoTestCase.java</exclude>
+               </excludes>
+            </configuration>
+         </plugin>
+         <plugin>
+            <groupId>org.apache.rat</groupId>
+            <artifactId>apache-rat-plugin</artifactId>
+            <configuration>
+               <excludes>
+                  <exclude>src/main/resources/org/apache/pluto/container/impl/portlet-app_1_0.xsd</exclude>
+                  <exclude>src/main/resources/org/apache/pluto/container/impl/portlet-app_2_0.xsd</exclude>
+                  <exclude>src/main/resources/org/apache/pluto/container/impl/web-app_2_3.dtd</exclude>
+               </excludes>
+            </configuration>
+         </plugin>
+         <plugin>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>maven-bundle-plugin</artifactId>
+            <configuration>
+               <instructions>
+                  <Export-Package>org.apache.pluto.container.impl,
+                     org.apache.pluto.container.om.portlet.impl,
+                     org.apache.pluto.container.util
+                  </Export-Package>
+               </instructions>
+            </configuration>
+         </plugin>
+         <plugin>
+            <groupId>org.jvnet.jaxb2.maven2</groupId>
+            <artifactId>maven-jaxb2-plugin</artifactId>
+            <version>0.12.3</version>
+            <executions>
+               <execution>
+                  <id>portlet1-generate</id>
+                  <goals>
+                     <goal>generate</goal>
+                  </goals>
+                  <configuration>
+                     <schemaDirectory>src/main/resources/org/apache/pluto/container/impl</schemaDirectory>
+                     <schemaIncludes>
+                        <include>portlet-app_1_0.xsd</include>
+                     </schemaIncludes>
+                     <generatePackage>org.apache.pluto.container.om.portlet10.impl</generatePackage>
+                     <generateDirectory>${project.build.directory}/generated-sources/xjc1</generateDirectory>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>portlet2-generate</id>
+                  <goals>
+                     <goal>generate</goal>
+                  </goals>
+                  <configuration>
+                     <schemaDirectory>src/main/resources/org/apache/pluto/container/impl</schemaDirectory>
+                     <schemaIncludes>
+                        <include>portlet-app_2_0.xsd</include>
+                     </schemaIncludes>
+                     <generatePackage>org.apache.pluto.container.om.portlet20.impl</generatePackage>
+                     <generateDirectory>${project.build.directory}/generated-sources/xjc2</generateDirectory>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>portlet3-generate</id>
+                  <goals>
+                     <goal>generate</goal>
+                  </goals>
+                  <configuration>
+                     <schemaDirectory>src/main/resources/org/apache/pluto/container/impl</schemaDirectory>
+                     <schemaIncludes>
+                        <include>portlet-app_3_0.xsd</include>
+                     </schemaIncludes>
+                     <generatePackage>org.apache.pluto.container.om.portlet30.impl</generatePackage>
+                     <generateDirectory>${project.build.directory}/generated-sources/xjc3</generateDirectory>
+                  </configuration>
+               </execution>
+            </executions>
+         </plugin>
+      </plugins>
+   </build>
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/impl/AbstractPortletConfigImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/AbstractPortletConfigImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/AbstractPortletConfigImpl.java
index b9c0556..28e7bb6 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/AbstractPortletConfigImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/AbstractPortletConfigImpl.java
@@ -135,7 +135,7 @@ public abstract class AbstractPortletConfigImpl implements PortletConfig
 	    ArrayList<QName> qnameList = new ArrayList<QName>();
         for (EventDefinitionReference ref : portlet.getSupportedProcessingEvents())
         {
-            QName name = ref.getQualifiedName(portlet.getApplication().getDefaultNamespace());
+            QName name = ref.getQualifiedName();
             if (name == null)
             {
                 continue;
@@ -149,7 +149,7 @@ public abstract class AbstractPortletConfigImpl implements PortletConfig
         ArrayList<QName> qnameList = new ArrayList<QName>();
         for (EventDefinitionReference ref : portlet.getSupportedPublishingEvents())
         {
-            QName name = ref.getQualifiedName(portlet.getApplication().getDefaultNamespace());
+            QName name = ref.getQualifiedName();
             if (name == null)
             {
                 continue;


[11/38] portals-pluto git commit: Replaced code that reads the deployment descriptor with an implementation that can be better extended to add v3.0 support. Added test cases. Uses jaxb binding classes that are generated at compile time.

Posted by ms...@apache.org.
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/SupportsType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/SupportsType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/SupportsType.java
deleted file mode 100644
index 729d552..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/SupportsType.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet10.impl;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-/**
- * Supports indicates the portlet modes a portlet supports for a specific content type. All portlets must support the
- * view mode. Used in: portlet <p>Java class for supportsType complex type. <p>The following schema fragment specifies
- * the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name="supportsType">
- *   &lt;complexContent>
- *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       &lt;sequence>
- *         &lt;element name="mime-type" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}mime-typeType"/>
- *         &lt;element name="portlet-mode" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}portlet-modeType" maxOccurs="unbounded" minOccurs="0"/>
- *       &lt;/sequence>
- *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     &lt;/restriction>
- *   &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "supportsType", propOrder = { "mimeType", "portletMode" })
-public class SupportsType
-{
-    @XmlElement(name = "mime-type", required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    String mimeType;
-    @XmlElement(name = "portlet-mode")
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    List<String> portletMode;
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/UserAttributeType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/UserAttributeType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/UserAttributeType.java
deleted file mode 100644
index 90e66a8..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/UserAttributeType.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet10.impl;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-/**
- * 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 <p>Java class
- * for user-attributeType complex type. <p>The following schema fragment specifies the expected content contained
- * within this class.
- * 
- * <pre>
- * &lt;complexType name="user-attributeType">
- *   &lt;complexContent>
- *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       &lt;sequence>
- *         &lt;element name="description" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}descriptionType" maxOccurs="unbounded" minOccurs="0"/>
- *         &lt;element name="name" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}nameType"/>
- *       &lt;/sequence>
- *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     &lt;/restriction>
- *   &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "user-attributeType", propOrder = { "description", "name" })
-public class UserAttributeType
-{
-    @XmlElement(name = "description")
-    List<DescriptionType> description;
-    @XmlElement(required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    String name;
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/UserDataConstraintType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/UserDataConstraintType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/UserDataConstraintType.java
deleted file mode 100644
index 34dee46..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/UserDataConstraintType.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet10.impl;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-/**
- * The user-data-constraintType is used to indicate how data communicated between the client and portlet should be
- * protected. Used in: security-constraint <p>Java class for user-data-constraintType complex type. <p>The following
- * schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name="user-data-constraintType">
- *   &lt;complexContent>
- *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       &lt;sequence>
- *         &lt;element name="description" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}descriptionType" maxOccurs="unbounded" minOccurs="0"/>
- *         &lt;element name="transport-guarantee" type="{http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd}transport-guaranteeType"/>
- *       &lt;/sequence>
- *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     &lt;/restriction>
- *   &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "user-data-constraintType", propOrder = { "description", "transportGuarantee" })
-public class UserDataConstraintType
-{
-    @XmlElement(name = "description")
-    List<DescriptionType> description;
-    @XmlElement(name = "transport-guarantee", required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    String transportGuarantee;
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/package-info.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/package-info.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/package-info.java
deleted file mode 100644
index 2f0ac1e..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet10/impl/package-info.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.
- * 
- * @version $Id$
- */
-@javax.xml.bind.annotation.XmlSchema(namespace = "http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
-package org.apache.pluto.container.om.portlet10.impl;
-

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/ContainerRuntimeOptionType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/ContainerRuntimeOptionType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/ContainerRuntimeOptionType.java
deleted file mode 100644
index a199c26..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/ContainerRuntimeOptionType.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.ContainerRuntimeOption;
-
-/**
- * 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 <p>Java class
- * for container-runtime-optionType complex type. <p>The following schema fragment specifies the expected content
- * contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;container-runtime-optionType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}nameType&quot;/&gt;
- *         &lt;element name=&quot;value&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}valueType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "container-runtime-optionType", propOrder = { "name", "value" })
-public class ContainerRuntimeOptionType implements ContainerRuntimeOption
-{
-    @XmlElement(required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String name;
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected List<String> value;
-
-    public String getName()
-    {
-        return name;
-    }
-
-    public void setName(String value)
-    {
-        name = value;
-    }
-
-    public List<String> getValues()
-    {
-        if (value == null)
-        {
-            value = new ArrayList<String>();
-        }
-        return value;
-    }
-
-    public void addValue(String value)
-    {
-        getValues().add(value);
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/CustomPortletModeType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/CustomPortletModeType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/CustomPortletModeType.java
deleted file mode 100644
index d6102ca..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/CustomPortletModeType.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.CustomPortletMode;
-import org.apache.pluto.container.om.portlet.Description;
-
-/**
- * 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 <p>Java class for custom-portlet-modeType complex type.
- * <p>The following schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;custom-portlet-modeType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;portlet-mode&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-modeType&quot;/&gt;
- *         &lt;element name=&quot;portal-managed&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portal-managedType&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "custom-portlet-modeType", propOrder = { "description", "portletMode", "portalManaged" })
-public class CustomPortletModeType implements CustomPortletMode
-{
-    @XmlElement(name = "description")
-    protected List<DescriptionType> description;
-    @XmlElement(name = "portlet-mode", required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String portletMode;
-    @XmlElement(name = "portal-managed")
-    protected Boolean portalManaged;
-    
-    public Description getDescription(Locale locale)
-    {
-        for (Description d : getDescriptions())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Description> getDescriptions()
-    {
-        if (description == null)
-        {
-            description = new ArrayList<DescriptionType>();
-        }
-        return description;
-    }
-    
-    public Description addDescription(String lang)
-    {
-        DescriptionType d = new DescriptionType();
-        d.setLang(lang);
-        if (getDescription(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
-        }
-        getDescriptions();
-        description.add(d);
-        return d;
-    }
-
-    public String getPortletMode()
-    {
-        return portletMode != null ? portletMode.toLowerCase() : null;
-    }
-
-    public void setPortletMode(String value)
-    {
-        portletMode = value.toLowerCase();
-    }
-
-    public boolean isPortalManaged()
-    {
-        return portalManaged != null ? portalManaged.booleanValue() : true;
-    }
-
-    public void setPortalManaged(boolean value)
-    {
-        portalManaged = value ? Boolean.TRUE : Boolean.FALSE;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/CustomWindowStateType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/CustomWindowStateType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/CustomWindowStateType.java
deleted file mode 100644
index 2cf0cab..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/CustomWindowStateType.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.CustomWindowState;
-import org.apache.pluto.container.om.portlet.Description;
-
-/**
- * A custom window state that one or more portlets in this portlet application supports. Used in: portlet-app <p>Java
- * class for custom-window-stateType complex type. <p>The following schema fragment specifies the expected content
- * contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;custom-window-stateType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;window-state&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}window-stateType&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "custom-window-stateType", propOrder = { "description", "windowState" })
-public class CustomWindowStateType implements CustomWindowState
-{
-    @XmlElement(name = "description")
-    protected List<DescriptionType> description;
-    @XmlElement(name = "window-state", required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String windowState;
-
-    public Description getDescription(Locale locale)
-    {
-        for (Description d : getDescriptions())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Description> getDescriptions()
-    {
-        if (description == null)
-        {
-            description = new ArrayList<DescriptionType>();
-        }
-        return description;
-    }
-    
-    public Description addDescription(String lang)
-    {
-        DescriptionType d = new DescriptionType();
-        d.setLang(lang);
-        if (getDescription(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
-        }
-        getDescriptions();
-        description.add(d);
-        return d;
-    }
-
-    public String getWindowState()
-    {
-        return windowState != null ? windowState.toLowerCase() : null;
-    }
-
-    public void setWindowState(String value)
-    {
-        windowState = value.toLowerCase();
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/DescriptionType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/DescriptionType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/DescriptionType.java
deleted file mode 100644
index 95e7c93..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/DescriptionType.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlValue;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.Description;
-
-/**
- * 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(“en�?). Used in: init-param,
- * portlet, portlet-app, security-role <p>Java class for descriptionType complex type. <p>The following schema
- * fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;descriptionType&quot;&gt;
- *   &lt;simpleContent&gt;
- *     &lt;extension base=&quot;&lt;http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd&gt;string&quot;&gt;
- *       &lt;attribute ref=&quot;{http://www.w3.org/XML/1998/namespace}lang&quot;/&gt;
- *     &lt;/extension&gt;
- *   &lt;/simpleContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "descriptionType", propOrder = { "value" })
-public class DescriptionType implements Description
-{
-    @XmlValue
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String value;
-    @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace")
-    protected String lang = null;
-    @XmlTransient
-    protected Locale locale;
-
-    public String getDescription()
-    {
-        return value;
-    }
-
-    public void setDescription(String value)
-    {
-        this.value = value;
-    }
-
-    public String getLang()
-    {
-        return lang == null ? Locale.ENGLISH.toString() : lang;
-    }
-
-    public void setLang(String value)
-    {
-        lang = value;
-        deriveLocale();
-    }
-    
-    public Locale getLocale()
-    {
-        return locale == null ? deriveLocale() : locale;
-    }
-    
-    protected Locale deriveLocale()
-    {
-        Locale locale = null;
-        String lang = this.getLang();
-        if (lang != null)
-        {
-            String country = "";
-            String variant = "";
-            String[] localeArray = lang.split("[-|_]");
-            for (int i = 0; i < localeArray.length; i++)
-            {
-                if (i == 0)
-                {
-                    lang = localeArray[i];
-                }
-                else if (i == 1)
-                {
-                    country = localeArray[i];
-                }
-                else if (i == 2)
-                {
-                    variant = localeArray[i];
-                }
-            }
-            locale = new Locale(lang, country, variant);
-        }
-        return this.locale = locale;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/DisplayNameType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/DisplayNameType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/DisplayNameType.java
deleted file mode 100644
index 5ec2507..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/DisplayNameType.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlValue;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.DisplayName;
-
-/**
- * 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: ...
- * 
- * <pre>
- * &lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;display-name xmlns="http://www.w3.org/2001/XMLSchema" xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="en"&gt;Employee Self Service&lt;/display-name&gt;
- * </pre>
- * 
- * 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(“en�?). <p>Java class for
- * display-nameType complex type. <p>The following schema fragment specifies the expected content contained within this
- * class.
- * 
- * <pre>
- * &lt;complexType name=&quot;display-nameType&quot;&gt;
- *   &lt;simpleContent&gt;
- *     &lt;extension base=&quot;&lt;http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd&gt;string&quot;&gt;
- *       &lt;attribute ref=&quot;{http://www.w3.org/XML/1998/namespace}lang&quot;/&gt;
- *     &lt;/extension&gt;
- *   &lt;/simpleContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "display-nameType", propOrder = { "value" })
-public class DisplayNameType implements DisplayName
-{
-    @XmlValue
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String value;
-    @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace")
-    protected String lang = null;
-    @XmlTransient
-    protected Locale locale;
-
-    public String getDisplayName()
-    {
-        return value;
-    }
-
-    public void setDisplayName(String value)
-    {
-        this.value = value;
-    }
-
-    public String getLang()
-    {
-        return lang == null ? Locale.ENGLISH.toString() : lang;
-    }
-
-    public void setLang(String value)
-    {
-        lang = value;
-    }
-
-    public Locale getLocale()
-    {
-        return locale == null ? deriveLocale() : locale;
-    }
-    
-    protected Locale deriveLocale()
-    {
-        Locale locale = null;
-        String lang = this.getLang();
-        if (lang != null)
-        {
-            String country = "";
-            String variant = "";
-            String[] localeArray = lang.split("[-|_]");
-            for (int i = 0; i < localeArray.length; i++)
-            {
-                if (i == 0)
-                {
-                    lang = localeArray[i];
-                }
-                else if (i == 1)
-                {
-                    country = localeArray[i];
-                }
-                else if (i == 2)
-                {
-                    variant = localeArray[i];
-                }
-            }
-            locale = new Locale(lang, country, variant);
-        }
-        return this.locale = locale;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/EventDefinitionReferenceType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/EventDefinitionReferenceType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/EventDefinitionReferenceType.java
deleted file mode 100644
index e6d83a7..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/EventDefinitionReferenceType.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import javax.xml.namespace.QName;
-
-import org.apache.pluto.container.om.portlet.EventDefinitionReference;
-
-/**
- * The event-definition-referenceType is used to reference events declared with the event-definition element at
- * application level. Used in: portlet <p>Java class for event-definition-referenceType complex type. <p>The following
- * schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;event-definition-referenceType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;choice&gt;
- *         &lt;element name=&quot;qname&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}QName&quot;/&gt;
- *         &lt;element name=&quot;name&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}NCName&quot;/&gt;
- *       &lt;/choice&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "event-definition-referenceType", propOrder = { "qname", "name" })
-public class EventDefinitionReferenceType implements EventDefinitionReference
-{
-    protected QName qname;
-    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
-    @XmlSchemaType(name = "NCName")
-    protected String name;
-
-    public QName getQName()
-    {
-        return qname;
-    }
-
-    public void setQName(QName value)
-    {
-        qname = value;
-        name = null;
-    }
-
-    public String getName()
-    {
-        return name;
-    }
-
-    public void setName(String value)
-    {
-        name = value;
-        qname = null;
-    }
-
-    public QName getQualifiedName(String defaultNamespace)
-    {
-        return qname != null ? qname : name != null ? new QName(defaultNamespace, name) : null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/EventDefinitionType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/EventDefinitionType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/EventDefinitionType.java
deleted file mode 100644
index eaaeeac..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/EventDefinitionType.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import javax.xml.namespace.QName;
-
-import org.apache.pluto.container.om.portlet.Description;
-import org.apache.pluto.container.om.portlet.EventDefinition;
-
-/**
- * The event-definitionType is used to declare events the portlet can either 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 <p>Java class
- * for event-definitionType complex type. <p>The following schema fragment specifies the expected content contained
- * within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;event-definitionType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;choice&gt;
- *           &lt;element name=&quot;qname&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}QName&quot;/&gt;
- *           &lt;element name=&quot;name&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}NCName&quot;/&gt;
- *         &lt;/choice&gt;
- *         &lt;element name=&quot;alias&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}QName&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;value-type&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}fully-qualified-classType&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "event-definitionType", propOrder = { "description", "qname", "name", "alias", "valueType" })
-public class EventDefinitionType implements EventDefinition
-{
-    @XmlElement(name = "description")
-    protected List<DescriptionType> description;
-    protected QName qname;
-    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
-    @XmlSchemaType(name = "NCName")
-    protected String name;
-    protected List<QName> alias;
-    @XmlElement(name = "value-type")
-    protected String valueType;
-
-    public Description getDescription(Locale locale)
-    {
-        for (Description d : getDescriptions())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Description> getDescriptions()
-    {
-        if (description == null)
-        {
-            description = new ArrayList<DescriptionType>();
-        }
-        return description;
-    }
-    
-    public Description addDescription(String lang)
-    {
-        DescriptionType d = new DescriptionType();
-        d.setLang(lang);
-        if (getDescription(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
-        }
-        getDescriptions();
-        description.add(d);
-        return d;
-    }
-
-    public QName getQName()
-    {
-        return qname;
-    }
-
-    public void setQName(QName value)
-    {
-        qname = value;
-        name = null;
-    }
-
-    public String getName()
-    {
-        return name;
-    }
-
-    public void setName(String value)
-    {
-        name = value;
-        qname = null;
-    }
-
-    public List<QName> getAliases()
-    {
-        if (alias == null)
-        {
-            alias = new ArrayList<QName>();
-        }
-        return alias;
-    }
-    
-    public void addAlias(QName alias)
-    {
-        // TODO: check for duplicates
-        getAliases().add(alias);
-    }
-
-    public String getValueType()
-    {
-        return valueType;
-    }
-
-    public void setValueType(String value)
-    {
-        valueType = value;
-    }
-
-    public QName getQualifiedName(String defaultNamespace)
-    {
-        return qname != null ? qname : name != null ? new QName(defaultNamespace, name) : null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/FilterMappingType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/FilterMappingType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/FilterMappingType.java
deleted file mode 100644
index 948bcbd..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/FilterMappingType.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.FilterMapping;
-
-/**
- * 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 <p>Java class for filter-mappingType
- * complex type. <p>The following schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;filter-mappingType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;filter-name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}filter-nameType&quot;/&gt;
- *         &lt;element name=&quot;portlet-name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-nameType&quot; maxOccurs=&quot;unbounded&quot;/&gt;
- *       &lt;/sequence&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "filter-mappingType", propOrder = { "filterName", "portletName" })
-public class FilterMappingType implements FilterMapping
-{
-    @XmlElement(name = "filter-name", required = true)
-    protected String filterName;
-    @XmlElement(name = "portlet-name", required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected List<String> portletName;
-
-    public String getFilterName()
-    {
-        return filterName;
-    }
-
-    public void setFilterName(String value)
-    {
-        filterName = value;
-    }
-
-    public List<String> getPortletNames()
-    {
-        if (portletName == null)
-        {
-            portletName = new ArrayList<String>();
-        }
-        return portletName;
-    }
-    
-    public void addPortletName(String name)
-    {
-        // TODO: check for duplicates
-        getPortletNames().add(name);
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/FilterType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/FilterType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/FilterType.java
deleted file mode 100644
index 9d26b93..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/FilterType.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-import org.apache.pluto.container.om.portlet.Description;
-import org.apache.pluto.container.om.portlet.DisplayName;
-import org.apache.pluto.container.om.portlet.Filter;
-import org.apache.pluto.container.om.portlet.InitParam;
-
-/**
- * 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 <p>Java class for
- * filterType complex type. <p>The following schema fragment specifies the expected content contained within this
- * class.
- * 
- * <pre>
- * &lt;complexType name=&quot;filterType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;display-name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}display-nameType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;filter-name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}filter-nameType&quot;/&gt;
- *         &lt;element name=&quot;filter-class&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}fully-qualified-classType&quot;/&gt;
- *         &lt;element name=&quot;lifecycle&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; maxOccurs=&quot;unbounded&quot;/&gt;
- *         &lt;element name=&quot;init-param&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}init-paramType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "filterType", propOrder = { "description", "displayName", "filterName", "filterClass", "lifecycle",
-                                           "initParam" })
-public class FilterType implements Filter
-{
-    @XmlElement(name = "description")
-    protected List<DescriptionType> description;
-    @XmlElement(name = "display-name")
-    protected List<DisplayNameType> displayName;
-    @XmlElement(name = "filter-name", required = true)
-    protected String filterName;
-    @XmlElement(name = "filter-class", required = true)
-    protected String filterClass;
-    @XmlElement(required = true)
-    protected List<String> lifecycle;
-    @XmlElement(name = "init-param")
-    protected List<InitParamType> initParam;
-
-    public Description getDescription(Locale locale)
-    {
-        for (Description d : getDescriptions())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Description> getDescriptions()
-    {
-        if (description == null)
-        {
-            description = new ArrayList<DescriptionType>();
-        }
-        return description;
-    }
-    
-    public Description addDescription(String lang)
-    {
-        DescriptionType d = new DescriptionType();
-        d.setLang(lang);
-        if (getDescription(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
-        }
-        getDescriptions();
-        description.add(d);
-        return d;
-    }
-
-    public DisplayName getDisplayName(Locale locale)
-    {
-        for (DisplayName d : getDisplayNames())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends DisplayName> getDisplayNames()
-    {
-        if (displayName == null)
-        {
-            displayName = new ArrayList<DisplayNameType>();
-        }
-        return displayName;
-    }
-    
-    public DisplayName addDisplayName(String lang)
-    {
-        DisplayNameType d = new DisplayNameType();
-        d.setLang(lang);
-        if (getDisplayName(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("DisplayName for language: "+d.getLocale()+" already defined");
-        }
-        getDisplayNames();
-        displayName.add(d);
-        return d;
-    }
-
-    public String getFilterName()
-    {
-        return filterName;
-    }
-
-    public void setFilterName(String value)
-    {
-        filterName = value;
-    }
-
-    public String getFilterClass()
-    {
-        return filterClass;
-    }
-
-    public void setFilterClass(String value)
-    {
-        filterClass = value;
-    }
-
-    public List<String> getLifecycles()
-    {
-        if (lifecycle == null)
-        {
-            lifecycle = new ArrayList<String>();
-        }
-        return lifecycle;
-    }
-    
-    public void addLifecycle(String name)
-    {
-        // TODO: check valid name and duplicates
-        getLifecycles().add(name);
-    }
-    
-    public InitParam getInitParam(String name)
-    {
-        for (InitParam param : getInitParams())
-        {
-            if (param.getParamName().equals(name))
-            {
-                return param;
-            }
-        }
-        return null;
-    }
-
-    public List<? extends InitParam> getInitParams()
-    {
-        if (initParam == null)
-        {
-            initParam = new ArrayList<InitParamType>();
-        }
-        return initParam;
-    }
-    
-    public InitParam addInitParam(String paramName)
-    {
-        if (getInitParam(paramName) != null)
-        {
-            throw new IllegalArgumentException("Init parameter: "+paramName+" already defined");
-        }
-        InitParamType param = new InitParamType();
-        param.setParamName(paramName);
-        getInitParams();
-        initParam.add(param);
-        return param;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/InitParamType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/InitParamType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/InitParamType.java
deleted file mode 100644
index b62732f..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/InitParamType.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.Description;
-import org.apache.pluto.container.om.portlet.InitParam;
-
-/**
- * The init-param element contains a name/value pair as an initialization param of the portlet Used in:portlet <p>Java
- * class for init-paramType complex type. <p>The following schema fragment specifies the expected content contained
- * within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;init-paramType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}nameType&quot;/&gt;
- *         &lt;element name=&quot;value&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}valueType&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "init-paramType", propOrder = { "description", "name", "value" })
-public class InitParamType implements InitParam
-{
-    @XmlElement(name = "description")
-    protected List<DescriptionType> description;
-    @XmlElement(required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String name;
-    @XmlElement(required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String value;
-
-    public Description getDescription(Locale locale)
-    {
-        for (Description d : getDescriptions())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Description> getDescriptions()
-    {
-        if (description == null)
-        {
-            description = new ArrayList<DescriptionType>();
-        }
-        return description;
-    }
-    
-    public Description addDescription(String lang)
-    {
-        DescriptionType d = new DescriptionType();
-        d.setLang(lang);
-        if (getDescription(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
-        }
-        getDescriptions();
-        description.add(d);
-        return d;
-    }
-
-    public String getParamName()
-    {
-        return name;
-    }
-
-    public void setParamName(String value)
-    {
-        name = value;
-    }
-
-    public String getParamValue()
-    {
-        return value;
-    }
-
-    public void setParamValue(String value)
-    {
-        this.value = value;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/ListenerType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/ListenerType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/ListenerType.java
deleted file mode 100644
index ddab472..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/ListenerType.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-import org.apache.pluto.container.om.portlet.Description;
-import org.apache.pluto.container.om.portlet.DisplayName;
-import org.apache.pluto.container.om.portlet.Listener;
-
-/**
- * The listenerType is used to declare listeners for this portlet application. Used in: portlet-app <p>Java class for
- * listenerType complex type. <p>The following schema fragment specifies the expected content contained within this
- * class.
- * 
- * <pre>
- * &lt;complexType name=&quot;listenerType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;display-name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}display-nameType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;listener-class&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}fully-qualified-classType&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "listenerType", propOrder = { "description", "displayName", "listenerClass" })
-public class ListenerType implements Listener
-{
-    @XmlElement(name = "description")
-    protected List<DescriptionType> description;
-    @XmlElement(name = "display-name")
-    protected List<DisplayNameType> displayName;
-    @XmlElement(name = "listener-class", required = true)
-    protected String listenerClass;
-
-    public Description getDescription(Locale locale)
-    {
-        for (Description d : getDescriptions())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Description> getDescriptions()
-    {
-        if (description == null)
-        {
-            description = new ArrayList<DescriptionType>();
-        }
-        return description;
-    }
-    
-    public Description addDescription(String lang)
-    {
-        DescriptionType d = new DescriptionType();
-        d.setLang(lang);
-        if (getDescription(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
-        }
-        getDescriptions();
-        description.add(d);
-        return d;
-    }
-
-    public DisplayName getDisplayName(Locale locale)
-    {
-        for (DisplayName d : getDisplayNames())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends DisplayName> getDisplayNames()
-    {
-        if (displayName == null)
-        {
-            displayName = new ArrayList<DisplayNameType>();
-        }
-        return displayName;
-    }
-    
-    public DisplayName addDisplayName(String lang)
-    {
-        DisplayNameType d = new DisplayNameType();
-        d.setLang(lang);
-        if (getDisplayName(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("DisplayName for language: "+d.getLocale()+" already defined");
-        }
-        getDisplayNames();
-        displayName.add(d);
-        return d;
-    }
-
-    public String getListenerClass()
-    {
-        return listenerClass;
-    }
-
-    public void setListenerClass(String value)
-    {
-        listenerClass = value;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/ObjectFactory.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/ObjectFactory.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/ObjectFactory.java
deleted file mode 100644
index 6fc2283..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/ObjectFactory.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlElementDecl;
-import javax.xml.bind.annotation.XmlRegistry;
-import javax.xml.namespace.QName;
-
-/**
- * This object contains factory methods for each Java content interface and Java element interface generated in the
- * org.apache.pluto.descriptors.portlet20 package. <p>An ObjectFactory allows you to programatically construct new
- * instances of the Java representation for XML content. The Java representation of XML content can consist of schema
- * derived interfaces and classes representing the binding of schema type definitions, element declarations and model
- * groups. Factory methods for each of these are provided in this class.
- * 
- * @version $Id$
- */
-@XmlRegistry
-public class ObjectFactory
-{
-    private final static QName _PortletApp_QNAME = new QName("http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd",
-                                                             "portlet-app");
-
-    public ObjectFactory()
-    {
-    }
-
-    public PortletAppType createPortletApp()
-    {
-        return new PortletAppType();
-    }
-
-    @XmlElementDecl(namespace = "http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd", name = "portlet-app")
-    public JAXBElement<PortletAppType> createPortletApp(PortletAppType value)
-    {
-        return new JAXBElement<PortletAppType>(_PortletApp_QNAME, PortletAppType.class, null, value);
-    }
-}


[37/38] portals-pluto git commit: Added some tests to the header portlet to make sure that the characters & and < are processed correctly within the script tag when a script tag is written to the output stream in the header phase. Modified Pluto implemen

Posted by ms...@apache.org.
Added some tests to the header portlet to make sure that the characters &
and < are processed correctly within the script tag when a script tag is
written to the output stream in the header phase. Modified Pluto
implementation to accommodate these characters.


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/d4424802
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/d4424802
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/d4424802

Branch: refs/heads/V3Prototype
Commit: d4424802772bec6e88f2d12f9a59df26ccd8aca7
Parents: 6dd6b87
Author: Scott Nicklous <ms...@apache.org>
Authored: Fri Nov 27 12:59:11 2015 +0100
Committer: Scott Nicklous <ms...@apache.org>
Committed: Fri Nov 27 12:59:11 2015 +0100

----------------------------------------------------------------------
 PortletV3Demo/pom.xml                           |  1 +
 .../main/java/basic/portlet/HeaderPortlet.java  |  2 +-
 .../webapp/WEB-INF/jsp/headSectionMarkup.jsp    |  3 +-
 PortletV3Demo/src/main/webapp/WEB-INF/web.xml   |  4 ---
 .../org/apache/pluto/container/HeaderData.java  | 29 ++++++++++++--------
 5 files changed, 22 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/d4424802/PortletV3Demo/pom.xml
----------------------------------------------------------------------
diff --git a/PortletV3Demo/pom.xml b/PortletV3Demo/pom.xml
index 3c23fdc..4f60abf 100644
--- a/PortletV3Demo/pom.xml
+++ b/PortletV3Demo/pom.xml
@@ -68,6 +68,7 @@
             <artifactId>maven-war-plugin</artifactId>
             <configuration>
                <archiveClasses>false</archiveClasses>
+               <failOnMissingWebXml>false</failOnMissingWebXml>
             </configuration>
          </plugin>
       </plugins>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/d4424802/PortletV3Demo/src/main/java/basic/portlet/HeaderPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/HeaderPortlet.java b/PortletV3Demo/src/main/java/basic/portlet/HeaderPortlet.java
index 95df1af..1310b48 100644
--- a/PortletV3Demo/src/main/java/basic/portlet/HeaderPortlet.java
+++ b/PortletV3Demo/src/main/java/basic/portlet/HeaderPortlet.java
@@ -82,7 +82,7 @@ public class HeaderPortlet extends GenericPortlet {
       resp.addProperty(c);
 
       // Set header
-      resp.setProperty("Portlet", this.getPortletName());
+      resp.addProperty("Portlet", this.getPortletName());
       resp.setProperty("Portal", "Pluto");
 
       PrintWriter writer = resp.getWriter();

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/d4424802/PortletV3Demo/src/main/webapp/WEB-INF/jsp/headSectionMarkup.jsp
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/headSectionMarkup.jsp b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/headSectionMarkup.jsp
index d15ad53..b3c4084 100644
--- a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/headSectionMarkup.jsp
+++ b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/headSectionMarkup.jsp
@@ -27,7 +27,7 @@ limitations under the License.
 <meta name="description" content="Portlet Hub Demo Portlet">
 <style>
 <!--
-.markupSection {
+.markupSection {                 /* special chars & < */
    padding: 5px;
    background-color: #DDFFDD;
    border: thin solid #22EE88;
@@ -44,6 +44,7 @@ bootstrap = function () {
    var cookies = document.cookie.split(';'), ii, markup;
    markup = '<p>Current Cookies:</p>';
    for (ii = 0; ii < cookies.length; ii++) {
+      /* make sure parser eats & character */
       markup += cookies[ii] + '<br/>';
    }
    document.getElementById(cdiv).innerHTML=markup;

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/d4424802/PortletV3Demo/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/webapp/WEB-INF/web.xml b/PortletV3Demo/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index 10055f0..0000000
--- a/PortletV3Demo/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-	<display-name>Portlet Version 3.0 Demo</display-name>
-</web-app>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/d4424802/pluto-container-api/src/main/java/org/apache/pluto/container/HeaderData.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/HeaderData.java b/pluto-container-api/src/main/java/org/apache/pluto/container/HeaderData.java
index 6209f5d..86f08cc 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/HeaderData.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/HeaderData.java
@@ -167,24 +167,26 @@ public class HeaderData {
          
          // convert < brackets within script tags to corresponding entities
          
-         Pattern pat = Pattern.compile("(?s)" +             // multiline mode 
-                                       "(?<=<script)" +     // 0-width lookbehind; script start tag
-                                       "(.*?)" +            // non-greedy content of tag
-                                       "(?=</script)");     // 0-width lookahead: script end tag
+         Pattern pat = Pattern.compile("(?s)" +                      // multiline mode 
+                                       "(?<=<(script|style))" +      // 0-width lookbehind; start tag
+                                       "(.*?)" +                     // non-greedy content of tag
+                                       "(?=</(script|style))");      // 0-width lookahead; end tag
          Matcher mat = pat.matcher(src);
          while (mat.find()) {
-            mat.appendReplacement(sb, mat.group().replaceAll("<", "&lt;"));
+            mat.appendReplacement(sb, mat.group().replaceAll("&", "&amp;").replaceAll("<", "&lt;"));
          }
          mat.appendTail(sb);
 
          sb.append(ROOT_ELEMENT_END);
-         LOG.debug(sb.toString());
 
          StringReader sr = new StringReader(sb.toString());
          InputSource is = new InputSource(sr);
          Document adoc;
 
          try {
+            if (docBuilder == null) {
+               setupDoc();
+            }
             adoc = docBuilder.parse(is);
 
             // verify that all tags are allowed
@@ -292,15 +294,20 @@ public class HeaderData {
          LOG.warn(txt.toString());
       }
    }
+   
+   public void setupDoc() throws ParserConfigurationException {
+      DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
+      dbfac.setExpandEntityReferences(true);
+      docBuilder = dbfac.newDocumentBuilder();
+      doc = docBuilder.newDocument();
+      root = doc.createElement(ROOT_ELEMENT);
+      doc.appendChild(root);
+   }
 
    public Element createElement(String tagName) {
       try {
          if (doc == null) {
-            DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
-            docBuilder = dbfac.newDocumentBuilder();
-            doc = docBuilder.newDocument();
-            root = doc.createElement(ROOT_ELEMENT);
-            doc.appendChild(root);
+            setupDoc();
          }
          return doc.createElement(tagName);
       } catch (ParserConfigurationException e) {


[14/38] portals-pluto git commit: Replaced code that reads the deployment descriptor with an implementation that can be better extended to add v3.0 support. Added test cases. Uses jaxb binding classes that are generated at compile time.

Posted by ms...@apache.org.
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR168ConfigurationProcessor.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR168ConfigurationProcessor.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR168ConfigurationProcessor.java
new file mode 100644
index 0000000..e0a6468
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR168ConfigurationProcessor.java
@@ -0,0 +1,564 @@
+/*  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.
+ */
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import javax.portlet.Portlet;
+import javax.portlet.PreferencesValidator;
+import javax.xml.bind.JAXBElement;
+
+import org.apache.pluto.container.om.portlet.CustomPortletMode;
+import org.apache.pluto.container.om.portlet.CustomWindowState;
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.DisplayName;
+import org.apache.pluto.container.om.portlet.InitParam;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.PortletDefinition;
+import org.apache.pluto.container.om.portlet.PortletInfo;
+import org.apache.pluto.container.om.portlet.Preference;
+import org.apache.pluto.container.om.portlet.Preferences;
+import org.apache.pluto.container.om.portlet.SecurityConstraint;
+import org.apache.pluto.container.om.portlet.SecurityRoleRef;
+import org.apache.pluto.container.om.portlet.Supports;
+import org.apache.pluto.container.om.portlet.UserDataConstraint;
+import org.apache.pluto.container.om.portlet10.impl.CustomPortletModeType;
+import org.apache.pluto.container.om.portlet10.impl.CustomWindowStateType;
+import org.apache.pluto.container.om.portlet10.impl.DescriptionType;
+import org.apache.pluto.container.om.portlet10.impl.DisplayNameType;
+import org.apache.pluto.container.om.portlet10.impl.InitParamType;
+import org.apache.pluto.container.om.portlet10.impl.MimeTypeType;
+import org.apache.pluto.container.om.portlet10.impl.PortletAppType;
+import org.apache.pluto.container.om.portlet10.impl.PortletCollectionType;
+import org.apache.pluto.container.om.portlet10.impl.PortletInfoType;
+import org.apache.pluto.container.om.portlet10.impl.PortletModeType;
+import org.apache.pluto.container.om.portlet10.impl.PortletNameType;
+import org.apache.pluto.container.om.portlet10.impl.PortletPreferencesType;
+import org.apache.pluto.container.om.portlet10.impl.PortletType;
+import org.apache.pluto.container.om.portlet10.impl.PreferenceType;
+import org.apache.pluto.container.om.portlet10.impl.SecurityConstraintType;
+import org.apache.pluto.container.om.portlet10.impl.SecurityRoleRefType;
+import org.apache.pluto.container.om.portlet10.impl.SupportedLocaleType;
+import org.apache.pluto.container.om.portlet10.impl.SupportsType;
+import org.apache.pluto.container.om.portlet10.impl.UserAttributeType;
+import org.apache.pluto.container.om.portlet10.impl.UserDataConstraintType;
+import org.apache.pluto.container.om.portlet10.impl.ValueType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Processes configuration for JSR 168 portlet app.
+ * 
+ * @author Scott Nicklous
+ * 
+ */
+public class JSR168ConfigurationProcessor extends ConfigurationProcessor {
+
+   /** Logger. */
+   private static final Logger          LOG     = LoggerFactory
+                                                      .getLogger(JSR168ConfigurationProcessor.class);
+   // private static final boolean         isDebug = LOG.isDebugEnabled();
+   private static final boolean         isTrace = LOG.isTraceEnabled();
+
+   private PortletApplicationDefinition pad;
+
+   /* (non-Javadoc)
+    * @see org.apache.pluto.container.om.portlet.impl.jsr168.ConfigurationProcessor#process(javax.xml.bind.JAXBElement)
+    */
+   @Override
+   public PortletApplicationDefinition process(JAXBElement<?> rootElement)
+         throws IllegalArgumentException {
+      pad = new PortletApplicationDefinitionImpl();
+
+      // make sure we were called properly
+      assert (rootElement != null);
+      assert (rootElement.getValue() instanceof PortletAppType);
+
+      PortletAppType app = (PortletAppType) rootElement.getValue();
+
+      // handle string values
+
+      pad.setId(app.getId());
+
+      if ((app.getVersion() == null) || !app.getVersion().equals("1.0")) {
+         String warning = "Bad version. Expected 1.0, was: " + app.getVersion();
+         LOG.warn(warning);
+         throw new IllegalArgumentException(warning);
+      }
+      pad.setVersion(app.getVersion());
+
+      if (isTrace) {
+         StringBuilder txt = new StringBuilder();
+         txt.append("Reading portlet DD. ");
+         txt.append("Version: ");
+         txt.append(app.getVersion());
+         txt.append(", ID: ");
+         txt.append(app.getId());
+         LOG.trace(txt.toString());
+      }
+
+      handleCPM(app.getCustomPortletMode());
+      handleCWS(app.getCustomWindowState());
+      handleSC(app.getSecurityConstraint());
+      handleUA(app.getUserAttribute());
+      handlePortlets(app.getPortlet());
+
+      return pad;
+   }
+
+   /**
+    * DisplayNames
+    */
+   private List<DisplayName> handleDisplayNames(List<DisplayNameType> dispNames) {
+      ArrayList<DisplayName> list = new ArrayList<DisplayName>();
+      for (DisplayNameType dispName : dispNames) {
+
+         if (dispName.getValue() == null) {
+            String warning = "Bad display name - no display name value; will be ignored. continuing ...";
+            LOG.warn(warning);
+            continue;
+         }
+
+         Locale loc = deriveLocale(dispName.getLang());
+
+         DisplayNameImpl d = new DisplayNameImpl(loc, dispName.getValue());
+         list.add(d);
+      }
+      return list;
+   }
+
+   /**
+    * Descriptions
+    */
+   private List<Description> handleDescriptions(List<DescriptionType> descs) {
+      ArrayList<Description> list = new ArrayList<Description>();
+      for (DescriptionType desc : descs) {
+
+         if (desc.getValue() == null) {
+            String warning = "Bad description - no description value; will be ignored. continuing ...";
+            LOG.warn(warning);
+            continue;
+         }
+
+         Locale loc = deriveLocale(desc.getLang());
+
+         DescriptionImpl d = new DescriptionImpl(loc, desc.getValue());
+         list.add(d);
+      }
+      return list;
+   }
+
+   /**
+    * User attributes
+    */
+   private void handleUA(List<UserAttributeType> uats) {
+      for (UserAttributeType uat : uats) {
+
+         // validate data
+         if ((uat.getName() == null) || (uat.getName().getValue() == null)) {
+            String warning = "Bad user attribute will be ignored. Name was null. Continuing ...";
+            LOG.warn(warning);
+            continue;
+         }
+
+         // set up the user attribute
+         UserAttributeImpl attr = new UserAttributeImpl(uat.getName()
+               .getValue());
+         for (Description desc : handleDescriptions(uat.getDescription())) {
+            attr.addDescription(desc);
+         }
+
+         // add it to the model
+         pad.addUserAttribute(attr);
+
+      }
+   }
+
+   /**
+    * Custom portlet modes
+    */
+   private void handleCPM(List<CustomPortletModeType> cpms) {
+      for (CustomPortletModeType cpm : cpms) {
+
+         // validate data
+         if ((cpm.getPortletMode() == null)
+               || (cpm.getPortletMode().getValue() == null)) {
+            String warning = "Bad custom portlet mode. Mode was null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         } else {
+            String val = cpm.getPortletMode().getValue();
+            if (val.equalsIgnoreCase("view") || val.equalsIgnoreCase("edit")
+                  || val.equalsIgnoreCase("help")) {
+               String warning = "Bad custom portlet mode. Mode was: " + val;
+               LOG.warn(warning);
+               throw new IllegalArgumentException(warning);
+            }
+         }
+
+         // set up the custom portlet mode
+         CustomPortletMode pm = new CustomPortletModeImpl(cpm.getPortletMode()
+               .getValue());
+         for (Description desc : handleDescriptions(cpm.getDescription())) {
+            pm.addDescription(desc);
+         }
+
+         // add it to the model
+         pad.addCustomPortletMode(pm);
+
+      }
+   }
+
+   /**
+    * Custom window states
+    */
+   private void handleCWS(List<CustomWindowStateType> cwss) {
+      for (CustomWindowStateType cws : cwss) {
+
+         // validate data
+         if ((cws.getWindowState() == null)
+               || (cws.getWindowState().getValue() == null)) {
+            String warning = "Bad custom portlet mode. Mode was null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         } else {
+            String val = cws.getWindowState().getValue();
+            if (val.equalsIgnoreCase("view") || val.equalsIgnoreCase("edit")
+                  || val.equalsIgnoreCase("help")) {
+               String warning = "Bad custom portlet mode. Mode was: " + val;
+               LOG.warn(warning);
+               throw new IllegalArgumentException(warning);
+            }
+         }
+
+         // set up the custom portlet mode
+         CustomWindowState ws = new CustomWindowStateImpl(cws.getWindowState()
+               .getValue());
+         for (Description desc : handleDescriptions(cws.getDescription())) {
+            ws.addDescription(desc);
+         }
+
+         // add it to the model
+         pad.addCustomWindowState(ws);
+
+      }
+
+   }
+
+   /**
+    * Security constraints
+    */
+   private void handleSC(List<SecurityConstraintType> scs) {
+      for (SecurityConstraintType sc : scs) {
+
+         // validate data
+         PortletCollectionType pct = sc.getPortletCollection();
+         if ((pct == null) || (pct.getPortletName() == null)
+               || (pct.getPortletName().size() == 0)) {
+            String warning = "Portlet collection is empty.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         } else {
+            for (PortletNameType pnt : pct.getPortletName()) {
+               if (!isValidIdentifier(pnt.getValue())) {
+                  String warning = "Bad portlet name: " + pnt.getValue();
+                  LOG.warn(warning);
+                  throw new IllegalArgumentException(warning);
+               }
+            }
+         }
+
+         UserDataConstraintType udc = sc.getUserDataConstraint();
+         if ((udc == null) || (udc.getTransportGuarantee() == null)
+               || (udc.getTransportGuarantee().value() == null)) {
+            String warning = "User data constraint contains null value.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+
+         // set up the user data constraint
+         UserDataConstraint newudc = new UserDataConstraintImpl(udc
+               .getTransportGuarantee().value());
+         for (Description desc : handleDescriptions(udc.getDescription())) {
+            newudc.addDescription(desc);
+         }
+
+         // set up the security constraint
+         SecurityConstraint newsc = new SecurityConstraintImpl(newudc);
+         for (DisplayName dispName : handleDisplayNames(sc.getDisplayName())) {
+            newsc.addDisplayName(dispName);
+         }
+         for (PortletNameType portletName : pct.getPortletName()) {
+            newsc.addPortletName(portletName.getValue());
+         }
+
+         // add it to the model
+         pad.addSecurityConstraint(newsc);
+
+      }
+   }
+
+   private List<Supports> handleSupports(List<SupportsType> sts) {
+      ArrayList<Supports> newSupps = new ArrayList<Supports>();
+      for (SupportsType st : sts) {
+
+         // validate Mime type & portlet mode
+         MimeTypeType mtt = st.getMimeType();
+         if (mtt == null || mtt.getValue() == null) {
+            String warning = "Null Mime type, ignoring Supports block.";
+            LOG.warn(warning);
+            continue;
+         }
+         List<PortletModeType> list = st.getPortletMode();
+         if (list.size() == 0) {
+            String warning = "No portlet modes found, ignoring Supports block.";
+            LOG.warn(warning);
+            continue;
+         }
+
+         // set up Supports
+         Supports sup = new SupportsImpl(mtt.getValue());
+         for (PortletModeType item : list) {
+            sup.addPortletMode(item.getValue());
+         }
+
+         // add to model
+         newSupps.add(sup);
+
+      }
+      return newSupps;
+   }
+
+   /**
+    * Init parameters
+    */
+   private List<InitParam> handleInitParam(List<InitParamType> parms) {
+      ArrayList<InitParam> newParms = new ArrayList<InitParam>();
+      for (InitParamType parm : parms) {
+
+         // validate data
+         if ((parm.getName() == null) || (parm.getName().getValue() == null)) {
+            String warning = "Bad init parameter. Parameter name was null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+
+         // set up the init parameter
+         String name = parm.getName().getValue();
+         String value = parm.getValue().getValue();
+         InitParam newp = new InitParamImpl(name, value);
+         for (Description desc : handleDescriptions(parm.getDescription())) {
+            newp.addDescription(desc);
+         }
+         
+         newParms.add(newp);
+      }
+      return newParms;
+   }
+
+   /**
+    * Portlet preferences
+    */
+   private List<Preference> handlePreferences(List<PreferenceType> args) {
+      ArrayList<Preference> list = new ArrayList<Preference>();
+      for (PreferenceType item : args) {
+
+         // validate data
+         if ((item.getName() == null) || (item.getName().getValue() == null)) {
+            String warning = "Bad portlet preference. Ppreference name was null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+
+         // set up the preference
+         String name = item.getName().getValue();
+         List<ValueType> vals = item.getValue();
+         ArrayList<String> lines = new ArrayList<String>(16);
+         for (ValueType vt : vals) {
+            lines.add(vt.getValue());
+         }
+         boolean isRO = (item.getReadOnly().value().equalsIgnoreCase("true"));
+
+         Preference pref = new PreferenceImpl(name, isRO, lines);
+         list.add(pref);
+      }
+      return list;
+   }
+
+   /**
+    * Security role references
+    */
+   private List<SecurityRoleRef> handleSecRoleRef(List<SecurityRoleRefType> args) {
+      ArrayList<SecurityRoleRef> list = new ArrayList<SecurityRoleRef>();
+      for (SecurityRoleRefType item : args) {
+
+         // validate data
+         if ((item.getRoleName() == null) || (item.getRoleLink() == null)
+               || (item.getRoleLink().getValue() == null)) {
+            String warning = "Bad security role reference. Name or link was null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+
+         // set up the role ref
+         String name = item.getRoleName();
+         String link = item.getRoleLink().getValue();
+         SecurityRoleRef srr = new SecurityRoleRefImpl(name);
+         srr.setRoleLink(link);
+         for (Description desc : handleDescriptions(item.getDescription())) {
+            srr.addDescription(desc);
+         }
+
+         list.add(srr);
+      }
+      return list;
+   }
+
+   /**
+    * Handle Portlets
+    */
+   private void handlePortlets(List<PortletType> portlets) {
+      for (PortletType portlet : portlets) {
+
+         // validate portlet name & class
+         String warning;
+         String pn = portlet.getPortletName().getValue();
+         if (!isValidIdentifier(pn)) {
+            warning = "Bad portlet name: " + pn;
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+         
+         String clsName = portlet.getPortletClass();
+         warning = "Bad portlet class: " + clsName;
+         if (!isValidIdentifier(clsName)) {
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+         
+         // Make sure the class can be loaded
+         Class<?> valClass = null;
+         try {
+            ClassLoader cl = this.getClass().getClassLoader();
+            valClass = cl.loadClass(clsName);
+            if (!Portlet.class.isAssignableFrom(valClass)) {
+               throw new Exception("specified class is not a Portlet.");
+            }
+         } catch (Exception e) {
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning, e);
+         }
+
+         // set up portlet definition
+
+         PortletDefinition pd = new PortletDefinitionImpl(pn, pad);
+         pd.setPortletClass(portlet.getPortletClass());
+
+         if (portlet.getResourceBundle() != null) {
+            pd.setResourceBundle(portlet.getResourceBundle().getValue());
+         }
+
+         if (portlet.getExpirationCache() != null) {
+            pd.setExpirationCache(portlet.getExpirationCache().getValue());
+         }
+
+         for (DisplayName dispName : handleDisplayNames(portlet
+               .getDisplayName())) {
+            pd.addDisplayName(dispName);
+         }
+
+         for (Description desc : handleDescriptions(portlet.getDescription())) {
+            pd.addDescription(desc);
+         }
+
+         for (Supports s : handleSupports(portlet.getSupports())) {
+            pd.addSupports(s);
+         }
+
+         PortletInfoType pit = portlet.getPortletInfo();
+         if (pit != null) {
+            if (pit.getTitle().getValue() == null) {
+               warning = "Portlet info section does not contain title. Ingoring ...";
+               LOG.warn(warning);
+            } else {
+               String title, st = null, kw = null; 
+               title = pit.getTitle().getValue();
+               if (pit.getShortTitle() != null) {
+                  st = pit.getShortTitle().getValue();
+               }
+               if (pit.getKeywords() != null) {
+                  kw = pit.getKeywords().getValue();
+               }
+               PortletInfo info = new PortletInfoImpl(title, kw, st);
+               pd.setPortletInfo(info);
+            }
+         }
+         
+         for (SupportedLocaleType slt : portlet.getSupportedLocale()) {
+            pd.addSupportedLocale(slt.getValue());
+         }
+         
+         for (InitParam ip : handleInitParam(portlet.getInitParam())) {
+            pd.addInitParam(ip);
+         }
+         
+         PortletPreferencesType prefs = portlet.getPortletPreferences();
+         if (prefs != null) {
+            Preferences newprefs = new PreferencesImpl();
+            
+            clsName = prefs.getPreferencesValidator();
+            warning = "Bad portlet preferences validator class: " + clsName;
+            if (!isValidIdentifier(clsName)) {
+               LOG.warn(warning);
+               throw new IllegalArgumentException(warning);
+            }
+            
+            // Make sure the class can be loaded
+            valClass = null;
+            try {
+               ClassLoader cl = this.getClass().getClassLoader();
+               valClass = cl.loadClass(clsName);
+               if (!PreferencesValidator.class.isAssignableFrom(valClass)) {
+                  throw new Exception("specified class is not a PreferencesValidator.");
+               }
+            } catch (Exception e) {
+               LOG.warn(warning);
+               throw new IllegalArgumentException(warning, e);
+            }
+
+            
+            newprefs.setPreferencesValidator(clsName);
+            for (Preference p : handlePreferences(prefs.getPreference())) {
+               newprefs.addPreference(p);
+            }
+            pd.setPortletPreferences(newprefs);
+         }
+         
+         for (SecurityRoleRef srr : handleSecRoleRef(portlet.getSecurityRoleRef())) {
+            pd.addSecurityRoleRef(srr);
+         }
+
+         pad.addPortlet(pd);
+
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR286ConfigurationProcessor.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR286ConfigurationProcessor.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR286ConfigurationProcessor.java
new file mode 100644
index 0000000..2e9e940
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/JSR286ConfigurationProcessor.java
@@ -0,0 +1,895 @@
+/*  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.
+ */
+
+package org.apache.pluto.container.om.portlet.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import javax.portlet.Portlet;
+import javax.portlet.PortletURLGenerationListener;
+import javax.portlet.PreferencesValidator;
+import javax.portlet.filter.PortletFilter;
+import javax.xml.XMLConstants;
+import javax.xml.bind.JAXBElement;
+import javax.xml.namespace.QName;
+
+import org.apache.pluto.container.om.portlet.ContainerRuntimeOption;
+import org.apache.pluto.container.om.portlet.CustomPortletMode;
+import org.apache.pluto.container.om.portlet.CustomWindowState;
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.DisplayName;
+import org.apache.pluto.container.om.portlet.EventDefinition;
+import org.apache.pluto.container.om.portlet.EventDefinitionReference;
+import org.apache.pluto.container.om.portlet.Filter;
+import org.apache.pluto.container.om.portlet.FilterMapping;
+import org.apache.pluto.container.om.portlet.InitParam;
+import org.apache.pluto.container.om.portlet.Listener;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.PortletDefinition;
+import org.apache.pluto.container.om.portlet.PortletInfo;
+import org.apache.pluto.container.om.portlet.Preference;
+import org.apache.pluto.container.om.portlet.Preferences;
+import org.apache.pluto.container.om.portlet.PublicRenderParameter;
+import org.apache.pluto.container.om.portlet.SecurityConstraint;
+import org.apache.pluto.container.om.portlet.SecurityRoleRef;
+import org.apache.pluto.container.om.portlet.Supports;
+import org.apache.pluto.container.om.portlet.UserDataConstraint;
+import org.apache.pluto.container.om.portlet20.impl.ContainerRuntimeOptionType;
+import org.apache.pluto.container.om.portlet20.impl.CustomPortletModeType;
+import org.apache.pluto.container.om.portlet20.impl.CustomWindowStateType;
+import org.apache.pluto.container.om.portlet20.impl.DescriptionType;
+import org.apache.pluto.container.om.portlet20.impl.DisplayNameType;
+import org.apache.pluto.container.om.portlet20.impl.EventDefinitionReferenceType;
+import org.apache.pluto.container.om.portlet20.impl.EventDefinitionType;
+import org.apache.pluto.container.om.portlet20.impl.FilterMappingType;
+import org.apache.pluto.container.om.portlet20.impl.FilterType;
+import org.apache.pluto.container.om.portlet20.impl.InitParamType;
+import org.apache.pluto.container.om.portlet20.impl.ListenerType;
+import org.apache.pluto.container.om.portlet20.impl.MimeTypeType;
+import org.apache.pluto.container.om.portlet20.impl.PortletAppType;
+import org.apache.pluto.container.om.portlet20.impl.PortletCollectionType;
+import org.apache.pluto.container.om.portlet20.impl.PortletInfoType;
+import org.apache.pluto.container.om.portlet20.impl.PortletModeType;
+import org.apache.pluto.container.om.portlet20.impl.PortletNameType;
+import org.apache.pluto.container.om.portlet20.impl.PortletPreferencesType;
+import org.apache.pluto.container.om.portlet20.impl.PortletType;
+import org.apache.pluto.container.om.portlet20.impl.PreferenceType;
+import org.apache.pluto.container.om.portlet20.impl.PublicRenderParameterType;
+import org.apache.pluto.container.om.portlet20.impl.SecurityConstraintType;
+import org.apache.pluto.container.om.portlet20.impl.SecurityRoleRefType;
+import org.apache.pluto.container.om.portlet20.impl.SupportedLocaleType;
+import org.apache.pluto.container.om.portlet20.impl.SupportsType;
+import org.apache.pluto.container.om.portlet20.impl.UserAttributeType;
+import org.apache.pluto.container.om.portlet20.impl.UserDataConstraintType;
+import org.apache.pluto.container.om.portlet20.impl.ValueType;
+import org.apache.pluto.container.om.portlet20.impl.WindowStateType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Processes configuration for JSR 168 portlet app.
+ * 
+ * @author Scott Nicklous
+ * 
+ */
+public class JSR286ConfigurationProcessor extends ConfigurationProcessor {
+
+   /** Logger. */
+   private static final Logger          LOG     = LoggerFactory
+                                                      .getLogger(JSR286ConfigurationProcessor.class);
+   // private static final boolean isDebug = LOG.isDebugEnabled();
+   private static final boolean         isTrace = LOG.isTraceEnabled();
+
+   private PortletApplicationDefinition pad;
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see
+    * org.apache.pluto.container.om.portlet.impl.jsr168.ConfigurationProcessor
+    * #process(javax.xml.bind.JAXBElement)
+    */
+   @Override
+   public PortletApplicationDefinition process(JAXBElement<?> rootElement)
+         throws IllegalArgumentException {
+      pad = new PortletApplicationDefinitionImpl();
+
+      // make sure we were called properly
+      assert (rootElement != null);
+      assert (rootElement.getValue() instanceof PortletAppType);
+
+      PortletAppType app = (PortletAppType) rootElement.getValue();
+
+      // handle string values
+
+      pad.setId(app.getId());
+
+      if ((app.getVersion() == null) || !app.getVersion().equals("2.0")) {
+         String warning = "Bad version. Expected 2.0, was: " + app.getVersion();
+         LOG.warn(warning);
+         throw new IllegalArgumentException(warning);
+      }
+      pad.setVersion(app.getVersion());
+
+      if (isTrace) {
+         StringBuilder txt = new StringBuilder();
+         txt.append("Reading portlet DD. ");
+         txt.append("Version: ");
+         txt.append(app.getVersion());
+         txt.append(", ID: ");
+         txt.append(app.getId());
+         LOG.trace(txt.toString());
+      }
+
+      if (app.getDefaultNamespace() != null
+            && !app.getDefaultNamespace().equals("")) {
+         pad.setDefaultNamespace(app.getDefaultNamespace());
+      } else {
+         pad.setDefaultNamespace(XMLConstants.NULL_NS_URI);
+      }
+
+      if (app.getResourceBundle() != null
+            && app.getResourceBundle().getValue() != null
+            && !app.getResourceBundle().getValue().equals("")) {
+         pad.setResourceBundle(app.getResourceBundle().getValue());
+      }
+
+      for (EventDefinition ed : handleEventDefs(app.getEventDefinition())) {
+         pad.addEventDefinition(ed);
+      }
+
+      for (PublicRenderParameter prp : handlePRPs(app
+            .getPublicRenderParameter())) {
+         pad.addPublicRenderParameter(prp);
+      }
+      
+      for (ContainerRuntimeOption cro : handleRTOptions(app.getContainerRuntimeOption())) {
+         pad.addContainerRuntimeOption(cro);
+      }
+
+      handleCPM(app.getCustomPortletMode());
+      handleCWS(app.getCustomWindowState());
+      handleSC(app.getSecurityConstraint());
+      handleUA(app.getUserAttribute());
+      handleListeners(app.getListener());
+      handleFilters(app.getFilter());
+      handlePortlets(app.getPortlet());
+      handleFilterMappings(app.getFilterMapping());
+
+      return pad;
+   }
+
+   /**
+    * DisplayNames
+    */
+   private List<DisplayName> handleDisplayNames(List<DisplayNameType> dispNames) {
+      ArrayList<DisplayName> list = new ArrayList<DisplayName>();
+      for (DisplayNameType dispName : dispNames) {
+
+         if (dispName.getValue() == null) {
+            String warning = "Bad display name - no display name value; will be ignored. continuing ...";
+            LOG.warn(warning);
+            continue;
+         }
+
+         Locale loc = deriveLocale(dispName.getLang());
+
+         DisplayNameImpl d = new DisplayNameImpl(loc, dispName.getValue());
+         list.add(d);
+      }
+      return list;
+   }
+
+   /**
+    * Descriptions
+    */
+   private List<Description> handleDescriptions(List<DescriptionType> descs) {
+      ArrayList<Description> list = new ArrayList<Description>();
+      for (DescriptionType desc : descs) {
+
+         if (desc.getValue() == null) {
+            String warning = "Bad description - no description value; will be ignored. continuing ...";
+            LOG.warn(warning);
+            continue;
+         }
+
+         Locale loc = deriveLocale(desc.getLang());
+
+         DescriptionImpl d = new DescriptionImpl(loc, desc.getValue());
+         list.add(d);
+      }
+      return list;
+   }
+
+   /**
+    * User attributes
+    */
+   private void handleUA(List<UserAttributeType> uats) {
+      for (UserAttributeType uat : uats) {
+
+         // validate data
+         if ((uat.getName() == null) || (uat.getName().getValue() == null)) {
+            String warning = "Bad user attribute will be ignored. Name was null. Continuing ...";
+            LOG.warn(warning);
+            continue;
+         }
+
+         // set up the user attribute
+         UserAttributeImpl attr = new UserAttributeImpl(uat.getName()
+               .getValue());
+         for (Description desc : handleDescriptions(uat.getDescription())) {
+            attr.addDescription(desc);
+         }
+
+         // add it to the model
+         pad.addUserAttribute(attr);
+
+      }
+   }
+
+   /**
+    * Filters
+    */
+   private void handleFilters(List<FilterType> args) {
+      for (FilterType item : args) {
+
+         // validate data
+         if ((item.getFilterName() == null)
+               || (item.getFilterClass() == null)) {
+            String warning = "Bad Filter definition. name or class was null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+         String clsName = item.getFilterClass();
+         if (clsName != null && !clsName.equals("")) {
+            checkValidClass(clsName, PortletFilter.class,
+                  "Bad filter definition. Filter class is invalid: ");
+         }
+
+         // set up the custom portlet mode
+         Filter newitem = new FilterImpl(item.getFilterName());
+         newitem.setFilterClass(item.getFilterClass());
+         for (InitParam ip : handleInitParam(item.getInitParam())) {
+            newitem.addInitParam(ip);
+         }
+         for (String lc : item.getLifecycle()) {
+            newitem.addLifecycle(lc);
+         }
+         for (Description desc : handleDescriptions(item.getDescription())) {
+            newitem.addDescription(desc);
+         }
+         for (DisplayName dispName : handleDisplayNames(item.getDisplayName())) {
+            newitem.addDisplayName(dispName);
+         }
+
+         // add it to the model
+         pad.addFilter(newitem);
+
+      }
+   }
+
+   /**
+    * FilterMappings
+    */
+   private void handleFilterMappings(List<FilterMappingType> args) {
+      for (FilterMappingType item : args) {
+
+         // validate data
+         String fname = item.getFilterName();
+         if ((fname == null) || (item.getPortletName().size() == 0)) {
+            String warning = "Bad FilterMapping definition. Filter name or portlet name is null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+         if (pad.getFilter(fname) == null) {
+            String warning = "Bad FilterMapping definition. Filter definition not found: " + fname;
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+         
+         // set up the filter mapping
+         FilterMapping newitem = new FilterMappingImpl(fname);
+         for (PortletNameType pnt : item.getPortletName()) {
+            String pname = pnt.getValue();
+            if (pad.getPortlet(pname) == null) {
+               String warning = "Bad FilterMapping definition. Portlet definition not found: " + pname;
+               LOG.warn(warning);
+               throw new IllegalArgumentException(warning);
+            }
+            newitem.addPortletName(pname);
+         }
+
+         // add it to the model
+         pad.addFilterMapping(newitem);
+
+      }
+   }
+
+   /**
+    * Listeners
+    */
+   private void handleListeners(List<ListenerType> args) {
+      for (ListenerType item : args) {
+
+         // validate data
+         if (item.getListenerClass() == null) {
+            String warning = "Bad Listener definition. Class was null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+         String clsName = item.getListenerClass();
+         if (clsName != null && !clsName.equals("")) {
+            checkValidClass(clsName, PortletURLGenerationListener.class,
+                  "Bad listener definition. Listener class is invalid: ");
+         }
+
+         // set up the custom portlet mode
+         Listener newitem = new ListenerImpl(item.getListenerClass());
+         for (Description desc : handleDescriptions(item.getDescription())) {
+            newitem.addDescription(desc);
+         }
+         for (DisplayName dispName : handleDisplayNames(item.getDisplayName())) {
+            newitem.addDisplayName(dispName);
+         }
+         
+         // add it to the model
+         pad.addListener(newitem);
+
+      }
+   }
+
+   /**
+    * Custom portlet modes
+    */
+   private void handleCPM(List<CustomPortletModeType> cpms) {
+      for (CustomPortletModeType cpm : cpms) {
+
+         // validate data
+         if ((cpm.getPortletMode() == null)
+               || (cpm.getPortletMode().getValue() == null)) {
+            String warning = "Bad custom portlet mode. Mode was null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         } else {
+            String val = cpm.getPortletMode().getValue();
+            if (val.equalsIgnoreCase("view") || val.equalsIgnoreCase("edit")
+                  || val.equalsIgnoreCase("help")) {
+               String warning = "Bad custom portlet mode. Mode was: " + val;
+               LOG.warn(warning);
+               throw new IllegalArgumentException(warning);
+            }
+         }
+
+         // set up the custom portlet mode
+         CustomPortletMode pm = new CustomPortletModeImpl(cpm.getPortletMode()
+               .getValue());
+         for (Description desc : handleDescriptions(cpm.getDescription())) {
+            pm.addDescription(desc);
+         }
+         boolean isPortalManaged = true; // default is true
+         if (cpm.getPortalManaged() != null
+               && cpm.getPortalManaged().value() != null) {
+            isPortalManaged = cpm.getPortalManaged().value()
+                  .equalsIgnoreCase("true");
+         }
+         pm.setPortalManaged(isPortalManaged);
+
+         // add it to the model
+         pad.addCustomPortletMode(pm);
+
+      }
+   }
+
+   /**
+    * Custom window states
+    */
+   private void handleCWS(List<CustomWindowStateType> cwss) {
+      for (CustomWindowStateType cws : cwss) {
+
+         // validate data
+         if ((cws.getWindowState() == null)
+               || (cws.getWindowState().getValue() == null)) {
+            String warning = "Bad custom portlet mode. Mode was null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         } else {
+            String val = cws.getWindowState().getValue();
+            if (val.equalsIgnoreCase("view") || val.equalsIgnoreCase("edit")
+                  || val.equalsIgnoreCase("help")) {
+               String warning = "Bad custom portlet mode. Mode was: " + val;
+               LOG.warn(warning);
+               throw new IllegalArgumentException(warning);
+            }
+         }
+
+         // set up the custom portlet mode
+         CustomWindowState ws = new CustomWindowStateImpl(cws.getWindowState()
+               .getValue());
+         for (Description desc : handleDescriptions(cws.getDescription())) {
+            ws.addDescription(desc);
+         }
+
+         // add it to the model
+         pad.addCustomWindowState(ws);
+
+      }
+
+   }
+
+   /**
+    * Security constraints
+    */
+   private void handleSC(List<SecurityConstraintType> scs) {
+      for (SecurityConstraintType sc : scs) {
+
+         // validate data
+         PortletCollectionType pct = sc.getPortletCollection();
+         if ((pct == null) || (pct.getPortletName() == null)
+               || (pct.getPortletName().size() == 0)) {
+            String warning = "Portlet collection is empty.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         } else {
+            for (PortletNameType pnt : pct.getPortletName()) {
+               if (!isValidIdentifier(pnt.getValue())) {
+                  String warning = "Bad portlet name: " + pnt.getValue();
+                  LOG.warn(warning);
+                  throw new IllegalArgumentException(warning);
+               }
+            }
+         }
+
+         UserDataConstraintType udc = sc.getUserDataConstraint();
+         if ((udc == null) || (udc.getTransportGuarantee() == null)
+               || (udc.getTransportGuarantee().value() == null)) {
+            String warning = "User data constraint contains null value.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+
+         // set up the user data constraint
+         UserDataConstraint newudc = new UserDataConstraintImpl(udc
+               .getTransportGuarantee().value());
+         for (Description desc : handleDescriptions(udc.getDescription())) {
+            newudc.addDescription(desc);
+         }
+
+         // set up the security constraint
+         SecurityConstraint newsc = new SecurityConstraintImpl(newudc);
+         for (DisplayName dispName : handleDisplayNames(sc.getDisplayName())) {
+            newsc.addDisplayName(dispName);
+         }
+         for (PortletNameType portletName : pct.getPortletName()) {
+            newsc.addPortletName(portletName.getValue());
+         }
+
+         // add it to the model
+         pad.addSecurityConstraint(newsc);
+
+      }
+   }
+
+   private List<Supports> handleSupports(List<SupportsType> sts) {
+      ArrayList<Supports> newSupps = new ArrayList<Supports>();
+      for (SupportsType st : sts) {
+
+         // validate Mime type & portlet mode
+         MimeTypeType mtt = st.getMimeType();
+         if (mtt == null || mtt.getValue() == null) {
+            String warning = "Null Mime type, ignoring Supports block.";
+            LOG.warn(warning);
+            continue;
+         }
+         List<PortletModeType> pmlist = st.getPortletMode();
+         if (pmlist.size() == 0) {
+            String info = "No portlet modes found in Supports block.";
+            LOG.info(info);
+         }
+         List<WindowStateType> wslist = st.getWindowState();
+         if (wslist.size() == 0) {
+            String info = "No window states found in Supports block.";
+            LOG.info(info);
+         }
+
+         // set up Supports
+         Supports sup = new SupportsImpl(mtt.getValue());
+         for (PortletModeType item : pmlist) {
+            sup.addPortletMode(item.getValue());
+         }
+         for (WindowStateType item : wslist) {
+            sup.addWindowState(item.getValue());
+         }
+
+         // add to model
+         newSupps.add(sup);
+
+      }
+      return newSupps;
+   }
+
+   /**
+    * Init parameters
+    */
+   private List<InitParam> handleInitParam(List<InitParamType> parms) {
+      ArrayList<InitParam> newParms = new ArrayList<InitParam>();
+      for (InitParamType parm : parms) {
+
+         // validate data
+         if ((parm.getName() == null) || (parm.getName().getValue() == null)) {
+            String warning = "Bad init parameter. Parameter name was null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+
+         // set up the init parameter
+         String name = parm.getName().getValue();
+         String value = parm.getValue().getValue();
+         InitParam newp = new InitParamImpl(name, value);
+         for (Description desc : handleDescriptions(parm.getDescription())) {
+            newp.addDescription(desc);
+         }
+
+         newParms.add(newp);
+      }
+      return newParms;
+   }
+
+   /**
+    * Portlet preferences
+    */
+   private List<Preference> handlePreferences(List<PreferenceType> args) {
+      ArrayList<Preference> list = new ArrayList<Preference>();
+      for (PreferenceType item : args) {
+
+         // validate data
+         if ((item.getName() == null) || (item.getName().getValue() == null)) {
+            String warning = "Bad portlet preference. Ppreference name was null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+
+         // set up the preference
+         String name = item.getName().getValue();
+         List<ValueType> vals = item.getValue();
+         ArrayList<String> lines = new ArrayList<String>(16);
+         for (ValueType vt : vals) {
+            lines.add(vt.getValue());
+         }
+         boolean isRO = (item.getReadOnly().value().equalsIgnoreCase("true"));
+
+         Preference pref = new PreferenceImpl(name, isRO, lines);
+         list.add(pref);
+      }
+      return list;
+   }
+
+   private List<ContainerRuntimeOption> handleRTOptions(
+         List<ContainerRuntimeOptionType> args) {
+      ArrayList<ContainerRuntimeOption> list = new ArrayList<ContainerRuntimeOption>();
+      for (ContainerRuntimeOptionType arg : args) {
+
+         // validate data
+         if ((arg.getName() == null) || (arg.getName().getValue() == null)
+               || arg.getName().getValue().equals("")) {
+            String warning = "Bad container runtime option. Name was null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+
+         // set up the runtime option
+         String name = arg.getName().getValue();
+         List<ValueType> vals = arg.getValue();
+         ArrayList<String> lines = new ArrayList<String>(16);
+         for (ValueType vt : vals) {
+            lines.add(vt.getValue());
+         }
+
+         ContainerRuntimeOption item = new ContainerRuntimeOptionImpl(name,
+               lines);
+         list.add(item);
+
+      }
+      return list;
+   }
+
+   /**
+    * Security role references
+    */
+   private List<SecurityRoleRef> handleSecRoleRef(List<SecurityRoleRefType> args) {
+      ArrayList<SecurityRoleRef> list = new ArrayList<SecurityRoleRef>();
+      for (SecurityRoleRefType item : args) {
+
+         // validate data
+         if ((item.getRoleName() == null) || (item.getRoleLink() == null)
+               || (item.getRoleLink().getValue() == null)) {
+            String warning = "Bad security role reference. Name or link was null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+
+         // set up the role ref
+         String name = item.getRoleName();
+         String link = item.getRoleLink().getValue();
+         SecurityRoleRef srr = new SecurityRoleRefImpl(name);
+         srr.setRoleLink(link);
+         for (Description desc : handleDescriptions(item.getDescription())) {
+            srr.addDescription(desc);
+         }
+
+         list.add(srr);
+      }
+      return list;
+   }
+
+   /**
+    * Event definition references - supported publishing events & supported
+    * processing events
+    */
+   private List<EventDefinitionReference> handleEventDefRefs(
+         List<EventDefinitionReferenceType> args) {
+      ArrayList<EventDefinitionReference> list = new ArrayList<EventDefinitionReference>();
+      for (EventDefinitionReferenceType item : args) {
+
+         // validate data
+         if ((item.getName() == null) && (item.getQname() == null)) {
+            String warning = "Bad Even definition reference. Name and QName are null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+
+         // prepare the qname
+         String name = item.getName();
+         QName qname = item.getQname();
+         if (qname == null) {
+            qname = new QName(pad.getDefaultNamespace(), name);
+         }
+
+         if (pad.getEventDefinition(qname) == null) {
+            String warning = "Bad Event definition reference. No event definition found for qname: "
+                  + qname;
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+
+         // set up the event def ref
+         EventDefinitionReference newedr = new EventDefinitionReferenceImpl(
+               qname);
+
+         list.add(newedr);
+      }
+      return list;
+   }
+
+   /**
+    * Event definitions
+    */
+   private List<EventDefinition> handleEventDefs(List<EventDefinitionType> args) {
+      ArrayList<EventDefinition> list = new ArrayList<EventDefinition>();
+      for (EventDefinitionType item : args) {
+
+         // validate data
+         if ((item.getName() == null) && (item.getQname() == null)) {
+            String warning = "Bad Event definition. Name and QName are null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+         String clsName = item.getValueType();
+         if (clsName != null && !clsName.equals("")) {
+            checkValidClass(clsName, null,
+                  "Bad Event definition. Payload type is invalid: ");
+         }
+
+         // prepare the qname
+         String name = item.getName();
+         QName qname = item.getQname();
+         if (qname == null) {
+            qname = new QName(pad.getDefaultNamespace(), name);
+         }
+
+         // set up the event definition
+         EventDefinition newed = new EventDefinitionImpl(qname);
+         if (clsName != null && clsName.length() > 0) {
+            newed.setValueType(clsName);
+         }
+         for (Description desc : handleDescriptions(item.getDescription())) {
+            newed.addDescription(desc);
+         }
+         for (QName qn : item.getAlias()) {
+            newed.addAlias(qn);
+         }
+
+         list.add(newed);
+      }
+      return list;
+   }
+
+   private List<PublicRenderParameter> handlePRPs(
+         List<PublicRenderParameterType> args) {
+      ArrayList<PublicRenderParameter> list = new ArrayList<PublicRenderParameter>();
+      for (PublicRenderParameterType item : args) {
+
+         // validate data
+         if ((item.getName() == null) && (item.getQname() == null)) {
+            String warning = "Bad public render parameter definition. Name and QName are null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+         String id = item.getIdentifier();
+         if ((id == null) || (id.length() == 0)) {
+            String warning = "Bad public render parameter definition. Identifier is null.";
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+
+         // prepare the qname
+         String name = item.getName();
+         QName qname = item.getQname();
+         if (qname == null) {
+            qname = new QName(pad.getDefaultNamespace(), name);
+         }
+
+         // set up the prp definition
+         PublicRenderParameter newprp = new PublicRenderParameterImpl(qname, id);
+         for (Description desc : handleDescriptions(item.getDescription())) {
+            newprp.addDescription(desc);
+         }
+         for (QName qn : item.getAlias()) {
+            newprp.addAlias(qn);
+         }
+
+         list.add(newprp);
+      }
+      return list;
+
+   }
+
+   /**
+    * Handle Portlets
+    */
+   private void handlePortlets(List<PortletType> portlets) {
+      for (PortletType portlet : portlets) {
+
+         // validate portlet name & class
+         String warning;
+         String pn = portlet.getPortletName().getValue();
+         if (!isValidIdentifier(pn)) {
+            warning = "Bad portlet name: " + pn;
+            LOG.warn(warning);
+            throw new IllegalArgumentException(warning);
+         }
+
+         String clsName = portlet.getPortletClass();
+         checkValidClass(clsName, Portlet.class, "Bad portlet class: ");
+
+         // set up portlet definition
+
+         PortletDefinition pd = new PortletDefinitionImpl(pn, pad);
+         pd.setPortletClass(portlet.getPortletClass());
+
+         if (portlet.getResourceBundle() != null) {
+            pd.setResourceBundle(portlet.getResourceBundle().getValue());
+         }
+
+         if (portlet.getExpirationCache() != null) {
+            pd.setExpirationCache(portlet.getExpirationCache().getValue());
+         }
+
+         if (portlet.getCacheScope() != null) {
+            pd.setCacheScope(portlet.getCacheScope().getValue());
+         }
+
+         for (DisplayName dispName : handleDisplayNames(portlet
+               .getDisplayName())) {
+            pd.addDisplayName(dispName);
+         }
+
+         for (Description desc : handleDescriptions(portlet.getDescription())) {
+            pd.addDescription(desc);
+         }
+
+         for (Supports s : handleSupports(portlet.getSupports())) {
+            pd.addSupports(s);
+         }
+
+         PortletInfoType pit = portlet.getPortletInfo();
+         if (pit != null) {
+            if (pit.getTitle().getValue() == null) {
+               warning = "Portlet info section does not contain title. Ingoring ...";
+               LOG.warn(warning);
+            } else {
+               String title, st = null, kw = null;
+               title = pit.getTitle().getValue();
+               if (pit.getShortTitle() != null) {
+                  st = pit.getShortTitle().getValue();
+               }
+               if (pit.getKeywords() != null) {
+                  kw = pit.getKeywords().getValue();
+               }
+               PortletInfo info = new PortletInfoImpl(title, kw, st);
+               pd.setPortletInfo(info);
+            }
+         }
+
+         for (SupportedLocaleType slt : portlet.getSupportedLocale()) {
+            pd.addSupportedLocale(slt.getValue());
+         }
+
+         for (InitParam ip : handleInitParam(portlet.getInitParam())) {
+            pd.addInitParam(ip);
+         }
+
+         PortletPreferencesType prefs = portlet.getPortletPreferences();
+         if (prefs != null) {
+            Preferences newprefs = new PreferencesImpl();
+
+            clsName = prefs.getPreferencesValidator();
+            checkValidClass(clsName, PreferencesValidator.class,
+                  "Bad portlet preferences validator class: ");
+
+            newprefs.setPreferencesValidator(clsName);
+            for (Preference p : handlePreferences(prefs.getPreference())) {
+               newprefs.addPreference(p);
+            }
+            pd.setPortletPreferences(newprefs);
+         }
+
+         for (SecurityRoleRef srr : handleSecRoleRef(portlet
+               .getSecurityRoleRef())) {
+            pd.addSecurityRoleRef(srr);
+         }
+
+         for (ContainerRuntimeOption cro : handleRTOptions(portlet
+               .getContainerRuntimeOption())) {
+            pd.addContainerRuntimeOption(cro);
+         }
+
+         for (String prp : portlet.getSupportedPublicRenderParameter()) {
+            boolean ok = false;
+            for (PublicRenderParameter prpdef : pad.getPublicRenderParameters()) {
+               if (prpdef.getIdentifier().equals(prp)) {
+                  ok = true;
+               }
+            }
+            if (!ok) {
+               warning = "Public render parameter definition not found for: " + prp;
+               LOG.warn(warning);
+               throw new IllegalArgumentException(warning);
+            }
+            pd.addSupportedPublicRenderParameter(prp);
+         }
+
+         // Supported processing events
+         for (EventDefinitionReference edr : handleEventDefRefs(portlet
+               .getSupportedProcessingEvent())) {
+            pd.addSupportedProcessingEvent(edr);
+         }
+
+         // Supported publishing events
+         for (EventDefinitionReference edr : handleEventDefRefs(portlet
+               .getSupportedPublishingEvent())) {
+            pd.addSupportedPublishingEvent(edr);
+         }
+
+         pad.addPortlet(pd);
+
+      }
+   }
+
+}


[28/38] portals-pluto git commit: Integrated latest version of the portlet API 3.0. Made necessary minor adaptations the Pluto code and demo portlets to make the previously available funtionality work. For the partial action request, changed implementati

Posted by ms...@apache.org.
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/HeaderPortlet.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/HeaderPortlet.java b/portlet-api/src/main/java/javax/portlet/HeaderPortlet.java
new file mode 100644
index 0000000..a83bb74
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/HeaderPortlet.java
@@ -0,0 +1,63 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet;
+
+import java.io.IOException;
+
+/**
+ * <div class="changed_added_3_0">
+ * The <code>HeaderPortlet</code> interface provides portlets
+ * with the ability to add HTTP headers to the response, and
+ * to generate markup for aggregation into the portal response document head section. 
+ * <p>
+ * </div>
+ *
+ * @see     HeaderRequest
+ * @see     HeaderResponse
+ * @since 3.0
+ */
+
+public interface HeaderPortlet {
+
+    /**
+     * <div class="changed_added_3_0">
+     * Called by the portlet container to allow the portlet to set response
+     * headers and generate markup for overall response document head section. 
+     * </div>
+     * 
+     * @param request  the header request
+     * @param response  the header response
+     * @exception  PortletException
+     *                   if the portlet has problems fulfilling the request
+     * @exception  UnavailableException   
+     *                   if the portlet is unavailable to process the request at this time
+     * @exception  PortletSecurityException  
+     *                   if the portlet cannot fulfill this request due to security reasons
+     * @exception  IOException
+     *                   if the streaming causes an I/O problem
+     */
+    public void renderHeaders (HeaderRequest request, HeaderResponse response) 
+        throws PortletException, java.io.IOException;
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/HeaderRequest.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/HeaderRequest.java b/portlet-api/src/main/java/javax/portlet/HeaderRequest.java
new file mode 100644
index 0000000..75352a3
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/HeaderRequest.java
@@ -0,0 +1,30 @@
+/*  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.
+ */
+
+
+package javax.portlet;
+
+/**
+ * <div class="changed_added_3_0">
+ * Tag interface designating a header request object
+ * </div>
+ *
+ */
+public interface HeaderRequest extends RenderRequest {
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/HeaderResponse.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/HeaderResponse.java b/portlet-api/src/main/java/javax/portlet/HeaderResponse.java
new file mode 100644
index 0000000..36ee7f0
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/HeaderResponse.java
@@ -0,0 +1,84 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet;
+
+/**
+ * <div class="changed_added_3_0">
+ * The
+ * <CODE>HeaderResponse</CODE> defines an object to assist a portlet in
+ * sending a response to the portal. It extends the
+ * <CODE>MimeResponse</CODE> interface to provide specific header
+ * response functionality to portlets.
+ * <p>
+ * The portlet container creates
+ * a <CODE>HeaderResponse</CODE> object and passes it as argument to the
+ * portlet's <CODE>renderHeaders</CODE> method in order to allow the portlet
+ * to add response headers and generate markup for the overall portal 
+ * response document <code>HEAD</code> section.
+ * </div>
+ * 
+ * @see RenderResponse
+ * @see HeaderRequest
+ * @see HeaderPortlet
+ * @see PortletResponse
+ * @see MimeResponse
+ */
+public interface HeaderResponse extends MimeResponse {
+
+    /**
+     * This method sets the title of the portlet.
+     * <p>
+     * The value can be a text String
+     * 
+     * @param title
+     *            portlet title as text String or resource URI
+     */
+    public void setTitle(String title);
+
+    /**
+     * Sets the MIME type for the header response. The portlet should set the
+     * content type before calling {@link #getWriter} or
+     * {@link #getPortletOutputStream}.
+     * <p>
+     * Calling <code>setContentType</code> after <code>getWriter</code> or
+     * <code>getOutputStream</code> does not change the content type.
+     * <p>
+     * The portlet container will ignore any character encoding
+     * specified as part of the content type for <code>render</code>
+     * calls.
+     * 
+     * @param type
+     *            the content MIME type
+     * 
+     * @throws java.lang.IllegalArgumentException
+     *             if the given type is not in the list 
+     *             returned by <code>PortletRequest.getResponseContentTypes</code>
+     * 
+     * @see PortletRequest#getResponseContentTypes
+     * @see #getContentType
+     */
+    public void setContentType(String type);
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/MethodToken.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/MethodToken.java b/portlet-api/src/main/java/javax/portlet/MethodToken.java
new file mode 100644
index 0000000..59e4f58
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/MethodToken.java
@@ -0,0 +1,68 @@
+/*  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.
+ */
+
+
+package javax.portlet;
+
+import java.lang.annotation.Annotation;
+
+/**
+ * <div class="changed_added_3_0">
+ * Interface designating an implementation-specific token used for annotated
+ * method invocation. The token represents a single candidate method for
+ * conditional dispatching.
+ * </div>
+ *
+ * @see  ConditionalDispatcher
+ * @see  javax.portlet.annotations.ConditionalDispatchMethod
+ */
+public interface MethodToken {
+   
+   /**
+    * <div class="changed_added_3_0">
+    * Returns the annotation on the candidate method of the given type
+    * if present, otherwise <code>null</code>.
+    * </div>
+    * 
+    * @param annotationClass     The annotation type to be returned
+    * @return                    The annotation on the candidate method of the 
+    *                            given type, otherwise <code>null</code>.
+    */
+   <A extends Annotation> A getAnnotation(Class<A> annotationClass);
+   
+   /**
+    * <div class="changed_added_3_0">
+    * Returns an array containing all annotations present on the candidate method.
+    * </div>
+    * 
+    * @return     The array of all candidate method annotations.
+    */
+   Annotation[] getAnnotations();
+   
+   /**
+    * <div class="changed_added_3_0">
+    * Returns true if an annotation of the given type is present on the candidate method, 
+    * else false. 
+    * This method is designed primarily for convenient access to marker annotations.
+    * </div>
+    * 
+    * @return     <code>true</code> if the given annotation type is present
+    */
+   boolean isAnnotationPresent(Class<? extends Annotation> annotationClass);
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/MimeResponse.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/MimeResponse.java b/portlet-api/src/main/java/javax/portlet/MimeResponse.java
index 8e950dc..f007ed8 100644
--- a/portlet-api/src/main/java/javax/portlet/MimeResponse.java
+++ b/portlet-api/src/main/java/javax/portlet/MimeResponse.java
@@ -39,12 +39,12 @@ public interface MimeResponse extends PortletResponse {
     * Specifies processing when a URL is created.
     * </div>
     * 
-    * @see #createActionURL(ParameterCopyOption)
-    * @see #createRenderURL(ParameterCopyOption)
+    * @see #createActionURL(Copy)
+    * @see #createRenderURL(Copy)
     * 
     * @since 3.0
     */
-   public enum ParameterCopyOption {
+   public enum Copy {
 
       /**
        * <div class="changed_added_3_0">
@@ -53,7 +53,7 @@ public interface MimeResponse extends PortletResponse {
        *  
        * @since 3.0
        */
-      COPY_NO_PARAMETERS,
+      NONE,
 
       /**
        * <div class="changed_added_3_0">
@@ -64,7 +64,7 @@ public interface MimeResponse extends PortletResponse {
        *  
        * @since 3.0
        */
-      COPY_RENDER_PARAMETERS,
+      ALL,
 
       /**
        * <div class="changed_added_3_0">
@@ -74,7 +74,7 @@ public interface MimeResponse extends PortletResponse {
        *  
        * @since 3.0
        */
-      COPY_PUBLIC_RENDER_PARAMETERS;
+      PUBLIC;
    }
    
    
@@ -443,8 +443,8 @@ public interface MimeResponse extends PortletResponse {
      * If a public render parameter value is set or removed on a render URL, then the public 
      * render parameter will be set to the new value or removed when the URL is activated.
      * <p>
-     * The effect of this method is the same as calling {@link #createRenderURL(ParameterCopyOption)}
-     * with the parameter set to COPY_PUBLIC_RENDER_PARAMETERS.
+     * The effect of this method is the same as calling {@link #createRenderURL(Copy)}
+     * with the parameter set to PUBLIC.
      * </div>
      *
      * @return a portlet render URL
@@ -464,12 +464,12 @@ public interface MimeResponse extends PortletResponse {
      * The new render URL will contain render parameters from the
      * current request as specified by the <code>option</code> parameter.
      * <dl>
-     * <dt>COPY_NO_PARAMETERS</dt>
+     * <dt>NONE</dt>
      * <dd>All public and private parameters are removed from the URL.</dd>
-     * <dt>COPY_RENDER_PARAMETERS</dt>
+     * <dt>ALL</dt>
      * <dd>The public and private parameters governing the current 
      * request are added to the URL.</dd>
-     * <dt>COPY_PUBLIC_PARAMETERS</dt>
+     * <dt>PUBLIC</dt>
      * <dd>Only public parameters governing the current
      * request are added to the URL.</dd>
      * </dl>
@@ -486,13 +486,13 @@ public interface MimeResponse extends PortletResponse {
      * @param option
      *            Specifies how current parameters are to be copied to the URL
      *
-     * @see ParameterCopyOption
+     * @see Copy
      * 
      * @return a portlet render URL
      *     
      * @since 3.0
      */
-    public RenderURL createRenderURL(ParameterCopyOption option);
+    public RenderURL createRenderURL(Copy option);
 
 
 	/**
@@ -527,8 +527,8 @@ public interface MimeResponse extends PortletResponse {
      * then the public render parameter will be set to the new value or 
      * removed when the URL is activated.
      * <p>
-     * The effect of this method is the same as calling {@link #createRenderURL(ParameterCopyOption)}
-     * with the parameter set to COPY_PUBLIC_RENDER_PARAMETERS.
+     * The effect of this method is the same as calling {@link #createRenderURL(Copy)}
+     * with the parameter set to PUBLIC.
      * </div>
      * 
      * @return a portlet action URL
@@ -548,12 +548,12 @@ public interface MimeResponse extends PortletResponse {
      * The new action URL will contain render parameters from the
      * current request as specified by the <code>option</code> parameter.
      * <dl>
-     * <dt>COPY_NO_PARAMETERS</dt>
+     * <dt>NONE</dt>
      * <dd>All public and private parameters are removed from the URL.</dd>
-     * <dt>COPY_RENDER_PARAMETERS</dt>
+     * <dt>ALL</dt>
      * <dd>The public and private parameters governing the current 
      * request are added to the URL.</dd>
-     * <dt>COPY_PUBLIC_PARAMETERS</dt>
+     * <dt>PUBLIC</dt>
      * <dd>Only public parameters governing the current
      * request are added to the URL.</dd>
      * </dl>
@@ -572,13 +572,13 @@ public interface MimeResponse extends PortletResponse {
      * @param option
      *            Specifies how current parameters are to be copied to the URL
      *
-     * @see ParameterCopyOption
+     * @see Copy
      * 
      * @return a portlet action URL
      *     
      * @since 3.0
      */
-    public ActionURL createActionURL(ParameterCopyOption option);
+    public ActionURL createActionURL(Copy option);
 
 
 	/**

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/PortletURL.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/PortletURL.java b/portlet-api/src/main/java/javax/portlet/PortletURL.java
index bced4b2..1f18f3c 100644
--- a/portlet-api/src/main/java/javax/portlet/PortletURL.java
+++ b/portlet-api/src/main/java/javax/portlet/PortletURL.java
@@ -24,6 +24,8 @@
 
 package javax.portlet;
 
+import javax.portlet.annotations.PortletSerializable;
+
 
 
 /**
@@ -72,4 +74,19 @@ public interface PortletURL extends BaseURL, MutablePortletState
    
    @Deprecated
   public void removePublicRenderParameter(String name); 
+   
+   /**
+    * Sets the value of a {@literal @}PortletStateScoped bean
+    * on an action or render URL. 
+    * Calling this method copies the bean state to the URL so that the values are
+    * available to the portlet when the URL is activated.
+    *  
+    * @param bean    The {@literal @}PortletStateScoped bean
+    * 
+    * @exception java.lang.IllegalArgumentException
+    *                if the bean is not an {@literal @}PortletStateScoped bean.
+    *                
+    * @see  javax.portlet.annotations.PortletStateScoped
+    */
+   public void setBeanParameter(PortletSerializable bean);
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/RenderResponse.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/RenderResponse.java b/portlet-api/src/main/java/javax/portlet/RenderResponse.java
index a822a49..df29374 100644
--- a/portlet-api/src/main/java/javax/portlet/RenderResponse.java
+++ b/portlet-api/src/main/java/javax/portlet/RenderResponse.java
@@ -47,6 +47,7 @@ public interface RenderResponse extends MimeResponse {
      * @param title
      *            portlet title as text String or resource URI
      */
+   @Deprecated
     public void setTitle(String title);
    
     

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/ResourceRequest.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/ResourceRequest.java b/portlet-api/src/main/java/javax/portlet/ResourceRequest.java
index f7918cc..7863897 100644
--- a/portlet-api/src/main/java/javax/portlet/ResourceRequest.java
+++ b/portlet-api/src/main/java/javax/portlet/ResourceRequest.java
@@ -63,6 +63,31 @@ public interface ResourceRequest extends ClientDataRequest {
    public static final String ETAG = "portlet.ETag";
 
    /**
+    * <div class="changed_added_3_0">
+    * This constant represents the attribute name used to retrieve the
+    * resource request attribute <code>String</code> representing the current 
+    * page state.
+    * <p>
+    * The PAGE_STATE request attribute is only set during Partial Action processing. 
+    * At all other times, the attribute will be <code>null</code>.
+    * <p>
+    * The Partial Action processing sequence provides support for infrastructure components
+    * such as a JSF Portlet Bridge to obtain page state information for use by the
+    * JavaScript Portlet Hub component.
+    * <p>
+    * The content of the page state request attribute is implementation-specific. 
+    * The portlet performing partial action processing must transport the attribute value to 
+    * the client and pass it to the Portlet Hub unchanged in order to conclude a 
+    * Partial Action processing sequence.
+    * <p>
+    * The portlet may make no assumptions about the length or content of the
+    * request attribute value. 
+    * The attribute value may be of any length or <code>null</code>.
+    * </div>
+    */
+   public static final String PAGE_STATE = "javax.portlet.pageState";
+
+   /**
     * Returns the validation tag if the portlet container
     * has a cached response for this validation tag, or
     * <code>null</code> if no cached response exists.
@@ -132,27 +157,6 @@ public interface ResourceRequest extends ClientDataRequest {
     */
 
    public ResourceParameters getResourceParameters();
-   
-   /**
-    * <div class="changed_added_3_0">
-    * Returns a <code>String</code> representing the current page state.
-    * <p>
-    * The content of the returned value is unspecified. It is to be passed to the
-    * Portlet Hub in order to conclude a Partial Action processing sequence. 
-    * <code>null</code> is a valid return value.
-    * <p>
-    * This call is only valid during Partial Action processing. If called at other times,
-    * the returned value is unspecified.
-    * <p>
-    * The Partial Action processing sequence provides support for infrastructure components
-    * such as a JSF Portlet Bridge to obtain page state information for use by the
-    * JavaScript Portlet Hub component.
-    * </div>
-    * 
-    * @return String to be passed to the Portlet Hub to conclude a Partial Action
-    *         processing sequence.
-    */
-   public String getPageState();
 
 
    /**

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/ResourceResponse.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/ResourceResponse.java b/portlet-api/src/main/java/javax/portlet/ResourceResponse.java
index 897a5f0..afc5d8a 100644
--- a/portlet-api/src/main/java/javax/portlet/ResourceResponse.java
+++ b/portlet-api/src/main/java/javax/portlet/ResourceResponse.java
@@ -145,7 +145,7 @@ public interface ResourceResponse extends MimeResponse {
      *             is not <code>PAGE</code> and thus does not allow
      *             for creating render URLs.
      */
-	public RenderURL createRenderURL();
+   public <T extends PortletURL & RenderURL> T createRenderURL();
    
    
   /**
@@ -155,7 +155,7 @@ public interface ResourceResponse extends MimeResponse {
      *             is not <code>PAGE</code> and thus does not allow
      *             for creating render URLs.
      */
-  public RenderURL createRenderURL(ParameterCopyOption option);
+  public RenderURL createRenderURL(Copy option);
 
 	/**
      * @throws java.lang.IllegalStateException
@@ -164,7 +164,7 @@ public interface ResourceResponse extends MimeResponse {
      *             is not <code>PAGE</code> and thus does not allow
      *             for creating action URLs.
      */
-	public ActionURL createActionURL();
+   public <T extends PortletURL & ActionURL> T createActionURL();
 
 	/**
      * @throws java.lang.IllegalStateException
@@ -173,7 +173,7 @@ public interface ResourceResponse extends MimeResponse {
      *             is not <code>PAGE</code> and thus does not allow
      *             for creating action URLs.
      */
-   public ActionURL createActionURL(ParameterCopyOption option);
+   public ActionURL createActionURL(Copy option);
 
 	/**
      * @throws java.lang.IllegalStateException

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/ActionMethod.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/ActionMethod.java b/portlet-api/src/main/java/javax/portlet/annotations/ActionMethod.java
new file mode 100644
index 0000000..477f97e
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/ActionMethod.java
@@ -0,0 +1,89 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Designates a method corresponding to the portlet API processAction method.
+ * The annotated method must have the following signature:
+ * <p>
+ *    <code>public void &lt;methodName&gt;(ActionRequest, ActionResponse)</code>
+ * <p>   
+ * where the method name can be freely selected.
+ * <p>
+ * The method declaration may contain a throws clause. Exceptions declared in the 
+ * throws clause should be of type {@link javax.portlet.PortletException} or
+ * {@link java.io.IOException}. 
+ * Checked exceptions of any other type will be caught, wrapped with a PortletException, 
+ * and rethrown.
+ * </div>
+ *    
+ * @see javax.portlet.Portlet#processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse) processAction
+ *
+ */
+
+@Retention(RUNTIME) @Target({METHOD})
+public @interface ActionMethod {
+   
+   /**
+    * The portlet name for the annotated method.
+    * 
+    * @return  The portlet name
+    */
+   String   portletName();
+   
+   /**
+    * The action name. 
+    * <p> 
+    * If an action name is specified, the bean enabler will dispatch Action requests with 
+    * matching values of the reserved "javax.portlet.action" parameter to this method. 
+    * <p>
+    * An ActionMethod with an empty action name will receive all  
+    * Action requests not dispatched to other named ActionMethods.
+    * 
+    * @return  The action name
+    */
+   String   actionName() default "";
+   
+   /**
+    * <div class='container-change'>
+    * The QName definitions of the events published by this method.
+    * </div>
+    * 
+    * @see     EventDefinition
+    * @see     PortletQName
+    * 
+    * @return  The processing event QNames
+    */
+   PortletQName[]   publishingEvents() default {};
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/ActionParam.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/ActionParam.java b/portlet-api/src/main/java/javax/portlet/annotations/ActionParam.java
new file mode 100644
index 0000000..596c590
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/ActionParam.java
@@ -0,0 +1,68 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.inject.Qualifier;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Qualifier that specifies an action parameter for injection.
+ * The parameter will be <code>null</code> if accessed outside of an action method.
+ * <p>
+ * The type of the injection target must be <code>String</code> or <code>String[]</code>.
+ * <p>
+ * This annotation may only be used in <code>{@literal @}RequestScoped</code> or
+ * <code>{@literal @}PortletStateScoped</code> beans.
+ * <p>
+ * Example:
+ * <div class='codebox'>      
+ * {@literal @}Inject {@literal @}ActionParam("paramName")<br/>   
+ * private String[] paramValues;
+ * </div>                    
+ * </div>
+ * 
+ * @see javax.portlet.PortletRequest#getParameter(String) getParameter
+ * @see javax.portlet.PortletRequest#getParameterValues(String) getParameterValues
+ */
+
+@Qualifier @Retention(RUNTIME) @Target({METHOD, FIELD, PARAMETER})
+public @interface ActionParam {
+   
+   /**
+    * The parameter name.
+    * 
+    * @return     The parameter name.
+    */
+   @Nonbinding String   value();
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/BeanPortlet.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/BeanPortlet.java b/portlet-api/src/main/java/javax/portlet/annotations/BeanPortlet.java
new file mode 100644
index 0000000..0aff963
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/BeanPortlet.java
@@ -0,0 +1,47 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Provides a qualifier sometimes needed for disambiguation. 
+ * <p>
+ * This qualifier is needed when injecting a PortletConfig object.
+ * </div>
+ */
+
+@Qualifier @Retention(RUNTIME) @Target({TYPE, METHOD, FIELD, PARAMETER})
+public @interface BeanPortlet {
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/ConditionalDispatchMethod.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/ConditionalDispatchMethod.java b/portlet-api/src/main/java/javax/portlet/annotations/ConditionalDispatchMethod.java
new file mode 100644
index 0000000..0296c4d
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/ConditionalDispatchMethod.java
@@ -0,0 +1,112 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Designates a conditional dispatcher method.
+ * The portlet container will invoke the annotated method when it determines 
+ * that <code>@RenderMethod</code>, <code>@HeaderMethod</code>, or 
+ * <code>@ServeResourceMethod</code> annotated methods
+ * are available for dispatching during request processing.
+ * <p>
+ * The annotated method must have one of the following signatures:
+ * <p>
+ *    <code>public boolean &lt;methodName&gt;(RenderRequest request, RenderResponse response, 
+ *                Set<MethodToken> methods)</code>
+ * <p>   
+ *    <code>public boolean &lt;methodName&gt;(HeaderRequest request, HeaderResponse response, 
+ *                Set<MethodToken> methods)</code>
+ * <p>   
+ *    <code>public boolean &lt;methodName&gt;(ResourceRequest request, ResourceResponse response, 
+ *                Set<MethodToken> methods)</code>
+ * <p>   
+ * where the method name can be freely selected.
+ * <p>
+ * For a given portlet name, only a single method of each type may be annotated. 
+ * If a conditional dispatcher is declared in the portlet deployment descriptor, that
+ * declaration overrides any <code>@ConditionalDispatchMethod</code> annotation.
+ * <p>
+ * The method should analyze the given <code>Set</code> of candidate methods using
+ * the annotations available from each <code>MethodToken</code> 
+ * based on the current request and
+ * create a list of method tokens representing the methods to be invoked. 
+ * The output list may be empty or <code>null</code>. 
+ * A given method token may appear in the output list more than once.  
+ * <p>
+ * If the method returns a non-<code>null</code> List object, the portlet container will
+ * invoke the methods in the order they appear in the list, and then 
+ * perform no further dispatching operation for the current request.
+ * <p>
+ * If the method returns <code>null</code>, the portlet container will dispatch the 
+ * method using its implementation-specific algorithm.
+ * <p>
+ * If the method throws an exception, it will be treated as an unhandled exception
+ * during request processing. The portlet container will perform no 
+ * further dispatching.
+ * <p>
+ * The method declaration may contain a throws clause. Exceptions declared in the 
+ * throws clause should be of type {@link javax.portlet.PortletException} or
+ * {@link java.io.IOException}. 
+ * If the <code>throws</code> clause defines exceptions of any other type, 
+ * it will be treated as a configuration error. 
+ * </div>
+ *    
+ * @see RenderMethod
+ * @see HeaderMethod
+ * @see ServeResourceMethod
+ * @see javax.portlet.ConditionalDispatcher
+ * @see javax.portlet.MethodToken
+ *
+ */
+
+@Retention(RUNTIME) @Target({METHOD})
+public @interface ConditionalDispatchMethod {
+   
+   /**
+    * <div class="changed_added_3_0">
+    * The portlet names for which the conditional dispatcher applies.
+    * <p>
+    * The annotated method can apply to multiple portlets within the portlet
+    * application. The names of the portlets to which the listener applies must be 
+    * specified in this field.
+    * <p>
+    * A wildcard character '*' can be specified in the first portletName array element 
+    * to indicate that the listener is to apply to all portlets in the portlet application.
+    * If specified, the wildcard character must appear alone in the first array element.
+    * This is the default if no portlet names are explicitly provided.
+    * </div>
+    * 
+    * @return     The portlet names
+    */
+   String[]    portletNames() default "*";
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/ContentTypeSupport.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/ContentTypeSupport.java b/portlet-api/src/main/java/javax/portlet/annotations/ContentTypeSupport.java
new file mode 100644
index 0000000..51f1d93
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/ContentTypeSupport.java
@@ -0,0 +1,87 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * This annotation is used within composite portlet configuration annotations to
+ * represent the portlet modes and window states supported for a given content type.
+ * <p>
+ * It cannot be used as a stand-alone portlet annotation.
+ * </div>
+ */
+@Retention(RUNTIME) @Target({ANNOTATION_TYPE})
+public @interface ContentTypeSupport {
+   
+   /**
+    * <div class='container-change'>
+    * The MIME type for which support is being defined.
+    * MIME type name, e.g. "text/html".
+    * The MIME type may also contain the wildcard
+    * character '*' as in 'text&#x2F;*' or '*&#x2F;*'.
+    * </div>
+    * 
+    * @return     The MIME type
+    */
+   String   mimeType() default "text/html";
+   
+   /**
+    * <div class='container-change'>
+    * Defines the portlet modes supported by this portlet.
+    * <p>
+    * The following names represent the standard portlet modes: 
+    * "edit", "help", "view".
+    * Custom portlet modes may also be defined.
+    * <p>
+    * Portlet mode names are not case sensitive.
+    * </div>
+    * 
+    * @return     The portlet modes
+    */
+   String[] supportedPortletModes() default {"view"};
+   
+   /**
+    * <div class='container-change'>
+    * Defines the window states supported by this portlet.
+    * <p>
+    * The following names represent the standard window states: 
+    * "normal", "minimized", "maximized".
+    * Custom window states may also be defined.
+    * <p>
+    * Window state names are not case sensitive.
+    * </div>
+    * 
+    * @return     The window states
+    */
+   String[] supportedWindowStates() default {"normal", "minimized", "maximized"};
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/ContextPath.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/ContextPath.java b/portlet-api/src/main/java/javax/portlet/annotations/ContextPath.java
new file mode 100644
index 0000000..9f859bc
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/ContextPath.java
@@ -0,0 +1,58 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Qualifier that specifies the context root for injection.
+ * <p>
+ * The injection target type must be <code>String</code>.
+ * <p>
+ * This annotation may only be used in <code>{@literal @}RequestScoped</code> or
+ * <code>{@literal @}PortletStateScoped</code> beans.
+ * <p>
+ * Example:
+ * <div class='codebox'>      
+ * {@literal @}Inject {@literal @}ContextPath<br/>   
+ * private String namespace;
+ * </div>                    
+ * </div>
+ * 
+ * @see javax.portlet.PortletRequest#getContextPath() getContextPath
+ */
+
+@Qualifier @Retention(RUNTIME) @Target({METHOD, FIELD, PARAMETER})
+public @interface ContextPath {
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/CustomPortletMode.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/CustomPortletMode.java b/portlet-api/src/main/java/javax/portlet/annotations/CustomPortletMode.java
new file mode 100644
index 0000000..45774a6
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/CustomPortletMode.java
@@ -0,0 +1,76 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * This annotation is used within composite portlet configuration annotations to
+ * represent a custom portlet mode.
+ * It cannot be used as a stand-alone portlet annotation.
+ * </div>
+ */
+@Retention(RUNTIME) @Target({ANNOTATION_TYPE})
+public @interface CustomPortletMode {
+   
+   /**
+    * <div class='container-change'>
+    * Provides locale-specific text describing the custom portlet mode for use by the portal application or by tools.
+    * </div>
+    * 
+    * @return  The custom portlet mode description
+    */
+   LocaleString[]      description() default {};
+   
+   /**
+    * <div class='container-change'>
+    * The custom portlet mode name.
+    * <p>
+    * The name by which the portlet mode is identified.
+    * </div>
+    * 
+    * @return  The custom portlet mode name
+    */
+   String      name();
+   
+   /**
+    * <div class='container-change'>
+    * The portal managed flag.
+    * <p>
+    * If set to <code>true</code>, the custom portlet mode will be managed by the portal.
+    * If set to <code>false</code>, the custom portlet mode will be managed by the portlet.
+    * </div>
+    * 
+    * @return  The portal managed flag setting 
+    */
+   boolean     portalManaged() default true;
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/CustomWindowState.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/CustomWindowState.java b/portlet-api/src/main/java/javax/portlet/annotations/CustomWindowState.java
new file mode 100644
index 0000000..bee3f36
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/CustomWindowState.java
@@ -0,0 +1,64 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * This annotation is used within composite portlet configuration annotations to
+ * represent a custom window state.
+ * It cannot be used as a stand-alone portlet annotation.
+ * </div>
+ */
+@Retention(RUNTIME) @Target({ANNOTATION_TYPE})
+public @interface CustomWindowState {
+   
+   /**
+    * <div class='container-change'>
+    * Provides locale-specific text describing the custom window state for use by the portal application or by tools.
+    * </div>
+    * 
+    * @return  The custom window state description
+    */
+   LocaleString[]      description() default {};
+   
+   /**
+    * <div class='container-change'>
+    * The custom window state name.
+    * <p>
+    * The name by which the window state is identified.
+    * </div>
+    * 
+    * @return  The custom window state name
+    */
+   String      name();
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/Dependency.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/Dependency.java b/portlet-api/src/main/java/javax/portlet/annotations/Dependency.java
new file mode 100644
index 0000000..2e9c9d1
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/Dependency.java
@@ -0,0 +1,65 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * This annotation is used within composite portlet configuration annotations to
+ * represent dependencies the portlet may have on external resources.
+ * The resources can represent client-side prerequisites such as JavaScript libraries
+ * or stylesheet resources that are shared among portlets.
+ * <p> 
+ * This annotation cannot be used as a stand-alone portlet annotation.
+ * </div>
+ */
+@Retention(RUNTIME) @Target({ANNOTATION_TYPE})
+public @interface Dependency {
+   
+   /**
+    * <div class='container-change'>
+    * The resource name.
+    * </div>
+    * 
+    * @return     The resource name
+    */
+   String   name();
+   
+   /**
+    * <div class='container-change'>
+    * The minimum acceptable module version.
+    * </div>
+    * 
+    * @return     The minimum acceptable module version
+    */
+   String   minVersion();
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/DestroyMethod.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/DestroyMethod.java b/portlet-api/src/main/java/javax/portlet/annotations/DestroyMethod.java
new file mode 100644
index 0000000..7b27cfe
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/DestroyMethod.java
@@ -0,0 +1,76 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Designates a method corresponding to the portlet API destroy method.
+ * The annotated method must have the following signature:
+ * <p>
+ *    <code>public void &lt;methodName&gt;()</code>
+ * <p>   
+ * where the method name can be freely selected.
+ * <p>
+ * the <code>destroy</code> method is called by the portlet container to 
+ * indicate to a portlet that the
+ * portlet is being taken out of service.  
+ * <p>
+ * Before the portlet container calls the destroy method, it should 
+ * allow any threads that are currently processing requests within 
+ * the portlet object to complete execution. To avoid
+ * waiting forever, the portlet container can optionally wait for 
+ * a predefined time before destroying the portlet object.
+ * <p>
+ * This method enables the portlet to do the following:
+ * <ul>
+ * <li>clean up any resources that it holds (for example, memory,
+ * file handles, threads) 
+ * <li>make sure that any persistent state is
+ * synchronized with the portlet current state in memory.
+ * </ul>
+ * </div>
+ *    
+ * @see javax.portlet.Portlet#destroy()
+ *
+ */
+
+@Retention(RUNTIME) @Target({METHOD})
+public @interface DestroyMethod {
+   
+   /**
+    * The portlet name for the annotated method.
+    * 
+    * @return  The portlet name
+    */
+   String   portletName();
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/EventDefinition.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/EventDefinition.java b/portlet-api/src/main/java/javax/portlet/annotations/EventDefinition.java
new file mode 100644
index 0000000..591c14a
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/EventDefinition.java
@@ -0,0 +1,107 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * This annotation is used within composite portlet configuration annotations to
+ * represent a single event.
+ * It cannot be used as a stand-alone portlet annotation.
+ * </div>
+ */
+@Retention(RUNTIME) @Target({ANNOTATION_TYPE})
+public @interface EventDefinition {
+   
+   /**
+    * The event Qname.
+    * <p>
+    * The local part of the QName should be a non-empty String.
+    * The local part is used as the event name in the portlet API 
+    * event handling methods.
+    * <p>
+    * The event qname must be unique within the portlet application. 
+    * 
+    * @see     javax.portlet.Event
+    * @see     javax.portlet.StateAwareResponse#setEvent(javax.xml.namespace.QName, java.io.Serializable)
+    * @see     javax.portlet.StateAwareResponse#setEvent(String, java.io.Serializable)
+    * @see     javax.portlet.PortletConfig#getProcessingEventQNames() PortletConfig#getProcessingEventQNames
+    * @see     javax.portlet.PortletConfig#getPublishingEventQNames() PortletConfig#getPublishingEventQNames
+    * 
+    * @return  The event qname
+    */
+   PortletQName   qname();
+
+   /**
+    * The event payload type associated with the specified QName.
+    * Each QName may have only a single event payload type associated with it.
+    * The payload type must be serializable and must have a valid JAXB binding.
+    * <p>
+    * The default value <code>void.class</code> indicates that the event has no payload. 
+    * 
+    * @see     javax.portlet.Event
+    * @see     javax.portlet.StateAwareResponse#setEvent(javax.xml.namespace.QName, java.io.Serializable)
+    * @see     javax.portlet.StateAwareResponse#setEvent(String, java.io.Serializable)
+    * 
+    * @return     A class representing the payload type
+    */
+   Class<?>    payloadType() default void.class;
+   
+   /**
+    * <div class='container-change'>
+    * Provides locale-specific text describing the event for use by the portal application or by tools.
+    * </div>
+    * 
+    * @return  The event description
+    */
+   LocaleString[]      description() default {};
+   
+   /**
+    * <div class='container-change'>
+    * The display-name type contains a locale-specific short name that is intended to be displayed by tools. 
+    * It is used by display-name elements. 
+    * The display name need not be unique.
+    * </div>
+    * 
+    * @return  The display name
+    */
+   LocaleString[]   displayName() default {};
+
+   /**
+    * <div class='container-change'>
+    * The qualified name aliases for this event.
+    * </div>
+    * 
+    * @return the qualified name aliases
+    */
+   PortletQName[]    alias() default {};
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/EventMethod.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/EventMethod.java b/portlet-api/src/main/java/javax/portlet/annotations/EventMethod.java
new file mode 100644
index 0000000..8790e33
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/EventMethod.java
@@ -0,0 +1,119 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Designates a method corresponding to the portlet API processEvent method.
+ * The annotated method must have the following signature:
+ * <p>
+ *    <code>public void &lt;methodName&gt;(EventRequest, EventResponse)</code>
+ * <p>   
+ * where the method name can be freely selected.
+ * <p>
+ * The method declaration may contain a throws clause. Exceptions declared in the 
+ * throws clause should be of type {@link javax.portlet.PortletException} or
+ * {@link java.io.IOException}. 
+ * Checked exceptions of any other type will be caught, wrapped with a PortletException, 
+ * and rethrown.
+ * </div>
+ *    
+ * @see javax.portlet.EventPortlet#processEvent(javax.portlet.EventRequest, javax.portlet.EventResponse) processEvent
+ *
+ */
+
+@Retention(RUNTIME) @Target({METHOD})
+public @interface EventMethod {
+   
+   /**
+    * The portlet name for the annotated method.
+    * 
+    * @return     The portlet name
+    */
+   String   portletName();
+   
+   /**
+    * If set to <code>true</code>, render parameters will be automatically copied
+    * from the <code>EventRequest</code> to the <code>EventResponse</code>.
+    * <p>
+    * The copy will take place before the code body of the annotated method
+    * is executed.
+    * 
+    * @return     <code>true</code> if parameters are to be copied.
+    */
+   boolean  copyParameters() default true; 
+   
+   /**
+    * The event name.
+    * <p>
+    * TODO: rework / remove this.
+    * <p>
+    * If an event name is specified, the bean enabler will dispatch portlet events with 
+    * matching event names to this method. 
+    * <p>
+    * An EventMethod with an empty event 
+    * name will receive all event requests not dispatched to other named EventMethods.
+    * 
+    * 
+    * @return  The event name
+    */
+   String   eventName() default "";
+   
+   /**
+    * <div class='container-change'>
+    * The processing event QName definitions supported by this method.
+    * <p>
+    * At least one processing event QName must be specified.
+    * <p>
+    * TODO: remove the default clause after rework above.
+    * </div>
+    * 
+    * @see     EventDefinition
+    * @see     PortletQName
+    * 
+    * @return  The processing event QNames
+    */
+   PortletQName[]   processingEvents() default {};
+   
+   /**
+    * <div class='container-change'>
+    * The QName definitions of the events published by this method.
+    * </div>
+    * 
+    * @see     EventDefinition
+    * @see     PortletQName
+    * 
+    * @return  The processing event QNames
+    */
+   PortletQName[]   publishingEvents() default {};
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/HeaderMethod.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/HeaderMethod.java b/portlet-api/src/main/java/javax/portlet/annotations/HeaderMethod.java
new file mode 100644
index 0000000..7c0a05a
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/HeaderMethod.java
@@ -0,0 +1,137 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Designates a method corresponding to the renderHeaders method of 
+ * the <code>HeaderPortlet</code> interface.
+ * The annotated method must have the following signature:
+ * <p>
+ *    <code>public void &lt;methodName&gt;(HeaderRequest, HeaderResponse)</code>
+ * <p>   
+ * where the method name can be freely selected.
+ * <p>
+ * The method declaration may contain a throws clause. Exceptions declared in the 
+ * throws clause should be of type {@link javax.portlet.PortletException} or
+ * {@link java.io.IOException}. 
+ * Checked exceptions of any other type will be caught, wrapped with a PortletException, 
+ * and rethrown.
+ * <p>
+ * The header method can be used to set properties such as cookies, header values, and 
+ * XML elements for the <code>HEAD</code> section of the aggregated portal document.
+ * <p>
+ * Valid <code>HEAD</code> section markup written to the <code>HeaderResponse</code>
+ * output stream or writer will be added to the aggregated portal document <code>HEAD</code>
+ * section subject to portlet container-imposed restrictions. 
+ * </div>
+ *    
+ * @see javax.portlet.PortletResponse the add and set properties methods of PortletResponse
+ * @see javax.portlet.MimeResponse#MARKUP_HEAD_ELEMENT MimeResponse#MARKUP_HEAD_ELEMENT
+ * @see javax.portlet.HeaderPortlet
+ */
+
+@Retention(RUNTIME) @Target({METHOD})
+public @interface HeaderMethod {
+   
+   /**
+    * The portlet names for which the header method applies.
+    * <p>
+    * The annotated method can apply to multiple portlets within the portlet
+    * application. The names of the portlets to which the resources apply must be 
+    * specified in this field.
+    * <p>
+    * A wildcard character '*' can be specified in the first portletName array element 
+    * to indicate that the resource declarations are to apply to all portlets in 
+    * the portlet application.
+    * If specified, the wildcard character must appear alone in the first array element.
+    * 
+    * @return     The portlet names
+    */
+   String[]   portletNames();
+   
+   /**
+    * The portlet mode rendered by the annotated method.
+    * <p>
+    * If an portlet mode is specified, the bean enabler will dispatch Header requests with 
+    * matching portlet mode values to this method. 
+    * <p>
+    * If this field is empty, the method will be executed for all
+    * Header requests not dispatched by portlet mode to other HeaderMethods.
+    * 
+    * @return     The portlet mode
+    */
+   String   portletMode() default "view";
+   
+   /**
+    * Sets the content type, or the MIME type, of content generated by the method.
+    * The content type will be set before the annotated method body is executed.
+    * <p>
+    * If this field is empty, no content type will be set.
+    * The portlet can then set the content type using the portlet API
+    * <code>HeaderResponse#setContentType</code> method.
+    * 
+    * @see        javax.portlet.HeaderResponse#setContentType(String) HeaderResponse#setContentType
+    * 
+    * @return     The content type
+    */
+   String   contentType() default "text/html";
+   
+   /**
+    * Specifies a resource, such as a JSP, an HTML file, or a servlet to be included.
+    * <p>
+    * The resource will be included using the 
+    * <code>PortletRequestDispatcher#include</code> method after the method body 
+    * has been executed.
+    * <p>
+    * If this field is empty, no resource will be included.
+    * 
+    * @see        javax.portlet.PortletRequestDispatcher
+    * @see        javax.portlet.PortletRequestDispatcher#include(javax.portlet.PortletRequest, javax.portlet.PortletResponse) PortletRequestDispatcher#include
+    * 
+    * @return     The resource to be included
+    */
+   String   include() default "";
+   
+   /**
+    * The ordinal number for this annotated method.
+    * <p>
+    * The ordinal number determines the order of execution if multiple methods
+    * are annotated.
+    * Annotated methods with a lower ordinal number are executed before methods with
+    * a higher ordinal number.
+    * 
+    * @return     The ordinal number
+    */
+   int        ordinal() default 0;
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/InitMethod.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/InitMethod.java b/portlet-api/src/main/java/javax/portlet/annotations/InitMethod.java
new file mode 100644
index 0000000..ed6176b
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/InitMethod.java
@@ -0,0 +1,74 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Designates a method corresponding to the portlet API init method.
+ * The annotated method must have the following signature:
+ * <p>
+ *    <code>public void &lt;methodName&gt;(PortletConfig) throws PortletException</code>
+ * <p>   
+ * where the method name can be freely selected.
+ * <p>
+ * the <code>init</code> method is called by the portlet container to 
+ * initialize the portlet when it is  
+ * being placed into service.
+ * <p>
+ * The portlet container calls the <code>init</code>
+ * method exactly once after instantiating the portlet.
+ * The <code>init</code> method must complete successfully
+ * before the portlet can receive any requests.
+ * <p>
+ * The portlet container cannot place the portlet into service
+ * if the <code>init</code> method
+ * <ol>
+ * <li>Throws a <code>PortletException</code>
+ * <li>Does not return within a time period defined by the portlet container.
+ * </ol>
+ * </div>
+ *    
+ * @see javax.portlet.Portlet#init(javax.portlet.PortletConfig)
+ *
+ */
+
+@Retention(RUNTIME) @Target({METHOD})
+public @interface InitMethod {
+   
+   /**
+    * The portlet name for the annotated method.
+    * 
+    * @return  The portlet name
+    */
+   String   portletName();
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/InitParameter.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/InitParameter.java b/portlet-api/src/main/java/javax/portlet/annotations/InitParameter.java
new file mode 100644
index 0000000..d726577
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/InitParameter.java
@@ -0,0 +1,58 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * This annotation is used within composite portlet configuration annotations to
+ * represent name-value pairs.
+ * It cannot be used as a stand-alone portlet annotation.
+ * </div>
+ */
+@Retention(RUNTIME) @Target({ANNOTATION_TYPE})
+public @interface InitParameter {
+   
+   /**
+    * The parameter name.
+    * 
+    * @return     The parameter name
+    */
+   String   name();
+   
+   /**
+    * The parameter value
+    * 
+    * @return     The parameter value
+    */
+   String   value();
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/LocaleString.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/LocaleString.java b/portlet-api/src/main/java/javax/portlet/annotations/LocaleString.java
new file mode 100644
index 0000000..a23346c
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/LocaleString.java
@@ -0,0 +1,67 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * This annotation represents locale-specific strings used within composite portlet configuration annotations to
+ * represent information describing the portlet.
+ * It cannot be used as a stand-alone portlet annotation.
+ * </div>
+ */
+@Retention(RUNTIME) @Target({ANNOTATION_TYPE})
+public @interface LocaleString {
+   
+   /**
+    * <div class='container-change'>
+    * The locale for the locale-specific string.
+    * <p>
+    * The locale is specified as a language tag as defined in 
+    * IETF BCP 47, "Tags for Identifying Languages".
+    * </div>
+    * 
+    * @see     java.util.Locale
+    * @see     java.util.Locale#forLanguageTag forLanguageTag
+    * @see     <a href="https://tools.ietf.org/html/bcp47">IETF BCP 47</a>
+    * 
+    * @return  The locale
+    */
+   String   locale() default "en";
+   
+   /**
+    * The parameter value
+    * 
+    * @return     The parameter value
+    */
+   String   value();
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/Namespace.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/Namespace.java b/portlet-api/src/main/java/javax/portlet/annotations/Namespace.java
new file mode 100644
index 0000000..291b298
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/Namespace.java
@@ -0,0 +1,58 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Qualifier that specifies the namespace for injection.
+ * <p>
+ * The injection target type must be <code>String</code>.
+ * <p>
+ * This annotation may only be used in <code>{@literal @}RequestScoped</code> or
+ * <code>{@literal @}PortletStateScoped</code> beans.
+ * <p>
+ * Example:
+ * <div class='codebox'>      
+ * {@literal @}Inject {@literal @}Namespace<br/>   
+ * private String namespace;
+ * </div>                    
+ * </div>
+ * 
+ * @see javax.portlet.PortletResponse#getNamespace() getNamespace
+ */
+
+@Qualifier @Retention(RUNTIME) @Target({METHOD, FIELD, PARAMETER})
+public @interface Namespace {
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/annotations/PortletApplication.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/annotations/PortletApplication.java b/portlet-api/src/main/java/javax/portlet/annotations/PortletApplication.java
new file mode 100644
index 0000000..63cc7de
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/annotations/PortletApplication.java
@@ -0,0 +1,143 @@
+/*  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.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.annotations;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * <div class='changed_added_3_0'>
+ * Annotation for the portlet application configuration. 
+ * These configuration parameters also appear in
+ * the portlet deployment descriptor.
+ * <p>
+ * The portlet deployment descriptor can continue to be used. 
+ * Values of configuration parameters appearing in the deployment descriptor have 
+ * precedence over the corresponding values defined in the annotation.   
+ * </div>
+ */
+@Retention(RUNTIME) @Target({TYPE})
+public @interface PortletApplication {
+   
+   /**
+    * The portlet API version required by this portlet application.
+    * 
+    * @return The portlet API version
+    */
+   String version() default "3.0";
+   
+   /**
+    * The portlet container runtime options.
+    * 
+    * @return     An array of portlet container runtime options
+    */
+   RuntimeOption[] runtimeOptions() default {};
+   
+   /**
+    * <div class='container-change'>
+    * The public render parameters used by the portlet.
+    * </div>
+    * 
+    * @return     The array of public render parameters.
+    */
+   PublicRenderParameterDefinition[]  publicParams() default {};
+   
+   /**
+    * <div class='container-change'>
+    * The events defined for the portlet.
+    * This includes the processing events as well as the publishing events.
+    * <p>
+    * The publishing event QNames are specified in the
+    * <code>ActionMethod</code> and <code>EventMethod</code> annotations.
+    * The processing event QNames are specified in the
+    * <code>ActionMethod</code> and <code>EventMethod</code> annotations.
+    * </div>
+    * 
+    * @see        PortletQName
+    * @see        ActionMethod
+    * @see        EventMethod
+    * 
+    * @return     The event definitions
+    */
+   EventDefinition[] events() default {};
+   
+   /**
+    * <div class='container-change'>
+    * The resource bundle name for this portlet.
+    * Name of the resource bundle containing the language specific 
+    * portlet information in different languages.
+    * <p>
+    * the file name is specified without 
+    * the language specific part (e.g. _en) or the file extension.
+    * </div>
+    * 
+    * @return     The resource bundle name
+    */
+   String   resourceBundle()  default "";
+   
+   /**
+    * <div class='container-change'>
+    * The custom portlet modes defined for this portlet.
+    * </div>
+    * 
+    * @return     The custom portlet modes
+    */
+   CustomPortletMode[] customPortletModes() default {};
+   
+   /**
+    * <div class='container-change'>
+    * The custom window states defined for this portlet.
+    * </div>
+    * 
+    * @return     The custom window states
+    */
+   CustomWindowState[] customWindowStates() default {};
+   
+   /**
+    * <div class='container-change'>
+    * The default QName namespace URI.
+    * <p>
+    * The default namespace URI is used when no namespace URI is specified 
+    * when declaring a QName for a public render parameter or portlet event. 
+    * </div>
+    * 
+    * @return  The default namespace URI.
+    */
+   String      defaultNamespaceURI() default "";
+   
+   /**
+    * <div class='container-change'>
+    * The user aattribute declarations. 
+    * </div>
+    * 
+    * @return  The user attribute declarations
+    */
+   UserAttribute[] userAttributes() default {};
+}


[02/38] portals-pluto git commit: Replaced code that reads the deployment descriptor with an implementation that can be better extended to add v3.0 support. Added test cases. Uses jaxb binding classes that are generated at compile time.

Posted by ms...@apache.org.
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/PortletApplicationDefinition362ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/PortletApplicationDefinition362ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/PortletApplicationDefinition362ImplTest.java
new file mode 100644
index 0000000..de06e67
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/PortletApplicationDefinition362ImplTest.java
@@ -0,0 +1,652 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl.jsr362;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.pluto.container.om.portlet.ContainerRuntimeOption;
+import org.apache.pluto.container.om.portlet.CustomPortletMode;
+import org.apache.pluto.container.om.portlet.CustomWindowState;
+import org.apache.pluto.container.om.portlet.EventDefinition;
+import org.apache.pluto.container.om.portlet.Filter;
+import org.apache.pluto.container.om.portlet.FilterMapping;
+import org.apache.pluto.container.om.portlet.Listener;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.PortletDefinition;
+import org.apache.pluto.container.om.portlet.PublicRenderParameter;
+import org.apache.pluto.container.om.portlet.SecurityConstraint;
+import org.apache.pluto.container.om.portlet.UserAttribute;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.ContainerRuntimeOptionImpl;
+import org.apache.pluto.container.om.portlet.impl.CustomPortletModeImpl;
+import org.apache.pluto.container.om.portlet.impl.CustomWindowStateImpl;
+import org.apache.pluto.container.om.portlet.impl.EventDefinitionImpl;
+import org.apache.pluto.container.om.portlet.impl.FilterImpl;
+import org.apache.pluto.container.om.portlet.impl.FilterMappingImpl;
+import org.apache.pluto.container.om.portlet.impl.ListenerImpl;
+import org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl;
+import org.apache.pluto.container.om.portlet.impl.PortletDefinitionImpl;
+import org.apache.pluto.container.om.portlet.impl.PublicRenderParameterImpl;
+import org.apache.pluto.container.om.portlet.impl.SecurityConstraintImpl;
+import org.apache.pluto.container.om.portlet.impl.UserAttributeImpl;
+import org.apache.pluto.container.om.portlet.impl.UserDataConstraintImpl;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Junit test cases for JSR 362 portlet application definition.
+ * @author Scott Nicklous
+ *
+ */
+public class PortletApplicationDefinition362ImplTest {
+
+   private static final String  WEBDDPKG         = "org/apache/pluto/container/om/portlet/";
+   private static final String  WEBDD31          = "webApp31simple.xml";
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet362Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+   private static ConfigurationHolder cfp;
+   
+   // class under test; cloned new for each test
+   private  PortletApplicationDefinition cut;
+
+   /**
+    * @throws java.lang.Exception
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      
+      InputStream in = PortletApplicationDefinition362ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+   
+   @Before
+   public void setUpBefore() throws Exception {
+      cut = new PortletApplicationDefinitionImpl(pad);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.PortletApplicationDefinitionImpl#getId()}.
+    */
+   @Test
+   public void testGetSetId() {
+      String val = pad.getId();
+      assertNotNull(val);
+      assertEquals("id1", val);
+      pad.setId("42");
+      val = pad.getId();
+      assertNotNull(val);
+      assertEquals("42", val);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.PortletApplicationDefinitionImpl#getName()}.
+    */
+   @Test
+   public void testGetSetName() {
+      pad.setName("Bob");
+      String val = pad.getName();
+      assertNotNull(val);
+      assertEquals("Bob", val);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.PortletApplicationDefinitionImpl#getContextPath()}.
+    */
+   @Test
+   public void testSetGetContextPath() {
+      pad.setContextPath("Bob");
+      String val = pad.getContextPath();
+      assertNotNull(val);
+      assertEquals("Bob", val);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.PortletApplicationDefinitionImpl#getVersion()}.
+    */
+   @Test
+   public void testGetSetVersion() {
+      String val = pad.getVersion();
+      assertNotNull(val);
+      assertEquals("3.0", val);
+      pad.setVersion("42");
+      val = pad.getVersion();
+      assertNotNull(val);
+      assertEquals("42", val);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getResourceBundle()}.
+    */
+   @Test
+   public void testGetSetResourceBundle() {
+      String val = pad.getResourceBundle();
+      String txt = "com.ibm.portal.ResourceBundle";
+      assertNotNull(val);
+      assertEquals("org.apache.portal.ResourceBundle", val);
+      pad.setResourceBundle(txt);
+      val = pad.getResourceBundle();
+      assertNotNull(val);
+      assertEquals(txt, val);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getDefaultNamespace()}.
+    */
+   @Test
+   public void testGetSetDefaultNamespace() {
+      String val = pad.getDefaultNamespace();
+      String txt = "https://www.ibm.com/";
+      assertNotNull(val);
+      assertEquals("https://www.apache.org/", val);
+      pad.setDefaultNamespace(txt);
+      val = pad.getDefaultNamespace();
+      assertNotNull(val);
+      assertEquals(txt, val);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getPortlet(java.lang.String)}.
+    */
+   @Test
+   public void testGetPortlet() {
+      PortletDefinition pd = pad.getPortlet("portlet362");
+      assertNotNull(pd);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getPortlets()}.
+    */
+   @Test
+   public void testGetPortlets() {
+      List<PortletDefinition> list = cut.getPortlets();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("portlet362", list.get(0).getPortletName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addPortlet(org.apache.pluto.container.om.portlet.PortletDefinition)}.
+    */
+   @Test
+   public void testAddPortlet() {
+      String newPN = "newPortlet";
+      PortletDefinition pd = new PortletDefinitionImpl(newPN, cut);
+      cut.addPortlet(pd);
+      
+      List<PortletDefinition> list = cut.getPortlets();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      boolean ok = false;
+      for (PortletDefinition item : list) {
+         if (item.getPortletName().equals(newPN)) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+  }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getEventDefinitions()}.
+    */
+   @Test
+   public void testGetEventDefinitions() {
+      List<EventDefinition> list = cut.getEventDefinitions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      boolean ok = false;
+      QName qn = new QName("https://www.apache.org/", "supported-processing-event");
+      for (EventDefinition item : list) {
+         if (item.getQName().equals(qn)) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getEventDefinition(javax.xml.namespace.QName)}.
+    */
+   @Test
+   public void testGetEventDefinition() {
+      QName qn = new QName("https://www.apache.org/", "supported-processing-event");
+      EventDefinition item = cut.getEventDefinition(qn);
+      assertNotNull(item);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addEventDefinition(org.apache.pluto.container.om.portlet.EventDefinition)}.
+    */
+   @Test
+   public void testAddEventDefinition() {
+      QName qn = new QName("https://www.ibm.com/", "some-other-event");
+      EventDefinition ed = new EventDefinitionImpl(qn);
+      cut.addEventDefinition(ed);
+
+      List<EventDefinition> list = cut.getEventDefinitions();
+      assertNotNull(list);
+      assertEquals(3, list.size());
+      boolean ok = false;
+      for (EventDefinition item : list) {
+         if (item.getQName().equals(qn)) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getPublicRenderParameter(java.lang.String)}.
+    */
+   @Test
+   public void testGetPublicRenderParameter() {
+      String prpid = "supported-public-render-parameter";
+      PublicRenderParameter prp = cut.getPublicRenderParameter(prpid);
+      assertNotNull(prp);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getPublicRenderParameters()}.
+    */
+   @Test
+   public void testGetPublicRenderParameters() {
+      String prpid = "supported-public-render-parameter";
+      List<PublicRenderParameter> prps = cut.getPublicRenderParameters();
+      assertNotNull(prps);
+      assertEquals(2, prps.size());
+      assertEquals(prpid, prps.get(0).getIdentifier());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addPublicRenderParameter(org.apache.pluto.container.om.portlet.PublicRenderParameter)}.
+    */
+   @Test
+   public void testAddPublicRenderParameter() {
+      String prpid = "newprp";
+      QName qn = new QName("https://www.ibm.com/", "some-other-prp");
+      PublicRenderParameter prp = new PublicRenderParameterImpl(qn, prpid);
+      cut.addPublicRenderParameter(prp);
+      
+      List<PublicRenderParameter> prps = cut.getPublicRenderParameters();
+      assertNotNull(prps);
+      assertEquals(3, prps.size());
+      assertEquals(prpid, prps.get(2).getIdentifier());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getCustomPortletMode(java.lang.String)}.
+    */
+   @Test
+   public void testGetCustomPortletMode() {
+      String newItem = "portlet-mode";
+      CustomPortletMode item = cut.getCustomPortletMode(newItem);
+      assertNotNull(item);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getCustomPortletModes()}.
+    */
+   @Test
+   public void testGetCustomPortletModes() {
+      String newItem = "portlet-mode";
+      List<CustomPortletMode> list = cut.getCustomPortletModes();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals(newItem, list.get(0).getPortletMode());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addCustomPortletMode(org.apache.pluto.container.om.portlet.CustomPortletMode)}.
+    */
+   @Test
+   public void testAddCustomPortletMode() {
+      String newItem = "newMode";
+      CustomPortletMode prp = new CustomPortletModeImpl(newItem);
+      cut.addCustomPortletMode(prp);
+      
+      List<CustomPortletMode> list = cut.getCustomPortletModes();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals(newItem, list.get(1).getPortletMode());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getCustomWindowState(java.lang.String)}.
+    */
+   @Test
+   public void testGetCustomWindowState() {
+      String newItem = "window-state";
+      CustomWindowState item = cut.getCustomWindowState(newItem);
+      assertNotNull(item);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getCustomWindowStates()}.
+    */
+   @Test
+   public void testGetCustomWindowStates() {
+      String newItem = "window-state";
+      List<CustomWindowState> list = cut.getCustomWindowStates();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals(newItem, list.get(0).getWindowState());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addCustomWindowState(org.apache.pluto.container.om.portlet.CustomWindowState)}.
+    */
+   @Test
+   public void testAddCustomWindowState() {
+      String newItem = "newMode";
+      CustomWindowState prp = new CustomWindowStateImpl(newItem);
+      cut.addCustomWindowState(prp);
+      
+      List<CustomWindowState> list = cut.getCustomWindowStates();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals(newItem, list.get(1).getWindowState());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getUserAttribute(java.lang.String)}.
+    */
+   @Test
+   public void testGetUserAttribute() {
+      String newItem = "name";
+      UserAttribute item = cut.getUserAttribute(newItem);
+      assertNotNull(item);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getUserAttributes()}.
+    */
+   @Test
+   public void testGetUserAttributes() {
+      String newItem = "name";
+      List<UserAttribute> list = cut.getUserAttributes();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals(newItem, list.get(0).getName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addUserAttribute(org.apache.pluto.container.om.portlet.UserAttribute)}.
+    */
+   @Test
+   public void testAddUserAttribute() {
+      String newItem = "newAttr";
+      UserAttribute prp = new UserAttributeImpl(newItem);
+      cut.addUserAttribute(prp);
+      
+      List<UserAttribute> list = cut.getUserAttributes();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals(newItem, list.get(1).getName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getFilter(java.lang.String)}.
+    */
+   @Test
+   public void testGetFilter() {
+      String newItem = "filter-name";
+      Filter item = cut.getFilter(newItem);
+      assertNotNull(item);
+      Filter filter = cut.getFilters().get(0);
+      assertEquals("org.apache.pluto.container.om.portlet.impl.fixtures.TestFilter", 
+            filter.getFilterClass());
+      assertEquals("description", filter.getDescription(new Locale("de")).getDescription());
+      assertEquals("display-name", filter.getDisplayName(new Locale("de")).getDisplayName());
+      assertEquals("lifecycle", filter.getLifecycles().get(0));
+      assertEquals("value", filter.getInitParam("name").getParamValue());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getFilters()}.
+    */
+   @Test
+   public void testGetFilters() {
+      String newItem = "filter-name";
+      List<Filter> list = cut.getFilters();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals(newItem, list.get(0).getFilterName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addFilter(org.apache.pluto.container.om.portlet.Filter)}.
+    */
+   @Test
+   public void testAddFilter() {
+      String newItem = "newFilter";
+      Filter prp = new FilterImpl(newItem);
+      cut.addFilter(prp);
+      
+      List<Filter> list = cut.getFilters();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals(newItem, list.get(1).getFilterName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getFilterMapping(java.lang.String)}.
+    */
+   @Test
+   public void testGetFilterMapping() {
+      String newItem = "filter-name";
+      FilterMapping item = cut.getFilterMapping(newItem);
+      assertNotNull(item);
+      assertEquals(1, item.getPortletNames().size());
+      assertEquals("portlet362", item.getPortletNames().get(0));
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getFilterMappings()}.
+    */
+   @Test
+   public void testGetFilterMappings() {
+      String newItem = "filter-name";
+      List<FilterMapping> list = cut.getFilterMappings();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals(newItem, list.get(0).getFilterName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addFilterMapping(org.apache.pluto.container.om.portlet.FilterMapping)}.
+    */
+   @Test
+   public void testAddFilterMapping() {
+      String newItem = "newFilter";
+      FilterMapping prp = new FilterMappingImpl(newItem);
+      cut.addFilterMapping(prp);
+      
+      List<FilterMapping> list = cut.getFilterMappings();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals(newItem, list.get(1).getFilterName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getContainerRuntimeOption(java.lang.String)}.
+    */
+   @Test
+   public void testGetContainerRuntimeOption() {
+      String newItem = "Runtime-Option-Portlet-App";
+      ContainerRuntimeOption item = cut.getContainerRuntimeOption(newItem);
+      assertNotNull(item);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getContainerRuntimeOptions()}.
+    */
+   @Test
+   public void testGetContainerRuntimeOptions() {
+      String newItem = "Runtime-Option-Portlet-App";
+      List<ContainerRuntimeOption> list = cut.getContainerRuntimeOptions();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals(newItem, list.get(0).getName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addContainerRuntimeOption(org.apache.pluto.container.om.portlet.ContainerRuntimeOption)}.
+    */
+   @Test
+   public void testAddContainerRuntimeOption() {
+      String newItem = "newRTO";
+      String[] newvals = {"v1", "v2"}; 
+      ContainerRuntimeOption item = new ContainerRuntimeOptionImpl(newItem, Arrays.asList(newvals));
+      cut.addContainerRuntimeOption(item);
+      
+      List<ContainerRuntimeOption> list = cut.getContainerRuntimeOptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals(newItem, list.get(1).getName());
+      assertArrayEquals(newvals, list.get(1).getValues().toArray());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getListeners()}.
+    */
+   @Test
+   public void testGetListeners() {
+      List<Listener> list = cut.getListeners();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("org.apache.pluto.container.om.portlet.impl.fixtures.TestListener", list.get(0).getListenerClass());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addListener(org.apache.pluto.container.om.portlet.Listener)}.
+    */
+   @Test
+   public void testAddListener() {
+      String clsName = "org.apache.pluto.container.om.portlet.impl.fixtures.DifferentListener";
+      Listener newitem = new ListenerImpl(clsName);
+      cut.addListener(newitem);
+      
+      List<Listener> list = cut.getListeners();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals(clsName, list.get(1).getListenerClass());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getSecurityConstraints()}.
+    */
+   @Test
+   public void testGetSecurityConstraints() {
+      List<SecurityConstraint> list = cut.getSecurityConstraints();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("NONE", list.get(0).getUserDataConstraint().getTransportGuarantee());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addSecurityConstraint(org.apache.pluto.container.om.portlet.SecurityConstraint)}.
+    */
+   @Test
+   public void testAddSecurityConstraint() {
+      SecurityConstraint seco = new SecurityConstraintImpl(new UserDataConstraintImpl("CONFIDENTIAL"));
+      cut.addSecurityConstraint(seco);
+      
+      List<SecurityConstraint> list = cut.getSecurityConstraints();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals("CONFIDENTIAL", list.get(1).getUserDataConstraint().getTransportGuarantee());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getLocaleEncodingMappings()}.
+    * @throws Exception 
+    */
+   @Test
+   public void testGetLocaleEncodingMappings() throws Exception {
+      String file = WEBDDPKG + WEBDD31;
+      InputStream in = this.getClass().getClassLoader().getResourceAsStream(file);
+      
+      try {
+         cfp.processWebDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+
+      Map<Locale, String> localemap = pad.getLocaleEncodingMappings();
+      assertEquals(2, localemap.size());
+      ArrayList<Locale> testlocs = new ArrayList<Locale>(Arrays.asList(new Locale[]{
+            Locale.forLanguageTag("de"), Locale.forLanguageTag("ja") }));
+      String[] testencs = {"UTF-8", "Shift_JIS"};
+      for (Locale loc : localemap.keySet()) {
+         assertTrue(testlocs.contains(loc));
+         int ind = testlocs.indexOf(loc);
+         assertEquals(testencs[ind], localemap.get(loc));
+      }
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addLocaleEncodingMapping(java.util.Locale, java.lang.String)}.
+    */
+   @Test
+   public void testAddLocaleEncodingMapping() {
+      ArrayList<Locale> testlocs = new ArrayList<Locale>(Arrays.asList(new Locale[]{
+            Locale.forLanguageTag("de"), Locale.forLanguageTag("ja") }));
+      String[] testencs = {"UTF-8", "Shift_JIS"};
+      for (Locale loc : testlocs) {
+         int ind = testlocs.indexOf(loc);
+         cut.addLocaleEncodingMapping(loc, testencs[ind]);
+      }
+      
+      Map<Locale, String> localemap = cut.getLocaleEncodingMappings();
+      assertEquals(2, localemap.size());
+      for (Locale loc : localemap.keySet()) {
+         assertTrue(testlocs.contains(loc));
+         int ind = testlocs.indexOf(loc);
+         assertEquals(testencs[ind], localemap.get(loc));
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/PortletDefinition362ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/PortletDefinition362ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/PortletDefinition362ImplTest.java
new file mode 100644
index 0000000..e757ecd
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/PortletDefinition362ImplTest.java
@@ -0,0 +1,538 @@
+package org.apache.pluto.container.om.portlet.impl.jsr362;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.InputStream;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Locale;
+
+import javax.xml.namespace.QName;
+
+import org.apache.pluto.container.om.portlet.ContainerRuntimeOption;
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.DisplayName;
+import org.apache.pluto.container.om.portlet.EventDefinitionReference;
+import org.apache.pluto.container.om.portlet.InitParam;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.PortletDefinition;
+import org.apache.pluto.container.om.portlet.PortletInfo;
+import org.apache.pluto.container.om.portlet.Preference;
+import org.apache.pluto.container.om.portlet.Preferences;
+import org.apache.pluto.container.om.portlet.SecurityRoleRef;
+import org.apache.pluto.container.om.portlet.Supports;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.ContainerRuntimeOptionImpl;
+import org.apache.pluto.container.om.portlet.impl.DescriptionImpl;
+import org.apache.pluto.container.om.portlet.impl.DisplayNameImpl;
+import org.apache.pluto.container.om.portlet.impl.EventDefinitionReferenceImpl;
+import org.apache.pluto.container.om.portlet.impl.InitParamImpl;
+import org.apache.pluto.container.om.portlet.impl.PortletDefinitionImpl;
+import org.apache.pluto.container.om.portlet.impl.PortletInfoImpl;
+import org.apache.pluto.container.om.portlet.impl.PreferenceImpl;
+import org.apache.pluto.container.om.portlet.impl.PreferencesImpl;
+import org.apache.pluto.container.om.portlet.impl.SecurityRoleRefImpl;
+import org.apache.pluto.container.om.portlet.impl.SupportsImpl;
+import org.apache.pluto.container.om.portlet.impl.fixtures.TestPortlet;
+import org.apache.pluto.container.om.portlet.impl.fixtures.TestPreferencesValidator;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class PortletDefinition362ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet362Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+   
+   // Class under test
+   private PortletDefinition cut;
+
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      
+      InputStream in = PortletDefinition362ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+   
+   @Before
+   public void setUpBefore() throws Exception {
+      assertEquals(1, pad.getPortlets().size());
+      cut = new PortletDefinitionImpl(pad.getPortlets().get(0));
+   }
+
+   @Test
+   public void testGetPortletName() {
+      assertNotNull(cut.getPortletName());
+      assertEquals("portlet362", cut.getPortletName());
+   }
+
+   @Test
+   public void testGetApplication() {
+      assertNotNull(cut.getApplication());
+      assertTrue(cut.getApplication() instanceof PortletApplicationDefinition);
+   }
+
+   @Test
+   public void testGetInitParam() {
+      InitParam ip = cut.getInitParam("name");
+      assertNotNull(ip);
+      assertEquals("name", ip.getParamName());
+      assertEquals("value", ip.getParamValue());
+      assertEquals(1, ip.getDescriptions().size());
+      Locale loc = new Locale("de");
+      Description d = ip.getDescription(loc);
+      assertNotNull(d);
+      assertEquals("description", d.getDescription());
+   }
+
+   @Test
+   public void testGetInitParamNullValue() {
+      InitParam ip = cut.getInitParam("nullValueParam");
+      assertNotNull(ip);
+      assertEquals("nullValueParam", ip.getParamName());
+      assertEquals("", ip.getParamValue());
+   }
+
+   @Test
+   public void testGetInitParams() {
+      List<InitParam> ips = cut.getInitParams();
+      assertEquals(2, ips.size());
+      boolean ok = false;
+      for (InitParam ip : ips) {
+         if (ip.getParamName().equals("name") && ip.getParamValue().equals("value")) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   @Test
+   public void testAddInitParam() {
+      String name = "Fred", value = "bowling";
+      InitParam newip = new InitParamImpl(name, value);
+      cut.addInitParam(newip);
+      
+      List<InitParam> ips = cut.getInitParams();
+      assertEquals(3, ips.size());
+      InitParam ip = cut.getInitParam(name);
+      assertNotNull(ip);
+      assertEquals(name, ip.getParamName());
+      assertEquals(value, ip.getParamValue());
+   }
+
+   @Test
+   public void testGetPortletClass() {
+      assertNotNull(cut.getPortletClass());
+      assertEquals(TestPortlet.class.getCanonicalName(), cut.getPortletClass());
+   }
+
+   @Test
+   public void testSetPortletClass() {
+      String text = "someClass";
+      cut.setPortletClass(text);
+      assertEquals(text, cut.getPortletClass());
+   }
+
+   @Test
+   public void testGetPortletInfo() {
+      PortletInfo info = cut.getPortletInfo();
+      assertNotNull(info);
+      assertEquals("title", info.getTitle());
+      assertEquals("short-title", info.getShortTitle());
+      assertEquals("keywords", info.getKeywords());
+   }
+
+   @Test
+   public void testSetPortletInfo() {
+      String ti = "t2", st = "st", kw = "kw";
+      PortletInfo i2 = new PortletInfoImpl(ti, kw, st);
+      cut.setPortletInfo(i2);
+
+      PortletInfo info = cut.getPortletInfo();
+      assertNotNull(info);
+      assertEquals(ti, info.getTitle());
+      assertEquals(st, info.getShortTitle());
+      assertEquals(kw, info.getKeywords());
+   }
+
+   @Test
+   public void testGetPortletPreferences() {
+      Preferences prefs = cut.getPortletPreferences();
+      assertNotNull(prefs);
+      assertEquals(TestPreferencesValidator.class.getCanonicalName(), prefs.getPreferencesValidator());
+      List<Preference> list = prefs.getPortletPreferences();
+      assertEquals(1, list.size());
+      Preference item = list.get(0);
+      assertEquals("name", item.getName());
+      List<String> vals = item.getValues();
+      assertEquals(1, vals.size());
+      assertEquals("value", vals.get(0));
+   }
+
+   @Test
+   public void testSetPortletPreferences() {
+      String validator = "validator";
+      String name = "prefName";
+      String[] vals = {"v1", "v2"};
+      Preferences prefs = new PreferencesImpl(cut.getPortletPreferences());
+      prefs.setPreferencesValidator(validator);
+      prefs.addPreference(new PreferenceImpl(name, true, Arrays.asList(vals)));
+      cut.setPortletPreferences(prefs);
+      
+      Preferences prefs2 = cut.getPortletPreferences();
+      assertNotNull(prefs2);
+      assertEquals(validator, prefs2.getPreferencesValidator());
+      List<Preference> list = prefs2.getPortletPreferences();
+      assertEquals(2, list.size());
+      Preference item = prefs2.getPortletPreference(name);
+      assertEquals(name, item.getName());
+      List<String> newvals = item.getValues();
+      assertEquals(2, newvals.size());
+      assertArrayEquals(vals, newvals.toArray());
+   }
+
+   @Test  // JSR 286
+   public void testGetSupportedProcessingEvents() {
+      List<EventDefinitionReference> list = cut.getSupportedProcessingEvents();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      boolean ok = false;
+      QName qn = new QName("https://www.apache.org/", "supported-processing-event");
+      for (EventDefinitionReference item : list) {
+         if (item.getQualifiedName().equals(qn)) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   @Test  // JSR 286
+   public void testAddSupportedProcessingEvent() {
+      QName qn = new QName("https://www.ibm.com/", "some-other-event");
+      EventDefinitionReference edr = new EventDefinitionReferenceImpl(qn);
+      cut.addSupportedProcessingEvent(edr);
+      
+      List<EventDefinitionReference> list = cut.getSupportedProcessingEvents();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      boolean ok = false;
+      for (EventDefinitionReference item : list) {
+         if (item.getQualifiedName().equals(qn)) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   @Test  // JSR 286
+   public void testGetSupportedPublishingEvents() {
+      List<EventDefinitionReference> list = cut.getSupportedPublishingEvents();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      boolean ok = false;
+      QName qn = new QName("http://test.com", "supported-publishing-event");
+      for (EventDefinitionReference item : list) {
+         QName aqn = item.getQualifiedName();
+         if (aqn.equals(qn)) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   @Test  // JSR 286
+   public void testAddSupportedPublishingEvent() {
+      QName qn = new QName("https://www.ibm.com/", "some-other-event");
+      EventDefinitionReference edr = new EventDefinitionReferenceImpl(qn);
+      cut.addSupportedPublishingEvent(edr);
+      
+      List<EventDefinitionReference> list = cut.getSupportedPublishingEvents();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      boolean ok = false;
+      for (EventDefinitionReference item : list) {
+         if (item.getQualifiedName().equals(qn)) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   @Test  // JSR 286
+   public void testGetSupportedPublicRenderParameters() {
+      List<String> list = cut.getSupportedPublicRenderParameters();
+      String prp = "supported-public-render-parameter";
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertTrue(list.contains(prp));
+   }
+
+   @Test  // JSR 286
+   public void testAddSupportedPublicRenderParameter() {
+      String newprp = "some-prp";
+      cut.addSupportedPublicRenderParameter(newprp);
+      List<String> list = cut.getSupportedPublicRenderParameters();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertTrue(list.contains(newprp));
+   }
+
+   @Test
+   public void testGetResourceBundle() {
+      assertNotNull(cut.getResourceBundle());
+      assertEquals("resource-bundle", cut.getResourceBundle());
+   }
+
+   @Test
+   public void testSetResourceBundle() {
+      String text = "newBundle";
+      cut.setResourceBundle(text);
+      assertNotNull(cut.getResourceBundle());
+      assertEquals(text, cut.getResourceBundle());
+   }
+
+   @Test
+   public void testGetSecurityRoleRef() {
+      SecurityRoleRef srr = cut.getSecurityRoleRef("NMTOKEN");
+      assertNotNull(srr);
+      assertEquals("NMTOKEN", srr.getRoleName());
+      assertEquals("role-link", srr.getRoleLink());
+   }
+
+   @Test
+   public void testGetSecurityRoleRefs() {
+      List<SecurityRoleRef> list = cut.getSecurityRoleRefs();
+      assertEquals(1, list.size());
+      SecurityRoleRef srr = list.get(0);
+      assertNotNull(srr);
+      assertEquals("NMTOKEN", srr.getRoleName());
+      assertEquals("role-link", srr.getRoleLink());
+      Description d = srr.getDescription(new Locale("de"));
+      assertNotNull(d);
+      assertEquals("description", d.getDescription());
+      
+   }
+
+   @Test
+   public void testAddSecurityRoleRef() {
+      String name = "RoleName";
+      String link = "RoleLink";
+      SecurityRoleRef srr = new SecurityRoleRefImpl(name);
+      srr.setRoleLink(link);
+      cut.addSecurityRoleRef(srr);
+
+      List<SecurityRoleRef> list = cut.getSecurityRoleRefs();
+      assertEquals(2, list.size());
+      srr = cut.getSecurityRoleRef(name);
+      assertNotNull(srr);
+      assertEquals(name, srr.getRoleName());
+      assertEquals(link, srr.getRoleLink());
+   }
+
+   @Test
+   public void testGetSupportsString() {
+      Supports s = cut.getSupports("mime-type2");
+      assertNotNull(s);
+      assertTrue(s.getPortletModes().contains("portlet-mode2"));
+   }
+
+   @Test
+   public void testGetSupportsMode() {
+      Supports s = cut.getSupports("mime-type2");
+      assertNotNull(s);
+      assertTrue(s.getPortletModes().contains("portlet-mode2"));
+   }
+
+   @Test
+   public void testGetSupportsState() {
+      Supports s = cut.getSupports("mime-type3");
+      assertNotNull(s);
+      assertTrue(s.getWindowStates().contains("window-state3"));
+   }
+
+   @Test
+   public void testGetSupports() {
+      List<Supports> list = cut.getSupports();
+      assertEquals(3, list.size());
+   }
+
+   @Test
+   public void testAddSupports() {
+      Supports s = new SupportsImpl("text/html");
+      cut.addSupports(s);
+      List<Supports> list = cut.getSupports();
+      assertEquals(4, list.size());
+      boolean ok = false;
+      for (Supports item : list) {
+         if (item.getMimeType().equals("text/html")) {
+            ok = true;
+            break;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   @Test
+   public void testGetDescription() {
+      Locale loc = new Locale("DE");
+      Description desc = cut.getDescription(loc);
+      assertNotNull(desc);
+      assertEquals("multi line description", desc.getDescription());
+   }
+
+   @Test
+   public void testGetDescriptions() {
+      List<Description> list = cut.getDescriptions();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("multi line description", list.get(0).getDescription());
+   }
+
+   @Test
+   public void testAddDescription() {
+      Locale loc = Locale.FRENCH;
+      String text = "Some description";
+      Description d = new DescriptionImpl(loc, text);
+      cut.addDescription(d);
+
+      List<Description> list = cut.getDescriptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (Description desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDescription());
+         } else {
+            assertEquals("multi line description", desc.getDescription());
+         }
+      }
+   }
+
+   @Test
+   public void testGetDisplayName() {
+      Locale loc = new Locale("DE");
+      DisplayName name = cut.getDisplayName(loc);
+      assertNotNull(name);
+      assertEquals("display-name", name.getDisplayName());
+   }
+
+   @Test
+   public void testGetDisplayNames() {
+      List<DisplayName> list = cut.getDisplayNames();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("display-name", list.get(0).getDisplayName());
+   }
+
+   @Test
+   public void testAddDisplayName() {
+      Locale loc = Locale.FRENCH;
+      String text = "Some display name";
+      DisplayName d = new DisplayNameImpl(loc, text);
+      cut.addDisplayName(d);
+
+      List<DisplayName> list = cut.getDisplayNames();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (DisplayName desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDisplayName());
+         } else {
+            assertEquals("display-name", desc.getDisplayName());
+         }
+      }
+   }
+
+   @Test
+   public void testGetSupportedLocales() {
+      List<String> list = cut.getSupportedLocales();
+      assertEquals(1, list.size());
+      assertTrue(list.contains("supported-locale"));
+   }
+
+   @Test
+   public void testAddSupportedLocale() {
+      String locname = "zh-cmn-Hans-CN";
+      cut.addSupportedLocale(locname);
+      
+      List<String> list = cut.getSupportedLocales();
+      assertEquals(2, list.size());
+      assertTrue(list.contains(locname));
+   }
+
+   @Test
+   public void testGetExpirationCache() {
+      assertNotNull(cut.getExpirationCache());
+      assertEquals(50, cut.getExpirationCache());
+   }
+
+   @Test
+   public void testSetExpirationCache() {
+      cut.setExpirationCache(100);
+      assertNotNull(cut.getExpirationCache());
+      assertEquals(100, cut.getExpirationCache());
+   }
+
+   @Test  // JSR 286
+   public void testGetCacheScope() {
+      assertNotNull(cut.getCacheScope());
+      assertEquals("private", cut.getCacheScope());
+   }
+
+   @Test  // JSR 286
+   public void testSetCacheScope() {
+      String cs = "whatever";
+      cut.setCacheScope(cs);
+      assertNotNull(cut.getCacheScope());
+      assertEquals(cs, cut.getCacheScope());
+   }
+
+   @Test  // JSR 286
+   public void testGetContainerRuntimeOption() {
+      ContainerRuntimeOption rto = cut.getContainerRuntimeOption("Runtime-Option1");
+      assertNotNull(rto);
+      assertEquals(1, rto.getValues().size());
+      assertTrue(rto.getValues().get(0).equalsIgnoreCase("true"));
+   }
+
+   @Test  // JSR 286
+   public void testGetContainerRuntimeOptions() {
+      List<ContainerRuntimeOption> list = cut.getContainerRuntimeOptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      boolean ok = false;
+      for (ContainerRuntimeOption item : list) {
+         if (item.getName().equalsIgnoreCase("Runtime-Option2") && 
+               item.getValues().size() == 1 && item.getValues().get(0).equalsIgnoreCase("value2")) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   @Test  // JSR 286
+   public void testAddContainerRuntimeOption() {
+      String name = "NewRTO";
+      String[] vals = {"v1", "v2", "v3"};
+      ContainerRuntimeOption cro = new ContainerRuntimeOptionImpl(name, Arrays.asList(vals));
+      cut.addContainerRuntimeOption(cro);
+      
+      ContainerRuntimeOption newcro = cut.getContainerRuntimeOption(name);
+      assertNotNull(newcro);
+      assertArrayEquals(vals, newcro.getValues().toArray());
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/SecurityConstraint362ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/SecurityConstraint362ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/SecurityConstraint362ImplTest.java
new file mode 100644
index 0000000..33eca76
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/SecurityConstraint362ImplTest.java
@@ -0,0 +1,122 @@
+package org.apache.pluto.container.om.portlet.impl.jsr362;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.DisplayName;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.SecurityConstraint;
+import org.apache.pluto.container.om.portlet.UserDataConstraint;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.DisplayNameImpl;
+import org.apache.pluto.container.om.portlet.impl.SecurityConstraintImpl;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class SecurityConstraint362ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet362Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+   
+   private ArrayList<SecurityConstraint> constraints;
+   private SecurityConstraint constraint;
+
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      
+      InputStream in = SecurityConstraint362ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+   
+   @Before
+   public void setUpBefore() throws Exception {
+      constraints = new ArrayList<SecurityConstraint>();
+      for (SecurityConstraint sc : pad.getSecurityConstraints()) {
+         // test the copy constructor
+         constraints.add(new SecurityConstraintImpl(sc));
+      }
+      assertEquals(1, constraints.size());
+      constraint = constraints.get(0);
+   }
+
+   @Test
+   // tests the UserDataConstraint as well
+   public void testGetUserDataConstraint() {
+      UserDataConstraint udc = constraint.getUserDataConstraint();
+      assertNotNull(udc);
+      
+   }
+
+   @Test
+   public void testGetDisplayName() {
+      Locale loc = new Locale("DE");
+      DisplayName name = constraint.getDisplayName(loc);
+      assertNotNull(name);
+      assertEquals("display-name", name.getDisplayName());
+   }
+
+   @Test
+   public void testGetDisplayNames() {
+      List<DisplayName> list = constraint.getDisplayNames();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("display-name", list.get(0).getDisplayName());
+   }
+
+   @Test
+   public void testAddDisplayName() {
+      Locale loc = Locale.FRENCH;
+      String text = "Some display name";
+      DisplayName d = new DisplayNameImpl(loc, text);
+      constraint.addDisplayName(d);
+
+      List<DisplayName> list = constraint.getDisplayNames();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (DisplayName desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDisplayName());
+         } else {
+            assertEquals("display-name", desc.getDisplayName());
+         }
+      }
+   }
+
+   @Test
+   public void testGetPortletNames() {
+      List<String> list = constraint.getPortletNames();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+   }
+
+   @Test
+   public void testAddPortletName() {
+      String text = "SomeName";
+      constraint.addPortletName(text);;
+
+      List<String> list = constraint.getPortletNames();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertTrue(list.contains(text));
+      assertTrue(list.contains("portlet362"));
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/StandAloneContainerRuntimeOptionImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/StandAloneContainerRuntimeOptionImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/StandAloneContainerRuntimeOptionImplTest.java
new file mode 100644
index 0000000..8840093
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/StandAloneContainerRuntimeOptionImplTest.java
@@ -0,0 +1,98 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl.jsr362;
+
+import static org.junit.Assert.*;
+
+import java.util.Arrays;
+
+import org.apache.pluto.container.om.portlet.ContainerRuntimeOption;
+import org.apache.pluto.container.om.portlet.impl.ContainerRuntimeOptionImpl;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class StandAloneContainerRuntimeOptionImplTest {
+   
+   private static final String NAME = "name";
+   private static final String VAL3 = "v3";
+   private static final String[] VALS = {"v1", "v2"}; 
+   private static final String[] VALS3 = {"v1", "v2", "v3"}; 
+   
+   private ContainerRuntimeOption cro;
+
+   /**
+    * @throws java.lang.Exception
+    */
+   @Before
+   public void setUp() throws Exception {
+      cro = new ContainerRuntimeOptionImpl(NAME, Arrays.asList(VALS));
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.ContainerRuntimeOptionImpl#ContainerRuntimeOptionImpl(java.lang.String, java.util.List)}.
+    */
+   @Test
+   public void testContainerRuntimeOptionImplStringListOfString() {
+      assertEquals(NAME, cro.getName());
+      assertArrayEquals(VALS, cro.getValues().toArray());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.ContainerRuntimeOptionImpl#ContainerRuntimeOptionImpl(org.apache.pluto.container.om.portlet.ContainerRuntimeOption)}.
+    */
+   @Test
+   public void testContainerRuntimeOptionImplContainerRuntimeOption() {
+      ContainerRuntimeOption cro2 = new ContainerRuntimeOptionImpl(cro);
+      assertEquals(NAME, cro2.getName());
+      assertArrayEquals(VALS, cro2.getValues().toArray());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.ContainerRuntimeOptionImpl#getName()}.
+    */
+   @Test
+   public void testGetName() {
+      assertEquals(NAME, cro.getName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.ContainerRuntimeOptionImpl#getValues()}.
+    */
+   @Test
+   public void testGetValues() {
+      assertArrayEquals(VALS, cro.getValues().toArray());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.ContainerRuntimeOptionImpl#addValue(java.lang.String)}.
+    */
+   @Test
+   public void testAddValue() {
+      ContainerRuntimeOption cro2 = new ContainerRuntimeOptionImpl(cro);
+      cro.addValue(VAL3);
+      assertArrayEquals(VALS3, cro.getValues().toArray());
+      assertArrayEquals(VALS, cro2.getValues().toArray());
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/UserAttribute362ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/UserAttribute362ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/UserAttribute362ImplTest.java
new file mode 100644
index 0000000..33fc80f
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/UserAttribute362ImplTest.java
@@ -0,0 +1,133 @@
+/*  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.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl.jsr362;
+
+import static org.junit.Assert.*;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.UserAttribute;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.DescriptionImpl;
+import org.apache.pluto.container.om.portlet.impl.UserAttributeImpl;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class UserAttribute362ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet362Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+   private        List<UserAttribute> attrs;
+   private        UserAttribute ua;
+
+   /**
+    * @throws java.lang.Exception
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      
+      InputStream in = UserAttribute362ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+   
+   @Before
+   public void setUpBefore() throws Exception {
+      attrs = new ArrayList<UserAttribute>();
+      for (UserAttribute ua : pad.getUserAttributes()) {
+         attrs.add(new UserAttributeImpl(ua));
+      }
+      assertEquals(1, attrs.size());
+      ua = attrs.get(0);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.UserAttributeImpl#getName()}.
+    */
+   @Test
+   public void testGetName() {
+      assertEquals("name", ua.getName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.UserAttributeImpl#getDescription(java.util.Locale)}.
+    */
+   @Test
+   public void testGetDescription() {
+      Locale loc = new Locale("DE");
+      Description desc = ua.getDescription(loc);
+      assertNotNull(desc);
+      assertEquals("description", desc.getDescription());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.UserAttributeImpl#getDescriptions()}.
+    */
+   @Test
+   public void testGetDescriptions() {
+      List<Description> list = ua.getDescriptions();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("description", list.get(0).getDescription());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.UserAttributeImpl#addDescription(org.apache.pluto.container.om.portlet.Description)}.
+    */
+   @Test
+   public void testAddDescription() {
+      Locale loc = Locale.FRENCH;
+      String text = "Some description";
+      Description d = new DescriptionImpl(loc, text);
+      ua.addDescription(d);
+
+      List<Description> list = ua.getDescriptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (Description desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDescription());
+         } else {
+            assertEquals("description", desc.getDescription());
+         }
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/UserDataConstraint362ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/UserDataConstraint362ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/UserDataConstraint362ImplTest.java
new file mode 100644
index 0000000..8b46d1f
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/UserDataConstraint362ImplTest.java
@@ -0,0 +1,105 @@
+package org.apache.pluto.container.om.portlet.impl.jsr362;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.InputStream;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.SecurityConstraint;
+import org.apache.pluto.container.om.portlet.UserDataConstraint;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.DescriptionImpl;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class UserDataConstraint362ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet362Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+   private        UserDataConstraint udc;
+
+   /**
+    * @throws java.lang.Exception
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      
+      InputStream in = UserDataConstraint362ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+   
+   @Before
+   public void setUpBefore() throws Exception {
+      assertEquals(1, pad.getSecurityConstraints().size());
+      SecurityConstraint sc = pad.getSecurityConstraints().get(0);
+      assertNotNull(sc);
+      assertNotNull(sc.getUserDataConstraint());
+      udc = sc.getUserDataConstraint();
+   }
+
+   @Test
+   public void testGetTransportGuarantee() {
+      assertEquals("NONE", udc.getTransportGuarantee());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.UserDataConstraintImpl#getDescription(java.util.Locale)}.
+    */
+   @Test
+   public void testGetDescription() {
+      Locale loc = new Locale("DE");
+      Description desc = udc.getDescription(loc);
+      assertNotNull(desc);
+      assertEquals("description", desc.getDescription());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.UserDataConstraintImpl#getDescriptions()}.
+    */
+   @Test
+   public void testGetDescriptions() {
+      List<Description> list = udc.getDescriptions();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("description", list.get(0).getDescription());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.UserDataConstraintImpl#addDescription(org.apache.pluto.container.om.portlet.Description)}.
+    */
+   @Test
+   public void testAddDescription() {
+      Locale loc = Locale.FRENCH;
+      String text = "Some description";
+      Description d = new DescriptionImpl(loc, text);
+      udc.addDescription(d);
+
+      List<Description> list = udc.getDescriptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (Description desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDescription());
+         } else {
+            assertEquals("description", desc.getDescription());
+         }
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/resources/META-INF/beans.xml b/pluto-container/src/test/resources/META-INF/beans.xml
new file mode 100644
index 0000000..8a73cf1
--- /dev/null
+++ b/pluto-container/src/test/resources/META-INF/beans.xml
@@ -0,0 +1,10 @@
+<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="
+http://java.sun.com/xml/ns/javaee
+http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+
+   <alternatives>
+      <class>com.ibm.portal.samples.GermanPrefixFactory</class>
+   </alternatives>
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet-app_2_0.xml
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet-app_2_0.xml b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet-app_2_0.xml
new file mode 100644
index 0000000..af4ea06
--- /dev/null
+++ b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet-app_2_0.xml
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet:portlet-app id="" version=""
+   xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+   xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd portlet-app_2_0.xsd "
+>
+
+   <!-- generated 2.0 deployment descriptor created by eclipse -->
+
+   <portlet:portlet id="">
+      <portlet:description xml:lang="">description</portlet:description>
+      <portlet:portlet-name>portlet-name</portlet:portlet-name>
+      <portlet:display-name xml:lang="">display-name</portlet:display-name>
+      <portlet:portlet-class>portlet-class</portlet:portlet-class>
+      <portlet:init-param id="">
+         <portlet:description xml:lang="">description</portlet:description>
+         <portlet:name>name</portlet:name>
+         <portlet:value>value</portlet:value>
+      </portlet:init-param>
+      <portlet:expiration-cache>0</portlet:expiration-cache>
+      <portlet:cache-scope>cache-scope</portlet:cache-scope>
+      <portlet:supports id="">
+         <portlet:mime-type>mime-type</portlet:mime-type>
+         <portlet:portlet-mode>portlet-mode</portlet:portlet-mode>
+         <portlet:window-state>window-state</portlet:window-state>
+      </portlet:supports>
+      <portlet:supported-locale>supported-locale</portlet:supported-locale>
+      <portlet:resource-bundle>resource-bundle</portlet:resource-bundle>
+      <portlet:portlet-info id="">
+         <portlet:title>title</portlet:title>
+         <portlet:short-title>short-title</portlet:short-title>
+         <portlet:keywords>keywords</portlet:keywords>
+      </portlet:portlet-info>
+      <portlet:portlet-preferences id="">
+         <portlet:preference id="">
+            <portlet:name>name</portlet:name>
+            <portlet:value>value</portlet:value>
+            <portlet:read-only>false</portlet:read-only>
+         </portlet:preference>
+         <portlet:preferences-validator>preferences-validator</portlet:preferences-validator>
+      </portlet:portlet-preferences>
+      <portlet:security-role-ref id="">
+         <portlet:description xml:lang="">description</portlet:description>
+         <portlet:role-name>NMTOKEN</portlet:role-name>
+         <portlet:role-link>role-link</portlet:role-link>
+      </portlet:security-role-ref>
+      <portlet:supported-processing-event id="">
+         <portlet:qname>QName</portlet:qname>
+      </portlet:supported-processing-event>
+      <portlet:supported-publishing-event id="">
+         <portlet:qname>QName</portlet:qname>
+      </portlet:supported-publishing-event>
+      <portlet:supported-public-render-parameter>supported-public-render-parameter</portlet:supported-public-render-parameter>
+      <portlet:container-runtime-option>
+         <portlet:name>name</portlet:name>
+         <portlet:value>value</portlet:value>
+      </portlet:container-runtime-option>
+   </portlet:portlet>
+   <portlet:custom-portlet-mode id="">
+      <portlet:description xml:lang="">description</portlet:description>
+      <portlet:portlet-mode>portlet-mode</portlet:portlet-mode>
+      <portlet:portal-managed>false</portlet:portal-managed>
+   </portlet:custom-portlet-mode>
+   <portlet:custom-window-state id="">
+      <portlet:description xml:lang="">description</portlet:description>
+      <portlet:window-state>window-state</portlet:window-state>
+   </portlet:custom-window-state>
+   <portlet:user-attribute id="">
+      <portlet:description xml:lang="">description</portlet:description>
+      <portlet:name>name</portlet:name>
+   </portlet:user-attribute>
+   <portlet:security-constraint id="">
+      <portlet:display-name xml:lang="">display-name</portlet:display-name>
+      <portlet:portlet-collection>
+         <portlet:portlet-name>portlet-name</portlet:portlet-name>
+      </portlet:portlet-collection>
+      <portlet:user-data-constraint id="">
+         <portlet:description xml:lang="">description</portlet:description>
+         <portlet:transport-guarantee>CONFIDENTIAL</portlet:transport-guarantee>
+      </portlet:user-data-constraint>
+   </portlet:security-constraint>
+   <portlet:resource-bundle>resource-bundle</portlet:resource-bundle>
+   <portlet:filter>
+      <portlet:description xml:lang="">description</portlet:description>
+      <portlet:display-name xml:lang="">display-name</portlet:display-name>
+      <portlet:filter-name>filter-name</portlet:filter-name>
+      <portlet:filter-class>filter-class</portlet:filter-class>
+      <portlet:lifecycle>lifecycle</portlet:lifecycle>
+      <portlet:init-param id="">
+         <portlet:description xml:lang="">description</portlet:description>
+         <portlet:name>name</portlet:name>
+         <portlet:value>value</portlet:value>
+      </portlet:init-param>
+   </portlet:filter>
+   <portlet:filter-mapping>
+      <portlet:filter-name>filter-name</portlet:filter-name>
+      <portlet:portlet-name>portlet-name</portlet:portlet-name>
+   </portlet:filter-mapping>
+   <portlet:default-namespace>http://tempuri.org</portlet:default-namespace>
+   <portlet:event-definition id="">
+      <portlet:description xml:lang="">description</portlet:description>
+      <portlet:qname>QName</portlet:qname>
+      <portlet:alias>QName</portlet:alias>
+      <portlet:value-type>value-type</portlet:value-type>
+   </portlet:event-definition>
+   <portlet:public-render-parameter id="">
+      <portlet:description xml:lang="">description</portlet:description>
+      <portlet:identifier>identifier</portlet:identifier>
+      <portlet:qname>QName</portlet:qname>
+      <portlet:alias>QName</portlet:alias>
+   </portlet:public-render-parameter>
+   <portlet:listener id="">
+      <portlet:description xml:lang="">description</portlet:description>
+      <portlet:display-name xml:lang="">display-name</portlet:display-name>
+      <portlet:listener-class>listener-class</portlet:listener-class>
+   </portlet:listener>
+   <portlet:container-runtime-option>
+      <portlet:name>name</portlet:name>
+      <portlet:value>value</portlet:value>
+   </portlet:container-runtime-option>
+</portlet:portlet-app>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet168Generated.xml
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet168Generated.xml b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet168Generated.xml
new file mode 100644
index 0000000..36e421b
--- /dev/null
+++ b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet168Generated.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app id="id1"
+   xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+   version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
+http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+>
+
+   <portlet id="id2">
+      <description xml:lang="de">multi
+         line 
+         description</description>
+      <portlet-name>portlet168</portlet-name>
+      <display-name xml:lang="de">display-name</display-name>
+      <portlet-class>org.apache.pluto.container.om.portlet.impl.fixtures.TestPortlet</portlet-class>
+      <init-param id="init1">
+         <description xml:lang="de">description</description>
+         <name>name</name>
+         <value>value</value>
+      </init-param>
+      <expiration-cache>50</expiration-cache>
+      <supports id="sup1">
+         <mime-type>mime-type</mime-type>
+         <portlet-mode>portlet-mode</portlet-mode>
+      </supports>
+      <supports id="sup2">
+         <mime-type>mime-type2</mime-type>
+         <portlet-mode>portlet-mode2</portlet-mode>
+      </supports>
+      <supports id="sup3">
+         <mime-type>mime-type3</mime-type>
+         <portlet-mode>portlet-mode3</portlet-mode>
+      </supports>
+      <supported-locale>supported-locale</supported-locale>
+      <resource-bundle>resource-bundle</resource-bundle>
+      <portlet-info id="info1">
+         <title>title</title>
+         <short-title>short-title</short-title>
+         <keywords>keywords</keywords>
+      </portlet-info>
+      <portlet-preferences id="prefs">
+         <preference id="pref1">
+            <name>name</name>
+            <value>value</value>
+            <read-only>true</read-only>
+         </preference>
+         <preferences-validator>
+            org.apache.pluto.container.om.portlet.impl.fixtures.TestPreferencesValidator
+         </preferences-validator>
+      </portlet-preferences>
+      <security-role-ref id="sec1">
+         <description xml:lang="de">description</description>
+         <role-name>NMTOKEN</role-name>
+         <role-link>role-link</role-link>
+      </security-role-ref>
+   </portlet>
+   <custom-portlet-mode id="mode1">
+      <description xml:lang="de">description</description>
+      <portlet-mode>portlet-mode</portlet-mode>
+   </custom-portlet-mode>
+   <custom-window-state id="state1">
+      <description xml:lang="de">description</description>
+      <window-state>window-state</window-state>
+   </custom-window-state>
+   <user-attribute id="att1">
+      <description xml:lang="de">description</description>
+      <name>name</name>
+   </user-attribute>
+   <security-constraint id="cons1">
+      <display-name xml:lang="de">display-name</display-name>
+      <portlet-collection>
+         <portlet-name>portlet.name</portlet-name>
+      </portlet-collection>
+      <user-data-constraint id="data1">
+         <description xml:lang="de">description</description>
+         <transport-guarantee>NONE</transport-guarantee>
+      </user-data-constraint>
+   </security-constraint>
+</portlet-app>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet168NoCache.xml
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet168NoCache.xml b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet168NoCache.xml
new file mode 100644
index 0000000..504c750
--- /dev/null
+++ b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet168NoCache.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app id="id1"
+   xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+   version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
+http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
+
+   <portlet>
+      <description>AboutPortletDescription</description>
+      <portlet-name>AboutPortlet</portlet-name>
+      <display-name>About Portlet</display-name>
+      <display-name xml:lang="fr">About Portlet</display-name>
+      <portlet-class>org.apache.pluto.driver.portlets.AboutPortlet</portlet-class>
+      <init-param>
+         <description xml:lang="de">a</description>
+         <name>b</name>
+         <value>v</value>
+      </init-param>
+      <supports>
+         <mime-type>text/html</mime-type>
+         <portlet-mode>VIEW</portlet-mode>
+         <portlet-mode>EDIT</portlet-mode>
+         <portlet-mode>HELP</portlet-mode>
+      </supports>
+      <supported-locale>en</supported-locale>
+      <portlet-info>
+         <title>About Apache Pluto</title>
+      </portlet-info>
+   </portlet>
+   <custom-portlet-mode id="mode1">
+      <description xml:lang="de">description</description>
+      <portlet-mode>portlet-mode</portlet-mode>
+   </custom-portlet-mode>
+   <custom-window-state id="state1">
+      <description xml:lang="de">description</description>
+      <window-state>window-state</window-state>
+   </custom-window-state>
+   <user-attribute id="att1">
+      <description xml:lang="de">description</description>
+      <name>name</name>
+   </user-attribute>
+   <security-constraint id="cons1">
+      <display-name xml:lang="de">display-name</display-name>
+      <portlet-collection>
+         <portlet-name>portlet-name</portlet-name>
+      </portlet-collection>
+      <user-data-constraint id="data1">
+         <description xml:lang="de">description</description>
+         <transport-guarantee>NONE</transport-guarantee>
+      </user-data-constraint>
+   </security-constraint>
+</portlet-app>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet286Generated.xml
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet286Generated.xml b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet286Generated.xml
new file mode 100644
index 0000000..0a82e9b
--- /dev/null
+++ b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet286Generated.xml
@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app id="id1"
+   xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+   version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
+http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
+
+   <portlet id="id2">
+      <description xml:lang="de">multi 
+      line 
+      description</description>
+      <portlet-name>portlet286</portlet-name>
+      <display-name xml:lang="de">display-name</display-name>
+      <portlet-class>org.apache.pluto.container.om.portlet.impl.fixtures.TestPortlet</portlet-class>
+      <init-param id="init1">
+         <description xml:lang="de">description</description>
+         <name>name</name>
+         <value>value</value>
+      </init-param>
+      <init-param id="init2">
+         <description xml:lang="de">description</description>
+         <name>nullValueParam</name>
+         <value></value>
+      </init-param>
+      <expiration-cache>50</expiration-cache>
+      <cache-scope>private</cache-scope>
+      <supports id="sup1">
+         <mime-type>mime-type</mime-type>
+         <portlet-mode>portlet-mode</portlet-mode>
+         <portlet:window-state>window-state</portlet:window-state>
+      </supports>
+      <supports id="sup2">
+         <mime-type>mime-type2</mime-type>
+         <portlet-mode>portlet-mode2</portlet-mode>
+         <portlet:window-state>window-state2</portlet:window-state>
+      </supports>
+      <supports id="sup3">
+         <mime-type>mime-type3</mime-type>
+         <portlet-mode>portlet-mode3</portlet-mode>
+         <portlet:window-state>window-state3</portlet:window-state>
+      </supports>
+      <supported-locale>supported-locale</supported-locale>
+      <resource-bundle>resource-bundle</resource-bundle>
+      <portlet-info id="info1">
+         <title>title</title>
+         <short-title>short-title</short-title>
+         <keywords>keywords</keywords>
+      </portlet-info>
+      <portlet-preferences id="prefs">
+         <preference id="pref1">
+            <name>name</name>
+            <value>value</value>
+            <read-only>true</read-only>
+         </preference>
+         <preferences-validator>
+            org.apache.pluto.container.om.portlet.impl.fixtures.TestPreferencesValidator
+         </preferences-validator>
+      </portlet-preferences>
+      <security-role-ref id="sec1">
+         <description xml:lang="de">description</description>
+         <role-name>NMTOKEN</role-name>
+         <role-link>role-link</role-link>
+      </security-role-ref>
+      <supported-processing-event>
+         <name>supported-processing-event</name>
+      </supported-processing-event>
+      <supported-publishing-event>
+         <qname xmlns:x="http://test.com">x:supported-publishing-event</qname>
+      </supported-publishing-event>
+      <supported-public-render-parameter>supported-public-render-parameter
+      </supported-public-render-parameter>
+      <container-runtime-option>
+         <name>Runtime-Option1</name>
+         <value>true</value>
+      </container-runtime-option>
+      <container-runtime-option>
+         <name>Runtime-Option2</name>
+         <value>value2</value>
+      </container-runtime-option>
+   </portlet>
+   <custom-portlet-mode id="mode1">
+      <description xml:lang="de">description</description>
+      <portlet-mode>portlet-mode</portlet-mode>
+      <portal-managed>false</portal-managed>
+   </custom-portlet-mode>
+   <custom-window-state id="state1">
+      <description xml:lang="de">description</description>
+      <window-state>window-state</window-state>
+   </custom-window-state>
+   <user-attribute id="att1">
+      <description xml:lang="de">description</description>
+      <name>name</name>
+   </user-attribute>
+   <security-constraint id="cons1">
+      <display-name xml:lang="de">display-name</display-name>
+      <portlet-collection>
+         <portlet-name>portlet.name</portlet-name>
+      </portlet-collection>
+      <user-data-constraint id="data1">
+         <description xml:lang="de">description</description>
+         <transport-guarantee>NONE</transport-guarantee>
+      </user-data-constraint>
+   </security-constraint>
+   <resource-bundle>org.apache.portal.ResourceBundle</resource-bundle>
+   <filter>
+      <description xml:lang="de">description</description>
+      <display-name xml:lang="de">display-name</display-name>
+      <filter-name>filter-name</filter-name>
+      <filter-class>org.apache.pluto.container.om.portlet.impl.fixtures.TestFilter</filter-class>
+      <lifecycle>lifecycle</lifecycle>
+      <init-param id="init2">
+         <description xml:lang="de">description</description>
+         <name>name</name>
+         <value>value</value>
+      </init-param>
+   </filter>
+   <filter-mapping>
+      <filter-name>filter-name</filter-name>
+      <portlet-name>portlet286</portlet-name>
+   </filter-mapping>
+   <portlet:default-namespace>https://www.apache.org/</portlet:default-namespace>
+   <event-definition id="event1">
+      <description xml:lang="de">description</description>
+      <name>supported-processing-event</name>
+      <alias>QName</alias>
+      <value-type>org.apache.pluto.container.om.portlet.impl.fixtures.TestEventType</value-type>
+   </event-definition>
+   <event-definition id="event2">
+      <description xml:lang="de">description</description>
+      <qname xmlns:x="http://test.com">x:supported-publishing-event</qname>
+      <alias>QName</alias>
+      <value-type>java.lang.String</value-type>
+   </event-definition>
+   <public-render-parameter id="public1">
+      <description xml:lang="de">description</description>
+      <identifier>supported-public-render-parameter</identifier>
+      <qname>QName</qname>
+   </public-render-parameter>
+   <public-render-parameter id="public2">
+      <description xml:lang="de">description2</description>
+      <identifier>identifier2</identifier>
+      <name>Name</name>
+   </public-render-parameter>
+   <listener>
+      <description xml:lang="de">description</description>
+      <display-name xml:lang="de">display-name</display-name>
+      <listener-class>org.apache.pluto.container.om.portlet.impl.fixtures.TestListener</listener-class>
+   </listener>
+   <container-runtime-option>
+      <name>Runtime-Option-Portlet-App</name>
+      <value>false</value>
+   </container-runtime-option>
+</portlet-app>


[10/38] portals-pluto git commit: Replaced code that reads the deployment descriptor with an implementation that can be better extended to add v3.0 support. Added test cases. Uses jaxb binding classes that are generated at compile time.

Posted by ms...@apache.org.
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PortletAppType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PortletAppType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PortletAppType.java
deleted file mode 100644
index 348a451..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PortletAppType.java
+++ /dev/null
@@ -1,551 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-import javax.xml.XMLConstants;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import javax.xml.namespace.QName;
-
-import org.apache.pluto.container.om.portlet.ContainerRuntimeOption;
-import org.apache.pluto.container.om.portlet.CustomPortletMode;
-import org.apache.pluto.container.om.portlet.CustomWindowState;
-import org.apache.pluto.container.om.portlet.EventDefinition;
-import org.apache.pluto.container.om.portlet.Filter;
-import org.apache.pluto.container.om.portlet.FilterMapping;
-import org.apache.pluto.container.om.portlet.Listener;
-import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
-import org.apache.pluto.container.om.portlet.PortletDefinition;
-import org.apache.pluto.container.om.portlet.PublicRenderParameter;
-import org.apache.pluto.container.om.portlet.SecurityConstraint;
-import org.apache.pluto.container.om.portlet.UserAttribute;
-
-/**
- * <p>Java class for portlet-appType complex type. <p>The following schema fragment specifies the expected content
- * contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;portlet-appType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;portlet&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portletType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;custom-portlet-mode&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}custom-portlet-modeType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;custom-window-state&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}custom-window-stateType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;user-attribute&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}user-attributeType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;security-constraint&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}security-constraintType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;resource-bundle&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}resource-bundleType&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;filter&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}filterType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;filter-mapping&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}filter-mappingType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;default-namespace&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}anyURI&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;event-definition&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}event-definitionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;public-render-parameter&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}public-render-parameterType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;listener&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}listenerType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;container-runtime-option&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}container-runtime-optionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;version&quot; use=&quot;required&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlRootElement(name = "portlet-app")
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "portlet-appType", propOrder = { "portlet", "customPortletMode", "customWindowState", "userAttribute",
-                                                "securityConstraint", "resourceBundle", "filter", "filterMapping",
-                                                "defaultNamespace", "eventDefinition", "publicRenderParameter",
-                                                "listener", "containerRuntimeOption" })
-public class PortletAppType implements PortletApplicationDefinition
-{
-    @XmlElement(name = "portlet")
-    protected List<PortletType> portlet;
-    @XmlElement(name = "custom-portlet-mode")
-    protected List<CustomPortletModeType> customPortletMode;
-    @XmlElement(name = "custom-window-state")
-    protected List<CustomWindowStateType> customWindowState;
-    @XmlElement(name = "user-attribute")
-    protected List<UserAttributeType> userAttribute;
-    @XmlElement(name = "security-constraint")
-    protected List<SecurityConstraintType> securityConstraint;
-    @XmlElement(name = "resource-bundle")
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String resourceBundle;
-    @XmlElement(name = "filter")
-    protected List<FilterType> filter;
-    @XmlElement(name = "filter-mapping")
-    protected List<FilterMappingType> filterMapping;
-    @XmlElement(name = "default-namespace")
-    @XmlSchemaType(name = "anyURI")
-    protected String defaultNamespace;
-    @XmlElement(name = "event-definition")
-    protected List<EventDefinitionType> eventDefinition;
-    @XmlElement(name = "public-render-parameter")
-    protected List<PublicRenderParameterType> publicRenderParameter;
-    @XmlElement(name = "listener")
-    protected List<ListenerType> listener;
-    @XmlElement(name = "container-runtime-option")
-    protected List<ContainerRuntimeOptionType> containerRuntimeOption;
-    @XmlAttribute(required = true)
-    protected String version = JSR_286_VERSION;
-    
-    @XmlTransient
-    protected String name;
-    @XmlTransient
-    protected String contextPath;
-    @XmlTransient
-    protected Map<Locale, String> localeEncodingMappings;
-    
-    public String getName()
-    {
-        return name;
-    }
-    
-    public void setName(String name)
-    {
-        this.name = name;
-    }
-    
-    public String getContextPath()
-    {
-        return contextPath;
-    }
-    
-    public void setContextPath(String contextPath)
-    {
-        this.contextPath = contextPath;
-    }
-    
-    public PortletDefinition getPortlet(String portletName)
-    {
-        for (PortletDefinition pd : getPortlets())
-        {
-            if (pd.getPortletName().equals(portletName))
-            {
-                return pd;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends PortletDefinition> getPortlets()
-    {
-        if (portlet == null)
-        {
-            portlet = new ArrayList<PortletType>();
-        }
-        return portlet;
-    }
-    
-    public PortletDefinition addPortlet(String portletName)
-    {
-        if (getPortlet(portletName) != null)
-        {
-            throw new IllegalArgumentException("Portlet with name: "+portletName+" already defined");
-        }
-        PortletType p = new PortletType();
-        p.setPortletName(portletName);
-        p.setApplication(this);
-        portlet.add(p);
-        return p;
-    }
-
-    public CustomPortletMode getCustomPortletMode(String name)
-    {
-        for (CustomPortletMode cpm : getCustomPortletModes())
-        {
-            if (cpm.getPortletMode().equalsIgnoreCase(name))
-            {
-                return cpm;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends CustomPortletMode> getCustomPortletModes()
-    {
-        if (customPortletMode == null)
-        {
-            customPortletMode = new ArrayList<CustomPortletModeType>();
-        }
-        return customPortletMode;
-    }
-    
-    public CustomPortletMode addCustomPortletMode(String name)
-    {
-        if (getCustomPortletMode(name) != null)
-        {
-            throw new IllegalArgumentException("Custom PortletMode with mode name: "+name+" already defined");
-        }
-        CustomPortletModeType cpm = new CustomPortletModeType();
-        cpm.setPortletMode(name);
-        customPortletMode.add(cpm);
-        return cpm;        
-    }
-    
-    public CustomWindowState getCustomWindowState(String name)
-    {
-        for (CustomWindowState cws : getCustomWindowStates())
-        {
-            if (cws.getWindowState().equalsIgnoreCase(name))
-            {
-                return cws;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends CustomWindowState> getCustomWindowStates()
-    {
-        if (customWindowState == null)
-        {
-            customWindowState = new ArrayList<CustomWindowStateType>();
-        }
-        return customWindowState;
-    }
-    
-    public CustomWindowState addCustomWindowState(String name)
-    {
-        if (getCustomWindowState(name) != null)
-        {
-            throw new IllegalArgumentException("Custom WindowState with state name: "+name+" already defined");
-        }
-        CustomWindowStateType cws = new CustomWindowStateType();
-        cws.setWindowState(name);
-        customWindowState.add(cws);
-        return cws;        
-    }
-    
-    public UserAttribute getUserAttribute(String name)
-    {
-        for (UserAttribute ua : getUserAttributes())
-        {
-            if (ua.getName().equals(name))
-            {
-                return ua;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends UserAttribute> getUserAttributes()
-    {
-        if (userAttribute == null)
-        {
-            userAttribute = new ArrayList<UserAttributeType>();
-        }
-        return userAttribute;
-    }
-    
-    public UserAttribute addUserAttribute(String name)
-    {
-        if (getUserAttribute(name) != null)
-        {
-            throw new IllegalArgumentException("User attribute with name: "+name+" already defined");
-        }
-        UserAttributeType ua = new UserAttributeType();
-        ua.setName(name);
-        userAttribute.add(ua);
-        return ua;        
-    }
-    
-    public List<? extends SecurityConstraint> getSecurityConstraints()
-    {
-        if (securityConstraint == null)
-        {
-            securityConstraint = new ArrayList<SecurityConstraintType>();
-        }
-        return securityConstraint;
-    }
-    
-    public SecurityConstraint addSecurityConstraint(String transportGuarantee)
-    {
-        SecurityConstraintType sc = new SecurityConstraintType();
-        ((UserDataConstraintType)sc.getUserDataConstraint()).setTransportGuarantee(transportGuarantee);
-        getSecurityConstraints();
-        securityConstraint.add(sc);
-        return sc;        
-    }
-    
-    public String getResourceBundle()
-    {
-        return resourceBundle;
-    }
-
-    public void setResourceBundle(String value)
-    {
-        resourceBundle = value;
-    }
-    
-    public Filter getFilter(String name)
-    {
-        for (Filter f : getFilters())
-        {
-            if (f.getFilterName().equals(name))
-            {
-                return f;
-            }
-        }
-        return null;
-    }
-
-    public List<? extends Filter> getFilters()
-    {
-        if (filter == null)
-        {
-            filter = new ArrayList<FilterType>();
-        }
-        return filter;
-    }
-    
-    public Filter addFilter(String name)
-    {
-        if (getFilter(name) != null)
-        {
-            throw new IllegalArgumentException("Filter with name: "+name+" already defined");
-        }
-        FilterType f = new FilterType();
-        f.setFilterName(name);
-        filter.add(f);
-        return f;        
-    }
-    
-    public FilterMapping getFilterMapping(String name)
-    {
-        for (FilterMapping f : getFilterMappings())
-        {
-            if (f.getFilterName().equals(name))
-            {
-                return f;
-            }
-        }
-        return null;
-    }
-
-    public List<? extends FilterMapping> getFilterMappings()
-    {
-        if (filterMapping == null)
-        {
-            filterMapping = new ArrayList<FilterMappingType>();
-        }
-        return filterMapping;
-    }
-    
-    public FilterMapping addFilterMapping(String name)
-    {
-        if (getFilterMapping(name) != null)
-        {
-            throw new IllegalArgumentException("Filtermapping for filter: "+name+" already defined");
-        }
-        FilterMappingType fm = new FilterMappingType();
-        fm.setFilterName(name);
-        filterMapping.add(fm);
-        return fm;        
-    }
-    
-    public String getDefaultNamespace()
-    {
-        return defaultNamespace != null ? defaultNamespace : XMLConstants.NULL_NS_URI;
-    }
-
-    public void setDefaultNamespace(String value)
-    {
-        defaultNamespace = value;
-    }
-
-    public List<? extends EventDefinition> getEventDefinitions()
-    {
-        if (eventDefinition == null)
-        {
-            eventDefinition = new ArrayList<EventDefinitionType>();
-        }
-        return eventDefinition;
-    }
-    
-    public EventDefinition addEventDefinition(String name)
-    {
-        // TODO: check duplicates (complication: set of qname and name)
-        EventDefinitionType ed = new EventDefinitionType();
-        ed.setName(name);
-        eventDefinition.add(ed);
-        return ed;        
-    }
-    
-    public EventDefinition addEventDefinition(QName qname)
-    {
-        // TODO: check duplicates (complication: set of qname and name)
-        EventDefinitionType ed = new EventDefinitionType();
-        ed.setQName(qname);
-        eventDefinition.add(ed);
-        return ed;        
-    }
-    
-    public PublicRenderParameter getPublicRenderParameter(String identifier)
-    {
-        for (PublicRenderParameter prp : getPublicRenderParameters())
-        {
-            if (prp.getIdentifier().equals(identifier))
-            {
-                return prp;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends PublicRenderParameter> getPublicRenderParameters()
-    {
-        if (publicRenderParameter == null)
-        {
-            publicRenderParameter = new ArrayList<PublicRenderParameterType>();
-        }
-        return publicRenderParameter;
-    }
-    
-    public PublicRenderParameter addPublicRenderParameter(String name, String identifier)
-    {
-        if (getPublicRenderParameter(identifier) != null)
-        {
-            throw new IllegalArgumentException("PublicRenderParameter with identifier: "+identifier+" already defined");
-        }
-        // TODO: check duplicates on name|qname?
-        PublicRenderParameterType p = new PublicRenderParameterType();
-        p.setName(name);
-        p.setIdentifier(identifier);
-        publicRenderParameter.add(p);
-        return p;        
-    }
-    
-    public PublicRenderParameter addPublicRenderParameter(QName qname, String identifier)
-    {
-        if (getPublicRenderParameter(identifier) != null)
-        {
-            throw new IllegalArgumentException("PublicRenderParameter with identifier: "+identifier+" already defined");
-        }
-        // TODO: check duplicates on name|qname?
-        PublicRenderParameterType p = new PublicRenderParameterType();
-        p.setQName(qname);
-        p.setIdentifier(identifier);
-        publicRenderParameter.add(p);
-        return p;        
-    }
-    
-    public List<? extends Listener> getListeners()
-    {
-        if (listener == null)
-        {
-            listener = new ArrayList<ListenerType>();
-        }
-        return listener;
-    }
-    
-    public Listener addListener(String listenerClass)
-    {
-        for (Listener l : getListeners())
-        {
-            if (l.getListenerClass().equals(listenerClass))
-            {
-                throw new IllegalArgumentException("Listener of class: "+listenerClass+" already defined");
-            }
-        }
-        ListenerType l = new ListenerType();
-        l.setListenerClass(listenerClass);
-        listener.add(l);
-        return l;        
-    }
-    
-    public ContainerRuntimeOption getContainerRuntimeOption(String name)
-    {
-        for (ContainerRuntimeOption cro : getContainerRuntimeOptions())
-        {
-            if (cro.getName().equals(name))
-            {
-                return cro;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends ContainerRuntimeOption> getContainerRuntimeOptions()
-    {
-        if (containerRuntimeOption == null)
-        {
-            containerRuntimeOption = new ArrayList<ContainerRuntimeOptionType>();
-        }
-        return containerRuntimeOption;
-    }
-    
-    public ContainerRuntimeOption addContainerRuntimeOption(String name)
-    {
-        if (getContainerRuntimeOption(name) != null)
-        {
-            throw new IllegalArgumentException("Container runtime option with name: "+name+" already defined");
-        }
-        ContainerRuntimeOptionType cro = new ContainerRuntimeOptionType();
-        cro.setName(name);
-        containerRuntimeOption.add(cro);
-        return cro;        
-    }
-    
-    public String getVersion()
-    {
-        return version;
-    }
-
-    public void setVersion(String value)
-    {
-        if (JSR_168_VERSION.equals(value) 
-           || JSR_286_VERSION.equals(value)
-           || JSR_362_VERSION.equals(value))
-        {
-            version = value;
-        }
-        else
-        {
-            throw new IllegalArgumentException("Application descriptor version: "+value+" unsupported.");
-        }
-    }
-    
-    public Map<Locale, String> getLocaleEncodingMappings()
-    {
-        if (localeEncodingMappings == null)
-        {
-            localeEncodingMappings = new HashMap<Locale,String>();
-        }
-        return localeEncodingMappings;
-    }
-    
-    public void addLocaleEncodingMapping(Locale locale, String encoding)
-    {
-        getLocaleEncodingMappings().put(locale, encoding);
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PortletCollectionType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PortletCollectionType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PortletCollectionType.java
deleted file mode 100644
index 3cfd5e8..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PortletCollectionType.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-/**
- * 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 <p>Java class for portlet-collectionType complex type. <p>The
- * following schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;portlet-collectionType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;portlet-name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-nameType&quot; maxOccurs=&quot;unbounded&quot;/&gt;
- *       &lt;/sequence&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "portlet-collectionType", propOrder = { "portletName" })
-public class PortletCollectionType
-{
-    @XmlElement(name = "portlet-name", required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected List<String> portletName;
-
-    public List<String> getPortletNames()
-    {
-        if (portletName == null)
-        {
-            portletName = new ArrayList<String>();
-        }
-        return portletName;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PortletInfoType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PortletInfoType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PortletInfoType.java
deleted file mode 100644
index 01f42a2..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PortletInfoType.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.PortletInfo;
-
-/**
- * <p>Java class for portlet-infoType complex type. <p>The following schema fragment specifies the expected content
- * contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;portlet-infoType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;title&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}titleType&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;short-title&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}short-titleType&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;keywords&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}keywordsType&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "portlet-infoType", propOrder = { "title", "shortTitle", "keywords" })
-public class PortletInfoType implements PortletInfo
-{
-    @XmlElement (name = "title")
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String title;
-    @XmlElement(name = "short-title")
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String shortTitle;
-    @XmlElement(name = "keywords")
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String keywords;
-
-    public String getTitle()
-    {
-        return title;
-    }
-
-    public void setTitle(String value)
-    {
-        title = value;
-    }
-
-    public String getShortTitle()
-    {
-        return shortTitle;
-    }
-
-    public void setShortTitle(String value)
-    {
-        shortTitle = value;
-    }
-
-    public String getKeywords()
-    {
-        return keywords;
-    }
-
-    public void setKeywords(String value)
-    {
-        keywords = value;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PortletPreferencesType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PortletPreferencesType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PortletPreferencesType.java
deleted file mode 100644
index ee1d092..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PortletPreferencesType.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-import org.apache.pluto.container.om.portlet.Preference;
-import org.apache.pluto.container.om.portlet.Preferences;
-
-/**
- * Portlet persistent preference store. Used in: portlet <p>Java class for portlet-preferencesType complex type. <p>The
- * following schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;portlet-preferencesType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;preference&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}preferenceType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;preferences-validator&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}preferences-validatorType&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "portlet-preferencesType", propOrder = { "preference", "preferencesValidator" })
-public class PortletPreferencesType implements Preferences
-{
-    @XmlElement(name = "preference")
-    protected List<PreferenceType> preference;
-    @XmlElement(name = "preferences-validator")
-    protected String preferencesValidator;
-
-    public Preference getPortletPreference(String name)
-    {
-        for (Preference p : getPortletPreferences())
-        {
-            if (p.getName().equals(name))
-            {
-                return p;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Preference> getPortletPreferences()
-    {
-        if (preference == null)
-        {
-            preference = new ArrayList<PreferenceType>();
-        }
-        return preference;
-    }
-    
-    public Preference addPreference(String name)
-    {
-        if (getPortletPreference(name) != null)
-        {
-            throw new IllegalArgumentException("Portlet preference with name: "+name+" already defined");
-        }
-        PreferenceType pref = new PreferenceType();
-        pref.setName(name);
-        preference.add(pref);
-        return pref;        
-    }
-    
-    public String getPreferencesValidator()
-    {
-        return preferencesValidator;
-    }
-
-    public void setPreferencesValidator(String value)
-    {
-        preferencesValidator = value;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PortletType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PortletType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PortletType.java
deleted file mode 100644
index 6bb2207..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PortletType.java
+++ /dev/null
@@ -1,521 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.Unmarshaller;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import javax.xml.namespace.QName;
-
-import org.apache.pluto.container.om.portlet.ContainerRuntimeOption;
-import org.apache.pluto.container.om.portlet.Description;
-import org.apache.pluto.container.om.portlet.DisplayName;
-import org.apache.pluto.container.om.portlet.EventDefinitionReference;
-import org.apache.pluto.container.om.portlet.InitParam;
-import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
-import org.apache.pluto.container.om.portlet.PortletDefinition;
-import org.apache.pluto.container.om.portlet.PortletInfo;
-import org.apache.pluto.container.om.portlet.Preferences;
-import org.apache.pluto.container.om.portlet.SecurityRoleRef;
-import org.apache.pluto.container.om.portlet.Supports;
-
-/**
- * The portlet element contains the declarative data of a portlet. Used in: portlet-app <p>Java class for portletType
- * complex type. <p>The following schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;portletType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;portlet-name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-nameType&quot;/&gt;
- *         &lt;element name=&quot;display-name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}display-nameType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;portlet-class&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-classType&quot;/&gt;
- *         &lt;element name=&quot;init-param&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}init-paramType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;expiration-cache&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}expiration-cacheType&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;cache-scope&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}cache-scopeType&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;supports&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}supportsType&quot; maxOccurs=&quot;unbounded&quot;/&gt;
- *         &lt;element name=&quot;supported-locale&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}supported-localeType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;resource-bundle&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}resource-bundleType&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;portlet-info&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-infoType&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;portlet-preferences&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-preferencesType&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;security-role-ref&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}security-role-refType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;supported-processing-event&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}event-definition-referenceType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;supported-publishing-event&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}event-definition-referenceType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;supported-public-render-parameter&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;container-runtime-option&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}container-runtime-optionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "portletType", propOrder = { "description", "portletName", "displayName", "portletClass", "initParam",
-                                            "expirationCache", "cacheScope", "supports", "supportedLocale",
-                                            "resourceBundle", "portletInfo", "portletPreferences", "securityRoleRef",
-                                            "supportedProcessingEvent", "supportedPublishingEvent",
-                                            "supportedPublicRenderParameter", "containerRuntimeOption" })
-public class PortletType implements PortletDefinition
-{
-    @XmlElement(name = "description")
-    protected List<DescriptionType> description;
-    @XmlElement(name = "portlet-name", required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String portletName;
-    @XmlElement(name = "display-name")
-    protected List<DisplayNameType> displayName;
-    @XmlElement(name = "portlet-class", required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String portletClass;
-    @XmlElement(name = "init-param")
-    protected List<InitParamType> initParam;
-    @XmlElement(name = "expiration-cache")
-    protected Integer expirationCache;
-    @XmlElement(name = "cache-scope")
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String cacheScope;
-    @XmlElement(required = true)
-    protected List<SupportsType> supports;
-    @XmlElement(name = "supported-locale")
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected List<String> supportedLocale;
-    @XmlElement(name = "resource-bundle")
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String resourceBundle;
-    @XmlElement(name = "portlet-info")
-    protected PortletInfoType portletInfo;
-    @XmlElement(name = "portlet-preferences")
-    protected PortletPreferencesType portletPreferences;
-    @XmlElement(name = "security-role-ref")
-    protected List<SecurityRoleRefType> securityRoleRef;
-    @XmlElement(name = "supported-processing-event")
-    protected List<EventDefinitionReferenceType> supportedProcessingEvent;
-    @XmlElement(name = "supported-publishing-event")
-    protected List<EventDefinitionReferenceType> supportedPublishingEvent;
-    @XmlElement(name = "supported-public-render-parameter")
-    protected List<String> supportedPublicRenderParameter;
-    @XmlElement(name = "container-runtime-option")
-    protected List<ContainerRuntimeOptionType> containerRuntimeOption;
-    
-    @XmlTransient
-    private PortletApplicationDefinition application;
-    
-    public PortletType()
-    {
-    }
-    
-    public PortletApplicationDefinition getApplication()
-    {
-        return application;
-    }
-    
-    public void setApplication(PortletApplicationDefinition app)
-    {
-        this.application = app;
-    }
-
-    public Description getDescription(Locale locale)
-    {
-        for (Description d : getDescriptions())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Description> getDescriptions()
-    {
-        if (description == null)
-        {
-            description = new ArrayList<DescriptionType>();
-        }
-        return description;
-    }
-    
-    public Description addDescription(String lang)
-    {
-        DescriptionType d = new DescriptionType();
-        d.setLang(lang);
-        if (getDescription(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
-        }
-        getDescriptions();
-        description.add(d);
-        return d;
-    }
-
-    public DisplayName getDisplayName(Locale locale)
-    {
-        for (DisplayName d : getDisplayNames())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends DisplayName> getDisplayNames()
-    {
-        if (displayName == null)
-        {
-            displayName = new ArrayList<DisplayNameType>();
-        }
-        return displayName;
-    }
-    
-    public DisplayName addDisplayName(String lang)
-    {
-        DisplayNameType d = new DisplayNameType();
-        d.setLang(lang);
-        if (getDisplayName(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("DisplayName for language: "+d.getLocale()+" already defined");
-        }
-        getDisplayNames();
-        displayName.add(d);
-        return d;
-    }
-
-    public String getPortletName()
-    {
-        return portletName;
-    }
-
-    public void setPortletName(String value)
-    {
-        portletName = value;
-    }
-
-    public String getPortletClass()
-    {
-        return portletClass;
-    }
-
-    public void setPortletClass(String value)
-    {
-        portletClass = value;
-    }
-
-    public InitParam getInitParam(String name)
-    {
-        for (InitParam param : getInitParams())
-        {
-            if (param.getParamName().equals(name))
-            {
-                return param;
-            }
-        }
-        return null;
-    }
-
-    public List<? extends InitParam> getInitParams()
-    {
-        if (initParam == null)
-        {
-            initParam = new ArrayList<InitParamType>();
-        }
-        return initParam;
-    }
-    
-    public InitParam addInitParam(String paramName)
-    {
-        if (getInitParam(paramName) != null)
-        {
-            throw new IllegalArgumentException("Init parameter: "+paramName+" already defined");
-        }
-        InitParamType param = new InitParamType();
-        param.setParamName(paramName);
-        getInitParams();
-        initParam.add(param);
-        return param;
-    }
-    
-    public int getExpirationCache()
-    {
-        return expirationCache != null ? expirationCache.intValue() : 0;
-    }
-
-    public void setExpirationCache(int value)
-    {
-        expirationCache = new Integer(value);
-    }
-
-    /**
-     * 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 across users. The default value if not present is "private".
-     */
-    public String getCacheScope()
-    {
-        return cacheScope != null ? cacheScope : "private";
-    }
-
-    public void setCacheScope(String cacheScope)
-    {
-        this.cacheScope = cacheScope;
-    }
-
-    public Supports getSupports(String mimeType)
-    {
-        for (Supports s : getSupports())
-        {
-            if (s.getMimeType().equals(mimeType))
-            {
-                return s;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Supports> getSupports()
-    {
-        if (supports == null)
-        {
-            supports = new ArrayList<SupportsType>();
-        }
-        return supports;
-    }
-    
-    public Supports addSupports(String mimeType)
-    {
-        if (getSupports(mimeType) != null)
-        {
-            throw new IllegalArgumentException("Supports for mime type: "+mimeType+" already defined");
-        }
-        SupportsType s = new SupportsType();
-        s.setMimeType(mimeType);
-        supports.add(s);
-        return s;        
-    }
-    
-    public List<String> getSupportedLocales()
-    {
-        if (supportedLocale == null)
-        {
-            supportedLocale = new ArrayList<String>();
-        }
-        return supportedLocale;
-    }
-    
-    public void addSupportedLocale(String lang)
-    {
-        for (String l : getSupportedLocales())
-        {
-            if (l.equals(lang))
-            {
-                throw new IllegalArgumentException("Supported locale: "+lang+" already defined");
-            }
-        }
-        supportedLocale.add(lang);    
-    }
-
-    public String getResourceBundle()
-    {
-        return resourceBundle;
-    }
-
-    public void setResourceBundle(String value)
-    {
-        resourceBundle = value;
-    }
-
-    public PortletInfo getPortletInfo()
-    {
-        if (portletInfo == null)
-        {
-            portletInfo = new PortletInfoType();
-        }
-        return portletInfo;
-    }
-
-    public Preferences getPortletPreferences()
-    {
-        if (portletPreferences == null)
-        {
-            portletPreferences = new PortletPreferencesType();
-        }
-        return portletPreferences;
-    }
-    
-    public SecurityRoleRef getSecurityRoleRef(String roleName)
-    {
-        for (SecurityRoleRef ref : getSecurityRoleRefs())
-        {
-            if (ref.getRoleName().equals(roleName))
-            {
-                return ref;
-            }
-        }
-        return null;
-    }
-
-    public List<? extends SecurityRoleRef> getSecurityRoleRefs()
-    {
-        if (securityRoleRef == null)
-        {
-            securityRoleRef = new ArrayList<SecurityRoleRefType>();
-        }
-        return securityRoleRef;
-    }
-    
-    public SecurityRoleRef addSecurityRoleRef(String roleName)
-    {
-        if (getSecurityRoleRef(roleName) != null)
-        {
-            throw new IllegalArgumentException("Security role reference for role: "+roleName+" already defined");
-        }
-        SecurityRoleRefType srr = new SecurityRoleRefType();
-        srr.setRoleName(roleName);
-        securityRoleRef.add(srr);
-        return srr;        
-    }
-    
-    public List<? extends EventDefinitionReference> getSupportedProcessingEvents()
-    {
-        if (supportedProcessingEvent == null)
-        {
-            supportedProcessingEvent = new ArrayList<EventDefinitionReferenceType>();            
-        }
-        return supportedProcessingEvent;
-    }
-
-    public EventDefinitionReference addSupportedProcessingEvent(QName qname)
-    {
-        // TODO: check duplicates
-        getSupportedProcessingEvents();
-        EventDefinitionReferenceType edr = new EventDefinitionReferenceType();
-        edr.setQName(qname);
-        supportedProcessingEvent.add(edr);
-        return edr;
-    }
-    
-    public EventDefinitionReference addSupportedProcessingEvent(String name)
-    {
-        // TODO check duplicates
-        getSupportedProcessingEvents();
-        EventDefinitionReferenceType edr = new EventDefinitionReferenceType();
-        edr.setName(name);
-        supportedProcessingEvent.add(edr);
-        return edr;
-    }
-        
-    public List<? extends EventDefinitionReference> getSupportedPublishingEvents()
-    {
-        if (supportedPublishingEvent == null)
-        {
-            supportedPublishingEvent = new ArrayList<EventDefinitionReferenceType>();            
-        }
-        return supportedPublishingEvent;
-    }
-
-    public EventDefinitionReference addSupportedPublishingEvent(QName qname)
-    {
-        // TODO: check duplicates
-        getSupportedPublishingEvents();
-        EventDefinitionReferenceType edr = new EventDefinitionReferenceType();
-        edr.setQName(qname);
-        supportedPublishingEvent.add(edr);
-        return edr;
-    }
-    
-    public EventDefinitionReference addSupportedPublishingEvent(String name)
-    {
-        // TODO check duplicates
-        getSupportedPublishingEvents();
-        EventDefinitionReferenceType edr = new EventDefinitionReferenceType();
-        edr.setName(name);
-        supportedPublishingEvent.add(edr);
-        return edr;
-    }
-        
-    public List<String> getSupportedPublicRenderParameters()
-    {
-        if (supportedPublicRenderParameter == null)
-        {
-            supportedPublicRenderParameter = new ArrayList<String>();
-        }
-        return supportedPublicRenderParameter;
-    }
-    
-    public void addSupportedPublicRenderParameter(String identifier)
-    {
-        for (String ident : getSupportedPublicRenderParameters())
-        {
-            if (ident.equals(identifier))
-            {
-                throw new IllegalArgumentException("Support for public render parameter with identifier: "+identifier+" already defined");
-            }
-        }
-        supportedPublicRenderParameter.add(identifier);
-    }
-
-    public ContainerRuntimeOption getContainerRuntimeOption(String name)
-    {
-        for (ContainerRuntimeOption cro : getContainerRuntimeOptions())
-        {
-            if (cro.getName().equals(name))
-            {
-                return cro;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends ContainerRuntimeOption> getContainerRuntimeOptions()
-    {
-        if (containerRuntimeOption == null)
-        {
-            containerRuntimeOption = new ArrayList<ContainerRuntimeOptionType>();
-        }
-        return containerRuntimeOption;
-    }
-    
-    public ContainerRuntimeOption addContainerRuntimeOption(String name)
-    {
-        if (getContainerRuntimeOption(name) != null)
-        {
-            throw new IllegalArgumentException("Container runtime option with name: "+name+" already defined");
-        }
-        ContainerRuntimeOptionType cro = new ContainerRuntimeOptionType();
-        cro.setName(name);
-        containerRuntimeOption.add(cro);
-        return cro;        
-    }
-    
-    public void afterUnmarshal(Unmarshaller u, Object parent) {
-        application = (PortletApplicationDefinition)parent;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PreferenceType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PreferenceType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PreferenceType.java
deleted file mode 100644
index 3a147c1..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PreferenceType.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.Preference;
-
-/**
- * Persistent preference values that may be used for customization and personalization by the portlet. Used in:
- * portlet-preferences <p>Java class for preferenceType complex type. <p>The following schema fragment specifies the
- * expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;preferenceType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}nameType&quot;/&gt;
- *         &lt;element name=&quot;value&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}valueType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;read-only&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}read-onlyType&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "preferenceType", propOrder = { "name", "value", "readOnly" })
-public class PreferenceType implements Preference
-{
-    @XmlElement(required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String name;
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected List<String> value;
-    @XmlElement(name = "read-only")
-    protected Boolean readOnly;
-
-    public String getName()
-    {
-        return name;
-    }
-
-    public void setName(String value)
-    {
-        name = value;
-    }
-
-    public List<String> getValues()
-    {
-        if (value == null)
-        {
-            value = new ArrayList<String>();
-        }
-        return value;
-    }
-    
-    public void addValue(String value)
-    {
-        getValues().add(value);
-    }
-
-    public boolean isReadOnly()
-    {
-        return readOnly != null ? readOnly.booleanValue() : false;
-    }
-
-    public void setReadOnly(boolean value)
-    {
-        readOnly = value ? Boolean.TRUE : Boolean.FALSE;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PublicRenderParameterType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PublicRenderParameterType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PublicRenderParameterType.java
deleted file mode 100644
index f9d7e02..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/PublicRenderParameterType.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import javax.xml.namespace.QName;
-
-import org.apache.pluto.container.om.portlet.Description;
-import org.apache.pluto.container.om.portlet.PublicRenderParameter;
-
-/**
- * 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 parameter in the portlet code. Used in:
- * portlet-app <p>Java class for public-render-parameterType complex type. <p>The following schema fragment specifies
- * the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;public-render-parameterType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;identifier&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot;/&gt;
- *         &lt;choice&gt;
- *           &lt;element name=&quot;qname&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}QName&quot;/&gt;
- *           &lt;element name=&quot;name&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}NCName&quot;/&gt;
- *         &lt;/choice&gt;
- *         &lt;element name=&quot;alias&quot; type=&quot;{http://www.w3.org/2001/XMLSchema}QName&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "public-render-parameterType", propOrder = { "description", "identifier", "qname", "name", "alias" })
-public class PublicRenderParameterType implements PublicRenderParameter
-{
-    @XmlElement(name = "description")
-    protected List<DescriptionType> description;
-    @XmlElement(required = true)
-    protected String identifier;
-    protected QName qname;
-    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
-    @XmlSchemaType(name = "NCName")
-    protected String name;
-    protected List<QName> alias;
-
-    public Description getDescription(Locale locale)
-    {
-        for (Description d : getDescriptions())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Description> getDescriptions()
-    {
-        if (description == null)
-        {
-            description = new ArrayList<DescriptionType>();
-        }
-        return description;
-    }
-    
-    public Description addDescription(String lang)
-    {
-        DescriptionType d = new DescriptionType();
-        d.setLang(lang);
-        if (getDescription(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
-        }
-        getDescriptions();
-        description.add(d);
-        return d;
-    }
-
-    public String getIdentifier()
-    {
-        return identifier;
-    }
-
-    public void setIdentifier(String value)
-    {
-        identifier = value;
-    }
-
-    public QName getQName()
-    {
-        return qname;
-    }
-
-    public void setQName(QName value)
-    {
-        qname = value;
-        name = null;
-    }
-
-    public String getName()
-    {
-        return name;
-    }
-
-    public void setName(String value)
-    {
-        name = value;
-        qname = null;
-    }
-
-    public List<QName> getAliases()
-    {
-        if (alias == null)
-        {
-            alias = new ArrayList<QName>();
-        }
-        return alias;
-    }
-
-    public void addAlias(QName alias)
-    {
-        // TODO: check duplicates
-        getAliases().add(alias);
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/SecurityConstraintType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/SecurityConstraintType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/SecurityConstraintType.java
deleted file mode 100644
index f9851f2..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/SecurityConstraintType.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-import org.apache.pluto.container.om.portlet.DisplayName;
-import org.apache.pluto.container.om.portlet.SecurityConstraint;
-import org.apache.pluto.container.om.portlet.UserDataConstraint;
-
-/**
- * The security-constraintType is used to associate intended security constraints with one or more portlets. Used in:
- * portlet-app <p>Java class for security-constraintType complex type. <p>The following schema fragment specifies the
- * expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;security-constraintType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;display-name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}display-nameType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;portlet-collection&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-collectionType&quot;/&gt;
- *         &lt;element name=&quot;user-data-constraint&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}user-data-constraintType&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "security-constraintType", propOrder = { "displayName", "portletCollection", "userDataConstraint" })
-public class SecurityConstraintType implements SecurityConstraint
-{
-    @XmlElement(name = "display-name")
-    protected List<DisplayNameType> displayName;
-    @XmlElement(name = "portlet-collection", required = true)
-    protected PortletCollectionType portletCollection;
-    @XmlElement(name = "user-data-constraint", required = true)
-    protected UserDataConstraintType userDataConstraint;
-
-    public DisplayName getDisplayName(Locale locale)
-    {
-        for (DisplayName d : getDisplayNames())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends DisplayName> getDisplayNames()
-    {
-        if (displayName == null)
-        {
-            displayName = new ArrayList<DisplayNameType>();
-        }
-        return displayName;
-    }
-    
-    public DisplayName addDisplayName(String lang)
-    {
-        DisplayNameType d = new DisplayNameType();
-        d.setLang(lang);
-        if (getDisplayName(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("DisplayName for language: "+d.getLocale()+" already defined");
-        }
-        getDisplayNames();
-        displayName.add(d);
-        return d;
-    }
-
-    public List<String> getPortletNames()
-    {
-        if (portletCollection == null)
-        {
-            portletCollection = new PortletCollectionType();
-        }
-        return portletCollection.getPortletNames();
-    }
-    
-    public void addPortletName(String portletName)
-    {
-        for (String name : getPortletNames())
-        {
-            if (name.equals(portletName))
-            {
-                throw new IllegalArgumentException("Portlet name: "+name+" already defined");
-            }
-        }
-        portletCollection.getPortletNames().add(portletName);        
-    }
-
-    public UserDataConstraint getUserDataConstraint()
-    {
-        if (userDataConstraint == null)
-        {
-            userDataConstraint = new UserDataConstraintType();
-        }
-        return userDataConstraint;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/SecurityRoleRefType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/SecurityRoleRefType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/SecurityRoleRefType.java
deleted file mode 100644
index c9d1044..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/SecurityRoleRefType.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.Description;
-import org.apache.pluto.container.om.portlet.SecurityRoleRef;
-
-/**
- * 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 <p>Java class for security-role-refType complex type. <p>The following schema fragment specifies the
- * expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;security-role-refType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;role-name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}role-nameType&quot;/&gt;
- *         &lt;element name=&quot;role-link&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}role-linkType&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
-*/
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "security-role-refType", propOrder = { "description", "roleName", "roleLink" })
-public class SecurityRoleRefType implements SecurityRoleRef
-{
-    @XmlElement(name = "description")
-    protected List<DescriptionType> description;
-    @XmlElement(name = "role-name", required = true)
-    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
-    protected String roleName;
-    @XmlElement(name = "role-link")
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String roleLink;
-
-    public Description getDescription(Locale locale)
-    {
-        for (Description d : getDescriptions())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Description> getDescriptions()
-    {
-        if (description == null)
-        {
-            description = new ArrayList<DescriptionType>();
-        }
-        return description;
-    }
-    
-    public Description addDescription(String lang)
-    {
-        DescriptionType d = new DescriptionType();
-        d.setLang(lang);
-        if (getDescription(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
-        }
-        getDescriptions();
-        description.add(d);
-        return d;
-    }
-
-    public String getRoleName()
-    {
-        return roleName;
-    }
-
-    public void setRoleName(String value)
-    {
-        roleName = value;
-    }
-
-    public String getRoleLink()
-    {
-        return roleLink;
-    }
-
-    public void setRoleLink(String value)
-    {
-        roleLink = value;
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/SupportsType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/SupportsType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/SupportsType.java
deleted file mode 100644
index 74f9b66..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/SupportsType.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.Supports;
-
-/**
- * Supports indicates the portlet modes a portlet supports for a specific content type. All portlets must support the
- * view mode. Used in: portlet <p>Java class for supportsType complex type. <p>The following schema fragment specifies
- * the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;supportsType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;mime-type&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}mime-typeType&quot;/&gt;
- *         &lt;element name=&quot;portlet-mode&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-modeType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;window-state&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}window-stateType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "supportsType", propOrder = { "mimeType", "portletMode", "windowState" })
-public class SupportsType implements Supports
-{
-    @XmlElement(name = "mime-type", required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String mimeType;
-    @XmlElement(name = "portlet-mode")
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected List<String> portletMode;
-    @XmlElement(name = "window-state")
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected List<String> windowState;
-
-    public String getMimeType()
-    {
-        return mimeType;
-    }
-
-    public void setMimeType(String value)
-    {
-        mimeType = value;
-    }
-
-    public List<String> getPortletModes()
-    {
-        if (portletMode == null)
-        {
-            portletMode = new ArrayList<String>();
-        }
-        return portletMode;
-    }
-    
-    public void addPortletMode(String name)
-    {
-        for (String mode : getPortletModes())
-        {
-            if (mode.equals(name))
-            {
-                throw new IllegalArgumentException("Portlet mode: "+name+" already defined");
-            }
-        }
-        portletMode.add(name);
-    }
-
-    public List<String> getWindowStates()
-    {
-        if (windowState == null)
-        {
-            windowState = new ArrayList<String>();
-        }
-        return windowState;
-    }
-
-    public void addWindowState(String name)
-    {
-        for (String state : getWindowStates())
-        {
-            if (state.equals(name))
-            {
-                throw new IllegalArgumentException("Window state: "+name+" already defined");
-            }
-        }
-        windowState.add(name);
-    }
-}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/UserAttributeType.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/UserAttributeType.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/UserAttributeType.java
deleted file mode 100644
index 6b439c5..0000000
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet20/impl/UserAttributeType.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * 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.
- */
-package org.apache.pluto.container.om.portlet20.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.pluto.container.om.portlet.Description;
-import org.apache.pluto.container.om.portlet.UserAttribute;
-
-/**
- * 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 <p>Java class
- * for user-attributeType complex type. <p>The following schema fragment specifies the expected content contained
- * within this class.
- * 
- * <pre>
- * &lt;complexType name=&quot;user-attributeType&quot;&gt;
- *   &lt;complexContent&gt;
- *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
- *       &lt;sequence&gt;
- *         &lt;element name=&quot;description&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType&quot; maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;/&gt;
- *         &lt;element name=&quot;name&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}nameType&quot;/&gt;
- *       &lt;/sequence&gt;
- *       &lt;attribute name=&quot;id&quot; type=&quot;{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string&quot; /&gt;
- *     &lt;/restriction&gt;
- *   &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * 
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "user-attributeType", propOrder = { "description", "name" })
-public class UserAttributeType implements UserAttribute
-{
-    @XmlElement(name = "description")
-    protected List<DescriptionType> description;
-    @XmlElement(required = true)
-    @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
-    protected String name;
-
-    public Description getDescription(Locale locale)
-    {
-        for (Description d : getDescriptions())
-        {
-            if (d.getLocale().equals(locale))
-            {
-                return d;
-            }
-        }
-        return null;
-    }
-    
-    public List<? extends Description> getDescriptions()
-    {
-        if (description == null)
-        {
-            description = new ArrayList<DescriptionType>();
-        }
-        return description;
-    }
-    
-    public Description addDescription(String lang)
-    {
-        DescriptionType d = new DescriptionType();
-        d.setLang(lang);
-        if (getDescription(d.getLocale()) != null)
-        {
-            throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
-        }
-        getDescriptions();
-        description.add(d);
-        return d;
-    }
-
-    public String getName()
-    {
-        return name;
-    }
-
-    public void setName(String value)
-    {
-        name = value;
-    }
-}


[24/38] portals-pluto git commit: Integrated latest version of the portlet API 3.0. Made necessary minor adaptations the Pluto code and demo portlets to make the previously available funtionality work. For the partial action request, changed implementati

Posted by ms...@apache.org.
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/7fb0624d/portlet-api/src/main/java/javax/portlet/filter/StateAwareResponseWrapper.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/filter/StateAwareResponseWrapper.java b/portlet-api/src/main/java/javax/portlet/filter/StateAwareResponseWrapper.java
new file mode 100644
index 0000000..9284c37
--- /dev/null
+++ b/portlet-api/src/main/java/javax/portlet/filter/StateAwareResponseWrapper.java
@@ -0,0 +1,168 @@
+/*  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.
+ */
+
+
+package javax.portlet.filter;
+
+import java.io.Serializable;
+import java.util.Map;
+
+import javax.portlet.MutableRenderParameters;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletModeException;
+import javax.portlet.StateAwareResponse;
+import javax.portlet.WindowState;
+import javax.portlet.WindowStateException;
+import javax.xml.namespace.QName;
+
+/**
+ * <div class="changed_added_3_0">
+ * The <code>StateAwareResponseWrapper</code> provides a convenient 
+ * implementation of the <code>StateAwareResponse</code> interface 
+ * that can be subclassed by developers wishing to adapt the Response.
+ * This class implements the Wrapper or Decorator pattern. 
+ * Methods default to calling through to the wrapped Response object.
+ * </div>
+ */
+public class StateAwareResponseWrapper extends PortletResponseWrapper implements StateAwareResponse {
+
+   StateAwareResponse response;
+
+   /**
+    * @param response
+    */
+   public StateAwareResponseWrapper(StateAwareResponse response) {
+      super(response);
+      this.response = response;
+   }
+
+   /**
+    * Return the wrapped response object.
+    * 
+    * @return the wrapped response
+    */
+   public StateAwareResponse getResponse() {
+      return response;
+   }
+
+   /**
+    * Sets the response object being wrapped.
+    * 
+    * @param response the response to set
+    * @throws java.lang.IllegalArgumentException   if the response is null.
+    */
+   public void setResponse(StateAwareResponse response) {
+      if ( response == null) {
+         throw new java.lang.IllegalArgumentException("Response is null");
+      }
+      super.setResponse(response);
+      this.response = response;
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.MutablePortletState#getRenderParameters()
+    */
+   public MutableRenderParameters getRenderParameters() {
+      return response.getRenderParameters();
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.MutablePortletState#setWindowState(javax.portlet.WindowState)
+    */
+   public void setWindowState(WindowState windowState)
+         throws WindowStateException {
+      response.setWindowState(windowState);
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.MutablePortletState#setPortletMode(javax.portlet.PortletMode)
+    */
+   public void setPortletMode(PortletMode portletMode)
+         throws PortletModeException {
+      response.setPortletMode(portletMode);
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.PortletState#getPortletMode()
+    */
+   public PortletMode getPortletMode() {
+      return response.getPortletMode();
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.PortletState#getWindowState()
+    */
+   public WindowState getWindowState() {
+      return response.getWindowState();
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.StateAwareResponse#setRenderParameters(java.util.Map)
+    */
+   @Deprecated
+   public void setRenderParameters(Map<String, String[]> parameters) {
+      response.setRenderParameters(parameters);
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.StateAwareResponse#setRenderParameter(java.lang.String, java.lang.String)
+    */
+   @Deprecated
+   public void setRenderParameter(String key, String value) {
+      response.setRenderParameter(key, value);
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.StateAwareResponse#setRenderParameter(java.lang.String, java.lang.String[])
+    */
+   @Deprecated
+   public void setRenderParameter(String key, String... values) {
+      response.setRenderParameter(key, values);
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.StateAwareResponse#setEvent(javax.xml.namespace.QName, java.io.Serializable)
+    */
+   public void setEvent(QName name, Serializable value) {
+      response.setEvent(name, value);
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.StateAwareResponse#setEvent(java.lang.String, java.io.Serializable)
+    */
+   public void setEvent(String name, Serializable value) {
+      response.setEvent(name, value);
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.StateAwareResponse#getRenderParameterMap()
+    */
+   @Deprecated
+   public Map<String, String[]> getRenderParameterMap() {
+      return response.getRenderParameterMap();
+   }
+
+   /* (non-Javadoc)
+    * @see javax.portlet.StateAwareResponse#removePublicRenderParameter(java.lang.String)
+    */
+   @Deprecated
+   public void removePublicRenderParameter(String name) {
+      response.removePublicRenderParameter(name);
+   }
+
+}