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 at...@apache.org on 2008/10/31 19:05:23 UTC

svn commit: r709513 - in /portals/pluto/branches/2.0-spi-refactoring: pluto-container-api/src/main/java/org/apache/pluto/core/ pluto-container/src/main/java/org/apache/pluto/internal/impl/ pluto-portal/src/main/webapp/WEB-INF/themes/

Author: ate
Date: Fri Oct 31 11:05:23 2008
New Revision: 709513

URL: http://svn.apache.org/viewvc?rev=709513&view=rev
Log:
PLUTO-481 - Pluto 2.0 Refactoring Initiative
See: http://issues.apache.org/jira/browse/PLUTO-481
Several small fixes:
- NPE in PortletPreferencesImpl when no Validator is defined
- Synchronizing on PortletServlet registration/destroy
- another JSP tag attribute encoding issue (Tomcat really is not allowing these errors anymore)

Modified:
    portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/PortletServlet.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletPreferencesImpl.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-portal/src/main/webapp/WEB-INF/themes/portlet-skin.jsp

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/PortletServlet.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/PortletServlet.java?rev=709513&r1=709512&r2=709513&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/PortletServlet.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/PortletServlet.java Fri Oct 31 11:05:23 2008
@@ -136,12 +136,15 @@
         {
             public void run()
             {
-                if (startTimer != null)
+                synchronized(servletContext)
                 {
-                    if (attemptRegistration(servletContext, paClassLoader ))
+                    if (startTimer != null)
                     {
-                        startTimer.cancel();
-                        startTimer = null;
+                        if (attemptRegistration(servletContext, paClassLoader ))
+                        {
+                            startTimer.cancel();
+                            startTimer = null;
+                        }
                     }
                 }
             }
@@ -198,21 +201,24 @@
 
     public void destroy()
     {
-        if ( startTimer != null )
+        synchronized(getServletContext())
         {
-          startTimer.cancel();
-          startTimer = null;
-        }
-        else if ( started )
-        {
-          started = false;
-          registryService.unregister(portletContext);
-          if (portlet != null)
-          {
-              portlet.destroy();
-          }
+            if ( startTimer != null )
+            {
+              startTimer.cancel();
+              startTimer = null;
+            }
+            else if ( started && portletContext != null)
+            {
+              started = false;
+              contextService.unregister(portletContext);
+              if (portlet != null)
+              {
+                  portlet.destroy();
+              }
+            }
+            super.destroy();
         }
-        super.destroy();
     }
 
     protected void doGet(HttpServletRequest request,

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletPreferencesImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletPreferencesImpl.java?rev=709513&r1=709512&r2=709513&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletPreferencesImpl.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletPreferencesImpl.java Fri Oct 31 11:05:23 2008
@@ -24,6 +24,7 @@
 import java.util.Vector;
 
 import javax.portlet.PortletPreferences;
+import javax.portlet.PreferencesValidator;
 import javax.portlet.ReadOnlyException;
 import javax.portlet.ValidatorException;
 
@@ -274,7 +275,11 @@
         //   If the preferences cannot pass the validation,
         //   an ValidatorException will be thrown out.
         PortletDefinition portletD = window.getPortletEntity().getPortletDefinition();
-       	preferencesService.getPreferencesValidator(portletD).validate(this);
+        PreferencesValidator validator = preferencesService.getPreferencesValidator(portletD);
+        if (validator != null)
+        {
+            validator.validate(this);
+        }
         // Store the portlet preferences.
         try {
         	preferencesService.store(window, request, preferences);

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-portal/src/main/webapp/WEB-INF/themes/portlet-skin.jsp
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-portal/src/main/webapp/WEB-INF/themes/portlet-skin.jsp?rev=709513&r1=709512&r2=709513&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-portal/src/main/webapp/WEB-INF/themes/portlet-skin.jsp (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-portal/src/main/webapp/WEB-INF/themes/portlet-skin.jsp Fri Oct 31 11:05:23 2008
@@ -35,9 +35,9 @@
 	      <pluto:modeDropDown />
 	
 	      <!-- Window State Controls -->
-	      <pluto:windowStateAnchor windowState="minimized" icon="<%= request.getContextPath() + "/images/controls/min.png"%>" />
-	      <pluto:windowStateAnchor windowState="maximized" icon="<%= request.getContextPath() + "/images/controls/max.png"%>" />
-	      <pluto:windowStateAnchor windowState="normal" icon="<%= request.getContextPath() + "/images/controls/norm.png"%>" />
+	      <pluto:windowStateAnchor windowState="minimized" icon='<%= request.getContextPath() + "/images/controls/min.png"%>' />
+	      <pluto:windowStateAnchor windowState="maximized" icon='<%= request.getContextPath() + "/images/controls/max.png"%>' />
+	      <pluto:windowStateAnchor windowState="normal" icon='<%= request.getContextPath() + "/images/controls/norm.png"%>' />
     	</td>
     	</tr>
     </table>