NAME

CQCC::TriggerBase - Class to provide generic services for triggers, including initialization, processing arguments and other services.


CLASS DESCRIPTION

This class manages initialization for the integration by reading in the command line arguments; creating ClearCase and ClearQuest class instances through IOClassFactory(); and cleaning up and terminating the trigger session.

A subclass of this trigger is expected to provide the specific behavior for an application, such as TriggerCQCC.

SUPPORT POLICY: See TriggerCQCC.pm for the Rational Support Policy.


METHODS

ClassInit()
This class function is automatically invoked to define class parameters using CQCC::Parm objects.
TriggerInterface
Name of Trigger subclass to run for this session, used by IOClassFactory(). Set to 'CQCC::Trigger' by default.

REQUIRED
Internal flag indicating if the operation is required (TRUE) or not (FALSE). Set through a command line argument (-required) but can also be set as a configuration parameter.

TESTMODE
Internal flag to other classes that the session is in debug mode (TRUE) or not (FALSE). Set through a command line argument (-test).

Connect(system)
This method connects to ClearCase or ClearQuest, handling any necessary initialization of the class interface and storing the value into the CC or CQ instance variables respectively.

DispatchOperation()
This method dispatchs the selected operation with its arguments and exits with the return status of the operation.

Initialize()
This method will initialize the trigger after it has been created. It determines which classes should be instantiated, processes command line arguments, retrieves any cached information since the last invocation and begins testmode operations if that has been selected.

LoadCache()
This method reads back the parameter values stored in the current cache file. On UNIX the cache file (cqcc_cache) is in the home directory of the user; on Windows is is kept in the profiles folder.

MenuDisplay(menuName, {[ initialChoice ]} )
This method displays the requested menu and handles interaction with the user. It looks up the menu definition as an instance variable if the Trigger object, i.e. ``MAIN_MENU'' refers to $obj->{MAIN_MENU}.

A menu is a list consisting of a title message tag and one or more choice message tags which can be translated through the message catalog along with a set of arguments. For example, [Action_Help, ``main_menu''] might be displayed as ``3) Help for main_menu''. If the title or choice message tags are NOT message tag arrays then the literal value is shown instead of being looked up through the message tag.

When the user makes a selection, the menu gets back the message tag. The first tag value is expected to be a trigger method and that will be called with the remaining tag values as arguments, i.e. $obj->Action_Help(``main_menu''). This approach allows a subclass to redefine the menu by editing its definition or to override any of its activities by overriding the method that gets called back.

The optional initialChoice argument is used to automatically make an initial selection, calling the Dialog_SelectByQuery for example or attempting to automatically commit changes when ApplyToAll was called to process the remaining elements of a batch for example. Like other menu selection items, it expects a message tag.

new CQCC::TriggerBase()
This method presets the objects attributes to read in the basic command line arguments. The object is not active until the owner calls it's Initialize() method.

Op_classtest()
This internal method is invoked to ask a specific class to run its ClassTest method. At least one argument must be provided to specify which class is to be tested; additional arguments will be passed to the ClassTest method. The arguments must be delimited by commas with no spaces in between. Example:

-op classtest CQCC::CCase,vobname,elemname

PreprocessArguments()
This function looks through the incoming arguments for any that must be pre-processed before the trigger is instantiated, i.e. the TriggerInterface command line argument to override the trigger subclass.

PrintState(option)
This method prints out information on classes, parameters, and other state information.

ProcessArguments()
This method processes command line arguments including -help, -test, and -required as well as -p name,value pairs; if no operation is specified the integration will fail and exit.

SaveCache()
This method saves the values of the parameters named in the CACHE instance variable to a file named by the CACHE_FILE instance variable.