Changeset 3051


Ignore:
Timestamp:
Jan 8, 2007, 1:50:15 PM (15 years ago)
Author:
Nicklas Nordborg
Message:

References #262 and #340: Some minor improvements and fixes

Location:
trunk
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/util/overview/ExperimentOverview.java

    r3045 r3051  
    6363import net.sf.basedb.core.ProtocolType;
    6464import net.sf.basedb.core.RawBioAssay;
     65import net.sf.basedb.core.RawDataType;
    6566import net.sf.basedb.core.Sample;
    6667import net.sf.basedb.core.Scan;
     
    267268    if (project != null)
    268269    {
    269       if (experiment.getRawDataType() != project.getDefaultRawDataType())
     270      RawDataType projectDefault = project.getDefaultRawDataType();
     271      if (projectDefault != null && experiment.getRawDataType() != projectDefault)
    270272      {
    271273        failures.add(
     
    542544    if (project != null)
    543545    {
    544       if (rba.getRawDataType() != project.getDefaultRawDataType())
     546      RawDataType projectDefault = project.getDefaultRawDataType();
     547      if (projectDefault != null && rba.getRawDataType() != projectDefault)
    545548      {
    546549        failures.add(
     
    566569            new Fix("Inherit annotation from a parent item", rba, at, true);
    567570          failures.add(new Failure(Validator.MISSING_FACTORVALUE, rbaNode,
    568             "Missing factor value for " + at.getName(), addFactor));
     571            "Missing value for experimental factor '" + at.getName() + "'", addFactor));
    569572        }
    570573      }
     
    807810      for (LabeledExtract le : nonUnique)
    808811      {
    809         failure.addFix(new Fix("Change label of " + le.getName(), le));
     812        failure.addFix(new Fix("Change label of '" + le.getName() + "'", le));
    810813      }
    811814      failures.add(failure);
     
    882885        {
    883886          failures.add(new Failure(Validator.CIRCULAR_REFERENCE, parentNode,
    884             "Circular reference to " + ((LabeledExtract)tempItem).getName(),
     887            "Circular reference to '" + ((LabeledExtract)tempItem).getName() + "'",
    885888            new Fix("Modify source labeled extracts", product)
    886889          ));
     
    909912            {
    910913              failures.add(new Failure(Validator.DIFFERENT_LABEL, leNode, null,
    911                 new Fix("Change label of " + source.getName(), source),
    912                 new Fix("Change label of " + product.getName(), product)
     914                new Fix("Change label of '" + source.getName() + "'", source),
     915                new Fix("Change label of '" + product.getName() + "'", product)
    913916                ));
    914917            }
     
    10051008        {
    10061009          failures.add(new Failure(Validator.CIRCULAR_REFERENCE, parentNode,
    1007             "Circular reference to " + ((Extract)tempItem).getName(),
     1010            "Circular reference to '" + ((Extract)tempItem).getName() + "'",
    10081011            new Fix("Modify source extracts", product)
    10091012          ));
     
    11091112        {
    11101113          failures.add(new Failure(Validator.CIRCULAR_REFERENCE, parentNode,
    1111             "Circular reference to " + ((Sample)tempItem).getName(),
     1114            "Circular reference to '" + ((Sample)tempItem).getName() + "'",
    11121115            new Fix("Modify source samples", product)
    11131116          ));
     
    15271530            {
    15281531              failures.add(new Failure(Validator.ANNOTATION_IS_PARAMETER, parentNode,
    1529                 "Annotation " + at.getName() + " is a protocol parameter",
     1532                "Annotation '" + at.getName() + "' is a protocol parameter",
    15301533                new Fix("Remove annotation value", (BasicItem)parent, at, false),
    15311534                new Fix("Change 'parameter' flag of annotation type", at)
     
    15371540            {
    15381541              failures.add(new Failure(Validator.ANNOTATION_INVALID_ITEM, parentNode,
    1539                 "Annotation " + at.getName() + " is invalid for item type: " + parent.getType(),
     1542                "Annotation '" + at.getName() + "' is invalid for item type: " + parent.getType(),
    15401543                new Fix("Remove annotation value", (BasicItem)parent, at, false),
    15411544                new Fix("Add '" + parent.getType().name() + "' to annotation type", at)
     
    15781581          {
    15791582            failures.add(new Failure(Validator.MISSING_MIAME_ANNOTATION, parentNode, null,
    1580                 new Fix("Add value for annotation " + at.getName(), (BasicItem)parent, at, false),
    1581                 new Fix("Remove 'Required for MIAME' flag on " + at.getName(), at)
     1583                new Fix("Add value for annotation '" + at.getName() + "'", (BasicItem)parent, at, false),
     1584                new Fix("Remove 'Required for MIAME' flag on '" + at.getName() + "'", at)
    15821585              ));
    15831586          }
     
    16201623            {
    16211624              failures.add(new Failure(Validator.ANNOTATION_INHERIT_FROM_NONPARENT, parentNode,
    1622                 "Inheriting annotation " + (at != null ?
    1623                   at.getName() : a.getValueType().toString()) + " from non-parent",
     1625                "Inheriting annotation '" + (at != null ?
     1626                  at.getName() : a.getValueType().toString()) + "' from non-parent",
    16241627                new Fix("Remove inherited annotation", parentNode.getItem(), at, true)
    16251628              ));
     
    16371640        {
    16381641          failures.add(new Failure(Validator.ANNOTATION_INHERIT_MULTIPLE, parentNode,
    1639             "Inherits multiple annotations of type " + dup.getName(),
     1642            "Inherits multiple annotations of type '" + dup.getName() + "'",
    16401643            new Fix("Modify inherited annotations", parentNode.getItem(), dup, true)
    16411644          ));
  • trunk/src/core/net/sf/basedb/util/overview/Failure.java

    r3045 r3051  
    2727import java.util.LinkedList;
    2828import java.util.List;
     29
     30import net.sf.basedb.core.BasicItem;
    2931
    3032/**
     
    112114    return getMessage();
    113115  }
     116 
     117  /**
     118    One failure is the same as another if they have the same validator
     119    but different nodes referencing the same item.
     120  */
     121  @Override
     122  public boolean equals(Object o)
     123  {
     124    if (o == null || o.getClass() != this.getClass()) return false;
     125    Failure other = (Failure)o;
     126    BasicItem thisItem = this.node.getItem();
     127    boolean sameNode = this.node == other.node;
     128    boolean sameItem = sameNode || this.node.getItem() ==  other.node.getItem();
     129    boolean sameValidator = this.validator == other.validator;
     130    return !sameNode && sameItem && sameValidator;
     131  }
     132
     133  @Override
     134  public int hashCode()
     135  {
     136    return validator.hashCode();
     137  }
    114138}
  • trunk/www/common/annotations/inherit.jsp

    r3045 r3051  
    7878}
    7979
    80 private String generateJoustTree(Set<AnnotationSet> parentAnnotations, Set<Annotation> inheritedAnnotations, Set<AnnotationSet> inheritedSets)
     80private String generateJoustTree(Set<AnnotationSet> parentAnnotations, Set<AnnotationSet> nonParents, Set<Annotation> inheritedAnnotations, Set<AnnotationSet> inheritedSets)
    8181{
    8282  StringBuilder sb = new StringBuilder();
     
    8484  String annotationIcon = "Annotation";
    8585  String parameterIcon = "Parameter";
     86  String nonParentIcon = "NonParent";
    8687 
    8788  for (AnnotationSet as : parentAnnotations)
     
    9495    catch (PermissionDeniedException ex)
    9596    {}
     97   
     98    String icon = nonParents.contains(as) ? nonParentIcon : itemIcon;
    9699   
    97100    boolean setInherited = inheritedSets != null && inheritedSets.contains(as);
     
    106109    sb.append("var item").append(as.getId());
    107110    sb.append(" = JoustMenu.addMenuItem(-1");
    108     sb.append(",'").append(itemIcon).append("'");
     111    sb.append(",'").append(icon).append("'");
    109112    sb.append(",'").append(input).append(name).append("'");
    110113    sb.append(", 'itemOnClick(event, ").append(as.getId()).append(")'");
     
    164167  Set<AnnotationSet> parentAnnotations = new HashSet<AnnotationSet>();
    165168  Set<Annotatable> parentItems = new HashSet<Annotatable>();
     169  Set<AnnotationSet> nonParents = new HashSet<AnnotationSet>();
    166170
    167171  if (item != null)
     
    223227      {
    224228        parentAnnotations.add(from);
     229        nonParents.add(from);
    225230      }
    226231    }
     
    233238      {
    234239        parentAnnotations.add(ias);
     240        nonParents.add(ias);
    235241      }
    236242    }
     
    252258      IconStore.addIcon('Annotation', path + 'annotation.gif', 18, 16);
    253259      IconStore.addIcon('Parameter', path + 'parameter.gif', 18, 16);
    254       <%=generateJoustTree(parentAnnotations, inheritedAnnotations, inheritedSets)%>
     260      IconStore.addIcon('NonParent', path + 'itemerror.gif', 18, 16);
     261      <%=generateJoustTree(parentAnnotations, nonParents, inheritedAnnotations, inheritedSets)%>
    255262      JoustMenu.alwaysSendOnClickToSelected = true;
    256263      JoustMenu.draw('joust');
     
    362369    </div>
    363370    <base:icon image="joust/annotation.gif" /> = Annotation
    364     <base:icon image="joust/parameter.gif" /> = Protocol parameter
     371    <base:icon image="joust/parameter.gif" /> = Protocol parameter<br>
     372    <base:icon image="joust/itemerror.gif" /> = Not a parent item
    365373  </td>
    366374  <td width="50%">
  • trunk/www/views/experiments/bioassaysets/list_bioassaysets.jsp

    r3033 r3051  
    255255
    256256    <t:tab id="overview" title="Overview"
    257       tooltip="Get an overview of all items in this experiment"/>
     257      tooltip="Get an overview of all hybridizations, biomaterials, etc. in this experiment" />
    258258
    259259    </t:tabcontrol>
  • trunk/www/views/experiments/overview/failures.jsp

    r3045 r3051  
    4848  import="java.util.LinkedList"
    4949  import="java.util.Iterator"
     50  import="java.util.Set"
     51  import="java.util.HashSet"
    5052%>
    5153<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
     
    6870  List<Failure> errors = new LinkedList<Failure>();
    6971  List<Failure> warnings = new LinkedList<Failure>();
     72  Set<Failure> duplicates = new HashSet<Failure>();
    7073 
    7174  for (Failure failure : failures)
    7275  {
    73     Validator validator = failure.getValidator();
    74     Severity severity = options.getSeverity(validator);
    75     if (severity == Severity.ERROR)
     76    if (!duplicates.contains(failure))
    7677    {
    77       errors.add(failure);
    78     }
    79     else if (severity == Severity.WARNING)
    80     {
    81       warnings.add(failure);
     78      duplicates.add(failure);
     79      Validator validator = failure.getValidator();
     80      Severity severity = options.getSeverity(validator);
     81      if (severity == Severity.ERROR)
     82      {
     83        errors.add(failure);
     84      }
     85      else if (severity == Severity.WARNING)
     86      {
     87        warnings.add(failure);
     88      }
    8289    }
    8390  }
     
    127134        if (severity != Severity.IGNORE)
    128135        {
    129           String failureId = "F" + failure.hashCode();
     136          String failureId = "F" + System.identityHashCode(failure);
    130137          Node node = failure.getNode();
    131138          BasicItem item = node.getItem();
     
    166173      </table>
    167174      </div>
    168 
    169175    </base:body>
    170176  </base:page>
  • trunk/www/views/experiments/overview/info.jsp

    r3045 r3051  
    219219                    }
    220220                    %>
    221                     <base:icon image="bullet.gif"
     221                    <base:icon image="fixit.png"
    222222                      style="padding-bottom: 4px;" /><a href="javascript:<%=fixIt%>"
    223                       title="Edit this item"><%=HTML.encodeTags(fix.getMessage())%></a><br>
     223                      title="Edit this item to fix the problem"><%=HTML.encodeTags(fix.getMessage())%></a><br>
    224224                    <%
    225225                  }
  • trunk/www/views/experiments/view_experiment.jsp

    r3033 r3051  
    469469     
    470470      <t:tab id="overview" title="Overview"
    471         tooltip="Get an overview of all items in this experiment" />
     471        tooltip="Get an overview of all hybridizations, biomaterials, etc. in this experiment" />
    472472     
    473473      </t:tabcontrol>
Note: See TracChangeset for help on using the changeset viewer.