UIX XMLテンプレート(UIT)は、ネームスペース対応のXML文書であり、UIX XMLページにインポートして使用できる再利用可能コンポーネントを定義し、提供します。
たとえば、同じヘッダー、フッター、ページ・ナビゲーション要素を複数のページで定義せずに、こうした共通のコンポーネントを定義するUITを作成すると、このUITをUIX XMLページにインポートして共通の要素を使用することができます。
UITページすなわちUITファイルの拡張子は.uit
です。UITページはすべてのXML文書と同様に、妥当な整形式であり、UIX XML要素セマンティックとXML構文の規則を表すスキーマに従う必要があります。
UIX XMLテンプレートの開発を簡略化するには、「新規」の「ADF UIX」カテゴリに属するUITウィザードの1つを使用します。たとえば、UIX XMLで記述した基本的なUITページは次のようになります。
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>
注意:
<templateDefinition>
要素は、UIXユーザー・インタフェース・コンポーネントと同じネームスペース(http://xmlns.oracle.com/uix/ui
)に入ります。
targetNamespace
とlocalName
)を使用してテンプレート要素の名前を定義します。
formSubmitted
とformName
です。
<content>
セクションでは、テンプレートの外観を定義します。
<type>
セクションでは、テンプレート要素の構文(つまり、情報をテンプレートに渡す方法)を定義します。各UITは1つのテンプレート要素を定義します。
<type>
のbase
属性で、拡張する要素の型を指定します。たとえば、ui:pageLayout
を指定すると、ネームスペースhttp://www.example.org/demo/templates
のdemoPageLayout
が<pageLayout>
を拡張するテンプレート要素になります。つまり、テンプレート要素<demoPageLayout>
は標準の<pageLayout>
要素がサポートするすべての機能をサポートします。
<type>
セクションでは名前付きの子がある場合にこれを定義します。上でサポートするすべての属性と、こうした「base」要素以外の属性も定義します。
UIX XMLテンプレートの定義とUIX XMLでのテンプレートの使用方法の詳細は、「ADF UIX開発者ガイド」を参照してください。
ADF UIXページの操作
Webアプリケーション設計ツールの使用
Copyright © 1997, 2004, Oracle. All rights reserved.