Choosing the ODA content type

The ODK API identifies the valid content types that an ODA can support with the ContentType class. This class contains static member variables for each of the supported content types, as Table 31 shows.

Table 31. How content types are represented

Content type ContentType member variable
Business object definitions BusinessObject
Binary files BinaryFile

The ContentType class simulates an enumerated list of the supported ODA content types. For example, a content-type object that represents business object definitions would use only the BusinessObject member variable, as follows:

ContentType.BusinessObject
 

To provide support for generation of a particular content type, an ODA must implement the appropriate content-generation interface, as listed in Table 17. Every ODA must support generation of business object definitions. It can optionally also support generation of binary files as its content. The content-generation interfaces contain the kinds of methods listed in Table 32. As part of the implementation of the content-generation interface, you must implement these methods.

Table 32.

Methods in a content-generation interface
Method Method purpose IGeneratesBoDefs
IGeneratesBinFiles
Source-node-generation method Business Object Wizard calls this method to obtain the source-node hierarchy that it displays to the user (Step 3: Select Source). getTreeNodes() None
Content-generation method Business Object Wizard calls this method to initiate generation of the specified content for the source data (Step 5: Generating Business Objects). generateBoDefs() generateBinFiles()
Content-retrieval method Business Object Wizard calls this method to retrieve the generated content from ODA memory (Step 5: Generating Business Objects). getBoDefs() getBinFile()

To determine which content-generation interface's method to call, Business Object Wizard checks the ODA's metadata. One of the components of this metadata is the supportedContent member variable, which is initialized by the AgentMetaData() constructor, called within the ODA's getMetaData() method. For more information, see Initializing ODA metadata.

Table 33 shows the information that this chapter provides on how to implement methods in a content-generation interface.

Table 33. How to develop a content-generation interface

Content-generation interface For more information
IGeneratesBoDefs Generating business object definitions as content
IGeneratesBinFiles Generating binary files as content

Copyright IBM Corp. 1997, 2003