Hi Andrew,

Thanks for your suggestion. Yes, we may not need this API if we could implement @import in the skin parser. For the time being, I am planning to rename this API.

Thanks
Mamallan

Andrew Robinson wrote:
Would this be needed if we could just implement an @import in the skin parser?

Then you could have something like this:
@agent ie {
  @import url("ie.skin.css");
}

Now we could have CSS for each browser as desired, including mobile
browsers. It would be more flexible this way than changing the API
IMO.

-Andrew

On Sun, Dec 20, 2009 at 11:25 PM, Mamallan Uthaman
<[email protected]> wrote:
Hi all,

I need your valuable suggestions in renaming the following Trinidad API that
is used only in mobile development.

API Name:
skinFamilyType. It can be accessed using EL #
{requestContext.agent.skinFamilyType}

What is skinFamilyType API?
CSS-support of mobile browsers varies drastically as most of the
mobile-browsers don’t strictly follow W3C standards. After analyzing various
mobile-browsers, we have categorized  mobile-browsers based on their
CSS-support and exposed the category thru this API. Example, this API
returns 'nokiawebkit' for NokiaS60 and 'iPhonewebkit' for iPhone.

Why Renaming?
This API doesn't return any skin-family; it simply returns the category to
which a mobile-browser belongs based on the mobile-browser's CSS-support. So
the new name should reflect what it returns.

Alternate Name:
styleCategory

Typical Usage:
As CSS-support of mobile browsers varies drastically, developers usually
create their own skinning with different versions of style-classes based on
a mobile-browser's CSS-support. To handle all mobile-browsers in a single
CSS-file, developers have to include lots of style-classes and tweaking such
as @agent/@platform rules. The resulting CSS-file will be very huge, and it
is not manageable. So developers prefer to maintain separate CSS files based
on mobile-browsers’ CSS-support. By creating different skin-families with
names same as values returned by this API, developers can easily switch to a
CSS file based on a requesting mobile-browser's CSS-support.
To illustrate with an example:

trinidad-config.xml contains #{requestContext.agent.skinFamilyType}
(Remember, skinFamilyType returns 'nokiawebkit' for NokiaS60 and
'iPhonewebkit' for iPhone)

trinidad-skin.xml contains
   <skin>
        <id>iPhonewebkit</id>
        <family>iPhonewebkit</family>
        <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>
        <style-sheet-name>styles/iPhone.css</style-sheet-name>
        <! -- iPhone.css is a CSS file created by a developer to handle
iPhone -->
    </skin>
    <skin>
        <id>nokiawebkit</id>
        <family>nokiawebkit</family>
        <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>
        <style-sheet-name>styles/symbian.css</style-sheet-name>
        <! -- symbian.css is a CSS file created by a developer to handle
NokiaS60-->
    </skin>

Thanks
Mamallan

Reply via email to