|How to set "priority" for my work item with OSLC? [message #1060286]
||Thu, 23 May 2013 21:28
| pietro marella
Registered: May 2013
I'm new with OSLC. I started from using the package org.eclipse.lyo.client.oslc.samples (RTCFormSample.java in particular) provided with the Lyo prject and I have developed a class by myself that relies on the OSLC4J client libraries to create and query work items (changerequests) on my Rational Team Concert) server.
I need now to make a pass further.
One of the attributes I need to set when I create a WI is the Priority, that can assume a predefined set of values (in a drop down menu).
When I display the RDF of a Work Item:
<oslc_cmx:priority rdf:resource="<A href='https:/x.xx.xx.xx:9443/ccm/oslc/enumerations/_ryl8MLbfEeK8JbTtKcHtwA/priority/priority.literal.l02" '="">https:/x.xx.xx.xx:9443/ccm/oslc/enumerations/_ryl8MLbfEeK8JbTtKcHtwA/priority/priority.literal.l02"/>
as you can see, Priority is a "oslc_cmx" type of attribute and its value is an enumeration (href='https:/x.xx.xx.xx:9443/ccm/oslc/enumerations/_ryl8MLbfEeK8JbTtKcHtwA/priority/priority.literal.l02)
So I did a GET from my REST Client on browser
and I get a response with all the "enumeration" available: this is an extract of the response, as for example:
From this response, I know that to set my WI Priority to "High" I need to write a code like this:
//create a ChangeRequest object
ChangeRequest wi = new ChangeRequest();
QName OSLC_PRIORITY = new QName("http:/jazz.net/xmlns/prod/jazz/rtc/ext/1.0/", "http:/jazz.net/xmlns/prod/jazz/rtc/cm/1.0/Literal", "oslc_cmx");
private Map<QName, Object> properties = new HashMap<QName, Object>();
properties.put(OSLC_PRIORITY, "https:/X.XX.XXX.XX:9443/ccm/oslc/enumerations /_ryl8MLbfEeK8JbTtKcHtwA/priority/priority.literal.l11");
//set extended properties for the changerequest
//then create the WI
This code works in some way, but of course, it is not fine.. I cannot use "hardcoded" values as I used in my sample.
What I need is to retrieve at runtime what are the valid pairs (value,URI) the attribute "priority" can assume. How should I do using the OSLC4J libraries? Is there any method I can use to simulate the execution of the GET I run on my browser, and to parse the response I should get back?
Hope I've not been too much confuse....
thanks in advance
Powered by FUDForum
. Page generated in 0.01519 seconds