Refine search
public AutoCompletionCandidates doAutoCompleteChildProjects(@QueryParameter String value, @AncestorInPath Item self, @AncestorInPath ItemGroup container) { return AutoCompletionCandidates.ofJobNames(Job.class,value,self,container); }
public AutoCompletionCandidates doAutoCompleteUpstreamProjects(@QueryParameter String value, @AncestorInPath Item self, @AncestorInPath ItemGroup container) { return AutoCompletionCandidates.ofJobNames(Job.class, value, self, container); }
public FormValidation doCheckLabel(@AncestorInPath AbstractProject<?,?> project, @QueryParameter String value) { return validateLabelExpression(value, project); }
@Deprecated public FormValidation doCheck(@AncestorInPath AbstractProject project, @QueryParameter String value) throws IOException { return doCheckTargets(project, value); }
public FormValidation doCheck(@QueryParameter String value, @AncestorInPath Item item) { return doCheckSpec(value, item); }
public FormValidation doCheckTargets(@AncestorInPath AbstractProject<?,?> project, @QueryParameter String value) throws IOException { if (project == null) { return FormValidation.ok(); } return FilePath.validateFileMask(project.getSomeWorkspace(),value); }
@Restricted(DoNotUse.class) public FormValidation doCheckAssignedLabelString(@AncestorInPath AbstractProject<?,?> project, @QueryParameter String value) { // Provide a legacy interface in case plugins are not going through p:config-assignedLabel // see: JENKINS-25372 LOGGER.log(Level.WARNING, "checking label via legacy '_.assignedLabelString'"); return doCheckLabel(project, value); }
/** * Performs on-the-fly validation of the file mask wildcard, when the artifacts * textbox or the caseSensitive checkbox are modified */ public FormValidation doCheckArtifacts(@AncestorInPath AbstractProject project, @QueryParameter String value, @QueryParameter(value = "caseSensitive") String caseSensitive) throws IOException { if (project == null) { return FormValidation.ok(); } // defensive approach to remain case sensitive in doubtful situations boolean bCaseSensitive = caseSensitive == null || !"false".equals(caseSensitive); return FilePath.validateFileMask(project.getSomeWorkspace(), value, bCaseSensitive); }
/** * Performs syntax check. */ public FormValidation doCheckScmpoll_spec(@QueryParameter String value, @QueryParameter boolean ignorePostCommitHooks, @AncestorInPath Item item) { if (StringUtils.isBlank(value)) { if (ignorePostCommitHooks) { return FormValidation.ok(Messages.SCMTrigger_no_schedules_no_hooks()); } else { return FormValidation.ok(Messages.SCMTrigger_no_schedules_hooks()); } } else { return Jenkins.getInstance().getDescriptorByType(TimerTrigger.DescriptorImpl.class) .doCheckSpec(value, item); } } }
/** * Auto-completion for the "copy from" field in the new job page. */ @Restricted(DoNotUse.class) public AutoCompletionCandidates doAutoCompleteCopyNewItemFrom(@QueryParameter final String value, @AncestorInPath ItemGroup<?> container) { AutoCompletionCandidates candidates = AutoCompletionCandidates.ofJobNames(TopLevelItem.class, value, container); if (container instanceof DirectlyModifiableTopLevelItemGroup) { DirectlyModifiableTopLevelItemGroup modifiableContainer = (DirectlyModifiableTopLevelItemGroup) container; Iterator<String> it = candidates.getValues().iterator(); while (it.hasNext()) { TopLevelItem item = Jenkins.getInstance().getItem(it.next(), container, TopLevelItem.class); if (item == null) { continue; // ? } if (!modifiableContainer.canAdd(item)) { it.remove(); } } } return candidates; }
public AutoCompletionCandidates doAutoCompleteIncludeBranchesSpec(@AncestorInPath final Job<?, ?> job, @QueryParameter final String value) { return ProjectBranchesProvider.instance().doAutoCompleteBranchesSpec(job, value); }
/** * Performs syntax check. */ public FormValidation doCheckSpec(@QueryParameter String value, @AncestorInPath Item item) { try { CronTabList ctl = CronTabList.create(fixNull(value), item != null ? Hash.from(item.getFullName()) : null); Collection<FormValidation> validations = new ArrayList<>(); updateValidationsForSanity(validations, ctl); updateValidationsForNextRun(validations, ctl); return FormValidation.aggregate(validations); } catch (ANTLRException e) { if (value.trim().indexOf('\n')==-1 && value.contains("**")) return FormValidation.error(Messages.TimerTrigger_MissingWhitespace()); return FormValidation.error(e.getMessage()); } }
public AutoCompletionCandidates doAutoCompleteIncludeMergeRequestLabels(@AncestorInPath final Job<?, ?> job, @QueryParameter final String value) { return ProjectLabelsProvider.instance().doAutoCompleteLabels(job, value); }
public FormValidation doCheckUpstreamProjects(@AncestorInPath Job project, @QueryParameter String value) { if (!project.hasPermission(Item.CONFIGURE)) { return FormValidation.ok(); } StringTokenizer tokens = new StringTokenizer(Util.fixNull(value),","); boolean hasProjects = false; while(tokens.hasMoreTokens()) { String projectName = tokens.nextToken().trim(); if (StringUtils.isNotBlank(projectName)) { Job item = Jenkins.getInstance().getItem(projectName, project, Job.class); if (item == null) { Job nearest = Items.findNearest(Job.class, projectName, project.getParent()); String alternative = nearest != null ? nearest.getRelativeNameFrom(project) : "?"; return FormValidation.error(hudson.tasks.Messages.BuildTrigger_NoSuchProject(projectName, alternative)); } hasProjects = true; } } if (!hasProjects) { return FormValidation.error(hudson.tasks.Messages.BuildTrigger_NoProjectSpecified()); } return FormValidation.ok(); }
public AutoCompletionCandidates doAutoCompleteExcludeBranchesSpec(@AncestorInPath final Job<?, ?> job, @QueryParameter final String value) { return ProjectBranchesProvider.instance().doAutoCompleteBranchesSpec(job, value); }
public FormValidation doCheckIncludeMergeRequestLabels(@AncestorInPath final Job<?, ?> project, @QueryParameter final String value) { return ProjectLabelsProvider.instance().doCheckLabels(project, value); }
public FormValidation doCheckIncludeBranchesSpec(@AncestorInPath final Job<?, ?> project, @QueryParameter final String value) { return ProjectBranchesProvider.instance().doCheckBranchesSpec(project, value); }
public FormValidation doCheckExcludeBranchesSpec(@AncestorInPath final Job<?, ?> project, @QueryParameter final String value) { return ProjectBranchesProvider.instance().doCheckBranchesSpec(project, value); }
public AutoCompletionCandidates doAutoCompleteExcludeMergeRequestLabels(@AncestorInPath final Job<?, ?> job, @QueryParameter final String value) { return ProjectLabelsProvider.instance().doAutoCompleteLabels(job, value); }
public FormValidation doCheckExcludeMergeRequestLabels(@AncestorInPath final Job<?, ?> project, @QueryParameter final String value) { return ProjectLabelsProvider.instance().doCheckLabels(project, value); }