portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/portlet ServletPortlet.java
Date Mon, 12 Jan 2004 18:12:44 GMT
weaver      2004/01/12 10:12:44

  Modified:    commons/src/java/org/apache/jetspeed/portlet
                        ServletPortlet.java
  Log:
  allow overriding of ViewPage by RenderRequest attribute
  
  Revision  Changes    Path
  1.3       +17 -4     jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/portlet/ServletPortlet.java
  
  Index: ServletPortlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/portlet/ServletPortlet.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ServletPortlet.java	31 Dec 2003 09:46:35 -0000	1.2
  +++ ServletPortlet.java	12 Jan 2004 18:12:44 -0000	1.3
  @@ -257,7 +257,10 @@
           if (this.allowPreferences == true)
           {
               PortletPreferences prefs = request.getPreferences();
  -            if (prefs != null)
  +            // allow ViewPage override by the request
  +            customPage = (String) request.getAttribute(PARAM_CUSTOM_PAGE);            
  +            
  +            if (prefs != null && customPage == null)
               {
                   customPage = prefs.getValue(PARAM_CUSTOM_PAGE, this.defaultCustomPage);
               }
  @@ -341,13 +344,23 @@
       throws PortletException, IOException
       {
           String viewPage = this.defaultViewPage;
  +        
  +         //	allow ViewPage override by the request
  +		String reqViewPage = (String) request.getAttribute(PARAM_VIEW_PAGE);
  +		if(reqViewPage != null)
  +		{
  +			viewPage = reqViewPage;
  +		}
  +		
           if (this.allowPreferences == true)
           {
               PortletPreferences prefs = request.getPreferences();
  -            if (prefs != null)
  +
  +            
  +            if (prefs != null && reqViewPage == null)
               {
                   viewPage = prefs.getValue(PARAM_VIEW_PAGE, this.defaultViewPage);
  -            }
  +            }          
           }
   
           if (viewPage != null)
  
  
  

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


Mime
View raw message