Administration Guide

Interface Descriptions

The following interfaces are shipped:

The interfaces are described in the next sections, followed by an example.

CCExtension

The CCExtension interface allows you to extend the Control Center user interface by adding new toolbar buttons, new menu items, and overriding existing menu actions.

The external interface is defined as follows:

   public interface CCExtension
   {
      /**
       * Get an array of CCObject subclass objects which define
       * a list of objects to be inserted or overridden in the
       * Control Center
       * @return CCObject[] CCObject subclass objects array
       */
      public CCObject[] getObjects();
 
      /**
       * Get an array of CCToolbarAction subclass objects which represent
       * a list of buttons to be added to the Control Center
       * main toolbar.
       * @return CCToolbarAction[] CCToolbarAction subclass objects array
       */
      public CCToolbarAction[] getToolbarActions();
   }

To use CCExtension, create a Java class which imports the "com.ibm.db2.tools.cc.navigator" package and implements this interface. The new class must provide the implementation of the getObjects() and getToolbarActions() methods.

The getObjects() method returns an array of CCObject which defines the existing objects which the user would like to add new menu actions or remove a predefined set of menu actions.

The getToolbarActions() method returns an array of CCToolbarAction which will be added to the Control Center main toolbar.

A single CCExtension subclass file or multiple CCExtension subclass files can be used to define the Control Center extensions. For the Control Center to use these extensions, use the following setup procedure:

  1. Create a "db2plug.zip" file which contains all the CCExtension subclass files. The files should not be compressed. For example, if the CCExtension files are in the plugin package and they are located in the plugin directory,
       zip -r0 db2plug.zip plugin\*.class
    

    This command will put all the plugin package class files into the db2plug.zip file and preserve their relative path information.

  2. To run the Control Center as an applet, put the db2plug.zip file in where the <codebase> tag points to in the Control Center html file. To run the Control Center as an application, put the db2plug.zip in a directory pointed to by the CLASSPATH environment variable.

For browsers that support multiple archives, just add "db2plug.zip" to the archive list of the Control Center html page. Otherwise, all the CCExtension, CCObject, CCToolbarAction, and CCMenuAction subclass files will have to be in their relative directories depending on which package they belong to.

CCObject

The CCObject interface allows you to change the behavior of the menu actions of an existing object.

The external interface is defined as follows:

public interface CCObject
{
   /**
    * The following static constants defines a list of object type
    * available to be added to the Control Center tree.
    */
   public static final int UDB_SYSTEMS_FOLDER                          = 0;
   public static final int UDB_SYSTEM                                  = 1;
   public static final int UDB_INSTANCES_FOLDER                        = 2;
   public static final int UDB_INSTANCE                                = 3;
   public static final int UDB_DATABASES_FOLDER                        = 4;
   public static final int UDB_DATABASE                                = 5;
   public static final int UDB_TABLES_FOLDER                           = 6;
   public static final int UDB_TABLE                                   = 7;
   public static final int UDB_TABLESPACES_FOLDER                      = 8;
   public static final int UDB_TABLESPACE                              = 9;
   public static final int UDB_VIEWS_FOLDER                            = 10;
   public static final int UDB_VIEW                                    = 11;
   public static final int UDB_ALIASES_FOLDER                          = 12;
   public static final int UDB_ALIAS                                   = 13;
   public static final int UDB_TRIGGERS_FOLDER                         = 14;
   public static final int UDB_TRIGGER                                 = 15;
   public static final int UDB_SCHEMAS_FOLDER                          = 16;
   public static final int UDB_SCHEMA                                  = 17;
   public static final int UDB_INDEXES_FOLDER                          = 18;
   public static final int UDB_INDEX                                   = 19;
   public static final int UDB_CONNECTIONS_FOLDER                      = 20;
   public static final int UDB_CONNECTION                              = 21;
   public static final int UDB_REPLICATION_SOURCES_FOLDER              = 22;
   public static final int UDB_REPLICATION_SOURCE                      = 23;
   public static final int UDB_REPLICATION_SUBSCRIPTIONS_FOLDER        = 24;
   public static final int UDB_REPLICATION_SUBSCRIPTION                = 25;
   public static final int UDB_BUFFERPOOLS_FOLDER                      = 26;
   public static final int UDB_BUFFERPOOL                              = 27;
   public static final int UDB_APPLICATION_OBJECTS_FOLDER              = 28;
   public static final int UDB_USER_DEFINED_DISTINCT_DATATYPES_FOLDER  = 29;
   public static final int UDB_USER_DEFINED_DISTINCT_DATATYPE          = 30;
   public static final int UDB_USER_DEFINED_DISTINCT_FUNCTIONS_FOLDER  = 31;
   public static final int UDB_USER_DEFINED_DISTINCT_FUNCTION          = 32;
   public static final int UDB_PACKAGES_FOLDER                         = 33;
   public static final int UDB_PACKAGE                                 = 34;
   public static final int UDB_STORE_PROCEDURES_FOLDER                 = 35;
   public static final int UDB_STORE_PROCEDURE                         = 36;
   public static final int UDB_USER_AND_GROUP_OBJECTS_FOLDER           = 37;
   public static final int UDB_DB_USERS_FOLDER                         = 38;
   public static final int UDB_DB_USER                                 = 39;
   public static final int UDB_DB_GROUPS_FOLDER                        = 40;
   public static final int UDB_DB_GROUP                                = 41;
   public static final int UDB_DRDA_TABLE                              = 42;
 
