jetbrains.buildServer.web.openapi
Class ViewBuildTab

java.lang.Object
  extended by jetbrains.buildServer.web.openapi.SimplePageExtension
      extended by jetbrains.buildServer.web.openapi.SimpleCustomTab
          extended by jetbrains.buildServer.web.openapi.ViewBuildTab
All Implemented Interfaces:
CustomTab, PageExtension
Direct Known Subclasses:
ViewLogTab

public abstract class ViewBuildTab
extends SimpleCustomTab

Created by Nikita.Skvortsov Date: 2/13/13, 2:58 PM


Field Summary
protected  SBuildServer myServer
           
 
Fields inherited from class jetbrains.buildServer.web.openapi.SimplePageExtension
myCssPaths, myJsPaths, myPagePlaces
 
Constructor Summary
ViewBuildTab(java.lang.String title, java.lang.String code, PagePlaces pagePlaces, SBuildServer server)
          Creates and registers tab for Build pages
ViewBuildTab(java.lang.String title, java.lang.String code, PagePlaces pagePlaces, java.lang.String includeUrl, SBuildServer server)
           
 
Method Summary
 void fillModel(java.util.Map<java.lang.String,java.lang.Object> model, javax.servlet.http.HttpServletRequest request)
          This method is useful for extensions that do not have controllers (such extensions usually return path to JSP as their include URL).
protected abstract  void fillModel(java.util.Map<java.lang.String,java.lang.Object> model, javax.servlet.http.HttpServletRequest request, BuildPromotion promotion)
           
protected  BuildPromotion getPromotion(javax.servlet.http.HttpServletRequest request)
           
 boolean isAvailable(javax.servlet.http.HttpServletRequest request)
          Returns true if this extension is available (should be included on the page) for the specified request.
protected abstract  boolean isAvailable(javax.servlet.http.HttpServletRequest request, BuildPromotion promotion)
           
 
Methods inherited from class jetbrains.buildServer.web.openapi.SimpleCustomTab
getTabId, getTabTitle, getTabTitle, isVisible, setTabTitle
 
Methods inherited from class jetbrains.buildServer.web.openapi.SimplePageExtension
addCssFile, addJsFile, getCssPaths, getIncludeUrl, getJsPaths, getPlaceId, getPluginName, isGet, isPost, register, setIncludeUrl, setPlaceId, setPluginName, setPosition, toString, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jetbrains.buildServer.web.openapi.PageExtension
getCssPaths, getIncludeUrl, getJsPaths, getPluginName
 

Field Detail

myServer

protected final SBuildServer myServer
Constructor Detail

ViewBuildTab

public ViewBuildTab(@NotNull
                    java.lang.String title,
                    @NotNull
                    java.lang.String code,
                    @NotNull
                    PagePlaces pagePlaces,
                    @NotNull
                    SBuildServer server)
Creates and registers tab for Build pages

Parameters:
title - tab title
code - tab identification code, should be java identifier
pagePlaces - used to register the tab
server - server object

ViewBuildTab

public ViewBuildTab(@NotNull
                    java.lang.String title,
                    @NotNull
                    java.lang.String code,
                    @NotNull
                    PagePlaces pagePlaces,
                    @NotNull
                    java.lang.String includeUrl,
                    @NotNull
                    SBuildServer server)
Method Detail

getPromotion

@Nullable
protected BuildPromotion getPromotion(@NotNull
                                               javax.servlet.http.HttpServletRequest request)

fillModel

public void fillModel(@NotNull
                      java.util.Map<java.lang.String,java.lang.Object> model,
                      @NotNull
                      javax.servlet.http.HttpServletRequest request)
Description copied from interface: PageExtension
This method is useful for extensions that do not have controllers (such extensions usually return path to JSP as their include URL). method is called before processing is passed to JSP. It allows page extension to modify model passed to JSP. Note that since main page controller also uses this model for storing its parameters in case of parameter name conflict extension parameter will be removed and warning message will be logged into the server log.

Specified by:
fillModel in interface CustomTab
Specified by:
fillModel in interface PageExtension
Overrides:
fillModel in class SimplePageExtension
Parameters:
model - model to modify
request - HTTP request

fillModel

protected abstract void fillModel(@NotNull
                                  java.util.Map<java.lang.String,java.lang.Object> model,
                                  @NotNull
                                  javax.servlet.http.HttpServletRequest request,
                                  @NotNull
                                  BuildPromotion promotion)

isAvailable

public boolean isAvailable(@NotNull
                           javax.servlet.http.HttpServletRequest request)
Description copied from interface: PageExtension
Returns true if this extension is available (should be included on the page) for the specified request. If extension needs to be shown for some pages only, it can obtain original page URL via request attribute called "pageUrl":
String pageUrl = (String)request.getAttribute("pageUrl");

Specified by:
isAvailable in interface CustomTab
Specified by:
isAvailable in interface PageExtension
Overrides:
isAvailable in class SimplePageExtension
Parameters:
request - HTTP request
Returns:
true if extension should be included in the page place

isAvailable

protected abstract boolean isAvailable(@NotNull
                                       javax.servlet.http.HttpServletRequest request,
                                       @NotNull
                                       BuildPromotion promotion)