Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Lyo » Using OSLC query parameters to request requirements in DOORS
Using OSLC query parameters to request requirements in DOORS [message #1696428] Tue, 26 May 2015 12:41 Go to next message
Carlos Gomez is currently offline Carlos GomezFriend
Messages: 63
Registered: October 2010
Member
Hello everybody,

I'm using Lyo 2.1, specifically the DoorsOauthSample.java. I'm trying to customize the default query adding the "oslc.select" parameter.

I use OslcQueryParameters class to set oslc.prefix and oslc.select as:
OslcQueryParameters queryParams = new OslcQueryParameters();
queryParams.setPrefix(oslcPrefix);
queryParams.setSelect("dcterms:title");


Once I submit the query, the result contains all properties (as i did not set oslc.select) and not only dcterms:title.

Is it normal this query result in Lyo?
Re: Using OSLC query parameters to request requirements in DOORS [message #1698122 is a reply to message #1696428] Thu, 11 June 2015 12:56 Go to previous messageGo to next message
Duncan Lilly is currently offline Duncan LillyFriend
Messages: 1
Registered: June 2015
Junior Member
A colleague has confirmed that a oslc.select does definitely work with DOORS - eg:
https://win-8cogopo9d2y:8443/dwa/rm/oslc/query/urn:rational::1-55718b4938b21a1e-M-00000020?oslc.prefix=dcterms,oslc.select=dcterms:title

So, he asks if you can print the request URL and request headers coming out of Lyo, so we know the code is sending the request to the correct URL with correct parameters set.

He is going to test with Lyo when possible.
Re: Using OSLC query parameters to request requirements in DOORS [message #1699421 is a reply to message #1698122] Wed, 24 June 2015 08:53 Go to previous message
Carlos Gomez is currently offline Carlos GomezFriend
Messages: 63
Registered: October 2010
Member
Hello Duncan,

Thanks for you answer. The query sent by Lyo is the same. I found where the problem was. I am using DoorsOauthSample.java as guide for my code, so this example after returning the query result asks for the URL list of the result and then get the information asking again to the URL.

The good news is Lyo query result object (OslcQueryResult) has the method getMembers() which is an iterable object where you give the class type of the result members. Then, you get the information from response directly on the expected object.

For example, you build a query that returns the requirements of a DOORS module, but you only want to know its title. Suppose you get the query answer in reqRes which is a OslcQueryResult object. If the result is a list of requirements, then:

Iterator<Requirement> reqIt = reqRes.getMembers(Requirement.class)
				.iterator();

		while (reqIt.hasNext()) {
			Requirement res = reqIt.next();
			System.out.println(res.getTitle());
		}


That's all!!!
Previous Topic:Parsing ClientReponse for a DOORS Requirement
Next Topic:OSLC provider for DOORS 9.5 as OSLC consumer
Goto Forum:
  


Current Time: Tue Sep 25 13:03:09 GMT 2018

Powered by FUDForum. Page generated in 0.02378 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top