   public static final int S390_SUBSYSTEMS_FOLDER                      = 43;
   public static final int S390_SUBSYSTEM                              = 44;
   public static final int S390_BUFFERPOOLS_FOLDER                     = 45;
   public static final int S390_BUFFERPOOL                             = 46;
   public static final int S390_VIEWS_FOLDER                           = 47;
   public static final int S390_VIEW                                   = 48;
   public static final int S390_DATABASES_FOLDER                       = 49;
   public static final int S390_DATABASE                               = 50;
   public static final int S390_TABLESPACES_FOLDER                     = 51;
   public static final int S390_TABLESPACE                             = 52;
   public static final int S390_TABLES_FOLDER                          = 53;
   public static final int S390_TABLE                                  = 54;
   public static final int S390_INDEXS_FOLDER                          = 55;
   public static final int S390_INDEX                                  = 56;
   public static final int S390_STORAGE_GROUPS_FOLDER                  = 57;
   public static final int S390_STORAGE_GROUP                          = 58;
   public static final int S390_ALIASES_FOLDER                         = 59;
   public static final int S390_ALIAS                                  = 60;
   public static final int S390_SYNONYMS_FOLDER                        = 61;
   public static final int S390_SYNONYM                                = 62;
   public static final int S390_APPLICATION_OBJECTS_FOLDER             = 63;
   public static final int S390_COLLECTIONS_FOLDER                     = 64;
   public static final int S390_COLLECTION                             = 65;
   public static final int S390_PACKAGES_FOLDER                        = 66;
   public static final int S390_PACKAGE                                = 67;
   public static final int S390_PLANS_FOLDER                           = 68;
   public static final int S390_PLAN                                   = 69;
   public static final int S390_PROCEDURES_FOLDER                      = 70;
   public static final int S390_PROCEDURE                              = 71;
   public static final int S390_DB_USERS_FOLDER                        = 72;
   public static final int S390_DB_USER                                = 73;
   public static final int S390_LOCATIONS_FOLDER                       = 74;
   public static final int S390_LOCATION                               = 75;
   public static final int S390_DISTINCT_TYPES_FOLDER                  = 76;
   public static final int S390_DISTINCT_TYPE                          = 77;
   public static final int S390_USER_DEFINED_FUNCTIONS_FOLDER          = 78;
   public static final int S390_USER_DEFINED_FUNCTION                  = 79;
   public static final int S390_TRIGGERS_FOLDER                        = 80;
   public static final int S390_TRIGGER                                = 81;
   public static final int S390_SCHEMAS_FOLDER                         = 82;
   public static final int S390_SCHEMA                                 = 83;
   public static final int S390_CATALOG_TABLES_FOLDER                  = 84;
   public static final int S390_CATALOG_TABLE                          = 85;
 
