cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastien Koechlin <skoech...@ivision.fr>
Subject Re: something that bugs me
Date Wed, 07 Nov 2001 13:36:47 GMT
Stefano Mazzocchi wrote:
> 
> giacomo wrote:
> 
> > > Thinking about it, for those like me who can't learn regexp (sorry, but
> > > I don't have that mindset), what do you think about adding something
> > > like
> > >
> > >    <map:match pattern="**images/*.{gif|jpg|png}">
> > >     <map:read src="images/{2}.gif" mime-type="image/{3}"/>
> > >    </map:match>
> >
> > You like us to mix wildcard and regex matching?
> 
> Matchers are pluggable anyway.

We can have a file to do default mapping of mime-type depending on
file extension.

	<map:readers default="resource">
	    <map:reader name="resource"
src="org.apache.cocoon.reading.ResourceReader">
	        <file type="unix" href="file:/etc/mime.types"/>
	    </map:reader>
	</map:readers>

or

	<map:readers default="resource">
	    <map:reader name="resource" src="">
	        <file type="xml" src="WEB-INF/mime-types.xml"/>
	    </map:reader>
	</map:readers>

With mime-types.xml looking like :

	<mime type="application/pdf">         pdf       </mime>
	<mime type="application/postscript">  ai,eps,ps </mime>

And then use :

	<map:match pattern="**images/*">
	    <map:read src="images/{2}"/>
	</map:match>

no more mime-type attribute, org.apache.cocoon.reading.ResourceReader
will use
the file to map mime-type using the file extension.

-- 
S├ębastien Koechlin - IVision - skoechlin@ivision.fr

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


Mime
View raw message