From 562a7fc2d3c7eb3828bfbff4412db7fe48304113 Mon Sep 17 00:00:00 2001 From: Devin Nusbaum Date: Fri, 13 Oct 2017 05:40:56 -0400 Subject: [PATCH] [JENKINS-36282] Add support to cc.xml for exporting jobs in folders recursively (#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 990ec3ebfb0838ec3b1b421dfe5d6518cbd79784. * Move logic in jelly view to static method --- core/src/main/java/hudson/Functions.java | 9 +++++++++ core/src/main/resources/hudson/model/View/cc.xml.jelly | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index e696d40f29..79e95e9367 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -2043,4 +2043,13 @@ public class Functions { } } + @Restricted(NoExternalUse.class) // for cc.xml.jelly + public static Collection getCCItems(View v) { + if (Stapler.getCurrentRequest().getParameter("recursive") != null) { + return Items.getAllItems(v.getOwner().getItemGroup(), TopLevelItem.class); + } else { + return v.getItems(); + } + } + } diff --git a/core/src/main/resources/hudson/model/View/cc.xml.jelly b/core/src/main/resources/hudson/model/View/cc.xml.jelly index 46253ec93d..b83ec111d1 100644 --- a/core/src/main/resources/hudson/model/View/cc.xml.jelly +++ b/core/src/main/resources/hudson/model/View/cc.xml.jelly @@ -32,10 +32,10 @@ THE SOFTWARE. - + -