Ignore:
Timestamp:
Oct 28, 2011, 2:35:36 PM (10 years ago)
Author:
Martin Svensson
Message:

References #330 The partition wizard is now fully functional. Some testings are left to do.

Location:
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/SpecimenTube.java

    r1421 r1425  
    105105   
    106106    ItemQuery<Sample> tubeQuery = Sample.getQuery();
    107     tubeQuery.restrict(Restrictions.rlike(Hql.property("name"), Expressions.parameter("name", "^.+\\.[0-9]+$", Type.STRING)));
     107    tubeQuery.restrict(Restrictions.and(Restrictions.eq(Hql.property("originalQuantity"), null),
     108        Restrictions.rlike(Hql.property("name"), Expressions.parameter("name", "^.+\\.[0-9]+$", Type.STRING))));
    108109    tubeQuery.order(Orders.desc(Hql.property("name")));
    109110    tubeQuery.include(Include.ALL);
     
    120121  private final String row;
    121122  private final String column;
    122   private final Float originalQuantity;
     123//  private final Float originalQuantity;
    123124 
    124125  private SpecimenTube(Sample sample)
     
    133134      row = wcfRow.format(well.getRow());     
    134135      column = wcfColumn.format(well.getColumn());
    135       originalQuantity = sample.getOriginalQuantity();
     136//      originalQuantity = sample.getOriginalQuantity();
    136137    }
    137138    else
     
    140141      row = null;
    141142      column = null;
    142       originalQuantity = null;
     143//      originalQuantity = null;
    143144    }
    144145  }
     
    176177    return column;
    177178  }
    178  
    179   public Float getOriginalQuantity()
    180   {
    181     return originalQuantity;
    182   }
     179// 
     180//  public Float getOriginalQuantity()
     181//  {
     182//    return originalQuantity;
     183//  }
    183184 
    184185  @SuppressWarnings("unchecked")
     
    189190    json.put("row", row);
    190191    json.put("column", column);
    191     json.put("originalQuantity", originalQuantity);
     192//    json.put("originalQuantity", originalQuantity);
    192193  }
    193194}
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/PartitionRegistrationServlet.java

    r1419 r1425  
    2828import net.sf.basedb.reggie.Reggie;
    2929import net.sf.basedb.reggie.converter.StringToDateConverter;
    30 import net.sf.basedb.reggie.dao.Case;
    3130import net.sf.basedb.reggie.dao.SpecimenTube;
    3231import net.sf.basedb.util.Values;
     
    115114        dc = sc.newDbControl();
    116115        JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader());       
    117         JSONObject jsonCase = (JSONObject)jsonReq.get("caseInfo");       
    118         JSONArray jsonSpecimens = (JSONArray)jsonCase.get("specimen");
     116        JSONObject jsonInfo = (JSONObject)jsonReq.get("tubeInfo");       
     117        JSONArray jsonSpecimens = (JSONArray)jsonInfo.get("specimens");
    119118       
    120119        AnnotationType partitionDateType = Reggie.findAnnotationType(dc, new Item[]{Item.EXTRACT, Item.SAMPLE}, Reggie.ANNOTATION_PARTITION_DATE, true);
     
    122121        AnnotationType nofPiecesType = Reggie.findAnnotationType(dc, Item.SAMPLE, Reggie.ANNOTATION_NOF_PIECES, true);
    123122       
    124         StringToDateConverter dateConverter = new StringToDateConverter(new SimpleDateFormat("yyyyMMdd"));
    125         String otherPartitionComment = Values.getStringOrNull((String)jsonCase.get("otherPartitionComment"));
    126         Date partitionDate = dateConverter.convert((String)jsonCase.get("partitionDate"));
     123        StringToDateConverter dateConverter = new StringToDateConverter(new SimpleDateFormat("yyyyMMdd"));       
     124        Date partitionDate = dateConverter.convert((String)jsonInfo.get("partitionDate"));
    127125       
    128126        if (jsonSpecimens != null && jsonSpecimens.size()>0)
     
    143141            Float apWeight = Values.getFloat((String)jsonSpecimen.get("apWeight"), null);
    144142            Float hisWeight = Values.getFloat((String)jsonSpecimen.get("hisWeight"), null);           
    145             Integer nofPieces = Values.getInteger((String)jsonSpecimen.get("nofPieces"), null);
     143            Integer nofPieces = Values.getInteger((String)jsonSpecimen.get("nofPieces"), null);
     144            String otherPartitionComment = Values.getStringOrNull((String)jsonSpecimen.get("otherPartitionComment"));
    146145           
    147146            if (spWeight != null) spWeight = spWeight *1000;
Note: See TracChangeset for help on using the changeset viewer.