Hm, I am not quiet sure, but it seems to me that you are using two
different approaches for detecting the user agent: the browser selector
and the "browser detection" of the xslt transformer.
The first one (browser selector) only uses the sitemap configuration
whereas the xslt transformer only uses the browser.xml. 
So, I would suggest that you first test only the browser selector in 
the sitemap, which means, you add your devices to the configuration
and test only if the browser selector chooses your correct stylesheet.
If this does not work, then it's a bug and we will fix it.
However, if this works, the second test is if the browser.xml configuration
works. For this test it's best to not use the browser selector in the
sitemap and only use a simple stylesheet printing out the values.

Please correct me anyone if I am wrong, but I think you only need one
of the both approaches. The browser selector is for use in the sitemap
and the browser.xml for use in an stylesheet.

I hope this helps,

Carsten



> Cassandra Bonner wrote:
> 
> Hi Carsten,
> 
> Thank you for the response.  I have taken your advise and printed out
> some debugging in both BrowserSelectorFactory as well as BrowserImpl.
>  I feel that this confirms there is an issue with selecting the
> appropriate media/browser.
> 
> I know that you've said browser.xml is only used by XSLT transformer,
> but while selecting the media/browser in BrowserImpl, it's only
> looking at the browsers in browsers.xml (see printout below), which
> does not pick up additions to 
> 
> This can be tested easily by adding a new BrowserSelector, creating a
> specific stylesheet for it, and passing in "user-agent='test user
> agent'.  I have put simple changes to stylesheets for a Phillips and
> Ericsson phone, but it's picking up the generic wap stylesheet. I
> haven't included my sitemap setup as it's the same as the original
> email, except that i've added an additional PHIL entry for a philips
> phone.
> 
> Within BrowserSelectorFactory, reading from sitemap (this part seems
> to work fine):
> 
> node attr, wap equals test :: wap
> node attr, wap equals test :: wap
> node attr, wap equals test :: wap
> node attr, netscape equals test :: netscape
> node attr, wap equals test :: wap
> node attr, wap equals test :: wap
> node attr, wap equals test :: wap
> node attr, wapR380 equals test :: wapR380
> node attr, netscape equals test :: netscape
> 
> 
> BrowserImpl 
> ===========
> - using 380 as user-agent.  Also tested via actual wap phone and
> issue is the same.  Notice that it only compares against the listings
> in browser.xml, not the entries in sitemap.  The media type
> determined here is than used through the fulfillment of the request,
> resulting in the
> 
> 
> WITHIN IN BROWSERIMPL:: COMPOSE
> user agent = 380 (from request)
> accept type = */* (from request)
> user agent = UP.Browserand  userAgent = 380
> user agent = Nokiaand  userAgent = 380
> user agent = MSPIEand  userAgent = 380
> user agent = MSIEand  userAgent = 380
> user agent = MO01and  userAgent = 380
> user agent = HandHTTPand  userAgent = 380
> 
> ====
> The user agent didn't match any of the user agents in the db
> ====
> **It should have, 380 is one of my entries in sitemap (see below)
> 
> no browser match - media = */*and currentType = text/html
> no browser match - media = */*and currentType = text/vnd.wap.wml
> text/html  (because i'm doing this from IE, forcing user-agent and
> passing in 380).
> 
> Here's the results when i don't pass in the user-agent.
> 
> WITHIN IN BROWSERIMPL:: COMPOSE
> user agent = Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
> accept type = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
> application/vnd.ms-excel, application/msword,
> application/vnd.ms-powerpoint, */*
> user agent = UP.Browser and  userAgent = Mozilla/4.0 (compatible;
> MSIE 5.01; Windows NT 5.0)
> user agent = Nokia and  userAgent = Mozilla/4.0 (compatible; MSIE
> 5.01; Windows NT 5.0)
> user agent = MSPIE and  userAgent = Mozilla/4.0 (compatible; MSIE
> 5.01; Windows NT 5.0)
> user agent = MSIE and  userAgent = Mozilla/4.0 (compatible; MSIE
> 5.01; Windows NT 5.0)
> 
> ====================================================================
> Matches only bc MSIE is in browsers.xml (but it's not in my sitemap)
> =====================================================================
> MATCH ::: userAgent match - ua = MSIE and userAgent = Mozilla/4.0
> (compatible; MSIE 5.01; Windows NT 5.0)
> text/html
> 
> 
> If anyone can take a look at this and test by adding an additional
> Selector in your sitemap, and an additional "when" clause for the new
> user-agent, creating an "altered" stylesheet (such as an additional
> statement to confirm the stylesheet is picked up) for this new
> agent(ie media), and simply pass in "?user-agent='test useragent' or
> use an actual device is possible, I think you'll confirm that the
> issue exists.  thanks in advance,
> 
> cass
> 
> 
> --- Carsten Ziegeler <[EMAIL PROTECTED]> wrote:
> > 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: [EMAIL PROTECTED]
> > ================================================================
> > 
> > 
> > > 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 <[EMAIL PROTECTED]> wrote:
> > > > Date: Sun, 9 Sep 2001 22:28:20 -0700 (PDT)
> > > > From: Cassandra Bonner <[EMAIL PROTECTED]>
> > > > Subject: C2B2: additional browser selectors in sitemap
> > > > To: [EMAIL PROTECTED]
> > > >
> > > > 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)
> > 
> === message truncated ===
> 
> 
> __________________________________________________
> 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: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to