Package hudson.model
Class AllView
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.model.View
-
- hudson.model.AllView
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<View>
,DescriptorByNameOwner
,ModelObject
,Saveable
,SearchableModelObject
,SearchItem
,AccessControlled
,ModelObjectWithChildren
public class AllView extends View
View
that contains everything.- Since:
- 1.269
- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AllView.DescriptorImpl
-
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 Modifier and Type Field Description static String
DEFAULT_VIEW_NAME
The name of the defaultAllView
.-
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 Modifier and Type Method Description boolean
contains(TopLevelItem item)
Checks if the job is in this collection.Item
doCreateItem(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Creates a newItem
in this collection.String
getDisplayName()
Collection<TopLevelItem>
getItems()
Gets all the items in this collection in a read-only view.String
getPostConstructLandingPage()
Returns the page to redirect the user to, after the view is created.boolean
isEditable()
By default, return true to render the "Edit view" link on the page.static String
migrateLegacyPrimaryAllViewLocalizedName(List<View> views, String primaryView)
Corrects the name of theAllView
if and only if theAllView
is the primary view and its name is one of the localized forms ofMessages._Hudson_ViewName()
and the user has not opted out of fixing the view name by setting the system propertyhudson.mode.AllView.JENKINS-38606
tofalse
.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, getColumns, getComputers, getDescription, getDescriptor, getDynamic, getIndenter, getItem, getItemCreatePermission, getJob, getNewPronoun, getOwner, getOwnerItemGroup, getOwnerPrimaryView, getOwnerViewActions, getPeople, getProperties, getQueueItems, getSearchUrl, getTimeline, getUrl, getViewName, getViewUrl, getVisiblePropertyDescriptors, getWidgets, hasPeople, isAutomaticRefreshEnabled, isDefault, isFilterExecutors, isFilterQueue, makeSearchIndex, 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
-
-
-
-
Field Detail
-
DEFAULT_VIEW_NAME
public static final String DEFAULT_VIEW_NAME
The name of the defaultAllView
. AnAllView
with this name will get a localized display name. OtherAllView
instances will be assumed to have been created by the user and thus will use the name the user created them with.- Since:
- 2.37
- See Also:
- Constant Field Values
-
-
Method Detail
-
isEditable
public boolean isEditable()
Description copied from class:View
By default, return true to render the "Edit view" link on the page. This method is really just for the default "All" view to hide the edit link so that the default Hudson top page remains the same as before 1.316.- Overrides:
isEditable
in classView
-
contains
public boolean contains(TopLevelItem item)
Description copied from class:View
Checks if the job is in this collection.
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceModelObject
- Overrides:
getDisplayName
in classView
-
doCreateItem
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
-
getItems
public Collection<TopLevelItem> getItems()
Description copied from class:View
Gets all the items in this collection in a read-only view.
-
getPostConstructLandingPage
public String getPostConstructLandingPage()
Description copied from class:View
Returns the page to redirect the user to, after the view is created. The returned string is appended to "/view/foobar/", so for example to direct the user to the top page of the view, return "", etc.- Overrides:
getPostConstructLandingPage
in classView
-
submit
protected void submit(org.kohsuke.stapler.StaplerRequest req) throws IOException, javax.servlet.ServletException, Descriptor.FormException
Description copied from class:View
Handles the configuration submission. Load view-specific properties here.- Specified by:
submit
in classView
- Throws:
IOException
javax.servlet.ServletException
Descriptor.FormException
-
migrateLegacyPrimaryAllViewLocalizedName
@NonNull public static String migrateLegacyPrimaryAllViewLocalizedName(@NonNull List<View> views, @NonNull String primaryView)
Corrects the name of theAllView
if and only if theAllView
is the primary view and its name is one of the localized forms ofMessages._Hudson_ViewName()
and the user has not opted out of fixing the view name by setting the system propertyhudson.mode.AllView.JENKINS-38606
tofalse
. Use this method to round-trip the primary view name, e.g.primaryView = migrateLegacyPrimaryAllViewLocalizedName(views, primaryView)
NOTE: we can only fix the localized name of an
AllView
if it is the primary view as otherwise urls would change, whereas the primary view is special and does not normally get accessed by the/view/_name_
url. (Also note that there are some cases where the primary view will get accessed by its/view/_name_
url which will then fall back to the primary view)- Parameters:
views
- the list of views.primaryView
- the current primary view name.- Returns:
- the primary view name - this will be the same as the provided primary view name unless a JENKINS-38606 matching name is detected, in which case this will be the new name of the primary view.
- Since:
- 2.37
-
-