ADF固有のプロジェクト・ファイルについて

次の図では、Oracle ADFアプリケーション用のJDeveloper設計時ツールを使用してアプリケーションをビルドする際に生成されるプロジェクト・ファイルが示されています。

Oracle ADF project files

モデル・プロジェクトのファイル

ビジネス・サービスに対してデータ・コントロールを登録する際に、DataControls.dcxファイルが作成されます。Oracle ADF Business ComponentsやOracle ADF TopLinkマッピング・データ・コントロールを登録する場合は、このファイルが生成されないことに注意してください。それらの状況では、データ・コントロールにより、生成されたサービスからメタデータが直接取得されます。

DataControls.dcx ファイルでは、Oracle ADFデータ・コントロールとして登録されたBeanのファクトリ・クラスが指定されます。EJB、Webサービス、およびBeanベースのデータ・コントロールの場合、パラメータを追加または削除するため、あるいはデータ・コントロール設定を編集するために、プロパティ・インスペクタを使用してこのファイルを編集できます。

Bean(たとえば、EJB Session Bean)をOracle ADFデータ・コントロールとして登録する際に、様々な.xmlファイルが作成されます。定義ファイルでは、Beanの使用可能な属性、アクセッサ、およびクライアント・アプリケーションから使用できるコレクションについて指定されます。開発者がこのファイルを変更するのは、アクセッサ・メソッドがコレクションを返す場合のみです。この場合、戻り型(戻り値の型)を指定する必要があります。Oracle ADF Business Componentsの場合、すべてのアクセッサの戻り型は既知であり、このステップを手動で実行する必要はないことに注意してください。

DataControls.dcxファイルの構文について

Beanベース、およびWebサービス・ベースのビジネス・サービスの場合、Modelプロジェクト・フォルダの/src/packageディレクトリで、 DataControls.dcxファイルが作成されます。アプリケーション・ナビゲータでは、このファイルが、「アプリケーション・ソース」フォルダのモデル・パッケージで表示されます。ファイル・ノードをダブルクリックすると、XMLコード・エディタでデータ・コントロールの説明が表示されます。データ・コントロール・パラメータを編集するには、プロパティ・インスペクタを使用し、構造ウィンドウで希望のパラメータを選択します。

次に、Oracle ADFビジネス・サービス、JavaBeansおよびWebサービスの各データ・コントロールを組み合せた構文を示します。


<DataControlConfigs
   id="DataControls"
   xmlns="http://xmlns.oracle.com/adfm" >
   <Contents >
      <DataControl
         id="ClassNameDataControl | AppModuleDataControl | PXWebServiceNameDataControl"

	     <!-- Indicates for the ADF design time the class to use to represent
	         the data control on the Data Control Palette. -->
         SubType="DCBC4J | DCJavaBean | DCWebService"

	     <!-- Indicates whether the data control for the business service
	          supports query-by-example. This enables the find operation choice
	          in the Data Control Palette for this data control and the associated
	          services. Not used by ADF. -->
         SupportsFindMode="true | false"

	     <!-- Indicates whether the data control for the business service
	          supports transaction semantics. This enables commit and rollback
	          operations on the data control. -->
         SupportsTransactions="true | false"

	     <!-- Oracle ADF Business Components definitions, including the
	          package, the bc4j.xcfg configuration, and the factory class. -->
         Package="model"
         Configuration="AppModuleLocal" >
         FactoryClass="oracle.adf.model.bc4j.DataControlFactoryImpl"

    	 <!-- Standard Bean definitions, including the factory class,
	          the XML definition file, and the bean class file. -->
	     FactoryClass="oracle.adf.model.generic.DataControlFactoryImpl"
         Definition="model.Class1"
         BeanClass="model.Class1" >
      </DataControl>
   </Contents>
</DataControlConfigs>    

ViewControllerプロジェクトのファイル

様々な.jsp.uixまたは.javaファイルは、クライアント・アプリケーションの表示形式ドキュメントです。ビジュアル・エディタとデータ・コントロール・パレットを使用して、Oracle ADFアプリケーションでUIを配置します。データ・バインドUIコンポーネントをドキュメントに挿入した時点で、実行時にOracle ADFバインディング・オブジェクトにアクセスするバインディング式がページに存在するようになります。UIコンポーネントのバインディング・オブジェクトで使用可能なプロパティにより実行時の動作を指定する目的で、ソース・コードの中でバインディング式を直接編集することもできます。

ビジュアル・エディタでStrutsページのフロー・ダイアグラムを最初に開いた時点で、DataBindings.cpxファイルが作成されます。.cpxファイルでは、アプリケーション全体に関するOracle ADFバインディング・コンテキストが定義されます。.cpxファイルでは、ADFバインディング・オブジェクトを実行時に作成するためのメタデータが用意されています。バインディング・コンテキストでは、アプリケーション全体にわたる、バインディングへのアクセスが用意されています。パラメータを追加または削除するため、あるいはバインディング・コンテナの設定を編集するために、プロパティ・インスペクタを使用してこのファイルを編集できます。

データ・コントロール・パレットおよびビジュアル・エディタを使用して新しいWebページまたはJClientパネルを設計するたびに、pageNameUIModel.xmlファイルが作成されます。これらのXMLファイルでは、クライアント・アプリケーションにある各表示形式ドキュメントに対してOracle ADFバインディング・コンテナが定義されています。バインディング・コンテナでは、ページ内でのバインディングへのアクセスが用意されています。したがって、各データ・バインドWebページ、または各JClientパネルに対して、1つのXMLファイルが存在することになります。表現形式ドキュメントからバインディング式を削除する場合、このファイルのバインディング定義を編集する必要が生じることがあります。

