Oracle Fusion Middleware Java API Reference for Oracle Team Productivity Center
11g Release 2 (11.1.2.1.0)
E17494-02

oracle.alm.connector
Interface WorkItemConnector


public interface WorkItemConnector

The WorkItemConnector interface defines the common operations that are used to integrate any backend repository with Oracle Team Productivity Center (OTPC) inside JDeveloper. It contains the APIs to fetch query result sets, create a new work item, or update an existing work item, etc.

Since:
11.1.1.1.0

Field Summary
static java.lang.String CURRENT_WORKITEM_ID
           
static java.lang.String SESSION_PARAMS_KEY
           
 
Method Summary
 void createWorkItem(java.util.Map session, java.lang.String wiType, WorkItem workItem)
          Creates a new work item of a specified type on its backend repository.
 void deleteWorkItem(java.util.Map session, java.lang.String wiType, WorkItem workItem)
          Deletes a work item from its backend repository.
 java.lang.String getDynamicModel(java.util.Map session, java.lang.String currentModel)
          Retrieves the latest dynamic model from connector.
 java.lang.String getDynamicUI(java.util.Map session, java.lang.String currentUI)
          Retrieves the latest UI layout from connector.
 java.util.List<Row> getLOVQueryResult(java.util.Map session, java.lang.String wiType, QueryInfo query)
          Retrieves the result set in responding to the search action in the LOV (List of Values) dialog.
 java.util.List<WorkItem> getQueryResult(java.util.Map session, java.lang.String wiType, QueryInfo query)
          Retrieves a set of records for the specified work item type that satisfy the query criteria.
 java.lang.String getUIRegionName(java.util.Map session, java.lang.String wiType, WorkItem workItem)
          Gets the name for the UI block represented as region in the UI metadata or the UI XML file for a given work item type.
 WorkItem getWorkItem(java.util.Map session, java.lang.String wiType, java.lang.String wiId)
          Retrieves a specific work item by its type and unique identifier.
 boolean hasDynamicModel(java.util.Map session)
          Determines if dynamic model or definition is supported by the connector, scoped by session context.
 boolean hasDynamicUI(java.util.Map session)
          Determines if dynamic UI support is provided by the connector, scoped by session context.
 void init(java.util.Map session)
          Initializes the connector instance on the client side in a state specified by the connector parameters.
 boolean isAttachmentSupported(java.util.Map session, WorkItem workItem)
          Determines if attachment is supported for the specified work item.
 void login(java.util.Map session, java.lang.String userName, java.lang.String password)
          Establishes a user connection between the connector instance on the client side and the backend repository.
 void logout(java.util.Map session)
          Disconnects the user session from the backend repository.
 void setWorkItemDefs(java.util.Map session, java.util.Map<java.lang.String,WorkItemDef> wiDefs)
          During connector instance creation time, OTPC framework reads the connector model definition XML file and constructs the runtime map.
 void updateWorkItem(java.util.Map session, java.lang.String wiType, WorkItem workItem)
          Updates an existing work item by its type and unique identifier.
 

Field Detail

SESSION_PARAMS_KEY

static final java.lang.String SESSION_PARAMS_KEY
See Also:
Constant Field Values

CURRENT_WORKITEM_ID

static final java.lang.String CURRENT_WORKITEM_ID
See Also:
Constant Field Values
Method Detail

init

void init(java.util.Map session)
          throws ALMException
Initializes the connector instance on the client side in a state specified by the connector parameters. These parameters are defined in the connector.xml file, and typically include the connector's physical connection parameters for corresponding repository.

Parameters:
session - initial connector parameters as specified by its corresponding repository
Throws:
ALMException - if required repository information is missing

login

void login(java.util.Map session,
           java.lang.String userName,
           java.lang.String password)
           throws ALMException
Establishes a user connection between the connector instance on the client side and the backend repository. If login is successful, connector writer may add connection cookie to the session context for later use.

Parameters:
session - user session context
userName - the Id used to access the backend repository. It will never be null
password - the password used to access the backend repository. It may be null
Throws:
ALMException - if failed to log in.

logout

void logout(java.util.Map session)
            throws ALMException
Disconnects the user session from the backend repository. If session cookie is also stored inside the session context, it can be used to log out from the backend repository. State can be saved inside the session map.

Parameters:
session - user session context
Throws:
ALMException - if failed to log off

setWorkItemDefs

void setWorkItemDefs(java.util.Map session,
                     java.util.Map<java.lang.String,WorkItemDef> wiDefs)
                     throws ALMException
During connector instance creation time, OTPC framework reads the connector model definition XML file and constructs the runtime map. The map maintains each work item type definition and uses the type as its key. This method is called by the framework to set this structure so connector can use them inside other APIs like getQueryResult().

