APIs Defined in ECX_ATTACHMENT

register_attachment

PL/SQL Syntax

procedure register_attachment
(i_entity_name in varchar2,
 i_pk1_value in varchar2,
 i_pk2_value in varchar2,
 i_pk3_value in varchar2,
 i_pk4_value in varchar2,
 i_pk5_value in varchar2,
 i_file_id in number,
 i_data_type in number,
 x_cid out varchar2);

Description

Called by message maps for outbound documents to register the correlation of attachment(s) to an outbound business document.

This API assumes the attachment has been defined in the Oracle Foundation module. The required input to the API are values returned when the attachment was deposited in FND.

Arguments (input)

i_entity_name Entity name from the FND_LOBS table used to compose the x_cid value.
i_pk1_value Key value from the FND_LOBS table used to compose the x_cid value.
i_pk2_value Key value from the FND_LOBS table used to compose the x_cid value.
i_pk3_value Key value from the FND_LOBS table used to compose the x_cid value.
i_pk4_value Key value from the FND_LOBS table used to compose the x_cid value.
i_pk5_value Key value from the FND_LOBS table used to compose the x_cid value.
i_file_id File identifier from the FND_LOBS table used to determine the file_name value from the FND_LOBS table. The file_name is used to compose the x_cid value.
i_data_type Identifies the data type of the attachment file. The valid value is BLOB. Currently, only the ecx_attachment.embedded_lob_data_type value is supported (only

Arguments (output)

x_cid A unique identifier for the attachment within a given outbound document provided by FND when the attachment was deposited. The value is constructed using the formulate_content_id API by concatenating i_entity_name, i_pk1_value, i_pk2_value, i_pk3_value, i_pk4_value, i_pk5_value (which are provided as input to this API), and then adding the file_name (based on the file_id) from the FND_LOBS table.

Note: register_attachment is an overloaded API. The second signature is documented below. The difference between the two APIs is that the first uses the key values from the FND_LOBS table to uniquely identify the attachment; and the second uses a user-defined identifier.

register_attachment

PL/SQL Syntax

procedure register_attachment
(i_cid in varchar2,
 i_file_id in number,
 i_data_type in number);

Arguments (input)

i_cid A unique identifier for the attachment provided by the user when the attachment was defined in FND.
i_file_id File identifier from the FND_LOBS table.
i_data_type Identifies the data type of the attachment file. The valid value is BLOB. The list of valid values is maintained in ecx_attachment.embedded_lob_data_type API.

Arguments (output)

None.

retrieve_attachment

PL/SQL Syntax

procedure retrieve_attachment
(i_msgid in raw,
 x_cid in varchar2,
 x_file_name out varchar2,
 x_file_content_type out varchar2,
 x_file_data out nocopy blob,
 x_ora_charset out varchar2,
 x_file_format out varchar2);

Description

Called by message maps for inbound documents to retrieve an attachment deposited by Oracle Transport Agent (OTA) when the inbound document was received.

Not all attachments deposited by OTA are of interest to the receiving application. Only the attachments identified by the i_msgid and x_cid parameters are retrieved using this API.

Arguments (input)

i_msgid The message ID associated with the attachment deposited by OTA into the FND repository.
x_cid A unique identifier for the attachment provided in the inbound XML document. With OAG, this would be provided in the ATTCHREF data type, FILENAME element. The exact location of the unique identifier in the XML document will vary by standard.

Arguments (output)

x_file_name Name of the attachment file from the FND_LOBS table.
x_file_content_type Content type specified during the attachment uploading process. Information from the FND_LOBS table.
x_file_data The uploaded attachment stored as a binary LOB from the FND_LOBS table.
x_ora_charset Oracle character set from the FND_LOBS table.
x_file_format File format ("text" or "binary") from the FND_LOBS table.

reconfig_attachment

PL/SQL Syntax

procedure reconfig_attachment
(i_msgid in raw,
 i_cid in varchar2,
 i_entity_name in varchar2,
 i_pk1_value in varchar2,
 i_pk2_value in varchar2,
 i_pk3_value in varchar2,
 i_pk4_value in varchar2,
 i_pk5_value in varchar2,
 i_program_app_id in number,
 i_program_id in number,
 i_request_id in number,
 x_document_id out number);

Description

Called by message maps for inbound documents to reset FND attributes for a previously retrieved attachment deposited by OTA when the inbound document was received.

Not all attachments retrieved using the retrieve_attachment API must be reconfigured. Use the reconfig_attachment API only if you want to update the FND attributes. Use the standard Oracle Foundation module to create a new copy of the attachment if necessary.

Arguments (input)

i_msgid The message ID associated with the attachment deposited by OTA into the FND repository.
i_cid A unique identifier for the attachment. This is the same value provided to the retrieve_attachment API that was based on the value in the inbound XML document.
i_entity_name Entity name from the FND_ATTACHED_DOCUMENTS table.
i_pk1_value Key value from the FND_ATTACHED_DOCUMENTS table.
i_pk2_value Key value from the FND_ATTACHED_DOCUMENTS table.
i_pk3_value Key value from the FND_ATTACHED_DOCUMENTS table.
i_pk4_value Key value from the FND_ATTACHED_DOCUMENTS table.
i_pk5_value Key value from the FND_ATTACHED_DOCUMENTS table.
i_program_app_id Standard extended who column from FND_ATTACHED_DOCUMENTS table.
i_program_id Standard extended who column from FND_ATTACHED_DOCUMENTS table.
i_request_id Standard extended who column from FND_ATTACHED_DOCUMENTS table.

Arguments (output)

x_document_id Unique identifier for the reconfigured attachment.

formulate_content_id

PL/SQL Syntax

procedure formulate_content_id
(i_file_id in number,
 i_entity_name in varchar2,
 i_pk1_value in varchar2,
 i_pk2_value in varchar2,
 i_pk3_value in varchar2,
 i_pk4_value in varchar2,
 i_pk5_value in varchar2,
 x_cid out varchar2);

Description

Called by register_attachment API to determine the unique CID for an attachment deposited into FND. This API is exposed for use outside of the register_attachment API context.

Arguments (input)

i_file_id File identifier from the FND_LOBS table used to determine the file_name value from the FND_LOBS table. The file_name is used to compose the x_cid value.
i_entity_name Entity name from the FND_LOBS table used to compose the x_cid value.
i_pk1_value Key value from the FND_LOBS table used to compose the x_cid value.
i_pk2_value Key value from the FND_LOBS table used to compose the x_cid value.
i_pk3_value Key value from the FND_LOBS table used to compose the x_cid value.
i_pk4_value Key value from the FND_LOBS table used to compose the x_cid value.
i_pk5_value Key value from the FND_LOBS table used to compose the x_cid value.

Arguments (output)

x_cid A unique identifier for the attachment based on the concatenation of i_entity_name, i_pk1_value, i_pk2_value, i_pk3_value, i_pk4_value, i_pk5_value (which are provided as input to this API), and then adding the file_name value (based n the file_id) from the FND_LOBS table.