Skip Headers

Oracle® Application Development Framework Developer's Guide 10g Release 3 (10.1.3) B25386-01 |
| Home | Solution Area | Contents | Index

Previous | Next |

# A.4 DataControls.dcx

The DataControls.dcx file is created in the /src/package directory of the data model project folder when you create data controls on the business services. There can be one .dcx file for each model project. The .dcx file identifies the Oracle ADF model layer data control classes that facilitate the interaction between the client and the available business service. There will be one data control definition for each data control type used in the project.

The JDeveloper design time maintains path information for the DataControls.dcx file in the adfm.xml registry file located in the model project's META-INF folder. When you create a data control, JDeveloper will automatically update this file.

In the case of EJB, web services, and bean-based data controls, you can edit this file in the Property Inspector to alter data control settings. For example, you can use the .dcx file to customize the global properties of each data control, such as whether to turn on/off sorting. See Table A-1 for details about the attributes.

The Application Navigator displays the .dcx file in the default package of the Application Sources folder. When you double-click the file node, the data control description appears in the XML Source Editor. To edit the data control attributes, use the Property Inspector and select the desired attribute in the Structure window.

## A.4.1 Syntax of the DataControls.dcx File

The toplevel element of the DataControls.dcx file is <DataControlConfigs>:

    <DataControlConfigs xmlns="http://xmlns.oracle.com/adfm/configuration"
                        version="10.1.3.35.65" Package="oracle.srdemo.model"
                        id="DataControls">

where the XML namespace attribute (xmlns) specifies the URI to which the data controls bind at runtime. Only the package name is editable; all other attributes should have the values shown.

Figure A-3 displays the the toplevel <DataControlConfigs> element. Note that the BaseDataControl element is a placeholder for the concrete data control types. In the SRDemo application, the data control type is the AdapterDataControl.

Figure A-3 Schema Overview for DataControl.dcx

Figure A-4 displays the <AdapterDataControl> element that substitutes for the placeholder <BaseDataControlType> element. Note that each business service for which you have created a data control, will have its own <AdapterDataControl> definition.

Figure A-4 Schema Overview for Adapter Data Control in DataControl.dcx

The child elements have the following usages:

- <AdapterDataControl> created by the Adapter Data Control to define properties of the data control. The properties of the data control definition varies with the business service for which the data control is created.

- <CreatableTypes> defines types from which a constructor method may be called. For example, a type may be an EJB, TopLink object, JavaBean, or Web Service. Contains one or more child elements <TypeInfo>.

- <Source> defines the service for which the data control is created. Used only in the case of adapter-based data controls, such as EJB session facade data controls. In the case of the EJB session facade, contains the child element <ejb-definition>.

Table A-1 describes the attributes of the DataControls.dcx elements.

Table A-1 DataControls.dcx File Metadata

Element Syntax | Attributes | Attribute Description
--- | --- | ---
<AdapterDataControl> | BeanClass | Fully qualified package name. Identifies the class for which the data control is created. In the case of the EJB session facade, this the session bean
| Definition | Identifies the class for which the data control is created. This is used for backward compatibility.
| FactoryClass | Fully qualified package name. Identifies the ADF runtime factory class that creates an instance of the data control.
| id | Unique identifier. Referenced by the DataBindings.cpx file.
| ImplDef | Internal.
| SupportsFindMode | Determines whether the data control supports preparing queries with user supplied criteria when preparing ADF iterator binding objects. Default is true for EJB session facade beans. Set to false if you want to globally prevent all iterator-bound web pages in the application from operating in find mode.
| SupportsRangeSize | Determines whether the data control supports returning a user-defined number of data objects when preparing ADF iterator binding objects. Default is false for EJB session facade beans.
| SupportResetState | Determines whether the data control supports resetting the state. Default is false for EJB session facade beans; not supported.
| SupportsSortCollection | Determines whether the data control supports data object sorting on the service collection. Default is false for EJB session facade beans; not supported for collections exposed by EJB session facade finder methods.
| SupportTransaction | Determines whether the data control supports create, edit, and delete operations on the business service. Default is true for EJB session facade beans.
| SupportsUpdates | Determines whether the data control supports write operations. Default is true for EJB session facade beans.
| xmlns | URI used to identify the data control configuration namespace. At runtime, the data control object locates the runtime factory responsible for creating the definition objects for elements in its namespace.
`<CreateableTypes> <TypeInfo /></CreateableTypes>` | FullName | Identifies the full type name of the Creatable type. This element is defined only for those types that have constructors that appear in the Constructors folder of the Data Control Palette
`<Source> <ejb-definition />`</Source> | ejb-business-interface | The Remote or Local interface that will be used to communicate with this Session bean
| ejb-interface-type | Either local or remote.
| ejb-name | The EJB's name.
| ejb-type | The EJB's type, currently only Session is supported.
| ejb-version | Either 3.0, 2.1, or 2.0.
| xmlns | This is for internal use only and refers to the schema namespace; this cannot be updated.

