Package hudson.plugins.nested_view
Class NestedView
java.lang.Object
hudson.model.AbstractModelObject
hudson.model.View
hudson.plugins.nested_view.NestedView
- All Implemented Interfaces:
ExtensionPoint
,Describable<View>
,DescriptorByNameOwner
,ModelObject
,Saveable
,ViewGroup
,SearchableModelObject
,SearchItem
,AccessControlled
,ModelObjectWithChildren
,ModelObjectWithContextMenu
,HasWidgets
,org.kohsuke.stapler.StaplerProxy
public class NestedView
extends View
implements ViewGroup, org.kohsuke.stapler.StaplerProxy, ModelObjectWithContextMenu
View type that contains only another set of views.
Allows grouping job views into multiple levels instead of one big list of tabs.
- Author:
- Alan Harder, Kohsuke Kawaguchi, Romain Seguy
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
static final class
static class
Container for HealthReport with two methods matching hudson.model.Job so we can pass this to f:healthReport jelly.class
Handle owner attributeNested classes/interfaces inherited from class hudson.model.View
View.PropertyList
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType
-
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 TypeMethodDescriptionboolean
boolean
contains
(TopLevelItem item) void
deleteView
(View view) doCheckViewName
(String value) Checks if a nested view with the given name exists and make sure that the name is good as a view name.doChildrenContextMenu
(org.kohsuke.stapler.StaplerRequest2 request, org.kohsuke.stapler.StaplerResponse2 response) org.kohsuke.stapler.HttpResponse
doConfigDotXml
(org.kohsuke.stapler.StaplerRequest2 req) doContextMenu
(org.kohsuke.stapler.StaplerRequest2 request, org.kohsuke.stapler.StaplerResponse2 response) doCreateItem
(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) void
doCreateView
(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) doViewExistsCheck
(String value) Checks if a nested view with the given name exists.Returns the health of this nested view.ItemGroup<? extends TopLevelItem>
getItems()
getUrl()
Returns the health of a view, wether it is a normal or a nested one.getViews()
Returns the worst result for this nested view.static Result
Returns the worst result for a view, wether is a normal view or a nested one.boolean
void
onJobRenamed
(Item item, String oldName, String newName) void
onViewRenamed
(View view, String oldName, String newName) void
save()
protected void
submit
(org.kohsuke.stapler.StaplerRequest2 req) void
updateByXml
(Source source) Updates View by its XML definition.Methods inherited from class hudson.model.View
all, allInstantiable, create, create, createViewFromXML, doCheckJobName, doConfigDotXml, doConfigSubmit, doCreateItem, doDoDelete, doItemCategories, doRssAll, doRssFailed, doRssLatest, doSubmitDescription, doSubmitDescription, getAbsoluteUrl, getACL, getActions, getAllItems, getAllProperties, getApi, getApplicablePropertyDescriptors, getApproximateQueueItemsQuickly, getBuilds, getColumns, getComputers, getDescription, getDescriptor, getDisplayName, getDynamic, getIndenter, getItem, getItemCreatePermission, getJob, getNewPronoun, getOwner, getOwnerItemGroup, getOwnerPrimaryView, getOwnerViewActions, getPostConstructLandingPage, getProperties, getQueueItems, getSearchUrl, getTimeline, getViewName, getViewUrl, getVisiblePropertyDescriptors, isAutomaticRefreshEnabled, isDefault, isEditable, isFilterExecutors, isFilterQueue, makeSearchIndex, makeSearchIndex, registerPermissions, rename, setDescription, setFilterExecutors, setFilterQueue, submit, toString, 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, getACL, hasAnyPermission, hasPermission, hasPermission2
Methods inherited from interface hudson.model.DescriptorByNameOwner
getDescriptorByName
Methods inherited from interface jenkins.widgets.HasWidgets
getWidget, getWidgets
Methods inherited from interface hudson.model.ModelObject
getDisplayName
Methods inherited from interface jenkins.model.ModelObjectWithChildren
doChildrenContextMenu
Methods inherited from interface jenkins.model.ModelObjectWithContextMenu
doContextMenu
Methods inherited from interface hudson.model.ViewGroup
getAllViews
-
Constructor Details
-
NestedView
-
-
Method Details
-
getItems
-
hasPermission
- Specified by:
hasPermission
in interfaceAccessControlled
-
contains
-
doContextMenu
public ModelObjectWithContextMenu.ContextMenu doContextMenu(org.kohsuke.stapler.StaplerRequest2 request, org.kohsuke.stapler.StaplerResponse2 response) throws IOException, org.apache.commons.jelly.JellyException - Specified by:
doContextMenu
in interfaceModelObjectWithContextMenu
- Throws:
IOException
org.apache.commons.jelly.JellyException
-
doChildrenContextMenu
public ModelObjectWithContextMenu.ContextMenu doChildrenContextMenu(org.kohsuke.stapler.StaplerRequest2 request, org.kohsuke.stapler.StaplerResponse2 response) throws Exception - Specified by:
doChildrenContextMenu
in interfaceModelObjectWithChildren
- Overrides:
doChildrenContextMenu
in classView
- Throws:
Exception
-
getUrl
-
getPrimaryView
- Specified by:
getPrimaryView
in interfaceViewGroup
-
getItemGroup
- Specified by:
getItemGroup
in interfaceViewGroup
-
getViewActions
- Specified by:
getViewActions
in interfaceViewGroup
-
doCreateItem
public Item doCreateItem(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException - Overrides:
doCreateItem
in classView
- Throws:
IOException
jakarta.servlet.ServletException
-
doCheckViewName
Checks if a nested view with the given name exists and make sure that the name is good as a view name. -
doViewExistsCheck
Checks if a nested view with the given name exists. -
onJobRenamed
- Overrides:
onJobRenamed
in classView
-
submit
protected void submit(org.kohsuke.stapler.StaplerRequest2 req) throws IOException, jakarta.servlet.ServletException, Descriptor.FormException - Overrides:
submit
in classView
- Throws:
IOException
jakarta.servlet.ServletException
Descriptor.FormException
-
canDelete
-
deleteView
- Specified by:
deleteView
in interfaceViewGroup
- Throws:
IOException
-
getViews
-
getView
-
getDefaultView
-
getColumnsToShow
-
onViewRenamed
- Specified by:
onViewRenamed
in interfaceViewGroup
-
save
- Specified by:
save
in interfaceSaveable
- Overrides:
save
in classView
- Throws:
IOException
-
doCreateView
public void doCreateView(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException, Descriptor.FormException - Throws:
IOException
jakarta.servlet.ServletException
Descriptor.FormException
-
getImage
-
getWorstResult
Returns the worst result for this nested view.To get the worst result, this method browses all the jobs this view contains. Also, as soon as it finds the worst result possible (cf.
WORST_RESULT
), the browsing stops.The algorithm first analyzes normal views (that is, views which are not nested ones); Then, in a second time, it processes nested views, hoping that
WORST_RESULT
will be found as quick as possible, as mentionned previously. -
getWorstResult
Returns the worst result for a view, wether is a normal view or a nested one.- See Also:
-
getWorstResult()
getWorstResultForNormalView(hudson.model.View)
-
getHealth
Returns the health of this nested view.Notice that, if a job is contained in several sub-views of the current view, then it is taken into account only once to get accurate stats.
This algorithm has been derecursified, hence the stack stuff.
-
doConfigDotXml
@WebMethod(name="config.xml") public org.kohsuke.stapler.HttpResponse doConfigDotXml(org.kohsuke.stapler.StaplerRequest2 req) throws IOException - Overrides:
doConfigDotXml
in classView
- Throws:
IOException
-
updateByXml
Updates View by its XML definition.- Overrides:
updateByXml
in classView
- Throws:
IOException
-
getViewHealth
Returns the health of a view, wether it is a normal or a nested one.- See Also:
-
getHealth()
getHealthForNormalView(hudson.model.View)
-
getViewsTabBar
- Specified by:
getViewsTabBar
in interfaceViewGroup
-
getTarget
- Specified by:
getTarget
in interfaceorg.kohsuke.stapler.StaplerProxy
-