Jazz Register Log in
Jazz Forum Welcome to the Jazz Community Forum

Welcome to the Jazz Community Forum

Connect and collaborate with IBM Engineering experts and users

get builtin attributes translation for Advisor

Hello,

is there a way of getting the relationship between attribute ID and managed property name for an Operation Advisor as "com.ibm.team.workitem.common.internal.model.WorkItemAttributes" does?

I understand that using an internal class is not a safe option to do such a thing, but having as guide RequiredAttributesAdvisor it uses the same class.

The problem is that for an Advisor configuration, what is the rule to tell a user whether to use the internal ID or the "short" Property?

Thanks in advance for any help.

Regards,

Jorge.

0 votes



4 answers

Permanent link
>The problem is that for an Advisor configuration, what is the rule to tell a user whether to use the internal ID or the "short" Property?

I don't understand your question..

I provide an Advisor to my teams. they configure it by the 'name' I provide in the Advisor configuration.. 'Prohibit Save with Open Dependencies'

who is 'user'? Administrator, programmer?

Sam

0 votes


Permanent link
Hi,

the user I referred to is the RTC administrator. To give him guidance on what type/format of strings the advisor configuration can handle.

The problem is that for the built-in attributes, if I reference in the plugin the internal ID, for example, com.ibm.team.workitem.attribute.summary has to be converted using something like (or make the code internal names mapping aware):

String internalAttributeId= WorkItemAttributes.getAttributeId(Identifier.create(IAttribute.class, attributeId));

and then you can fetch the IAttribute to act over it:

IAttribute attribute= workItemCommon.findAttribute(workItem.getProjectArea(), attributeId, monitor);

As WorkItemAttributes states:

* This mapping can be used to retrieve attribute ids for built-in attributes
* providing a property identifier and vice-versa.
* Custom attributes always map to an identifier have the attribute id as identifier string.

Thanks!

Regards,

Jorge.

0 votes


Permanent link
thanks for the quick response, but I still don't understand..

maybe you could give us a little more of the use case you are trying to support.

you talk about administrator, plugin, attribute, ID and advisor

Administrators don't see code.. but you show code..

Sam

0 votes


Permanent link
Yes, I try to put things in order ;)

- We are developing precondition plugins with configuration source to allow our RTC administrators modify its parameterization.

- One of the plugins parameters is the attributes they act on. So we accept for our precondition the ability to specify attributes IDs in its configuration part in the Process source xml.

- What we try to support is that, no matter custom or built-in attributes, give administrators the ability of specifying the attribute ID for these parameters. As general rule to simplify their tasks.

- In order to make the code consistent; for the built-in attributes, if the administrator adds a new value specifying the attribute ID (for example com.ibm.team.workitem.attribute.summary) the code has to find a way of getting the translated property to get the IAttribute object and continue with the logic,, that's why I added the code in the previous post.

Thanks!

Regards,

Jorge.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,984

Question asked: Jan 09 '12, 12:50 p.m.

Question was seen: 5,967 times

Last updated: Jan 09 '12, 12:50 p.m.

Confirmation Cancel Confirm