public class ItemHandler extends LoginDungs implements java.lang.Runnable
This class serves as a little example how to work with the Track+ client library (TCL). It demonstrates how to create an item, retrieve an item by its identifier, and change various aspects of an item. It also demonstrates how to access all item information.
The class uses the LoginSample
class to perform
the login. You need to set the URL and the user name and password in that
class before compiling and running this class here.
This example is a Java console application. You can run it directly by
calling its main()
method.
connector, pField, uName, url
Constructor and Description |
---|
ItemHandler()
The constructor.
|
ItemHandler(TCLFacade connector)
Constructor with existing connection.
|
Modifier and Type | Method and Description |
---|---|
WSField[] |
getCustomFields() |
WSDisplayItemBean |
getDisplayItem(java.lang.String itemID)
Retrieve an item by its identifier.
|
WSEditItemContextBean |
getEditItemContext(java.lang.String itemID)
The item context contains all objects the item proper references.
|
WSItemBean |
getItem(java.lang.String itemID)
Retrieve an item by its identifier.
|
WSItemContextBean |
getItemContext(java.lang.String itemID)
The item context contains all objects the item proper references.
|
WSItemContextBean[] |
getItemContexts(java.lang.String[] itemIDs) |
static void |
main(java.lang.String[] args) |
void |
modifyItem(java.lang.String itemID)
This method demonstrates how to change some aspects of an item.
|
void |
printBaseFields(WSItemBean item) |
void |
printDisplayItem(WSDisplayItemBean displayItem) |
void |
printEditItemContext(WSEditItemContextBean editCtx,
WSField[] customFields) |
void |
printItem(WSItemBean item) |
void |
printItemSimple(WSItemBean item) |
void |
run() |
checkVersion, handleTCLFacadeException, login, login, startTime, stopTime
public ItemHandler()
public ItemHandler(TCLFacade connector)
connector
- public WSItemBean getItem(java.lang.String itemID)
itemID
- the object identifier of the item to retrieve.public WSDisplayItemBean getDisplayItem(java.lang.String itemID)
itemID
- public WSItemContextBean getItemContext(java.lang.String itemID)
The item context contains all objects the item proper references. For example, the context contains the persons that are the (possible) manager and responsible of that item, with all their related information, or the possible statuses, priorities, severities, and so on.
The context is helpful when constructing the selection boxes at the user interface.
itemID
- public WSItemContextBean[] getItemContexts(java.lang.String[] itemIDs)
public WSEditItemContextBean getEditItemContext(java.lang.String itemID)
The item context contains all objects the item proper references. For example, the context contains the persons that are the (possible) manager and responsible of that item, with all their related information, or the possible statuses, priorities, severities, and so on.
The context is helpful when constructing the selection boxes at the user interface.
itemID
- public void modifyItem(java.lang.String itemID)
itemID
- public WSField[] getCustomFields()
public void printItemSimple(WSItemBean item)
public void printItem(WSItemBean item)
public void printBaseFields(WSItemBean item)
public void printDisplayItem(WSDisplayItemBean displayItem)
public void printEditItemContext(WSEditItemContextBean editCtx, WSField[] customFields)
public static void main(java.lang.String[] args)
public void run()
run
in interface java.lang.Runnable
run
in class LoginDungs