An ODA can generate a particular content type using either of the content protocols listed in Table 34. The content protocol determines how the ODA interacts with Business Object Wizard to generate the supported content; that is, it determines whether Business Object Wizard can explicitly initiate content generation from the ODA.
Table 34. Content protocols for an ODA
To support content protocols, your ODA must take the following steps:
Both the IGeneratesBoDefs and IGeneratesBinFiles interfaces are extensions of the IGeneratesContent interface. Therefore, they both inherit the single method that IGeneratesContent defines, getContentProtocol(). As part of the implementation of the ODA's content-generation interface, you must implement the getContentProtocol() method to indicate which of the content protocols your ODA will use for its supported content types.
The getContentProtocol() method accepts as an argument a ContentType object, which identifies a content type that the ODA supports. The getContentProtocol() method returns the content protocol that the ODA supports for this specified content type. It returns the supported content protocol as one of the content-protocol constants (shown in Table 34). These constants are defined in the ODKConstant interface.
Figure 58 shows an implementation of getContentProtocol() that indicates the ODA supports the callback protocol for the generation of files and the on-request protocol for the generation of business object definitions.
Figure 58. Indicating supported content protocols
public long getContentProtocol(ContentType contentType) { if (contentType == ContentType.BinaryFile) return ODKConstant.CONTENT_PROTOCOL_CALLBACK; else return ODKConstant.CONTENT_PROTOCOL_ONREQUEST; }
The implementation of the content-generation method depends on the content protocol that the content type supports, as Table 35 shows.
Table 35. Content protocols and the content-generation method
Table 36 shows the information that this chapter provides on how to implement the content-generation methods.
Table 36. How to develop a content-generation method
Content-generation method | For more information |
---|---|
IGeneratesBoDefs.generateBODefs() | Defining the generateBoDefs() method |
IGeneratesBinFiles.generateBinFiles() | Defining the generateBinFiles() method |