cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From un...@apache.org
Subject cvs commit: cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap GenerateNode.java ViewNode.java PipelineEventComponentProcessingNode.java
Date Tue, 27 Jan 2004 10:33:05 GMT
unico       2004/01/27 02:33:05

  Modified:    src/java/org/apache/cocoon/components/cprocessor
                        sitemap2xconf.xsl SimpleParentProcessingNode.java
                        ContainerNode.java NamedContainerNode.java
               src/java/org/apache/cocoon/components/cprocessor/sitemap
                        GenerateNode.java ViewNode.java
                        PipelineEventComponentProcessingNode.java
  Log:
  make views work
  
  Revision  Changes    Path
  1.6       +4 -4      cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap2xconf.xsl
  
  Index: sitemap2xconf.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap2xconf.xsl,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- sitemap2xconf.xsl	27 Jan 2004 09:05:09 -0000	1.5
  +++ sitemap2xconf.xsl	27 Jan 2004 10:32:59 -0000	1.6
  @@ -63,15 +63,15 @@
     </xsl:template>
     
     <xsl:template match="map:view">
  -    <xsl:param name="parent-id"/>
       <xsl:variable name="id">
  -      <xsl:value-of select="$parent-id"/>-<xsl:value-of select="position()"/>
  +      <xsl:text>v-</xsl:text>
  +      <xsl:value-of select="@name"/>
       </xsl:variable>
  -    <view-node id-ref="{$id}" logger="sitemap.processor">
  +    <view-node id="{$id}" logger="sitemap.processor">
         <xsl:apply-templates select="@*" mode="copy" />
         <xsl:for-each select="map:call|map:aggregate|map:generate|map:transform|map:serialize|map:read|map:mount|map:redirect-to">
           <xsl:element name="{local-name()}">
  -          <xsl:attribute name="id">
  +          <xsl:attribute name="id-ref">
               <xsl:value-of select="$id"/>-<xsl:value-of select="position()"/>
             </xsl:attribute>
           </xsl:element>
  
  
  
  1.2       +2 -5      cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/SimpleParentProcessingNode.java
  
  Index: SimpleParentProcessingNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/SimpleParentProcessingNode.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SimpleParentProcessingNode.java	28 Dec 2003 21:03:17 -0000	1.1
  +++ SimpleParentProcessingNode.java	27 Jan 2004 10:33:02 -0000	1.2
  @@ -50,8 +50,6 @@
   */
   package org.apache.cocoon.components.cprocessor;
   
  -import java.util.List;
  -
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.cocoon.environment.Environment;
  @@ -71,8 +69,7 @@
       
       public void configure(Configuration config) throws ConfigurationException {
           super.configure(config);
  -        final List childNodes = getChildNodesList(config);
  -        m_childNodes = (ProcessingNode[]) childNodes.toArray(new ProcessingNode[childNodes.size()]);
  +        m_childNodes = super.getChildNodes(config);
       }
           
       /**
  
  
  
  1.2       +6 -6      cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/ContainerNode.java
  
  Index: ContainerNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/ContainerNode.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ContainerNode.java	28 Dec 2003 21:03:17 -0000	1.1
  +++ ContainerNode.java	27 Jan 2004 10:33:02 -0000	1.2
  @@ -61,9 +61,9 @@
    * @version CVS $Id$
    * 
    * @avalon.component
  - * @avalon.service type="ProcessingNode"
  - * @x-avalon.lifestyle type="singleton"
  - * @x-avalon.info name="container-node"
  + * @avalon.service type=ProcessingNode
  + * @x-avalon.lifestyle type=singleton
  + * @x-avalon.info name=container-node
    */
   public class ContainerNode extends SimpleParentProcessingNode {
   
  @@ -72,8 +72,8 @@
       
       public void configure(Configuration config) throws ConfigurationException {
           super.configure(config);
  -        if (getChildNodes().length == 0) {
  -            String msg = "There must be at least one child at " + getConfigLocation(config);
  +        if (!hasChildren()) {
  +            String msg = "There must be at least one child at " + getLocation();
               throw new ConfigurationException(msg);
           }
       }
  
  
  
  1.2       +7 -7      cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/NamedContainerNode.java
  
  Index: NamedContainerNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/NamedContainerNode.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NamedContainerNode.java	28 Dec 2003 21:03:17 -0000	1.1
  +++ NamedContainerNode.java	27 Jan 2004 10:33:03 -0000	1.2
  @@ -61,25 +61,25 @@
    * @version CVS $Id$
    * 
    * @avalon.component
  - * @avalon.service type="ProcessingNode"
  - * @x-avalon.lifestyle type="singleton"
  - * @x-avalon.info name="named-container-node"
  + * @avalon.service type=ProcessingNode
  + * @x-avalon.lifestyle type=singleton
  + * @x-avalon.info name=named-container-node
    */
   public class NamedContainerNode extends ContainerNode implements NamedProcessingNode {
   
       private static final String NAME_ATTR = "name";
       
  -    private String name;
  +    private String m_name;
   
       public NamedContainerNode() {
       }
   
       public void configure(Configuration config) throws ConfigurationException {
           super.configure(config);
  -        config.getAttribute(NAME_ATTR);
  +        m_name = config.getAttribute(NAME_ATTR);
       }
   
       public String getName() {
  -        return this.name;
  +        return m_name;
       }
   }
  
  
  
  1.4       +3 -2      cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/GenerateNode.java
  
  Index: GenerateNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/GenerateNode.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- GenerateNode.java	5 Jan 2004 08:17:30 -0000	1.3
  +++ GenerateNode.java	27 Jan 2004 10:33:05 -0000	1.4
  @@ -128,7 +128,8 @@
   
               if (viewNode != null) {
                   if (getLogger().isDebugEnabled()) {
  -                    getLogger().debug("Jumping to view " + cocoonView + " from generator
at " + this.getLocation());
  +                    getLogger().debug("Jumping to view " + cocoonView + 
  +                        " from generator at " + getLocation());
                   }
                   return viewNode.invoke(env, context);
               }
  
  
  
  1.2       +1 -0      cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/ViewNode.java
  
  Index: ViewNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/ViewNode.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ViewNode.java	28 Dec 2003 21:03:17 -0000	1.1
  +++ ViewNode.java	27 Jan 2004 10:33:05 -0000	1.2
  @@ -106,4 +106,5 @@
       public String getLabel() {
           return m_label;
       }
  +    
   }
  
  
  
  1.3       +12 -6     cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/PipelineEventComponentProcessingNode.java
  
  Index: PipelineEventComponentProcessingNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/PipelineEventComponentProcessingNode.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PipelineEventComponentProcessingNode.java	5 Jan 2004 08:17:30 -0000	1.2
  +++ PipelineEventComponentProcessingNode.java	27 Jan 2004 10:33:05 -0000	1.3
  @@ -52,6 +52,7 @@
   
   import java.util.Arrays;
   import java.util.Collection;
  +import java.util.HashMap;
   import java.util.HashSet;
   import java.util.Map;
   
  @@ -66,20 +67,21 @@
   /**
    *
    * @author <a href="mailto:Michael.Melhem@dresdner-bank.com">Michael Melhem</a>
  - * @author <a href="mailto:Michael.Melhem@dresdner-bank.com">Michael Melhem</a>
    * @version CVS $Id$
    */
   public abstract class PipelineEventComponentProcessingNode extends AbstractProcessingNode
   implements Initializable {
   
       private String m_type;
  +    private Map m_views = new HashMap();
       protected Collection m_labels;
       protected ComponentNode m_component;
  -    protected Map m_views;
  -    
       // TODO: implement pipeline hints
       protected Map m_pipelineHints;
       
  +    public PipelineEventComponentProcessingNode() {
  +    }
  +    
       public void configure(Configuration config) throws ConfigurationException {
           super.configure(config);
           m_type = config.getAttribute("type",null);
  @@ -106,12 +108,16 @@
                       m_views.put(name,view);
                   }
                   else {
  -                    // TODO: record no such view
  +                    if (getLogger().isDebugEnabled()) {
  +                        getLogger().debug("view '" + name + "' not applicable " +
    
                       "to statement at '" + getLocation() + "'");
  +                    }
                       view = null;
                   }
               }
               catch (ServiceException e) {
  -                // TODO: record no such view
  +                if (getLogger().isDebugEnabled()) {
  +                    getLogger().debug("no such view: '" + name + "'");
  +                }
                   view = null;
               }
           }
  
  
  

Mime
View raw message