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 2016/01/18 13:41:13 UTC

[11/35] portals-pluto git commit: Adapted the portlet hub demo portlet to use annotation based configuration as much as possible (supported event config is not yet possible ... need the bean portlet functionality for that). Fixed several bugs in the conf

Adapted the portlet hub demo portlet to use annotation based configuration
as much as possible (supported event config is not yet possible ... need the
bean portlet functionality for that). Fixed several bugs in the config
reading impl.


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

Branch: refs/heads/V3Prototype
Commit: 0ceee24eb628552a07274448069563e755c3630a
Parents: df30f96
Author: Scott Nicklous <ms...@apache.org>
Authored: Mon Dec 7 15:49:20 2015 +0100
Committer: Scott Nicklous <ms...@apache.org>
Committed: Mon Dec 7 15:49:20 2015 +0100

----------------------------------------------------------------------
 .../java/basic/portlet/ImageSelPortlet.java     |   6 +-
 .../java/basic/portlet/MessageBoxPortlet.java   |   2 +-
 .../java/basic/portlet/ParamTestPortlet.java    |   4 +
 .../basic/portlet/PartialActionPortlet.java     |   6 +-
 .../java/basic/portlet/ResourcePortlet.java     |  35 +++++-
 .../src/main/webapp/WEB-INF/portlet.xml         |  97 +---------------
 .../portlet/PortletApplicationDefinition.java   |  12 ++
 .../container/om/portlet/PortletDefinition.java |   4 +
 .../driver/PortletContainerInitializer.java     |   9 +-
 .../impl/JSR286ConfigurationProcessor.java      | 113 ++++++++++++++-----
 .../impl/JSR362ConfigurationProcessor.java      |   5 +-
 .../impl/PortletApplicationDefinitionImpl.java  |  60 ++++++++++
 .../om/portlet/impl/PortletDefinitionImpl.java  |  15 +++
 13 files changed, 234 insertions(+), 134 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/0ceee24e/PortletHubDemo/src/main/java/basic/portlet/ImageSelPortlet.java
----------------------------------------------------------------------
diff --git a/PortletHubDemo/src/main/java/basic/portlet/ImageSelPortlet.java b/PortletHubDemo/src/main/java/basic/portlet/ImageSelPortlet.java
index 4475ebb..2221e84 100644
--- a/PortletHubDemo/src/main/java/basic/portlet/ImageSelPortlet.java
+++ b/PortletHubDemo/src/main/java/basic/portlet/ImageSelPortlet.java
@@ -38,11 +38,15 @@ import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 import javax.portlet.ResourceRequest;
 import javax.portlet.ResourceResponse;
+import javax.portlet.annotations.LocaleString;
+import javax.portlet.annotations.PortletConfiguration;
 
 
 /**
- * A management portlet that displays the current deep link configuraion
+ * A demo portlet for selecting images
  */
