aboutsummaryrefslogtreecommitdiffstats
blob: 3fce557341d4c3e66c92b22bd4c6d745e26e1b76 (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
44
45
46
47
48
49
50
51
52
53
54
<!-- **************************************************************************
#
# 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:attribute name="projectPropertyClass">
            ProjectProperty class that will be used for creating project property instance
            based on hudson.util.CascadingUtil.getProjectProperty method. Default value is
            org.hudsonci.model.project.property.ExternalProjectProperty.class.
        </st:attribute>
    </st:documentation>

    <j:set var="targetType" value="${it.class}"/>
    <j:if test="${attrs.projectPropertyClass==null}">
        <j:set var="attrs.projectPropertyClass"
               value="${org.hudsonci.model.project.property.ExternalProjectProperty.class}"/>
    </j:if>
    <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.getProjectProperty(it, descriptor.jsonSafeClassName, attrs.projectPropertyClass)}"/>
                <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>