Class AsyncConfigurableTrendJobAction<T extends io.jenkins.plugins.util.BuildAction<?>>

java.lang.Object
io.jenkins.plugins.util.JobAction<T>
io.jenkins.plugins.echarts.AsyncTrendJobAction<T>
io.jenkins.plugins.echarts.AsyncConfigurableTrendJobAction<T>
Type Parameters:
T - type of the results
All Implemented Interfaces:
Action, ModelObject, AsyncConfigurableTrendChart, AsyncTrendChart

public abstract class AsyncConfigurableTrendJobAction<T extends io.jenkins.plugins.util.BuildAction<?>> extends AsyncTrendJobAction<T> implements AsyncConfigurableTrendChart
A job action displays a link on the side panel of a job that refers to the last build that contains results (i.e. a BuildAction with a corresponding result). This action also is responsible to render the historical trend via its associated 'floatingBox.jelly' view. The trend chart will be rendered by ECharts: the model of the chart will be obtained using an asynchronous Ajax call. This action basically is the same as AsyncTrendJobAction, it additionally provides a configuration of the trend chart using a JSON object (given as a string value). This JSON object can be populated in the client using a configuration dialog (or using the browser's local storage). For the default trend charts that are simply built around ChartModelConfiguration you can include the provided global configuration dialog with <st:adjunct includes="io.jenkins.plugins.echarts-trend-default-setup"/>.
Author:
Ullrich Hafner
  • Constructor Details

    • AsyncConfigurableTrendJobAction

      protected AsyncConfigurableTrendJobAction(Job<?,?> owner, Class<T> buildActionClass)
      Creates a new instance of AsyncConfigurableTrendJobAction.
      Parameters:
      owner - the job that owns this action
      buildActionClass - the type of the action to find
  • Method Details

    • getBuildTrendModel

      @JavaScriptMethod public final String getBuildTrendModel()
      Description copied from interface: AsyncTrendChart
      Returns the UI model for an ECharts chart that shows the build trend. The model has to be a JSON representation of a corresponding LinesChartModel instance, that will be inserted into the client side model of the corresponding ECharts instance.
      Specified by:
      getBuildTrendModel in interface AsyncTrendChart
      Overrides:
      getBuildTrendModel in class AsyncTrendJobAction<T extends io.jenkins.plugins.util.BuildAction<?>>
      Returns:
      the UI model as JSON
      See Also:
    • getConfigurableBuildTrendModel

      @JavaScriptMethod public String getConfigurableBuildTrendModel(String configuration)
      Description copied from interface: AsyncConfigurableTrendChart
      Returns the UI model for an ECharts chart that shows the build trend. The model has to be a JSON representation of a corresponding LinesChartModel instance, that will be inserted into the client side model of the corresponding ECharts instance.
      Specified by:
      getConfigurableBuildTrendModel in interface AsyncConfigurableTrendChart
      Parameters:
      configuration - JSON configuration of the chart (number of builds, etc.). It is up to an individual plugin to correctly create this configuration in the trend configuration dialog.
      Returns:
      the UI model as JSON
      See Also:
    • createChartModel

      protected abstract edu.hm.hafner.echarts.LinesChartModel createChartModel(String configuration)
      Creates the model of the trend chart. The returned model will be converted to JSON and inserted into the client side model of the corresponding ECharts instance.
      Parameters:
      configuration - JSON configuration of the chart (number of builds, etc.). It is up to an individual plugin to correctly create this configuration in the trend configuration dialog.
      Returns:
      the model of the trend chart
      See Also:
      • for details on how to construct such a model
    • createChartModel

      protected final edu.hm.hafner.echarts.LinesChartModel createChartModel()
      Description copied from class: AsyncTrendJobAction
      Creates the model of the trend chart. The returned model will be converted to JSON and inserted into the client side model of the corresponding ECharts instance.
      Specified by:
      createChartModel in class AsyncTrendJobAction<T extends io.jenkins.plugins.util.BuildAction<?>>
      Returns:
      the model of the trend chart
      See Also:
      • for details on how to construct such a model