Skip Headers
Oracle® Application Development Framework Developer's Guide
10g Release 3 (10.1.3)
B25386-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

A.6 DataBindings.cpx

The DataBindings.cpx file is created in the ViewController project the first time you drop a data control usage onto a web page in the HTML Visual Editor. The .cpx file defines the Oracle ADF binding context for the entire application and provides the metadata from which the Oracle ADF binding objects are created at runtime. When you insert a databound UI component into your document, the page will contain binding expressions that access the Oracle ADF binding objects at runtime.

If you are familiar with building ADF applications in earlier releases of JDeveloper, you'll notice that the CPX file no longer contains all the information copied from the DCX file, but only a reference to it. Therefore, if you need to make changes to the CPX file, you must edit the DCX file.

The DataBindings.cpx file appears in the /src directory of the ViewController project folder. When you double-click the file node, the binding context description appears in the XML Source Editor. (To edit the binding context parameters, use the Property Inspector and select the desired parameter in the Structure window.)

A.6.1 DataBindings.cpx Syntax

The toplevel element of the DataBindings.cpx 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-9 displays the child element hierarchy of the <DataControlConfigs> element. Note that each business service for which you have created a data control, will have its own <dataControlUsages> definition.

Figure A-9 Schema for the Structure Definition of the DataBindings.cpx File

Schema for Structure Definition of DataBindings.cpx File

The child elements have the following usages:

  • <pageMap> element maps all user interface URLs and the corresponding pageDefinitionUsage name. This map is used at runtime to map an URL to its pageDefinition.

  • <pageDefinitionUsages> element maps a PageDefinition Usage (BindingContainer instance) name to the corresponding pageDefinition definition. The id attribute represents the usage id. The path attribute represents the full path to the page definition.

  • <dataControlUsages> element declares a list of datacontrol (shortnames) and corresponding path to the datacontrol definition entries in the dcx or xcfg file.

Table A-3 describes the attributes of the DataBindings.cpx elements.

Table A-3 Attributes of the DataBindings.cpx File Elements

Element Syntax Attributes Attribute Description

<pageMap> <page /></pageMap>

path

The full directory path. Identifies the location of the user interface page.


usageId

A unique qualifier. Names the page definition id that appears in the ADF page definition file. The ADF binding servlet looks at the incoming URL requests and checks that the bindings variable is pointing to the ADF page definition associated with the URL of the incoming HTTP request.

<pageDefinitionUsages> <page/></pageDefinitionUsages>

id

A unique qualifier. References the page definition id that appears in the ADF page definition file.


path

The fully qualified package name. Identifies the location of the user interface page's ADF page definition file..

<dataControlUsages> <dc ... /></dataControlUsages>

id

A unique qualifier. Identifies the data control usage as is defined in the DataControls.dcx file.


path

The fully qualified package name. Identifies the location of the data control


A.6.2 DataBindings.cpx Sample

Example A-6 shows the syntax for the DataBindings.cpx file in the SR Demo application. It uses two session facades data controls and a URL data control. In the following code, notice the references to the data controls within the DCX. For example, <dc id="SRDemoFAQ" path="oracle.srdemo.faq.SRDemoFAQ"/> finds "SRDemoFAQ" via the data control id within DataControls.dcx.

Example A-6 DataBindings.cpx Sample

<?xml version="1.0" encoding="UTF-8" ?>
<Application xmlns="http://xmlns.oracle.com/adfm/application"
             version="10.1.3.35.65" id="DataBindings" SeparateXMLFiles="false"
             Package="oracle.srdemo.view" ClientType="Generic">
  <pageMap>
    <page path="/app/SRList.jspx" usageId="SRListPageDef"/>
    <page path="/app/SRCreate.jspx" usageId="SRCreatePageDef"/>
    <page path="/app/SRCreateConfirm.jspx" usageId="SRCreateConfirmPageDef"/>
    <page path="/app/staff/SREdit.jspx" usageId="SREditPageDef"/>
    <page path="/app/staff/SRStaffSearch.jspx" usageId="SRStaffSearchPageDef"/>
    <page path="/app/staff/SRSearch.jspx" usageId="SRSearchPageDef"/>
    <page path="/app/SRMain.jspx" usageId="SRMainPageDef"/>
    <page path="/app/management/SRManage.jspx" usageId="SRManagePageDef"/>
    <page path="/app/SRFaq.jspx" usageId="SRFaqPageDef"/>
  </pageMap>
  <pageDefinitionUsages>
    <page id="SRListPageDef"
          path="oracle.srdemo.view.pageDefs.app_SRListPageDef"/>
    <page id="UserInfoPageDef"
          path="oracle.srdemo.view.pageDefs.headless_UserInfoPageDef"/>
    <page id="SRCreatePageDef"
          path="oracle.srdemo.view.pageDefs.app_SRCreatePageDef"/>
    <page id="SRCreateConfirmPageDef"
          path="oracle.srdemo.view.pageDefs.app_SRCreateConfirmPageDef"/>
    <page id="SREditPageDef"
          path="oracle.srdemo.view.pageDefs.app_staff_SREditPageDef"/>
    <page id="SRStaffSearchPageDef"
          path="oracle.srdemo.view.pageDefs.app_staff_SRStaffSearchPageDef"/>
    <page id="SRSearchPageDef"
          path="oracle.srdemo.view.pageDefs.app_staff_SRSearchPageDef"/>
    <page id="SRMainPageDef"
          path="oracle.srdemo.view.pageDefs.app_SRMainPageDef"/>
    <page id="SRManagePageDef"
          path="oracle.srdemo.view.pageDefs.app_management_SRManagePageDef"/>
    <page id="SRFaqPageDef"
          path="oracle.srdemo.view.pageDefs.app_SRFaqPageDef"/>          
  </pageDefinitionUsages>
  <dataControlUsages>
    <dc id="SRDemoFAQ" path="oracle.srdemo.faq.SRDemoFAQ"/>
    <dc id="SRAdminFacade" path="oracle.srdemo.model.SRAdminFacade"/>
    <dc id="SRPublicFacade"
        path="oracle.srdemo.model.SRPublicFacade"/>
  </dataControlUsages>
</Application>