Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 1c70c37728ec4df6de01b9d7b39c45019c8115b7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!-- **************************************************************************
#
# Copyright  (c) 2004-2009 Oracle Corporation.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors: 
#
#    Kohsuke Kawaguchi, Romain Seguy
#        
#
#************************************************************************** --> 


<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">
  <st:documentation>
    Generates a listing of the build artifacts.
    Depending on the size of the artifact, this will either produce a list or a link to the directory view.

    <st:attribute name="build" type="hudson.model.Build" use="required">
      Build object for which the artifacts are displayed
    </st:attribute>
    <st:attribute name="caption" use="required">
      Human readable title text
    </st:attribute>
    <st:attribute name="baseURL">
      If the hyperlink to artifacts are at another URL, specify the prefix.
    </st:attribute>
  </st:documentation>
  <j:if test="${!h.isArtifactsPermissionEnabled() or h.isArtifactsPermissionEnabled() and h.hasPermission(it,attrs.permission)}">
    <j:set var="artifacts" value="${build.getArtifactsUpTo(build.TREE_CUTOFF+1)}" />
    <j:if test="${!build.building and !empty(artifacts)}">
      <t:summary icon="package.png">
        <a href="${baseURL}artifact/">${caption}</a>
        <j:choose>
          <j:when test="${size(artifacts) le build.LIST_CUTOFF}">
            <!-- if not too many, just list them -->
            <ul>
              <j:forEach var="f" items="${artifacts}">
                <li>
                  <a href="${baseURL}artifact/${f.href}">${h.xmlEscape(f.displayPath)}</a>
                  <st:nbsp/>
                  <a href="${baseURL}artifact/${f.href}/*fingerprint*/"><img src="${imagesURL}/16x16/fingerprint.png" alt="[fingerprint]" /></a>
                </li>
              </j:forEach>
            </ul>
          </j:when>
          <j:when test="${size(artifacts) le build.TREE_CUTOFF}">
              <!-- otherwise (unless way too many) use a tree view -->
              <l:yui module="treeview"/>
              <link rel="stylesheet" href="${resURL}/scripts/yui/treeview/assets/skins/sam/treeview.css" type="text/css"/>
              <link rel="stylesheet" href="${resURL}/scripts/yui/fonts/fonts-min.css" type="text/css"/>
              <style type="text/css">#artifact-tree td { vertical-align:middle; }</style>
              <div id="artifact-tree"></div>
              <script language="javascript">// &lt;![CDATA[
                YAHOO.util.Event.onContentReady('artifact-tree', function () {
                var artifactTree = new YAHOO.widget.TreeView('artifact-tree');
                var artifactRoot = new YAHOO.widget.TextNode('${h.jsStringEscape('%View')}',
                                                             artifactTree.getRoot(), false);
                <j:forEach var="e" items="${artifacts.getTree().entrySet()}">
                  <j:set var="f" value="${e.key}"/>
                  var ${f.treeNodeId} = new YAHOO.widget.TextNode(
                    '${h.jsStringEscape(f.fileName)}', ${e.value?:'artifactRoot'}, false);
                        <j:if test="${f.href!=null}">
                          <!-- Assign href property instead of passing to constructor above,
                               as constructor does urlencoding, but f.href is already encoded -->
                          ${f.treeNodeId}.href = '${baseURL}artifact/${h.jsStringEscape(f.href)}';
                        </j:if>
                </j:forEach>
                artifactTree.draw();
               });
             // ]]&gt;</script>
          </j:when>
          <!-- otherwise just show link to directory browser -->
        </j:choose>
      </t:summary>
    </j:if>
  </j:if>
</j:jelly>

Back to the top