GetCQLDAPMap
Description
Returns the Rational® ClearQuest® user profile field that is used for correlating LDAP user records to Rational® ClearQuest® user records.
Returns a Long corresponding to a CQLDAPMap constant. Returns 0 if the mapping is not configured. May return an exception if there is an error connecting to the schema repository (that is, the master database).
The CQLDAPMap constant can be one of the following Rational® ClearQuest® user profile fields: Name, FullName, Phone, Email, and MiscInfo. The CQLDAPMap field is specified with the installutil setcqldapmap subcommand.
In a MultiSite environment, Rational® ClearQuest® enforces that the same CQLDAPMap field is used for all sites (that is, the same Rational® ClearQuest® User profile field), but allows that the LDAP attribute that is mapped may be site specific. This allows you to have different LDAP schemas at different sites, but allows Rational® ClearQuest® to enforce the uniqueness of the Rational® ClearQuest® mapping field values across an entire database set.
GetCQLDAPMap returns 0 if the database set has not been configured forRational® ClearQuest® to LDAP mapping using the installutil setcqldapmap command.
Syntax
VBScript
adminSession.GetCQLDAPMap()
Perl
$adminSession->GetCQLDAPMap();
- Identifier
- Description
- adminSession
- The AdminSession object representing the current schema repository access session.
- Return value
- Returns a Long containing the CQLDAPMap value of the schema repository. Returns 0 if the mapping is not configured
Examples
VBScript
' Build a CQ AdminSession object...
Set CQAdminSession = CreateObject("CLEARQUEST.ADMINSESSION")
' Log on...
CQAdminSession.Logon CQADMINUSER, CQADMINPASSWORD, DBSET
' Test adminSession.GetCQLDAPMap
map = CQAdminSession.GetCQLDAPMap
if map = 0 then
msgbox "CQ to LDAP mapping not configured.
Run installutil setcqldapmap command" & vbcrlf
elseif map = AD_CQ_LOGIN_NAME then
msgbox "Map to CQ_LOGIN_NAME" & vbcrlf
elseif map = AD_CQ_FULLNAME then
msgbox "Map to CQ_FULLNAME" & vbcrlf
elseif map = AD_CQ_EMAIL then
msgbox "Map to CQ_EMAIL" & vbcrlf
elseif map = AD_CQ_PHONE then
msgbox "Map to CQ_PHONE" & vbcrlf
elseif map = AD_CQ_MISC_INFO then
msgbox "Map to CQ_MISC_INFO" & vbcrlf
else
msgbox "Undefined map value" & vbcrlf
end if
' Destroy the AdminSession (to log out of the database)
Set CQAdminSession = NothingPerl
use CQPerlExt;
my $admin_user = shift;
my $admin_pwd = shift;
my $dbset = shift;
my $AdminSession = CQAdminSession::Build();
eval{$AdminSession->Logon($admin_user, $admin_pwd, $dbset);};
if ($@){print "Error: $@\n";}
my $map;
eval{$map = $AdminSession->GetCQLDAPMap();};
if ($@){print "Error: $@\n";}
if ($map == 0){ print "CQ to LDAP mapping not configured.
Run installutil setcqldapmap command\nn";
}
elseif ($map == $CQPerlExt::CQ_CQ_LOGIN_NAME){
print "Map to CQ_LOGIN_NAME\nn";
}
elsif ($map == $CQPerlExt::CQ_CQ_FULLNAME){
print "CQ Authmode for CQ_CQ_FULLNAME\n";
}
elsif ($map == $CQPerlExt::CQ_CQ_EMAIL){
print "CQ Authmode for CQ_CQ_EMAIL\n";
}
elsif ($map == $CQPerlExt::CQ_CQ_PHONE){
print "CQ Authmode for CQ_CQ_PHONE\n";
}
elsif ($map == $CQPerlExt::CQ_CQ_MISC_INFO){
print "CQ Authmode for CQ_CQ_MISC_INFO\n";
}
else{
print "Undefined map value - val was $map\n";
}
CQPerlExt::CQAdminSession_Unbuild($AdminSession);