Class BuildPipelineView
java.lang.Object
hudson.model.AbstractModelObject
hudson.model.View
au.com.centrumsystems.hudson.plugin.buildpipeline.BuildPipelineView
- All Implemented Interfaces:
ExtensionPoint,Describable<View>,DescriptorByNameOwner,ModelObject,Saveable,SearchableModelObject,SearchItem,AccessControlled,ModelObjectWithChildren,HasWidgets
- Direct Known Subclasses:
ReadOnlyBuildPipelineView
This view displays the set of jobs that are related
based on their upstream\downstream relationships as a pipeline. Each
build pipeline becomes a row on the view.
- Author:
- Centrum Systems
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThis descriptor class is required to configure the View Pagestatic interfaceA function which accepts an argument and returns a result.Nested classes/interfaces inherited from class hudson.model.View
View.PropertyListNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
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
ConstructorsConstructorDescriptionBuildPipelineView(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) BuildPipelineView(String name, String buildViewTitle, ProjectGridBuilder gridBuilder, String noOfDisplayedBuilds, boolean triggerOnlyLatestJob, String cssUrl) -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(TopLevelItem item) doCreateItem(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) Returns BuildPipelineForm containing the build pipeline to display.List<AbstractProject<?,?>> getDownstreamProjects(AbstractProject<?, ?> currentProject) Get a List of downstream projects.getItems()getProjectURL(AbstractProject<?, ?> project) Retrieves the project URLintintbooleanChecks whether the user has a permission to start a new instance of the pipeline.booleanChecks whether the user has Configure permission for the current project.booleanhasDownstreamProjects(AbstractProject<?, ?> currentProject) Determines if the current project has any downstream projectsbooleanbooleanbooleanbooleanChecks if this build starts with parametersbooleanbooleanbooleanvoidonJobRenamed(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.protected ObjectMigrate old data, set new fieldsintrerunBuild(String externalizableId) Re-run a project, passing in the CauseActions from the previous completedRunso that the new run will appear in the same pipeline.voidsetAlwaysAllowManualTrigger(boolean alwaysAllowManualTrigger) voidsetBuildCard(BuildCardExtension buildCard) voidsetBuildViewTitle(String buildViewTitle) voidsetColumnHeaders(PipelineHeaderExtension columnHeaders) voidsetConsoleOutputLinkStyle(String consoleOutputLinkStyle) voidvoidsetGridBuilder(ProjectGridBuilder gridBuilder) voidsetNoOfDisplayedBuilds(String noOfDisplayedBuilds) voidsetRefreshFrequency(int refreshFrequency) voidsetRowHeaders(PipelineHeaderExtension rowHeaders) voidsetShowPipelineDefinitionHeader(boolean showPipelineDefinitionHeader) voidsetTriggerOnlyLatestJob(boolean triggerOnlyLatestJob) protected voidsubmit(org.kohsuke.stapler.StaplerRequest req) Handles the configuration submissioninttriggerManualBuild(Integer upstreamBuildNumber, String triggerProjectName, String upstreamProjectName) Trigger a manual buildMethods inherited from class hudson.model.View
all, allInstantiable, create, create, createViewFromXML, doCheckJobName, doChildrenContextMenu, doConfigDotXml, 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, getSearchGroup, getSearchIcon, getSearchUrl, getTimeline, getUrl, getViewName, getViewUrl, getVisiblePropertyDescriptors, isAutomaticRefreshEnabled, isDefault, isEditable, isFilterExecutors, isFilterQueue, makeSearchIndex, makeSearchIndex, registerPermissions, rename, save, setDescription, setFilterExecutors, setFilterQueue, submit, toString, updateByXml, updateTransientActions, writeXmlMethods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendErrorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission2Methods inherited from interface hudson.model.DescriptorByNameOwner
getDescriptorByNameMethods inherited from interface jenkins.widgets.HasWidgets
getWidget, getWidgetsMethods inherited from interface jenkins.model.ModelObjectWithChildren
doChildrenContextMenu
-
Constructor Details
-
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 viewtriggerOnlyLatestJob- 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 viewtriggerOnlyLatestJob- 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 cardscssUrl- 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- seecolumnHeadersrowHeaders- seerowHeadersbuildCard- seebuildCard
-
-
Method Details
-
readResolve
Migrate old data, set new fields- Returns:
- must be always 'this'
- See Also:
-
submit
protected void submit(org.kohsuke.stapler.StaplerRequest req) throws IOException, javax.servlet.ServletException, Descriptor.FormException Handles the configuration submission- Overrides:
submitin classView- Parameters:
req- Stapler Request- Throws:
Descriptor.FormException- Form ExceptionIOException- IO Exceptionjavax.servlet.ServletException- Servlet Exception
-
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:
-
isProjectParameterized
public boolean isProjectParameterized()Checks if this build starts with parameters- Returns:
- - true: The build has parameters; false: Does not have parameters
-
getColumnHeaders
-
setColumnHeaders
-
getRowHeaders
-
setRowHeaders
-
getBuildCard
-
setBuildCard
-
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
-
getGridBuilder
-
setGridBuilder
-
getDownstreamProjects
Get a List of downstream projects.- Parameters:
currentProject- - The project from which we want the downstream projects- Returns:
- - A List of downstream projects
-
hasDownstreamProjects
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
Returns BuildPipelineForm containing the build pipeline to display.- Returns:
- - Representation of the projects and their related builds making up the build pipeline view
-
getProjectURL
Retrieves the project URL- Parameters:
project- - The project- Returns:
- URL - of the project
- Throws:
URISyntaxException- on error
-
triggerManualBuild
@JavaScriptMethod public int triggerManualBuild(Integer upstreamBuildNumber, String triggerProjectName, String upstreamProjectName) Trigger a manual build- Parameters:
upstreamBuildNumber- upstream build numbertriggerProjectName- project that is triggeredupstreamProjectName- upstream project- Returns:
- next build number that has been scheduled
-
rerunBuild
Re-run a project, passing in the CauseActions from the previous completedRunso that the new run will appear in the same pipeline.- Parameters:
externalizableId- the externalizableId of the Run. SeeRun.getExternalizableId()- Returns:
- the number of re-run build
-
getBuildViewTitle
-
setBuildViewTitle
-
getCssUrl
-
setCssUrl
-
getNoOfDisplayedBuilds
-
setNoOfDisplayedBuilds
-
getConsoleOutputLinkStyle
-
setConsoleOutputLinkStyle
-
isNewWindowConsoleOutputLinkStyle
public boolean isNewWindowConsoleOutputLinkStyle() -
isThisWindowConsoleOutputLinkStyle
public boolean isThisWindowConsoleOutputLinkStyle() -
isTriggerOnlyLatestJob
public boolean isTriggerOnlyLatestJob() -
getTriggerOnlyLatestJob
-
setTriggerOnlyLatestJob
public void setTriggerOnlyLatestJob(boolean triggerOnlyLatestJob) -
isAlwaysAllowManualTrigger
public boolean isAlwaysAllowManualTrigger() -
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
-
setShowPipelineDefinitionHeader
public void setShowPipelineDefinitionHeader(boolean showPipelineDefinitionHeader) -
getItems
-
contains
-
onJobRenamed
If a project name is changed we check if the selected job for this view also needs to be changed.- Overrides:
onJobRenamedin classView- Parameters:
item- - The Item that has been renamedoldName- - The old name of the ItemnewName- - 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 - Overrides:
doCreateItemin classView- Throws:
IOExceptionjavax.servlet.ServletException
-
hasPermission
-