cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lyudmila Balakireva <lu...@lanl.gov>
Subject serializer and mime-type
Date Mon, 14 Jul 2003 18:17:34 GMT

>Hello,
>  Is it possible to set mime-type  to serializer dynamically, and have 
> just one basic  serializer?
>As you can see from example below I use the same serializer and only 
>mimetype is different .
>
>We have XML tape with binary objects encoded  as base64. I wrote the 
>custom serializer (text serializer)  where
>I put base 64 decording  applyed to the output stream.
>I  need to be able extract   any binary object with any mime-type like 
>pdf, jpeg, gif etc.
>In sitemap I use mapping
>
>  <!-- All base64 serializers -->
>             <map:serializer   mime-type="application/pdf" 
> name="base64pdf"   logger="sitemap.serializer.text" 
> src="mot.Base64Serializer"></map:serializer>
>             <map:serializer   mime-type="image/gif"  name="giftext" 
> logger="sitemap.serializer.text" src="mot.Base64Serializer"> </map:serializer>
>             <map:serializer   mime-type="application/MARC" 
> name="base64MARC"  logger="sitemap.serializer.text" 
> src="mot.Base64Serializer"> </map:serializer>
>            <map:serializer   mime-type="text/text"  name="base64text" 
> logger="sitemap.serializer.text"  src="mot.Base64Serializer"> </map:serializer>
>              <map:serializer   mime-type="text/xml"  name="base64xml" 
> logger="sitemap.serializer.text"  src="mot.Base64Serializer"> </map:serializer>
>   <map:serializer   mime-type="image/jpeg"  name="base64jpg" 
> logger="sitemap.serializer.text"  src="mot.Base64Serializer"> </map:serializer>
>
>..... more
>
>and in pipe line:
>
>     <map:resource name="serialize-base64">
>                  <map:select type="parameter">
>                 <map:parameter name="parameter-selector-test" 
> value="{mType}" />
>                 <map:when test="application/pdf">
>                 <map:serialize type="base64pdf" />
>                 </map:when>
>                 <map:when test="image/jpeg">
>                 <map:serialize type="base64jpg" />
>                 </map:when>
>                 <map:when test="application/MARC">
>                 <map:serialize type="base64MARC" />
>                 </map:when>
>                     ..... more
>                   <map:otherwise>
>                 <map:serialize type="base64text" />
>                 </map:otherwise>
>                 </map:select>
>               </map:resource>
>
>
>Thank you , Luda


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


Mime
View raw message