This chapter explains the basics of the Oracle Configuration Interface Object (CIO) and how to use it. For details about how to use the CIO for specific purposes, see other chapters in Part 2.
This chapter covers the following topics:
This section describes the CIO and its relationship to Configurator Extensions.
The Configuration Interface Object (CIO) is an API (application programming interface) that provides programs access to the Model used by a runtime Oracle Configurator, which you construct with Oracle Configurator Developer. The CIO is designed to enable you to programmatically perform any interaction with a configuration model that can be interactively performed by an end user during a configuration session.
The CIO is a top-level configuration server. The CIO is responsible for creating, saving and destroying objects representing configurations, which themselves contain objects representing Models, Components, Features, Options, Totals and Resources. The runtime configuration model can be completely controlled and manipulated through these interfaces, using methods for getting and setting logical, numeric and string values, and creating optional subcomponents.
The CIO is the only API supported by Oracle for programmatic interaction with the runtime Oracle Configurator. Consequently, any custom applications must use the CIO. Custom applications are those that integrate Oracle Configurator with a custom user interface (a UI not generated by Oracle Configurator Developer).
The CIO is also used by Configurator Extensions, as described in Configurator Extensions and the CIO. Be sure to review the Oracle Configurator Performance Guide for information on the performance impacts of Configurator Extensions.
Most of the techniques for using the CIO apply equally to custom applications and Configurator Extensions. This document points out selected cases where there is a distinction between these two applications.
The Oracle Configuration Interface Object is written in Java, and implemented as the Java package oracle.apps.cz.cio. To use the functionality of the CIO you must import classes from this package.
Note: Unless stated otherwise, references in this document to classes, methods, and properties refer to the package oracle.apps.cz.cio, and all code examples are in Java.
A Configurator Extension is Java code that calls the CIO.
Configurator Extensions are invoked by the CIO through the runtime Oracle Configurator, and Configurator Extensions call the CIO to get information from the running Model. The CIO is like a broker for the runtime Oracle Configurator, in that it passes information both ways. Programmers writing Configurator Extensions need to know how to use the CIO.
Each Configurator Extension is an object class. For every component instance in your Model that is associated with a Configurator Extension, the CIO creates an instance of this class.
When you program against the CIO, you create one instance of the class CIO (see Initializing the CIO) and one or more instance of the classes Configuration and ConfigParameters (see Working with Configurations). You then use the public interfaces of the CIO, such as those listed in Important Runtime Node Interfaces for the CIO, to access fields in the runtime node objects created by your instances of CIO and Configuration. Apart from CIO and Configuration, your code should refer only to these public runtime node interface objects. You should not implement any of the runtime node interfaces, but only use them as references to runtime node objects.
In Java, an interface is a special type that allows programmers more flexibility in the way that they implement the internal details of classes. In Java terms, an interface is a named collection of method definitions, without implementations of those methods. For example, in the CIO, the interface IRuntimeNode specifies methods that are implemented in the class RuntimeNode.
Note: In normal circumstances, the only CIO classes that you should create (with the Java keyword new) are:
CIO
Configuration
ConfigParameters
You only need to create these objects when working with a custom application. Configurator Extensions do not need to create them, because that task is performed by the runtime Oracle Configurator when it starts a configuration session.
The table Important Runtime Node Interfaces for the CIO lists some of the interfaces defined in the Java package oracle.apps.cz.cio that you are most likely to use in working with the CIO. For more detail about these and the other CIO interfaces, see Reference Documentation for the CIO.
The functionality underlying the CIO interfaces is implemented by other classes in oracle.apps.cz.cio, which are subject to revision by Oracle. This interface/implementer architecture protects your code from the effects of such revisions, since the interfaces remain constant.
In order to use any of the features of the CIO, an application must initialize it, using a JDBC driver to make a connection to the Oracle Configurator schema. This connection enables the CIO to obtain and store data about Model structure, Configuration Rules, and User Interface.
This use of the CIO is intended for custom applications. If you are using the CIO in a custom application, you must initialize the CIO.
When you run Configurator Extensions through the runtime Oracle Configurator or through the testing facilities of Oracle Configurator Developer, this initialization and connection work is automatically handled for you; you do not have to write your own code to initialize the CIO. See Managing JDBC Connections for details.
Use the following practice to initialize the CIO:
Import the necessary classes.
import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import oracle.apps.cz.cio.*; import oracle.apps.cz.common.*;
It is good practice to import only the classes that you actually need. The example here shows oracle.apps.cz.cio.* for simplicity.
Load the database driver that you have installed. For instance:
Class.forName("oracle.jdbc.driver.OracleDriver");
Create a context object and pass to it the information needed to make a database connection: the full path and name of the DBC file. The context object manages the database connection. You should not create a separate connection object (for instance, by using java.sql.DriverManager.getConnection).
contextObject = new CZWebAppsContext ("/fullpath/dbcFileName.dbc");
In the current release, all DBC files should be installed in the directory identified by the system parameter FND_SECURE. This directory is distinct from FND_TOP. Your custom code must access DBC files through FND_SECURE.
When creating a context object, it is necessary to set the Responsibility ID for the session.
SessionManager sm = contextObject.getSessionManager(); sm.setResp(appId,respId);
Consult the Java API reference documentation for oracle.apps.fnd.common.Context.getSessionManager() and oracle.apps.fnd.security.SessionManager.setResp(int, int) for background.
Create a single global CIO object. This object is shared by any Configuration objects that are created during the configuration session.
CIO cioObject = new CIO();
Creating a Configuration Object (MyConfigCreator.java) shows how some of these steps are employed.