Package hudson.model

Class AllView

All Implemented Interfaces:
ExtensionPoint, Describable<View>, DescriptorByNameOwner, ModelObject, Saveable, SearchableModelObject, SearchItem, AccessControlled, ModelObjectWithChildren, HasWidgets

public class AllView extends View
View that contains everything.
Since:
1.269
Author:
Kohsuke Kawaguchi
  • Field Details

    • DEFAULT_VIEW_NAME

      public static final String DEFAULT_VIEW_NAME
      The name of the default AllView. An AllView with this name will get a localized display name. Other AllView 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:
  • Constructor Details

    • AllView

      @DataBoundConstructor public AllView(String name)
    • AllView

      public AllView(String name, ViewGroup owner)
  • Method Details

    • 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 class View
    • contains

      public boolean contains(TopLevelItem item)
      Description copied from class: View
      Checks if the job is in this collection.
      Specified by:
      contains in class View
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface ModelObject
      Overrides:
      getDisplayName in class View
    • doCreateItem

      public Item doCreateItem(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException
      Description copied from class: View
      Creates a new Item in this collection.

      This method should call ModifiableItemGroup.doCreateItem(StaplerRequest2, StaplerResponse2) and then add the newly created item to this view.

      Overrides:
      doCreateItem in class View
      Returns:
      null if fails.
      Throws:
      IOException
      jakarta.servlet.ServletException
    • getItems

      public Collection<TopLevelItem> getItems()
      Description copied from class: View
      Gets all the items in this collection in a read-only view.
      Specified by:
      getItems in class 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 class View
    • submit

      protected void submit(org.kohsuke.stapler.StaplerRequest2 req) throws IOException, jakarta.servlet.ServletException, Descriptor.FormException
      Description copied from class: View
      Handles the configuration submission. Load view-specific properties here.
      Overrides:
      submit in class View
      Throws:
      IOException
      jakarta.servlet.ServletException
      Descriptor.FormException
    • submit

      @Deprecated protected void submit(org.kohsuke.stapler.StaplerRequest req) throws IOException, javax.servlet.ServletException, Descriptor.FormException
      Deprecated.
      Overrides:
      submit in class View
      Throws:
      IOException
      javax.servlet.ServletException
      Descriptor.FormException
    • migrateLegacyPrimaryAllViewLocalizedName

      @NonNull public static String migrateLegacyPrimaryAllViewLocalizedName(@NonNull List<View> views, @NonNull String primaryView)
      Corrects the name of the AllView if and only if the AllView is the primary view and its name is one of the localized forms of Messages._Hudson_ViewName() and the user has not opted out of fixing the view name by setting the system property hudson.mode.AllView.JENKINS-38606 to false. 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