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
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:
Regardless of the content protocol uses, the generation of content involves the following steps:
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 |
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:
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.
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.
The ODA provides its generated content to Business Object Wizard in two parts:
A content-metadata ( ContentMetaData) object contains information about the ODA's generated content. Business Object Wizard uses this information to determine which content-retrieval method to use to retrieve the generated content.
The ODA writes the generated content to a generated-content structure, somewhere that is accessible by the methods of the ODA class. For example, it could write the content to an array that is a member variable of the ODA class.
The method that provides the generated content depends on the content protocol that the ODA uses for a particular content type, as follows:
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.