You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by sy...@apache.org on 2002/03/22 23:26:13 UTC

cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap AggregateNode.java AggregateNodeBuilder.java SitemapLanguage.java

sylvain     02/03/22 14:26:13

  Modified:    src/java/org/apache/cocoon/components/treeprocessor/sitemap
                        AggregateNode.java AggregateNodeBuilder.java
                        SitemapLanguage.java
  Log:
  Fix bug #7196
  
  Revision  Changes    Path
  1.3       +12 -1     xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/AggregateNode.java
  
  Index: AggregateNode.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/AggregateNode.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AggregateNode.java	14 Mar 2002 11:05:58 -0000	1.2
  +++ AggregateNode.java	22 Mar 2002 22:26:13 -0000	1.3
  @@ -83,7 +83,7 @@
    * <a href="http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=100517130418424">here</a>.
    *
    * @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
  - * @version CVS $Id: AggregateNode.java,v 1.2 2002/03/14 11:05:58 sylvain Exp $
  + * @version CVS $Id: AggregateNode.java,v 1.3 2002/03/22 22:26:13 sylvain Exp $
    */
   
   public class AggregateNode extends AbstractProcessingNode {
  @@ -165,6 +165,17 @@
                       part.nsPrefix.resolve(mapStack)
                   );
               }
  +        }
  +        
  +        // Bug #7196 : Some parts matched the view : jump to that view
  +        if (actualParts != this.allParts) {
  +            ProcessingNode viewNode = (ProcessingNode)this.viewNodes.get(cocoonView);
  +            if (viewNode != null) {
  +                if (infoEnabled) {
  +                    getLogger().info("Jumping to view '" + cocoonView + "' from aggregate part at " + this.getLocation());
  +                }
  +                return viewNode.invoke(env, context);
  +            }            
           }
   
           // Check aggregate-level view
  
  
  
  1.3       +10 -1     xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/AggregateNodeBuilder.java
  
  Index: AggregateNodeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/AggregateNodeBuilder.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AggregateNodeBuilder.java	14 Mar 2002 11:05:58 -0000	1.2
  +++ AggregateNodeBuilder.java	22 Mar 2002 22:26:13 -0000	1.3
  @@ -64,7 +64,7 @@
   /**
    *
    * @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
  - * @version CVS $Id: AggregateNodeBuilder.java,v 1.2 2002/03/14 11:05:58 sylvain Exp $
  + * @version CVS $Id: AggregateNodeBuilder.java,v 1.3 2002/03/22 22:26:13 sylvain Exp $
    */
   
   public class AggregateNodeBuilder extends AbstractProcessingNodeBuilder
  @@ -88,6 +88,11 @@
   
           this.views = ((SitemapLanguage)this.treeBuilder).getViewsForStatement("", "", config);
           
  +        // Bug #7196 : ensure this.views is never null (see continuation of fix below)
  +        if (this.views == null) {
  +            this.views = new HashSet();
  +        }
  +        
           // The sitemap builder
           SitemapLanguage sitemap = (SitemapLanguage)this.treeBuilder;
   
  @@ -125,6 +130,10 @@
               
               // Associate this part to all the views it belongs to
               if (viewsForPart != null) {
  +                
  +                // Bug #7196 : add part view to aggregate views
  +                this.views.addAll(viewsForPart);
  +                
                   Iterator iter = viewsForPart.iterator();
                   while(iter.hasNext()) {
                       String currentView = (String)iter.next();
  
  
  
  1.3       +2 -2      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java
  
  Index: SitemapLanguage.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SitemapLanguage.java	17 Mar 2002 21:55:22 -0000	1.2
  +++ SitemapLanguage.java	22 Mar 2002 22:26:13 -0000	1.3
  @@ -82,7 +82,7 @@
    * The tree builder for the sitemap language.
    *
    * @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
  - * @version CVS $Id: SitemapLanguage.java,v 1.2 2002/03/17 21:55:22 sylvain Exp $
  + * @version CVS $Id: SitemapLanguage.java,v 1.3 2002/03/22 22:26:13 sylvain Exp $
    */
   
   public class SitemapLanguage extends DefaultTreeBuilder {
  @@ -322,7 +322,7 @@
        * @return association of names to views
        */
       public Map getViewNodes(Collection viewNames) throws Exception {
  -        if (viewNames == null) {
  +        if (viewNames == null || viewNames.size() == 0) {
               return null;
           }
   
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org