jetbrains.buildServer.web.openapi
Class ChangeDetailsExtension

java.lang.Object
  extended by jetbrains.buildServer.web.openapi.SimplePageExtension
      extended by jetbrains.buildServer.web.openapi.ChangeDetailsExtension
All Implemented Interfaces:
PageExtension

public class ChangeDetailsExtension
extends SimplePageExtension

Base class for change details extensions PlaceId.CHANGE_DETAILS_BLOCK and PlaceId.CHANGED_FILE_LINK


Field Summary
 
Fields inherited from class jetbrains.buildServer.web.openapi.SimplePageExtension
myCssPaths, myJsPaths, myPagePlaces
 
Constructor Summary
ChangeDetailsExtension(PagePlaces pagePlaces)
           
ChangeDetailsExtension(PagePlaces pagePlaces, PlaceId placeId, java.lang.String pluginName, java.lang.String includeUrl)
           
 
Method Summary
 VcsChangeInfo findChangedFile(javax.servlet.http.HttpServletRequest request)
           
protected  SVcsModification findVcsModification(javax.servlet.http.HttpServletRequest request)
          Retrieves SVcsModification object from the request attributes.
protected  SBuildType getBuildType(javax.servlet.http.HttpServletRequest request, ProjectManager projectManager)
          Searches for a build type in the specified request.
protected  VcsChangeInfo getChangedFile(javax.servlet.http.HttpServletRequest request)
          Searches for a changed VCS file in the specified request.
protected  SVcsModification getVcsModification(javax.servlet.http.HttpServletRequest request)
          Searches for a VCS modification in the specified request.
 boolean isAvailable(javax.servlet.http.HttpServletRequest request)
          Returns true if VCS modification is found in the HTTP servlet request, and this modification is not personal.
protected  boolean isChangeLogPage(javax.servlet.http.HttpServletRequest request)
          Returns whether this request is for change-log page (project or build)
protected  boolean isChangePage(javax.servlet.http.HttpServletRequest request)
          Returns whether this request is for single change page
protected  boolean isChangesPage(javax.servlet.http.HttpServletRequest request)
          Returns whether this request is for build changes page
protected  boolean requiresBuildTypeContext()
          The method should return true if this extension requires build type from request context to operate.
 
Methods inherited from class jetbrains.buildServer.web.openapi.SimplePageExtension
addCssFile, addJsFile, fillModel, 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
 

Constructor Detail

ChangeDetailsExtension

public ChangeDetailsExtension(PagePlaces pagePlaces)

ChangeDetailsExtension

public ChangeDetailsExtension(PagePlaces pagePlaces,
                              PlaceId placeId,
                              @NonNls
                              java.lang.String pluginName,
                              @NonNls
                              java.lang.String includeUrl)
Method Detail

isAvailable

public boolean isAvailable(@NotNull
                           javax.servlet.http.HttpServletRequest request)
Returns true if VCS modification is found in the HTTP servlet request, and this modification is not personal.

Specified by:
isAvailable in interface PageExtension
Overrides:
isAvailable in class SimplePageExtension
Parameters:
request - HTTP servlet request
Returns:
see above

requiresBuildTypeContext

protected boolean requiresBuildTypeContext()
The method should return true if this extension requires build type from request context to operate. I.e. if the extension doesn't require build type, the method should return true;

Returns:
see above
Since:
5.0

getVcsModification

@NotNull
protected SVcsModification getVcsModification(@NotNull
                                                      javax.servlet.http.HttpServletRequest request)
Searches for a VCS modification in the specified request. Throws IllegalStateException if VCS modification not found.

Parameters:
request - HTTP servlet request
Returns:
found modification object

findVcsModification

@Nullable
protected SVcsModification findVcsModification(javax.servlet.http.HttpServletRequest request)
Retrieves SVcsModification object from the request attributes. Returns null if there is no such object.

Parameters:
request - HTTP servlet request
Returns:
found modification object
Since:
7.0

getChangedFile

@NotNull
protected VcsChangeInfo getChangedFile(@NotNull
                                               javax.servlet.http.HttpServletRequest request)
Searches for a changed VCS file in the specified request. Throws IllegalStateException if VCS file not found.

Parameters:
request - HTTP servlet request
Returns:
found file

findChangedFile

public VcsChangeInfo findChangedFile(@NotNull
                                     javax.servlet.http.HttpServletRequest request)

getBuildType

@Nullable
protected SBuildType getBuildType(javax.servlet.http.HttpServletRequest request,
                                           @NotNull
                                           ProjectManager projectManager)
Searches for a build type in the specified request.

Parameters:
request - HTTP servlet request
projectManager - project manager (to search build type by buildTypeId)
Returns:
found build configuration or null
Since:
5.0

isChangeLogPage

protected boolean isChangeLogPage(@NotNull
                                  javax.servlet.http.HttpServletRequest request)
Returns whether this request is for change-log page (project or build)

Parameters:
request - the request
Returns:
true if the change-log page is requested

isChangesPage

protected boolean isChangesPage(@NotNull
                                javax.servlet.http.HttpServletRequest request)
Returns whether this request is for build changes page

Parameters:
request - the request
Returns:
true if the build changes tab is requested

isChangePage

protected boolean isChangePage(@NotNull
                               javax.servlet.http.HttpServletRequest request)
Returns whether this request is for single change page

Parameters:
request - the request
Returns:
true if the change page is requested