OSLC REST API: how to set a "drop down list" attribute, as for example "priority", for a RTC WI
Hi all.
I'm developing an OSLC client for my RTC - I need to be able to "create" and "update" RTC WI from an extenal application. I'm using the OSLC4J libraries as base OSLC client code as starting point.
I'm able to create WI with sample fields (title, description) and even with some custom attributes.
Now the problem I need to solve is how to set values for attributes that accepts pre-defined multiple values, as for example "oslc-cmx:priority". In other words, when I'm going to create my new WI, I want to set the priority too (low, medium or high).
If I look at rdf presentatoin of a WI with a set priority, it loks like this:
<rdf:RDF>
.....
<oslc_cmx:priority rdf:resource="https://x.xx.xx.xx:9443/ccm/oslc/enumerations/_ryl8MLbfEeK8JbTtKcHtwA/priority/priority.literal.l02"/>
</rdf:RDF
as you can see, the "value"for the priority attribute is in terms of enumeration.
Now the question is: how should I "query" what are the predefined values (enumerations) for an attribute like "priority" in order to get the correct "literal" to be set when I create the WI?
PS: I'm including what looks like the response for a GET of "enumerations" for "priority":
GET https://X.XX.XXX.XX:9443/ccm/oslc/enumerations/_ryl8MLbfEeK8JbTtKcHtwA/priority
Response:
<rdf:RDF>
<rdf:Description rdf:about="https://x.xx.xxx.xx:9443/ccm/oslc/enumerations/_ryl8MLbfEeK8JbTtKcHtwA/priority/priority.literal.l07">
<rdf:type rdf:resource="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/Literal"/>
<rtc_cm:iconUrl rdf:resource="https://x.xx.xxx.xx:9443/ccm/service/com.ibm.team.workitem.common.internal.model.IImageContentService/processattachment/_ryl8MLbfEeK8JbTtKcHtwA/enumeration/medium.gif"/>
<dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Medium</dcterms:title>
<dcterms:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">priority.literal.l07</dcterms:identifier>
</rdf:Description>
<rdf:Description rdf:about="https://x.xx.xxx.xx:9443/ccm/oslc/enumerations/_ryl8MLbfEeK8JbTtKcHtwA/priority">
<rdfs:member rdf:resource="https://x.xx.xxx.xx:9443/ccm/oslc/enumerations/_ryl8MLbfEeK8JbTtKcHtwA/priority/priority.literal.l11"/>
<rdfs:member rdf:resource="https://x.xx.xxx.xx:9443/ccm/oslc/enumerations/_ryl8MLbfEeK8JbTtKcHtwA/priority/priority.literal.l07"/>
<rdfs:member rdf:resource="https://x.xx.xxx.xx:9443/ccm/oslc/enumerations/_ryl8MLbfEeK8JbTtKcHtwA/priority/priority.literal.l02"/>
<rdfs:member rdf:resource="https://x.xx.xxx.xx:9443/ccm/oslc/enumerations/_ryl8MLbfEeK8JbTtKcHtwA/priority/priority.literal.l01"/>
<dcterms:title>priority</dcterms:title>
<oslc:totalCount>4</oslc:totalCount>
<rdf:type rdf:resource="http://open-services.net/ns/core#ResponseInfo"/>
</rdf:Description>
<rdf:Description rdf:about="https://x.xx.xxx.xx:9443/ccm/oslc/enumerations/_ryl8MLbfEeK8JbTtKcHtwA/priority/priority.literal.l02">
<rdf:type rdf:resource="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/Literal"/>
<rtc_cm:iconUrl rdf:resource="https://x.xx.xxx.xx:9443/ccm/service/com.ibm.team.workitem.common.internal.model.IImageContentService/processattachment/_ryl8MLbfEeK8JbTtKcHtwA/enumeration/low.gif"/>
<dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Low</dcterms:title>
<dcterms:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">priority.literal.l02</dcterms:identifier>
</rdf:Description>
<rdf:Description rdf:about="https://x.xx.xxx.xx:9443/ccm/oslc/enumerations/_ryl8MLbfEeK8JbTtKcHtwA/priority/priority.literal.l01">
<rdf:type rdf:resource="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/Literal"/>
<rtc_cm:iconUrl rdf:resource="https://x.xx.xxx.xx:9443/ccm/service/com.ibm.team.workitem.common.internal.model.IImageContentService/processattachment/_ryl8MLbfEeK8JbTtKcHtwA/enumeration/unassigned.gif"/>
<dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Unassigned</dcterms:title>
<dcterms:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">priority.literal.l01</dcterms:identifier>
</rdf:Description>
<rdf:Description rdf:about="https://x.xx.xxx.xx:9443/ccm/oslc/enumerations/_ryl8MLbfEeK8JbTtKcHtwA/priority/priority.literal.l11">
<rdf:type rdf:resource="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/Literal"/>
<rtc_cm:iconUrl rdf:resource="https://x.xx.xxx.xx:9443/ccm/service/com.ibm.team.workitem.common.internal.model.IImageContentService/processattachment/_ryl8MLbfEeK8JbTtKcHtwA/enumeration/high.gif"/>
<dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">High</dcterms:title>
<dcterms:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">priority.literal.l11</dcterms:identifier>
</rdf:Description>
</rdf:RDF>
Thanks in advance
Piero M.