cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gkossakow...@apache.org
Subject svn commit: r542815 - in /cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main: java/org/apache/cocoon/servletservice/postable/components/ resources/META-INF/cocoon/spring/
Date Wed, 30 May 2007 13:18:37 GMT
Author: gkossakowski
Date: Wed May 30 06:18:36 2007
New Revision: 542815

URL: http://svn.apache.org/viewvc?view=rev&rev=542815
Log:
COCOON-2050: Mime type should be set in bean's configuration file.

Modified:
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/postable/components/ServletServiceSerializer.java
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-serializer.xml

Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/postable/components/ServletServiceSerializer.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/postable/components/ServletServiceSerializer.java?view=diff&rev=542815&r1=542814&r2=542815
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/postable/components/ServletServiceSerializer.java
(original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/postable/components/ServletServiceSerializer.java
Wed May 30 06:18:36 2007
@@ -77,16 +77,6 @@
 		
 		response = ObjectModelHelper.getResponse(objectModel);
 	}
-	
-	/**
-	 * This method returns dummy mime type to satisfy pipeline's requirement to have mime type
determined at setup phase.
-	 * In this serializer case it's not possible to satisfy this requirement so dummy value
is returned and real is set in the 
-	 * method {@link #endDocument()}.
-	 * @see http://article.gmane.org/gmane.text.xml.cocoon.devel/73261 for post explaining current
(hacky) solution
-	 */
-	public String getMimeType() {
-		return "application/dummy-mime-type";
-	}
 
 	public void endDocument() throws SAXException {
 		super.endDocument();
@@ -103,7 +93,7 @@
 			throw new SAXException("Exception occured while writing to the output stream of source
'" + servletSource.getURI() + "'", e);
 		}
 		try {
-			//here real mime type is set, see getMimeType() method's comment
+			//here real mime type is set, see Spring bean's configuration comment
 			response.setHeader("Content-Type", servletSource.getMimeType());
 			
 			IOUtils.copy(servletSource.getInputStream(), super.output);

Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-serializer.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-serializer.xml?view=diff&rev=542815&r1=542814&r2=542815
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-serializer.xml
(original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-serializer.xml
Wed May 30 06:18:36 2007
@@ -17,8 +17,18 @@
 -->
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+       xmlns:pipeline="http://cocoon.apache.org/schema/pipeline"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+                           http://cocoon.apache.org/schema/pipeline http://cocoon.apache.org/schema/pipeline/cocoon-pipeline-1.0.xsd">
 
   <bean name="org.apache.cocoon.serialization.Serializer/servletService"
-      class="org.apache.cocoon.servletservice.postable.components.ServletServiceSerializer"
init-method="init" scope="prototype"/>
+    class="org.apache.cocoon.servletservice.postable.components.ServletServiceSerializer"
init-method="init" scope="prototype">
+    <!--
+    * This method returns dummy mime type to satisfy pipeline's requirement to have mime
type determined at setup phase.
+    * In this serializer case it's not possible to satisfy this requirement so dummy value
is returned and real is set in the 
+    * method org.apache.cocoon.servletservice.postable.components.ServletServiceSerializer#endDocument()
+    * See http://article.gmane.org/gmane.text.xml.cocoon.devel/73261 for post explaining
current (hacky) solution
+    * -->
+    <pipeline:component mime-type="application/dummy-mime-type"/>
+  </bean>
 </beans>



Mime
View raw message