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
public class ListView extends View implements DirectlyModifiableView
DisplaysJob
s in a flat list view.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ListView.DescriptorImpl
static class
ListView.Listener
-
Nested classes/interfaces inherited from class hudson.model.View
View.AsynchPeople, View.People, View.PropertyList, View.UserInfo
-
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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
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.Item
doCreateItem(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Creates a newItem
in this collection.org.kohsuke.stapler.HttpResponse
doRemoveJobFromView(String name)
Handle removeJobFromView web method.DescribableList<ListViewColumn,Descriptor<ListViewColumn>>
getColumns()
If this view uses<t:projectView>
for rendering, this method returns columns to be displayed.static List<ListViewColumn>
getDefaultColumns()
Deprecated.as of 1.391 UseListViewColumn.createDefaultInitialColumnList()
String
getIncludeRegex()
List<TopLevelItem>
getItems()
Returns a read-only view of allJob
s in this view.DescribableList<ViewJobFilter,Descriptor<ViewJobFilter>>
getJobFilters()
Set<String>
getJobNames()
Boolean
getStatusFilter()
Deprecated.Status filter is now controlled via aViewJobFilter
, seeStatusFilter
boolean
hasJobFilterExtensions()
Used to determine if we want to display the Add button.protected void
initColumns()
protected void
initJobFilters()
boolean
isAddToCurrentView()
Determines the initial state of the checkbox.boolean
isRecurse()
boolean
jobNamesContains(TopLevelItem item)
SearchIndexBuilder
makeSearchIndex()
Default implementation that returns empty index.protected Object
readResolve()
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)
Handles the configuration submission.-
Methods inherited from class hudson.model.View
all, allInstantiable, create, createViewFromXML, doCheckJobName, doChildrenContextMenu, doConfigDotXml, doConfigSubmit, doDoDelete, doItemCategories, doRssAll, doRssFailed, doRssLatest, doSubmitDescription, getAbsoluteUrl, getACL, getActions, getAllItems, getAllProperties, getApi, getApplicablePropertyDescriptors, getApproximateQueueItemsQuickly, getAsynchPeople, getBuilds, getComputers, getDescription, getDescriptor, getDisplayName, getDynamic, getIndenter, getItem, getItemCreatePermission, getJob, getNewPronoun, getOwner, getOwnerItemGroup, getOwnerPrimaryView, getOwnerViewActions, getPeople, getPostConstructLandingPage, getProperties, getQueueItems, getSearchUrl, getTimeline, getUrl, getViewName, getViewUrl, getVisiblePropertyDescriptors, getWidgets, hasPeople, isAutomaticRefreshEnabled, isDefault, isEditable, isFilterExecutors, isFilterQueue, makeSearchIndex, onJobRenamed, registerPermissions, rename, save, setDescription, toString, updateByXml, updateTransientActions, writeXml
-
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, requirePOST, 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
-
-
-
-
Method Detail
-
setColumns
@DataBoundSetter public void setColumns(List<ListViewColumn> columns) throws IOException
Sets the columns of this view.- Throws:
IOException
-
setJobFilters
@DataBoundSetter public void setJobFilters(List<ViewJobFilter> jobFilters) throws IOException
- Throws:
IOException
-
readResolve
protected Object 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
public DescribableList<ViewJobFilter,Descriptor<ViewJobFilter>> getJobFilters()
-
getColumns
public DescribableList<ListViewColumn,Descriptor<ListViewColumn>> 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
-
getItems
public List<TopLevelItem> 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
public SearchIndexBuilder makeSearchIndex()
Description copied from class:AbstractModelObject
Default implementation that returns empty index.- Overrides:
makeSearchIndex
in classView
-
contains
public boolean contains(TopLevelItem item)
Description copied from class:View
Checks if the job is in this collection.
-
jobNamesContains
public boolean jobNamesContains(TopLevelItem item)
-
add
public void add(TopLevelItem item) throws IOException
Adds the given item to this view.- Specified by:
add
in interfaceDirectlyModifiableView
- Throws:
IOException
- Adding failed.- Since:
- 1.389
-
remove
public boolean remove(TopLevelItem item) throws IOException
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
public String getIncludeRegex()
-
isRecurse
public boolean isRecurse()
-
setRecurse
@DataBoundSetter public void setRecurse(boolean recurse)
- Since:
- 1.568
-
getStatusFilter
@Deprecated public Boolean 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.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
Description copied from class:View
Creates a newItem
in this collection.This method should call
ModifiableItemGroup.doCreateItem(StaplerRequest, StaplerResponse)
and then add the newly created item to this view.- Specified by:
doCreateItem
in classView
- Returns:
- null if fails.
- Throws:
IOException
javax.servlet.ServletException
-
doAddJobToView
public org.kohsuke.stapler.HttpResponse doAddJobToView(@QueryParameter String name) throws IOException, javax.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
javax.servlet.ServletException
-
doRemoveJobFromView
public org.kohsuke.stapler.HttpResponse doRemoveJobFromView(@QueryParameter String name) throws IOException, javax.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
javax.servlet.ServletException
-
submit
protected void submit(org.kohsuke.stapler.StaplerRequest req) throws javax.servlet.ServletException, Descriptor.FormException, IOException
Handles the configuration submission. Load view-specific properties here.- Specified by:
submit
in classView
- Throws:
javax.servlet.ServletException
Descriptor.FormException
IOException
-
setIncludeRegex
@DataBoundSetter public void setIncludeRegex(String includeRegex)
- Since:
- 1.526
-
setStatusFilter
@Deprecated @DataBoundSetter public void setStatusFilter(Boolean statusFilter)
Deprecated.Status filter is now controlled via aViewJobFilter
, seeStatusFilter
-
getDefaultColumns
@Deprecated public static List<ListViewColumn> getDefaultColumns()
Deprecated.as of 1.391 UseListViewColumn.createDefaultInitialColumnList()
-
-