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, typicallyJob
T
- Type individual record, typicallyHistoricalBuild
- Direct Known Subclasses:
BuildHistoryWidget
Displays the history of records on the side panel.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static final class
-
Field Summary
Modifier and TypeFieldDescriptionfinal HistoryWidget.Adapter<? super T>
The given data model of records.final String
URL of theowner
.static final AlternativeUiTextProvider.Message<HistoryWidget<?,
?>> Replaceable title for describing the kind of tasks this history shows.final O
-
Constructor Summary
ConstructorDescriptionHistoryWidget
(O owner, Iterable<T> baseList, HistoryWidget.Adapter<? super T> adapter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Handles AJAX requests from browsers to update build history.Title of the widget.Get aHistoryPageFilter
for rendering a page of queue items.protected String
The records to be rendered this time.Gets the URL path name.boolean
protected HistoryPageFilter<T>
void
setNextBuildNumberToFetch
(String nextBuildNumberToFetch) void
setTrimmed
(boolean trimmed) protected HistoryPageFilter
updateFirstTransientBuildKey
(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:
getOwnerUrl
in classWidget
- Returns:
- The URL of the owner of this widget relative to context path. Always ends with a trailing slash.
Can be
null
for backward compatibility with widgets annotated with @Extension.
-
getDisplayName
Title of the widget. -
getUrlName
Description copied from class:Widget
Gets 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
Widget
s. The default implementation returns the unqualified class name.- Overrides:
getUrlName
in 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 aHistoryPageFilter
for 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:
IOException
jakarta.servlet.ServletException
-
getNextBuildNumberToFetch
-
setNextBuildNumberToFetch
-