Merge "Add value description feature to extended choice parameter"

This commit is contained in:
Jenkins 2016-04-23 15:02:35 +00:00 committed by Gerrit Code Review
commit 12614f13ab
5 changed files with 57 additions and 1 deletions

View File

@ -296,10 +296,16 @@ def extended_choice_param(parser, xml_parent, data):
or multi-select box (optional, default '')
:arg str default-value: used to set the initial selection of the
single-select or multi-select box (optional, default '')
:arg str value-description: comma separated list of value descriptions
for the single select or multi-select box (optional, default '')
:arg str default-property-file: location of property file when default
value needs to come from a property file (optional, default '')
:arg str default-property-key: key for the default property file
(optional, default '')
:arg str description-property-file: location of property file when value
description needs to come from a property file (optional, default '')
:arg str description-property-key: key for the value description
property file (optional, default '')
:arg str multi-select-delimiter: value between selections when the
parameter is a multi-select (optiona, default ',')
@ -323,7 +329,8 @@ def extended_choice_param(parser, xml_parent, data):
False)).lower()
XML.SubElement(pdef, 'defaultValue').text = data.get(
'default-value', '')
XML.SubElement(pdef, 'descriptionPropertyValue').text = data.get(
'value-description', '')
choice = data.get('type', 'single-select')
choicedict = {'single-select': 'PT_SINGLE_SELECT',
'multi-select': 'PT_MULTI_SELECT',
@ -348,6 +355,10 @@ def extended_choice_param(parser, xml_parent, data):
'default-property-file', '')
XML.SubElement(pdef, 'defaultPropertyKey').text = data.get(
'default-property-key', '')
XML.SubElement(pdef, 'descriptionPropertyFile').text = data.get(
'description-property-file', '')
XML.SubElement(pdef, 'descriptionPropertyKey').text = data.get(
'description-property-key', '')
def validating_string_param(parser, xml_parent, data):

View File

@ -11,11 +11,14 @@
<multiSelectDelimiter>,</multiSelectDelimiter>
<quoteValue>false</quoteValue>
<defaultValue/>
<descriptionPropertyValue/>
<type>PT_CHECKBOX</type>
<propertyFile/>
<propertyKey/>
<defaultPropertyFile/>
<defaultPropertyKey/>
<descriptionPropertyFile/>
<descriptionPropertyKey/>
</com.cwctravel.hudson.plugins.extended__choice__parameter.ExtendedChoiceParameterDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>

View File

@ -11,11 +11,14 @@
<multiSelectDelimiter>|</multiSelectDelimiter>
<quoteValue>true</quoteValue>
<defaultValue>foo</defaultValue>
<descriptionPropertyValue/>
<type>PT_MULTI_SELECT</type>
<propertyFile>/home/foo/property.prop</propertyFile>
<propertyKey>key</propertyKey>
<defaultPropertyFile>/home/property.prop</defaultPropertyFile>
<defaultPropertyKey>fookey</defaultPropertyKey>
<descriptionPropertyFile/>
<descriptionPropertyKey/>
</com.cwctravel.hudson.plugins.extended__choice__parameter.ExtendedChoiceParameterDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<properties>
<hudson.model.ParametersDefinitionProperty>
<parameterDefinitions>
<com.cwctravel.hudson.plugins.extended__choice__parameter.ExtendedChoiceParameterDefinition>
<name>OPTIONS</name>
<description>Available options</description>
<value/>
<visibleItemCount>2</visibleItemCount>
<multiSelectDelimiter>,</multiSelectDelimiter>
<quoteValue>false</quoteValue>
<defaultValue>foo</defaultValue>
<descriptionPropertyValue>bar1, bar2, bar3</descriptionPropertyValue>
<type>PT_SINGLE_SELECT</type>
<propertyFile>/home/foo/property.prop</propertyFile>
<propertyKey>key</propertyKey>
<defaultPropertyFile>/home/property.prop</defaultPropertyFile>
<defaultPropertyKey>fookey</defaultPropertyKey>
<descriptionPropertyFile>/home/foo/bar.properties</descriptionPropertyFile>
<descriptionPropertyKey>bar_desc</descriptionPropertyKey>
</com.cwctravel.hudson.plugins.extended__choice__parameter.ExtendedChoiceParameterDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
</properties>
</project>

View File

@ -0,0 +1,13 @@
parameters:
- extended-choice:
name: OPTIONS
description: "Available options"
property-file: /home/foo/property.prop
property-key: key
visible-items: 2
default-value: foo
default-property-file: /home/property.prop
default-property-key: fookey
description-property-file: /home/foo/bar.properties
description-property-key: bar_desc
value-description: bar1, bar2, bar3