Oracle8 ConText Cartridge Administrator's Guide Release 2.3 A58165-01 |
Library | Product | Contents | Index

# 8
Understanding the ConText Data Dictionary: Text Loading

This chapter describes the ConText data dictionary objects provided with ConText for text loading.

The topics discussed in this chapter are:

- Sources
- Preferences for Text Loading
- Reader Tiles
- Engine Tiles
- Translator Tiles

## Sources

This section provides conceptual, as well as reference, information about text loading sources, which are stored in the ConText data dictionary:

- What is a Source?
- Source Attributes
- Preferences in Sources

### What is a Source?

A source is a logical grouping of three text loading preferences (one preference for each of the supported categories), assigned to a column in the database. A source specifies the options used by ConText to load text automatically into a column using ctxload and ConText servers with the Loader personality.

Note: A source must exist for a column before a ConText server with the Loader personality can load text from an operating system file into the column.

Sources can be created by any ConText user with the CTXAPP role. Sources are stored in the ConText data dictionary. In addition to the preferences for a source, users specify a name and text column for the source. Users can also specify a description and a refresh rate for directory scanning.

The sources created by a user must be unique for the user. As such, the same source for a user cannot be assigned to more than one column.

See Also: For an example of automated text loading with ConText servers, see "Loading Text" in "Setting Up and Managing Text". For more information about text loading preferences, see "Preferences for Text Loading" in this chapter.

### Source Attributes

To define a source, a user specifies a name and column for the source, and optionally a description and refresh rate for the source.

The column in the source indicates the column to which text is loaded by ConText servers.

Note: The column must be a LONG or LONG RAW column, because load servers only supports loading text columns with these datatypes.

### Preferences in Sources

To define a source, the user specifies a preference for each of the three supported categories.

A preference can be used in more than one source; however, two preferences from the same category cannot be used in the same source.

If a preference for one of the categories is not specified when the source is created, the default, predefined preference for the category is used in the source.

Note: All three of the loading categories have defaults; however, the default preference for the Reader category should not be used. This is because the directory specified in the default Reader preference is a generic directory specification and probably does not exist in your file system.

## Preferences for Text Loading

This section provides conceptual, as well as reference, information for text loading preferences, which are stored in the ConText data dictionary:

- What is a Text Loading Preference?
- Reader Predefined Preferences
- Engine Predefined Preferences
- Translator Predefined Preferences

### What is a Text Loading Preference?

Text loading preferences specify the options that ConText uses to load text (in batch mode). Each preference represents one (and only one) text loading option.

A preference consists of a ConText Tile and one or more attributes (and their corresponding values) for the Tile.

In addition, each preference is grouped into one of three types or categories, which determine the text loading operation that the preference controls.

When creating a source, three preferences are specified for the source, one for each of the three categories.

See Also: For more information about Tiles in sources, see "Reader Tiles", "Engine Tiles", or "Translator Tiles" in this chapter.

#### User-defined Preferences

A ConText user with the CTXAPP role can create their own preferences by setting the required attributes for one of the Tiles provided by ConText, then calling CTX_DDL.CREATE_PREFERENCE and specifying the name of the Tile.

Note: When creating a source, users can use all preferences that have been defined in the ConText data dictionary, including their own preferences, preferences created by other users, or the predefined preferences provided by ConText.

#### Predefined Preferences

ConText provides predefined preferences for each category. These predefined preferences can be used by any ConText user with the CTXAPP role to create sources without first creating preferences.

### Reader Predefined Preferences

ConText provides a single predefined Reader preference for text loading: DEFAULT_READER.

#### DEFAULT_READER

This preference calls the DIRECTORY READER Tile, which specifies a dummy directory for the Tile.

Note: Because it is unknown which directory contains the files to be loaded and path names are operating-system specific, this preference is provided as a default only and should not be used when creating a source. Before creating a source, you should create your own Reader preference that specifies the directory where your files to be loaded are located.

### Engine Predefined Preferences

ConText provides a single predefined Engine preference, DEFAULT_LOADER, for text loading.

#### DEFAULT_LOADER

This preference calls the GENERIC LOADER Tile, which indicates the preference can be used to load text from files in a operating system directory.

### Translator Predefined Preferences

ConText provides a single predefined Translator preference, DEFAULT_TRANSLATOR, for text loading.

#### DEFAULT_TRANSLATOR

This preference calls the NULL TRANSLATOR Tile, which indicates no translation is performed on the files to be loaded; the files are in the format required by ctxload.

## Reader Tiles

The Reader Tiles are used to specify the location of the files to be loaded.

ConText provides the a single Reader Tile for creating preferences for text loading sources:

Tile | Attributes | Attribute Values
--- | --- | ---
DIRECTORY READER | directories | pathname for the directory where text loading files are located

### DIRECTORY READER Tile

The DIRECTORY READER Tile is used to specify the location of files to be loaded when the files are located in the local operating system.

#### Attributes

DIRECTORY READER has the following attribute(s):

##### directories

The directories attribute specifies the full pathname for the directory that the ConText server with the Loader personality scans when looking for new files to load into a column in a table or view.

The structure of the value for directories will vary depending on the directory naming conventions used by your operating system.

## Engine Tiles

ConText provides a single Engine Tile for creating preferences for text loading sources:

Tile | Attributes | Attribute Values
--- | --- | ---
GENERIC LOADER | separate | Y (text stored in separate file(s), load file contains pointers to separate file(s))
|  | N (text stored in load file, default)
| longsize | maximum size, in kilobytes, of text to be loaded (default 64)

### GENERIC LOADER Tile

The GENERIC LOADER Tile is used to specify the loader (ctxload) for loading text.

#### Attributes

GENERIC LOADER has the following attribute(s).

##### separate

The separate attribute specifies whether the -separate option for ctxload is enabled. When the -separate option is enabled, the load files do not contain the actual text of the documents to be loaded, but, rather, contain pointers to separate files where the text of the documents is stored.

The default for separate is N.

##### longsize

The longsize attribute specifies a value for the -longsize option for ctxload. The -longsize option specifies the maximum size, in kilobytes, allowed for text loaded by ctxload.

See Also: For more information about how the -separate and -longsize options work in ctxload for loading text, see "Command-line Syntax" in Chapter 10, "Text Loading Utility".

## Translator Tiles

ConText provides the following Translator Tiles for creating preferences for text loading sources:

Tile | Attributes | Attribute Values
--- | --- | ---
NULL TRANSLATOR | ** none ** | N/A
USER TRANSLATOR | command | executable for translator program

### NULL TRANSLATOR Tile

The NULL TRANSLATOR Tile is used to specify that the load files for the loader (ctxload) are already in the format required by the loader. It has no attributes.

### USER TRANSLATOR Tile

The USER TRANSLATOR Tile is used to specify a translator program that converts load files into the format required by the loader (ctxload).

#### Attributes

USER TRANSLATOR has the following attribute(s):

##### command

The command attribute specifies the executable name of the translator program used to convert a load file into the format required by ctxload.

Note: The specified translator executable must be stored in the appropriate directory in the Oracle home directory. For example, in a UNIX-based environment, all translator executables must be stored in $ORACLE_HOME/ctx/bin. In a Windows NT environment, the translator executables must be stored in \BIN in the Oracle home directory. For more information about the required location for executable files, see the Oracle8 installation documentation specific to your operating system.

Prev | Next
| Copyright © 1997 Oracle Corporation. All Rights Reserved. |
Library | Product | Contents | Index