14.01.2013 Views

Oracle JHeadstart Developer's Guide - Downloads - Oracle

Oracle JHeadstart Developer's Guide - Downloads - Oracle

Oracle JHeadstart Developer's Guide - Downloads - Oracle

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The content in the header, footer, leftSide, and rightSide areas is defined in ADF Faces<br />

regions by the same name, to prevent the actual content of these areas from being<br />

duplicated in each and every page.<br />

Reference: You can download this example. See the <strong>JHeadstart</strong> Blog post<br />

‘Generating a Custom Look and Feel using <strong>JHeadstart</strong>’ at<br />

http://blogs.oracle.com/jheadstart/2006/12/22 - a122.<br />

5.9.3. Creating Custom ADF Faces Regions and using them in Generator Templates<br />

In ADF Faces 10.1.3, Regions are snippets of ADF Faces source code that are stored in<br />

separate files, and can be reused in several ADF Faces pages. <strong>JHeadstart</strong> uses these ADF<br />

Faces Regions for the application branding, the menu sections, and for example the form<br />

browse buttons (arrow buttons to navigate to the previous or next record in form layout).<br />

In general, you have to perform the following steps to customize an ADF Faces Region, if<br />

you want to make a copy of the original region:<br />

1. Create custom ADF Faces Region file<br />

2. Declare the new Region in region-metadata.xml<br />

3. Create customized version of Generator Template file that references the region,<br />

in which you refer to the new Region<br />

4. Refer to customized Generator Template in Application Definition<br />

These steps are detailed below for customizing the application logo(s). As explained in<br />

section 5.9.1 Customizing the Application Logos, it is not necessary to use this technique<br />

for the logos because <strong>JHeadstart</strong> does not overwrite the relevant region files, but it is<br />

useful to use this example for explaining the steps.<br />

5.9.3.1. Creating a Custom Region<br />

The <strong>JHeadstart</strong> logo's are referenced in the ADF Faces Region files<br />

common\regions\branding.jspx and common\regions\brandingAppContextual.jspx.<br />

As the golden rule is that you should not change files that were created by <strong>JHeadstart</strong>,<br />

the way to do this is to copy these branding region files and make customized versions of<br />

them.<br />

• Copy branding.jspx and brandingAppContextual.jspx in<br />

ViewController\public_html\common\regions to for example<br />

customBranding.jspx and customBrandingAppContextual.jspx. If you want to<br />

replace the 2 images by just 1, you only need to copy<br />

brandingAppContextual.jspx.<br />

• Copy your own logo image(s) to ViewController\images (for example, use<br />

SRBranding.gif from the <strong>Oracle</strong> SR Demo).<br />

• Change customBrandingAppContextual.jspx (and possibly customBranding.jspx<br />

too) to refer to your own image instead of the <strong>JHeadstart</strong> image.<br />

5 - 50 Generating Page Layouts <strong>JHeadstart</strong> Developer’s <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!