CQCC::AssocList - Class to manage a list of ClearQuest Associations
This class manages a list of ClearQuest Change Requests that can be
associated with a ClearCase version. The entity, database, and number
are stored for each item, providing initial support for multiple
entities and multiple databases within a list. Methods provide the
same information formatted different ways for different needs; handle
parsing user input and output; and compare two lists to identify the
differences.
SUPPORT POLICY: See TriggerCQCC.pm for the Rational Support Policy.
ClassTest(args)
-
This function is a local unit test that will create an instance of the
Class and ask it to parse a typical user input string to set the
initial set of associations. It will then print out the same
information in various formats.
CreateEditLists(desiredList)
-
This method compares the current AssocList object (``existing list'')
with a second one (``desired list'') and produces two new association
lists describing the differences. The first is the items to be added
to the current list and the second is the items to be deleted from the
current list to produce the ``desired list''.
($add, $del) = $obj->CreateEditLists($obj2);
GetAssocs()
-
This method returns the internal associations list as a list
consisting of ``entity:DBNAMExxxx'' entries.
GetBugList( dbEntityFilter, delimiter )
-
This method returns the internal associations list as either a string
or a list depending on the return type expected by the caller. If a
list is expected it returns a list; otherwise it returns a scalar with
the items delimited by commas similar to what ProcessBugString accepts
for input. All bugs are displayed in full as DBNAME00000xxx and do not
include the entity name.
The dbEntityFilter argument requests that only items matching the
provided database and entity be returned. If undefined then all items
will be returned.
The optional delimiter argument specifies which delimiter to use to
produce string output. If not specified, a space is used.
GetEntityDBList( mergeList )
-
This method returns a list of unique ``entity:database'' combinations
that the association list covers. If a mergeList list is provided then
the return value will be a merge of the provided list and what the
association list has. This is used internally to support handling
lists of mixed entity:database combinations.
GetNumbers()
-
This method returns the internal associations list as a list
consisting of just the numeric bug numbers embedded in the
associations.
new( {ASSOC=>list} )
-
This method creates a new AssocList object, empty by default. If you
pass in ASSOC=>\@list, it will initialize the association list to the
list that you provide but will not test any internal values.
Print()
-
This method prints out the current association list.
ProcessBugString(entity, bugstring)
-
This method parses user input to determine a list of change request
IDs, assuming that all are in the same database.
Bugs may be entered with complete names, as 'SAMPL00000008' or
'SAMPL9', or as just numbers '000008' or '9', or any combination
as long as the database name (when used) matches the current
database.
SetAssocs(list)
-
This method sets the internal associations list from a list
consisting of ``entity:DBNAMExxxx'' entries.