+@PortletConfiguration(portletName = "ImageSelPortlet", publicParams = "imgName", 
+                      title = @LocaleString("PH Image Selection Portlet"))
 public class ImageSelPortlet extends GenericPortlet {
 
    // Set up logging

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/0ceee24e/PortletHubDemo/src/main/java/basic/portlet/MessageBoxPortlet.java
----------------------------------------------------------------------
diff --git a/PortletHubDemo/src/main/java/basic/portlet/MessageBoxPortlet.java b/PortletHubDemo/src/main/java/basic/portlet/MessageBoxPortlet.java
index 4fb730a..13cb517 100644
--- a/PortletHubDemo/src/main/java/basic/portlet/MessageBoxPortlet.java
+++ b/PortletHubDemo/src/main/java/basic/portlet/MessageBoxPortlet.java
@@ -39,7 +39,7 @@ import javax.portlet.ResourceRequest;
 import javax.portlet.ResourceResponse;
 
 /**
- * A management portlet that displays the current deep link configuraion
+ * A demo portlet that displays messages sent via event
  */
 public class MessageBoxPortlet extends GenericPortlet {
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/0ceee24e/PortletHubDemo/src/main/java/basic/portlet/ParamTestPortlet.java
----------------------------------------------------------------------
diff --git a/PortletHubDemo/src/main/java/basic/portlet/ParamTestPortlet.java b/PortletHubDemo/src/main/java/basic/portlet/ParamTestPortlet.java
index ab5b242..8d182ca 100644
--- a/PortletHubDemo/src/main/java/basic/portlet/ParamTestPortlet.java
+++ b/PortletHubDemo/src/main/java/basic/portlet/ParamTestPortlet.java
@@ -38,6 +38,8 @@ import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 import javax.portlet.ResourceRequest;
 import javax.portlet.ResourceResponse;
+import javax.portlet.annotations.LocaleString;
+import javax.portlet.annotations.PortletConfiguration;
 
 
 /**
@@ -45,6 +47,8 @@ import javax.portlet.ResourceResponse;
  * 
  * @author Scott Nicklous
  */
+@PortletConfiguration(portletName = "ParamTestPortlet", publicParams = {"color", "imgName"},
+                        title = @LocaleString("PH Parameter Test Portlet"))
 public class ParamTestPortlet extends GenericPortlet {
 
    // Set up logging

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/0ceee24e/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 185daea..4f6c365 100644
--- a/PortletHubDemo/src/main/java/basic/portlet/PartialActionPortlet.java
+++ b/PortletHubDemo/src/main/java/basic/portlet/PartialActionPortlet.java
@@ -39,10 +39,14 @@ import javax.portlet.ResourceRequest;
 import static javax.portlet.ResourceRequest.*;
 
 import javax.portlet.ResourceResponse;
+import javax.portlet.annotations.LocaleString;
+import javax.portlet.annotations.PortletConfiguration;
 
 /**
- * A management portlet that displays the current deep link configuraion
+ * A demo portlet exercising the partial action processing sequence
  */
+@PortletConfiguration(portletName = "PartialActionPortlet", publicParams = "color",
+                        title = @LocaleString("PH Partial Action Portlet"))
 public class PartialActionPortlet extends GenericPortlet {
 
    // Set up logging

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/0ceee24e/PortletHubDemo/src/main/java/basic/portlet/ResourcePortlet.java
----------------------------------------------------------------------
diff --git a/PortletHubDemo/src/main/java/basic/portlet/ResourcePortlet.java b/PortletHubDemo/src/main/java/basic/portlet/ResourcePortlet.java
index 7dac46f..eec1af5 100644
--- a/PortletHubDemo/src/main/java/basic/portlet/ResourcePortlet.java
+++ b/PortletHubDemo/src/main/java/basic/portlet/ResourcePortlet.java
@@ -39,11 +39,44 @@ import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 import javax.portlet.ResourceRequest;
 import javax.portlet.ResourceResponse;
+import javax.portlet.annotations.EventDefinition;
+import javax.portlet.annotations.LocaleString;
+import javax.portlet.annotations.PortletApplication;
+import javax.portlet.annotations.PortletConfiguration;
+import javax.portlet.annotations.PortletQName;
+import javax.portlet.annotations.PublicRenderParameterDefinition;
+import javax.portlet.annotations.Supports;
 
 
 /**
- * A management portlet that displays the current deep link configuraion
+ * A demo portlet that displays images
  */
+@PortletApplication(
+      events = {
+            @EventDefinition(
+                  qname = @PortletQName(
+                        namespaceURI = "http://www.apache.org/portals/pluto/ResourcePortlet", 
+                        localPart = "Message"),
+                  payloadType = String.class)},
+      publicParams = {
+            @PublicRenderParameterDefinition(
+                  qname = @PortletQName(
+                        namespaceURI = "http://www.apache.org/portals/pluto/ResourcePortlet", 
+                        localPart = "imgName"),
+                  identifier = "imgName"
+                  ),
+            @PublicRenderParameterDefinition(
+                  qname = @PortletQName(
+                        namespaceURI = "http://www.apache.org/portals/pluto/ResourcePortlet", 
+                        localPart = "color"),
+                  identifier = "color") }
+      )
+@PortletConfiguration(portletName = "PH-ResourcePortlet-PRP",
+      title={@LocaleString("PH Resource Portlet")},
+      supportedLocales = {"en"},
+      supports = @Supports(mimeType = "text/html", portletModes = "VIEW"),
+      publicParams = {"color", "imgName"}
+      )
 public class ResourcePortlet extends GenericPortlet {
 
    // Set up logging

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/0ceee24e/PortletHubDemo/src/main/webapp/WEB-INF/portlet.xml
----------------------------------------------------------------------
diff --git a/PortletHubDemo/src/main/webapp/WEB-INF/portlet.xml b/PortletHubDemo/src/main/webapp/WEB-INF/portlet.xml
index f5e8595..a79f959 100644
--- a/PortletHubDemo/src/main/webapp/WEB-INF/portlet.xml
+++ b/PortletHubDemo/src/main/webapp/WEB-INF/portlet.xml
@@ -1,29 +1,9 @@
 <portlet-app xmlns="http://xmlns.jcp.org/xml/ns/portlet" 
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-             xmlns:rp="http://www.apache.org/portals/pluto/pub-render-params/ResourcePortlet"
+             xmlns:rp="http://www.apache.org/portals/pluto/ResourcePortlet"
              xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/portlet http://xmlns.jcp.org/xml/ns/portlet/portlet-app_3_0.xsd" 
              version="3.0"
     		id="ph.resource.portlet">
-   <portlet>
-      <portlet-name>PH-ResourcePortlet-PRP</portlet-name>
-      <display-name>PH Resource Portlet</display-name>
-      
-      <portlet-class>basic.portlet.ResourcePortlet</portlet-class>
-
-      <supports>
-         <mime-type>text/html</mime-type>
-         <portlet-mode>VIEW</portlet-mode>
-      </supports>
-
-      <supported-locale>en</supported-locale>        
-
-      <portlet-info>
-         <title>PH Resource Portlet</title>
-      </portlet-info>
-
-      <supported-public-render-parameter>imgName</supported-public-render-parameter>
-      <supported-public-render-parameter>color</supported-public-render-parameter>
-   </portlet>
 
    <portlet>
       <portlet-name>MessageBoxPortlet</portlet-name>
@@ -50,26 +30,6 @@
    </portlet>
 
    <portlet>
-      <portlet-name>ImageSelPortlet</portlet-name>
-      <display-name>Image Selection Portlet</display-name>
-      
-      <portlet-class>basic.portlet.ImageSelPortlet</portlet-class>
-
-      <supports>
-         <mime-type>text/html</mime-type>
-         <portlet-mode>VIEW</portlet-mode>
-      </supports>
-
-      <supported-locale>en</supported-locale>        
-
-      <portlet-info>
-         <title>PH Image Selection Portlet</title>
-      </portlet-info>
-
-      <supported-public-render-parameter>imgName</supported-public-render-parameter>
-   </portlet>
-
-   <portlet>
       <portlet-name>PH-ColorSelPortlet</portlet-name>
       <display-name>PH Color Selection Portlet</display-name>
       
@@ -92,59 +52,4 @@
       </supported-publishing-event>
       <supported-public-render-parameter>color</supported-public-render-parameter>
    </portlet>
-
-   <portlet>
-      <portlet-name>PartialActionPortlet</portlet-name>
-      <display-name>Partial Action Portlet</display-name>
-      
-      <portlet-class>basic.portlet.PartialActionPortlet</portlet-class>
-
-      <supports>
-         <mime-type>text/html</mime-type>
-         <portlet-mode>VIEW</portlet-mode>
-      </supports>
-
-      <supported-locale>en</supported-locale>        
-
-      <portlet-info>
-         <title>PH Partial Action Portlet</title>
-      </portlet-info>
-
-      <supported-public-render-parameter>color</supported-public-render-parameter>
-   </portlet>
-
-   <portlet>
-      <portlet-name>ParamTestPortlet</portlet-name>
-      <display-name>PH Parameter Test Portlet</display-name>
-      
-      <portlet-class>basic.portlet.ParamTestPortlet</portlet-class>
-
-      <supports>
-         <mime-type>text/html</mime-type>
-         <portlet-mode>VIEW</portlet-mode>
-      </supports>
-
-      <supported-locale>en</supported-locale>        
-
-      <portlet-info>
-         <title>PH Parameter Test Portlet</title>
-      </portlet-info>
-
-      <supported-public-render-parameter>imgName</supported-public-render-parameter>
-      <supported-public-render-parameter>color</supported-public-render-parameter>
-   </portlet>
-   
-   <event-definition>
-      <qname>rp:Message</qname>
-      <value-type>java.lang.String</value-type>
-   </event-definition>
-   
-   <public-render-parameter>
-      <identifier>imgName</identifier>
-      <qname>rp:ph-imgName</qname>
-   </public-render-parameter>
-   <public-render-parameter>
-      <identifier>color</identifier>
-      <qname>rp:ph-color</qname>
-   </public-render-parameter>
  </portlet-app>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/0ceee24e/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 b4698a7..6a76d15 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
@@ -47,14 +47,17 @@ public interface PortletApplicationDefinition {
     */
    public List<PortletDefinition> getMatchingPortlets(String portletName);
    void addPortlet(PortletDefinition pd);
+   boolean removePortlet(PortletDefinition pd);
    
    List<EventDefinition> getEventDefinitions();
    EventDefinition getEventDefinition(QName qn);
    void addEventDefinition(EventDefinition ed);
+   boolean removeEventDefinition(EventDefinition ed);
 
    PublicRenderParameter getPublicRenderParameter(String identifier);
    List<PublicRenderParameter> getPublicRenderParameters();
    void addPublicRenderParameter(PublicRenderParameter prp);
+   boolean removePublicRenderParameter(PublicRenderParameter prp);
 
    String getVersion();
    void setVersion(String version);
@@ -62,17 +65,21 @@ public interface PortletApplicationDefinition {
    CustomPortletMode getCustomPortletMode(String name);
    List<CustomPortletMode> getCustomPortletModes();
    void addCustomPortletMode(CustomPortletMode cpm);
+   boolean removeCustomPortletMode(CustomPortletMode pm);
 
    CustomWindowState getCustomWindowState(String name);
    List<CustomWindowState> getCustomWindowStates();
    void addCustomWindowState(CustomWindowState cws);
+   boolean removeCustomWindowState(CustomWindowState ws);
 
    UserAttribute getUserAttribute(String name);
    List<UserAttribute> getUserAttributes();
    void addUserAttribute(UserAttribute ua);
+   boolean removeUserAttribute(UserAttribute ua);
 
    List<SecurityConstraint> getSecurityConstraints();
    void addSecurityConstraint(SecurityConstraint sc);
+   boolean removeSecurityCOnstraint(SecurityConstraint sc);
 
    String getResourceBundle();
    void setResourceBundle(String resourceBundle);
@@ -80,13 +87,16 @@ public interface PortletApplicationDefinition {
    Filter getFilter(String filterName);
    List<Filter> getFilters();
    void addFilter(Filter filter);
+   boolean removeFilter(Filter filter);
 
    FilterMapping getFilterMapping(String filterName);
    List<FilterMapping> getFilterMappings();
    void addFilterMapping(FilterMapping fm);
+   boolean removeFilterMapping(FilterMapping fm);
 
    List<Listener> getListeners();
    void addListener(Listener listener);
+   boolean removeListener(Listener listener);
 
    String getDefaultNamespace();
    void setDefaultNamespace(String defaultNamespace);
@@ -94,7 +104,9 @@ public interface PortletApplicationDefinition {
    ContainerRuntimeOption getContainerRuntimeOption(String name);
    List<ContainerRuntimeOption> getContainerRuntimeOptions();
    void addContainerRuntimeOption(ContainerRuntimeOption cro);
+   boolean removeRuntimeOption(ContainerRuntimeOption cro);
 
    Map<Locale, String> getLocaleEncodingMappings();
    void addLocaleEncodingMapping(Locale locale, String encoding);
+   String removeLocaleEncodingMapping(Locale locale);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/0ceee24e/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 6de7da5..225844c 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
@@ -40,12 +40,15 @@ public interface PortletDefinition {
 
    List<EventDefinitionReference> getSupportedProcessingEvents();
    void addSupportedProcessingEvent(EventDefinitionReference edr);
+   boolean removeSupportedProcessingEvent(EventDefinitionReference edr);
     
    List<EventDefinitionReference> getSupportedPublishingEvents();
    void addSupportedPublishingEvent(EventDefinitionReference edr);
+   boolean removeSupportedPublishingEvent(EventDefinitionReference edr);
 
    List<String> getSupportedPublicRenderParameters();
    void addSupportedPublicRenderParameter(String identifier);
+   boolean removeSupportedPublicRenderParameter(String identifier);
 
    String getResourceBundle();
    void setResourceBundle(String resourceBundle);
@@ -82,4 +85,5 @@ public interface PortletDefinition {
    void addDependency(Dependency dep);
    List<Dependency> getDependencies();
    Dependency getDependency(String name);
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/0ceee24e/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 ff90207..9fb036b 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,6 +24,7 @@ import java.util.Set;
 import javax.portlet.annotations.PortletApplication;
 import javax.portlet.annotations.PortletConfiguration;
 import javax.portlet.annotations.PortletConfigurations;
+import javax.portlet.annotations.PortletRequestFilter;
 import javax.portlet.filter.PortletFilter;
 import javax.servlet.ServletContainerInitializer;
 import javax.servlet.ServletContext;
@@ -45,7 +46,7 @@ import org.slf4j.LoggerFactory;
  * 
  */
 @HandlesTypes({PortletApplication.class, PortletConfiguration.class,
-               PortletFilter.class, PortletConfigurations.class})
+               PortletRequestFilter.class, PortletConfigurations.class})
 public class PortletContainerInitializer implements ServletContainerInitializer {
 
    private static final String WEB_XML     = "/WEB-INF/web.xml";
@@ -89,7 +90,7 @@ public class PortletContainerInitializer implements ServletContainerInitializer
             ConfigurationHolder holder = new ConfigurationHolder();
 
             if (classes != null) {
-               // digest any & all configuration annotations
+               holder.processConfigAnnotations(classes);
             }
 
             if (pin != null) {
@@ -129,7 +130,7 @@ public class PortletContainerInitializer implements ServletContainerInitializer
                ctx.setAttribute(ConfigurationHolder.ATTRIB_NAME, holder);
                
             } else {
-               LOG.error("Configuration problem - no portlet definitions");
+               LOG.debug("No portlet definitions for context: " + ctx.getServletContextName());
             }
 
          } catch (Exception e) {
@@ -138,7 +139,7 @@ public class PortletContainerInitializer implements ServletContainerInitializer
             txt.append(", Servlet ctx name: ").append(
                   ctx.getServletContextName());
             txt.append(", Exception: ").append(e.toString());
-            LOG.error(txt.toString());
+            LOG.info(txt.toString());
          }
       }
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/0ceee24e/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 28df6f8..b466e3d 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
@@ -478,12 +478,12 @@ public class JSR286ConfigurationProcessor extends JSR168ConfigurationProcessor {
          List<PortletModeType> pmlist = st.getPortletMode();
          if (pmlist.size() == 0) {
             String info = "No portlet modes found in Supports block.";
-            LOG.info(info);
+            LOG.debug(info);
          }
          List<WindowStateType> wslist = st.getWindowState();
          if (wslist.size() == 0) {
             String info = "No window states found in Supports block.";
-            LOG.info(info);
+            LOG.debug(info);
          }
 
          // set up Supports
@@ -865,30 +865,49 @@ public class JSR286ConfigurationProcessor extends JSR168ConfigurationProcessor {
    public void validate () {
       super.validate();
       
+      StringBuilder txt = new StringBuilder(128);
+      
       // validate the resource bundle
       if (pad.getResourceBundle() != null) {
-         checkValidBundle(pad.getResourceBundle());
+         try {
+            checkValidBundle(pad.getResourceBundle());
+         } catch (Exception e) {
+            pad.setResourceBundle("");
+         }
       }
       
       // validate event definitions by making sure the payload classes, if provided, can be loaded.
       for (EventDefinition ed : pad.getEventDefinitions()) {
          String clsName = ed.getValueType();
          if (clsName != null && !clsName.equals("")) {
-            checkValidClass(clsName, null,
-                  "Bad Event definition. Payload type is invalid: ");
+            try {
+               checkValidClass(clsName, null, "Bad Event definition. Payload type is invalid: ");
+            } catch (Exception e) {
+               pad.removeEventDefinition(ed);
+            }
          }
       }
       
       // validate provided listener classes
       for (Listener l : pad.getListeners()) {
-         checkValidClass(l.getListenerClass(), PortletURLGenerationListener.class,
-               "Bad listener definition. Listener class is invalid: ");
+         try {
+            checkValidClass(l.getListenerClass(), PortletURLGenerationListener.class,
+                  "Bad listener definition. Listener class is invalid: ");
+         } catch(Exception e) {
+            pad.removeListener(l);
+         }
       }
       
       // Validate the filter classes
       for (Filter f : pad.getFilters()) {
-         checkValidClass(f.getFilterClass(), PortletFilter.class,
-               "Bad filter definition. Filter class is invalid: ");
+         try {
+            txt.setLength(0);
+            txt.append("Bad filter definition. Filter name: ").append(f.getFilterName());
+            txt.append(". Filter class is invalid: ");
+            checkValidClass(f.getFilterClass(), PortletFilter.class, txt.toString());
+         } catch(Exception e) {
+            pad.removeFilter(f);
+         }
       }
       
       // validate the filter mappings by making sure that the specified filters and 
@@ -896,15 +915,21 @@ public class JSR286ConfigurationProcessor extends JSR168ConfigurationProcessor {
       for (FilterMapping fm : pad.getFilterMappings()) {
          String fname = fm.getFilterName();
          if (pad.getFilter(fname) == null) {
-            String warning = "Bad FilterMapping definition. Filter definition not found: " + fname;
-            LOG.warn(warning);
-            throw new IllegalArgumentException(warning);
+            txt.setLength(0);
+            txt.append("Bad filter mapping definition. Filter name: ").append(fm.getFilterName());
+            txt.append(", Portlet names: ").append(fm.getPortletNames().toString());
+            txt.append(", Filter definition not found: ").append(fname);
+            LOG.warn(txt.toString());
+            pad.removeFilterMapping(fm);
          }
          for (String pn : fm.getPortletNames()) {
             if (pad.getMatchingPortlets(pn).isEmpty()) {
-               String warning = "Bad FilterMapping definition. Portlet definition not found: " + pn;
-               LOG.warn(warning);
-               throw new IllegalArgumentException(warning);
+               txt.setLength(0);
+               txt.append("Bad filter mapping definition. Filter name: ").append(fm.getFilterName());
+               txt.append(", Portlet names: ").append(fm.getPortletNames().toString());
+               txt.append(", Portlet definition not found: ").append(pn);
+               LOG.warn(txt.toString());
+               pad.removeFilterMapping(fm);
             }
          }
       }
@@ -914,34 +939,52 @@ public class JSR286ConfigurationProcessor extends JSR168ConfigurationProcessor {
          
          // check the portlet class
          if (pad.getVersion().equals("2.0") || pad.getVersion().equals("1.0")) {
-            checkValidClass(portlet.getPortletClass(), Portlet.class, "Bad portlet class: ");
+            try {
+               checkValidClass(portlet.getPortletClass(), Portlet.class, "Bad portlet class: ");
+            } catch (Exception e) {
+               pad.removePortlet(portlet);
+               continue;
+            }
          }
          
          // check the resource bundle
          if (portlet.getResourceBundle() != null) {
-            checkValidBundle(portlet.getResourceBundle());
+            try {
+               checkValidBundle(portlet.getResourceBundle());
+            } catch (Exception e) {
+               pad.setResourceBundle("");
+            }
          }
          
          // check the portlet preferences validator class
          Preferences prefs = portlet.getPortletPreferences();
          if (prefs != null && prefs.getPreferencesValidator() != null) {
             String clsName = prefs.getPreferencesValidator();
+            try {
             checkValidClass(clsName, PreferencesValidator.class,
                   "Bad portlet preferences validator class: ");
+            } catch (Exception e) {
+               portlet.setPortletPreferences(null);
+            }
          }
          
          // Check the supported public render parameters
          for (String prp : portlet.getSupportedPublicRenderParameters()) {
             boolean ok = false;
+            txt.setLength(0);
+            txt.append("Valid PRP identifiers: ");
+            String sep = "";
             for (PublicRenderParameter prpdef : pad.getPublicRenderParameters()) {
+               txt.append(sep).append(prpdef.getIdentifier());
+               sep = ", ";
                if (prpdef.getIdentifier().equals(prp)) {
                   ok = true;
                }
             }
             if (!ok) {
-               String warning = "Public render parameter definition not found for: " + prp;
-               LOG.warn(warning);
-               throw new IllegalArgumentException(warning);
+               txt.append(". Public render parameter definition not found for: ").append(prp);
+               LOG.warn(txt.toString());
+               portlet.removeSupportedPublicRenderParameter(prp);
             }
          }
          
@@ -949,10 +992,17 @@ public class JSR286ConfigurationProcessor extends JSR168ConfigurationProcessor {
          for (EventDefinitionReference edr : portlet.getSupportedPublishingEvents()) {
             QName qname = edr.getQualifiedName();
             if (pad.getEventDefinition(qname) == null) {
-               String warning = "Bad publishing event definition reference. No event definition found for qname: "
-                     + qname;
-               LOG.warn(warning);
-               throw new IllegalArgumentException(warning);
+               txt.setLength(0);
+               txt.append("Bad publishing event definition reference. No event definition found for qname: ");
+               txt.append(qname);
+               txt.append(". Valid QNames: ");
+               String sep = "";
+               for (EventDefinition def : pad.getEventDefinitions()) {
+                  txt.append(sep).append(def.getQName());
+                  sep = ", ";
+               }
+               LOG.warn(txt.toString());
+               portlet.removeSupportedPublishingEvent(edr);
             }
          }
          
@@ -960,10 +1010,17 @@ public class JSR286ConfigurationProcessor extends JSR168ConfigurationProcessor {
          for (EventDefinitionReference edr : portlet.getSupportedProcessingEvents()) {
             QName qname = edr.getQualifiedName();
             if (pad.getEventDefinition(qname) == null) {
-               String warning = "Bad processing event definition reference. No event definition found for qname: "
-                     + qname;
-               LOG.warn(warning);
-               throw new IllegalArgumentException(warning);
+               txt.setLength(0);
+               txt.append("Bad publishing event definition reference. No event definition found for qname: ");
+               txt.append(qname);
+               txt.append(". Valid QNames: ");
+               String sep = "";
+               for (EventDefinition def : pad.getEventDefinitions()) {
+                  txt.append(sep).append(def.getQName());
+                  sep = ", ";
+               }
+               LOG.warn(txt.toString());
+               portlet.removeSupportedProcessingEvent(edr);
             }
          }
          

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/0ceee24e/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 6a961df..a60a6f0 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
@@ -427,12 +427,12 @@ public class JSR362ConfigurationProcessor extends JSR286ConfigurationProcessor {
          List<PortletModeType> pmlist = st.getPortletMode();
          if (pmlist.size() == 0) {
             String info = "No portlet modes found in Supports block.";
-            LOG.info(info);
+            LOG.debug(info);
          }
          List<WindowStateType> wslist = st.getWindowState();
          if (wslist.size() == 0) {
             String info = "No window states found in Supports block.";
-            LOG.info(info);
+            LOG.debug(info);
          }
 
          // set up Supports
@@ -904,6 +904,7 @@ public class JSR362ConfigurationProcessor extends JSR286ConfigurationProcessor {
             DisplayName d = new DisplayNameImpl(Locale.forLanguageTag(ls.locale()), ls.value());
             evt.addDisplayName(d);
          }
+         evt.setValueType(ed.payloadType().getCanonicalName());
          pad.addEventDefinition(evt);
       }
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/0ceee24e/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
index 382efcb..48fdb99 100644
--- 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
@@ -269,6 +269,11 @@ public class PortletApplicationDefinitionImpl implements
       }
       portlets.add( pd);
    }
+   
+   @Override
+   public boolean removePortlet(PortletDefinition pd) {
+      return portlets.remove(pd);
+   }
 
    @Override
    public List<EventDefinition> getEventDefinitions() {
@@ -297,6 +302,11 @@ public class PortletApplicationDefinitionImpl implements
       }
       events.add(ed);
    }
+   
+   @Override
+   public boolean removeEventDefinition(EventDefinition ed) {
+      return events.remove(ed);
+   }
 
    @Override
    public PublicRenderParameter getPublicRenderParameter(String identifier) {
@@ -334,6 +344,11 @@ public class PortletApplicationDefinitionImpl implements
       }
       prps.add(prp);
    }
+   
+   @Override
+   public boolean removePublicRenderParameter(PublicRenderParameter prp) {
+      return prps.remove(prp);
+   }
 
    @Override
    public CustomPortletMode getCustomPortletMode(String arg) {
@@ -362,6 +377,11 @@ public class PortletApplicationDefinitionImpl implements
       }
       cpms.add(cpm);
    }
+   
+   @Override
+   public boolean removeCustomPortletMode(CustomPortletMode pm) {
+      return cpms.remove(pm);
+   }
 
    @Override
    public CustomWindowState getCustomWindowState(String arg) {
@@ -390,6 +410,11 @@ public class PortletApplicationDefinitionImpl implements
       }
       cwss.add(cws);
    }
+   
+   @Override
+   public boolean removeCustomWindowState(CustomWindowState ws) {
+      return cwss.remove(ws);
+   }
 
    @Override
    public UserAttribute getUserAttribute(String arg) {
@@ -418,6 +443,11 @@ public class PortletApplicationDefinitionImpl implements
       }
       uattrs.add(ua);
    }
+   
+   @Override
+   public boolean removeUserAttribute(UserAttribute ua) {
+      return uattrs.remove(ua);
+   }
 
    @Override
    public Filter getFilter(String arg) {
@@ -451,6 +481,11 @@ public class PortletApplicationDefinitionImpl implements
          LOG.debug("No filter class for filter: " + filter.getFilterName());
       }
    }
+   
+   @Override
+   public boolean removeFilter(Filter filter) {
+      return filters.remove(filter);
+   }
 
    @Override
    public FilterMapping getFilterMapping(String arg) {
@@ -484,6 +519,11 @@ public class PortletApplicationDefinitionImpl implements
          LOG.debug("No portlet names for filter mapping. Filter name: " + fm.getFilterName());
       }
    }
+   
+   @Override
+   public boolean removeFilterMapping(FilterMapping fm) {
+      return fmaps.remove(fm);
+   }
 
    @Override
    public ContainerRuntimeOption getContainerRuntimeOption(String arg) {
@@ -512,6 +552,11 @@ public class PortletApplicationDefinitionImpl implements
       }
       cros.add(cro);
    }
+   
+   @Override
+   public boolean removeRuntimeOption(ContainerRuntimeOption cro) {
+      return cros.remove(cro);
+   }
 
    @Override
    public List<Listener> getListeners() {
@@ -529,6 +574,11 @@ public class PortletApplicationDefinitionImpl implements
       }
       listeners.add(listener);
    }
+   
+   @Override
+   public boolean removeListener(Listener listener) {
+      return listeners.remove(listener);
+   }
 
    @Override
    public List<SecurityConstraint> getSecurityConstraints() {
@@ -548,6 +598,11 @@ public class PortletApplicationDefinitionImpl implements
    }
 
    @Override
+   public boolean removeSecurityCOnstraint(SecurityConstraint sc) {
+      return constraints.remove(sc);
+   }
+
+   @Override
    public Map<Locale, String> getLocaleEncodingMappings() {
       Map<Locale, String> lem = new HashMap<Locale, String>();
       for (Locale l : localemap.keySet()) {
@@ -560,5 +615,10 @@ public class PortletApplicationDefinitionImpl implements
    public void addLocaleEncodingMapping(Locale locale, String encoding) {
       localemap.put(locale, encoding);
    }
+   
+   @Override
+   public String removeLocaleEncodingMapping(Locale locale) {
+      return localemap.remove(locale);
+   }
 
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/0ceee24e/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
index 5437e62..7708180 100644
--- 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
@@ -259,6 +259,11 @@ public class PortletDefinitionImpl implements PortletDefinition {
       }
       proEvtRefs.add(edr);
    }
+   
+   @Override
+   public boolean removeSupportedProcessingEvent(EventDefinitionReference edr) {
+      return proEvtRefs.remove(edr);
+   }
 
    /* (non-Javadoc)
     * @see org.apache.pluto.container.om.portlet.PortletDefinition#getSupportedPublishingEvents()
@@ -278,6 +283,11 @@ public class PortletDefinitionImpl implements PortletDefinition {
       }
       pubEvtRefs.add(edr);
    }
+   
+   @Override
+   public boolean removeSupportedPublishingEvent(EventDefinitionReference edr) {
+      return pubEvtRefs.remove(edr);
+   }
 
    /* (non-Javadoc)
     * @see org.apache.pluto.container.om.portlet.PortletDefinition#getSupportedPublicRenderParameters()
@@ -297,6 +307,11 @@ public class PortletDefinitionImpl implements PortletDefinition {
       }
       pubParms.add(identifier);
    }
+   
+   @Override
+   public boolean removeSupportedPublicRenderParameter(String identifier) {
+      return pubParms.remove(identifier);
+   }
 
    /* (non-Javadoc)
     * @see org.apache.pluto.container.om.portlet.PortletDefinition#getResourceBundle()