where xml file of project area is located in rational team concert.
I have just started to extend rational team concert.I am currently trying to develop plugin for follow up action for operation save work item, In that I want an XML structure containing all of the work item attribute values as they exist in the database after the save.
Any advice would be much appreciated, very stuck at this stage.
Thanks in advance.
Accepted answer
the project XML does not have any VALUES of the attributes.
in the followup extension, you can get the CURRENT values (they were saved just before the extension was called). but you do not have an XML structure, just the attributes, their values, and the attribute type (object). from that you could construct an xml document.
you can get the project XML from the project area
you can see code to get the xml structure here
https://jazz.net/forum/questions/159700/is-it-possible-to-migrate-an-rtc-project-area-to-a-different-process-parent-programmatically
in the accepted answer
// get the process data
@SuppressWarnings("unchecked")
Map<object, Object=""> pd = ip.getProcessData();
// get the content Manager
IContentManager icm = repo.contentManager();
// get the process config content object
IContent processSource = (IContent) pd.get(keyname);
if (processSource != null)
{
System.out.println("have xml source");
saveXMLSource(ip, processSource, icm, sPm);
}
Comments
Hi Sam,
Thanks for your response,I want to retrieve work item attribute values during work item save operation and want to add that attribute values in xml format in log file which i have created.
How I can achieve this.
you would have to loop thru all the attributes and build your xml doc..
the workitem is the NewState
the accepted answer here https://jazz.net/forum/questions/94776/assertionfailedexception-problem-with-getting-the-values-of-attributes has code that shows how to loop thru all the attributes of a workitem and get their types and values (most of them)
see
static void printAttributes(IWorkItem workItem,
// loop thru all the workitem attributes in the project
for (IAttribute ia : workItemCommon.findAttributes(projectArea,
monitor))
{
// if this workitem has this attribute and
// its NOT an internal use attribute
if (workItem.hasAttribute(ia) && !ia.isInternal())