rtc api : add attributes and editor presentation elements
Hello to the forum members,
I defined couple of attributes and some related presentations for a work-item. I'd like to prepare some sort of setup script that will create these items.
I'm digging into RTC SDK API in search for an API that will allow me to add attributes and editor presentation elements, currently with no luck. If you have a link to sample code that does that it would be great if you could add it here.
Many thanks,
Gidi
I defined couple of attributes and some related presentations for a work-item. I'd like to prepare some sort of setup script that will create these items.
I'm digging into RTC SDK API in search for an API that will allow me to add attributes and editor presentation elements, currently with no luck. If you have a link to sample code that does that it would be great if you could add it here.
Many thanks,
Gidi
One answer
This code adds the attribute to the project area, if it is not available
All the code needed to create new attributes and editor presentations is available in the Eclipse client. Out of curiosity I have looked at the project area editor to find out more. However, it is so abstracted out and really complex, that I gave up trying, because I did not have the business justification to spend days on it.
if (null == customString && fCreateAttributesIfMissing) {
customString = workItemClient.createNewAttribute(fProjectArea,
fCustomStringAttributeID, AttributeTypes.SMALL_STRING,
IAttribute.FULL_TEXT_KIND_DEFAULT, monitor);
customString.setDisplayName("Created String ("
+ fCustomStringAttributeID + ")");
customString = workItemClient.saveAttribute(customString,
monitor);
}
if (!workItem.hasCustomAttribute(customString)) {
// If not defined in the process template it has to be
// manually created
workItem.addCustomAttribute(customString);
}
Caveat of this approach was that the attribute was not available in the process XML as far as I remember. It was available for usage in the project, but did not show up in the configuration editor. I have not tried this for a very long time.
All the code needed to create new attributes and editor presentations is available in the Eclipse client. Out of curiosity I have looked at the project area editor to find out more. However, it is so abstracted out and really complex, that I gave up trying, because I did not have the business justification to spend days on it.
Comments
Gidi Gal
Feb 27 '14, 2:18 a.m.