Schemas
Description
Returns the collection of schemas associated with the schema repository. This is a read-only property; it can be viewed but not set.
Each element in the returned collection is a Schema Object.
Syntax
VBScript
adminSession.Schemas
Perl
$adminSession->GetSchemas();
- Identifier
- Description
- adminSession
- The AdminSession object representing the current schema repository access session.
- Return value
- A Schemas Object containing all of the schemas in the schema repository.
Example
VBScript
set adminSession = CreateObject("ClearQuest.AdminSession")
set SessionObj = CreateObject("ClearQuest.Session")
adminSession.Logon "admin", "admin", ""
set schemaList = adminSession.Schemas
For each schemaObj in schemaList
schemaName = schemaObj.Name
SessionObj.OutputDebugString "Found schema: " & schemaName
Next
Perl
use CQPerlExt;
#Create a Rational
ClearQuest admin session
$adminSession = CQAdminSession::Build();
$SessionObj = CQSession::Build();
#Logon as admin
$adminSession->Logon( "admin", "admin", "" );
#Get the list of schemas in the repository.
$schemaList = $adminSession->GetSchemas();
#Get the number of schemas in the repository
$numSchemas = $schemaList->Count();
#Iterate through the schemas in the repository
for ( $x=0; $x<$numSchemas; $x++ ) {
#Get the specified item in the collection of schemas
$schemaObj = $schemaList->Item( $x );
#Get the name of the schema
$schemaName = $schemaObj->GetName();
#Output, via debugger, that the user was found
$debugString = "Found schema: " . $schemaName;
$SessionObj->OutputDebugString( $debugString );
}
CQSession::Unbuild($SessionObj);
CQAdminSession::Unbuild($adminSession);