Static Methods Unique to the ORDDoc Object Type Relational Interface

This section presents reference information on the interMedia static methods unique to the ORDDoc relational interface.

The relational interface adds interMedia support to audio, image, video, and other heterogeneous media data stored in BLOBs and BFILEs rather than in the ORDDoc object type. The following interface is defined in the orddspec.sql file:

.
.
.
-- Static Methods for the relational interface
STATIC PROCEDURE export(ctx IN OUT RAW,
local_data IN BLOB,
source_type IN VARCHAR2,
source_location IN VARCHAR2,
source_name IN VARCHAR2),
--
STATIC PROCEDURE importFrom(ctx IN OUT RAW,
local_data IN OUT NOCOPY BLOB,
source_type IN VARCHAR2,
source_location IN VARCHAR2,
source_name IN VARCHAR2),
--
STATIC PROCEDURE importFrom(ctx IN OUT RAW,
local_data IN OUT NOCOPY BLOB,
source_type IN VARCHAR2,
source_location IN VARCHAR2,
source_name IN VARCHAR2,
format OUT VARCHAR2,
mime_type OUT VARCHAR2),
--
STATIC PROCEDURE getProperties(ctx IN OUT RAW,
docBlob IN BLOB,
attributes IN OUT NOCOPY CLOB,
format IN VARCHAR2),
--
STATIC PROCEDURE getProperties(ctx IN OUT RAW,
docBlob IN BLOB,
attributes IN OUT NOCOPY CLOB,
mimeType OUT VARCHAR2,
format IN OUT VARCHAR2,
contentLength OUT INTEGER),
--
STATIC PROCEDURE getProperties(ctx IN OUT RAW,
docBfile IN OUT NOCOPY BFILE,
attributes IN OUT NOCOPY CLOB,
format IN VARCHAR2),
--
STATIC PROCEDURE getProperties(ctx IN OUT RAW,
docBfile IN OUT NOCOPY BFILE,
attributes IN OUT NOCOPY CLOB,
mimeType OUT VARCHAR2,
format IN OUT VARCHAR2,
contentLength OUT INTEGER),
.
.
.

Example Media Table Definition

The methods described in this section show examples based on a test document table TDOC. Refer to the TDOC table definition that follows when reading through the examples:

getProperties( ) for BLOBs

Format

getProperties(ctx IN OUT RAW,

docBlob IN BLOB,

attributes IN OUT NOCOPY CLOB,

format IN VARCHAR2);

Description

Reads the document BLOB data to get the values of the media attributes, and then stores them in the input CLOB. This method populates the CLOB with an extensive set of format and application properties in XML form.

Parameters

ctx

The format plug-in context information.

docBlob

The document data represented as a BLOB.

attributes

The CLOB to hold the XML attribute information generated by the getProperties( ) method. This CLOB is populated with an extensive set of format and application properties of the document BLOB data in XML form.

format

The format of the document data. If a non-NULL value is specified, then the format plug-in for this format type is invoked.

Usage Notes

None.

Pragmas

None.

Exceptions

ORDDocExceptions.DOC_PLUGIN_EXCEPTION

This exception is raised if you call the getProperties( ) method and the document plug-in raises an exception.

ORDSourceExceptions.EMPTY_SOURCE

This exception is raised when the value of the source.local attribute is 1 or 0 (TRUE), but the value of the source.localData attribute is NULL.

getProperties( ) (all attributes) for BLOBs

Format

getProperties(ctx IN OUT RAW,

docBlob IN BLOB,

attributes IN OUT NOCOPY CLOB,

mimeType OUT VARCHAR2,

format IN OUT VARCHAR2,

contentLength OUT INTEGER);

Description

Reads the document BLOB data to get the values of the media attributes, and then stores them in the input CLOB and returns them as explicit parameters. This method gets the properties for the following attributes of the document data: MIME type, content length, and format. It populates the CLOB with an extensive set of format and application properties in XML form.

Parameters

ctx

The format plug-in context information.

docBlob

The document data represented as a BLOB.

attributes

The CLOB to hold the XML attribute information generated by the getProperties( ) method. This CLOB is populated with an extensive set of format and application properties of the document BLOB data in XML form.

mimeType

The MIME type of the document data.

format

The format of the document data. If a non-NULL value is specified, then the format plug-in for this format type is invoked.

contentLength

The length in bytes of the content.

Usage Notes

If a property cannot be extracted from the media source, then the respective parameter is set to NULL.

Pragmas

None.

Exceptions

ORDDocExceptions.DOC_PLUGIN_EXCEPTION

This exception is raised if you call the getProperties( ) method and the document plug-in raises an exception.

ORDSourceExceptions.EMPTY_SOURCE

This exception is raised when the value of the source.local attribute is 1 or 0 (TRUE), but the value of the source.localData attribute is NULL.

getProperties( ) for BFILEs

Format

getProperties(ctx IN OUT RAW,

docBfile IN OUT NOCOPY BFILE,

attributes IN OUT NOCOPY CLOB,

format IN VARCHAR2);

Description

Reads the document BFILE data to get the values of the media attributes, and then stores them in the input CLOB. It populates the CLOB with an extensive set of format and application properties in XML form.

Parameters

ctx

The format plug-in context information.

docBfile

The document data represented as a BFILE.

attributes

The CLOB to hold the XML attribute information generated by the getProperties( ) method. This CLOB is populated with an extensive set of format and application properties of the document BFILE data in XML form.

format

The format of the document data. If a non-NULL value is specified, then the format plug-in for this format type is invoked.

Usage Notes

None.

Pragmas

None.

Exceptions

ORDDocExceptions.DOC_PLUGIN_EXCEPTION

This exception is raised if you call the getProperties( ) method and the document plug-in raises an exception.

ORDSourceExceptions.EMPTY_SOURCE

This exception is raised when the value of the source.local attribute is 1 or 0 (TRUE), but the value of the source.localData attribute is NULL.

getProperties( ) (all attributes) for BFILEs

Format

getProperties(ctx IN OUT RAW,

docBfile IN OUT NOCOPY BFILE,

attributes IN OUT NOCOPY CLOB,

mimeType OUT VARCHAR2,

format IN OUT VARCHAR2,

contentLength OUT INTEGER);

Description

Reads the document BFILE data to get the values of the media attributes for supported formats, and then stores them in the input CLOB and returns them as explicit parameters. This method gets the properties for the following attributes of the document data: MIME type, content length, and format. It populates the CLOB with an extensive set of format and application properties in XML form.

Parameters

ctx

The format plug-in context information.

docBfile

The document data represented as a BFILE.

attributes

The CLOB to hold the XML attribute information generated by the getProperties( ) method. This CLOB is populated with an extensive set of format and application properties of the document BFILE data in XML form.

mimeType

The MIME type of the document data.

format

The format of the document data. If a non-NULL value is specified, then the format plug-in for this format type is invoked. If not specified, the derived format is returned.

contentLength

The length in bytes of the content.

Usage Notes

If a property cannot be extracted from the media source, then the respective parameter is set to NULL.

Pragmas

None.

Exceptions

ORDDocExceptions.DOC_PLUGIN_EXCEPTION

This exception is raised if you call the getProperties( ) method and the document plug-in raises an exception.

ORDSourceExceptions.EMPTY_SOURCE

This exception is raised when the value of the source.local attribute is 1 or 0 (TRUE), but the value of the source.localData attribute is NULL.