Interface PageExtension

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      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).
      java.util.List<java.lang.String> getCssPaths()
      Returns list of additional CSS files paths required by this extension
      default java.lang.String getDisplayName()
      For extensions in some places, return the user-visible section name for this extension.
      java.lang.String getIncludeUrl()
      Returns URL by which this page extension is included.
      java.util.List<java.lang.String> getJsPaths()
      Returns list of additional JavaScript files paths required by this extension
      java.lang.String getPluginName()
      Returns some identifier unique among all extensions within one extension point.
      boolean isAvailable​(javax.servlet.http.HttpServletRequest request)
      Returns true if this extension is available (should be included on the page) for the specified request.
    • Method Detail

      • getPluginName

        @NotNull
        java.lang.String getPluginName()

        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.

        Returns:
        extension identifier.
      • getDisplayName

        default java.lang.String getDisplayName()
        For extensions in some places, return the user-visible section name for this extension. At the moment of writing, one of such extension places is PlaceId.BUILD_RESULTS_FRAGMENT
        Returns:
        see above
        Since:
        2022.10
        See Also:
        PlaceId.BUILD_RESULTS_FRAGMENT
      • getIncludeUrl

        @NotNull
        java.lang.String getIncludeUrl()
        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 use PluginDescriptor.getPluginResourcesPath(String) to obtain the path.
        Returns:
        URL of the page extension content
      • getCssPaths

        @NotNull
        java.util.List<java.lang.String> getCssPaths()
        Returns list of additional CSS files paths required by this extension
        Returns:
        list of additional CSS paths or empty collection
      • getJsPaths

        @NotNull
        java.util.List<java.lang.String> getJsPaths()
        Returns list of additional JavaScript files paths required by this extension
        Returns:
        list of additional JavaScript paths or empty collection
      • isAvailable

        boolean isAvailable​(@NotNull
                            javax.servlet.http.HttpServletRequest request)
        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");
        Parameters:
        request - HTTP request
        Returns:
        true if extension should be included in the page place
      • fillModel

        void fillModel​(@NotNull
                       java.util.Map<java.lang.String,​java.lang.Object> model,
                       @NotNull
                       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). 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.
        Parameters:
        model - model to modify
        request - HTTP request