Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Lyo » DOORS ClientResponse.getEntity(ServiceProviderCatalog.class)(The result appears to be incorrect)
DOORS ClientResponse.getEntity(ServiceProviderCatalog.class) [message #1723705] Wed, 17 February 2016 10:30 Go to next message
David Akehurst is currently offline David AkehurstFriend
Messages: 13
Registered: July 2009
Junior Member
I am connecting to a DOORS Web Access (v9.6.1.4).
Based on the DoorsOauthSample found in ...lyo.client.oslc.samples.

JazzRootServicesHelper helper = new JazzRootServicesHelper(webContextUrl + "/public",OSLCConstants.OSLC_RM_V2);
OslcOAuthClient client = helper.initOAuthClient("lyo", "lyo");
...
String catalogUrl = helper.getCatalogUrl();
ClientResponse response = client.getResource(catalogUrl,OSLCConstants.CT_RDF);
ServiceProviderCatalog catalog = response.getEntity(ServiceProviderCatalog.class);


The resulting catalog is not the root catalog from the URL passed in, it is one of the sub-catalogs.


After debugging through the code I discovered that the OslcRdfXmlProvider seems to be reading each of the sub-catalogs as a separate resource and then it returns just the first one parsed (which happens to be incorrect).
In JenaModelHelper.fromJenaModel the 'if (!OSLC4JUtils.useBeanClassForParsing())' path is taken, which seems to do the wrong thing.
Noticing the sections regarding "// Fix for defect 412755" which use "OSLC4JUtils.useBeanClassForParsing()".
If I set the relevant system property, like so
System.setProperty(OSLC4JConstants.OSLC4J_USE_BEAN_CLASS_FOR_PARSING,"true");

Then I get the correct result.
After reading about bug 412755 I don't understand how it is relevant to my code, and why I have to set this system property to get it to work?

Is this a bug or is it normal to have to set this property?
Re: DOORS ClientResponse.getEntity(ServiceProviderCatalog.class) [message #1725160 is a reply to message #1723705] Tue, 01 March 2016 10:22 Go to previous message
Maeve OReilly is currently offline Maeve OReillyFriend
Messages: 13
Registered: October 2013
Junior Member
It's supposed to through all the DOORS projects (service providers) until it finds in one of them a service provider for the module name passed in as a parameter. I just tested (v9.6.1.4) with a module not in the first project found and it still finds it. But it does stop once it finds it- it would need more logic when there are duplicate module names. I don't have to go changing any system properties.

You do give a module (not project) as the parameter? What is the structure of the database? It is a pretty basic sample, I wouldn't be astonished if a complex structure impacted its ability to find a module.
Previous Topic:Upload attachment to RTC using Lyo
Next Topic:Cannot upload file using the Lyo Automation Adapter
Goto Forum:
  


Current Time: Sun Nov 18 16:41:26 GMT 2018

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

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

Back to the top