Oracle Repository API and Model Reference Guide


Contents


API Methods


Element Definitions


Index  


The Multi-Line Text API

The Multi-line Text API provides a way to store and retrieve arbitrarily large blocks of text (such as documentation, full descriptions, SQL code, policies, and user-defined types) against an element in the repository.

Text is stored in the table RM_TEXT_LINES.  Up to 32K of text can be stored against an element.  The text is stored as presented to the API: that is, control characters such as carriage returns and linefeed are stored and retrieved without any transformation.

When storing a block of text, the caller assigns a text type to the block.  Each element type has a set of text types associated with it, shown under the section entitled 'Multi-line Text' in the column in the Element Type Definitions page for each element type.  Further text types can be defined using the User Extensibility features of Oracle Repository, which are also described in the documentation for the Repository Administration Utility.

Multiple blocks of text, each of a different type, can be stored against a single element.  When text of one type is stored, existing text of that type is overwritten by the new text.  When text is read, either all the text of a specified type is read, or a specified amount of text of a specified type is read.

Note: Large amounts of text can be stored and managed in the COMPRESSED_CONTENTS, CONTENTS_CLOB, and CONTENTS_BLOB columns of PRIMARY_ACCESS_FILE objects. For details, see the information about the File Service API for Java.

A subset of element types in Oracle Repository support multi-line text. In the Element Type Definition pages, such element types have appropriate entries in 'Multi-line Text' section of their definition page naming the text types available for that element type.

Also, user-defined element types can have additional text types, and element types that support multi-line text can have any number of user defined text types attached to them using the CIUE_TEXT_TYPE and CIUE_TEXT_USAGE packages.

The package RMOTEXTP provides the following methods for storing and retrieving multi-line text associated with elements:

lengthall
readall
truncall
writeall

Note: In all operations object version referenced is the one currently visible in the context workarea.



PROCEDURE rmotextp.readall (ref IN NUMBER
                          , txt_type IN VARCHAR2
                          , buffer IN OUT VARCHAR2
                          , buflen in INTEGER
                          , bufret out INTEGER);

Where:

ref is the IRID of the element

txt_type is type of the text to be read (for example, 'CDIDSC')

buffer is the buffer for text to be read into.

buflen is the maximum length of buffer.  readall never retrieves more than the amount of text specified by buflen .

bufret contains the number of bytes of text retrieved on completion of the call.  bufret is never larger than buflen .

Description

Reads up to buflen characters of text of the specified type for an element into buffer.  Any text in buffer is overwritten. The version referenced is the one currently visible in the context workarea.

See also

API Methods List

Return to Top  



PROCEDURE rmotextp.truncall (ref IN NUMBER
                           , txt_type IN VARCHAR2); 

Where:

ref is the IRID of the element. 

txt_type is the type of text (for example, 'CDIDSC').

Description

Truncates (deletes) all the text of the specified type for an element. The version referenced is the one currently visible in the context workarea.

See also

API Methods List

Return to Top  



PROCEDURE rmotextp.writeall (ref IN NUMBER
                           , txt_type IN VARCHAR2
                           , element type_for IN VARCHAR2
                           , buffer IN VARCHAR2
                           , buflen in INTEGER
                           , bufwrt out INTEGER);

Where:

ref is the IRID of the element.

txt_type is the type of text (for example, 'CDIDSC').

element type_for is the short name of the owning element type (for example, 'COL'), shown in the 'Short Code' column in the Element Type Definitions pages.

buffer is the buffer for new text.

buflen is the length of new text.

bufwrt contains the number of characters written on completion of the call.

Description

Stores buflen characters of the text found in buffer. The text is associated with the currently visible version of the element specified by ref, and is assigned type txt_type.  If any text of the specified type exists for the element, the existing text is overwritten.

See also

API Methods List

Return to Top  



PROCEDURE rmotextp.lengthall (ref IN NUMBER
                            , txt_type IN VARCHAR2
                            , buflen OUT INTEGER); 

Where:

ref is the IVID of the element to be queried.

txt_type is the type of the text to be queried.

buflen contains, on return, the length of the text of type txt_type for the specified element.

Description

Returns the number of characters of text stored against a specified element. The version of the element queried is the one currently visible in the context workarea.

See also

API Methods List

Return to Top