Adding pages to the webapp
Creating page extensions to run in your SonarQube environment.
Prerequisites
Create a Java class implementing PageDefinition
import org.sonar.api.web.page.Page;
import org.sonar.api.web.page.PageDefinition;
import org.sonar.api.web.page.Context;
import static org.sonar.api.web.page.Page.Scope.COMPONENT;
import static org.sonar.api.web.page.Page.Qualifier.VIEW;
import static org.sonar.api.web.page.Page.Qualifier.SUB_VIEW;
public class MyPluginPageDefinition implements PageDefinition {
@Override
public void define(Context context) {
context
.addPage(Page.builder("my_plugin/global_page")
.setName("Global Page")
.build())
.addPage(Page.builder("my_plugin/project_page")
.setName("Project Page")
.setScope(COMPONENT)
.build())
.addPage(Page.builder("my_plugin/portfolio_page")
.setName("Portfolio Page")
.setScope(COMPONENT)
.setComponentQualifiers(VIEW, SUB_VIEW)
.build())
.addPage(Page.builder("my_plugin/admin_page")
.setName("Admin Page")
.setAdmin(true)
.build());
}
}Configuring each page
Create a JavaScript file per page
CSS files
Examples
Was this helpful?