Parameters:
session - user session context
wiDefs - the map contains work item definitions by types
Throws:
ALMException

getQueryResult

java.util.List<WorkItem> getQueryResult(java.util.Map session,
                                        java.lang.String wiType,
                                        QueryInfo query)
                                        throws ALMException
Retrieves a set of records for the specified work item type that satisfy the query criteria.

Parameters:
session - user session context
wiType - the work item type
query - the query criteria
Returns:
a list of WorkItem objects that contains the result set
Throws:
ALMException

getLOVQueryResult

java.util.List<Row> getLOVQueryResult(java.util.Map session,
                                      java.lang.String wiType,
                                      QueryInfo query)
                                      throws ALMException
Retrieves the result set in responding to the search action in the LOV (List of Values) dialog.

Parameters:
session - user session context
wiType - the work item type
query - the query criteria
Returns:
a list of row objects representing the query result
Throws:
ALMException

getWorkItem

WorkItem getWorkItem(java.util.Map session,
                     java.lang.String wiType,
                     java.lang.String wiId)
                     throws ALMException
Retrieves a specific work item by its type and unique identifier.

Parameters:
session - user session context
wiType - the work item type
wiId - Id of the work item to retrieve
Returns:
a WorkItem object that contains the work items's field values
Throws:
ALMException

updateWorkItem

void updateWorkItem(java.util.Map session,
                    java.lang.String wiType,
                    WorkItem workItem)
                    throws ALMException
Updates an existing work item by its type and unique identifier. Upon a successful update, workItem contains updated information for the work item from the backend repository.

Parameters:
session - user session context
wiType - the work item type
workItem - the work item to update
Throws:
ALMException

createWorkItem

void createWorkItem(java.util.Map session,
                    java.lang.String wiType,
                    WorkItem workItem)
                    throws ALMException
Creates a new work item of a specified type on its backend repository. Upon a successful creation, workItem contains work item as it is created on the backend repository

Parameters:
session - user session context
wiType - the work item type
workItem - contains new field values to be saved
Throws:
ALMException

deleteWorkItem

void deleteWorkItem(java.util.Map session,
                    java.lang.String wiType,
                    WorkItem workItem)
                    throws ALMException
Deletes a work item from its backend repository.

Parameters:
session - user session context
wiType - the work item type
workItem - the work item to be deleted
Throws:
ALMException

isAttachmentSupported

boolean isAttachmentSupported(java.util.Map session,
                              WorkItem workItem)
                              throws ALMException
Determines if attachment is supported for the specified work item. If returns true, the connector needs to implement the WorkItemAttachment interface.

Parameters:
session - user session context
workItem - current work item
Returns:
true if attachment is supported for the work item
Throws:
ALMException

getUIRegionName

java.lang.String getUIRegionName(java.util.Map session,
                                 java.lang.String wiType,
                                 WorkItem workItem)
                                 throws ALMException
Gets the name for the UI block represented as region in the UI metadata or the UI XML file for a given work item type.

Parameters:
session - user session context
wiType - the work item type
workItem - current work item
Returns:
the region name
Throws:
ALMException

hasDynamicUI

boolean hasDynamicUI(java.util.Map session)
                     throws ALMException
Determines if dynamic UI support is provided by the connector, scoped by session context.

Parameters:
session - user session context
Returns:
true if the dynamic UI is supported
Throws:
ALMException

getDynamicUI

java.lang.String getDynamicUI(java.util.Map session,
                              java.lang.String currentUI)
                              throws ALMException
Retrieves the latest UI layout from connector. Normally this call follows the call to hasDynamicUI().

Parameters:
session - user session context
currentUI - the current UI xml stream presented in a string
Returns:
String a string that contains the new UI XML stream if it is different from the one passed in, currentUI
Throws:
ALMException

hasDynamicModel

boolean hasDynamicModel(java.util.Map session)
                        throws ALMException
Determines if dynamic model or definition is supported by the connector, scoped by session context.

Parameters:
session - user session context
Returns:
true if the dynamic model is supported
Throws:
ALMException

getDynamicModel

java.lang.String getDynamicModel(java.util.Map session,
                                 java.lang.String currentModel)
                                 throws ALMException
Retrieves the latest dynamic model from connector. Normally this call follows the call to hasDynamicModel().

Parameters:
session - user session context
currentModel - the current model xml stream presented in a string
Returns:
String a string that contains the new model XML stream
Throws:
ALMException

Oracle Fusion Middleware Java API Reference for Oracle Team Productivity Center
11g Release 2 (11.1.2.1.0)
E17494-02

Copyright © 1998,2011, Oracle. All rights reserved.