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/aggregator/impl PageAggregatorImpl.java
Date Sat, 08 May 2004 02:14:03 GMT
taylor      2004/05/07 19:14:03

  Modified:    portal/src/java/org/apache/jetspeed/layout
                        LayoutPortlet.java
               portal/src/java/org/apache/jetspeed/velocity
                        JetspeedPowerTool.java
               portal/src/java/org/apache/jetspeed/aggregator/impl
                        PageAggregatorImpl.java
  Log:
  fixed bug in maximize state where the portal header/footers were dropping out
  
  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.8       +19 -2     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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- LayoutPortlet.java	8 May 2004 01:15:46 -0000	1.7
  +++ LayoutPortlet.java	8 May 2004 02:14:03 -0000	1.8
  @@ -59,7 +59,14 @@
           request.setAttribute("page", getPage(request));
           request.setAttribute("fragment", getFragment(request, maximized));
           request.setAttribute("dispatcher", getDispatcher(request));
  -
  +        if (maximized)
  +        {
  +            request.setAttribute("layout", getMaximizedLayout(request));
  +        }
  +        else
  +        {
  +            request.setAttribute("layout", getFragment(request, false));
  +        }
           // now invoke the JSP associated with this portlet
           JetspeedPowerTool jpt = new JetspeedPowerTool(request, response, getPortletConfig());
           PortletPreferences prefs = request.getPreferences();
  @@ -96,7 +103,8 @@
           super.doView(request, response);
   
           request.removeAttribute("page");
  -        request.removeAttribute("fragment");
  +        request.removeAttribute("fragment");        
  +        request.removeAttribute("layout");
           request.removeAttribute("dispatcher");
       }
   
  @@ -110,6 +118,15 @@
           return fragment;
       }
   
  +    protected Fragment getMaximizedLayout(RenderRequest request)
  +    {
  +        // Very ugly and Pluto dependant but I don't see anything better right now
  +        ServletRequest innerRequest = ((HttpServletRequestWrapper) request).getRequest();
  +        String attribute = "org.apache.jetspeed.maximized.Layout" ;
  +        Fragment fragment = (Fragment) innerRequest.getAttribute(attribute);
  +        return fragment;        
  +    }    
  +    
       protected Page getPage(RenderRequest request)
       {
           // Very ugly and Pluto dependant but I don't see anything better right now
  
  
  
  1.13      +25 -4     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/velocity/JetspeedPowerTool.java
  
  Index: JetspeedPowerTool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/velocity/JetspeedPowerTool.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- JetspeedPowerTool.java	7 May 2004 02:40:36 -0000	1.12
  +++ JetspeedPowerTool.java	8 May 2004 02:14:03 -0000	1.13
  @@ -99,6 +99,8 @@
       private static final String COLUMNS_ATTR = "columns";
       public static final String PAGE_ATTR = "page";
       public static final String FRAGMENT_ATTR = "fragment";
  +    public static final String LAYOUT_ATTR = "layout";
  +    
       public static final String HIDDEN = "hidden";
   
       public static final String LAYOUT_TEMPLATE_TYPE = "layout";
  @@ -258,7 +260,7 @@
           checkState();
           return (Fragment) renderRequest.getAttribute(FRAGMENT_ATTR);
       }
  -
  +    
       /**
        * 
        * @param f
  @@ -268,7 +270,25 @@
           checkState();
           renderRequest.setAttribute(FRAGMENT_ATTR, f);
       }
  -
  +    
  +    public void setCurrentLayout()
  +    {
  +        checkState();
  +        RequestContext context = Jetspeed.getCurrentRequestContext();
  +        Fragment f = (Fragment)context.getRequest().getAttribute(LAYOUT_ATTR);
  +        renderRequest.setAttribute(LAYOUT_ATTR, f);        
  +    }
  +    
  +    /**
  +     * 
  +     * @return
  +     */
  +    public Fragment getCurrentLayout()
  +    {
  +        checkState();
  +        return (Fragment) renderRequest.getAttribute(LAYOUT_ATTR);
  +    }
  +    
       /**
        * 
        * @return
  @@ -489,7 +509,8 @@
               fragmentStack.push(getCurrentFragment());
           }
           setCurrentFragment(f);
  -
  +        setCurrentLayout();
  +        
           String decoratorPath = decorator + "/" + DECORATOR_TYPE + ext;
           TemplateDescriptor template = null;
           try
  
  
  
  1.5       +6 -2      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PageAggregatorImpl.java	8 May 2004 01:15:46 -0000	1.4
  +++ PageAggregatorImpl.java	8 May 2004 02:14:03 -0000	1.5
  @@ -146,8 +146,12 @@
                   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().setAttribute("org.apache.jetspeed.maximized.Layout",
page.getRootFragment());
  +                    
  +                    renderer.renderNow(page.getRootFragment(), context);
  +                    
                       context.getRequest().removeAttribute("org.apache.jetspeed.maximized.Fragment");
  +                    context.getRequest().removeAttribute("org.apache.jetspeed.maximized.Layout");
                   }
                   return;
               }
  
  
  

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