cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Upayavira ...@upaya.co.uk>
Subject Re: CLI User Agent not working?
Date Wed, 03 Dec 2003 09:13:35 GMT
Sully,

Looking into the code, the way the CLI handles user agent strings does 
not make sense (and come to think of it, I have often wondered about why 
it is like that).

I have coded (but not tested _at all_) a patch that switches the CLI to 
pass the user agent and accept strings as headers). I'm afraid my dev 
environment is broken at present and I don't have the time to fix it 
just yet.

I have attached this patch, that I think should make it work. Let me 
know if you're able/not able to make anything of it.

Sorry I can't help more right now.

Regards, Upayavira

Sully wrote:

> Hi All,
>
> I'm wanting to use a different stylesheet depending if it's the CLI 
> looking at the page or a normal browser, the way I'm doing it is 
> working fine online though won't work offline, changing user agents to 
> what I'm setting the cli to is showing the correct display, however 
> when I'm generating via the CLI it's never being selected, which I can 
> only assume means that it's not passing the user-agent correctly.
>
> I'm using a clean install of 2.1.3 (latest from the website), jvm is 
> 1.4.1 running on linux
>
> I've included the relevant portions (simplified) of my sitemap below
>
> <browser name="CLI" useragent="CLI"/>
>
> <map:match.................
> .............
> <map:select type="browser">
>     <map:when test="CLI">
>         <map:transform src="stylesheets/offline.xsl"></map:transform>
>     </map:when>
>     <map:otherwise>
>         <map:transform src="stylesheets/online.xsl"></map:transform>
>     </map:otherwise>
> </map:select>
> ............
>
> and the relevant portion of cli.xconf is
>
> <user-agent>CLI 2.1</user-agent>
>
> I have attempted setting -a "CLI 2.1" on the command line without any 
> difference.
>
> if I have my browser set to CLI 2.1 then I am able to view the content 
> generated by offline.xsl
>
> any help greatly appreciated!
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


Mime
View raw message