A UIX XML template (UIT) is a namespace-aware XML document that defines and provides reusable components that may be imported and used in UIX XML pages.
For example, instead of defining the same header, footer, and page navigation elements in several UIX XML pages, you can create a UIT that defines those common components, and then import the UIT into the UIX XML pages to use the common elements.
A UIT page or file has the extension .uit
. Like any XML
document, a UIT page must be well formed and valid, complying with
schemas that describe the rules for UIX XML elements semantics and XML
syntax.
To simplify UIX XML template development, you can use one of the UIT wizards included in the ADF UIX category of the New Gallery. For example, a basic UIT page written in UIX XML would look like this:
Example of a UIT page written in UIX XML
<?xml version="1.0" encoding="windows-1252"?>
<!-- Template definition file. Add any needed namespaces.
Specify the required "targetNamespace" and "localName" attributes -->
<templateDefinition xmlns="http://xmlns.oracle.com/uix/ui"
xmlns:ui="http://xmlns.oracle.com/uix/ui"
targetNamespace="http://www.demos.org/examples"
localName="demopage"
expressionLanguage="el">
<!-- Optional section: import any needed templates
<templates>
<templateImport source=""/>
</templates>
-->
<!-- Type section. Define a "base" attribute if needed -->
<type base="ui:pageLayout">
<!-- Add any needed named children -->
<!-- Add any needed attributes -->
</type>
<!-- Content section: Define the content of the template -->
<content>
<!-- Add UINode content here to make your template valid -->
<pageLayout>
<attributeMap>
<rootAttributeMap/>
</attributeMap>
<childMap>
<rootChildMap/>
</childMap>
<contents>
<rootChild name="contents"/>
</contents>
<corporateBranding>
<image source="images/corporatebrand.gif" destination="#"/>
</corporateBranding>
<productBranding>
<image source="images/productbrand.gif" destination="#"/>
</productBranding>
<globalButtons>
<globalButtonBar>
<contents>
<globalButton icon="images/help.gif" text="Help" destination="#"/>
</contents>
</globalButtonBar>
</globalButtons>
<copyright>Copyright Oracle 2003</copyright>
<privacy>
<link text="Privacy Statement" destination="#"/>
</privacy>
<contents/>
</pageLayout>
</content>
</templateDefinition>
Notes:
<templateDefinition>
element belongs in the
same namespace for UIX user interface components (
http://xmlns.oracle.com/uix/ui
).
targetNamespace
and localName
) are used to define the name of a template element.
<type>
and <content>
.
<content>
section defines what the template
looks like.
<type>
section defines the template element
syntax, i.e., how information can be passed into the template. Each
UIT defines one template element.
base
attribute of <type>
specifies the type
of element you are extending. For example, by specifying
ui:pageLayout
, you are stating that demoPageLayout
in the namespace http://www.example.org/demo/templates
is
the template element that extends the <pageLayout>
element, i.e., the template element <demoPageLayout>
will support all of the features that a normal <pageLayout>
element would support.
<type>
section, if any, and all attributes that are supported above and
beyond those from the "base" element.
For complete information about defining UIX XML Templates and how templates are used in UIX XML pages, refer to the ADF UIX Developer's Guide.
Working with ADF UIX Pages
Working with Web Application Design Tools
Copyright © 1997, 2004, Oracle. All rights reserved.