cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r156308 - cocoon/branches/BRANCH_2_1_X/src/blocks/profiler/java/org/apache/cocoon/components/profiler
Date Sun, 06 Mar 2005 13:09:02 GMT
Author: cziegeler
Date: Sun Mar  6 05:09:02 2005
New Revision: 156308

URL: http://svn.apache.org/viewcvs?view=rev&rev=156308
Log:
Use inherited method to set mime-type

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/profiler/java/org/apache/cocoon/components/profiler/ProfilingCachingProcessingPipeline.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/profiler/java/org/apache/cocoon/components/profiler/ProfilingNonCachingProcessingPipeline.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/profiler/java/org/apache/cocoon/components/profiler/ProfilingCachingProcessingPipeline.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/profiler/java/org/apache/cocoon/components/profiler/ProfilingCachingProcessingPipeline.java?view=diff&r1=156307&r2=156308
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/profiler/java/org/apache/cocoon/components/profiler/ProfilingCachingProcessingPipeline.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/profiler/java/org/apache/cocoon/components/profiler/ProfilingCachingProcessingPipeline.java
Sun Mar  6 05:09:02 2005
@@ -34,7 +34,7 @@
  * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
  * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
  * @author <a href="mailto:bruno@outerthought.org">Bruno Dumon</a>
- * @version CVS $Id: ProfilingCachingProcessingPipeline.java,v 1.7 2004/03/23 19:48:43 stephan
Exp $
+ * @version CVS $Id$
  */
 public class ProfilingCachingProcessingPipeline
   extends CachingProcessingPipeline {
@@ -211,25 +211,7 @@
             }
             this.data.setSetupTime(index++, System.currentTimeMillis()-time);
 
-            String mimeType = this.serializer.getMimeType();
-
-            if (mimeType!=null) {
-                // we have a mimeType from the component itself
-                environment.setContentType(mimeType);
-            } else if (serializerMimeType!=null) {
-                // there was a mimeType specified in the sitemap pipeline
-                environment.setContentType(serializerMimeType);
-            } else if (this.sitemapSerializerMimeType!=null) {
-                // use the mimeType specified in the sitemap component declaration
-                environment.setContentType(this.sitemapSerializerMimeType);
-            } else {
-                // No mimeType available
-                String message = "Unable to determine MIME type for "+
-                                 environment.getURIPrefix()+"/"+
-                                 environment.getURI();
-
-                throw new ProcessingException(message);
-            }
+            this.setMimeTypeForSerializer(environment);
         } catch (SAXException e) {
             throw new ProcessingException("Could not setup pipeline.", e);
         } catch (IOException e) {

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/profiler/java/org/apache/cocoon/components/profiler/ProfilingNonCachingProcessingPipeline.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/profiler/java/org/apache/cocoon/components/profiler/ProfilingNonCachingProcessingPipeline.java?view=diff&r1=156307&r2=156308
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/profiler/java/org/apache/cocoon/components/profiler/ProfilingNonCachingProcessingPipeline.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/profiler/java/org/apache/cocoon/components/profiler/ProfilingNonCachingProcessingPipeline.java
Sun Mar  6 05:09:02 2005
@@ -39,7 +39,7 @@
  * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
  * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
  * @author <a href="mailto:bruno@outerthought.org">Bruno Dumon</a>
- * @version CVS $Id: ProfilingNonCachingProcessingPipeline.java,v 1.7 2004/03/23 19:48:43
stephan Exp $
+ * @version CVS $Id$
  */
 public class ProfilingNonCachingProcessingPipeline
   extends NonCachingProcessingPipeline implements Disposable {
@@ -215,25 +215,7 @@
             }
             this.data.setSetupTime(index++, System.currentTimeMillis()-time);
 
-            String mimeType = this.serializer.getMimeType();
-
-            if (mimeType!=null) {
-                // we have a mimeType from the component itself
-                environment.setContentType(mimeType);
-            } else if (serializerMimeType!=null) {
-                // there was a mimeType specified in the sitemap pipeline
-                environment.setContentType(serializerMimeType);
-            } else if (this.sitemapSerializerMimeType!=null) {
-                // use the mimeType specified in the sitemap component declaration
-                environment.setContentType(this.sitemapSerializerMimeType);
-            } else {
-                // No mimeType available
-                String message = "Unable to determine MIME type for "+
-                                 environment.getURIPrefix()+"/"+
-                                 environment.getURI();
-
-                throw new ProcessingException(message);
-            }
+            this.setMimeTypeForSerializer(environment);
         } catch (SAXException e) {
             throw new ProcessingException("Could not setup pipeline.", e);
         } catch (IOException e) {



Mime
View raw message