|Re: [lyo-dev] Fwd: How to set "priority" for my work item with OSLC?|
---------- Forwarded message ----------
From: Pietro Marella <pietro.marella@xxxxxxxxx>
Subject: How to set "priority" for my work item with OSLC?
To: lyo-dev@xxxxxxxxxxxThanks in advance.So if you can, I'll appreciate if you can spend some time to help me address this problem.I wrote in the forum, but I didn't get an answer yet.Hellohope this is the right place where to post my question.
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"/>
as you can see, Priority is a "oslc_cmx" type of attribute and its value is an enumeration (href="">
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"
lyo-dev mailing list