[sonar-dev] Access to controllers or api from widget

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[sonar-dev] Access to controllers or api from widget

Aurelien BAUDET
Hello,

I am currently writing a new plugin. I have created a new widget that displays issues with some filters. In Sonar 4.5 I was using "Api.issues.find" method. However, since Sonar 5.0, this API is no more available.
I know there exists a web service for searching issues ("/api/issues/search") but if I want to use it, I have to do AJAX queries to call this web service.

I have several questions :
  1. Is there a way to call the method that provides the web service from a ruby template without using Javascript ?
  2. Is it possible to provide a custom ruby controller/api that will be usable by the widget inside the plugin ?
  3. Is it possible to create a new Java controller inside the plugin (custom RequestHandler) ?
  4. Is it possible to call a Java controller/api directly from ruby template ?
Thanks

Aurélien


Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Access to controllers or api from widget

Simon Brandhof
Hi Aurélien,

The recommended approach is to call web services from JS code. That's the only way to depend on a fully documented and supported API. So here are my answers :

  1. Is there a way to call the method that provides the web service from a ruby template without using Javascript ?
No.
  1. Is it possible to provide a custom ruby controller/api that will be usable by the widget inside the plugin ?
  1. Is it possible to create a new Java controller inside the plugin (custom RequestHandler) ?
Java Web Service extension point is currently under development (beta) and may be changed during next releases. 
  1. Is it possible to call a Java controller/api directly from ruby template ?
No.

Regards