cziegeler    2004/05/24 04:04:55

  Modified:    .        status.xml
               src/documentation/xdocs/plan updating.xml
               src/java/org/apache/cocoon/components/pipeline
                        AbstractProcessingPipeline.java
  Log:
  Change mime-type setting of readers (merge from cocoon-2.2)
  
  Revision  Changes    Path
  1.333     +4 -3      cocoon-2.1/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/status.xml,v
  retrieving revision 1.332
  retrieving revision 1.333
  diff -u -r1.332 -r1.333
  --- status.xml        24 May 2004 09:56:53 -0000      1.332
  +++ status.xml        24 May 2004 11:04:54 -0000      1.333
  @@ -211,8 +211,9 @@
     <changes>
   
    <release version="@version@" date="@date@">
  -   <action dev="NN" type="fix">
  -     Dummy placeholder
  +   <action dev="CZ" type="fix">
  +     Change the mime-type setting of a reader. For more information, see
  +     <link 
href="http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10277";>bug entry 
10277</link>.
      </action>
    </release>
    <release version="2.1.5" date="May 24 2004">
  
  
  
  1.7       +2 -2      cocoon-2.1/src/documentation/xdocs/plan/updating.xml
  
  Index: updating.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/documentation/xdocs/plan/updating.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- updating.xml      8 May 2004 08:57:55 -0000       1.6
  +++ updating.xml      24 May 2004 11:04:54 -0000      1.7
  @@ -50,11 +50,11 @@
     </s1>
     <s1 title="Updating Your Application">
       <p>Currently, updating your application from an older version to the 
latest
  -     version of Cocoon has do be done manually (but we are working on a 
better
  +     version of Cocoon has to be done manually (but we are working on a 
better
        solution!).</p>
       <p>We suggest you, that you start from a clean Cocoon installation and 
       incorporate your changes into the cocoon.xconf, the sitemap etc. This
  -    is in most cases much easier that starting with your old application
  +    is in most cases much easier than starting with your old application
       and adapting it for Cocoon 2.2.x.</p>
     </s1>
     <s1 title="Sitemap Changes">
  
  
  
  1.22      +18 -7     
cocoon-2.1/src/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java
  
  Index: AbstractProcessingPipeline.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- AbstractProcessingPipeline.java   26 Apr 2004 21:28:39 -0000      1.21
  +++ AbstractProcessingPipeline.java   24 May 2004 11:04:55 -0000      1.22
  @@ -560,16 +560,27 @@
       protected void setupReader(Environment environment)
       throws ProcessingException {
           try {
  -            String mimeType;
               
this.reader.setup(environment,environment.getObjectModel(),readerSource,readerParam);
  -            mimeType = this.reader.getMimeType();
  -            if ( mimeType != null ) {
  -                environment.setContentType(mimeType);
  -            } else if ( readerMimeType != null ) {
  +            // 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
  +            // MIME type declared for the reader component
  +            // Ask the Reader for a MIME type:
  +            //     A *.doc reader could peek into the file
  +            //     and return either text/plain or application/vnd.msword or
  +            //     the reader can use MIME type declared in WEB-INF/web.xml 
or 
  +            //     by the server.
  +            if ( this.readerMimeType != null ) {
                   environment.setContentType(this.readerMimeType);
  +            } else if ( this.sitemapReaderMimeType != null ) {
  +                environment.setContentType(this.sitemapReaderMimeType);      
          
               } else {
  -                environment.setContentType(this.sitemapReaderMimeType);
  +                final String mimeType = this.reader.getMimeType();
  +                if ( mimeType != null ) {
  +                    environment.setContentType(mimeType);                    
  +                }
               }
  +
           } catch (SAXException e){
               throw new ProcessingException("Failed to execute reader 
pipeline.", e);
           } catch (IOException e){
  
  
  

Reply via email to