Accessing a custom defined db table in Sonar

Go To StackoverFlow.com

0

I have a custom defined table in sonar DB , and I wanted to get an access to it from a Sonar plugin , I'm currently accessing the exiting tables by using sonar , Web Service / controller so how can I get this done ?

2012-04-04 08:07
by Lakshitha Udara


1

Sonar does not define any extension to add custom DB tables, so there's no API for what you want to achieve.

Now, whatever your reasons for creating a custom DB table (I'd like to know them actually), you have to create your own fork of Sonar to be able to add MyBatis mappers & DAOs on Java's side of Sonar, and/or add a Ruby model on RoR side to be able to query the table from the Web side.

2012-04-04 09:01
by Fabrice - SonarSource Team
thank u so much for the reply ! it's like I hv some custom data gathered for projects ( not from sonar ) and I hv added these data in the sql db ( in a table ) now what I want to do is show this data ( in a chart ..etc ) with the relative project , so if I'm adding a Rails model how it'll effect to the sonar ? I mean when updating ..etc , and if is not a huge harm to the sonar , can you specify me that how can I add the model in Rails ( need directions ) thanks again : - Lakshitha Udara 2012-04-04 09:24
As I said, what you want to achieve (and the way you do it) requires a fork of Sonar, which will require quite some efforts to maintain and which I would not recommend. Instead, I'm pretty sure that you could push your custom data into Sonar existing tables using a Sonar plugin of your own that you would write using the documentation (http://docs.codehaus.org/display/SONAR/Coding+a+plugin) and examples (https://github.com/SonarSource/sonar-examples/tree/master/plugins/sonar-reference-plugin) we provide - Fabrice - SonarSource Team 2012-04-04 11:56
thanx for your advices - Lakshitha Udara 2012-04-04 12:53
Ads