Ignore:
Timestamp:
Oct 20, 2009, 8:50:49 AM (13 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1404: Use cached annotations in "item overview"

The tests in #1406 were successful. Also fixed an issue with icons in the outline for protocol parameters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/common/overview/ajax.jsp

    r4864 r5145  
    2424  import="net.sf.basedb.core.SessionControl"
    2525  import="net.sf.basedb.core.DbControl"
     26  import="net.sf.basedb.core.Annotation"
     27  import="net.sf.basedb.core.AnnotationType"
    2628  import="net.sf.basedb.core.Item"
    2729  import="net.sf.basedb.util.overview.GenericOverview"
     
    5254      for (Node n : parent.getChildren())
    5355      {
    54         String title;
    5556        String folderIcon = n.getNodeType() == Node.Type.FOLDER ? "Folder" : "Item";
    56         if (n.getItemType() == Item.ANNOTATIONTYPE && parent.getItemType() == Item.PROTOCOL)
     57        if (n.getItemType() == Item.ANNOTATIONTYPE)
    5758        {
    58           folderIcon = "ProtocolParameter";
     59          if (parent.getItemType() == Item.PROTOCOL)
     60          {
     61            folderIcon = "ProtocolParameter";
     62          }
     63          else
     64          {
     65            try
     66            {
     67              AnnotationType at = (AnnotationType)n.getItem(dc);
     68              if (at.isProtocolParameter()) folderIcon = "ProtocolParameter";
     69            }
     70            catch (Throwable t)
     71            {}
     72          }
    5973        }
    6074        else if (n.getItemType() == Item.ANNOTATION)
    6175        {
    6276          folderIcon = "Annotation";
     77          try
     78          {
     79            AnnotationType at = ((Annotation)n.getItem(dc)).getAnnotationType();
     80            if (at.isProtocolParameter()) folderIcon = "ProtocolParameter";
     81          }
     82          catch (Throwable t)
     83          {}
    6384        }       
    6485        int numChildren = n.numChildren();
Note: See TracChangeset for help on using the changeset viewer.