Changeset 4840


Ignore:
Timestamp:
Mar 24, 2009, 3:55:03 PM (15 years ago)
Author:
Martin Svensson
Message:

References #1240. The functionallity in the webclient is done. The documentation is not completely updated yet.

Location:
trunk
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/src/docbook/userdoc/webclient.xml

    r4771 r4840  
    22382238      function you can get an overview of all hybridizations,
    22392239      extracts, samples, annotations, raw data sets, etc. that are
    2240       related to a given item. The overview includes a lot of checks
    2241       that validates the data for missing or possibly incorrect information.
     2240      related to a given item. In the overview you can validate
     2241      the data to find possibly missing or incorrect information.
    22422242    </para>
    22432243   
     
    22702270      <listitem>
    22712271        <para>
    2272         To the left is a tree displaying all items
    2273         that are related to the current item.
     2272        To the left is a tree displaying items that are related
     2273        to the current item. The tree is loaded gradually when
     2274        you click your way through the sublevels.
     2275        The only exception is when a validation has been done,
     2276        in this case the whole tree is loaded through the validation-process.               
    22742277        </para>
    22752278      </listitem>
     
    22792282        The lower right shows a list of warnings and error
    22802283        messages that was found when validating the data.
     2284        This section is empty if no validation has been done.
     2285        Click on <guibutton>Validate</guibutton> to validate the data.       
    22812286        <nohelp>
    2282         In the example you can see that we have failed to
    2283         specify a value for the <guilabel>Temperature</guilabel>
    2284         protocol parameter for one of the samples.
    2285         </nohelp>
     2287        In the example you can see that we failed to assign biosource to sample
     2288        <guilabel>Sample A.ref</guilabel> and
     2289        protocol and hardware to array batch <guilabel>Affymetrix batch A</guilabel>.
     2290        </nohelp> 
    22862291        </para>
    22872292      </listitem>
     
    22902295        <para>
    22912296          The upper right shows information about the
    2292           currently selected item in the tree. This part also
    2293           contains more information errors or warnings for this
    2294           item. It may also present you with one or more suggestions
     2297          currently selected item in the tree. This part will also
     2298          contain more information about errors or warnings for this
     2299          item, but only if a validation has been done.
     2300          It may also present you with one or more suggestions
    22952301          about how to fix the problem and with a link that
    22962302          takes you to the most probable location where you can fix
     
    25772583        title="How to fix validation failures">
    25782584       
    2579         <para>
     2585        <para>       
    25802586        The overview includes a function that allows
    25812587        you to quickly fix most of the problems found during the
  • trunk/www/common/overview/ajax.jsp

    r4830 r4840  
    3030  import="net.sf.basedb.clients.web.Base"
    3131  import="net.sf.basedb.clients.web.WebException"
    32   import="net.sf.basedb.clients.web.util.HTML"
    3332%>
    3433<%
     
    4645    dc = sc.newDbControl();
    4746    GenericOverview overview = OverviewUtil.getCurrentOverview(sc);
    48     Node parent = overview.getNode("N"+nodeId);
     47    Node parent = overview.getNode(nodeId);
    4948    overview.expand(dc, parent, false);
    5049    overview.updateFailureCountOnNodes();
    5150    if (parent != null && parent.numChildren() > 0)
    5251    {
    53       String parentIconSuffix = "";
    54       String parentTooltip = "";
    55       int errors = parent.getNumErrors();
    56       int warnings = parent.getNumWarnings();
    57       if (errors > 0)
    58       {
    59         parentIconSuffix = "Error";
    60         parentTooltip = errors + " error(s) on this item";
    61       }
    62       else if (warnings > 0)
    63       {     
    64         parentIconSuffix = "Warning";
    65         parentTooltip = warnings + " warning(s) on this item";
    66       }
    6752      for (Node n : parent.getChildren())
    6853      {
     
    7762          folderIcon = "Annotation";
    7863        }       
    79         String tooltip = "";
    8064        int numChildren = n.getChildren() == null ?
    8165          0 : n.getChildren().size();
    8266        %>begin
    8367id  <%=n.getId()%>
    84 title <%=HTML.javaScriptEncode(n.getTitle()) + (n.getNodeType() == Node.Type.FOLDER ? " (" + numChildren + ")" : "")%>
    85 hashCode  <%=n.hashCode()%>
     68title <%=n.getTitle() + (n.getNodeType() == Node.Type.FOLDER ? " (" + numChildren + ")" : "")%>
    8669folderIcon  <%=folderIcon %>
    87 parentIconSuffix  <%=parentIconSuffix%>
    88 tooltip <%=HTML.javaScriptEncode(tooltip)%>
    89 parentTooltip <%=HTML.javaScriptEncode(parentTooltip)%>
    9070end
    9171<%
  • trunk/www/common/overview/failures.jsp

    r4767 r4840  
    5858  GenericOverview overview = OverviewUtil.getCurrentOverview(sc);
    5959  ValidationOptions options = overview.getValidationOptions();
    60 
     60  Boolean showFailures = Values.getBoolean(request.getParameter("show_failures"), false);
    6161  List<Failure> failures = overview.getFailures();
    6262  if (failures == null) failures = new LinkedList<Failure>();
     
    130130    <base:body>
    131131      <div class="summary">
    132         <b>
     132      <b>
     133      <%
     134      if (showFailures)
     135      {
     136        %>
    133137        <%=errors.size() %> error(s),
    134138        <%=warnings.size()%> warning(s)
    135         </b>
     139      <%
     140      }       
     141      else
     142      {
     143        %>
     144        <i>Item-tree not validated</i>
     145        <%
     146      }
     147      %>
     148      </b>
    136149      </div>
    137       <br>
    138       <div class="joust">
    139       <table border="0" cellspacing="0" cellpadding="0" width="100%">
    140150      <%
    141       int index = 0;
    142       Iterator<Failure> all = new NestedIterator<Failure>(errors, warnings);
    143       while (all.hasNext())
    144       {
    145         Failure failure = all.next();
    146         Validator validator = failure.getValidator();
    147         Severity severity = options.getSeverity(validator);
    148         if (severity != Severity.IGNORE)
     151      if(showFailures)
     152      {
     153        %>
     154        <br>
     155        <div class="joust">
     156        <table border="0" cellspacing="0" cellpadding="0" width="100%">
     157        <%
     158        int index = 0;
     159        Iterator<Failure> all = new NestedIterator<Failure>(errors, warnings);
     160        while (all.hasNext())
    149161        {
    150           index++;
    151           String failureId = "F" + System.identityHashCode(failure);
    152           Node node = failure.getNode();
    153           BasicItem item = node.getItem();
    154           String onClick = "";
    155           String tooltip = "";
    156           if (item == null)
     162          Failure failure = all.next();
     163          Validator validator = failure.getValidator();
     164          Severity severity = options.getSeverity(validator);
     165          if (severity != Severity.IGNORE)
    157166          {
    158             tooltip = "Get more information about this failure";
    159             onClick = "failureOnClick(event, '"+failureId+"', '" + node.getId() + "')";
     167            index++;
     168            String failureId = "F" + System.identityHashCode(failure);
     169            Node node = failure.getNode();
     170            BasicItem item = node.getItem();
     171            String onClick = "";
     172            String tooltip = "";
     173            if (item == null)
     174            {
     175              tooltip = "Get more information about this failure";
     176              onClick = "failureOnClick(event, '"+failureId+"', '" + node.getId() + "')";
     177            }
     178            else
     179            {
     180              tooltip = "Get more information about this failure (use CTRL, ALT or SHIFT to edit the item)";
     181              onClick = "failureOnClick(event, '"+failureId+"', '" + node.getId() +
     182                "', '" + item.getType().name() + "', " + item.getId() + ")";
     183            }
     184            %>
     185            <tr id="<%=failureId%>" class="menuitem failure"
     186              onclick="<%=onClick%>"
     187              onmouseover="Main.addClass(this, 'hover')"
     188              onmouseout="Main.removeClass(this, 'hover')"
     189              title="<%=tooltip%>"
     190              >
     191              <td width="20px" class="index text"><%=index%></td>
     192              <td width="20px" class="text"><base:icon image="<%=severity == Severity.ERROR ? "error.gif" : "warning.gif"%>" /></td>
     193              <td class="text"><%=HTML.encodeTags(failure.getMessage()) %></td>
     194              <td class="text"><%=HTML.encodeTags(node.getTitle()) %></td>
     195            </tr>
     196            <%
    160197          }
    161           else
    162           {
    163             tooltip = "Get more information about this failure (use CTRL, ALT or SHIFT to edit the item)";
    164             onClick = "failureOnClick(event, '"+failureId+"', '" + node.getId() +
    165               "', '" + item.getType().name() + "', " + item.getId() + ")";
    166           }
    167           %>
    168           <tr id="<%=failureId%>" class="menuitem failure"
    169             onclick="<%=onClick%>"
    170             onmouseover="Main.addClass(this, 'hover')"
    171             onmouseout="Main.removeClass(this, 'hover')"
    172             title="<%=tooltip%>"
    173             >
    174             <td width="20px" class="index text"><%=index%></td>
    175             <td width="20px" class="text"><base:icon image="<%=severity == Severity.ERROR ? "error.gif" : "warning.gif"%>" /></td>
    176             <td class="text"><%=HTML.encodeTags(failure.getMessage()) %></td>
    177             <td class="text"><%=HTML.encodeTags(node.getTitle()) %></td>
    178           </tr>
    179           <%
    180198        }
     199        %>
     200        </table>
     201        </div>
     202        <%
    181203      }
    182204      %>
    183       </table>
    184       </div>
    185205    </base:body>
    186206  </base:page>
  • trunk/www/common/overview/frameset.jsp

    r4765 r4840  
    3535final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
    3636final String ID = sc.getId();
     37final String showFailures = request.getParameter("show_failures");
    3738%>
    3839<base:page type="frameset" title="">
     
    4041  <frameset cols="300,*" frameborder="yes" border="5">
    4142    <frame name="tree"
    42       src="tree.jsp?ID=<%=ID%>"
     43      src="tree.jsp?ID=<%=ID%>&show_failures=<%=showFailures%>"
    4344      scrolling="auto" marginwidth="0" marginheight="4" frameborder="1"
    4445    >
    4546    <frameset rows="*,200" framborder="yes" border="5">
    4647      <frame name="info"
    47         src="info.jsp?ID=<%=ID%>"
     48        src="info.jsp?ID=<%=ID%>&show_failures=<%=showFailures%>"
    4849        scrolling="auto" marginwidth="0" marginheight="4" frameborder="1"
    4950      >
    5051      <frame name="failures"
    51         src="failures.jsp?ID=<%=ID%>"
     52        src="failures.jsp?ID=<%=ID%>&show_failures=<%=showFailures%>"
    5253        scrolling="auto" marginwidth="0" marginheight="4" frameborder="1"
    5354      >
  • trunk/www/common/overview/index.jsp

    r4823 r4840  
    6868    overview.updateFailureCountOnNodes();
    6969    dc.close();
    70     redirect = "frameset.jsp?ID="+ID;
     70    redirect = "frameset.jsp?ID="+ID+"&show_failures="+false;
    7171  }
    72   else if ("Revalidate".equals(cmd))
     72  else if ("Validate".equals(cmd))
    7373  {
    7474    final Item itemType = Item.valueOf(request.getParameter("item_type"));
     
    8282    overview.updateFailureCountOnNodes();
    8383    dc.close();
    84     redirect = "frameset.jsp?ID="+ID+"&item_type="+itemType.name()+"&item_id="+itemId;
     84    redirect = "frameset.jsp?ID="+ID+"&item_type="+itemType.name()+"&item_id="+itemId+"&show_failures="+true;
    8585  }
    8686  else if ("SaveValidationOptions".equals(cmd))
  • trunk/www/common/overview/info.jsp

    r4767 r4840  
    101101  ValidationOptions options = overview.getValidationOptions();
    102102  String nodeId = request.getParameter("nodeId");
     103  Boolean showFailures = Values.getBoolean(request.getParameter("show_failures"), false);
    103104  Node node = overview.getNode(nodeId);
    104105  if (node == null) node = overview.getRootNode();
     
    262263      <tr>
    263264        <td class="prompt">Errors (children)</td>
    264         <td><%=node.getNumErrors()+node.getChildErrors()%> (<%=node.getChildErrors()%>)</td>
     265        <%
     266        if (showFailures)
     267        {
     268        %>
     269          <td><%=node.getNumErrors()+node.getChildErrors()%> (<%=node.getChildErrors()%>)</td>
     270        <%
     271        }
     272        else
     273        {       
     274        %>
     275          <td><i>- n/a -</i></td>
     276        <%
     277        }
     278        %>
    265279      </tr>
    266280      <tr>
    267281        <td class="prompt">Warnings (children)</td>
    268         <td><%=node.getNumWarnings()+node.getChildWarnings()%> (<%=node.getChildWarnings()%>)</td>
     282        <%
     283        if (showFailures)
     284        {
     285        %>
     286          <td><%=node.getNumWarnings()+node.getChildWarnings()%> (<%=node.getChildWarnings()%>)</td>
     287        <%
     288        }
     289        else
     290        {       
     291        %>
     292          <td><i>- n/a -</i></td>
     293        <%
     294        }
     295        %>
    269296      </tr>
    270297      <%
     
    466493        </table>
    467494        <%
    468       }
    469       %>
    470       <h4>Failure details</h4>
    471       <table>
    472       <%
    473       int numFailures = 0;
    474       for (Failure failure : failures)
    475       {
    476         Validator validator = failure.getValidator();
    477         Severity severity = options.getSeverity(validator);
    478         if (failure.getNode() == node && severity != Severity.IGNORE)
    479         {
    480           numFailures++;
    481           List<Fix> fixes = failure.getFixes();
    482           %>
    483           <tr>
    484             <td><base:icon image="<%=severity == Severity.ERROR ?
    485               "error.gif" : "warning.gif"%>" /></td>
    486             <td><b><%=HTML.encodeTags(failure.getMessage())%></b></td>
    487           </tr>
    488           <tr>
    489             <td style="border-bottom: 1px dotted #999999;"></td>
    490             <td style="border-bottom: 1px dotted #999999;">
    491               <%=HTML.encodeTags(validator.getDescription())%><br>
    492               <%
    493               if (fixes != null && fixes.size() > 0)
    494               {
    495                 for (Fix fix : fixes)
    496                 {
    497                   if (fix == null) continue;
    498                   BasicItem fixItem = fix.getItem();
    499                   if (fixItem.hasPermission(Permission.WRITE))
     495      }     
     496      if (showFailures)
     497      {
     498        %>
     499        <h4>Failure details</h4>     
     500        <table>
     501        <%
     502        int numFailures = 0;
     503        for (Failure failure : failures)
     504        {
     505          Validator validator = failure.getValidator();
     506          Severity severity = options.getSeverity(validator);
     507          if (failure.getNode() == node && severity != Severity.IGNORE)
     508          {
     509            numFailures++;
     510            List<Fix> fixes = failure.getFixes();
     511            %>
     512            <tr>
     513              <td><base:icon image="<%=severity == Severity.ERROR ?
     514                "error.gif" : "warning.gif"%>" /></td>
     515              <td><b><%=HTML.encodeTags(failure.getMessage())%></b></td>
     516            </tr>
     517            <tr>
     518              <td style="border-bottom: 1px dotted #999999;"></td>
     519              <td style="border-bottom: 1px dotted #999999;">
     520                <%=HTML.encodeTags(validator.getDescription())%><br>
     521                <%
     522                if (fixes != null && fixes.size() > 0)
     523                {
     524                  for (Fix fix : fixes)
    500525                  {
    501                     String fixIt = "";
    502                     if (fix.isAnnotationFix())
     526                    if (fix == null) continue;
     527                    BasicItem fixItem = fix.getItem();
     528                    if (fixItem.hasPermission(Permission.WRITE))
    503529                    {
    504                       AnnotationType at = fix.getAnnotationType();
    505                       if (fix.isFromInherited())
     530                      String fixIt = "";
     531                      if (fix.isAnnotationFix())
    506532                      {
    507                         fixIt = "editInheritedAnnotation('" + fixItem.getType().name() + "', " +
    508                           fixItem.getId() + ", " + at.getId() + ")";
     533                        AnnotationType at = fix.getAnnotationType();
     534                        if (fix.isFromInherited())
     535                        {
     536                          fixIt = "editInheritedAnnotation('" + fixItem.getType().name() + "', " +
     537                            fixItem.getId() + ", " + at.getId() + ")";
     538                        }
     539                        else
     540                        {
     541                          fixIt = "editAnnotation('" + fixItem.getType().name() + "', " +
     542                            fixItem.getId() + ", " + at.getId() + ")";
     543                        }
     544                      }
     545                      else if (fix.isDataFileFix())
     546                      {
     547                        FileSetMember member = fix.getFileSetMember();
     548                        fixIt = "editDataFile('" + fixItem.getType().name() + "', " +
     549                          fixItem.getId() + ")";
    509550                      }
    510551                      else
    511552                      {
    512                         fixIt = "editAnnotation('" + fixItem.getType().name() + "', " +
    513                           fixItem.getId() + ", " + at.getId() + ")";
     553                        fixIt = "editItem('" + fixItem.getType().name() + "', " +
     554                          fixItem.getId() + ")";
    514555                      }
     556                      %>
     557                      <base:icon image="fixit.png"
     558                        style="padding-bottom: 4px;" /><a href="javascript:<%=fixIt%>"
     559                        title="Edit this item to fix the problem"><%=HTML.encodeTags(fix.getMessage())%></a><br>
     560                      <%
    515561                    }
    516                     else if (fix.isDataFileFix())
    517                     {
    518                       FileSetMember member = fix.getFileSetMember();
    519                       fixIt = "editDataFile('" + fixItem.getType().name() + "', " +
    520                         fixItem.getId() + ")";
    521                     }
    522                     else
    523                     {
    524                       fixIt = "editItem('" + fixItem.getType().name() + "', " +
    525                         fixItem.getId() + ")";
    526                     }
    527                     %>
    528                     <base:icon image="fixit.png"
    529                       style="padding-bottom: 4px;" /><a href="javascript:<%=fixIt%>"
    530                       title="Edit this item to fix the problem"><%=HTML.encodeTags(fix.getMessage())%></a><br>
    531                     <%
    532562                  }
    533563                }
    534               }
    535               %>
    536             </td>
    537           </tr>
     564                %>
     565              </td>
     566            </tr>
     567            <%
     568          }
     569        }
     570        %>
     571        </table>
     572        <%
     573        if (numFailures == 0)
     574        {
     575          %>
     576          No validation failures on this item
    538577          <%
    539         }
    540       }
    541       %>
    542       </table>
    543       <%
    544       if (numFailures == 0)
    545       {
    546         %>
    547         No validation failures on this item
    548         <%
     578        }       
    549579      }
    550580      %>
  • trunk/www/common/overview/overview.jsp

    r4830 r4840  
    9696      frames['overview']['tree'].closeAll();
    9797    }
    98     function revalidate()
    99     {
     98    function validate()
     99    { 
    100100      var url = '<%=root%>/common/overview/index.jsp?ID=<%=ID%>';
    101       url += '&cmd=Revalidate';
     101      url += '&cmd=Validate';
    102102      url += '&item_type=<%=itemType.name()%>';
    103103      url += '&item_id=<%=itemId%>';
     
    118118    </script>
    119119      <tbl:toolbar>
    120         <tbl:button image="joust/plusonly.gif" title="Expand all"
    121           onclick="expandAll()" tooltip="Expand entire tree"/>
    122         <tbl:button image="joust/minusonly.gif" title="Collapse all"
    123           onclick="collapseAll()" tooltip="Collapse entire tree" />
    124         <tbl:button image="refresh.gif" title="Validate"
    125           onclick="revalidate()" tooltip="Validate the whole tree" />
     120       
     121        <tbl:button image="validate.gif" title="Validate"
     122          onclick="validate()" tooltip="Load and validate entire tree" />
    126123        <tbl:button image="configure.png" title="Validation options&hellip;"
    127124          onclick="validationOptions()" tooltip="Change validation options" />
  • trunk/www/common/overview/tree.jsp

    r4830 r4840  
    4040<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
    4141<%!
    42 String generateSubTree(Node startNode, String ID)
     42String generateSubTree(Node startNode, String ID, boolean showFailures)
    4343{
    4444  StringBuilder sb = new StringBuilder();
     
    5353
    5454    String folderIcon = child.getNodeType() == Node.Type.FOLDER ? "Folder" : "Item";
     55    String tooltip = "";
    5556    if (child.getItemType() == Item.ANNOTATIONTYPE && startNode.getItemType() == Item.PROTOCOL)
    5657    {
     
    6162      folderIcon = "Annotation";
    6263    }
    63     if (errors > 0)
    64     {
    65       folderIcon += "Error";
    66     }
    67     else if (warnings > 0)
    68     {
    69       folderIcon += "Warning";
    70     }
    71     else if (childErrors > 0)
    72     {
    73       folderIcon += "ChildError";
    74     }
    75     else if (childWarnings > 0)
    76     {
    77       folderIcon += "ChildWarning";
    78     }
    79     String tooltip = "";
    80     if (warnings > 0 && errors > 0)
    81     {
    82       tooltip += errors + " error(s); " + warnings + " warning(s) on this item";
    83     }
    84     else if (errors > 0)
    85     {
    86       tooltip += errors + " error(s) on this item";
    87     }
    88     else if (warnings > 0)
    89     {
    90       tooltip += warnings + " warning(s) on this item";
    91     }
    92     if (childErrors > 0 && childWarnings > 0)
    93     {
    94       if (tooltip.length() > 0) tooltip += "; ";
    95       tooltip += childErrors + " error(s); " + childWarnings + " warning(s) on child items";
    96     }
    97     else if (childErrors > 0)
    98     {
    99       if (tooltip.length() > 0) tooltip += "; ";
    100       tooltip += childErrors + " error(s) on child items";
    101     }
    102     else if (childWarnings > 0)
    103     {
    104       if (tooltip.length() > 0) tooltip += "; ";
    105       tooltip += childWarnings + " warning(s) on child items";
     64   
     65    if (showFailures)
     66    {
     67      if (errors > 0)
     68      {
     69        folderIcon += "Error";
     70      }
     71      else if (warnings > 0)
     72      {
     73        folderIcon += "Warning";
     74      }
     75      else if (childErrors > 0)
     76      {
     77        folderIcon += "ChildError";
     78      }
     79      else if (childWarnings > 0)
     80      {
     81        folderIcon += "ChildWarning";
     82      }     
     83      if (warnings > 0 && errors > 0)
     84      {
     85        tooltip += errors + " error(s); " + warnings + " warning(s) on this item";
     86      }
     87      else if (errors > 0)
     88      {
     89        tooltip += errors + " error(s) on this item";
     90      }
     91      else if (warnings > 0)
     92      {
     93        tooltip += warnings + " warning(s) on this item";
     94      }
     95      if (childErrors > 0 && childWarnings > 0)
     96      {
     97        if (tooltip.length() > 0) tooltip += "; ";
     98        tooltip += childErrors + " error(s); " + childWarnings + " warning(s) on child items";
     99      }
     100      else if (childErrors > 0)
     101      {
     102        if (tooltip.length() > 0) tooltip += "; ";
     103        tooltip += childErrors + " error(s) on child items";
     104      }
     105      else if (childWarnings > 0)
     106      {
     107        if (tooltip.length() > 0) tooltip += "; ";
     108        tooltip += childWarnings + " warning(s) on child items";
     109      }
    106110    }
    107111    int numChildren = child.getChildren() == null ?
     
    112116    sb.append(child.getNodeType() == Node.Type.FOLDER ? " (" + numChildren + ")" : "").append("',");
    113117    sb.append("'showInfo(\"").append(child.getId()).append("\")','").append(HTML.javaScriptEncode(tooltip)).append("', '").append(child.getId()).append("',");
    114     sb.append("'lazyInitSubNode(").append(child.hashCode()).append(")')\n");
    115     sb.append(generateSubTree(child, ID));
     118    sb.append("'lazyInitSubNode(\"").append(child.getId()).append("\")')\n");
     119    sb.append(generateSubTree(child, ID, showFailures));
    116120  }
    117121  return sb.toString();
     
    126130{
    127131  GenericOverview overview = OverviewUtil.getCurrentOverview(sc);
    128  
     132  Boolean showFailures = Values.getBoolean(request.getParameter("show_failures"), false);
    129133  Nameable rootItem = (Nameable)overview.getRootItem();
    130134  Node rootNode = overview.getRootNode();
    131135  String rootIcon = "Home";
    132   if (rootNode.getNumErrors() > 0 || rootNode.getChildErrors() > 0)
    133   {
    134     rootIcon = "Error";
    135   }
    136   else if (rootNode.getNumWarnings() > 0 || rootNode.getChildWarnings() > 0)
    137   {
    138     rootIcon = "Warning";
     136  if (showFailures)
     137  {
     138    if (rootNode.getNumErrors() > 0 || rootNode.getChildErrors() > 0)
     139    {
     140      rootIcon = "Error";
     141    }
     142    else if (rootNode.getNumWarnings() > 0 || rootNode.getChildWarnings() > 0)
     143    {
     144      rootIcon = "Warning";
     145    }
    139146  }
    140147  %>
     
    190197    IconStore.addIcon('AnnotatioChildnErrorSelected', path + 'annotationchilderrorselected.gif', 18, 16);
    191198    var node<%=rootNode.hashCode()%> = JoustMenu.addMenuItem(-1, '<%=rootIcon%>', '<%=HTML.javaScriptEncode(rootItem.getName())%>', 'showInfo("<%=rootNode.getId()%>")', '', '<%=rootNode.getId()%>');
    192     <%=generateSubTree(rootNode, ID)%>
     199    <%=generateSubTree(rootNode, ID, showFailures)%>
    193200    JoustMenu.menuItems[node<%=rootNode.hashCode()%>].isOpen = true;
    194201    JoustMenu.draw('joust');
     
    208215  function showInfo(nodeId)
    209216  {
    210     parent.frames['info'].location.href = 'info.jsp?ID=<%=ID%>&nodeId='+nodeId;
     217    parent.frames['info'].location.href = 'info.jsp?ID=<%=ID%>&nodeId='+nodeId+'&show_failures=<%=showFailures%>';
    211218  }
    212219 
     
    229236  function lazyInitSubNode(nodeId)
    230237  {
    231     var parentMenu = JoustMenu.menuItems['N' + nodeId];
     238    var parentMenu = JoustMenu.menuItems[nodeId];
    232239    JoustMenu.changeCursorOnMenuItem(parentMenu.index, 'progress');   
    233240    var request = Ajax.getXmlHttpRequest();
     
    246253      {
    247254        var id = kv['id'];
    248         var folderIcon = kv['folderIcon'];       
    249         var parentIconSuffix = kv['parentIconSuffix'];
    250         var tooltip = kv['tooltip'] ? kv['tooltip'] : '';
    251         var parentTooltip = kv['parentTooltip'] ? kv['parentTooltip'] : '';                           
     255        var folderIcon = kv['folderIcon'];                               
    252256        numAdded++;
    253257        var node = JoustMenu.addLazyChildItem(
    254               parentMenu.index, folderIcon, kv['title'], 'showInfo(\''+id+'\')',
    255                 tooltip , id, 'lazyInitSubNode('+kv['hashCode']+')');
    256        
    257         if (parentIconSuffix)
    258         {
    259           updateParentMenu(parentMenu, parentIconSuffix, parentTooltip);         
    260           JoustMenu.menuItems['0'].iconName = parentIconSuffix;
    261           reloadSiblingFrames();
    262         }
     258              parentMenu.index, folderIcon, Main.trimString(kv['title']), 'showInfo(\''+id+'\')',
     259                '' , id, 'lazyInitSubNode(\''+id+'\')');
    263260      }
    264261      else
     
    271268    JoustMenu.changeCursorOnMenuItem(parentMenu.index, 'pointer');
    272269    return numAdded > 0;         
    273   }
    274 
    275   function reloadSiblingFrames()
    276   {
    277     parent.frames.failures.location.reload();
    278     parent.frames.info.location.reload();
    279   }
    280 
    281   function updateParentMenu(menuItem, iconSuffix, tooltip)
    282   {
    283     menuItem.tooltip = tooltip;
    284     var currentIcon = menuItem.iconName;   
    285     if (currentIcon.indexOf('Error') < 0 && currentIcon.indexOf('Warning') < 0)
    286     {
    287       menuItem.iconName += iconSuffix;
    288     }
    289     else if (iconSuffix == 'Error')
    290     {
    291       menuItem.iconName = currentIcon.replace(/ChildError/, iconSuffix);
    292       menuItem.iconName = currentIcon.replace(/ChildWarning/, iconSuffix);
    293       menuItem.iconName = currentIcon.replace(/Warning/, iconSuffix);
    294     }
    295     else if (iconSuffix == 'Warning')
    296     {
    297       menuItem.iconName = currentIcon.replace(/ChildError/, iconSuffix);
    298       menuItem.iconName = currentIcon.replace(/ChildWarning/, iconSuffix);           
    299     }
    300     updateIconRecursively(menuItem.parentItemIndex, 'Child'+iconSuffix);
    301   }
    302 
    303   function updateIconRecursively(itemIndex, newIconSuffix)
    304   {   
    305     var item = JoustMenu.menuItems[itemIndex];
    306     var currentIcon = item.iconName;
    307     if (currentIcon.indexOf('Error') < 0 && currentIcon.indexOf('Warning') < 0)
    308     {
    309       item.iconName += newIconSuffix;
    310     }
    311     else if (newIconSuffix == 'ChildError')
    312     {
    313       item.iconName = currentIcon.replace(/ChildWarning/, newIconSuffix);
    314     }
    315     if (item.parentItemIndex > 0)
    316     {
    317       updateIconRecursively(item.parentItemIndex, newIconSuffix);
    318     }
    319270  }
    320271 
Note: See TracChangeset for help on using the changeset viewer.