package jetbrains.buildServer.serverSide; import jetbrains.buildServer.web.openapi.WebControllerManager; import jetbrains.buildServer.web.openapi.WebExtension; import jetbrains.buildServer.web.openapi.WebPlace; import jetbrains.buildServer.web.openapi.WebResourcesManager; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.servlet.http.HttpServletRequest; import java.util.List; import java.util.Map; public class AprilJokeExtension implements WebExtension { private WebResourcesManager myResManager; private JokeSettings mySettings; public AprilJokeExtension(@NotNull WebControllerManager manager, @NotNull WebResourcesManager resManager, @NotNull JokeSettings settings) { manager.addPageExtension(WebPlace.PAGE_HEADER, this); myResManager = resManager; mySettings = settings; } @NonNls @NotNull public String getPluginName() { return JokeSettings.PLUGIN_NAME; } @NotNull public String getTitle() { return ""; } public List getCssFiles() { return null; } public List getJsFiles() { return null; } @Nullable @NonNls public String getJspFilePath() { return myResManager.resourcePath(getPluginName(), "joke.jsp"); } public void fillModel(final Map model, @NotNull final HttpServletRequest request) { } public boolean isAvailable(@NotNull final HttpServletRequest request) { return mySettings.isEnabled(); } @NotNull public String getTitle(@NotNull final HttpServletRequest request) { return ""; } }