Class BuildPipelineView

    • Constructor Detail

      • BuildPipelineView

        public BuildPipelineView​(String name,
                                 String buildViewTitle,
                                 ProjectGridBuilder gridBuilder,
                                 String noOfDisplayedBuilds,
                                 boolean triggerOnlyLatestJob,
                                 String cssUrl)
        Parameters:
        name - the name of the pipeline build view.
        buildViewTitle - the build view title.
        gridBuilder - controls the data to be displayed.
        noOfDisplayedBuilds - a count of the number of builds displayed on the view
        triggerOnlyLatestJob - Indicates whether only the latest job will be triggered.
        cssUrl - URL for the custom CSS file.
      • BuildPipelineView

        @DataBoundConstructor
        public BuildPipelineView​(String name,
                                 String buildViewTitle,
                                 ProjectGridBuilder gridBuilder,
                                 String noOfDisplayedBuilds,
                                 boolean triggerOnlyLatestJob,
                                 boolean alwaysAllowManualTrigger,
                                 boolean showPipelineParameters,
                                 boolean showPipelineParametersInHeaders,
                                 boolean showPipelineDefinitionHeader,
                                 int refreshFrequency,
                                 String cssUrl,
                                 String selectedJob,
                                 PipelineHeaderExtension columnHeaders,
                                 PipelineHeaderExtension rowHeaders,
                                 BuildCardExtension buildCard)
        Parameters:
        name - the name of the pipeline build view.
        buildViewTitle - the build view title.
        gridBuilder - controls the data to be displayed.
        noOfDisplayedBuilds - a count of the number of builds displayed on the view
        triggerOnlyLatestJob - Indicates whether only the latest job will be triggered.
        alwaysAllowManualTrigger - Indicates whether manual trigger will always be available.
        showPipelineParameters - Indicates whether pipeline parameter values should be shown.
        showPipelineParametersInHeaders - Indicates whether the pipeline headers should show the pipeline parameter values for the last successful instance.
        showPipelineDefinitionHeader - Indicates whether the pipeline headers should be shown.
        refreshFrequency - Frequency at which the build pipeline plugin refreshes build cards
        cssUrl - URL for the custom CSS file.
        selectedJob - the first job name in the pipeline. it can be set to null when gridBuilder is passed.
        columnHeaders - see columnHeaders
        rowHeaders - see rowHeaders
        buildCard - see buildCard
    • Method Detail

      • hasBuildPermission

        public boolean hasBuildPermission()
        Checks whether the user has a permission to start a new instance of the pipeline.
        Returns:
        - true: Has Build permission; false: Does not have Build permission
        See Also:
        Item
      • isProjectParameterized

        public boolean isProjectParameterized()
        Checks if this build starts with parameters
        Returns:
        - true: The build has parameters; false: Does not have parameters
      • hasConfigurePermission

        public boolean hasConfigurePermission()
        Checks whether the user has Configure permission for the current project.
        Returns:
        - true: Has Configure permission; false: Does not have Configure permission
      • getDownstreamProjects

        public List<AbstractProject<?,​?>> getDownstreamProjects​(AbstractProject<?,​?> currentProject)
        Get a List of downstream projects.
        Parameters:
        currentProject - - The project from which we want the downstream projects
        Returns:
        - A List of downstream projects
      • hasDownstreamProjects

        public boolean hasDownstreamProjects​(AbstractProject<?,​?> currentProject)
        Determines if the current project has any downstream projects
        Parameters:
        currentProject - - The project from which we are testing.
        Returns:
        - true; has downstream projects; false: does not have downstream projects
      • getBuildPipelineForm

        public BuildPipelineForm getBuildPipelineForm()
        Returns BuildPipelineForm containing the build pipeline to display.
        Returns:
        - Representation of the projects and their related builds making up the build pipeline view
      • triggerManualBuild

        @JavaScriptMethod
        public int triggerManualBuild​(Integer upstreamBuildNumber,
                                      String triggerProjectName,
                                      String upstreamProjectName)
        Trigger a manual build
        Parameters:
        upstreamBuildNumber - upstream build number
        triggerProjectName - project that is triggered
        upstreamProjectName - upstream project
        Returns:
        next build number that has been scheduled
      • rerunBuild

        @JavaScriptMethod
        public int rerunBuild​(String externalizableId)
        Re-run a project, passing in the CauseActions from the previous completed Run so that the new run will appear in the same pipeline.
        Parameters:
        externalizableId - the externalizableId of the Run. See Run.getExternalizableId()
        Returns:
        the number of re-run build
      • getBuildViewTitle

        public String getBuildViewTitle()
      • setBuildViewTitle

        public void setBuildViewTitle​(String buildViewTitle)
      • getCssUrl

        public String getCssUrl()
      • setCssUrl

        public void setCssUrl​(String cssUrl)
      • getNoOfDisplayedBuilds

        public String getNoOfDisplayedBuilds()
      • setNoOfDisplayedBuilds

        public void setNoOfDisplayedBuilds​(String noOfDisplayedBuilds)
      • getConsoleOutputLinkStyle

        public String getConsoleOutputLinkStyle()
      • setConsoleOutputLinkStyle

        public void setConsoleOutputLinkStyle​(String consoleOutputLinkStyle)
      • isNewWindowConsoleOutputLinkStyle

        public boolean isNewWindowConsoleOutputLinkStyle()
      • isThisWindowConsoleOutputLinkStyle

        public boolean isThisWindowConsoleOutputLinkStyle()
      • isTriggerOnlyLatestJob

        public boolean isTriggerOnlyLatestJob()
      • getTriggerOnlyLatestJob

        public String getTriggerOnlyLatestJob()
      • setTriggerOnlyLatestJob

        public void setTriggerOnlyLatestJob​(boolean triggerOnlyLatestJob)
      • isAlwaysAllowManualTrigger

        public boolean isAlwaysAllowManualTrigger()
      • getAlwaysAllowManualTrigger

        public String getAlwaysAllowManualTrigger()
      • setAlwaysAllowManualTrigger

        public void setAlwaysAllowManualTrigger​(boolean alwaysAllowManualTrigger)
      • getRefreshFrequency

        public int getRefreshFrequency()
      • setRefreshFrequency

        public void setRefreshFrequency​(int refreshFrequency)
      • getRefreshFrequencyInMillis

        public int getRefreshFrequencyInMillis()
      • isShowPipelineDefinitionHeader

        public boolean isShowPipelineDefinitionHeader()
      • getShowPipelineDefinitionHeader

        public String getShowPipelineDefinitionHeader()
      • setShowPipelineDefinitionHeader

        public void setShowPipelineDefinitionHeader​(boolean showPipelineDefinitionHeader)
      • onJobRenamed

        public void onJobRenamed​(Item item,
                                 String oldName,
                                 String newName)
        If a project name is changed we check if the selected job for this view also needs to be changed.
        Overrides:
        onJobRenamed in class View
        Parameters:
        item - - The Item that has been renamed
        oldName - - The old name of the Item
        newName - - The new name of the Item
      • doCreateItem

        public Item doCreateItem​(org.kohsuke.stapler.StaplerRequest req,
                                 org.kohsuke.stapler.StaplerResponse rsp)
                          throws IOException,
                                 javax.servlet.ServletException
        Specified by:
        doCreateItem in class View
        Throws:
        IOException
        javax.servlet.ServletException
      • hasPermission

        public boolean hasPermission​(Permission p)