For WAP applications, different device might require
significant change between each other, so, a request
to the same template or asset might served
differently. I had a proposal to solve the problem.
Resource, template or asset will have device name in
the file name, A typical resource will appear as
AAA_BBB-CCC, where AAA is the base name of the
resource, such as the page name; BBB is the locale
representative, for example, zh, or zh_CN; and CCC is
the mobile device name. Please note that underscore
"_" is used to seperate base name and locale name, and
hyphen "-" is used for device name.

Default Template Source must change because it will
only use resource base name and locale as the key of
template cache. An implementation of ResourceLocalizer
is aware of the mobile device which can be determined
by DeviceManager from web request.


Yunfeng Hou

hivemind config
====================================
        <service-point id="WmlResourceLocalizer"
        
interface="com.newtouch.newtouchone.tapestry.wml.WmlResourceLocalizer">
                <invoke-factory>
                        <construct
                        
class="com.newtouch.newtouchone.tapestry.wml.WmlResourceLocalizerImpl">
                                <set-service property="request"
                                        
service-id="tapestry.globals.WebRequest" />
                                <set-service property="deviceManager"
                                        service-id="DeviceManager" />
                        </construct>
                </invoke-factory>
        </service-point>

    <contribution
configuration-id="tapestry.l10n.ResourceLocalizers">
        <command id="WmlResourceLocalizer"
object="service:WmlResourceLocalizer"/>
    </contribution>


        <service-point id="DeviceManager"
        
interface="com.newtouch.newtouchone.tapestry.wml.DeviceManager">
                <invoke-factory>
                        <construct
                        
class="com.newtouch.newtouchone.tapestry.wml.DefaultDeviceManager"
/>
                </invoke-factory>
        </service-point>

        
        <implementation
service-id="tapestry.parse.TemplateSource">

                <invoke-factory>
                        <construct
                        
class="com.newtouch.newtouchone.tapestry.TemplateSourceImpl">
                                <set-service property="parser"
                                        
service-id="tapestry.parse.TemplateParser" />
                                <set-service property="delegate"
                                
service-id="tapestry.parse.TemplateSourceDelegate" />
                                <set-object property="contextRoot"
                                        value="infrastructure:contextRoot" />
                                <set-service
property="componentSpecificationResolver"
                                
service-id="tapestry.page.ComponentSpecificationResolver"
/>
                                <set-object property="componentPropertySource"
                                        
value="infrastructure:componentPropertySource" />
                                <set-service property="localizer"
                                        service-id="WmlResourceLocalizer" />
                                <set-service property="resourceKeyGenerator"
service-id="WmlResourceLocalizer" />
                                <event-listener
                                        
service-id="tapestry.describe.ReportStatusHub" />
                                <event-listener
service-id="tapestry.ResetEventHub" />
                        </construct>
                </invoke-factory>

        </implementation>

===========================================================

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to