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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5.9.3.2. Declaring the New Region<br />

To declare these new jspx files as ADF Faces Regions, you must modify WEB-<br />

INF/region-metadata.xml.<br />

• Open WEB-INF/region-metadata.xml, find the component<br />

oracle.jheadstart.region.brandingAppContextual (and possibly<br />

oracle.jheadstart.region.branding too), and copy the complete component<br />

definition. Change the name of the component to, for example,<br />

com.mycompany.myapp.view.region.brandingAppContextual, and change the<br />

reference to the jspx file of the region.<br />

5.9.3.3. Customizing the Data Page Template<br />

Now that you have customized the branding region(s), you must ensure that the new<br />

regions are used in every generated page. You can do this by creating a customized<br />

version of the data page generator template (see also section 4.7 Using Generator<br />

Templates).<br />

• In your ViewController project, find the Resource default/page/dataPage.vm.<br />

• Open it, and Save As custom/page/dataPage.vm (for example).<br />

• In the copied dataPage template, optionally remove the (if you only want the brandingAppContextual). Change the<br />

to refer to the new region (set the<br />

regionType to the name of the new component you defined in regionmetadata.xml,<br />

for example<br />

com.mycompany.myapp.view.region.brandingAppContextual).<br />

5.9.3.4. Using the Customized Template in the Application Definition<br />

The last step is to specify this custom dataPage.vm in the Application Definition (see also<br />

section 4.7 Using Generator Templates).<br />

• Open the Application Definition editor.<br />

• On Service level, go to the Templates tab.<br />

• For DATA_PAGE, enter custom/page/dataPage.vm<br />

Now if you generate the application again, each page will have a header like this:<br />

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

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

Saved successfully!

Ooh no, something went wrong!