It's all about the answers!

Ask a question

get builtin attributes translation for Advisor


Jorge Diaz (8664234) | asked Jan 09 '12, 12:50 p.m.
JAZZ DEVELOPER
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.

4 answers



permanent link
Jorge Diaz (8664234) | answered Jan 10 '12, 5:06 p.m.
JAZZ DEVELOPER
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.

permanent link
sam detweiler (12.5k6189201) | answered Jan 10 '12, 10:13 a.m.
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

permanent link
Jorge Diaz (8664234) | answered Jan 10 '12, 9:40 a.m.
JAZZ DEVELOPER
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.

permanent link
sam detweiler (12.5k6189201) | answered Jan 10 '12, 8:32 a.m.
>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

Your answer


Register or to post your answer.