提交 c46c66a0 编写于 作者: K Kohsuke Kawaguchi

fixed up the form submission mechanism

上级 8df8647e
......@@ -158,12 +158,9 @@ public class MatrixProject extends AbstractProject<MatrixProject,MatrixBuild> im
return sorter;
}
public void setSorter(MatrixConfigurationSorter sorter){
public void setSorter(MatrixConfigurationSorter sorter) throws IOException {
this.sorter = sorter;
}
public List<MatrixConfigurationSorter> getAllSorters(){
return MatrixConfigurationSorter.all();
save();
}
public AxisList getAxes() {
......@@ -590,23 +587,9 @@ public class MatrixProject extends AbstractProject<MatrixProject,MatrixBuild> im
this.axes = new AxisList(newAxes.toList());
// set sorter if any sorter is chosen
String sorterClassName = req.getParameter("sorter");
for(MatrixConfigurationSorter s: MatrixConfigurationSorter.all()){
if(sorterClassName.equals("None")){
sorter = null;
break;
}
if(s.getClass().getName().equals(sorterClassName)){
if(s.isSortingPossible(axes)){
sorter = s;
}
else{
sorter = null;
throw new FormException(s.getErrorFormMessage(),"sorter.getDisplayName");
}
break;
}
}
MatrixConfigurationSorter s = req.bindJSON(MatrixConfigurationSorter.class,json.optJSONObject("sorter"));
s.validate(this);
setSorter(s);
runSequentially = json.has("runSequentially");
......@@ -672,6 +655,10 @@ public class MatrixProject extends AbstractProject<MatrixProject,MatrixBuild> im
}
return r;
}
public List<MatrixConfigurationSorterDescriptor> getSorterDescriptors() {
return MatrixConfigurationSorterDescriptor.all();
}
}
private static final Logger LOGGER = Logger.getLogger(MatrixProject.class.getName());
......
......@@ -59,15 +59,8 @@ THE SOFTWARE.
addCaption="${%Add axis}"/>
</f:block>
<j:if test="${(it.allSorters.size() > 0)}">
<f:entry title="Sort axis">
<select name="sorter">
<f:option selected="${it.sorter==null}" value="${none}">None</f:option>
<j:forEach var="inst" items="${it.allSorters}">
<f:option selected="${inst.class.isInstance(it.sorter)}" value="${inst.class.name}">${inst.displayName}</f:option>
</j:forEach>
</select>
</f:entry>
<j:if test="${(descriptor.sorterDescriptors().size() > 0)}">
<f:dropdownDescriptorSelector title="${%Execution order of builds}" field="sorter" />
</j:if>
<f:optionalBlock field="runSequentially" title="${%Run each configuration sequentially}"/>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册