## A.4.2 Sample of the DataControls.dcx File

Example A-1 shows the syntax for a sample data control definition file. Notice that there are two session beans identified by the AdapterDataControl: SRPublicFacade and SRAdminFacade.

Example A-1 DataControls.dcx Sample File

    <?xml version="1.0" encoding="UTF-8" ?>
    <DataControlConfigs xmlns="http://xmlns.oracle.com/adfm/configuration"
                        version="10.1.3.35.65" Package="oracle.srdemo.model"
                        id="DataControls">
      <AdapterDataControl id="SRPublicFacade"
                        FactoryClass="oracle.adf.model.adapter.DataControlFactoryImpl"
                          ImplDef="oracle.adfinternal.model.adapter.ejb.EjbDefinition"
                          SupportsTransactions="true" SupportsSortCollection="false"
                          SupportsResetState="false" SupportsRangesize="false"
                          SupportsFindMode="true"
                          Definition="oracle.srdemo.model.SRPublicFacade"
                          BeanClass="oracle.srdemo.model.SRPublicFacade"
                          xmlns="http://xmlns.oracle.com/adfm/datacontrol"
                          SupportsUpdates="true">
        <CreatableTypes>
          <TypeInfo FullName="oracle.srdemo.model.entities.Product"/>
          <TypeInfo FullName="oracle.srdemo.model.entities.ExpertiseArea"/>
          <TypeInfo FullName="oracle.srdemo.model.entities.ServiceHistory"/>
          <TypeInfo FullName="oracle.srdemo.model.entities.User"/>
          <TypeInfo FullName="oracle.srdemo.model.entities.ServiceRequest"/>
        </CreatableTypes>
        <Source>
          <ejb-definition ejb-version="3.0" ejb-name="SRPublicFacade"
                          ejb-type="Session" ejb-interface-type="local"
                          ejb-business-interface="oracle.srdemo.model.SRPublicFacade"
                          xmlns="http://xmlns.oracle.com/adfm/adapter/ejb"/>
        </Source>
      </AdapterDataControl>
      <AdapterDataControl id="SRAdminFacade"
                        FactoryClass="oracle.adf.model.adapter.DataControlFactoryImpl"
                          ImplDef="oracle.adfinternal.model.adapter.ejb.EjbDefinition"
                          SupportsTransactions="true" SupportsSortCollection="false"
                          SupportsResetState="false" SupportsRangesize="false"
                          SupportsFindMode="true"
                          Definition="oracle.srdemo.model.SRAdminFacade"
                          BeanClass="oracle.srdemo.model.SRAdminFacade"
                          xmlns="http://xmlns.oracle.com/adfm/datacontrol"
                          SupportsUpdates="true">
        <CreatableTypes>
          <TypeInfo FullName="oracle.srdemo.model.entities.ServiceHistory"/>
          <TypeInfo FullName="oracle.srdemo.model.entities.User"/>
          <TypeInfo FullName="oracle.srdemo.model.entities.ServiceRequest"/>
          <TypeInfo FullName="oracle.srdemo.model.entities.Product"/>
          <TypeInfo FullName="oracle.srdemo.model.entities.ExpertiseArea"/>
        </CreatableTypes>
        <Source>
          <ejb-definition ejb-version="3.0" ejb-name="SRAdminFacade"
                          ejb-type="Session" ejb-interface-type="local"
                          ejb-business-interface="oracle.srdemo.model.SRAdminFacade"
                          xmlns="http://xmlns.oracle.com/adfm/adapter/ejb"/>
        </Source>
      </AdapterDataControl>
    </DataControlConfigs>

## A.4.3 Sample of the adfm.xml File

The `adfm.xml` file is the registry for the data controls in the JDeveloper design time. For instance, the Data Control Palette uses the supplied path to facilitate locating the data controls used in the model project. When you create a data control, JDeveloper will automatically update this file located in the META-INF folder of the data model project.

Example A-2 shows the data control registry syntax.

Example A-2 Data Control Registry Syntax

    <MetadataDirectory xmlns="http://xmlns.oracle.com/adfm/metainf"
                 version="10.1.3.xx.xx">
            <DataControlRegistry path="test/model/DataControls.dcx"/>
    </MetadataDirectory>