[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sonar-dev
Subject:    Re: [sonar-dev] Sonar Widget in Java
From:       Pieter Agten <pieter.agten () cs ! kuleuven ! be>
Date:       2014-09-22 8:28:03
Message-ID: 541FDD93.9080701 () cs ! kuleuven ! be
[Download RAW message or body]

Hi Jean-Baptiste,

Thanks for the reply. Although using a web service is not the most
efficient way to connect two server-side components running in the same
application server, it does indeed seem like the best option in this
case. I tried reusing some of the classes from sonar-core (e.g.
MeasureFilter) to retrieve metrics directly from the database but I
wasn't successful, so I'm taking the web service approach now.

Best regards,
Pieter Agten


On 09/19/2014 09:21 AM, Jean-Baptiste Lièvremont wrote:
> Hi Pieter,
> 
> There is no public API to access the database. However, depending on
> your needs, you can rely upon the increasingly comprehensive list of Web
> Services that are documented (since 4.2) at
> <yoursonarqubeinstance>/api_documentation
> 
> HTH
> 
> *Jean-Baptiste LIEVREMONT | **SonarSource
> */Core Developer/
> http://sonarsource.com <http://sonarsource.com/>/
> /
> 
> 2014-09-18 13:55 GMT+02:00 Pieter Agten <pieter.agten@cs.kuleuven.be
> <mailto:pieter.agten@cs.kuleuven.be>>:
> 
>     Hi,
> 
>     I'm trying to write a SonarQube widget to visualize collected metrics in
>     a variety of ways. I know that widgets are usually written in Ruby, but
>     I really want to write the core of my widget in Java.
> 
>     The approach I'm considering is to write a basic html template in Ruby,
>     which retrieves the visualisation result through a Java Servlet that
>     does all "hard work". Now, my problem is that I would like to access the
>     SonarQube database from this Java servlet to retrieve metrics, but I
>     cannot find how to do this. I could of course access the database
>     directly using for instance JDBC, but I'd prefer a higher-level API so
>     as to remain compatible with future database schema changes and to avoid
>     writing boilerplate database abstraction code that (possibly) already
>     exists.
> 
>     So, I'm hoping there is a Java API available to use on the server (from
>     a servlet) to access the database, perhaps similar to the API available
>     to the batch components. Is there such an API or is there another
>     "prefered" way to access the SonarQube database from a servlet?
> 
>     Thank you!
>     Pieter Agten
> 
>     Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
> 
>     ---------------------------------------------------------------------
>     To unsubscribe from this list, please visit:
> 
>         http://xircles.codehaus.org/manage_email
> 
> 
> 

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic