portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r601177 - in /portals/jetspeed-2/branches/JETSPEED-2.1.3/applications/j2-admin/src: java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java webapp/WEB-INF/portlet.xml
Date Wed, 05 Dec 2007 00:50:20 GMT
Author: taylor
Date: Tue Dec  4 16:50:19 2007
New Revision: 601177

URL: http://svn.apache.org/viewvc?rev=601177&view=rev
Log:
support edit_defaults on registration portlet
otherwise admins are simply setting up preferences for themselves which is quite useless

Modified:
    portals/jetspeed-2/branches/JETSPEED-2.1.3/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java
    portals/jetspeed-2/branches/JETSPEED-2.1.3/applications/j2-admin/src/webapp/WEB-INF/portlet.xml

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java?rev=601177&r1=601176&r2=601177&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java
(original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java
Tue Dec  4 16:50:19 2007
@@ -39,8 +39,10 @@
 import javax.portlet.PortletResponse;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
 
 import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.JetspeedActions;
 import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.administration.AdministrationEmailException;
 import org.apache.jetspeed.administration.PortalAdministration;
@@ -244,6 +246,24 @@
         doPreferencesEdit(request, response);
     }
     
+    protected void doDispatch(RenderRequest request, RenderResponse response) throws PortletException,
IOException
+    {
+        if ( !request.getWindowState().equals(WindowState.MINIMIZED))
+        {
+            PortletMode curMode = request.getPortletMode();            
+            if (JetspeedActions.EDIT_DEFAULTS_MODE.equals(curMode))
+            {
+                //request.setAttribute(PARAM_EDIT_PAGE, DEFAULT_EDIT_DEFAULTS_PAGE);
+                doEdit(request, response);
+            }
+            else
+            {
+                super.doDispatch(request, response);
+            }
+        }
+        
+    }
+    
     public void doView(RenderRequest request, RenderResponse response)
             throws PortletException, IOException
     {
@@ -497,7 +517,10 @@
         ResourceBundle resource = getPortletConfig().getResourceBundle(
                 actionRequest.getLocale());
 
-        if (actionRequest.getPortletMode() == PortletMode.EDIT)
+        PortletMode curMode = actionRequest.getPortletMode();
+       
+        if (curMode == PortletMode.EDIT ||
+            curMode.equals(JetspeedActions.EDIT_DEFAULTS_MODE))
         {
             PortletPreferences prefs = actionRequest.getPreferences();
             PreferencesHelper.requestParamsToPreferences(actionRequest);

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/applications/j2-admin/src/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/applications/j2-admin/src/webapp/WEB-INF/portlet.xml?rev=601177&r1=601176&r2=601177&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/applications/j2-admin/src/webapp/WEB-INF/portlet.xml
(original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/applications/j2-admin/src/webapp/WEB-INF/portlet.xml
Tue Dec  4 16:50:19 2007
@@ -1170,6 +1170,8 @@
         <mime-type>text/html</mime-type>
         <portlet-mode>VIEW</portlet-mode>
         <portlet-mode>EDIT</portlet-mode>
+        <!--  support custom edit_defaults mode -->
+        <portlet-mode>edit_defaults</portlet-mode>        
     </supports>
     <supported-locale>en</supported-locale>
     <supported-locale>ja</supported-locale>
@@ -1894,6 +1896,12 @@
       <keywords>admin,config,custom</keywords>
     </portlet-info>
   </portlet>
+  
+   <custom-portlet-mode>
+        <description>a Custom Edit_defaults Mode</description>            
+        <portlet-mode>edit_defaults</portlet-mode>
+    </custom-portlet-mode>
+  
   
 </portlet-app>
 



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message