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/portal/src/java/org/apache/jetspeed/aggregator PageAggregator.java
Date Sun, 14 Mar 2004 00:04:46 GMT
weaver      2004/03/13 16:04:46

  Modified:    portal/src/java/org/apache/jetspeed/aggregator
                        PageAggregator.java
  Log:
  PageAggreagtor now sets up decorator/content filter look up order based
  on the layout-decorator of the root fragment
  
  Revision  Changes    Path
  1.9       +33 -1     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/aggregator/PageAggregator.java
  
  Index: PageAggregator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/aggregator/PageAggregator.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- PageAggregator.java	8 Mar 2004 00:22:31 -0000	1.8
  +++ PageAggregator.java	14 Mar 2004 00:04:46 -0000	1.9
  @@ -15,12 +15,15 @@
    */
   package org.apache.jetspeed.aggregator;
   
  +import java.util.ArrayList;
   import java.util.Iterator;
  +import java.util.List;
   import java.util.Stack;
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.apache.jetspeed.Jetspeed;
  +import org.apache.jetspeed.contentserver.ContentFilter;
   import org.apache.jetspeed.cps.BaseCommonService;
   import org.apache.jetspeed.cps.CommonPortletServices;
   import org.apache.jetspeed.cps.CPSInitializationException;
  @@ -129,6 +132,35 @@
           {
               throw new JetspeedException("No root Fragment found in Page");
           }
  +        
  +        String layoutDecorator = currentFragment.getDecorator();
  +        if(layoutDecorator == null)
  +        {
  +            layoutDecorator = page.getDefaultDecorator(currentFragment.getType());
  +        }
  +        
  +        //TODO: Remove hard coding of locations and use CM + TL
  +        List contentPathes = (List) context.getSessionAttribute(ContentFilter.SESSION_CONTENT_PATH_ATTR);
  +        
  +        if(contentPathes == null)
  +        {
  +            contentPathes = new ArrayList(2);
  +            context.setSessionAttribute(ContentFilter.SESSION_CONTENT_PATH_ATTR, contentPathes);
  +        }
  +        
  +        if(contentPathes.size() < 1)
  +        {
  +            // define the lookup order
  +            contentPathes.add(currentFragment.getType()+"/html/"+layoutDecorator);
  +            contentPathes.add("portlet/html");
  +            contentPathes.add("generic/html");
  +            contentPathes.add("/html");
  +        }
  +        else
  +        {
  +            contentPathes.set(0, currentFragment.getType()+"/html/"+layoutDecorator);
  +        }
  +        
   
           if (checkAccess(context,(currentFragment.getAcl()!=null)?currentFragment.getAcl():acl,
"render"))
           {
  
  
  

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