Changeset 999


Ignore:
Timestamp:
Mar 27, 2009, 3:35:14 PM (12 years ago)
Author:
Jari Häkkinen
Message:

Restructured result storage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/base2/net.sf.basedb.pluginutilities/trunk/src/net/sf/basedb/plugins/AbstractRunBinaryPlugin.java

    r990 r999  
    22  $Id$
    33
    4   Copyright (C) 2008 Jari Hakkinen
     4  Copyright (C) 2008, 2009 Jari Hakkinen
    55
    66  This file is part of the PluginUtilities
     
    2929import net.sf.basedb.core.BioAssaySet;
    3030import net.sf.basedb.core.DbControl;
    31 import net.sf.basedb.core.Experiment; // Jari, remove this?
    32 import net.sf.basedb.core.InvalidUseOfNullException; // Jari, remove this?
    3331import net.sf.basedb.core.Job;
    3432import net.sf.basedb.core.PluginDefinition;
    3533import net.sf.basedb.core.PluginParameter;
    3634import net.sf.basedb.core.ProgressReporter;
    37 import net.sf.basedb.core.RawBioAssay; // Jari, remove this?
    3835import net.sf.basedb.core.RequestInformation;
     36import net.sf.basedb.core.SpotBatcher;
     37import net.sf.basedb.core.Transformation;
     38import net.sf.basedb.util.Values;
    3939
    4040import net.sf.basedb.core.plugin.About;
     
    283283    DbControl dc=sc.newDbControl();
    284284    try {
    285       String name=(String)job.getValue("name");
    286       if (name==null)
    287         name="New bioassay set";
    288285      if (sourceBAS==null)
    289286        sourceBAS = getSourceBioAssaySet(dc);
    290287      runBinary();
    291       storeResult(dc,name);
     288      storeResult(dc);
    292289//      dc.commit();
    293290      response.setDone("Plug-in ended successfully");
     
    323320
    324321
    325   abstract protected void storeResult(DbControl dc, String name);
     322  private void storeResult(DbControl dc)
     323  {
     324    // Create Transformation
     325    Transformation t = sourceBAS.newTransformation(this.getCurrentJob(dc));
     326    t.setName(about.getName());
     327    dc.saveItem(t);
     328
     329    // Create the normalized bioassay set
     330    BioAssaySet child = t.newProduct(null, "new", true);
     331    child.setName(Values.getString((String)job.getValue(CHILD_NAME),
     332                                   sourceBAS.getName()));
     333    child.setDescription((String)job.getValue(CHILD_DESCRIPTION));
     334    dc.saveItem(child);
     335
     336    // Batcher for inserting normalized data
     337    SpotBatcher batcher = child.getSpotBatcher();
     338    storeResult(batcher);
     339  }
     340
     341
     342  abstract protected void storeResult(SpotBatcher batcher)
     343    throws BaseException;
    326344
    327345
     
    339357  protected String subprocess_stdin=null;
    340358  protected String subprocess_stdout=null;
     359  protected String metadata=null;
    341360
    342361  private String binaryPath=null;
Note: See TracChangeset for help on using the changeset viewer.