H Data Controls in Fusion Web Applications

This appendix describes the various types of data controls available for the Fusion web application. It also presents a brief comparison of how data access features are implemented for each type of data control.

This appendix contains the following sections:

H.1 Introduction to Data Controls

A data control is essentially a bridge that makes data from a source available to the user interface in a Fusion web application. You can use the objects in the data control to create databound user interface components.

The most commonly used types of data controls include the following:

  • ADF Business Components Data Control

    This type of data control is generated by JDeveloper when you create an application module in your ADF Business Components application.

    For more information, see Section 13.4, "Using the Data Controls Panel."

  • JavaBean Data Control

    This type of data control obtains the structure of the data from POJOs (plain, old Java objects).

    To create a JavaBean data control, right-click a Java class file (in the Application Navigator), and choose Create Data Control.

    For information about the data control objects available in a JavaBean data control, see Section H.3, "Data Control Objects."

  • EJB Data Control

    The EJB data control is essentially the same as the JavaBean data control, except that it uses features inherent in the EJB architecture to obtain the structure of the data.

    You can create an EJB data control from the New Gallery. Expand the Business Tier node, select Data Controls, choose EJB Data Control, and click OK.

    For information about the data control objects available in an EJB data control, see the Oracle Fusion Middleware Java EE Developer's Guide for Oracle Application Development Framework.

  • URL Service Data Control

    A URL service data control lets you access and consume the data stream from a specified URL. This type of data control is not updateable.

    You can create a URL Service data control from the New Gallery. Expand the Business Tier node, select Data Controls, choose URL Service Data Control, and click OK.

    For information about the data control objects available in a URL Service data control, see Section 15.2, "Exposing URL Services with ADF Data Controls."

  • Web Service Data Control

    A Web Service data control obtains the structure of the data from the WSDL for a web service.

    You can create a Web Service data control from the New Gallery. Expand the Business Tier node, select Data Controls, choose Web Service Data Control, and click OK.

    For more information, see Section 14.2, "Creating Web Service Data Controls."

  • JMX Data Control

    A JMX data control obtains the structure of the JMX MBeans from an MBean Server.

    You can create a JMX data control from the New Gallery. Expand the Business Tier node, select Data Controls, choose JMX Data Control, and click OK. For more information about creating a JMX data control, see the online help for the Create JMX Data Control wizard.

    Before you can create a JMX data control, you must first have a JMX connection. For more information about JMX connections, see the online help for the Create JMX Connection dialog.

    For information about the data control objects available in a JMX data control, see Section H.3, "Data Control Objects."

  • Placeholder Data Control

    A placeholder data control is a special type of data control that doesn't require a traditional data structure. As the name implies, it is a placeholder that can be used during UI development, and then replaced with the real data control when it becomes available.

    You can create a Placeholder data control from the New Gallery. Expand the Business Tier node, select Data Controls, choose Placeholder Data Control, and click OK.

    For more information, see Chapter 17, "Designing a Page Using Placeholder Data Controls."

H.2 Data Control Feature Implementation Comparison

The type of data control that you choose to use will impact how you implement data access features. Table H-1 provides a comparison of how you implement some commonly used data access features for each type of data control.

Table H-1 Comparison of Feature Implementation in Data Controls


ADF Business Components Data Control JavaBean
Data Control
EJB
Data Control
Web Services Data Control URL Service Data Control JMX Data Control Placeholder Data Control

af:Query

Declarative

Declarative

Declarative

Implemented programmatically

Not available

Not available

Not available

af:quickQuery

Declarative

Declarative

Declarative

Implemented programmatically

Not available

Not available

Not available

af:inputComboListOfValues

Declarative

Declarative

Declarative

Implemented programmatically

Not available

Not available

Declarative

af:Calendar

Declarative

Implemented programmatically

Implemented programmatically

Implemented programmatically

Not available

Not available

Not available

af:Media

Declarative

Implemented programmatically

Implemented programmatically

Implemented programmatically

Not available

Not available

Not available


The features that are listed in the table as "implemented programmatically" can be implemented using the necessary Java classes required to implement a business model that can be used by the specific data-entry component. For more information, refer to the Javadoc for the appropriate classes.

H.3 Data Control Objects

