aboutsummaryrefslogtreecommitdiffstats
blob: b15b84573496246f24a856bc7baa046a9983bcb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!-- **************************************************************************
#
# Copyright  (c) 2011 Oracle Corporation.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
#
#    Nikita Levyankov
#
#
#************************************************************************** -->
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:f="/lib/form">
  <st:documentation>
    Generates config pages from a list of Descriptors into a section. Tag is based on cascading functionality.
    <st:attribute name="title">
      Human readable title of the section to be rendered in HTML.
    </st:attribute>
    <st:attribute name="descriptors" use="required">
      hudson.model.Descriptor collection whose configuration page is rendered.
    </st:attribute>
  </st:documentation>

  <j:set var="targetType" value="${it.class}"/>
  <j:if test="${!empty(descriptors) or context['org.apache.commons.jelly.body']!=null}">
    <f:section title="${attrs.title}" name="${attrs.name}">
      <d:invokeBody/>
      <j:forEach var="descriptor" items="${descriptors}">
        <j:set var="instanceProperty" value="${cu.getExternalProjectProperty(it, descriptor.jsonSafeClassName)}"/>
        <j:set var="instance" value="${instanceProperty.getValue()}"/>
        <f:optionalBlock name="${descriptor.jsonSafeClassName}" help="${descriptor.helpFile}"
                         title="${descriptor.displayName}" checked="${instance!=null}"
                         resetUrl="${jobUrl}/resetProjectProperty?propertyName=${descriptor.jsonSafeClassName}"
                         isPropertyOverridden="${instanceProperty.isOverridden()}">
          <st:include from="${descriptor}" page="${descriptor.configPage}" optional="true"/>
        </f:optionalBlock>
      </j:forEach>
    </f:section>
  </j:if>
</j:jelly>