portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r393232 - in /portals/jetspeed-2/trunk: components/portal/src/java/org/apache/jetspeed/layout/impl/ChangePortletAction.java src/webapp/WEB-INF/assembly/ajax-layout.xml
Date Tue, 11 Apr 2006 14:29:14 GMT
Author: ate
Date: Tue Apr 11 07:29:13 2006
New Revision: 393232

URL: http://svn.apache.org/viewcvs?rev=393232&view=rev
Log:
JS2-523: Supporting custom PortletModes and WindowStates
Separated out commit of changes related to current AJAX desktop implementation in progress.
The Pluto PortalContextProvider isn't provided anymore, so it can't be used in the assembly
either.
See: http://issues.apache.org/jira/browse/JS2-523, especially 3.f) and the last remark.

David, Steve: please validate!  

Modified:
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/ChangePortletAction.java
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/ajax-layout.xml

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/ChangePortletAction.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/ChangePortletAction.java?rev=393232&r1=393231&r2=393232&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/ChangePortletAction.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/ChangePortletAction.java
Tue Apr 11 07:29:13 2006
@@ -30,7 +30,6 @@
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.page.PageManager;
 import org.apache.jetspeed.request.RequestContext;
-import org.apache.pluto.services.information.PortalContextProvider;
 
 /**
  * Move Portlet portlet placement action
@@ -54,7 +53,6 @@
 {
     protected Log log = LogFactory.getLog(ChangePortletAction.class);
     protected String action;
-    protected PortalContextProvider portalContext;
     protected Map validWindowStates = new HashMap();
     protected Map validPortletModes = new HashMap();
     
@@ -63,27 +61,39 @@
             String action)
     throws AJAXException    
     {
-        this(template, errorTemplate, action, null, null, null);
+        this(template, errorTemplate, action, null, null);
     }
     
     public ChangePortletAction(String template, 
                              String errorTemplate, 
                              String action,
                              PageManager pageManager,
-                             PortletActionSecurityBehavior securityBehavior,
-                             PortalContextProvider portalContext)
+                             PortletActionSecurityBehavior securityBehavior)
     throws AJAXException
     {
         super(template, errorTemplate, pageManager, securityBehavior);
         this.action = action;
-        this.portalContext = portalContext;
-        Iterator modes = this.portalContext.getSupportedPortletModes().iterator();      
 
+        
+        // Build the maps of allowed (internal) modes and states
+        Iterator modes = JetspeedActions.getStandardPortletModes().iterator();        
         while (modes.hasNext())
         {
             String mode = modes.next().toString();
             this.validPortletModes.put(mode, mode);
         }
-        Iterator states = this.portalContext.getSupportedWindowStates().iterator();     
  
+        modes = JetspeedActions.getExtendedPortletModes().iterator();
+        while (modes.hasNext())
+        {
+            String mode = modes.next().toString();
+            this.validPortletModes.put(mode, mode);
+        }
+        Iterator states = JetspeedActions.getStandardWindowStates().iterator();        
+        while (states.hasNext())
+        {
+            String state = states.next().toString();
+            this.validWindowStates.put(state, state);
+        }        
+        states = JetspeedActions.getExtendedWindowStates().iterator();        
         while (states.hasNext())
         {
             String state = states.next().toString();
@@ -188,6 +198,15 @@
 
         return success;
     }
+    
+    // TODO: The validWindowStates and validPortletModes maps only contain 
+    //       internal (portal level) valid modes and states.
+    //       *if* a pa defines a custom mode/state with a different name but
+    //       mapped onto a interal (portal) mode/state 
+    //       *then* first the real internal mode/state needs to be retrieved from the 
+    //       targetted portlet its application:
+    //       o.a.j.om.common.portlet.PortletApplication.getMappedMode(customMode) and
+    //       o.a.j.om.common.portlet.PortletApplication.getMappedState(customState)     
  
     
     protected boolean isValidWindowState(String windowState)
     {

Modified: portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/ajax-layout.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/ajax-layout.xml?rev=393232&r1=393231&r2=393232&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/ajax-layout.xml (original)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/ajax-layout.xml Tue Apr 11 07:29:13
2006
@@ -241,9 +241,6 @@
     <constructor-arg index='4'>
         <ref bean="PortletActionSecurityBehavior"/>        
     </constructor-arg>    	
-    <constructor-arg index='5'>
-        <ref bean="PortalContextProvider"/>        
-    </constructor-arg>    	        
 </bean>
 
 <bean id="AjaxGetMenus"



---------------------------------------------------------------------
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