Index: C:/entw/hudson-org/main/core/src/main/java/hudson/model/ListView.java =================================================================== --- C:/entw/hudson-org/main/core/src/main/java/hudson/model/ListView.java (revision 12819) +++ C:/entw/hudson-org/main/core/src/main/java/hudson/model/ListView.java (working copy) @@ -48,7 +48,36 @@ * Include regex string. */ private String includeRegex; - + + private String showType; + + public String getShowType() { + return showType; + } + + private static final String TYPEALL = "ALL"; + private static final String TYPESUCCESS = "Successes"; + private static final String TYPEFAILURE = "Failures"; + private static final String TYPEUNSTABLE = "Unstables"; + private static final String TYPEDISABLED = "Disabled"; + + public String getTYPEALL() { + return TYPEALL; + } + public String getTYPESUCCESS() { + return TYPESUCCESS; + } + public String getTYPEFAILURE() { + return TYPEFAILURE; + } + public String getTYPEUNSTABLE() { + return TYPEUNSTABLE; + } + public String getTYPEDISABLED() { + return TYPEDISABLED; + } + + /** * Compiled include pattern from the includeRegex string. */ @@ -84,6 +113,25 @@ } catch (PatternSyntaxException pse) { } } + for (Iterator iterator = names.iterator(); iterator.hasNext();) { + String name = iterator.next(); + Result result = Result.NOT_BUILT; + if (((AbstractProject) owner.getItem(name)).getLastBuild() != null) { + result = ((AbstractProject) owner.getItem(name)).getLastBuild().getResult(); + } + boolean isDisabled = ((AbstractProject) owner.getItem(name)).isDisabled(); + if (showType != null){ + if ((showType.equals(TYPEFAILURE)) && ((result != Result.FAILURE) || isDisabled)) { + iterator.remove(); + } else if ((showType.equals(TYPESUCCESS)) && ((result != Result.SUCCESS) || isDisabled)) { + iterator.remove(); + } else if ((showType.equals(TYPEUNSTABLE)) && ((result != Result.UNSTABLE) || isDisabled)) { + iterator.remove(); + } else if ((showType.equals(TYPEDISABLED)) && (!isDisabled)) { + iterator.remove(); + } + } + } List items = new ArrayList(names.size()); for (String name : names) { @@ -117,7 +165,7 @@ public String getDisplayName() { return name; } - + public String getIncludeRegex() { return includeRegex; } @@ -142,7 +190,7 @@ checkPermission(CONFIGURE); req.setCharacterEncoding("UTF-8"); - + jobNames.clear(); for (TopLevelItem item : owner.getItems()) { if(req.getParameter(item.getName())!=null) @@ -150,7 +198,12 @@ } description = Util.nullify(req.getParameter("description")); - + + if (req.getParameter("showType") != null) + showType = req.getParameter("showType"); + else + showType = TYPEALL; + if (req.getParameter("useincluderegex") != null) { includeRegex = Util.nullify(req.getParameter("includeregex")); } else { @@ -195,6 +248,18 @@ } /** + * Build all jobs of this view. + * @throws ServletException + */ + public synchronized void doBuild(StaplerRequest req, StaplerResponse rsp) + throws IOException, ServletException { + for (TopLevelItem item : this.getItems()) { + ((AbstractProject) item).scheduleBuild(); + } + rsp.sendRedirect("."); + } + + /** * Checks if the include regular expression is valid. */ public synchronized void doIncludeRegexCheck( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, InterruptedException { Index: C:/entw/hudson-org/main/core/src/main/resources/hudson/model/ListView/configure.jelly =================================================================== --- C:/entw/hudson-org/main/core/src/main/resources/hudson/model/ListView/configure.jelly (revision 12819) +++ C:/entw/hudson-org/main/core/src/main/resources/hudson/model/ListView/configure.jelly (working copy) @@ -19,17 +19,28 @@
- + - + + + + + + + + + + + + - + \ No newline at end of file Index: C:/entw/hudson-org/main/core/src/main/resources/hudson/model/ListView/sidepanel2.jelly =================================================================== --- C:/entw/hudson-org/main/core/src/main/resources/hudson/model/ListView/sidepanel2.jelly (revision 12819) +++ C:/entw/hudson-org/main/core/src/main/resources/hudson/model/ListView/sidepanel2.jelly (working copy) @@ -1,4 +1,5 @@ + \ No newline at end of file