Package jenkins.model.dashboard
Class Dashboard
java.lang.Object
hudson.model.AbstractModelObject
hudson.model.Actionable
jenkins.model.dashboard.Dashboard
- All Implemented Interfaces:
ModelObject,SearchableModelObject,SearchItem,ModelObjectWithContextMenu
@Extension
@Restricted(org.kohsuke.accmod.restrictions.Beta.class)
public final class Dashboard
extends Actionable
The home page of the experimental dashboard, shown at the root URL to users who have enabled
NewDashboardPageUserExperimentalFlag.
The page is made of Tabs. Plugins can add a tab by implementing
TransientActionFactory for this type, typically returning an ItemListTab.
Actions added with Actionable.addAction(Action) are not saved and do not survive a restart.
The root URL belongs to the primary view, whose page hands over to
this one when the flag is on. Tabs are reachable at /<urlName>/ through Jenkins.getDynamic(String),
which consults them only after its own actions, so a tab cannot hide a root action.
- Since:
- TODO
-
Nested Class Summary
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoContextMenu(org.kohsuke.stapler.StaplerRequest2 request, org.kohsuke.stapler.StaplerResponse2 response) Generates the context menu.static Dashboardget()The same actions as the primary view, plus a menu of the configured views.The tabs to show, in extension order.The tab shown at the root URL: the first one without a URL name, or else the first tab.This bindsSearchobject to the URL hierarchy.Returns the URL of this item relative to the parentSearchItem.Finds the tab for a URL token: a tab's URL name, ordefaultTabforgetDefaultTab().getUrl()static booleanWhether the current user sees this page at the root URL.static booleanisRootRequest(org.kohsuke.stapler.StaplerRequest2 request) Whether a request is for the root URL, rather than for a view's own URL such as/view/all/.protected SearchIndexBuilderDefault implementation that returns empty index.Methods inherited from class hudson.model.Actionable
addAction, addOrReplaceAction, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, getDynamic, getDynamic, removeAction, removeActions, replaceAction, replaceActionsMethods inherited from class hudson.model.AbstractModelObject
getSearchIndex, getSearchName, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendErrorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.search.SearchItem
getSearchGroup, getSearchIcon
-
Constructor Details
-
Dashboard
public Dashboard()
-
-
Method Details
-
get
-
isEnabled
public static boolean isEnabled()Whether the current user sees this page at the root URL. -
getDisplayName
-
getSearchUrl
Description copied from interface:SearchItemReturns the URL of this item relative to the parentSearchItem.- Returns:
- URL like "foo" or "foo/bar". The path can end with '/'. The path that starts with '/' will be interpreted as the absolute path (within the context path of Jenkins.)
-
getUrl
-
getSearch
Description copied from interface:SearchableModelObjectThis bindsSearchobject to the URL hierarchy.- Specified by:
getSearchin interfaceSearchableModelObject- Overrides:
getSearchin classAbstractModelObject
-
makeSearchIndex
Description copied from class:AbstractModelObjectDefault implementation that returns empty index.- Overrides:
makeSearchIndexin classAbstractModelObject
-
getDashboardTabs
The tabs to show, in extension order. -
getDefaultTab
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @CheckForNull public Tab getDefaultTab()The tab shown at the root URL: the first one without a URL name, or else the first tab. It is also reachable at/defaultTab/, so that the endpoints of a tab without a URL name have a URL. -
getAppBarActions
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public List<Action> getAppBarActions()The same actions as the primary view, plus a menu of the configured views.- Overrides:
getAppBarActionsin classActionable- Returns:
- an unmodifiable list of actions suitable for display in the app bar
-
doContextMenu
public ModelObjectWithContextMenu.ContextMenu doContextMenu(org.kohsuke.stapler.StaplerRequest2 request, org.kohsuke.stapler.StaplerResponse2 response) Description copied from interface:ModelObjectWithContextMenuGenerates the context menu. The typical implementation isreturn new ContextMenu().from(this,request,response);, which implements the default behaviour. SeeModelObjectWithContextMenu.ContextMenu.from(ModelObjectWithContextMenu, StaplerRequest2, StaplerResponse2)for more details of what it does. This should suit most implementations.- Specified by:
doContextMenuin interfaceModelObjectWithContextMenu- Overrides:
doContextMenuin classActionable
-
getTab
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @CheckForNull public Tab getTab(@NonNull String token) Finds the tab for a URL token: a tab's URL name, ordefaultTabforgetDefaultTab(). -
isRootRequest
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static boolean isRootRequest(@NonNull org.kohsuke.stapler.StaplerRequest2 request) Whether a request is for the root URL, rather than for a view's own URL such as/view/all/.
-