Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info

Widgets can be manually tested with the URL : http://<server>/widget?id=<widget id>.

If you're testing a project-level widget, you'll need to add a project to the URL, like so : http://<server>/widget?id=<widget id>&resource=<project key>.

The width can be set with the property widget_width. The default value is 350px.

...

The development mode reloads Ruby changes on the fly. It allows to lets you edit code and immediately display your widget at the same timechanges.

To enable the development mode on a widget :

  1. Install SonarQube
  2. Edit the method RubyRailsWidget#getTemplatePath() in order to return the absolute path but not the to the widget file, rather than the class path.
  3. Build the plugin and copy it to /extensions/plugins
  4. Start server
  5. (warning)Do not forget to revert the path before commiting your changes

...

Ruby on Rails applications allow plugins to extend the SonarQube webapp with a complete MVC stack : controllers, helpers, models and views. Contrary to Unlike widgets, it does not require you to declare a Java component. ; Ruby sources just have to be stored in the plugin directory : /src/main/resources/org/sonar/ror/<plugin key>. This directory must also contain an empty file named init.rb.

...

The development mode reloads Ruby changes on the fly. It allows you to edit code and to directly interact with the application. Only the changes on the files that exist during server startup are supported. Adding a new file requires you to restart the server.

To enable the development mode on an application :

  1. Install SonarQube
  2. Install the plugin by copying the initial JAR file to /extensions/plugins
  3. Edit the Enable the development mode :
    1. If SonarQube 3.x : edit the file war/sonar-server/WEB-INF/web.xml and set the context-params rails.env to development and jruby.max.runtimes to 3.
    2. If SonarQube 4.x : edit conf/sonar.properties and add the line sonar.web.dev=true
  4. Edit the file war/sonar-server/WEB-INF/config/environment.rb and set the absolute path to your ruby application by replacing the property config.plugin_paths :

    Code Block
    #config.plugin_paths << "#{Java::OrgSonarServerUi::JRubyFacade.getInstance().getServerHome()}/temp/ror"
    config.plugin_paths << '/absolute/path/to/sonar-foo-plugin/src/main/resources/org/sonar/ror'
  5. Start server

...

Info

Static files are not deployed on the fly when the development mode is enabled. The plugin has to be built and re-installed after changes.

Dynamic charts

SonarQube integrates JFreechart Eastwood 1.1.0, a partial implementation of the Google Chart API . To know if a chart is implemented, simply replace http://chart.apis.google.com/chart?<params>  by http://<sonar>/gchart?<params>.

TBD : protovis.js.

Language packs

See Internationalization