You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Tsui, Alban" <Al...@COGNOS.com> on 2003/07/16 16:31:34 UTC

dynamic "encoding" for html serialiser?

Hi 

I am trying to write a xsp page directly generating html and my page will
take in a parameter which would tell me what final encoding the page should
use. SO I tried to "manually" generate that

<meta Content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">

tag ...
but my serializer seems to append 

<meta Content="text/html; charset=UTF-8" http-equiv="Content-Type">

in my final html output.

i have not specified any encoding in my html serializer defintion in my
sitemap at all... and I have an entry as follows:

	<map:serializers default="html">
		<map:serializer logger="sitemap.serializer.xml"
mime-type="text/xml" name="xml"
src="org.apache.cocoon.serialization.XMLSerializer"/>
		<map:serializer logger="sitemap.serializer.html"
mime-type="text/html" name="html"
src="org.apache.cocoon.serialization.HTMLSerializer">
			<buffer-size>1024</buffer-size>
		</map:serializer>
		<map:serializer logger="sitemap.serializer.svgxml"
mime-type="image/svg-xml" name="svgxml"
src="org.apache.cocoon.serialization.XMLSerializer">
			<doctype-public>-//W3C//DTD SVG 20000303
Stylable//EN</doctype-public>
	
<doctype-system>http://www.w3.org/TR/2000/03/WD-SVG-20000303/</doctype-syste
m>
		</map:serializer>
		<map:serializer mime-type="image/jpeg" name="svg2jpeg"
src="org.apache.cocoon.serialization.SVGSerializer">
			<parameter name="quality" type="float" value="0.9"/>
		</map:serializer>
		<map:serializer mime-type="image/png" name="svg2png"
src="org.apache.cocoon.serialization.SVGSerializer"/>
	</map:serializers>

Is there anyway I could effect the final encoding in that meta string
generated from the serialiser from within the xsp generator?

I am using version 2.0.3 cocoon.

AT

Join us at Cognos' biggest event of the year Enterprise 2003, The Cognos
Business Forum.  Taking place in over 25 cities around the world, it's an
opportunity for Business and IT leaders to learn about strategies for
driving performance. Visit http://www.cognos.com/enterprise03 for more
details. 

This message may contain privileged and/or confidential information.  If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.  Thank you.

Re: dynamic "encoding" for html serialiser?

Posted by Geoff Howard <co...@leverageweb.com>.
Yury Mikhienko wrote:
> On Thu, 17 Jul 2003 10:25:56 -0400
> Geoff Howard <co...@leverageweb.com> wrote:
> 
> 
>>Yury Mikhienko wrote:
>>
>>>On Thu, 17 Jul 2003 09:43:27 -0400
>>>Geoff Howard <co...@leverageweb.com> wrote:
>>>
>>>
>>>>>Sometime ago this question was already asked on cocoon-dev list, 
>>>>>but setup() method is not implemented in serializers at this time ((
>>
>>...
>>
>>
>>>>Hope that clears it up,
>>>>
>>>>Geoff
>>>
>>>Yes, you are right, but implementation of  the  setup() method make serialize step more flexible.
>>
>>It was decided to purposely deny that flexibility.  You should be able 
>>achieve anything you need to with matchers and selectors.
>>
> 
> 
> Ok, you set the rules. ;))

Well, it wasn't "me" but "we" (before I was part of "we" incidentally) 
but i do think I get the logic.

However "we" (including you) set the rules, so if you think you have a 
good case for adding this feature, don't be afraid to bring it up on 
dev@cocoon.apache.org.  First, search the archives to see if you can 
find and understand the original reasoning (if not ask on dev).  Then, 
explain your use and ask for opinions about whether this should 
challenge the original decision.  Only be ready to accept alternative 
solutions which preserve other important architectural protections.

Geoff


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: dynamic "encoding" for html serialiser?

Posted by Yury Mikhienko <Yu...@mobicomk.ru>.
On Thu, 17 Jul 2003 10:25:56 -0400
Geoff Howard <co...@leverageweb.com> wrote:

> Yury Mikhienko wrote:
> > On Thu, 17 Jul 2003 09:43:27 -0400
> > Geoff Howard <co...@leverageweb.com> wrote:
> > 
> >>>Sometime ago this question was already asked on cocoon-dev list, 
> >>>but setup() method is not implemented in serializers at this time ((
> 
> ...
> 
> >>Hope that clears it up,
> >>
> >>Geoff
> > 
> > Yes, you are right, but implementation of  the  setup() method make serialize step more flexible.
> 
> It was decided to purposely deny that flexibility.  You should be able 
> achieve anything you need to with matchers and selectors.
> 

Ok, you set the rules. ;))

