Linking OLSC resources within DNG
I've stood up an OSLC Bugzilla server and successfully connected DNG to it as an Outbound Friend in both the server administration area and the project administration area. Now I cannot figure out what I need to do to create a link from the DNG artifact to the Bugzilla server.
|
5 answers
I made it work for RDNG 6.x. The problem is that RDNG request the Bugzilla services document in application/rdf+xml and is not able to consume it ( it only consume application/xml ).
What I did is change the Eclipse Lyo library to return the Services document for the RM domain always as application/xml. That allowed me to create links between RDNG and Bugzilla code.
Comments Thank you. I'll give it a try. Do you recall which classes you touched? The ServiceProviderService.class or all of them?
Gabriel Ruelas
commented May 24 '17, 1:50 p.m.
AbstractOslcRdfXmlProvider, Method writeTo().
Matthew Stone
commented May 25 '17, 1:50 p.m.
Thanks for that. I've set break points in both of the writeTo() method signatures in that class and the thread never stops there when I attempt to add the Bugzilla association in DNG. I'm just prompted to authenticate over and over again. My break point in the CredentialsFilter is called every time and authenticates successfully. What version of the oslc4j-jena-provider.jar are you modifying? I'm using 3.0.0-SNAPSHOT. Any suggestions?
Gabriel Ruelas
commented May 25 '17, 3:44 p.m.
You have to pass the authentication step. Do you have a valid/active user in Bugzilla? After it is logged the Service Document is requested.
Matthew Stone
commented May 27 '17, 12:22 p.m.
Yes I have a Bugzilla account and I've verified it by logging in directly to their site.
|
With Jim and Gabriel's help in this thread I finally got it working. The part about adding the Bugzilla provider to a DNG "Projet Area" as a "Friend (Outbound)" I knew already.
o.e.l.o.p.j.AbstractOslcRdfXmlProviderand forcing it to return application/xml would allow DNG to find and use the Delegated Ui's. On line 147 I did this... getSerializationLanguage(MediaType.APPLICATION_XML_TYPE);Thanks for everyone's help! I hope this helps someone else. I guess the question is why doesn't DNG support the rdf+xml content-type? |
Hi Matthew,
I'd need more info to determine exactly what's going on, but here are a few things to try:
Comments
Matthew Stone
commented May 24 '17, 8:59 a.m.
Thanks for the feedback. The suggestion to Add the Association is definitely a step I was missing. Unfortunately I'm still stuck. I select the Bugzilla Application in the Add Association dialog and then I'm presented a login window with content generated by the Bugzilla adapter. I provide my credentials and I'm certain the provider authenticates successfully because I have a break point set in the provider to step through that code. The provider responds with a 204 (No Content) status and the login window close and then immediately reopens prompting me to enter my credentials again. I don't see any errors to indicate what's going wrong in the client or either server hosting DNG or Bugzilla. Any ideas?
Matthew Stone
commented Jun 01 '17, 9:45 a.m.
Jim,
Matthew Stone
commented Jun 01 '17, 12:10 p.m.
Okay. So I can see Bugzilla in the list when I attempt to create a link now. I had overlooked the Save button at the top of the Manage Project Area screen. I suppose that's intuitive???
You'll have to check with the Bugzilla adapter to see if it provides a delegated UI. It looks like it might not. If that's the case you'll need to render the UI yourself (sorry!). It's a matter of displaying the list of bugs, allowing someone to select one, then establishing the link with the Bugzilla adapter.
The delegated UI is a service that an OSLC server can optionally provide. So if the adapter you're using doesn't provide it then you need to create your own UI and establish the link in your own code.
|
The OSLC Bugzilla application was written for Jazz 5.x. I will not be surprised that it doesn’t work for v 6.x as it has introduced configuration management concepts. There is additional configuration selection in the process. Anyway, at this step, follow the instructions Jim has described. You definitely need to associate your Bugzilla service provider to an existing project area in DNG. Provided that your Bugzilla adapter provides a delegated UI, you will be able to create a traceability link . I hope it helps. |
Implementors of OSLC ServiceProviders may be able to satisfy DNG by claiming to @Produce( OslcMediaType.APPLICATION_RDF_XML) but then in the Response builder setting the entity type to MediaType.APPLICATION_XML.
This would allow them to support DNG's needs without having to alter the library version of AbstractOslcRdfXmlProvider.
Comments
Gabriel Ruelas
commented Jun 09 '17, 3:40 p.m.
Could you pls explain how to alter the Response builder? Thanks If you are implementing your own Service controller and so can code the @Produces annotation on the REST method, you can also code the MediaType which the Response builder actually sends back. // TODO: See https://jazz.net/jazz03/web/projects/Requirements%20Management#action=com.ibm.team.workitem.viewWorkItem&id=115412 // Jazz DNG prior to 6.0.5 requests but cannot accept rdf+xml, can only process application/xml return Optional.ofNullable( acceptType ) .filter( at -> at.contains( "application/x-oslc-cm-service-description+xml" ) ) .map( at -> responseBuilder.type( MediaType.APPLICATION_XML ) ) .orElse( responseBuilder ) .build(); |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
Figured it out. See my answer below.