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/environment/internal EnvironmentHelper.java
Date Sun, 22 Feb 2004 17:36:34 GMT
cziegeler    2004/02/22 09:36:34

  Modified:    src/java/org/apache/cocoon/components/source/impl
                        SitemapSource.java
               src/java/org/apache/cocoon/components/cprocessor/sitemap
                        SerializeNode.java GenerateNode.java ActNode.java
                        ReadNode.java AggregateNode.java TransformNode.java
               src/java/org/apache/cocoon ProcessorWrapper.java
                        Processor.java Cocoon.java
               src/java/org/apache/cocoon/components/pipeline
                        AbstractProcessingPipeline.java
               src/java/org/apache/cocoon/components/cprocessor
                        InvokeContext.java TreeProcessor.java
               src/java/org/apache/cocoon/environment/internal
                        EnvironmentHelper.java
  Log:
  Remove dependencies to internal implementation
  Organize imports
  
  Revision  Changes    Path
  1.29      +2 -2      cocoon-2.2/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
  
  Index: SitemapSource.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- SitemapSource.java	20 Feb 2004 20:34:37 -0000	1.28
  +++ SitemapSource.java	22 Feb 2004 17:36:34 -0000	1.29
  @@ -306,7 +306,7 @@
               this.environment.startingProcessing();
               this.processed = true;
               this.pipelineDescription = this.processor.buildPipeline(this.environment);
  -            this.pipelineDescription.lastProcessor.getEnvironmentHelper().setContext(this.environment);
  +            this.environment.setURI(this.pipelineDescription.prefix, this.pipelineDescription.uri);
   
               String redirectURL = this.environment.getRedirectURL();
               if (redirectURL == null) {
  
  
  
  1.6       +1 -2      cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/SerializeNode.java
  
  Index: SerializeNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/SerializeNode.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SerializeNode.java	22 Feb 2004 15:07:57 -0000	1.5
  +++ SerializeNode.java	22 Feb 2004 17:36:34 -0000	1.6
  @@ -62,7 +62,6 @@
   import org.apache.cocoon.components.cprocessor.variables.VariableResolverFactory;
   import org.apache.cocoon.components.pipeline.ProcessingPipeline;
   import org.apache.cocoon.environment.Environment;
  -import org.apache.cocoon.serialization.Serializer;
   import org.apache.cocoon.sitemap.PatternException;
   
   /**
  
  
  
  1.7       +1 -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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- GenerateNode.java	22 Feb 2004 15:07:57 -0000	1.6
  +++ GenerateNode.java	22 Feb 2004 17:36:34 -0000	1.7
  @@ -61,7 +61,6 @@
   import org.apache.cocoon.components.cprocessor.variables.VariableResolver;
   import org.apache.cocoon.components.cprocessor.variables.VariableResolverFactory;
   import org.apache.cocoon.environment.Environment;
  -import org.apache.cocoon.generation.Generator;
   import org.apache.cocoon.sitemap.PatternException;
   
   /**
  
  
  
  1.7       +2 -2      cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/ActNode.java
  
  Index: ActNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/ActNode.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ActNode.java	20 Feb 2004 19:06:21 -0000	1.6
  +++ ActNode.java	22 Feb 2004 17:36:34 -0000	1.7
  @@ -125,7 +125,7 @@
        */
       public void contextualize(Context context) throws ContextException {
           TreeProcessor processor = (TreeProcessor) context.get(TreeProcessor.CONTEXT_TREE_PROCESSOR);
  -        this.resolver = processor.getEnvironmentHelper();
  +        this.resolver = processor.getSourceResolver();
       }
       
       public void configure(Configuration config) throws ConfigurationException {
  
  
  
  1.5       +1 -2      cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/ReadNode.java
  
  Index: ReadNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/ReadNode.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ReadNode.java	22 Feb 2004 15:07:57 -0000	1.4
  +++ ReadNode.java	22 Feb 2004 17:36:34 -0000	1.5
  @@ -60,7 +60,6 @@
   import org.apache.cocoon.components.cprocessor.variables.VariableResolverFactory;
   import org.apache.cocoon.components.pipeline.ProcessingPipeline;
   import org.apache.cocoon.environment.Environment;
  -import org.apache.cocoon.reading.Reader;
   import org.apache.cocoon.sitemap.PatternException;
   
   /**
  
  
  
  1.6       +1 -2      cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/AggregateNode.java
  
  Index: AggregateNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/AggregateNode.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AggregateNode.java	22 Feb 2004 15:08:56 -0000	1.5
  +++ AggregateNode.java	22 Feb 2004 17:36:34 -0000	1.6
  @@ -68,7 +68,6 @@
   import org.apache.cocoon.components.cprocessor.variables.VariableResolverFactory;
   import org.apache.cocoon.components.pipeline.ProcessingPipeline;
   import org.apache.cocoon.environment.Environment;
  -import org.apache.cocoon.generation.Generator;
   import org.apache.cocoon.sitemap.ContentAggregator;
   import org.apache.cocoon.sitemap.PatternException;
   import org.apache.cocoon.util.StringUtils;
  
  
  
  1.5       +1 -2      cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/TransformNode.java
  
  Index: TransformNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/TransformNode.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TransformNode.java	22 Feb 2004 15:07:57 -0000	1.4
  +++ TransformNode.java	22 Feb 2004 17:36:34 -0000	1.5
  @@ -61,7 +61,6 @@
   import org.apache.cocoon.components.cprocessor.variables.VariableResolverFactory;
   import org.apache.cocoon.environment.Environment;
   import org.apache.cocoon.sitemap.PatternException;
  -import org.apache.cocoon.transformation.Transformer;
   
   /**
    *
  
  
  
  1.12      +10 -11    cocoon-2.2/src/java/org/apache/cocoon/ProcessorWrapper.java
  
  Index: ProcessorWrapper.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/ProcessorWrapper.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ProcessorWrapper.java	6 Feb 2004 11:42:46 -0000	1.11
  +++ ProcessorWrapper.java	22 Feb 2004 17:36:34 -0000	1.12
  @@ -55,7 +55,7 @@
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.thread.ThreadSafe;
   import org.apache.cocoon.environment.Environment;
  -import org.apache.cocoon.environment.internal.EnvironmentHelper;
  +import org.apache.cocoon.environment.SourceResolver;
   
   /**
    * This class is a wrapper around the real processor (the <code>Cocoon</code>
class).
  @@ -113,15 +113,14 @@
       /* (non-Javadoc)
        * @see org.apache.cocoon.Processor#getEnvironmentHelper()
        */
  -    public EnvironmentHelper getEnvironmentHelper() {
  -        return this.processor.getEnvironmentHelper();
  -    }
  -
  -    /* (non-Javadoc)
  -     * @see org.apache.cocoon.Processor#getContext()
  -     */
  -    public String getContext() {
  -        return this.processor.getContext();
  +    public SourceResolver getSourceResolver() {
  +        return this.processor.getSourceResolver();
       }
   
  +	/* (non-Javadoc)
  +	 * @see org.apache.cocoon.Processor#getContext()
  +	 */
  +	public String getContext() {
  +		return this.processor.getContext();
  +	}
   }
  
  
  
  1.16      +7 -6      cocoon-2.2/src/java/org/apache/cocoon/Processor.java
  
  Index: Processor.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/Processor.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Processor.java	6 Feb 2004 11:42:46 -0000	1.15
  +++ Processor.java	22 Feb 2004 17:36:34 -0000	1.16
  @@ -55,7 +55,7 @@
   import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.cocoon.components.pipeline.ProcessingPipeline;
   import org.apache.cocoon.environment.Environment;
  -import org.apache.cocoon.environment.internal.EnvironmentHelper;
  +import org.apache.cocoon.environment.SourceResolver;
   
   /**
    * 
  @@ -66,6 +66,7 @@
    */
   public interface Processor {
   
  +    /** The role of the root processor */
       String ROLE = Processor.class.getName();
   
       public class InternalPipelineDescription {
  @@ -77,6 +78,8 @@
           public ProcessingPipeline processingPipeline;
           public ServiceManager pipelineManager;
           public Processor lastProcessor;
  +        public String prefix;
  +        public String uri;
           
           public void release() {
               if (this.pipelineManager != null) {
  @@ -124,15 +127,13 @@
       Processor getRootProcessor();
       
       /**
  -     * Get the EnvironmentHelper for this processor
  -     * EXPERIMENTAL
  +     * Get the source resolver for this processor
        * @since 2.2
        */
  -    EnvironmentHelper getEnvironmentHelper();
  +    SourceResolver getSourceResolver();
       
       /**
        * Get the context URI for this processor
  -     * EXPERIMENTAL
        * @since 2.2
        */
       String getContext();
  
  
  
  1.38      +2 -2      cocoon-2.2/src/java/org/apache/cocoon/Cocoon.java
  
  Index: Cocoon.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/Cocoon.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- Cocoon.java	20 Feb 2004 20:34:37 -0000	1.37
  +++ Cocoon.java	22 Feb 2004 17:36:34 -0000	1.38
  @@ -509,7 +509,7 @@
       /* (non-Javadoc)
        * @see org.apache.cocoon.Processor#getEnvironmentHelper()
        */
  -    public EnvironmentHelper getEnvironmentHelper() {
  +    public org.apache.cocoon.environment.SourceResolver getSourceResolver() {
           return this.environmentHelper;
       }
   
  
  
  
  1.33      +5 -5      cocoon-2.2/src/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java
  
  Index: AbstractProcessingPipeline.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- AbstractProcessingPipeline.java	22 Feb 2004 15:07:58 -0000	1.32
  +++ AbstractProcessingPipeline.java	22 Feb 2004 17:36:34 -0000	1.33
  @@ -357,7 +357,7 @@
           try {
               // setup the generator
               this.generator.setup(
  -                this.processor.getEnvironmentHelper(),
  +                this.processor.getSourceResolver(),
                   environment.getObjectModel(),
                   generatorSource,
                   generatorParam
  @@ -369,7 +369,7 @@
   
               while (transformerItt.hasNext()) {
                   Transformer trans = (Transformer)transformerItt.next();
  -                trans.setup(this.processor.getEnvironmentHelper(),
  +                trans.setup(this.processor.getSourceResolver(),
                               environment.getObjectModel(),
                               (String)transformerSourceItt.next(),
                               (Parameters)transformerParamItt.next());
  @@ -377,7 +377,7 @@
   
               if (this.serializer instanceof SitemapModelComponent) {
                   ((SitemapModelComponent)this.serializer).setup(
  -                this.processor.getEnvironmentHelper(),
  +                this.processor.getSourceResolver(),
                       environment.getObjectModel(),
                       this.serializerSource,
                       this.serializerParam
  @@ -552,7 +552,7 @@
       protected void setupReader(Environment environment)
       throws ProcessingException {
           try {
  -            this.reader.setup(this.processor.getEnvironmentHelper(),environment.getObjectModel(),readerSource,readerParam);
  +            this.reader.setup(this.processor.getSourceResolver(),environment.getObjectModel(),readerSource,readerParam);
               // Set the mime-type
               // the behaviour has changed from 2.1.x to 2.2 according to bug #10277:
               // MIME type declared on the reader instance
  
  
  
  1.9       +5 -2      cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/InvokeContext.java
  
  Index: InvokeContext.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/InvokeContext.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- InvokeContext.java	20 Feb 2004 18:57:15 -0000	1.8
  +++ InvokeContext.java	22 Feb 2004 17:36:34 -0000	1.9
  @@ -64,6 +64,7 @@
   import org.apache.cocoon.Processor;
   import org.apache.cocoon.components.pipeline.ProcessingPipeline;
   import org.apache.cocoon.components.cprocessor.variables.VariableResolver;
  +import org.apache.cocoon.environment.Environment;
   import org.apache.cocoon.environment.Redirector;
   
   /**
  @@ -198,11 +199,13 @@
       /**
        * Get the pipeline description
        */
  -    public Processor.InternalPipelineDescription getInternalPipelineDescription() {
  +    public Processor.InternalPipelineDescription getInternalPipelineDescription(Environment
env) {
           if ( this.internalPipelineDescription == null ) {
               this.internalPipelineDescription = new Processor.InternalPipelineDescription(
                       this.processingPipeline, this.pipelinesManager);
               this.internalPipelineDescription.lastProcessor = this.lastProcessor;
  +            this.internalPipelineDescription.prefix = env.getURIPrefix();
  +            this.internalPipelineDescription.uri = env.getURI();
           }
           return this.internalPipelineDescription;
       }
  
  
  
  1.20      +10 -3     cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/TreeProcessor.java
  
  Index: TreeProcessor.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/TreeProcessor.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- TreeProcessor.java	20 Feb 2004 18:57:15 -0000	1.19
  +++ TreeProcessor.java	22 Feb 2004 17:36:34 -0000	1.20
  @@ -453,7 +453,7 @@
           context.setLastProcessor(this);
           try {
               if (process(environment, context)) {
  -                return context.getInternalPipelineDescription();
  +                return context.getInternalPipelineDescription(environment);
               } else {
                   return null;
               }
  @@ -516,8 +516,11 @@
           return this.sitemapComponentConfigurations;
       }
       
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.Processor#getContext()
  +     */
       public String getContext() {
  -        return getEnvironmentHelper().getContext();
  +        return m_environmentHelper.getContext();
       }
       
       /**
  @@ -534,10 +537,14 @@
       /* (non-Javadoc)
        * @see org.apache.cocoon.Processor#getEnvironmentHelper()
        */
  -    public EnvironmentHelper getEnvironmentHelper() {
  +    public org.apache.cocoon.environment.SourceResolver getSourceResolver() {
           return m_environmentHelper;
       }
   
  +    public EnvironmentHelper getEnvironmentHelper() {
  +        return m_environmentHelper;   
  +    }
  +    
       /**
        * Create a new child of this processor (used for mounting submaps).
        *
  
  
  
  1.13      +1 -23     cocoon-2.2/src/java/org/apache/cocoon/environment/internal/EnvironmentHelper.java
  
  Index: EnvironmentHelper.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/environment/internal/EnvironmentHelper.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- EnvironmentHelper.java	21 Feb 2004 18:06:09 -0000	1.12
  +++ EnvironmentHelper.java	22 Feb 2004 17:36:34 -0000	1.13
  @@ -212,28 +212,6 @@
       }
       
       /**
  -     * Set the context of the environment.
  -     * @param env The environment to change
  -     * @throws ProcessingException
  -     */
  -    public void setContext(Environment env) 
  -    throws ProcessingException {
  -        if ( this.prefix != null ) {
  -            // FIXME - This is not correct!
  -            final String uris = env.getURIPrefix() + env.getURI();
  -            if (!uris.startsWith(this.prefix)) {
  -                final String message = "The current URI (" + uris +
  -                                 ") doesn't start with given prefix (" + this.prefix +
")";
  -                throw new ProcessingException(message);
  -            }      
  -            // we don't need to check for slash at the beginning
  -            // of uris - the prefix always ends with a slash!
  -            final int l = this.prefix.length();
  -            env.setURI(this.prefix, uris.substring(l));
  -        }
  -    }
  -
  -    /**
        * Adds an prefix to the overall stripped off prefix from the request uri
        */
       public void changeContext(Source newSource, String newPrefix)
  
  
  

Mime
View raw message