Package jetbrains.buildServer.web.impl
Class PageExtensionDefaultValuesProvider
- java.lang.Object
-
- jetbrains.buildServer.web.impl.PageExtensionDefaultValuesProvider
-
- All Implemented Interfaces:
CustomTab
,ExtensionAvailability
,Groupable
,PageExtension
public class PageExtensionDefaultValuesProvider extends Object implements PageExtension, CustomTab, Groupable
Must implement ALL interfaces suitable for page extensions.- Author:
- Evgeniy.Koshkin
-
-
Field Summary
Fields Modifier and Type Field Description static PageExtensionDefaultValuesProvider
Instance
-
Fields inherited from interface jetbrains.buildServer.web.openapi.Groupable
GROUP_POSITIONS, INTEGRATIONS_GROUP, PROJECT_RELATED_GROUP, SERVER_RELATED_GROUP, USER_MANAGEMENT_GROUP
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fillModel(Map<String,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).List<String>
getCssPaths()
Returns list of additional CSS files paths required by this extensionString
getGroup()
Returns the group name.String
getIncludeUrl()
Returns URL by which this page extension is included.List<String>
getJsPaths()
Returns list of additional JavaScript files paths required by this extensionString
getPluginName()
Returns some identifier unique among all extensions within one extension point.String
getTabId()
Returns tab identifierString
getTabTitle()
Returns title to use as custom tab nameString
getTabTitle(javax.servlet.http.HttpServletRequest request)
Returns title to use as custom tab nameboolean
isAvailable(javax.servlet.http.HttpServletRequest request)
Returns true if this extension is available (should be included on the page) for the specified request.boolean
isVisible()
Return false if the tab should be active (i.e.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.web.openapi.PageExtension
getDisplayName
-
-
-
-
Field Detail
-
Instance
public static final PageExtensionDefaultValuesProvider Instance
-
-
Method Detail
-
getTabId
@NotNull public String getTabId()
Description copied from interface:CustomTab
Returns tab identifier
-
getTabTitle
@NotNull public String getTabTitle()
Description copied from interface:CustomTab
Returns title to use as custom tab name- Specified by:
getTabTitle
in interfaceCustomTab
- Returns:
- tab title
-
getTabTitle
@NotNull public String getTabTitle(@NotNull javax.servlet.http.HttpServletRequest request)
Description copied from interface:CustomTab
Returns title to use as custom tab name- Specified by:
getTabTitle
in interfaceCustomTab
- Parameters:
request
- to get information from. Can be used to customize title- Returns:
- tab title for given request
-
isVisible
public boolean isVisible()
Description copied from interface:CustomTab
Return false if the tab should be active (i.e. handle requests) but not visible for some reason
-
getGroup
@NotNull public String getGroup()
Description copied from interface:Groupable
Returns the group name.
-
getPluginName
@NotNull public String getPluginName()
Description copied from interface:PageExtension
Returns some identifier unique among all extensions within one extension point. Despite its probably confusing name, the result of this method may not be related to any existing plugin names, its just an arbitrary string used to distinguish extensions within one extension point (PlaceId).
Before TeamCity 5.1 plugin name used to determine paths to plugin resources, but since 5.1 it only plays a role of identifier.
- Specified by:
getPluginName
in interfacePageExtension
- Returns:
- extension identifier.
-
getIncludeUrl
@NotNull public String getIncludeUrl()
Description copied from interface:PageExtension
Returns URL by which this page extension is included. This url may point to a JSP file or to a controller. If URL is absolute it must not include context path. For plugin resources usePluginDescriptor.getPluginResourcesPath(String)
to obtain the path.- Specified by:
getIncludeUrl
in interfacePageExtension
- Returns:
- URL of the page extension content
-
getCssPaths
@NotNull public List<String> getCssPaths()
Description copied from interface:PageExtension
Returns list of additional CSS files paths required by this extension- Specified by:
getCssPaths
in interfacePageExtension
- Returns:
- list of additional CSS paths or empty collection
-
getJsPaths
@NotNull public List<String> getJsPaths()
Description copied from interface:PageExtension
Returns list of additional JavaScript files paths required by this extension- Specified by:
getJsPaths
in interfacePageExtension
- Returns:
- list of additional JavaScript paths or empty collection
-
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 interfaceExtensionAvailability
- Specified by:
isAvailable
in interfacePageExtension
- Parameters:
request
- HTTP request- Returns:
- true if extension should be included in the page place
-
fillModel
public void fillModel(@NotNull Map<String,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 interfaceCustomTab
- Specified by:
fillModel
in interfacePageExtension
- Parameters:
model
- model to modifyrequest
- HTTP request
-
-