You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Carsten Ziegeler <cz...@s-und-n.de> on 2004/05/25 12:00:01 UTC

Mime-Type setting of a serializer [was: RE:cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/pipelineAbstractProcessingPipeline.java]

Joerg Heinicke wrote: 
> 
> I saw your back port of the changed mime-type setting.
> And have two questions that are not directly related to it:
> 1. Is this compatible to my proposed patch at
> http://issues.apache.org/bugzilla/show_bug.cgi?id=26997 ??
> 2. What about this patch at all?
> 
> Sorry to nag you about this issue, but I got no response 
> until now. And I think fixing this issue is important as we 
> can not rely on correct browser charset recognition. Tomcat 
> probably follows only the spec. See also the dependent bug 
> for a more user-centric view.
> 
Ok, I think there are different issues here.

One of them is the order in which the mime-type is evaluated.
I think we should change if for the serializer as well in order
to make it equal to the order used for the reader. So the order
should be:
- optional configured mime-type in the usage of the serializer
  (perhaps this can be removed)
- configured mime-type in the configuration of the serializer
- ask the serializer


Now for the encoding. In general I would say that a serializer
is configured with a mime-type and (perhaps) with an encoding.
Now, a working solution should be that the serializer is
configured with the combination of mime-type and encoding:
<map:serializer mime-type="MT;ENCODING".../>
This should work out of the box. It has only the disadvantage
that you configure the encoding twice on the serializer.

WDYT?
Carsten


Re: Mime-Type setting of a serializer [was: RE:cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/pipelineAbstractProcessingPipeline.java]

Posted by Joerg Heinicke <jo...@gmx.de>.
On 25.05.2004 12:00, Carsten Ziegeler wrote:

>>http://issues.apache.org/bugzilla/show_bug.cgi?id=26997

> One of them is the order in which the mime-type is evaluated.
> I think we should change if for the serializer as well in order
> to make it equal to the order used for the reader. So the order
> should be:
> - optional configured mime-type in the usage of the serializer
>   (perhaps this can be removed)
> - configured mime-type in the configuration of the serializer
> - ask the serializer

Yes, for consistency.

> Now for the encoding. In general I would say that a serializer
> is configured with a mime-type and (perhaps) with an encoding.
> Now, a working solution should be that the serializer is
> configured with the combination of mime-type and encoding:
> <map:serializer mime-type="MT;ENCODING".../>
> This should work out of the box. It has only the disadvantage
> that you configure the encoding twice on the serializer.
> 
> WDYT?

To be honest I really don't like it. Why shall a user have to care what 
comes out at the end (the header) and why he has to know the needed 
format for it ("mimetype;charset")? To say nothing of the duplicate 
configuration and the nice effects if you change one and forget the 
other one ... IMO the serializer must know the encoding in any case, so 
it should get the complete control over it and the pipeline (setting the 
header) only asks the serializer. This is what I tried with the patch.

Joerg