Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
e6b90c74
J
jenkins
项目概览
xxadev
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e6b90c74
编写于
3月 31, 2011
作者:
K
Kohsuke Kawaguchi
提交者:
Stephen Connolly
4月 04, 2011
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- modified to use <descriptorList> for better reuse&consistency.
- support invisible JobProperty
上级
5e3c8872
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
26 deletion
+22
-26
core/src/main/java/hudson/model/Job.java
core/src/main/java/hudson/model/Job.java
+9
-13
core/src/main/java/hudson/model/JobProperty.java
core/src/main/java/hudson/model/JobProperty.java
+8
-1
core/src/main/resources/hudson/model/Job/configure.jelly
core/src/main/resources/hudson/model/Job/configure.jelly
+1
-11
core/src/main/resources/lib/form/descriptorList.jelly
core/src/main/resources/lib/form/descriptorList.jelly
+4
-1
未找到文件。
core/src/main/java/hudson/model/Job.java
浏览文件 @
e6b90c74
...
...
@@ -26,6 +26,7 @@ package hudson.model;
import
static
javax
.
servlet
.
http
.
HttpServletResponse
.
SC_BAD_REQUEST
;
import
static
javax
.
servlet
.
http
.
HttpServletResponse
.
SC_NO_CONTENT
;
import
com.google.common.collect.Iterables
;
import
com.infradna.tool.bridge_method_injector.WithBridgeMethods
;
import
hudson.ExtensionPoint
;
import
hudson.PermalinkList
;
...
...
@@ -46,6 +47,7 @@ import hudson.util.ChartUtil;
import
hudson.util.ColorPalette
;
import
hudson.util.CopyOnWriteList
;
import
hudson.util.DataSetBuilder
;
import
hudson.util.DescribableList
;
import
hudson.util.IOException2
;
import
hudson.util.RunList
;
import
hudson.util.ShiftedCategoryAxis
;
...
...
@@ -936,25 +938,19 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
keepDependencies
=
req
.
getParameter
(
"keepDependencies"
)
!=
null
;
try
{
properties
.
clear
();
JSONObject
json
=
req
.
getSubmittedForm
();
if
(
req
.
getParameter
(
"logrotate"
)
!=
null
)
logRotator
=
LogRotator
.
DESCRIPTOR
.
newInstance
(
req
,
json
.
getJSONObject
(
"logrotate"
));
else
logRotator
=
null
;
int
i
=
0
;
for
(
JobPropertyDescriptor
d
:
JobPropertyDescriptor
.
getPropertyDescriptors
(
Job
.
this
.
getClass
()))
{
String
name
=
"jobProperty"
+
(
i
++);
JSONObject
config
=
json
.
getJSONObject
(
name
);
JobProperty
prop
=
d
.
newInstance
(
req
,
config
);
if
(
prop
!=
null
)
{
prop
.
setOwner
(
this
);
properties
.
add
(
prop
);
}
DescribableList
<
JobProperty
<?>,
JobPropertyDescriptor
>
t
=
new
DescribableList
<
JobProperty
<?>,
JobPropertyDescriptor
>(
NOOP
,
getAllProperties
());
t
.
rebuild
(
req
,
json
.
optJSONObject
(
"properties"
),
JobPropertyDescriptor
.
getPropertyDescriptors
(
Job
.
this
.
getClass
()));
properties
.
clear
();
for
(
JobProperty
p
:
t
)
{
p
.
setOwner
(
this
);
properties
.
add
(
p
);
}
submit
(
req
,
rsp
);
...
...
core/src/main/java/hudson/model/JobProperty.java
浏览文件 @
e6b90c74
...
...
@@ -26,6 +26,7 @@ package hudson.model;
import
hudson.ExtensionPoint
;
import
hudson.Launcher
;
import
hudson.Plugin
;
import
hudson.model.Descriptor.FormException
;
import
hudson.model.queue.SubTask
;
import
hudson.tasks.BuildStep
;
import
hudson.tasks.Builder
;
...
...
@@ -36,6 +37,8 @@ import java.io.IOException;
import
java.util.Collection
;
import
java.util.Collections
;
import
net.sf.json.JSONObject
;
import
org.kohsuke.stapler.StaplerRequest
;
import
org.kohsuke.stapler.export.ExportedBean
;
/**
...
...
@@ -69,7 +72,7 @@ import org.kohsuke.stapler.export.ExportedBean;
* @since 1.72
*/
@ExportedBean
public
abstract
class
JobProperty
<
J
extends
Job
<?,?>>
implements
Describable
<
JobProperty
<?>>,
BuildStep
,
ExtensionPoint
{
public
abstract
class
JobProperty
<
J
extends
Job
<?,?>>
implements
Reconfigurable
Describable
<
JobProperty
<?>>,
BuildStep
,
ExtensionPoint
{
/**
* The {@link Job} object that owns this property.
* This value will be set by the Hudson code.
...
...
@@ -169,6 +172,10 @@ public abstract class JobProperty<J extends Job<?,?>> implements Describable<Job
return
Collections
.
emptyList
();
}
public
JobProperty
<?>
reconfigure
(
StaplerRequest
req
,
JSONObject
form
)
throws
FormException
{
return
form
==
null
?
null
:
getDescriptor
().
newInstance
(
req
,
form
);
}
/**
* Contributes {@link SubTask}s to {@link AbstractProject#getSubTasks()}
*
...
...
core/src/main/resources/hudson/model/Job/configure.jelly
浏览文件 @
e6b90c74
...
...
@@ -53,17 +53,7 @@ THE SOFTWARE.
</j:if>
<!-- job property configurations. This should have been <f:descriptorList> -->
<j:set var="instances" value="${it.properties}" />
<j:forEach var="d" items="${h.getJobPropertyDescriptors(it.getClass())}" varStatus="loop">
<j:scope>
<j:set var="descriptor" value="${d}" />
<j:set var="instance" value="${instances[d]}" />
<f:rowSet name="jobProperty${loop.index}">
<st:include from="${d}" page="${d.configPage}" optional="true"/>
</f:rowSet>
</j:scope>
</j:forEach>
<f:descriptorList field="properties" descriptors="${h.getJobPropertyDescriptors(it.getClass())}" forceRowSet="true" />
<!-- additional entries from derived classes -->
<st:include page="configure-entries.jelly" />
...
...
core/src/main/resources/lib/form/descriptorList.jelly
浏览文件 @
e6b90c74
...
...
@@ -50,6 +50,9 @@ THE SOFTWARE.
the type for which descriptors will be configured.
default to ${it.class}
</st:attribute>
<st:attribute name="forceRowSet">
If specified, instead of a sequence of <f:optionalBlock>s, draw a sequence of <rowSet>s.
</st:attribute>
</st:documentation>
<j:if test="${attrs.field==null}">
...
...
@@ -73,7 +76,7 @@ THE SOFTWARE.
<d:invokeBody />
<j:forEach var="d" items="${descriptors}">
<f:optionalBlock name="${d.jsonSafeClassName}" help="${d.helpFile}"
title="${d.displayName}" checked="${instances.get(d)!=null}">
title="${
attrs.forceRowSet!=null?null:
d.displayName}" checked="${instances.get(d)!=null}">
<j:set var="descriptor" value="${d}" />
<j:set var="instance" value="${instances.get(d)}" />
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录