Package hudson.widgets
Class HistoryWidget<O extends ModelObject,T>
java.lang.Object
hudson.widgets.Widget
hudson.widgets.HistoryWidget<O,T>
- Type Parameters:
O- Owner of the widget, typicallyJobT- Type individual record, typicallyHistoricalBuild
- Direct Known Subclasses:
BuildHistoryWidget
Displays the history of records on the side panel.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic final class -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal HistoryWidget.Adapter<? super T> The given data model of records.final StringURL of theowner.static final AlternativeUiTextProvider.Message<HistoryWidget<?, ?>> Replaceable title for describing the kind of tasks this history shows.final O -
Constructor Summary
ConstructorsConstructorDescriptionHistoryWidget(O owner, Iterable<T> baseList, HistoryWidget.Adapter<? super T> adapter) -
Method Summary
Modifier and TypeMethodDescriptionvoidHandles AJAX requests from browsers to update build history.Title of the widget.Get aHistoryPageFilterfor rendering a page of queue items.protected StringThe records to be rendered this time.Gets the URL path name.booleanprotected HistoryPageFilter<T> voidsetNextBuildNumberToFetch(String nextBuildNumberToFetch) voidsetTrimmed(boolean trimmed) protected HistoryPageFilterupdateFirstTransientBuildKey(HistoryPageFilter historyPageFilter) Calculates the first transient build record.
-
Field Details
-
DISPLAY_NAME
Replaceable title for describing the kind of tasks this history shows. Defaults to "Build History". -
baseList
The given data model of records. Newer ones first. -
baseUrl
URL of theowner. -
owner
-
adapter
-
-
Constructor Details
-
HistoryWidget
- Parameters:
owner- The parent model object that owns this widget.
-
-
Method Details
-
getOwnerUrl
- Overrides:
getOwnerUrlin classWidget- Returns:
- The URL of the owner of this widget relative to context path. Always ends with a trailing slash.
Can be
nullfor backward compatibility with widgets annotated with @Extension.
-
getDisplayName
Title of the widget. -
getUrlName
Description copied from class:WidgetGets the URL path name.For example, if this method returns "xyz", and if the parent object (that this widget is associated with) is bound to /foo/bar/zot, then this widget object will be exposed to /foo/bar/zot/widget/xyz.
This method is useful when the widget needs to expose additional URLs, for example for serving AJAX requests.
This method should return a string that's unique among other
Widgets. The default implementation returns the unqualified class name.- Overrides:
getUrlNamein classWidget
-
getFirstTransientBuildKey
-
updateFirstTransientBuildKey
Calculates the first transient build record. Everything ≥ this will be discarded when AJAX call is made.- Parameters:
historyPageFilter- The history page filter containing the list of builds.- Returns:
- The history page filter that was passed in.
-
getRenderList
The records to be rendered this time. -
getHistoryPageFilter
Get aHistoryPageFilterfor rendering a page of queue items. -
newPageFilter
-
isTrimmed
public boolean isTrimmed() -
setTrimmed
public void setTrimmed(boolean trimmed) -
doAjax
public void doAjax(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, @Header("n") String n) throws IOException, jakarta.servlet.ServletException Handles AJAX requests from browsers to update build history.- Parameters:
n- The build 'number' to fetch. This is string because various variants uses non-numbers as the build key.- Throws:
IOExceptionjakarta.servlet.ServletException
-
getNextBuildNumberToFetch
-
setNextBuildNumberToFetch
-