Skip Headers
Oracle® WebCenter Framework Building a WebCenter Application Step by Step
10g (10.1.3.2.0)

Part Number B31073-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

3 Setting Up Skins

In this chapter, you will configure your application to use the skins you downloaded as part of the demo application, so that they are available for selection when running your application.

Before you can perform the tasks in this chapter, you must have extracted the skins from the skins.zip file to the appropriate folder by performing the steps in the install.html document available as part of the SRDemo_App_Download.ZIP. This ZIP file contains two skins, myCompany and limerine, and the corresponding image files you may require. By default, the srdemo skin is available as part of the SRDemoSample_Starter application.

This chapter includes the following sections:

Step 1: Verifying that the Skins are Registered

To apply the new skins, myCompany and limerine for your application, you must first ensure that these skins are registered with your WebCenter application. For this, you must ensure that the adf-faces-skins.xml file, which contains information about all the skins available for the application, contains entries for these three skins.

For more information about skins, including how to create new skins, refer to Oracle Application Development Framework Developer's Guide.

To verify that the three new skins are registered with your application, perform the following steps:

  1. In the Applications Navigator, expand the UserInterface project.

  2. Expand the Web Content folder, then the WEB-INF folder.

  3. Right-click adf-faces-skins.xml and select Open.

  4. Ensure that the code in bold text in Example 3-1 exists in the file.

    Example 3-1 Entries for Skins in adf-faces-skins.xml

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <skins xmlns="http://xmlns.oracle.com/adf/view/faces/skin">
    
        <skin>
            <id>srdemo.desktop</id>
            <family>srdemo</family>
            <render-kit-id>oracle.adf.desktop</render-kit-id>
            <style-sheet-name>skins/srdemo/srdemo.css</style-sheet-name>
        </skin>
        <skin>
            <id>mycompany.desktop</id>
            <family>mycompany</family>
            <render-kit-id>oracle.adf.desktop</render-kit-id>
            <style-sheet-name>skins/mycompany/myCompanySkin.css</style-sheet-name>
        </skin>
        <skin>
            <id>limerine.desktop</id>
            <family>limerine</family>
            <render-kit-id>oracle.adf.desktop</render-kit-id>
            <style-sheet-name>skins/limerine/limerine.css</style-sheet-name>
        </skin>
    </skins>
    
  5. Close the file.

Step 2: Verifying that Your Application is Configured to Use the New Skins

To use a different skin, the <skin-family> tag in the adf-faces-config.xml file must have been updated with the family name of the desired skin. The adf-faces-config.xml file contains information about the skin to be used at run time. In most cases, the skin family name is hardcoded in the configuration file.

However, in our application we want the administrator to be able to select a skin at run time. For this, the skin family name in the adf-faces-config.xml file must use expression language (EL), instead of being hardcoded. This section describes the procedure to verify this.

To verify that the adf-faces-config.xml file uses an EL for the skin family name, perform the following steps:

  1. In the Applications Navigator, expand the <SRDemoSample> application.

  2. Expand the UserInterface project.

  3. Expand the Web Content node, then the WEB-INF node.

  4. Right-click adf-faces-config.xml and select Open.

  5. In the Structure pane, select skin-family.

  6. In the Property Inspector, ensure that skin-family is set to #{skinBean.currentSkin}.

Summary

In this chapter, you learned how to register new skins with your application and configure the application to use the new skins. You can now provide users the option to change the skin at run time. Chapter 11, "Building a Site Administration Page" describes the steps involved in enabling this type of customization.