-- 
 
Best regards,
Yury Mikhienko.
IT engineer, ZAO "Mobicom-Kavkaz"

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: dynamic "encoding" for html serialiser?

Posted by Geoff Howard <co...@leverageweb.com>.
Yury Mikhienko wrote:
> On Thu, 17 Jul 2003 09:43:27 -0400
> Geoff Howard <co...@leverageweb.com> wrote:
> 
>>>Sometime ago this question was already asked on cocoon-dev list, 
>>>but setup() method is not implemented in serializers at this time ((

...

>>Hope that clears it up,
>>
>>Geoff
> 
> Yes, you are right, but implementation of  the  setup() method make serialize step more flexible.

It was decided to purposely deny that flexibility.  You should be able 
achieve anything you need to with matchers and selectors.

Geoff


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Session data with SessionAttributeGenerator

Posted by Paul Bowler <pa...@www.aventix.co.uk>.
I'm trying to get the <authenticate> xml block back from a successful user authenticated session object using the 
SessionAttributeGenerator.

What is the name of the session attribute that this block is stoed under. There is nothing in the documentation and 
the obvious names of 'root', 'authentication' and 'session' are not found.

Thanks,

Paul.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: dynamic "encoding" for html serialiser?

Posted by Yury Mikhienko <Yu...@mobicomk.ru>.
On Thu, 17 Jul 2003 09:43:27 -0400
Geoff Howard <co...@leverageweb.com> wrote:

> > Sometime ago this question was already asked on cocoon-dev list, 
> > but setup() method is not implemented in serializers at this time ((
> 
> Sorry, I must not be coming across clearly: you must declare the 
> encoding in the definition of your serializer in the map:components 
> section of the sitemap.  This configuration is read during configure().
> 
> <map:components>
> ...
> <map:serializers ...>
>     <map:serializer name="encoding1" 
> src="org.apache.cocoon.serialization.XMLSerializer" ...>
> 	<encoding>encoding1</encoding>
>     </map:serializer>
>     <map:serializer name="encoding2" 
> src="org.apache.cocoon.serialization.XMLSerializer" ...>
> 	<encoding>encoding2</encoding>
>     </map:serializer>
> ....
> </map:serializers>
> 
> then, in your pipeline something like:
> 
> <map:match ..>
> 	...
> 	<map:serialize type="encoding1"/>
> </map:match>
> <map:match ..>
> 	...
> 	<map:serialize type="encoding2"/>
> </map:match>
> 
> Hope that clears it up,
> 
> Geoff


Yes, you are right, but implementation of  the  setup() method make serialize step more flexible.

-- 
 
Best regards,
Yury Mikhienko.
IT engineer, ZAO "Mobicom-Kavkaz"

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: dynamic "encoding" for html serialiser?

Posted by Geoff Howard <co...@leverageweb.com>.
Yury Mikhienko wrote:
> Sometime ago this question was already asked on cocoon-dev list, 
> but setup() method is not implemented in serializers at this time ((

Sorry, I must not be coming across clearly: you must declare the 
encoding in the definition of your serializer in the map:components 
section of the sitemap.  This configuration is read during configure().

<map:components>
...
<map:serializers ...>
    <map:serializer name="encoding1" 
src="org.apache.cocoon.serialization.XMLSerializer" ...>
	<encoding>encoding1</encoding>
    </map:serializer>
    <map:serializer name="encoding2" 
src="org.apache.cocoon.serialization.XMLSerializer" ...>
	<encoding>encoding2</encoding>
    </map:serializer>
....
</map:serializers>

then, in your pipeline something like:

<map:match ..>
	...
	<map:serialize type="encoding1"/>
</map:match>
<map:match ..>
	...
	<map:serialize type="encoding2"/>
</map:match>

Hope that clears it up,

Geoff

>>You declare the encoding as part of the serializer config in the 
>>sitemap.  if you need the same serializer to use different encodings in 
>>different pipelines, you need to declare the serializer once for each of 
>>  the encodings with a different name each time.
>>
>>Geoff
>>
>>
>>Tsui, Alban wrote:
>>
>>>Hi
>>>
>>>I am trying to write a xsp page directly generating html and my page 
>>>will take in a parameter which would tell me what final encoding the 
>>>page should use. SO I tried to "manually" generate that
>>>
>>><meta Content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
>>>
>>>tag ...
>>>but my serializer seems to append
>>>
>>><meta Content="text/html; charset=UTF-8" http-equiv="Content-Type">
>>>
>>>in my final html output.
>>>
>>>i have not specified any encoding in my html serializer defintion in my 
>>>sitemap at all... and I have an entry as follows:
>>>
>>>        <map:serializers default="html">
>>>                <map:serializer logger="sitemap.serializer.xml" 
>>>mime-type="text/xml" name="xml" 
>>>src="org.apache.cocoon.serialization.XMLSerializer"/>
>>>
>>>                <map:serializer logger="sitemap.serializer.html" 
>>>mime-type="text/html" name="html" 
>>>src="org.apache.cocoon.serialization.HTMLSerializer">
>>>
>>>                        <buffer-size>1024</buffer-size>
>>>                </map:serializer>
>>>                <map:serializer logger="sitemap.serializer.svgxml" 
>>>mime-type="image/svg-xml" name="svgxml" 
>>>src="org.apache.cocoon.serialization.XMLSerializer">
>>>
>>>                        <doctype-public>-//W3C//DTD SVG 20000303 
>>>Stylable//EN</doctype-public>
>>>                        
>>><doctype-system>http://www.w3.org/TR/2000/03/WD-SVG-20000303/</doctype-system> 
>>>
>>>                </map:serializer>
>>>                <map:serializer mime-type="image/jpeg" name="svg2jpeg" 
>>>src="org.apache.cocoon.serialization.SVGSerializer">
>>>
>>>                        <parameter name="quality" type="float" 
>>>value="0.9"/>
>>>                </map:serializer>
>>>                <map:serializer mime-type="image/png" name="svg2png" 
>>>src="org.apache.cocoon.serialization.SVGSerializer"/>
>>>
>>>        </map:serializers>
>>>
>>>Is there anyway I could effect the final encoding in that meta string 
>>>generated from the serialiser from within the xsp generator?
>>>
>>>I am using version 2.0.3 cocoon.
>>>
>>>AT
>>>
>>>Join us at Cognos' biggest event of the year/ Enterprise 2003, The 
>>>Cognos Business Forum/.  Taking place in over 25 cities around the 
>>>world, it's an opportunity for Business and IT leaders to learn about 
>>>strategies for driving performance. Visit_ 
>>>http://www.cognos.com/enterprise03_ for more details.
>>>
>>>This message may contain privileged and/or confidential information.  If 
>>>you have received this e-mail in error or are not the intended 
>>>recipient, you may not use, copy, disseminate or distribute it; do not 
>>>open any attachments, delete it immediately from your system and notify 
>>>the sender promptly by e-mail that you have done so.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: dynamic "encoding" for html serialiser?

Posted by Yury Mikhienko <Yu...@mobicomk.ru>.
Sometime ago this question was already asked on cocoon-dev list, 
but setup() method is not implemented in serializers at this time ((


> You declare the encoding as part of the serializer config in the 
> sitemap.  if you need the same serializer to use different encodings in 
> different pipelines, you need to declare the serializer once for each of 
>   the encodings with a different name each time.
> 
> Geoff
> 
> 
> Tsui, Alban wrote:
> > Hi
> > 
> > I am trying to write a xsp page directly generating html and my page 
> > will take in a parameter which would tell me what final encoding the 
> > page should use. SO I tried to "manually" generate that
> > 
> > <meta Content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
> > 
> > tag ...
> > but my serializer seems to append
> > 
> > <meta Content="text/html; charset=UTF-8" http-equiv="Content-Type">
> > 
> > in my final html output.
> > 
> > i have not specified any encoding in my html serializer defintion in my 
> > sitemap at all... and I have an entry as follows:
> > 
> >         <map:serializers default="html">
> >                 <map:serializer logger="sitemap.serializer.xml" 
> > mime-type="text/xml" name="xml" 
> > src="org.apache.cocoon.serialization.XMLSerializer"/>
> > 
> >                 <map:serializer logger="sitemap.serializer.html" 
> > mime-type="text/html" name="html" 
> > src="org.apache.cocoon.serialization.HTMLSerializer">
> > 
> >                         <buffer-size>1024</buffer-size>
> >                 </map:serializer>
> >                 <map:serializer logger="sitemap.serializer.svgxml" 
> > mime-type="image/svg-xml" name="svgxml" 
> > src="org.apache.cocoon.serialization.XMLSerializer">
> > 
> >                         <doctype-public>-//W3C//DTD SVG 20000303 
> > Stylable//EN</doctype-public>
> >                         
> > <doctype-system>http://www.w3.org/TR/2000/03/WD-SVG-20000303/</doctype-system> 
> > 
> >                 </map:serializer>
> >                 <map:serializer mime-type="image/jpeg" name="svg2jpeg" 
> > src="org.apache.cocoon.serialization.SVGSerializer">
> > 
> >                         <parameter name="quality" type="float" 
> > value="0.9"/>
> >                 </map:serializer>
> >                 <map:serializer mime-type="image/png" name="svg2png" 
> > src="org.apache.cocoon.serialization.SVGSerializer"/>
> > 
> >         </map:serializers>
> > 
> > Is there anyway I could effect the final encoding in that meta string 
> > generated from the serialiser from within the xsp generator?
> > 
> > I am using version 2.0.3 cocoon.
> > 
> > AT
> > 
> > Join us at Cognos' biggest event of the year/ Enterprise 2003, The 
> > Cognos Business Forum/.  Taking place in over 25 cities around the 
> > world, it's an opportunity for Business and IT leaders to learn about 
> > strategies for driving performance. Visit_ 
> > http://www.cognos.com/enterprise03_ for more details.
> > 
> > This message may contain privileged and/or confidential information.  If 
> > you have received this e-mail in error or are not the intended 
> > recipient, you may not use, copy, disseminate or distribute it; do not 
> > open any attachments, delete it immediately from your system and notify 
> > the sender promptly by e-mail that you have done so.  Thank you.
> > 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


-- 
 
Best regards,
Yury Mikhienko.
IT engineer, ZAO "Mobicom-Kavkaz"

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: dynamic "encoding" for html serialiser?

Posted by Geoff Howard <co...@leverageweb.com>.
You declare the encoding as part of the serializer config in the 
sitemap.  if you need the same serializer to use different encodings in 
different pipelines, you need to declare the serializer once for each of 
  the encodings with a different name each time.

Geoff


Tsui, Alban wrote:
> Hi
> 
> I am trying to write a xsp page directly generating html and my page 
> will take in a parameter which would tell me what final encoding the 
> page should use. SO I tried to "manually" generate that
> 
> <meta Content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
> 
> tag ...
> but my serializer seems to append
> 
> <meta Content="text/html; charset=UTF-8" http-equiv="Content-Type">
> 
> in my final html output.
> 
> i have not specified any encoding in my html serializer defintion in my 
> sitemap at all... and I have an entry as follows:
> 
>         <map:serializers default="html">
>                 <map:serializer logger="sitemap.serializer.xml" 
> mime-type="text/xml" name="xml" 
> src="org.apache.cocoon.serialization.XMLSerializer"/>
> 
>                 <map:serializer logger="sitemap.serializer.html" 
> mime-type="text/html" name="html" 
> src="org.apache.cocoon.serialization.HTMLSerializer">
> 
>                         <buffer-size>1024</buffer-size>
>                 </map:serializer>
>                 <map:serializer logger="sitemap.serializer.svgxml" 
> mime-type="image/svg-xml" name="svgxml" 
> src="org.apache.cocoon.serialization.XMLSerializer">
> 
>                         <doctype-public>-//W3C//DTD SVG 20000303 
> Stylable//EN</doctype-public>
>                         
> <doctype-system>http://www.w3.org/TR/2000/03/WD-SVG-20000303/</doctype-system> 
> 
>                 </map:serializer>
>                 <map:serializer mime-type="image/jpeg" name="svg2jpeg" 
> src="org.apache.cocoon.serialization.SVGSerializer">
> 
>                         <parameter name="quality" type="float" 
> value="0.9"/>
>                 </map:serializer>
>                 <map:serializer mime-type="image/png" name="svg2png" 
> src="org.apache.cocoon.serialization.SVGSerializer"/>
> 
>         </map:serializers>
> 
> Is there anyway I could effect the final encoding in that meta string 
> generated from the serialiser from within the xsp generator?
> 
> I am using version 2.0.3 cocoon.
> 
> AT
> 
> Join us at Cognos' biggest event of the year/ Enterprise 2003, The 
> Cognos Business Forum/.  Taking place in over 25 cities around the 
> world, it's an opportunity for Business and IT leaders to learn about 
> strategies for driving performance. Visit_ 
> http://www.cognos.com/enterprise03_ for more details.
> 
> This message may contain privileged and/or confidential information.  If 
> you have received this e-mail in error or are not the intended 
> recipient, you may not use, copy, disseminate or distribute it; do not 
> open any attachments, delete it immediately from your system and notify 
> the sender promptly by e-mail that you have done so.  Thank you.
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org