AdminSession object

An AdminSession object allows you to create a session object associated with a schema repository.

The AdminSession object is the starting point if you want to modify the information in a schema repository. Unlike the Session object, you must create an instance of AdminSession explicitly even if you are writing a hook. You create an AdminSession object as follows:

Language example
Syntax for manually creating the AdminSession object in an external application
Visual Basic
set adminSession = CreateObject("CLEARQUEST.ADMINSESSION")
Perl
$currentAdminSession= CQAdminSession::Build();

When you are done with the object, destroy it:

CQAdminSession::Unbuild($currentAdminSession);

This creates an uninitialized AdminSession object. To use it you have to log into the database using the AdminSession.Logon method. This method logs you into the schema repository in the specified database set. It takes the following arguments (the argument values are strings):


Logon login_name, password, databaseSetName

You must know the administrator's login name and password, as well as the name of the database set containing the schema repository. After you have logged on successfully, you can use the methods of the AdminSession object to get information from the schema repository.

You can get various information such as users, groups, and databases associated with this schema repository. The AdminSession API hierarchy is:


AdminSession

    |-----Users

    |       |-----User

    |-----Groups

    |       |-----Group

    |-----Databases

    |       |-----Database

    |-----Schemas

            |-----Schema 
Note: To learn about user administration, see "Performing user administration".