Oracle® WebCenter Framework Building a WebCenter Application Step by Step 10g (10.1.3.2.0) Part Number B31073-01 |
|
|
View PDF |
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:
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:
In the Applications Navigator, expand the UserInterface project.
Expand the Web Content folder, then the WEB-INF folder.
Right-click adf-faces-skins.xml and select Open.
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>
Close the file.
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:
In the Applications Navigator, expand the <
SRDemoSample
>
application.
Expand the UserInterface project.
Expand the Web Content node, then the WEB-INF node.
Right-click adf-faces-config.xml and select Open.
In the Structure pane, select skin-family.
In the Property Inspector, ensure that skin-family
is set to #{skinBean.currentSkin}
.
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.