Generating content

You can write an ODA to generate one or both of the content types listed in Table 17. The content type determines the structure of the data that the ODA generates. For an ODA to support a particular content, it must implement the appropriate content-generation interface for the ODA. Table 17 lists the content types that an ODA can support as well as the associated content-generation interface the ODA must implement.

Table 17. Content types for an ODA

Content type Description Content-generation interface
Business object definitions The ODA generates business object definitions to represent the objects in the data source. IGeneratesBoDefs
Binary files The ODA generates file objects to hold information about the generated content. IGeneratesBinFiles
Note:
With this release, an ODA must support the generation of business object definitions as its content. Therefore, it must implement the IGeneratesBoDefs interface. Additionally, the ODA can support the generation of files as its content by implementing the IGeneratesBinFiles interface.

After source nodes are selected and confirmed, Business Object Wizard enters Step 5 of the content generation. It displays the Generating Business Objects screen and passes the array of user-selected source nodes (from Step 4) to the ODA by calling the content-generation method for business object definitions, generateBoDefs(). This method generates the corresponding business object definitions for the selected source nodes. Because an ODA must support the generation of business object definitions in the on-request content protocol, Business Object Wizard always calls the generateBoDefs() method. Therefore, the ODA developer must implement this method as part of the ODA's implementation of the IGeneratesBoDefs interface.

Whether the ODA generates file content depends on whether it implements the IGeneratesBinFiles interface. If the ODA class implements this interface, the method that actually provides the generated content depends on the content protocol that the ODA uses for the file content type, as follows:

Therefore, whether Business Object Wizard calls the content-generation method for files, generateBinFiles(), depends on the following:

Note:
For more information on content protocols, see Choosing the ODA content protocol.

Regardless of the content protocol uses, the generation of content involves the following steps:

  1. Optionally, obtaining any additional information, such as verb values, as business-object properties.
  2. Generating the requested content and saving it in the generated-content structure in ODA memory.

The following sections summarize these steps. For a more detailed overview of the content-generation process, Table 18 shows where to find more information for each of the supported content types.

Table 18. Content-generation process

Content type For more information
Business object definitions Generating business object definitions
Binary files Generating files

Obtaining business-object properties

Often the ODA needs additional information before it can generate the business object definitions. The ODA can request this additional information by defining business-object properties. The ODK API represents a business-object property as an agent-property (AgentProperty) object. To collect business-object properties, the ODA can have Business Object Wizard display the BO Properties dialog box. In this dialog box, the wizard displays the business-object properties, allows updates, and writes the user-initialized properties into the ODA runtime memory, as Figure 51 shows.

To display the BO Properties dialog box, the content-generation method of the ODA calls the getBOSpecificProps() method (defined in the ODKUtility class).

Figure 54. Obtaining business-object properties

As Figure 54 shows, the getBOSpecificProps() method takes the following steps:

  1. Sends the business-object properties to Business Object Wizard, which displays them in the BO Properties dialog box.

    To send the business-object properties, the getBOSpecificProps() method sends as an argument the initialized array of agent-property (AgentProperty) objects, one object for each business-object property to display.

  2. From the BO Properties dialog box, values can be added or changed. After the Next button is clicked, the wizard sends the user-initialized business-object properties back to the getBOSpecificProps() method in the ODA.

    You can access these business-object properties within the ODA through the Java Hashtable object that getBOSpecificProps() returns. Alternatively, you can access these properties through an instance of the ODKUtility class, which provides the getBOSpecificProperty() and getAllBOSpecificProperties() methods.

The ODA can call getBOSpecificProps() repeatedly to obtain different sets of business-object properties. For more information on how to use the getBOSpecificProps() method, see Requesting business-object properties.

Providing generated content

The ODA provides its generated content to Business Object Wizard in two parts:

The method that provides the generated content depends on the content protocol that the ODA uses for a particular content type, as follows:

Note:
For more information on content protocols, see Choosing the ODA content protocol.

The following table shows where to find more information on how to provide generated content:

Content type For more information
Business object definitions Providing generated business object definitions
Binary files Providing generated files

To retrieve the generated content, Business Object Wizard calls the appropriate content-retrieval method as Table 19 shows.

Table 19. Content-retrieval methods

Content type Content-retrieval method For more information
Business object definitions IGeneratesBoDefs.getBoDefs()
Providing access to generated business object definitions
Binary files IGeneratesBinFiles.getBinFile()
Providing access to generated files

The content-retrieval method accesses the generated-content structure within the ODA object and returns specified content in an array to Business Object Wizard. Business Object Wizard must have access to the generated content before it can process the request to save the content in Step 6. For more information, see Saving content.

Copyright IBM Corp. 1997, 2003