cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/variables PreparedVariableResolver.java
Date Thu, 15 Apr 2004 13:13:17 GMT
cziegeler    2004/04/15 06:13:17

  Modified:    src/java/org/apache/cocoon/components/cprocessor/sitemap/impl
                        AggregateNode.java PipelineNode.java
               src/java/org/apache/cocoon/components/cprocessor
                        SitemapContainer.java AbstractNode.java
               src/java/org/apache/cocoon/components/container
                        CocoonContainer.java
               src/java/org/apache/cocoon/components/cprocessor/variables
                        PreparedVariableResolver.java
  Log:
  Add selectors for compatibility and clean up code a
  
  Revision  Changes    Path
  1.4       +2 -2      cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/impl/AggregateNode.java
  
  Index: AggregateNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/impl/AggregateNode.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AggregateNode.java	28 Mar 2004 21:01:21 -0000	1.3
  +++ AggregateNode.java	15 Apr 2004 13:13:16 -0000	1.4
  @@ -156,7 +156,7 @@
   
           } else {
               // Are there some parts that match this view ?
  -            actualParts = (Part[]) getViewParts(cocoonView);
  +            actualParts = getViewParts(cocoonView);
   
               // If not, keep all parts
               if (actualParts == null) {
  
  
  
  1.4       +2 -2      cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/impl/PipelineNode.java
  
  Index: PipelineNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/impl/PipelineNode.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PipelineNode.java	18 Mar 2004 15:15:10 -0000	1.3
  +++ PipelineNode.java	15 Apr 2004 13:13:16 -0000	1.4
  @@ -63,7 +63,7 @@
       private boolean m_internalOnly;
   
       /** Is it the last <pipeline> in the enclosing <pipelines> ? */
  -    private boolean isLast = false;
  +    //private boolean isLast = false;
   
       public PipelineNode() {
       }
  
  
  
  1.8       +26 -0     cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/SitemapContainer.java
  
  Index: SitemapContainer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/SitemapContainer.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SitemapContainer.java	8 Mar 2004 13:57:39 -0000	1.7
  +++ SitemapContainer.java	15 Apr 2004 13:13:17 -0000	1.8
  @@ -21,6 +21,7 @@
   import org.apache.avalon.fortress.impl.ComponentHandlerMetaData;
   import org.apache.avalon.fortress.impl.DefaultContainer;
   import org.apache.avalon.fortress.impl.lookup.FortressServiceManager;
  +import org.apache.avalon.fortress.impl.lookup.FortressServiceSelector;
   import org.apache.avalon.fortress.util.CompositeException;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  @@ -33,12 +34,16 @@
   import org.apache.cocoon.components.cprocessor.sitemap.impl.SerializerNode;
   import org.apache.cocoon.components.cprocessor.sitemap.impl.TransformerNode;
   import org.apache.cocoon.components.pipeline.ProcessingPipeline;
  +import org.apache.cocoon.generation.Generator;
   import org.apache.cocoon.matching.Matcher;
  +import org.apache.cocoon.reading.Reader;
   import org.apache.cocoon.selection.Selector;
  +import org.apache.cocoon.serialization.Serializer;
   import org.apache.cocoon.sitemap.ContentAggregator;
   import org.apache.cocoon.sitemap.LinkGatherer;
   import org.apache.cocoon.sitemap.LinkTranslator;
   import org.apache.cocoon.sitemap.NotifyingGenerator;
  +import org.apache.cocoon.transformation.Transformer;
   
   /**
    * @author <a href="mailto:unico@apache.org">Unico Hommes</a>
  @@ -72,6 +77,27 @@
               String role = (String) TYPES2ROLES.get(type);
               m_defaultHints.put(role,hint);
           }
  +        this.addSelector(Generator.ROLE);
  +        this.addSelector(Transformer.ROLE);
  +        this.addSelector(Serializer.ROLE);
  +        this.addSelector(Reader.ROLE);
  +        this.addSelector(Matcher.ROLE);
  +        this.addSelector(Selector.ROLE);
  +        this.addSelector(Action.ROLE);
  +        this.addSelector(ProcessingPipeline.ROLE);
  +    }
  +    
  +    /**
  +     * Add a selector for compatibility with 2.1.x
  +     */   
  +    protected void addSelector(String role) {
  +        final String selectorRole = role + "Selector";
  +        FortressServiceSelector fss = new FortressServiceSelector(this, selectorRole);
  +        Map hintMap = createHintMap();
  +        hintMap.put( DEFAULT_ENTRY, fss );
  +        hintMap.put( SELECTOR_ENTRY,
  +                    new FortressServiceSelector( this, selectorRole ) );
  +        m_mapper.put( selectorRole, hintMap );        
       }
       
       /**
  
  
  
  1.2       +2 -2      cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/AbstractNode.java
  
  Index: AbstractNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/AbstractNode.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractNode.java	22 Feb 2004 19:08:15 -0000	1.1
  +++ AbstractNode.java	15 Apr 2004 13:13:17 -0000	1.2
  @@ -47,11 +47,11 @@
           return m_manager.lookup(role);
       }
       
  -    protected final boolean hasService(String role) throws ServiceException {
  +    protected final boolean hasService(String role) {
           return m_manager.hasService(role);
       }
       
  -    protected final void release(Object component) throws ServiceException {
  +    protected final void release(Object component) {
           m_manager.release(component);
       }
       
  
  
  
  1.5       +8 -0      cocoon-2.2/src/java/org/apache/cocoon/components/container/CocoonContainer.java
  
  Index: CocoonContainer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/container/CocoonContainer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CocoonContainer.java	5 Apr 2004 13:15:27 -0000	1.4
  +++ CocoonContainer.java	15 Apr 2004 13:13:17 -0000	1.5
  @@ -82,4 +82,12 @@
   
           return component;
       }
  +    
  +    /**
  +     * Use a different default proxy type
  +     */
  +    protected String getDefaultProxyType() {
  +        return "bcel";
  +    }
  +    
   }
  
  
  
  1.3       +3 -3      cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/variables/PreparedVariableResolver.java
  
  Index: PreparedVariableResolver.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/variables/PreparedVariableResolver.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PreparedVariableResolver.java	8 Mar 2004 13:57:37 -0000	1.2
  +++ PreparedVariableResolver.java	15 Apr 2004 13:13:17 -0000	1.3
  @@ -148,7 +148,7 @@
           }
       }
   
  -    private void addAnchorVariable(String anchor, String variable) throws PatternException
{
  +    private void addAnchorVariable(String anchor, String variable) {
           this.items.add(ANCHOR_OBJ);
           this.items.add(anchor);
           this.items.add(variable);
  @@ -326,7 +326,7 @@
   
                       case THREADSAFE_MODULE:
                           i++; // module
  -                        this.selector.release((InputModule) this.items.get(i));
  +                        this.selector.release(this.items.get(i));
                           i++; // variable
                           break;
   
  
  
  

Mime
View raw message