Ignore:
Timestamp:
Nov 7, 2008, 9:36:37 AM (13 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1133: Experimental factors - inherit annotations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/views/experiments/index.jsp

    r4619 r4630  
    341341    redirect = "../../common/plugin/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&main_type=OTHER&title=Run+plugin";
    342342  }
     343  else if ("AutoInherit".equals(cmd))
     344  {
     345    // Display the edit page for a single item (should be opened in a popup)
     346    dc = sc.newDbControl();
     347    Experiment exp = Experiment.getById(dc, Values.getInt(itemId));
     348    AnnotationType at = AnnotationType.getById(dc, Values.getInt(request.getParameter("annotationtype_id")));
     349    ItemQuery<RawBioAssay> query = exp.getRawBioAssays();
     350    query.include(Include.ALL);
     351    query.setItemPermission(Permission.WRITE);
     352    int numInherited = 0;
     353    int numRawBioAssays = 0;
     354    for (RawBioAssay rba : query.list(dc))
     355    {
     356      numRawBioAssays++;
     357      numInherited += rba.getAnnotationSet().autoInherit(dc, at, false);
     358    }
     359    dc.commit();
     360    message = numInherited + " annotation(s) inherited by " + numRawBioAssays + " raw bioassay(s)";
     361  }
    343362  else
    344363  {
Note: See TracChangeset for help on using the changeset viewer.