Ignore:
Timestamp:
Sep 8, 2015, 2:30:31 PM (7 years ago)
Author:
Nicklas Nordborg
Message:

References #1941: Store experimental factor values as part experiments

Implemented support for inheriting new annotations via the "Inherit" button. The 'Inherited annotations' tab has been removed from all dialogs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/common/annotations/inherit.jsp

    r6937 r6947  
    124124      HTML.encodeTags(((Nameable)item).getName()) + " <span class=\"itemsubtype\">(" + itemType + ")</span>";
    125125   
    126     ItemQuery<Annotation> query = as.getAnnotations();
     126    ItemQuery<Annotation> query = as.getAnnotations(Annotation.Source.PRIMARY);
    127127    query.restrict(Restrictions.eq(Hql.property("annotationType.disableInheritance"), Expressions.bool(false)));
    128128    List<Annotation> annotations = query.list(as.getDbControl());
    129129    if (annotations.size() == 0) continue; // With the next AnnotationSet/item
    130130     
    131     JSONObject jsonJoust = newJoustEntry(null, icon, input+name, joustId);
    132     jsonJoust.put("isOpen", 1);
    133     jsonJoust.put("type", "annotation-set");
    134     jsonJoust.put("externalId", as.getId());
    135     json.add(jsonJoust);
     131    JSONObject jsonJoust = null;
    136132
    137133    SessionControl sc = as.getSessionControl();
     
    140136      Formatter formatter = FormatterFactory.getAnnotationFormatter(sc, a, null);
    141137      boolean inherited = inheritedAnnotations != null && inheritedAnnotations.contains(a);
     138      if (inherited) continue;
     139     
     140      if (jsonJoust == null)
     141      {
     142        jsonJoust = newJoustEntry(null, icon, input+name, joustId);
     143        jsonJoust.put("isOpen", 1);
     144        jsonJoust.put("type", "annotation-set");
     145        jsonJoust.put("externalId", as.getId());
     146        json.add(jsonJoust);
     147      }
     148     
    142149      AnnotationType at = a.getAnnotationType();
    143150      String annotationName = at.getName();
     
    190197final Item itemType = Item.valueOf(request.getParameter("item_type"));
    191198final int itemId = Values.getInt(request.getParameter("item_id"));
    192 final boolean standalone = Values.getBoolean(request.getParameter("standalone"));
     199
     200//final boolean standalone = Values.getBoolean(request.getParameter("standalone"));
    193201
    194202final DbControl dc = sc.newDbControl();
     
    206214    loadParents(dc, parentAnnotations, parentItems, item);
    207215  }
    208   if (standalone)
    209   {
    210     sc.getCurrentContext(itemType).setObject("item", item);
    211   }
     216
    212217  String title = "Inherit annotations to " +
    213218    HTML.encodeTags((item instanceof Nameable ? ((Nameable)item).getName() :
     
    256261      ));
    257262   
     263    // Ignore annotations marked for DELETE (so it is possible to re-select them)
     264    String d = request.getParameter("deleted");
     265    if (d != null)
     266    {
     267      Integer[] deleted = Values.getInt(d.split(","));
     268      if (deleted.length > 0)
     269      {
     270        inheritedQuery.restrict(Restrictions.not(Restrictions.in(Hql.property("id"), Expressions.parameter("deleted"))));
     271        inheritedQuery.setParameter("deleted", java.util.Arrays.asList(deleted), Type.INT);
     272      }
     273    }
     274       
    258275    inheritedQuery.order(Orders.asc(Hql.property("annotationSet")));
    259276    inheritedQuery.order(Orders.asc(Hql.property("annotationType.name")));
     
    286303  </base:head>
    287304  <base:body>
    288     <%
    289     if (standalone)
    290     {
    291       %>
    292       <h1><%=title%> <base:help helpid="annotations.inherit" /></h1>
    293       <div class="content bottomborder">
    294       <%
    295     }
    296     %>
     305   
     306  <h1><%=title%> <base:help helpid="annotations.inherit" /></h1>
     307  <div class="content bottomborder">
     308 
     309  <div id="page-data" class="datacontainer"
     310    data-callback="<%=HTML.encodeTags(request.getParameter("callback"))%>"
     311  ></div>
     312 
    297313  <form name="annotations">
    298314  <div class="absolutefull">
     
    352368  </div>
    353369  </form>
    354 
    355     <%
    356     if (standalone)
    357     {
    358       %>
    359       </div>
    360       <base:buttongroup subclass="dialogbuttons">
    361         <base:button id="btnSave" title="Save" />
    362         <base:button id="close" title="Cancel" />
    363       </base:buttongroup>
    364       <form name="modified" method="post" action="index.jsp?ID=<%=ID%>">
    365         <input type="hidden" name="cmd" value="SaveAnnotations">
    366         <input type="hidden" name="item_type" value="<%=itemType.name()%>">
    367         <input type="hidden" name="item_id" value="<%=itemId%>">
    368       </form>
    369       <%
    370     }
    371     %>
     370  </div>
     371
     372  <base:buttongroup subclass="dialogbuttons">
     373    <base:button id="btnOk" title="Ok" />
     374    <base:button id="close" title="Cancel" />
     375  </base:buttongroup>
     376 
    372377  </base:body>
    373378  </base:page>
Note: See TracChangeset for help on using the changeset viewer.