You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Cassandra Bonner <cb...@yahoo.com> on 2001/09/10 07:28:20 UTC

C2B2: additional browser selectors in sitemap

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,application/vnd.wap.wmlscriptc,text/x-vCard,text/x-vcard,text/x-vcal,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

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>