Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

Is it possible to query the CaliberRM database User object via the SDK?

Is it possible to query the CaliberRM database User object via the SDK?

Problem:

Is it possible to query the CaliberRM database User object via the SDK?

Resolution:


  • Product Name: CaliberRM
  • Product Version: 2008
  • Product Component: Java SDK
  • Platform/OS Version: All

This is possible using the "FrameworkManager Class" which is only available in the Java SDK. The query, which is marked in red, is similar to the WHERE clause of a SQL statement, e.g. the statement

User_v300_p::user_id like "Admin"

would only return the details of the Admin user.

The statement

User_v300_p::last_name like "A*"

would return the details of all users with a last name beginning with "A"

The following objects can be returned by the "FrameworkManager Class"

User_v300_p::id_number
User_v300_p::user_id
User_v300_p::first_name
User_v300_p::last_name
User_v300_p::email_addr
User_v300_p::dept_item_id
User_v300_p::location
User_v300_p::phone_num
User_v300_p::fax_num
User_v300_p::pager_num
User_v300_p::password
User_v300_p::must_change_password
User_v300_p::can_not_change_password
User_v300_p::password_never_expires
User_v300_p::account_disabled
User_v300_p::title
User_v300_p::userCanModifyBaselines
User_v300_p::dn

Sample Java Code Utilising the "FrameworkManager Class"

import org.omg.CORBA.Any;
import org.omg.CORBA.ORB;

import FrameworkManagement.FrameworkManager;
import FrameworkManagement.UserInfo;
import com.starbase.caliber.*;
import com.starbase.caliber.server.CaliberServer;


public class Test {
static Session session = null;
static RequirementManager My_Req_Man = null;
static int projectID = -1;
static int baselineID = -1;
static int Requirement_Count=0;

public static void main( String[] args) {


try {


//login to CaliberRM
CaliberServer server = new CaliberServer("localhost");

session = server.login( "admin", "admin");
System.out.println ("login successful");

//Create FrameworkManager object to obtain Project Information
FrameworkManager myFrame=session.getRemoteFrameworkManager();

//Create Container to hold information on all Projects
Any rv = ORB.init().create_any();
rv.insert_string("User_v300_p::user_id like "*"");
UserInfo[] userinfo = myFrame.getUserInfo(rv);

System.out.println ("User Information");
System.out.println ("--------------------------------------------------------------");
for(int i=0; i<>
{
System.out.println (userinfo.first_name + " " + userinfo.last_name + " " + userinfo.user_id );
}

System.out.println ("--------------------------------------------------------------");


session.logout();
System.out.println ("logout successful");



} catch( Exception e ) {
e.printStackTrace();
} finally {
if ( session != null ) {
session.logout();
}
}
}}

Additional examples of querying other database objects via the SDK can be found below:

Is it possible to query the CaliberRM database project object via the SDK?

Is it possible to query the CaliberRM database project object and return baseline info via the SDK?


Old KB# 30077

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 20:42
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.