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 project object via the SDK?

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

Problem:

Is it possible to query the CaliberRM database project 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 in the sample below, is similar to the WHERE clause of a SQL statement, e.g. the statement

Project_p::name like "Address Book"

would only return the details of the Address Book project.

To return All projects beginning with the letter "A" The statement

Project_p::name like "A*"

would return the details of all projects beginning with "A"

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

Project_p::id_number
Project_p::name
Project_p::description
Project_p::email_addr

Sample Java Code Utilising the "FrameworkManager Class"

import org.omg.CORBA.Any;
import org.omg.CORBA.ORB;
import FrameworkManagement.FrameworkManager;
import FrameworkManagement.ProjectInfo;
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 users
Any rv = ORB.init().create_any();

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

//Create Container to hold information on all projects
rv.insert_string("Project_p::name like "*"");
ProjectInfo[] projects = myFrame.getProjectInfo(rv);

for(int i=0; i<>
{
System.out.println (projects.name);
}
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 User object via the SDK?

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


Old KB# 30074

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.