You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by bu...@apache.org on 2003/07/25 12:13:50 UTC
DO NOT REPLY [Bug 21881] New: -
[PATCH] StreamGenerator
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21881>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21881
[PATCH] StreamGenerator
Summary: [PATCH] StreamGenerator
Product: Cocoon 2
Version: Current CVS 2.1
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: sitemap components
AssignedTo: dev@cocoon.apache.org
ReportedBy: gcasper@s-und-n.de
This patch is a companion to the WebDAV sample.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21878
If StreamGenerator doesn't find a HTTP header Content-Type it throws an
exception. Since some WebDAV client don't set the Content-Type header (as Win2k
Explorer) it is not possible to store new content into the davmap with these
clients.
This patch allows the StreamGenerator to specify a default content type if the
HTTP header is missing.
<map:match pattern="PUT/**/*.xml">
<map:generate type="stream">
<map:parameter name="contentType" value="text/xml"/>
</map:generate>
<map:transform src="styles/stream2write.xsl">
<map:parameter name="file" value="{global:staging}{1}/{2}.xml"/>
</map:transform>
<map:transform type="write-source"/>
<map:serialize/>
</map:match>
It still throws an exception if there is a Content-Type header but its value
is not xml.
It feels somewhat hacky, but I don't know a better solution.
Additionally maybe org.apache.cocoon.util.PostInputStream should be renamed to
HTTPRequestInputStream. It's currently used only by StreamGenerator and
HTMLGenerator.