Skip to content

Commit

Permalink
[FIXED JENKINS-23561] Copied matrix.jelly from Jenkins 1.509 (/lib/hu…
Browse files Browse the repository at this point in the history
…dson/project/matrix.jelly).
  • Loading branch information
ikedam committed Jun 29, 2014
1 parent 026c0c9 commit ecb95e5
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 2 deletions.
Expand Up @@ -13,7 +13,7 @@ l = namespace(LayoutTagLib)
t = namespace("/lib/hudson")
st = namespace("jelly:stapler")
f = namespace("lib/form")
nsProject = namespace("/lib/hudson/project")
nsProject = namespace("/hudson/plugins/matrix_configuration_parameter/taglib")


MatrixProject project = request.findAncestorObject(MatrixProject.class);
Expand Down
Expand Up @@ -12,7 +12,7 @@ l = namespace(LayoutTagLib)
t = namespace("/lib/hudson")
st = namespace("jelly:stapler")
f = namespace("lib/form")
nsProject = namespace("/lib/hudson/project")
nsProject = namespace("/hudson/plugins/matrix_configuration_parameter/taglib")


MatrixProject project = request.findAncestorObject(MatrixProject.class);
Expand Down
@@ -0,0 +1,103 @@
<!--
The MIT License
Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Yahoo! 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.
-->

<!--
Generate configuration matrix and invoke body with 'p' as the instance of T
(of Layouter<T>)
Used by Matrix* classes
-->
<?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">
<st:documentation>
Generate configuration matrix and invoke body with 'p' as the instance of T
(of Layouter&lt;T>)

<st:attribute name="autoRefresh">
If specified, the content of the matrix will be automatically updated via AJAX.
(This happens by requesting URL "./ajaxMatrix", so the caller needs "ajaxMatrix.jelly"
to serve this request.)
</st:attribute>
</st:documentation>

<j:set var="o" value="${it.layouter}"/>
<div id='matrix'>
<j:choose>
<!-- Optimized case when there's only one dimension to the axis (or zero dimension) -->
<j:when test="${empty(o.x) and empty(o.y)}">
<h2>${%Configurations}</h2>
<j:forEach var="p" items="${o.rows[0][0]}">
<d:invokeBody />
<st:nbsp />
</j:forEach>
</j:when>
<j:otherwise>
<table id="configuration-matrix">
<!-- X-axis -->
<j:forEach var="x" items="${o.x}" varStatus="loop">
<tr class="matrix-row">
<!-- space for Y-axis -->
<j:if test="${!empty(o.y)}">
<td id="matrix-title" colspan="${size(o.y)}">${%Configuration Matrix}</td>
</j:if>
<j:forEach begin="1" end="${o.repeatX(loop.index)}">
<j:forEach var="v" items="${x.values}">
<td class="matrix-header" colspan="${o.width(loop.index)}">${v}</td>
</j:forEach>
</j:forEach>
</tr>
</j:forEach>

<!-- Y-axis -->
<j:forEach var="r" items="${o.rows}">
<tr>
<j:forEach var="y" items="${o.y}" varStatus="loop">
<j:if test="${r.drawYHeader(loop.index)!=null}">
<td class="matrix-leftcolumn" rowspan="${o.height(loop.index)}">${r.drawYHeader(loop.index)}</td>
</j:if>
</j:forEach>

<j:forEach var="c" items="${r}">
<td class="matrix-cell">
<j:choose>
<j:forEach var="p" items="${c}">
<div>
<d:invokeBody />
</div>
</j:forEach>
</j:choose>
</td>
</j:forEach>
</tr>
</j:forEach>
</table>
</j:otherwise>
</j:choose>
<j:if test="${ajax==null and attrs.autoRefresh and !h.isAutoRefresh(request)}">
<script defer="defer">
refreshPart('matrix',"./ajaxMatrix");
</script>
</j:if>
</div>
</j:jelly>
Empty file.

0 comments on commit ecb95e5

Please sign in to comment.