Previous Table of Contents Next


Testing the Developed Data Cartridge

1.  Create a database table that will hold instances of the DataStore type.

Create table DataStore_table of DataStore;

2.  Insert a row into the DataStore table.

Insert into DataStore_table values (1, ‘test1’, to_date

(‘03-28-1998’, ‘MM-DD-YYYY’),

EMPTY_CLOB() );



commit;

3.  Populate the LOB using an OCI program that uses the OCI routine OCILobWrite() to read data from a file and copy it into the clob attribute of the DataStore.
4.  Compile the c_miminum and c_maximum routines and put them into the library.
5.  Using PL/SQL, invoke the data cartridge methods.

Select d.DataMimimum(), d.DataMaximum() from DataStore_table d;

Deploying Cartridges

There are several tasks that need to performed before you can start using the cartridges. In this section we will take a look at several of these tasks.

Data Cartridge Installation and Operation

Installation involves the following steps:

1.  Putting the data cartridge at the correct place.
This involves placing the dynamic link libraries, help documentation, and other supporting files at a particular location.
2.  Making the Oracle server aware of the object data type definitions.
You can make the server aware of the ODT definitions by running a SQL script logged in with a privileged account.
3.  Granting users the rights to use the data cartridge.

The entire process of packaging and installing of cartridges can be divided into four phases:

1.  Java developers define the libraries of actions, dialogs, and queries. These libraries are used as input to the component definition tool and the installer runtime.
2.  Developers specify the files that form a component, the dependencies between the components, and the flow during the installation process.
3.  Defining the component and session variables settings creates customized drivers.
4.  The software is installed, and the users can provide input to the dialogs or the dialog inputs are provided via drivers.

Definition of Libraries

Libraries are collections of related Java classes that are used for implementing specific functionality during an installation. The Cartridge Packager uses libraries to make actions, dialogs, or queries available to the installation developer. Libraries can be uniquely defined by specifying the following:

  Library name
  Library version
  All the actions, dialogs, and queries in the library
  Names of classes that implement an action
  Exceptions that occur during an action

There are three types of libraries:

  Action libraries
  Dialog libraries
  Query libraries

Action Library

Action libraries are collections of actions that can be added by the developers to the action flow. Actions are only available in the state change phase. The Cartridge Packager provides default action libraries, and it also allows the developers to import additional custom-developed libraries.

The default action library provided with the cartridge packager includes the following:

  Add item to registry
  Append file
  Copy files
  Create user
  Create group
  Change password
  Create icon/Program group (Windows only)
  Rename file
  Relink
  Set environment variable

Actions may be platform-specific–applicable and implemented for certain platforms only—or they may be polymorphic. Depending on the platform, they can implement different logic to perform the same action.

Actions are defined using the following two steps:

1.  Select a set of action objects and the associated variables.
2.  Define the logical flow and associations between the action objects.


Note:  
Associated with each action object is an Undo function that is used during the uninstall procedure to reverse the effect of that action object.

Dialog Libraries

Dialogs are used by the end users during the installation process to set variables. The installer first runs through its standard set of dialogs, and then it runs through the dialogs of each component that has been selected during the installation process. The Cartridge Packager provides default dialog libraries, and it also allows the developers to import additional custom-developed libraries.

The default dialog library provided with the Cartridge Packager includes the following:

  Directory dialog
  Password dialog
  Single selection
  Single text field
  Multiple selection

Dialogs are defined using the following two steps:

1.  Select a set of dialog objects and the associated variables.
2.  Define the logical flow and associations between the dialog objects.

Queries Library

During the installation process, queries can be used to obtain information about the target machine. The information that results from the query can be used to influence the flow of the rest of the install process.


Note:  
Actions can change the state of the target machine, while queries only retrieve information about the target machine.

Installation Flow

There are several things that must be considered during the definition of the installation flow:

  Specify the variables and their associations with dialogs and actions
  Specify the dialogs, which control the customization and also influence the flow of the installation
  Specify actions using variables, expressions, and decision controls

Summary

Cartridges provide a powerful and flexible mechanism for the customization and extension of the Oracle8 engine. They are a very important component of the Network Computing Architecture and allow the overall functionality of the system to be distributed into either the client, application, or data cartridges. As server-based components, data cartridges allow the storage, management, manipulation, and retrieval of complex data just like traditional data, thereby supporting the business model in a better way.

Oracle is committed to further extend this technology in the future. There are two initiatives underway at Oracle to enhance the usage of the cartridges.

  Support of Java as a native language in the Oracle8 kernel.
  Improved extensibility by supporting inheritance of object types, methods, and data.


Previous Table of Contents Next
Используются технологии uCoz