To access Rational® ClearQuest® through the Rational CM
API, you must import the common interfaces and the ones that are specific
to Rational ClearQuest.
Once you have added the installed CM API files to your class path,
you can begin programming with CM API. Like any Java™ programming, you need to import all
interfaces that contain methods you are using in your code. Since the ClearQuest interfaces
are all in the same package, you can use a wildcard to include all of the
interfaces specific to Rational ClearQuest:
import com.ibm.rational.wvcm.stp.cq.*
You
need the classes from the WVCM package that implement the basic mechanisms
of the API. The remaining interfaces in the WVCM package deal specifically
with source configuration management resources and are not used when working
exclusively with Rational ClearQuest.
// WVCM classes to import for ClearQuest applications
import javax.wvcm.Feedback;
import javax.wvcm.PropertyNameList;
import javax.wvcm.ProviderFactory;
import javax.wvcm.ResourceList;
import javax.wvcm.PropertyRequestItem.NestedPropertyName;
import javax.wvcm.PropertyRequestItem.PropertyRequest;
import javax.wvcm.PropertyNameList.PropertyName;
import javax.wvcm.ProviderFactory.Callback;
import javax.wvcm.ProviderFactory.Callback.Authentication;
import javax.wvcm.WvcmException;
You also use many of the interfaces in the STP (software team
package) package that specify the extensions to WVCM used by the Rational CM
API.
// Common Rational CM API classes to import for ClearQuest
import com.ibm.rational.wvcm.stp.StpReleasableIterator;
import com.ibm.rational.wvcm.stp.StpException;
import com.ibm.rational.wvcm.stp.StpProperty;
import com.ibm.rational.wvcm.stp.StpResource;
import com.ibm.rational.wvcm.stp.StpProperty.MetaPropertyName;
import com.ibm.rational.wvcm.stp.StpLocation;
Finally, since the sample applications use the Swing GUI, you
also must include a number of the Swing, AWT, and Java utility classes.
// other utility classes to import for this tutorial
import java.lang.reflect.InvocationTargetException;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Arrays;
import java.util.Comparator;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.TableModel;
import javax.swing.JComboBox;
import javax.swing.JFileChooser;
All of the required interfaces to complete this tutorial are now included
in your code.