cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Joseph <pjos...@gmail.com>
Subject Re: how to make sitemap entries case insensitive
Date Mon, 30 Jan 2012 15:27:44 GMT
Ah...wow...ok.

I'll just ask them to make sure its lower case.  I have never seen upper 
case file extensions before and so...

Thanks for the useful info!

Paul

On 1/30/2012 10:25 AM, Robby Pelssers wrote:
>
> Hi Jasha,
>
> Matching is not the issue for him I think.   You're right that he can 
> easily match on both .BMP and .bmp but there are some open ends to this:
>
> -Is the actual file extension using (always?) lower or uppercase?
>
> -Is there any direct support in the sitemap to translate the extension 
> to the correct format?
>
> For a windows environment your solution for matching on both upper and 
> lower case will most probably work, but for any unix derivative he 
> will run into  a filenotfoundexception.
>
> Robby
>
> *From:*Jasha Joachimsthal [mailto:j.joachimsthal@onehippo.com]
> *Sent:* Monday, January 30, 2012 4:21 PM
> *To:* users@cocoon.apache.org
> *Subject:* Re: how to make sitemap entries case insensitive
>
> Hi Paul,
>
> URI's are case sensitive, so that's why the match is too. Another 
> reason is that some file systems are also case sensitive so passing a 
> wildcard would lead to different results.
>
> You can use regexp matchers to match both .bmp and .BMP in the same 
> pipeline.
>
> First configure the matcher:
>
> <map:matcher name="regexp" 
> src="org.apache.cocoon.matching.RegexpURIMatcher" 
> logger="sitemap.matching.regexp"/>
>
> Then the pipeline
>
> <map:match pattern="^(.+)[.](bmp|BMP)$" type="regexp">
>
>
> Jasha Joachimsthal
>
>
> Europe - Amsterdam - Oosteinde 11, 1017 WT Amsterdam - +31(0)20 522 4466
> US - Boston - 1 Broadway, Cambridge, MA 02142 - +1 877 414 4776 (toll 
> free)
>
> www.onehippo.com <http://www.onehippo.com/>
>
> On 30 January 2012 16:09, Paul Joseph <pjoseph@gmail.com 
> <mailto:pjoseph@gmail.com>> wrote:
>
> Hi there,
>
> The cocoon site map is case sensitive (
> http://cocoon.apache.org/2.1/userdocs/parameter-selector.html).
>
> I have the need to upload various images...I have a sitemap (parts 
> shown below).
>
> <map:match pattern="*.bmp">
> <map:read mime-type="image/bmp"
>  src="context://webtask/taskfiles/{0}"/>
> </map:match>
>
>
> However the customer tried to upload a file whose extension was in 
> CAPS. as in myimage.BMP
>
> Any way to "compactly" address this instead of duplicating all the 
> entries with their cap eqivalents?
>
> Paul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org 
> <mailto:users-unsubscribe@cocoon.apache.org>
> For additional commands, e-mail: users-help@cocoon.apache.org 
> <mailto:users-help@cocoon.apache.org>
>

Mime
View raw message