Class 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
  • Constructor Details

    • Dashboard

      public Dashboard()
  • Method Details

    • get

      @NonNull public static Dashboard get()
    • isEnabled

      public static boolean isEnabled()
      Whether the current user sees this page at the root URL.
    • getDisplayName

      public String getDisplayName()
    • getSearchUrl

      public String getSearchUrl()
      Description copied from interface: SearchItem
      Returns the URL of this item relative to the parent SearchItem.
      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

      public String getUrl()
    • getSearch

      public Search getSearch()
      Description copied from interface: SearchableModelObject
      This binds Search object to the URL hierarchy.
      Specified by:
      getSearch in interface SearchableModelObject
      Overrides:
      getSearch in class AbstractModelObject
    • makeSearchIndex

      protected SearchIndexBuilder makeSearchIndex()
      Description copied from class: AbstractModelObject
      Default implementation that returns empty index.
      Overrides:
      makeSearchIndex in class AbstractModelObject
    • getDashboardTabs

      @NonNull public List<Tab> 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:
      getAppBarActions in class Actionable
      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: ModelObjectWithContextMenu
      Generates the context menu. The typical implementation is return new ContextMenu().from(this,request,response);, which implements the default behaviour. See ModelObjectWithContextMenu.ContextMenu.from(ModelObjectWithContextMenu, StaplerRequest2, StaplerResponse2) for more details of what it does. This should suit most implementations.
      Specified by:
      doContextMenu in interface ModelObjectWithContextMenu
      Overrides:
      doContextMenu in class Actionable
    • 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, or defaultTab for getDefaultTab().
    • 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/.