Skip to content
Permalink
Browse files
[JENKINS-36282] Add support to cc.xml for exporting jobs in folders r…
…ecursively (#3060)

* Add support for exporting jobs in folders recursively

* Convert cc.xml into a Groovy view

* Revert "Convert cc.xml into a Groovy view"

This reverts commit 990ec3e.

* Move logic in jelly view to static method
  • Loading branch information
dwnusbaum authored and oleg-nenashev committed Oct 13, 2017
1 parent f2d470d commit 562a7fc2d3c7eb3828bfbff4412db7fe48304113
Showing with 11 additions and 2 deletions.
  1. +9 −0 core/src/main/java/hudson/Functions.java
  2. +2 −2 core/src/main/resources/hudson/model/View/cc.xml.jelly
@@ -2043,4 +2043,13 @@ public static boolean isContextMenuVisible(Action a) {
}
}

@Restricted(NoExternalUse.class) // for cc.xml.jelly
public static Collection<TopLevelItem> getCCItems(View v) {
if (Stapler.getCurrentRequest().getParameter("recursive") != null) {
return Items.getAllItems(v.getOwner().getItemGroup(), TopLevelItem.class);
} else {
return v.getItems();
}
}

}
@@ -32,10 +32,10 @@ THE SOFTWARE.
<j:new var="h" className="hudson.Functions" />

<Projects>
<j:forEach var="p" items="${it.items}">
<j:forEach var="p" items="${h.getCCItems(it)}">
<j:set var="lb" value="${p.lastCompletedBuild}"/>
<j:if test="${lb!=null}">
<Project name="${p.displayName}"
<Project name="${p.fullDisplayName}"
activity="${p.isBuilding() ? 'Building' : 'Sleeping'}"
lastBuildStatus="${h.toCCStatus(p)}"
lastBuildLabel="${lb.number}"

0 comments on commit 562a7fc

Please sign in to comment.