Hi Simon, thanx for the snippet. I think I'm still missing some thing. Here is what I did:
Added the metadata to my example-plugin
package com.mycompany.sonar.reference.ui;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sonar.api.config.Settings;
import org.sonar.api.web.NavigationSection;
import org.sonar.api.web.UserRole;
import org.sonar.api.web.Page;
@NavigationSection(NavigationSection.HOME)
@UserRole(UserRole.ADMIN)
public class ExampleROR implements Page {
Logger logger = LoggerFactory.getLogger(getClass());
public ExampleROR(Settings settings) {
logger.info("my first log...");
logger.info("my key: {}", settings.getString("pluginKey"));
}
public String getId() {
return "/foo";
}
public String getTitle() {
return "Foo";
}
}
I've also added the plugin key
pom.xml:
...
<build>
<plugins>
<plugin>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-packaging-maven-plugin</artifactId>
<version>1.1</version>
<extensions>true</extensions>
<configuration>
<pluginKey>foo</pluginKey>
<pluginClass>com.mycompany.sonar.reference.ExamplePlugin</pluginClass>
</configuration>
</plugin>
...
and the ruby-parts with simple controller impl:
./src/main/resources/org/sonar/ror/foo/app/controllers/foo_controller.rb
./src/main/resources/org/sonar/ror/foo/app/views/foo
Now the link appears and points to
Which yield The page you were looking for doesn't exist.
BTW: how can I access the pluginKey - settings.getString("pluginKey") yields null.
This feature is experimental. Plugins can define their own Ruby on Rails applications by storing the directory app/ in org/sonar/ror/<plugin>. For example for the plugin with key "foo" :