Skip to end of metadata
Go to start of metadata

Table of Contents

Web Services

Web Services are declared through the extension point. Contrary to the deprecated org.sonar.api.web.Webservice extension point, implementation does not require any Ruby on Rails code and can rely upon dependency injection.

An implementation of WebService must declare the path under which it will be published. This path must not start with a '/' character. It is recommended to start with the 'api' string and to use lower case with underscores - e.g 'api/my_plugin_service'. It is also recommended to provide other metadata, which will be used to document the web service in the built-in Web service API page.

A WebService can provide several actions, each associated to a RequestHandler.

See the Javadoc of the cited classes for more information.

Static Files

Plugins can provide static files like images, CSS or JS files. They have to be copied in src/main/resources/static and then can by accessible from the public URL :

http://<server>/static/<plugin key>/<filename>

Note that the plugin key is logged during the maven build :

[INFO] -------------------------------------------------------
[INFO] Plugin definition in update center
[INFO]     Key: foo
[INFO]     Name: Foo
[INFO]     Description: 
[INFO]     Version: 1.0-SNAPSHOT

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.

Language Packs

See Internationalization

Web App Pages

See Creating a Page


  • No labels