It's all about the answers!

Ask a question

Need clarification on extending java (external reference) Value Set Providers for use with stringList and Value Set Picker for multiple selection.


Robert Stawicki (5844) | asked Aug 17 '17, 4:29 p.m.

So, we've been using javascript Value Set Providers for quite a while (for values available from within RTC), and started a while back using a java Value Set Provider which gives us the ability to gather selections from an external source. We've been using this to some success for single selection values. We figured out how to use the latter with a stringList attribute and Value Set Picker for multiple selections. But it was a total guess and may have just got lucky. We used the information provided at (toward the end) -

https://jazz.net/wiki/bin/view/Main/DataSourceValueSetProviders

Question 1 -

From that link we defined our plugin.xml extension point for a single select (string) as follows -

ex -
   <extension
         point="com.ibm.team.workitem.common.attributeValueProviders">
      <valueSetProvider
            class="com.ibm.sport.rtc.common.RTC51615L6Q000ValueSetUtils"
            id="com.ibm.sport.rtc.common.RTC51615L6Q000ValueSetUtils"
            name="Test for multi-choice for string list Value Set Provider">
         <attributeType id="smallString"/>
         <attributeType id="mediumString"/>
         <attributeType id="string"/>
      </valueSetProvider>
   </extension>

What do the attributeTypes correspond to? We changed the last one to stringList and it worked for multiple selections. Was this correct? I assume that was the return value type, correct?
Curious what the other two are - one may be the attribute ID, but just dont know?

ex -
   <extension
         point="com.ibm.team.workitem.common.attributeValueProviders">
      <valueSetProvider
            class="com.ibm.sport.rtc.common.RTC51615L6Q000ValueSetUtils"
            id="com.ibm.sport.rtc.common.RTC51615L6Q000ValueSetUtils"
            name="Test for multi-choice for string list Value Set Provider">
         <attributeType id="smallString"/>
         <attributeType id="mediumString"/>
         <attributeType id="stringList"/>
      </valueSetProvider>
   </extension>


Question 2 -

We reuse the same java Value Set Provider code for attributes that gather external data and format choices depending on the attribute applied to. Some of these attributes only need 1 choice, and so are string attributes. In some test code, we reused the provider extension with stringList extension on a string attribute, and it appeared to work. Was this by design or chance?

Accepted answer


permanent link
Ralph Schoon (63.2k33646) | answered Aug 18 '17, 2:46 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Most of the attribute types above are for single value items. For multiple values add List to the name as described in https://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/ e.g. stringList as you did in the last example.

Robert Stawicki selected this answer as the correct answer

Comments
Robert Stawicki commented Aug 18 '17, 12:13 p.m. | edited Aug 18 '17, 12:16 p.m.

Ah, after all this time guessing at what the meaning of the attributeTypes were, I believe I now get it.
It is a list of ALL of the attribute types you want your provider extension to apply to. (So I could have just ADDED stringList and kept "string" there, then it applies to / is available to be used by 4 attribute types in the project area.) I thought it was a list of argument types to the provider extension, and dont know where I got that idea from?
(Yes, the light went on - it was not obvious to me - for so long.)
Thank You.

(Quote from the link you provided -
Also be aware you can and should add several attribute type definitions if you want the extension to support more than one type. String provider are typical in this case. If you want to be able to select them for all string type attributes, define small, medium and large string like below.
)


Ralph Schoon commented Aug 18 '17, 2:32 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Take my blog post with a grain of salt. I just found it working that way. I experimented with it. I did not design the API/extension point, so there might be issues.

Your answer


Register or 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.