7 Creating Business Services that Call Media Object Operations (Release 9.1 Update 2)

This chapter contains the following topics:

7.1 Understanding Media Object Operations

Many of the rules for business services that call Media Object operations are the same as the rules for business services that call business functions and call database operations, but some exceptions and differences exist. The exceptions and differences are discussed in this chapter for each of the different types of operations.

You can create business services that call Media Object operations. You use the business service foundation Create Media Object Call Wizard to create these business service methods. Media Object operations include Insert, Select, and Delete. This code sample shows code that is generated by the Create Media Object Call Wizard:

//calls method which then executes jdbj call to the table selected. 
messages = insertMediaObject(context, connection, internalVO);
 

The wizard creates a generic method. You modify the signature of the method and complete the code for the objects that will be accessed for mapping to and from the Media Object operation call. The wizard creates InputVOType as a placeholder in the signature for the internal value object class name that you provide. The wizard generates unique code for each type of Media Object operation.

7.1.1 Data Types

The data types for the internal/published value objects for Media Object operations include data types that are available for business function calls or database operation calls. You use the long data type in a database operation to show how many Media objects were deleted. This table shows the new data type used for published or internal value objects that expose Media Object operations:

Published or Internal Data Type Usage
javax.activation.DataHandler Used for Media object attachments transmitted as binary data over a network.
oracle.e1.bssvfoundation.base.MOInfo Represents the metadata of the media object stored in EnterpriseOne.

7.2 Creating a Media Object Business Service

A Media Object business service contains the business logic to call a Media Object operation such as select, insert, or delete. The java code to call the Media Object operations is automatically generated by the Create Media Object Call Wizard. The code generated for each operation is unique. In the Create Media Object Call Wizard, you select the operation that you plan to implement. In addition, you must create a Media Object value object to call a Media Object operation. You use the Media Object Value Object Class Wizard to create the Media Object value object.

See the following sections in the JD Edwards EnterpriseOne Business Services Development Guide for more information:

7.2.1 Internal Value Object

The internal value object for calling a Media Object operation is created by selecting the internal option in the Media Object Value Object Class Wizard. The same internal value object can be used for calling any of the Media Object operations such as Select, Insert, or Delete. This internal value object will contain an array list of Media Object records that need to be inserted, selected, or deleted.

The following class diagram shows the business service objects for the internal business service RI_AddressBookMediaObjectProcessor:

Figure 7-1 Class diagram of the business service objects for RI_AddressBookMediaObjectProcessor.

Description of Figure 7-1 follows
Description of "Figure 7-1 Class diagram of the business service objects for RI_AddressBookMediaObjectProcessor."

7.2.2 Published Value Object

The published interface for any Media Object operation requires an input value object and an output value object. The published value object for calling any Media Object operation can be created by selecting the "publish" option in the Media Object Value Object Class Wizard. This published Media Object value object is referenced within the published input value object and the output value object classes.

7.2.2.1 Naming Conventions

For the input value object naming convention, use the verb "Insert" to preface the type of data to be processed; for example, InsertAddressBookMO. For the output value object name, use the verb phrase "ConfirmInsert" to preface the information that is processed; for example, ConfirmInsertAddressBookMO or ShowAddressBookMO.

7.2.2.2 Data Types and Structure

The input value object for a Media Object operation represents a data set that is required to perform a particular Media Object operation. The data set includes the Media Object value object. The output value object returns messages and the output data set, such as media object records for a select operation, for a particular operation. The output value object also returns any warnings that occur during business service processing. If an error occurs during processing, the system sends an error message to the published business service, and the published business service throws an exception.

This code sample shows the structure for the output value object:

public class RI_ShowAddressBook extends oracle.e1.bssv.JPR01MO1.MessageValueObject implements Serializable {
    private ABGT_Publish mediaObject = null;
…
}

This code sample shows the structure for the input value object:

public class RI_AddAddressBook extends oracle.e1.bssv.JPR01MO1.ValueObject implements Serializable {
    /**    Add the ABGT_Publish class reference to include the Mediaobject fields in the WSDL*/
        private ABGT_Publish mediaObject = null;
…
}

7.2.2.3 Class Diagram

The following class diagram shows the published business service objects for RI_AddressBookMediaObjectManager Insert operation:

Figure 7-2 Class diagram of published business service objects for RI_AddressBookMediaObjectManager Insert operation.

Description of Figure 7-2 follows
Description of "Figure 7-2 Class diagram of published business service objects for RI_AddressBookMediaObjectManager Insert operation."

The following class diagram shows the published business service objects for the RI_AddressBookMediaObjectManager Select operation:

Figure 7-3 Class diagram of published business service objects for RI_AddressBookMediaObjectManager Select operation.

Description of Figure 7-3 follows
Description of "Figure 7-3 Class diagram of published business service objects for RI_AddressBookMediaObjectManager Select operation."

The following class diagram shows the published business service objects for the RI_AddressBookMediaObjectManager Delete operation:

Figure 7-4 Class diagram of published business service objects for RI_AddressBookMediaObjectManager Delete operation.

Description of Figure 7-4 follows
Description of "Figure 7-4 Class diagram of published business service objects for RI_AddressBookMediaObjectManager Delete operation."