Package hudson.model
Class ListView
java.lang.Object
hudson.model.AbstractModelObject
hudson.model.View
hudson.model.ListView
- All Implemented Interfaces:
ExtensionPoint
,Describable<View>
,DescriptorByNameOwner
,DirectlyModifiableView
,ModelObject
,Saveable
,SearchableModelObject
,SearchItem
,AccessControlled
,ModelObjectWithChildren
,HasWidgets
Displays
Job
s in a flat list view.- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static final class
Nested classes/interfaces inherited from class hudson.model.View
View.PropertyList
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Fields inherited from class hudson.model.View
CONFIGURE, CREATE, DELETE, description, filterExecutors, filterQueue, LIST, name, NEW_PRONOUN, owner, PERMISSIONS, READ, SORTER
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(TopLevelItem item) Adds the given item to this view.boolean
contains
(TopLevelItem item) Checks if the job is in this collection.org.kohsuke.stapler.HttpResponse
doAddJobToView
(String name) Handle addJobToView web method.doCreateItem
(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Creates a newItem
in this collection.org.kohsuke.stapler.HttpResponse
doRemoveJobFromView
(String name) Handle removeJobFromView web method.If this view uses<t:projectView>
for rendering, this method returns columns to be displayed.static List<ListViewColumn>
Deprecated.getItems()
Returns a read-only view of allJob
s in this view.Deprecated.Status filter is now controlled via aViewJobFilter
, seeStatusFilter
boolean
Used to determine if we want to display the Add button.protected void
protected void
boolean
Determines the initial state of the checkbox.boolean
boolean
jobNamesContains
(TopLevelItem item) Default implementation that returns empty index.protected Object
boolean
remove
(TopLevelItem item) Removes given item from this view.void
setColumns
(List<ListViewColumn> columns) Sets the columns of this view.void
setIncludeRegex
(String includeRegex) void
setJobFilters
(List<ViewJobFilter> jobFilters) void
setJobNames
(Set<String> jobNames) void
setRecurse
(boolean recurse) void
setStatusFilter
(Boolean statusFilter) Deprecated.Status filter is now controlled via aViewJobFilter
, seeStatusFilter
protected void
submit
(org.kohsuke.stapler.StaplerRequest req) Deprecated.protected void
submit
(org.kohsuke.stapler.StaplerRequest2 req) Handles the configuration submission.Methods inherited from class hudson.model.View
all, allInstantiable, create, create, createViewFromXML, doCheckJobName, doChildrenContextMenu, doConfigDotXml, doConfigDotXml, doConfigSubmit, doCreateItem, doDoDelete, doItemCategories, doRssAll, doRssFailed, doRssLatest, doSubmitDescription, doSubmitDescription, getAbsoluteUrl, getACL, getActions, getAllItems, getAllProperties, getApi, getApplicablePropertyDescriptors, getApproximateQueueItemsQuickly, getBuilds, getComputers, getDescription, getDescriptor, getDisplayName, getDynamic, getIndenter, getItem, getItemCreatePermission, getJob, getNewPronoun, getOwner, getOwnerItemGroup, getOwnerPrimaryView, getOwnerViewActions, getPostConstructLandingPage, getProperties, getQueueItems, getSearchIcon, getSearchUrl, getTimeline, getUrl, getViewName, getViewUrl, getVisiblePropertyDescriptors, isAutomaticRefreshEnabled, isDefault, isEditable, isFilterExecutors, isFilterQueue, makeSearchIndex, onJobRenamed, registerPermissions, rename, save, setDescription, setFilterExecutors, setFilterQueue, toString, updateByXml, updateTransientActions, writeXml
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendError
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2
Methods inherited from interface hudson.model.DescriptorByNameOwner
getDescriptorByName
Methods inherited from interface jenkins.widgets.HasWidgets
getWidget, getWidgets
Methods inherited from interface jenkins.model.ModelObjectWithChildren
doChildrenContextMenu
-
Constructor Details
-
ListView
-
ListView
-
-
Method Details
-
setColumns
Sets the columns of this view.- Throws:
IOException
-
setJobFilters
- Throws:
IOException
-
readResolve
-
initColumns
protected void initColumns() -
initJobFilters
protected void initJobFilters() -
hasJobFilterExtensions
public boolean hasJobFilterExtensions()Used to determine if we want to display the Add button. -
getJobFilters
-
getColumns
Description copied from class:View
If this view uses<t:projectView>
for rendering, this method returns columns to be displayed.- Overrides:
getColumns
in classView
-
getJobNames
-
getItems
Returns a read-only view of allJob
s in this view.This method returns a separate copy each time to avoid concurrent modification issue.
-
makeSearchIndex
Description copied from class:AbstractModelObject
Default implementation that returns empty index.- Overrides:
makeSearchIndex
in classView
-
contains
Description copied from class:View
Checks if the job is in this collection. -
jobNamesContains
-
add
Adds the given item to this view.- Specified by:
add
in interfaceDirectlyModifiableView
- Throws:
IOException
- Adding failed.- Since:
- 1.389
-
remove
Removes given item from this view.- Specified by:
remove
in interfaceDirectlyModifiableView
- Returns:
- false if item not present in view, true if removed.
- Throws:
IOException
- Removal failed.- Since:
- 1.566
-
getIncludeRegex
-
isRecurse
public boolean isRecurse() -
setRecurse
@DataBoundSetter public void setRecurse(boolean recurse) - Since:
- 1.568
-
getStatusFilter
Deprecated.Status filter is now controlled via aViewJobFilter
, seeStatusFilter
Filter by enabled/disabled status of jobs. Null for no filter, true for enabled-only, false for disabled-only. -
isAddToCurrentView
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isAddToCurrentView()Determines the initial state of the checkbox.- Returns:
- true when the view is empty or already contains jobs specified by name.
-
doCreateItem
@POST public Item doCreateItem(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException Description copied from class:View
Creates a newItem
in this collection.This method should call
ModifiableItemGroup.doCreateItem(StaplerRequest2, StaplerResponse2)
and then add the newly created item to this view.- Overrides:
doCreateItem
in classView
- Returns:
- null if fails.
- Throws:
IOException
jakarta.servlet.ServletException
-
doAddJobToView
public org.kohsuke.stapler.HttpResponse doAddJobToView(@QueryParameter String name) throws IOException, jakarta.servlet.ServletException Description copied from interface:DirectlyModifiableView
Handle addJobToView web method. This method shouldRequirePOST
.- Specified by:
doAddJobToView
in interfaceDirectlyModifiableView
- Parameters:
name
- Item name. This can be either full name relative to owner item group or full item name prefixed with '/'.- Throws:
IOException
jakarta.servlet.ServletException
-
doRemoveJobFromView
public org.kohsuke.stapler.HttpResponse doRemoveJobFromView(@QueryParameter String name) throws IOException, jakarta.servlet.ServletException Description copied from interface:DirectlyModifiableView
Handle removeJobFromView web method. This method shouldRequirePOST
.- Specified by:
doRemoveJobFromView
in interfaceDirectlyModifiableView
- Parameters:
name
- Item name. This can be either full name relative to owner item group or full item name prefixed with '/'.- Throws:
IOException
jakarta.servlet.ServletException
-
submit
protected void submit(org.kohsuke.stapler.StaplerRequest2 req) throws jakarta.servlet.ServletException, Descriptor.FormException, IOException Handles the configuration submission. Load view-specific properties here.- Overrides:
submit
in classView
- Throws:
jakarta.servlet.ServletException
Descriptor.FormException
IOException
-
submit
@Deprecated protected void submit(org.kohsuke.stapler.StaplerRequest req) throws javax.servlet.ServletException, Descriptor.FormException, IOException Deprecated.- Overrides:
submit
in classView
- Throws:
javax.servlet.ServletException
Descriptor.FormException
IOException
-
setIncludeRegex
- Since:
- 1.526
-
setJobNames
-
setStatusFilter
Deprecated.Status filter is now controlled via aViewJobFilter
, seeStatusFilter
-
getDefaultColumns
Deprecated.as of 1.391 UseListViewColumn.createDefaultInitialColumnList()
-
ListViewColumn.createDefaultInitialColumnList()