In the Data Controls panel, each data control object is represented by an icon. Table H-2 describes what each icon represents, where it appears in the Data Controls panel hierarchy, and what components it can be used to create.

You can design a databound user interface by dragging an item from the Data Controls panel and dropping it on a page as a specific UI component.

The objects described in Table H-2 are applicable to the JavaBean data control, the EJB data control, and the JMX data control, unless otherwise noted. For information about the data control objects available in the other types of data controls, refer to the documentation for the desired type of data control, as listed in Section H.1, "Introduction to Data Controls."

Table H-2 Data Controls Panel Icons and Object Hierarchy for JavaBeans and EJBs

Icon Name Description Used to Create...

Data control icon

Data Control

Represents a data control. You cannot use the data control itself to create UI components, but you can use the child objects listed under the data control. There may be more than one data control, each representing a logical grouping of data functions.

Typically, there is one data control for a given source (bean or EJB). However, you may have additional data controls that were created for other types of objects (for example, application modules or web services).

Serves as a container for the other objects. Not used to create anything.

Create method icon.

Create Method

Represents a built-in method that creates a new instance of an object in a data collection using the new Java constructor call. Create method icons are located in a node named after the data collection to which they belong. These data collection nodes are located in the Constructors node under the data control. The Attributes node, which appears as a child under a create method, contains all the attributes of the data collection. If the collection contains an attribute from another collection (called a foreign key in relational databases), that attribute is represented by an accessor return icon. In this case, the accessor returns a single object.

This object is not available in the JMX data control.

Creation forms.

Method icon

Method

Represents a custom method on the data control that may accept parameters, perform some action or business logic, and return data or data collections. If the method is a get method of a map and returns a data collection, a method return icon appears as a child under it. If a method requires a parameter, a folder appears under the method, which lists the required parameters.

UI actions such as buttons or links.

Method return icon.

Method Return

Represents a data collection that is returned by a custom method. A method return appears as a child under the method that returns it. The objects that appear as children under a method return may be attributes of the collection, accessor returns that represent collections related to the parent collection, other methods that perform actions related to the parent collection, and operations that can be performed on the parent collection.

Forms, tables, trees, and range navigation components.

Accessor return icon.

Accessor Return

Represents an object returned by a bean-style accessor method on the business service. An accessor method is used when the objects returned are JavaBeans. Accessor returns appear as children under method returns, other accessor returns, or in the Attributes node under built-in create methods. Accessor returns are objects that are related to the current object in the parent collection. This relationship is usually based on a common unique attribute in both objects. For example, if a method returns a collection of users, an accessor return that is a child of that collection might be a collection of service requests that are assigned to a particular user. In ADF, the relationship between parent and child collections is called a master-detail relationship. For more information about master-detail objects, see Chapter 29, "Displaying Master-Detail Data.".

Accessor returns can be either collections or single objects. For example, if a method returns a collection of service requests, one accessor return under that method might be a collection of service history details for the current service request, while another accessor return might be a single user assigned to the current service request. By default, when data controls are created from session beans over POJOs, the names of accessors that return collections end in Collection (for example, OrderCollection). The UI components available from the Data Controls panel context menu differ depending on whether the accessor return is a collection or a single object.

The children under an accessor return may be attributes of the collection or object, other accessor returns, custom methods that return a value from the collection or object, and operations that can be performed on the collection or object. The accessor returns under a built-in create method are always a single object and never have any children.

For collections: Forms, tables, trees, range navigation components, and master-detail widgets.

For single objects: Forms, master-detail widgets, and selection lists.

For single objects under a constructor: selection lists only.

Attribute icon.

Attribute

Represents a discrete data element in an object. Attributes appear as children under method returns or accessor returns.

Label, text field, and selection list components.

Data control operation icon.

Operation

Represents a built-in data control operation that performs actions on the parent object. If an operation requires a parameter, a folder appears under the method, which lists the required parameters. Data control operations are located in an Operations node under method returns or accessor returns and under the root data control node. The operations that are children of a particular method or accessor return operate on that return object only, while operations under the data control node operate on all the objects represented by the data control.

UI actions such as buttons or links.

Parameter icon.

Parameter

Represents a parameter value that is declared by the method or operation under which it appears. Parameters appear in a folder under a method or operation.

Label, text, and selection list components.