   public static final int DCS_GATEWAY_CONNECTIONS_FOLDER              = 86;
   public static final int DCS_GATEWAY_CONNECTION                      = 87;
 
   /**
    * Total number of object types
    */
   public static final int NUM_OBJECT_TYPES                            = 88;
 
   /**
    * Get the name of these object
    * The function returns the name of this object. This name
    * can be of three types:
    * (1) Fully qualified name
    *     Syntax: xxxxx-yyyyy-zzzzz
    *             where xxxxx-yyyyy is the fully quality name of the
    *             parent object and zzzzz is the name of the new object.
    *     Note: Parent and child object name is separated by '-' character.
    *     If a schema name is required to identify object, the fully
    *     qualified name is represented by xxxxx-yyyyy-wwwww.zzzzz
    *     where wwwww is the schema name.
    *     Only the behavior of the object that matches this fully
    *     qualified name will be affected.
    * (2) Parent fully qualified name
    *     Syntax: xxxxx-yyyyy
    *             where xxxxx-yyyyy is the fully qualified name of the
    *             parent object.
    *     When the object type is folder (ie. DATABASES_FOLDER), the
    *     getName() should only return the fully qualified name of the
    *     folder's parent.
    *     Only the behavior of the object that match this name
    *     and the specific type return by the getType() function will be
    *     affected.
    * (3) null
    *     Syntax: null
    *     If null is return, the CCActions returns by the getActions()
    *     call will be applied to all objects of type returns by the
    *     getType() call.
    * @return String object name
    */
   public String getName();
 
   /**
    * Get the type of this object
    * @return int return one of the static type constants defined
    * in this interface
    */
   public int getType();
 
   /**
    * Get the CCMenu Action array which defines the list of menu actions
    * to be created for the selected object
    * return CCMenuAction[] CCMenuAction array
    */
   public CCMenuAction[] getMenuActions();
 
   /**
    * Check if this object is editable.
    * If not, the Alter related menu items will be removed from
    * the object's popup menu return boolean If false, the Alter
    * menu item will be removed from the object's popup menu
    */
   public boolean isEditable();
 
   /**
    * Check if this object is configurable.
    * If not, the configuration related menu items will be
    * removed from the object's popup menu return boolean If
    * false, the Configuration related menu item will be removed
    * from the object's popup menu
    */
   public boolean isConfigurable();
}

Note:At this time, the last two methods in CCObject: isEditable() and isConfigurable() should always return true.

CCMenuAction

The CCMenuAction interface allows you to define a new action to be used by a Control Center object.

The external interface is defined as follows:

public interface CCMenuAction
{
   /**
    * Get the name of this action
    * @return String Name text on the menu item
    */
   public String getMenuText();
 
   /**
    * Invoked when an action occurs. Use the getActionCommand()
    * method of the ActionEvent to get the fully qualified name of
    * the invoked Control Center object.
    * @param e Action event
    */
   public void actionPerformed(ActionEvent e);
}

CCToolBarAction

The CCToolbarAction interface allows you to define a new action on the Control Center toolbar.

The external interface is defined as follows:

public interface CCToolbarAction
{
   /**
    * Get the name of this action
    * @return String Name text on the menu item, or toolbar
    * button hover help
    */
   public String getHoverHelpText();
 
   /**
    * Get the icon for the toolbar button
    * Any toolbar CCAction should implement this function and return
    * a valid ImageIcon object. Otherwise, the button will have no icon.
    * @return ImageIcon Icon to be displayed
    */
   public ImageIcon getIcon();
 
   /**
    * Invoked when an action occurs.
    * @param e Action event
    */
   public void actionPerformed(ActionEvent e);
}


[ Top of Page | Previous Page | Next Page ]