Skip to content

Commit

Permalink
[JENKINS-36282] Add support to cc.xml for exporting jobs in folders r…
Browse files Browse the repository at this point in the history
…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 562a7fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions core/src/main/java/hudson/Functions.java
Expand Up @@ -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();
}
}

}
4 changes: 2 additions & 2 deletions core/src/main/resources/hudson/model/View/cc.xml.jelly
Expand Up @@ -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}"
Expand Down

0 comments on commit 562a7fc

Please sign in to comment.