Class MonitorPortlet

java.lang.Object
io.jenkins.plugins.monitoring.MonitorPortlet
Direct Known Subclasses:
DemoPortlet

public abstract class MonitorPortlet extends Object

Defines a single portlet for the pull request monitoring dashboard.

The id must be unique. Please make sure that the id is related to the plugin so that there are no conflicts with other plugins. It is recommended to use the artifact id of the plugin or parts of it as prefix. If several portlets of the same class are created in the MonitorPortletFactory, it must be ensured that getId() is always unique for each portlet!

Since:
1.6.0
Author:
Simon Symhoven
  • Constructor Details

    • MonitorPortlet

      public MonitorPortlet()
  • Method Details

    • getTitle

      public abstract String getTitle()
      Defines the title to be shown.
      Returns:
      the title.
    • getId

      public abstract String getId()
      Defines the id for the portlet.
      Returns:
      the id.
    • isDefault

      public boolean isDefault()
      Defines whether the portlet is shown per default in the dashboard or not. The functionality for this is not yet given and the flag is ignored, but the API for it is already prepared.
      Returns:
      true if portlet should be shown, false else.
      Since:
      1.6.0
    • getPreferredWidth

      public abstract int getPreferredWidth()
      Defines the preferred width of the portlet.
      Returns:
      the width in pixels.
    • getPreferredHeight

      public abstract int getPreferredHeight()
      Defines the preferred height of the portlet.
      Returns:
      the height in pixels.
    • getIconUrl

      public Optional<String> getIconUrl()
      Defines the icon to show in the dropdown list of available portlets.
      Returns:
      the app relative icon url depending on ${resURL} (/static/cache-id), or Optional.empty(), if a default icon should be added. Supported file formats (depending on browser): jpeg, gif, png, apng, svg, bmp, bmp ico, png ico.
    • getDetailViewUrl

      public Optional<String> getDetailViewUrl()
      Defines the relative url to a detail view of the portlet.
      Returns:
      the relative link to the detail view depending on the current build url, e.g. current build url: "http://localhost:8080/jenkins/job/job-name/view/change-requests/job/PR-1/1/", then the relative url could be "pull-request-monitoring". or Optional.empty(), if no link should be added to portlet.
    • toString

      public String toString()
      Overrides:
      toString in class Object