提交 600b1f07 编写于 作者: J Jesse Glick

Simplified ParametersDefinitionProperty by extending OptionalJobProperty.

上级 53c86ec8
......@@ -38,12 +38,14 @@ import javax.annotation.CheckForNull;
import javax.servlet.ServletException;
import static javax.servlet.http.HttpServletResponse.SC_CREATED;
import jenkins.model.Jenkins;
import jenkins.model.OptionalJobProperty;
import jenkins.model.ParameterizedJobMixIn;
import jenkins.util.TimeDuration;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
......@@ -60,11 +62,12 @@ import org.kohsuke.stapler.export.ExportedBean;
* The builds also need a {@code sidepanel.jelly}.
*/
@ExportedBean(defaultVisibility=2)
public class ParametersDefinitionProperty extends JobProperty<Job<?, ?>>
public class ParametersDefinitionProperty extends OptionalJobProperty<Job<?, ?>>
implements Action {
private final List<ParameterDefinition> parameterDefinitions;
@DataBoundConstructor
public ParametersDefinitionProperty(List<ParameterDefinition> parameterDefinitions) {
this.parameterDefinitions = parameterDefinitions;
}
......@@ -203,33 +206,12 @@ public class ParametersDefinitionProperty extends JobProperty<Job<?, ?>>
}
@Extension
public static class DescriptorImpl extends JobPropertyDescriptor {
public static class DescriptorImpl extends OptionalJobPropertyDescriptor {
@Override
public boolean isApplicable(Class<? extends Job> jobType) {
return ParameterizedJobMixIn.ParameterizedJob.class.isAssignableFrom(jobType);
}
@Override
public JobProperty<?> newInstance(StaplerRequest req,
JSONObject formData) throws FormException {
if (formData.isNullObject()) {
return null;
}
JSONObject parameterized = formData.getJSONObject("parameterized");
if (parameterized.isNullObject()) {
return null;
}
List<ParameterDefinition> parameterDefinitions = Descriptor.newInstancesFromHeteroList(
req, parameterized, "parameter", ParameterDefinition.all());
if(parameterDefinitions.isEmpty())
return null;
return new ParametersDefinitionProperty(parameterDefinitions);
}
@Override
public String getDisplayName() {
return Messages.ParametersDefinitionProperty_DisplayName();
......
......@@ -319,7 +319,7 @@ Permalink.LastSuccessfulBuild=Last successful build
Permalink.LastFailedBuild=Last failed build
ParameterAction.DisplayName=Parameters
ParametersDefinitionProperty.DisplayName=Parameters
ParametersDefinitionProperty.DisplayName=This build is parameterized
StringParameterDefinition.DisplayName=String Parameter
TextParameterDefinition.DisplayName=Text Parameter
FileParameterDefinition.DisplayName=File Parameter
......
ParametersDefinitionProperty.DisplayName=\u0422\u043E\u0437\u0438 \u0431\u0438\u043B\u0434 \u0435 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0438\u0437\u0438\u0440\u0430\u043D
......@@ -237,3 +237,4 @@ LoadStatistics.Legends.BusyExecutors=Optagede afviklere
HealthReport.EmptyString=
MultiStageTimeSeries.EMPTY_STRING=
ManageJenkinsAction.DisplayName=Bestyr Jenkins
ParametersDefinitionProperty.DisplayName=Dette byg er parameteriseret
......@@ -304,3 +304,4 @@ Cause.RemoteCause.ShortDescription=Gestartet durch entfernten Rechner {0}
Cause.RemoteCause.ShortDescriptionWithNote=Gestartet durch entfernten Rechner {0} mit Hinweis: {1}
ManageJenkinsAction.DisplayName=Jenkins verwalten
ParametersDefinitionProperty.DisplayName=Dieser Build ist parametrisiert.
ParametersDefinitionProperty.DisplayName=This build is parameterised
......@@ -311,3 +311,4 @@ UpdateCenter.DownloadButNotActivated=Descarga correcta. Se activar
Computer.ConnectPermission.Description=Este permiso permite que los usuarios puedan conectar nodos o marcarlos como activos.
BallColor.NotBuilt=Sin ejecutar.
AbstractBuild_Building=Ejecutando.
ParametersDefinitionProperty.DisplayName=Esta ejecucin debe parametrizarse
......@@ -192,3 +192,4 @@ MyViewsProperty.DisplayName=Mes vues
MyViewsProperty.GlobalAction.DisplayName=Mes vues
ManageJenkinsAction.DisplayName=Administrer Jenkins
ParametersDefinitionProperty.DisplayName=Ce build a des paramètres
ParametersDefinitionProperty.DisplayName=\u05D1\u05E0\u05D9\u05D4 \u05DE\u05DB\u05D9\u05DC\u05D4 \u05DE\u05E9\u05EA\u05E0\u05D9\u05DD
ManageJenkinsAction.DisplayName=Jenkins Kezel\u00E9se
ParametersDefinitionProperty.DisplayName=Hozz\u00E1ad
......@@ -310,3 +310,4 @@ CLI.cancel-quiet-down.shortDescription=Cancel the effect of the "quiet-down" com
CLI.reload-configuration.shortDescription=Discard all the loaded data in memory and reload everything from file system. Useful when you modified config files directly on disk.
BuildAuthorizationToken.InvalidTokenProvided=Invalid token provided.
ParametersDefinitionProperty.DisplayName=Questa build \u00E8 parametrizzata
......@@ -332,3 +332,4 @@ Jenkins.CheckDisplayName.NameNotUniqueWarning=\u8868\u793a\u7528\u30d7\u30ed\u30
Jenkins.CheckDisplayName.DisplayNameNotUniqueWarning=\u8868\u793a\u7528\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d "{0}" \u306f\u4ed6\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001 \u533a\u5225\u3067\u304d\u306a\u3044\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002
Jenkins.NotAllowedName="{0}" \u306f\u8a31\u53ef\u3055\u308c\u306a\u3044\u540d\u524d\u3067\u3059\u3002
ParametersDefinitionProperty.DisplayName=\u30d3\u30eb\u30c9\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u5316
ManageJenkinsAction.DisplayName=Jenkins \uAD00\uB9AC
ParametersDefinitionProperty.DisplayName=\uC774 \uBE4C\uB4DC\uB294 \uB9E4\uAC1C\uBCC0\uC218\uAC00 \uC788\uC2B5\uB2C8\uB2E4
ParametersDefinitionProperty.DisplayName=\u0160is darbas yra parametrizuotas
ManageJenkinsAction.DisplayName=Konfigurer Jenkins
ManageJenkinsAction.DisplayName=Konfigurer Jenkins
ParametersDefinitionProperty.DisplayName=Denne build har parametre
......@@ -101,3 +101,4 @@ Permalink.LastStableBuild=Laatste stabiele bouwpoging
Permalink.LastSuccessfulBuild=Laatste succesvolle bouwpoging
Permalink.LastFailedBuild=Laatst gefaalde bouwpoging
ManageJenkinsAction.DisplayName=Beheer Jenkins
ParametersDefinitionProperty.DisplayName=Deze bouwpoging is geparametriseerd
ParametersDefinitionProperty.DisplayName=Ten build jest sparametryzowany
......@@ -512,3 +512,4 @@ Item.CONFIGURE.description=Mudar a configura\u00e7\u00e3o de um job.
Item.DELETE.description=Excuir um job.
HealthReport.EmptyString=
MultiStageTimeSeries.EMPTY_STRING=
ParametersDefinitionProperty.DisplayName=Este build \u00E9 parametrizado
ParametersDefinitionProperty.DisplayName=Acest build este parametrizat
......@@ -101,3 +101,4 @@ Permalink.LastStableBuild=\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f
Permalink.LastSuccessfulBuild=\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430
Permalink.LastFailedBuild=\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0432\u0448\u0430\u044f\u0441\u044f \u0441\u0431\u043e\u0440\u043a\u0430
ManageJenkinsAction.DisplayName=\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c Jenkins
ParametersDefinitionProperty.DisplayName=\u042d\u0442\u043e - \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430
ParametersDefinitionProperty.DisplayName=Toto zostavenie je parametrizovan\u00E9
......@@ -4,3 +4,4 @@ AbstractProject.Pronoun=Projekt
Job.Pronoun=Projekt
ManageJenkinsAction.DisplayName=Hantera Jenkins
ParametersDefinitionProperty.DisplayName=Detta bygge \u00E4r parametriserat
......@@ -102,3 +102,4 @@ Permalink.LastStableBuild=Son stabil yap\u0131land\u0131rma
Permalink.LastSuccessfulBuild=Son ba\u015far\u0131l\u0131 yap\u0131land\u0131rma
Permalink.LastFailedBuild=Son ba\u015far\u0131s\u0131z yap\u0131land\u0131rma
ManageJenkinsAction.DisplayName=Jenkins''\u0131 Y\u00f6net
ParametersDefinitionProperty.DisplayName=Bu yap\u0131land\u0131rma parametrele\u015ftirilmi\u015ftir.
ParametersDefinitionProperty.DisplayName=\u0426\u044F \u0431\u0443\u0434\u043E\u0432\u0430 \u043C\u0430\u0454 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0438
......@@ -269,3 +269,4 @@ CLI.quiet-down.shortDescription=Quiet down Jenkins, in preparation for a restart
CLI.cancel-quiet-down.shortDescription=Cancel the effect of the "quiet-down" command.
CLI.reload-configuration.shortDescription=Discard all the loaded data in memory and reload everything from file system. Useful when you modified config files directly on disk.
ManageJenkinsAction.DisplayName=\u7cfb\u7edf\u7ba1\u7406
ParametersDefinitionProperty.DisplayName=\u53C2\u6570\u5316\u6784\u5EFA\u8FC7\u7A0B
......@@ -325,3 +325,4 @@ Jenkins.CheckDisplayName.NameNotUniqueWarning=\u5df2\u7d93\u6709\u4f5c\u696d\u53
Jenkins.CheckDisplayName.DisplayNameNotUniqueWarning=\u5df2\u7d93\u6709\u4f5c\u696d\u7684\u986f\u793a\u540d\u7a31\u662f "{0}"\uff0c\u53ef\u80fd\u6703\u9020\u6210\u6df7\u6dc6\u53ca\u5ef6\u9072\u3002
Jenkins.NotAllowedName="{0}" \u4e26\u4e0d\u662f\u53ef\u4ee5\u4f7f\u7528\u7684\u540d\u7a31
ParametersDefinitionProperty.DisplayName=\u53c3\u6578\u5316\u5efa\u7f6e
......@@ -23,15 +23,8 @@ THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define"
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"
xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project">
<f:optionalBlock name="parameterized" title="${%This build is parameterized}"
checked="${instance!=null}" help="/help/project-config/parameterized-build.html">
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form">
<f:nested>
<f:hetero-list name="parameter" hasHeader="true"
descriptors="${h.getParameterDescriptors()}" items="${instance.parameterDefinitions}"
addCaption="${%Add Parameter}" />
<f:repeatableHeteroProperty field="parameterDefinitions" hasHeader="true" addCaption="${%Add Parameter}"/>
</f:nested>
</f:optionalBlock>
</j:jelly>
\ No newline at end of file
</j:jelly>
# The MIT License
#
# Copyright (c) 2004-2010, Sun Microsystems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
Add\ Parameter=\u0414\u043E\u0431\u0430\u0432\u0438 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u044A\u0440
......@@ -20,5 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
This\ build\ is\ parameterized=Esta ejecución debe parametrizarse
Add\ Parameter=Añadir un parámetro
......@@ -20,5 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
This\ build\ is\ parameterized=Ce build a des paramètres
Add\ Parameter=Ajouter un paramètre
# This file is under the MIT License by authors
Add\ Parameter=\u05D4\u05D5\u05E1\u05E3 \u05DE\u05E9\u05EA\u05E0\u05D4
This\ build\ is\ parameterized=\u05D1\u05E0\u05D9\u05D4 \u05DE\u05DB\u05D9\u05DC\u05D4 \u05DE\u05E9\u05EA\u05E0\u05D9\u05DD
# This file is under the MIT License by authors
Add\ Parameter=Param\u00E9ter hozz\u00E1ad\u00E1sa
This\ build\ is\ parameterized=Hozz\u00E1ad
......@@ -20,5 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
This\ build\ is\ parameterized=\u30d3\u30eb\u30c9\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u5316
Add\ Parameter=\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u8ffd\u52a0
\ No newline at end of file
Add\ Parameter=\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u8ffd\u52a0
# This file is under the MIT License by authors
Add\ Parameter=\uB9E4\uAC1C\uBCC0\uC218 \uCD94\uAC00
This\ build\ is\ parameterized=\uC774 \uBE4C\uB4DC\uB294 \uB9E4\uAC1C\uBCC0\uC218\uAC00 \uC788\uC2B5\uB2C8\uB2E4
# This file is under the MIT License by authors
Add\ Parameter=Prid\u0117ti parametr\u0105
This\ build\ is\ parameterized=\u0160is darbas yra parametrizuotas
# This file is under the MIT License by authors
Add\ Parameter=Instelling toevoegen
This\ build\ is\ parameterized=Deze bouwpoging is geparametriseerd
......@@ -20,5 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
This\ build\ is\ parameterized=Este build \u00E9 parametrizado
Add\ Parameter=Adicionar par\u00e2metro
# This file is under the MIT License by authors
Add\ Parameter=Adauga Parametru
This\ build\ is\ parameterized=Acest build este parametrizat
# The MIT License
#
# Copyright (c) 2004-2010, Sun Microsystems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
Add\ Parameter=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440
# This file is under the MIT License by authors
Add\ Parameter=Pridaj parameter
This\ build\ is\ parameterized=Toto zostavenie je parametrizovan\u00E9
......@@ -21,4 +21,3 @@
# THE SOFTWARE.
Add\ Parameter=L\u00E4gg till parameter
This\ build\ is\ parameterized=Detta bygge \u00E4r parametriserat
......@@ -20,5 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
This\ build\ is\ parameterized=Bu yap\u0131land\u0131rma parametrele\u015ftirilmi\u015ftir.
Add\ Parameter=Parametre ekle
# This file is under the MIT License by authors
Add\ Parameter=\u0414\u043E\u0434\u0430\u0442\u0438 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440
This\ build\ is\ parameterized=\u0426\u044F \u0431\u0443\u0434\u043E\u0432\u0430 \u043C\u0430\u0454 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0438
......@@ -21,4 +21,3 @@
# THE SOFTWARE.
Add\ Parameter=\u6DFB\u52A0\u53C2\u6570
This\ build\ is\ parameterized=\u53C2\u6570\u5316\u6784\u5EFA\u8FC7\u7A0B
......@@ -20,5 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
This\ build\ is\ parameterized=\u53c3\u6578\u5316\u5efa\u7f6e
Add\ Parameter=\u65B0\u589E\u53C3\u6578
# The MIT License
#
# Copyright (c) 2004-2010, Sun Microsystems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
Add\ Parameter=\u0414\u043E\u0431\u0430\u0432\u0438 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u044A\u0440
This\ build\ is\ parameterized=\u0422\u043E\u0437\u0438 \u0431\u0438\u043B\u0434 \u0435 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0438\u0437\u0438\u0440\u0430\u043D
# This file is under the MIT License by authors
This\ build\ is\ parameterized=This build is parameterised
# The MIT License
#
# Copyright (c) 2004-2010, Sun Microsystems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
Add\ Parameter=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440
This\ build\ is\ parameterized=\u042d\u0442\u043e - \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册