cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <cziege...@sundn.de>
Subject AW: C2B2: additional browser selectors in sitemap
Date Mon, 17 Sep 2001 08:50:12 GMT
Hi Cass,

I just evaluated the browser selector and in my test case it worked
as expected.
The Browser selector (org.apache.cocoon.selection.BrowserSelectorFactory)
does not use the browser.xml (This is used by the xslt transformer).

The browser selector uses the configuration of the sitemap, so your
changes to the sitemap.xmap should be used. You can verify this by
looking at the compiled sitemap which is located in the working
directory of your servlet engine.

I would suggest that you change the BrowserSelectorFactory: Add some
debugging methods to the generateMethodSource() which print out the
queried user agent and the values tested against (the pattern array).
This should show very quickly if there is a bug in the selector or
not. (I can't test it here, as I only have the usual html browsers
at hand).

HTH


Carsten

Open Source Group                        sunShine - b:Integrated
================================================================
Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
www.sundn.de                          mailto: cziegeler@sundn.de
================================================================


> Cassandra Bonner wrote:
>
>
> Hi,
>
> Apologies in advance if I shouldn't send this to cocoon-dev, but I
> believe this may be a bug/known issue.  Before submitting as a bug, I
> thought I'd forward this on to cocoon-dev as I haven't received any
> response from cocoon-users.
>
> In short (details in fwd'd msg below) I believe that the
> browser/media selectors within the sitemap are no longer being looked
> at (but rather hardcoded from the browser.xml prior to compilation).
> An explanation of whether this is working as desired (or if it's user
> error, etc.) will be greatly appreciated.  As Australia's second
> largest telco, we'd need the ability to add entries on a continual,
> configurable basis.  Therefore the lack of this configurability means
> that we may have to investigate another package (which we really
> don't want to have to do).
>
> tia,
> cass
>
>
> --- Cassandra Bonner <cbonner_98@yahoo.com> wrote:
> > Date: Sun, 9 Sep 2001 22:28:20 -0700 (PDT)
> > From: Cassandra Bonner <cbonner_98@yahoo.com>
> > Subject: C2B2: additional browser selectors in sitemap
> > To: cocoon-users@xml.apache.org
> >
> > Hi,
> >
> > We've recently upgraded from cocoon1 to cocoon2 beta 2, and I have
> > a
> > question about the browser mapping in the sitemap.  Has anyone else
> > noticed that the 'Selectors' browser mappings seem to be
> > "hard-coded", and additions/deletions to the entries in
> > sitemap.xmap
> > seem to be conveniently ignored.  Hopefully this is user error, but
> > from looking at BrowserImpl, I don't think it is.
> >
> > Has anyone sucessfully added additional "browser" entries as
> > selectors (or removed any for that matter).  If so, was there any
> > special setup needed?  OR - does anyone know if this is a known
> > issue
> > (I've searched and searched and haven't seen anyting) and when it
> > might be fixed?  We will need to add a number of entries to the
> > browser entries, as we have a number of requirements for specific
> > phones and/or PDA's that are not listed (e.g. send more bytes to an
> > Ericsson R380 than other wap devices).
> >
> > Here is my setup in sitemap.conf and some info that I'm printing
> > out
> > for each request for debugging purposes.  NOTE:  just to avoid
> > confusion, C2 is working fine for the user-agents supplied by
> > default
> > (i.e. those provided in browser.xml before compilation of c2), but
> > seems to ignore additional browsers supplied as selectors.  Note
> > that
> > I've removed 'explorer' as a test in my sitemap, but it still picks
> > up explorer as a media type, confirming that it's not looking at
> > the
> > sitemap for the "db" of browsers.
> >
> > SITEMAP
> > ========
> >
> > <map:selectors default="browser">
> >    <map:selector name="browser"
> > src="org.apache.cocoon.selection.BrowserSelectorFactory">
> >
> >     <browser name="mozilla5" useragent="Netscape6/"/>
> >     <browser name="pocketexplorer" useragent="MSPIE"/>
> >     <browser name="handweb" useragent="HandHTTP"/>
> >     <browser name="avantgo" useragent="AvantGo"/>
> >     <browser name="imode" useragent="DoCoMo"/>
> >     <browser name="opera" useragent="Opera"/>
> >     <browser name="lynx" useragent="Lynx"/>
> >     <browser name="java" useragent="Java"/>
> >     <browser name="wap" useragent="Nokia"/>
> >     <browser name="wap" useragent="UP"/>
> >     <browser name="wap" useragent="Wapalizer"/>
> >
> >      <! --
> >         ADDITION FOR R380
> >      -->
> >     <browser name="wapR380" useragent="R380"/>
> >     <browser name="mozilla5" useragent="Mozilla/5"/>
> >     <browser name="netscape" useragent="Mozilla"/>
> >    </map:selector>
> >     .
> >     .
> >     .
> >   </map:selectors>
> >
> >
> > <map:match pattern="news/*.xml">
> >     <map:generate type="serverpages"
> > src="nextgen/xml/news/{1}.xml"/>
> >     <map:select>
> >       <map:when test="wap">
> >         <map:transform src="nextgen/xsl/news/{1}2wap.xsl"/>
> >         <map:serialize type="wap"/>
> >       </map:when>
> >       <map:when test="wapR380">
> >         <map:transform src="nextgen/xsl/news/{1}2r380.xsl"/>
> >         <map:serialize type="wap"/>
> >       </map:when>
> >       <map:when test="netscape">
> >         <map:transform src="nextgen/xsl/news/{1}2netscape.xsl"/>
> >         <map:serialize type="html"/>
> >       </map:when>
> >       <map:when test="explorer">
> >         <map:transform src="nextgen/xsl/news/{1}2netscape.xsl"/>
> >         <map:serialize type="html"/>
> >       </map:when>
> >       <map:otherwise>
> >         <map:transform src="nextgen/xsl/news/{1}2wap.xsl"/>
> >         <map:serialize type="wap"/>
> >       </map:otherwise>
> >     </map:select>
> >    </map:match>
> >
> >
> > ==============================================================
> > Some info printed out for each request for various browsers
> > ==============================================================
> >
> > R380
> > ======
> >
> > user agent = R380 2.0 WAP1.1
> > accept type = text/vnd.wap.wml, text/vnd.wap.wmlscript,
> > application/vnd.wap.wmlc, application/vnd.wap.wbxml,
> > application/vnd.wap.wmlscriptc, */*
> > text/wml
> > [#document: null]
> > text/vnd.wap.wml
> > wap
> > media = wap  //NOTE THAT THIS SHOULD PICK UP R380
> >
> > IE
> > ===
> > user agent = Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
> > accept type = */*
> > text/html
> > [#document: null]
> > text/html
> > explorer
> > MSIE
> > media = explorer  //EXPLORER ISN'T IN MY SITEMAP ANYMORE.
> > element = browser
> >
> >
> >
> > Netscape 6.1
> > =============
> >
> > user agent = Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;
> > rv:0.9.2) Gecko/20010726 Netscape6/6.1
> >
> > accept type = text/xml, application/xml, application/xhtml+xml,
> > text/html;q=0.9, image/png, image/jpeg, image/gif;q=0.2,
> > text/plain;q=0.8, text/css, */*;q=0.1
> >
> > (MEDIA NOT POPULATED FOR Notscape 6.1 - I think because of accept
> > type)
> >
> > Netscape 6.0
> > =============
> > user agent = Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; m18)
> > Gecko/20010131 Netscape6/6.01
> > accept type = */*
> > text/html
> > [#document: null]
> > text/html
> > html
> > media = html
> >
> > Wap Toolkit
> > ===========
> > user agent = Nokia-WAP-Toolkit/2.1
> > accept type =
> >
> text/vnd.wap.wml,text/vnd.wap.wmlscript,application/vnd.wap.wmlc,a
> pplication/vnd.wap.wmlscriptc,text/x-vCard,text/x-vcard,text/x-vca
> l,text/x-vCalendar,text/x-vcalendar,image/vnd.wap.wbmp,application
/vnd.wap.wbxml,application/vnd.wap.multipart.mixed,multipart/mixed,image/gif
,image/jpeg
> > text/wml
> > [#document: null]
> > Nokia
> > text/vnd.wap.wml
> > wap
> > Nokia
> > media = wap
> > element = browser
> >
> >
> > thanks in advance,
> > cass
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Get email alerts & NEW webcam video instant messaging with Yahoo!
> > Messenger
> > http://im.yahoo.com
> >
>
>
> __________________________________________________
> Terrorist Attacks on U.S. - How can you help?
> Donate cash, emergency relief information
> http://dailynews.yahoo.com/fc/US/Emergency_Information/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>


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


Mime
View raw message