注意: JDeveloperを使用してpageName UIModel.xmlファイルを名前変更することはできませんが、JDeveloperを使用せずに、MyWork/ViewController/src/view フォルダでこのファイルを名前変更することはできます。どうしてもpageNameUIModel.xmlファイルを名前変更する場合、<Containee> id FullNameの各属性内にあるDataBindings.cpxのファイル参照も更新する必要があります。

UIModel.xmlファイルの構文について

UIModel.xmlファイルは、ViewControllerプロジェクト・フォルダの/src/viewディレクトリにあります。アプリケーション・ナビゲータでは、このファイルが、「アプリケーション・ソース」フォルダのビュー・パッケージで表示されます。ファイル・ノードをダブルクリックすると、XMLコード・エディタでバインディング・コンテナの説明が表示されます。バインディング・コンテナ・パラメータを編集するには、プロパティ・インスペクタを使用し、構造ウィンドウで希望のパラメータを選択します。

次の構文は、MyAttribute1MyAttribute2およびMyDataCollectionIteratorの各ビジネス・サービス・オブジェクトにアクセスする際に、それぞれのバインディング・オブジェクトを使用するWebページ用に生成されたものです。


<DCContainer
   id="PageNameUIModel"
   xmlns="http://xmlns.oracle.com/adfm"
   Package="view"

   <!-- Indicates whether find mode should be enabled for the page. -->
   FindMode="false | true"

   <!-- Indicates whether to check the currency of the bound collection.
        This ensures that row updates will be applied to the correct row. -->
   EnableTokenValidation="true | false" >

   <Contents >
      <DCIterator
         id="MyDataCollection1Iterator"
         Binds="BusinessServiceDataControl.MyDataCollection"
         <!-- Indicates the number of rows to display from the bound collection. -->
         RangeSize="10" >
      </DCIterator>
      <DCControl
         id="MyBusinessServiceName"
         Subtype="DCBindingType"
         IterBinding="MyDataCollection1Iterator" >
         <AttrNames>
            <Item Value="MyAttribute1" />
            <Item Value="MyAttribute2" />
         </AttrNames>
      </DCControl>
 </DCContainer>    

DataBindings.cpxファイルの構文について

DataBindings.cpxファイルは、ViewControllerプロジェクト・フォルダの/srcディレクトリにあります。アプリケーション・ナビゲータでは、「アプリケーション・ソース」フォルダでそのファイルが表示されます。ファイル・ノードをダブルクリックすると、XMLコード・エディタでバインディング・コンテキストの説明が表示されます。バインディング・コンテキスト・パラメータを編集するには、プロパティ・インスペクタを使用し、構造ウィンドウで希望のパラメータを選択します。

次に、Oracle ADFビジネス・サービス、JavaBeansおよびWebサービスの各データ・コントロールを組み合せた構文を示します。


<JboProject
   id="DataBindings"
   xmlns="http://xmlns.oracle.com/adfm"

   <!-- Indicates that the components of this project may appear
         in separate XML files. Not used by ADF. -->
   SeparateXMLFiles="false"

   <!-- Used by JClient applications to locate a bc4j.xcfg file. For backwards compatibility. -->
   Package=""

   <!-- Indicates whether the ADF bindings use generic classes or JClient-specific classes. -->
   ClientType="Generic | JClient" >

   <Contents >
      <DataControl
         id="ClassNameDataControl | AppModuleDataControl | PXWebServiceNameDataControl"

	     <!-- Indicates for the ADF design time the class to use to represent
	          the data control on the Data Control Palette. -->
         Subtype="DCBC4J | DCJavaBean | DCWebService"

	     <!-- Indicates whether the data control for the business service
	          supports query-by-example. This enables the find operation choice in
	          the Data Control Palette for this data control and the associated
	          services. Not used by ADF. -->
         SupportsFindMode="true | false"

	     <!-- Indicates whether the data control for the business service
	          supports transaction semantics. This enables commit and rollback
	          operations on the data control. -->
         SupportsTransactions="true | false"

	     <!-- Oracle ADF Business Components definitions, including the
	          package, the bc4j.xcfg configuration, and the factory class. -->
         Package="model"
         Configuration="AppModuleLocal" >
         FactoryClass="oracle.adf.model.bc4j.DataControlFactoryImpl"

	     <!-- Standard Bean definitions, including the factory class,
	          the XML definition file, and the bean class file. -->
	     FactoryClass="oracle.adf.model.generic.DataControlFactoryImpl"
         Definition="model.Class1"
         BeanClass="model.Class1" >

	     <!-- Indicates whether the Application Module synchronization will
	          use Batch mode or Immediate mode. -->
         <Parameters >
            <Parameter
               name="Sync"
               value="Batch" >
            </Parameter>
         </Parameters>
      </DataControl>

      <!-- References the binding containers to create from the UI Model
           definition files. This allows the .cpx file to create the binding
           context for the application at runtime. -->
      <Containee
         id="MyPage1UIModel"
         ObjectType="BindingContainerReference"
         FullName="view.MyPage1UIModel" >
      </Containee>
      <Containee
         id="MyPage2UIModel"
         ObjectType="BindingContainerReference"
         FullName="view.MyPage2UIModel" >
      </Containee>
          ...
   </Contents>
</JboProject>    

Oracle ADFのバインディングについて
Oracle ADFデータ・コントロールについて
データ・コントロール・パレットについて

コレクションを返すアクセッサ用のBean定義の指定
ビジネス・サービスの変更後にADFデータ・コントロールをリフレッシュ

 

Copyright © 1997, 2004, Oracle. All rights reserved.