portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/url/impl PortalControlParameter.java
Date Sat, 08 May 2004 01:15:46 GMT
taylor      2004/05/07 18:15:46

  Modified:    portal/src/java/org/apache/jetspeed/container/session
                        NavigationalStateComponent.java
                        NavigationalState.java
               portal/src/java/org/apache/jetspeed/layout
                        LayoutPortlet.java MultiColumnPortlet.java
               portal/src/java/org/apache/jetspeed/container/session/impl
                        JetspeedNavigationalStateComponent.java
                        PathNavigationalState.java
                        SessionNavigationalState.java
               portal/src/java/org/apache/jetspeed/request
                        JetspeedRequestContext.java RequestContext.java
               portal/src/java/org/apache/jetspeed/aggregator/impl
                        PageAggregatorImpl.java
               portal/src/java/org/apache/jetspeed/container/url/impl
                        PortalControlParameter.java
  Added:       portal/src/java/org/apache/jetspeed/container/session
                        PageState.java
               portal/src/java/org/apache/jetspeed/container/session/impl
                        PageStateImpl.java
  Log:
  maximize state initial implementation
  this implementation keeps maximized state on a per page basis
  
  PR:
  Obtained from:
  Submitted by:	
  Reviewed by:	
  CVS: ----------------------------------------------------------------------
  CVS: PR:
  CVS:   If this change addresses a PR in the problem report tracking
  CVS:   database, then enter the PR number(s) here.
  CVS: Obtained from:
  CVS:   If this change has been taken from another system, such as NCSA,
  CVS:   then name the system in this line, otherwise delete it.
  CVS: Submitted by:
  CVS:   If this code has been contributed to Apache by someone else; i.e.,
  CVS:   they sent us a patch or a new module, then include their name/email
  CVS:   address here. If this is your work then delete this line.
  CVS: Reviewed by:
  CVS:   If we are doing pre-commit code reviews and someone else has
  CVS:   reviewed your changes, include their name(s) here.
  CVS:   If you have not had it reviewed then delete this line.
  
  Revision  Changes    Path
  1.6       +3 -3      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/session/NavigationalStateComponent.java
  
  Index: NavigationalStateComponent.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/session/NavigationalStateComponent.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- NavigationalStateComponent.java	7 May 2004 02:40:36 -0000	1.5
  +++ NavigationalStateComponent.java	8 May 2004 01:15:46 -0000	1.6
  @@ -104,7 +104,7 @@
        * @param name The string representation of the window state.
        * @return The corresponding WindowState object
        */
  -    //WindowState lookupWindowState(String name);
  +    WindowState lookupWindowState(String name);
   
       /**
        * Given a portlet mode name, look up its object.
  @@ -114,6 +114,6 @@
        * @param name The string representation of the portlet mode.
        * @return The corresponding PortletMode object
        */    
  -    //PortletMode lookupPortletMode(String name);
  +    PortletMode lookupPortletMode(String name);
       
   }
  
  
  
  1.10      +12 -1     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/session/NavigationalState.java
  
  Index: NavigationalState.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/session/NavigationalState.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- NavigationalState.java	4 May 2004 22:05:17 -0000	1.9
  +++ NavigationalState.java	8 May 2004 01:15:46 -0000	1.10
  @@ -18,6 +18,7 @@
   import javax.portlet.PortletMode;
   import javax.portlet.WindowState;
   
  +import org.apache.jetspeed.om.page.Page;
   import org.apache.jetspeed.request.RequestContext;
   import org.apache.pluto.om.window.PortletWindow;
   
  @@ -91,5 +92,15 @@
        * @param context 
        */
       void init(RequestContext context);
  +    
  +    
  +    /**
  +     * For a given page, return the maximized window or
  +     * return null no windows are maximized.
  +     * 
  +     * @param page
  +     * @return The maximized window or null
  +     */
  +    PortletWindow getMaximizedWindow(Page page);
       
   }
  
  
  
  1.1                  jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/session/PageState.java
  
  Index: PageState.java
  ===================================================================
  /*
   * Copyright 2000-2001,2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.jetspeed.container.session;
  
  import org.apache.pluto.om.window.PortletWindow;
  
  /**
   * PageState
   *
   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
   * @version $Id: PageState.java,v 1.1 2004/05/08 01:15:46 taylor Exp $
   */
  public interface PageState
  {
      boolean isMaximized();
      
      void setMaximizedWindow(PortletWindow maximized);
      
  }
  
  
  
  1.7       +27 -6     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/layout/LayoutPortlet.java
  
  Index: LayoutPortlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/layout/LayoutPortlet.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- LayoutPortlet.java	8 Mar 2004 00:27:56 -0000	1.6
  +++ LayoutPortlet.java	8 May 2004 01:15:46 -0000	1.7
  @@ -27,11 +27,14 @@
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  +import org.apache.jetspeed.Jetspeed;
   import org.apache.jetspeed.aggregator.ContentDispatcher;
   import org.apache.jetspeed.locator.TemplateLocatorException;
   import org.apache.jetspeed.om.page.Fragment;
   import org.apache.jetspeed.om.page.Page;
  +import org.apache.jetspeed.request.RequestContext;
   import org.apache.jetspeed.velocity.JetspeedPowerTool;
  +import org.apache.pluto.om.window.PortletWindow;
   
   /**
    */
  @@ -49,8 +52,12 @@
       {
           response.setContentType("text/html");
   
  +        RequestContext context = Jetspeed.getCurrentRequestContext();
  +        PortletWindow window = context.getNavigationalState().getMaximizedWindow(context.getPage());
  +        boolean maximized = (window != null);
  +        
           request.setAttribute("page", getPage(request));
  -        request.setAttribute("fragment", getFragment(request));
  +        request.setAttribute("fragment", getFragment(request, maximized));
           request.setAttribute("dispatcher", getDispatcher(request));
   
           // now invoke the JSP associated with this portlet
  @@ -61,9 +68,22 @@
               String absViewPage = null;
               try
               {
  -                String viewPage = prefs.getValue(PARAM_VIEW_PAGE, "columns");
  -                // Need to retreive layout.properties instead of hard-coding ".vm" 
  -                absViewPage = jpt.getTemplate(viewPage+"/"+JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE+".vm",
JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE).getAppRelativePath();
  +                if (maximized)
  +                {
  +                    String viewPage = prefs.getValue(PARAM_MAX_PAGE, "maximized");
  +                    
  +                    // TODO: Need to retreive layout.properties instead of hard-coding
".vm" 
  +                    absViewPage = jpt.getTemplate(viewPage+"/"+JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE+".vm",

  +                                                  JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE).getAppRelativePath();
                   
  +                }
  +                else
  +                {
  +                    String viewPage = prefs.getValue(PARAM_VIEW_PAGE, "columns");
  +                    
  +                    // TODO: Need to retreive layout.properties instead of hard-coding
".vm" 
  +                    absViewPage = jpt.getTemplate(viewPage+"/"+JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE+".vm",

  +                                                  JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE).getAppRelativePath();
  +                }
                   log.debug("Path to view page for LayoutPortlet "+absViewPage);
                   request.setAttribute(PARAM_VIEW_PAGE, absViewPage);
               }
  @@ -80,11 +100,12 @@
           request.removeAttribute("dispatcher");
       }
   
  -    protected Fragment getFragment(RenderRequest request)
  +    protected Fragment getFragment(RenderRequest request, boolean maximized)
       {
           // Very ugly and Pluto dependant but I don't see anything better right now
           ServletRequest innerRequest = ((HttpServletRequestWrapper) request).getRequest();
  -        Fragment fragment = (Fragment) innerRequest.getAttribute("org.apache.jetspeed.Fragment");
  +        String attribute = (maximized) ? "org.apache.jetspeed.maximized.Fragment" : "org.apache.jetspeed.Fragment";
  +        Fragment fragment = (Fragment) innerRequest.getAttribute(attribute);
   
           return fragment;
       }
  
  
  
  1.5       +15 -1     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/layout/MultiColumnPortlet.java
  
  Index: MultiColumnPortlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/layout/MultiColumnPortlet.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MultiColumnPortlet.java	25 Mar 2004 21:39:23 -0000	1.4
  +++ MultiColumnPortlet.java	8 May 2004 01:15:46 -0000	1.5
  @@ -27,8 +27,12 @@
   import javax.portlet.PortletException;
   import javax.portlet.RenderRequest;
   import javax.portlet.RenderResponse;
  +
  +import org.apache.jetspeed.Jetspeed;
   import org.apache.jetspeed.om.page.Fragment;
   import org.apache.jetspeed.om.page.Property;
  +import org.apache.jetspeed.request.RequestContext;
  +import org.apache.pluto.om.window.PortletWindow;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   
  @@ -60,7 +64,17 @@
       public void doView(RenderRequest request, RenderResponse response)
       throws PortletException, IOException
       {
  -        List[] columns = buildColumns(getFragment(request), this.numColumns);
  +        RequestContext context = Jetspeed.getCurrentRequestContext();
  +        PortletWindow window = context.getNavigationalState().getMaximizedWindow(context.getPage());
  +        
  +        // if (targetState != null && targetState.isMaximized())
  +        if (window != null)
  +        {
  +            super.doView(request,response);
  +            return;
  +        }
  +        
  +        List[] columns = buildColumns(getFragment(request, false), this.numColumns);
   
           request.setAttribute("columns", columns);
   
  
  
  
  1.7       +36 -1     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/session/impl/JetspeedNavigationalStateComponent.java
  
  Index: JetspeedNavigationalStateComponent.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/session/impl/JetspeedNavigationalStateComponent.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JetspeedNavigationalStateComponent.java	7 May 2004 02:40:36 -0000	1.6
  +++ JetspeedNavigationalStateComponent.java	8 May 2004 01:15:46 -0000	1.7
  @@ -19,6 +19,8 @@
   import java.lang.reflect.Field;
   import java.util.StringTokenizer;
   
  +import javax.portlet.PortletMode;
  +import javax.portlet.WindowState;
   import javax.servlet.http.HttpSession;
   
   import org.apache.commons.logging.Log;
  @@ -200,4 +202,37 @@
           return tokenizer.nextToken();                
       }
           
  +    public WindowState lookupWindowState(String name)
  +    {
  +        if (name.equals(WindowState.MAXIMIZED.toString()))
  +        {
  +            return WindowState.MAXIMIZED;
  +        }
  +        else if (name.equals(WindowState.MAXIMIZED.toString()))
  +        {
  +            return WindowState.MINIMIZED;
  +        }
  +        else if (name.equals(WindowState.NORMAL.toString()))
  +        {
  +            return WindowState.NORMAL;
  +        }
  +        return new WindowState(name);
  +    }
  +
  +    public PortletMode lookupPortletMode(String name)
  +    {
  +        if (name.equals(PortletMode.VIEW.toString()))
  +        {
  +            return PortletMode.VIEW;
  +        }        
  +        else if (name.equals(PortletMode.EDIT.toString()))
  +        {
  +            return PortletMode.EDIT;
  +        }
  +        else if (name.equals(PortletMode.HELP.toString()))
  +        {
  +            return PortletMode.HELP;
  +        }        
  +        return new PortletMode(name);
  +    }
   }
  
  
  
  1.10      +40 -1     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/session/impl/PathNavigationalState.java
  
  Index: PathNavigationalState.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/session/impl/PathNavigationalState.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- PathNavigationalState.java	7 Apr 2004 03:55:00 -0000	1.9
  +++ PathNavigationalState.java	8 May 2004 01:15:46 -0000	1.10
  @@ -15,12 +15,19 @@
    */
   package org.apache.jetspeed.container.session.impl;
   
  +import java.util.Iterator;
  +import java.util.Map;
  +
   import javax.portlet.PortletMode;
   import javax.portlet.WindowState;
   
  +import org.apache.jetspeed.Jetspeed;
   import org.apache.jetspeed.container.session.NavigationalState;
   import org.apache.jetspeed.container.session.NavigationalStateComponent;
   import org.apache.jetspeed.container.url.PortalURL;
  +import org.apache.jetspeed.container.url.impl.PortalControlParameter;
  +import org.apache.jetspeed.container.window.PortletWindowAccessor;
  +import org.apache.jetspeed.om.page.Page;
   import org.apache.jetspeed.request.RequestContext;
   import org.apache.pluto.om.window.PortletWindow;
   
  @@ -88,5 +95,37 @@
       public void sync()
       {
           // do nothing
  +    }
  +    
  +    public PortletWindow getMaximizedWindow(Page page)
  +    {
  +        PortalControlParameter pcp = url.getControlParameters();
  +        Iterator stateful = pcp.getStateFullControlParameter().entrySet().iterator();
  +        while (stateful.hasNext())
  +        {
  +            Map.Entry entry = (Map.Entry)stateful.next();
  +            String key = (String)entry.getKey();
  +            String windowId = nav.getWindowIdFromKey(key);
  +            if (null == windowId)
  +            {
  +                continue;
  +            }
  +            if (key.startsWith(nav.getNavigationKey(NavigationalStateComponent.STATE)))
  +            {
  +                String windowState = (String)entry.getValue();
  +                WindowState state = nav.lookupWindowState(windowState);
  +                
  +                if (state == WindowState.MAXIMIZED)
  +                {
  +                    PortletWindowAccessor accessor = (PortletWindowAccessor) Jetspeed.getComponentManager().getComponent(PortletWindowAccessor.class);
  +                    PortletWindow window = accessor.getPortletWindow(windowId);
  +                    return window;
  +                }
  +                else
  +                {
  +                }
  +            }
  +        }
  +        return null;
       }
   }
  
  
  
  1.12      +32 -6     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/session/impl/SessionNavigationalState.java
  
  Index: SessionNavigationalState.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/session/impl/SessionNavigationalState.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SessionNavigationalState.java	4 May 2004 22:05:17 -0000	1.11
  +++ SessionNavigationalState.java	8 May 2004 01:15:46 -0000	1.12
  @@ -22,10 +22,13 @@
   import javax.portlet.PortletMode;
   import javax.portlet.WindowState;
   
  +import org.apache.jetspeed.Jetspeed;
   import org.apache.jetspeed.container.session.NavigationalState;
   import org.apache.jetspeed.container.session.NavigationalStateComponent;
   import org.apache.jetspeed.container.url.PortalURL;
   import org.apache.jetspeed.container.url.impl.PortalControlParameter;
  +import org.apache.jetspeed.container.window.PortletWindowAccessor;
  +import org.apache.jetspeed.om.page.Page;
   import org.apache.jetspeed.request.RequestContext;
   import org.apache.pluto.om.window.PortletWindow;
   
  @@ -46,6 +49,7 @@
       private Map pstates;
       private Map pmodes;
       private String portalPath = null;
  +    private Map pages;
   
       static public final boolean SESSION_BASED = true;
       
  @@ -56,7 +60,8 @@
           states = new HashMap();
           modes = new HashMap();
           pstates = new HashMap();            
  -        pmodes = new HashMap(); 
  +        pmodes = new HashMap();
  +        pages = new HashMap();
       }
           
       public WindowState getState(PortletWindow window) 
  @@ -145,7 +150,22 @@
                   {
                       pstates.put(windowId, previousState);
                   }
  -                states.put(windowId, new WindowState (windowState));
  +                WindowState state = nav.lookupWindowState(windowState);
  +                states.put(windowId, state);
  +                
  +                if (state == WindowState.MAXIMIZED)
  +                {
  +                    PortletWindowAccessor accessor = (PortletWindowAccessor) Jetspeed.getComponentManager().getComponent(PortletWindowAccessor.class);
  +                    PortletWindow window = accessor.getPortletWindow(windowId);
  +                    
  +                    Page page = context.getPage();
  +                    pages.put(page.getId(), window);
  +                }
  +                else
  +                {
  +                    Page page = context.getPage();
  +                    pages.put(page.getId(), null);
  +                }
                   // System.out.println("STATE UPDATED = " + windowId + ", = " + windowState);
               
               }
               else if (key.startsWith(nav.getNavigationKey(NavigationalStateComponent.MODE)))
  @@ -156,11 +176,17 @@
                   {
                       pmodes.put(windowId, previousMode);
                   }
  -                modes.put(windowId, new PortletMode(mode));
  +                PortletMode portletMode = nav.lookupPortletMode(mode);
  +                modes.put(windowId, portletMode);
  +                PortletWindowAccessor accessor = (PortletWindowAccessor) Jetspeed.getComponentManager().getComponent(PortletWindowAccessor.class);
  +                PortletWindow window = accessor.getPortletWindow(windowId);
                   // System.out.println("MODE UPDATED = " + windowId + ", = " + mode);
  -            }
  -            
  +            }           
           }
       }
       
  +    public PortletWindow getMaximizedWindow(Page page)
  +    {
  +        return (PortletWindow)pages.get(page.getId());
  +    }
   }
  
  
  
  1.1                  jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/session/impl/PageStateImpl.java
  
  Index: PageStateImpl.java
  ===================================================================
  /*
   * Copyright 2000-2001,2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.jetspeed.container.session.impl;
  
  import org.apache.jetspeed.container.session.PageState;
  import org.apache.pluto.om.window.PortletWindow;
  
  /**
   * PageStateImpl
   *
   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
   * @version $Id: PageStateImpl.java,v 1.1 2004/05/08 01:15:46 taylor Exp $
   */
  public class PageStateImpl implements PageState
  {
      private PortletWindow maximized = null;
  
      public boolean isMaximized()
      {
          return (maximized != null);
      }
  
      public void setMaximizedWindow(PortletWindow maximized)
      {
          this.maximized = maximized;
      }
  }
  
  
  
  1.17      +3 -2      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/request/JetspeedRequestContext.java
  
  Index: JetspeedRequestContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/request/JetspeedRequestContext.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- JetspeedRequestContext.java	4 May 2004 22:05:18 -0000	1.16
  +++ JetspeedRequestContext.java	8 May 2004 01:15:46 -0000	1.17
  @@ -66,6 +66,7 @@
       private PortletWindow actionWindow;
       private String encoding;
       private String requestPath = null;
  +               
       
       public final static String REQUEST_PORTALENV = "org.apache.jetspeed.request.RequestContext";
   
  @@ -426,5 +427,5 @@
       {
           return url;
       }
  -    
  +            
   }
  
  
  
  1.12      +2 -1      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/request/RequestContext.java
  
  Index: RequestContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/request/RequestContext.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- RequestContext.java	6 Apr 2004 19:57:38 -0000	1.11
  +++ RequestContext.java	8 May 2004 01:15:46 -0000	1.12
  @@ -328,4 +328,5 @@
        * @return the path
        */
       String getPath();
  +        
   }
  
  
  
  1.4       +19 -1     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/aggregator/impl/PageAggregatorImpl.java
  
  Index: PageAggregatorImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/aggregator/impl/PageAggregatorImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PageAggregatorImpl.java	7 May 2004 13:44:00 -0000	1.3
  +++ PageAggregatorImpl.java	8 May 2004 01:15:46 -0000	1.4
  @@ -20,16 +20,19 @@
   import java.util.List;
   import java.util.Stack;
   
  +
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.apache.jetspeed.aggregator.ContentDispatcher;
   import org.apache.jetspeed.aggregator.PageAggregator;
   import org.apache.jetspeed.aggregator.PortletRenderer;
  +import org.apache.jetspeed.container.session.NavigationalState;
   import org.apache.jetspeed.contentserver.ContentFilter;
   import org.apache.jetspeed.exception.JetspeedException;
   import org.apache.jetspeed.om.page.Page;
   import org.apache.jetspeed.om.page.Fragment;
   import org.apache.jetspeed.request.RequestContext;
  +import org.apache.pluto.om.window.PortletWindow;
   import org.picocontainer.Startable;
   
   /**
  @@ -134,6 +137,21 @@
   
           if (checkAccess(context, (currentFragment.getAcl() != null) ? currentFragment.getAcl()
: acl, "render"))
           {
  +            // handle maximized state
  +            NavigationalState nav = context.getNavigationalState();
  +            PortletWindow window = nav.getMaximizedWindow(context.getPage());
  +            if (null != window)
  +            {
  +                Fragment fragment = page.getFragmentById(window.getId().toString());
  +                if (checkAccess(context, (fragment.getAcl() != null) ? fragment.getAcl()
: acl, "render"))
  +                {
  +                    context.getRequest().setAttribute("org.apache.jetspeed.maximized.Fragment",
fragment);
  +                    renderer.renderNow(page.getRootFragment(), context);              
       
  +                    context.getRequest().removeAttribute("org.apache.jetspeed.maximized.Fragment");
  +                }
  +                return;
  +            }
  +            
               if (strategy == STRATEGY_PARALLEL)
               {
                   // initializes the rendering stack with root children
  
  
  
  1.6       +21 -5     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/url/impl/PortalControlParameter.java
  
  Index: PortalControlParameter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/url/impl/PortalControlParameter.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PortalControlParameter.java	7 Apr 2004 00:49:29 -0000	1.5
  +++ PortalControlParameter.java	8 May 2004 01:15:46 -0000	1.6
  @@ -78,9 +78,13 @@
       {
           String mode = (String) stateFullControlParameter.get(url.getModeKey(window));
           if (mode != null)
  -            return new PortletMode(mode);
  +        {
  +            return nav.lookupPortletMode(mode);
  +        }
           else
  +        {
               return PortletMode.VIEW;
  +        }
       }
   
       public PortletWindow getPortletWindowOfAction() 
  @@ -107,18 +111,26 @@
       {
           String mode = (String) stateFullControlParameter.get(url.getPrevModeKey(window));
           if (mode != null)
  -            return new PortletMode(mode);
  +        {
  +            return nav.lookupPortletMode(mode);
  +        }
           else
  +        {
               return null;
  +        }
       }
   
       public WindowState getPrevState(PortletWindow window)
       {
           String state = (String) stateFullControlParameter.get(url.getPrevStateKey(window));
           if (state != null)
  -            return new WindowState(state);
  +        {
  +            return nav.lookupWindowState(state);
  +        }
           else
  +        {
               return null;
  +        }
       }
       
       public Iterator getRenderParamNames(PortletWindow window)
  @@ -150,9 +162,13 @@
       {
           String state = (String) stateFullControlParameter.get(url.getStateKey(window));
           if (state != null)
  -            return new WindowState(state);
  +        {
  +            return nav.lookupWindowState(state);
  +        }
           else
  +        {
               return WindowState.NORMAL;
  +        }
       }
   
       public Map getStateFullControlParameter()
  
  
  

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