Changeset 5641


Ignore:
Timestamp:
May 25, 2011, 12:56:04 PM (12 years ago)
Author:
Nicklas Nordborg
Message:

References #1153: Handling short read transcript sequence data

Removed LabeledExtract and related classes. Extract takes it place in most situations, including a temporary link to hybridizations. All tests programs pass and the web client is more or less working. The next step is to replace Hybridization with PhysicalBioAssay.

Location:
trunk
Files:
8 deleted
61 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/clients/web/net/sf/basedb/clients/web/PermissionUtil.java

    r5632 r5641  
    196196        Arrays.asList(new Item[]
    197197        {
    198           Item.BIOSOURCE, Item.SAMPLE, Item.EXTRACT, Item.LABELEDEXTRACT, Item.TAG,
     198          Item.BIOSOURCE, Item.SAMPLE, Item.EXTRACT, Item.TAG,
    199199          Item.BIOMATERIALLIST, Item.BIOPLATE, Item.BIOPLATETYPE, Item.BIOPLATEEVENT, Item.BIOPLATEEVENTTYPE,
    200200          Item.HYBRIDIZATION, Item.SCAN, Item.RAWBIOASSAY, Item.EXPERIMENT, Item.FORMULA
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/edit/EditUtil.java

    r5632 r5641  
    5656  public static final Item[] EDIT_ITEMS = new Item[]
    5757    {
    58       Item.BIOSOURCE, Item.SAMPLE, Item.EXTRACT, Item.LABELEDEXTRACT, Item.TAG,
     58      Item.BIOSOURCE, Item.SAMPLE, Item.EXTRACT, Item.TAG,
    5959      Item.BIOPLATE, Item.BIOWELL, Item.BIOPLATETYPE, Item.BIOMATERIALLIST, Item.BIOMATERIALEVENT,
    6060      Item.BIOPLATEEVENT, Item.BIOPLATEEVENTTYPE,
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/toolbar/ToolbarUtil.java

    r5632 r5641  
    6262      Item.SCAN, Item.IMAGE, Item.HYBRIDIZATION,
    6363      Item.BIOSOURCE, Item.SAMPLE, Item.EXTRACT,
    64       Item.LABELEDEXTRACT, Item.TAG, Item.BIOMATERIALEVENT,
     64      Item.TAG, Item.BIOMATERIALEVENT,
    6565      Item.BIOMATERIALLIST, Item.BIOPLATE, Item.BIOWELL, Item.BIOPLATETYPE,
    6666      Item.BIOPLATEEVENT, Item.BIOPLATEEVENTTYPE,
  • trunk/src/clients/web/net/sf/basedb/clients/web/resources/common.properties

    r5632 r5641  
    104104item.extract  Extract
    105105item.extract+ Extracts
    106 item.labeledextract Labeled extract
    107 item.labeledextract+  Labeled extracts
    108106item.tag  Tag
    109107item.tag+ Tags
  • trunk/src/clients/web/net/sf/basedb/clients/web/resources/menu.properties

    r5632 r5641  
    111111extracts.tooltip.1  Manage extracts
    112112extracts.tooltip.0  You do not have permission to manage extracts
    113 labeledextracts.tooltip.1 Manage labeled extracts
    114 labeledextracts.tooltip.0 You do not have permission to manage labeled extracts
    115113tags.tooltip.1  Manage tags
    116114tags.tooltip.0  You do not have permission to manage tags
  • trunk/src/core/net/sf/basedb/core/BioMaterialEvent.java

    r5559 r5641  
    353353        defaultProtocolType = Project.Default.EXTRACTING_PROTOCOL;
    354354      }
    355       else if (parentType == Item.LABELEDEXTRACT)
    356       {
    357         defaultProtocolType = Project.Default.LABELING_PROTOCOL;
    358       }
    359355    }
    360356   
     
    752748      case HYBRIDIZATION:
    753749      {
    754         if (bioMaterial.getType() != Item.LABELEDEXTRACT)
     750        if (bioMaterial.getType() != Item.EXTRACT)
    755751        {
    756752          throw new InvalidDataException("The source for a hybridization must be a labeled extract");
     
    861857        break;
    862858      }
    863       case LABELEDEXTRACT:
    864       {
    865         if (pooled)
    866         {
    867           query = LabeledExtract.getQuery();
    868         }
    869         else
    870         {
    871           query = Extract.getQuery();
    872         }
    873         break;
    874       }
    875859      case HYBRIDIZATION:
    876860      {
    877         query = LabeledExtract.getQuery();
     861        query = Extract.getQuery();
    878862        break;
    879863      }
  • trunk/src/core/net/sf/basedb/core/BioPlateType.java

    r5456 r5641  
    200200    Get the biomaterial type that can be stored on plates of
    201201    this type.
    202     @return One of {@link Item#SAMPLE}, {@link Item#EXTRACT}, {@link Item#LABELEDEXTRACT}
     202    @return One of {@link Item#SAMPLE}, {@link Item#EXTRACT}
    203203      or null if the plate can store mixed types
    204204   */
     
    211211  /**
    212212    Set the type of biomaterial that can be stored on plates with
    213     this type. Valid values are {@link Item#SAMPLE} {@link Item#EXTRACT},
    214     {@link Item#LABELEDEXTRACT} and null. The value can't be changed
     213    this type. Valid values are {@link Item#SAMPLE}, {@link Item#EXTRACT},
     214    and null. The value can't be changed
    215215    after the plate type has been saved to the database.
    216216    @param type A biomaterial item type or null
     
    228228        "bioMaterialType of BioPlateType[id=" + getId() + "]");
    229229    }
    230     boolean ok = type == null || type == Item.SAMPLE || type == Item.EXTRACT ||
    231       type == Item.LABELEDEXTRACT;
     230    boolean ok = type == null || type == Item.SAMPLE || type == Item.EXTRACT;
    232231    if (!ok)
    233232    {
    234       throw new InvalidDataException("type must be one of SAMPLE, EXTRACT, LABELEDEXTRACT or null");
     233      throw new InvalidDataException("type must be one of SAMPLE, EXTRACT or null");
    235234    }
    236235    getData().setBioMaterialType(type == null ? null : type.getValue());   
  • trunk/src/core/net/sf/basedb/core/Extract.java

    r5632 r5641  
    5252  public static final Item TYPE = Item.EXTRACT;
    5353 
     54  /**
     55    The id for the <code>ExtractType</code> item representing a
     56    labeled extract.
     57    @since 3.0
     58  */
     59  public static final String LABELED = "net.sf.basedb.core.ExtractType.LABELED";
     60
    5461  /**
    5562    Create a new <code>Extract</code> item.
     
    180187    Check that:
    181188    <ul>
    182     <li>no {@link LabeledExtract}:s has been created from this item
     189    <li>no {@link PhysicalBioAssay}:s has been created from this item
    183190    <li>no {@link Extract}:s has been created from this item
    184191    </ul>
     
    187194    throws BaseException
    188195  {   
    189     return countLabeledExtracts() > 0 || super.isUsed();
     196    return /*countPhysicalBioAssays() > 0 || */ super.isUsed();
    190197  }
    191198  /**
    192199    Get all:
    193200    <ul>
    194     <li>{@link LabeledExtract}:s created from this extract
     201    <li>{@link PhysicalBioassay}:s created from this extract
    195202    <ul>
    196203    @since 2.2
     
    200207  {
    201208    Set<ItemProxy> using = super.getUsingItems();
    202     org.hibernate.Session session = getDbControl().getHibernateSession();
    203     org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session,
    204       "GET_LABELED_EXTRACTS_FOR_EXTRACT", "le.id");
    205       /*
    206         SELECT {1}
    207         FROM LabeledExtractData le
    208         WHERE le.parent = :extract
    209       */
    210     query.setEntity("extract", this.getData());
    211     addUsingItems(using, Item.LABELEDEXTRACT, query);
     209    // TODO
    212210    return using;
    213211  }
    214212  // -------------------------------------------
    215213
     214  public Tag getTag()
     215  {
     216    return getDbControl().getItem(Tag.class, getData().getTag());
     217  }
     218 
     219  public void setTag(Tag tag)
     220  {
     221    checkPermission(Permission.WRITE);
     222    if (tag != null) tag.checkPermission(Permission.USE);
     223    getData().setTag(tag == null ? null : tag.getData());
     224  }
     225 
    216226  /**
    217227    Get the {@link Sample} that is the parent of this extract.
     
    252262  }
    253263 
    254   /**
    255     Create a new {@link LabeledExtract} from this extract.
    256     @param label The labeling compound used to label the extract
    257     @param usedQuantity The quantity used from this extract or null
    258       if not known
    259     @return The new <code>LabeledExtract</code> item
    260     @throws PermissionDeniedException If the logged in user doesn't have
    261       use permission for this extract or use permission for the label
    262     @throws BaseException If there is another error
    263   */
    264   public LabeledExtract newLabeledExtract(Tag tag, Float usedQuantity)
    265     throws PermissionDeniedException, BaseException
    266   {
    267     return newLabeledExtract(tag, usedQuantity, null);
    268   }
    269 
    270   /**
    271     Create a new {@link LabeledExtract} from this extract as
    272     part of a master bioplate event.
    273     @param label The labeling compound used to label the extract
    274     @param usedQuantity The quantity used from this extract or null
    275       if not known
    276     @param master The master bioplate event participant or null
    277     @return The new <code>LabeledExtract</code> item
    278     @throws PermissionDeniedException If the logged in user doesn't have
    279       use permission for this extract or use permission for the label
    280     @throws BaseException If there is another error
    281     @since 2.17
    282   */
    283   public LabeledExtract newLabeledExtract(Tag tag, Float usedQuantity, BioPlateEventParticipant master)
    284     throws PermissionDeniedException, BaseException
    285   {
    286     LabeledExtract le = LabeledExtract.getNew(getDbControl(), tag, master);
    287     le.setExtract(this, usedQuantity);
    288     return le;
    289   }
    290 
    291  
    292   /**
    293     Get a query that returns all labeled extracts created from this extract.
    294     @return An {@link ItemQuery} object
    295   */
    296   public ItemQuery<LabeledExtract> getLabeledExtracts()
    297   {
    298     ItemQuery<LabeledExtract> query = LabeledExtract.getQuery();
    299     query.restrictPermanent(
    300       Restrictions.eq(
    301         Hql.property("parent"),
    302         Hql.entity(this)
    303       )
    304     );
    305     return query;
    306   }
     264
     265  public void setExtract(Extract extract, Float usedQuantity)
     266    throws PermissionDeniedException, InvalidDataException, BaseException
     267  {
     268    checkPermission(Permission.WRITE);
     269    if (extract != null) extract.checkPermission(Permission.USE);
     270   
     271    getData().setPooled(true);
     272
     273    getData().setParent(extract == null ? null : extract.getData());
     274    getCreationEvent().setSource(extract, usedQuantity);
     275  }
     276
    307277 
    308278  /**
     
    319289    query.restrictPermanent(Restrictions.eq(Hql.index("src", null), Hql.entity(this)));
    320290    return query;
    321   }
    322  
    323   /**
    324       Gets the number of {@link LabeledExtract} that are create from this item.
    325       @return Number of <code>LabeledExtracts</code>
    326       @throws BaseException If there is any error.
    327   */
    328   public long countLabeledExtracts()
    329     throws BaseException
    330   {
    331     org.hibernate.Session session = getDbControl().getHibernateSession();
    332     org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session,
    333       "GET_LABELED_EXTRACTS_FOR_EXTRACT", "count(*)");
    334     /*
    335       SELECT {1}
    336       FROM LabeledExtractData le
    337       WHERE le.parent = :extract
    338     */
    339     query.setEntity("extract", this.getData());
    340     return HibernateUtil.loadData(Long.class, query);
    341291  }
    342292 
     
    365315 
    366316  /**
    367     Count the number of child extracts or labeled extracts.
    368     @param pooled TRUE = count child extracts, FALSE = count child labeled extracts
     317    Count the number of child extracts. Since an extract
     318    can't have non-pooled children, this method always return
     319    0 if pooled = false.
    369320    @since 2.16
    370321  */
     
    372323  public long countChildren(boolean pooled)
    373324  {
    374     return pooled ? countExtracts() : countLabeledExtracts();
     325    return pooled ? countExtracts() : 0;
     326  }
     327
     328  /**
     329    Get a query that returns all hybridizations created from this
     330    extract.
     331    @return An {@link ItemQuery} object
     332  */
     333  public ItemQuery<Hybridization> getHybridizations()
     334  {
     335    ItemQuery<Hybridization> query = Hybridization.getQuery();
     336    query.joinPermanent(Hql.innerJoin("creationEvent.sources", Item.EXTRACT.getAlias()));
     337    query.restrictPermanent(
     338      Restrictions.eq(
     339        Hql.index(Item.EXTRACT.getAlias(), null),
     340        Hql.entity(this)
     341      )
     342    );
     343    return query;
    375344  }
    376345
  • trunk/src/core/net/sf/basedb/core/Hybridization.java

    r5559 r5641  
    240240    {
    241241      BioMaterialEvent event = getCreationEvent();
    242       ItemQuery<LabeledExtract> query = (ItemQuery<LabeledExtract>)event.getSources();
     242      ItemQuery<Extract> query = (ItemQuery<Extract>)event.getSources();
    243243      query.include(Include.ALL);
    244244      if (arrayNum > 0)
     
    361361  */
    362362  @SuppressWarnings("unchecked")
    363   public ItemQuery<LabeledExtract> getLabeledExtracts(int arrayNum)
    364   {
    365     ItemQuery<LabeledExtract> query = (ItemQuery<LabeledExtract>)getCreationEvent().getSources();
     363  public ItemQuery<Extract> getLabeledExtracts(int arrayNum)
     364  {
     365    ItemQuery<Extract> query = (ItemQuery<Extract>)getCreationEvent().getSources();
    366366    if (arrayNum > 0)
    367367    {
  • trunk/src/core/net/sf/basedb/core/Install.java

    r5632 r5641  
    344344      createRoleKey(Item.SAMPLE, "Samples", "Gives access to samples", users_create);
    345345      createRoleKey(Item.EXTRACT, "Extracts", "Gives access to extracts", users_create);
    346       createRoleKey(Item.LABELEDEXTRACT, "Labeled extracts", "Gives access to labeled extracts", users_create);
    347346      createRoleKey(Item.BIOPLATE, "Bio plates", "Gives access to bio plates", users_create);
    348347      createRoleKey(Item.BIOPLATETYPE, "Bio plate types", "Gives access to bio plate types", guests_use_power_users_all);
     
    441440      createItemSubtype(Item.PROTOCOL, Protocol.SAMPLING, "Sampling", "Protocols used for creating samples.", protocolFileType);
    442441      createItemSubtype(Item.PROTOCOL, Protocol.EXTRACTION, "Extraction", "Protocols used for creating extracts.", protocolFileType);
    443       createItemSubtype(Item.PROTOCOL, Protocol.LABELING, "Labeling", "Protocols used for creating labeled extracts.", protocolFileType);
     442      ItemSubtypeData labelingProtocol = createItemSubtype(Item.PROTOCOL, Protocol.LABELING, "Labeling",
     443          "Protocols used for creating labeled extracts.", protocolFileType);
    444444      createItemSubtype(Item.PROTOCOL, Protocol.POOLING, "Pooling", "Protocols used for creating pooled biomaterails.", protocolFileType);
    445445      createItemSubtype(Item.PROTOCOL, Protocol.HYBRIDIZATION, "Hybridization", "Protocols used for creating hybridizations.", protocolFileType);
     
    463463      ItemSubtypeData barcodeTag = createItemSubtype(Item.TAG, Tag.BARCODE, "Barcode",
    464464        "Adaptor used to tag libraries to enable multiplexing in sequencing experiments.");
     465     
     466      // Biomaterial subtypes
     467      createItemSubtype(Item.EXTRACT, Extract.LABELED, "Labeled extract",
     468        "A labeled extract is an extract which has been tagged with a label",
     469        labelTag, labelingProtocol);
    465470     
    466471      // Hardware
     
    600605      BioPlateTypeData extractReactionPlate = createBioPlateType("Extract reaction plate", "A generic reaction plate for extracts.",
    601606          Item.EXTRACT, BioWell.LockMode.LOCKED_AFTER_ADD);
    602       BioPlateTypeData labeledExtractReactionPlate =
    603         createBioPlateType("Labeled extract reaction plate", "A generic reaction plate for labeled extracts.",
    604             Item.LABELEDEXTRACT, BioWell.LockMode.LOCKED_AFTER_ADD);
    605607     
    606608      BioPlateEventTypeData genericEvent = createBioPlateEventType("Generic", BioPlateEventType.GENERIC,
  • trunk/src/core/net/sf/basedb/core/Item.java

    r5632 r5641  
    293293  EXTRACT(203, "Extract", "xtr", Extract.class, ExtractData.class, DefinedPermissions.shareable,
    294294    410),
    295   /**
    296     The item is a {@link LabeledExtract}.
    297   */
    298   LABELEDEXTRACT(204, "Labeled extract", "lbe", LabeledExtract.class, LabeledExtractData.class, DefinedPermissions.shareable,
    299     400),
     295
    300296  /**
    301297    The item is a {@link BioMaterialEvent}.
  • trunk/src/core/net/sf/basedb/core/Project.java

    r5630 r5641  
    841841    SAMPLING_PROTOCOL("default_sampling_protocol", "Sampling protocol", Item.PROTOCOL, Protocol.SAMPLING, Item.SAMPLE),
    842842    EXTRACTING_PROTOCOL("default_extracting_protocol", "Extracting protocol", Item.PROTOCOL, Protocol.EXTRACTION, Item.EXTRACT),   
    843     LABELING_PROTOCOL("default_labeling_protocol", "Labeling protocol", Item.PROTOCOL, Protocol.LABELING, Item.LABELEDEXTRACT),
    844843    HYBRIDIZATION_PROTOCOL("default_hybridization_protocol", "Hybridization protocol", Item.PROTOCOL, Protocol.HYBRIDIZATION, Item.HYBRIDIZATION),
    845844    FEATURE_EXTRACTION_PROTOCOL("default_feature_extraction_protocol", "Feat. extraction protocol", Item.PROTOCOL, Protocol.FEATURE_EXTRACTION, Item.RAWBIOASSAY),
  • trunk/src/core/net/sf/basedb/core/Tag.java

    r5632 r5641  
    2525import java.util.Set;
    2626
    27 import net.sf.basedb.core.query.Restrictions;
    28 import net.sf.basedb.core.query.Hql;
    2927import net.sf.basedb.core.data.TagData;
    3028
     
    205203  // -------------------------------------------
    206204
    207   /**
    208     Get a query that returns all labeled extracts labeled
    209     with this label.
    210     @return An {@link ItemQuery} object
    211    * @throws BaseException If the query could not be created and configured.
    212   */
    213   public ItemQuery<LabeledExtract> getLabeledExtracts()
    214     throws BaseException
    215   {
    216     ItemQuery<LabeledExtract> query = LabeledExtract.getQuery();
    217     query.restrictPermanent(
    218       Restrictions.eq(
    219         Hql.property("label"),
    220         Hql.entity(this)
    221       )
    222     );
    223     return query;
    224   }
     205
    225206}
  • trunk/src/core/net/sf/basedb/util/biomaterial/ListUtil.java

    r4723 r5641  
    3838import net.sf.basedb.core.Item;
    3939import net.sf.basedb.core.ItemQuery;
    40 import net.sf.basedb.core.LabeledExtract;
    4140import net.sf.basedb.core.PermissionDeniedException;
    4241import net.sf.basedb.core.Sample;
     
    7877    {
    7978      query = Extract.getQuery();
    80     }
    81     else if (biomaterialType == Item.LABELEDEXTRACT)
    82     {
    83       query = LabeledExtract.getQuery();
    8479    }
    8580    else
     
    131126    <code>sourceItem</code>:s into a collection with <code>destinationItem</code>:s
    132127    by following parent/child paths. Both the source and destination must be
    133     one of {@link Item#BIOSOURCE}, {@link Item#SAMPLE}, {@link Item#EXTRACT}
    134     or {@link Item#LABELEDEXTRACT}.
     128    one of {@link Item#BIOSOURCE}, {@link Item#SAMPLE} or {@link Item#EXTRACT}.
    135129   
    136130    @param dc The DbControl the transformers should use for loading
     
    145139  {
    146140    // The allowed item types
    147     final List<Item> INDEX = Arrays.asList(new Item[] { Item.BIOSOURCE, Item.SAMPLE, Item.EXTRACT, Item.LABELEDEXTRACT });
     141    final List<Item> INDEX = Arrays.asList(new Item[] { Item.BIOSOURCE, Item.SAMPLE, Item.EXTRACT });
    148142    int dIndex = INDEX.indexOf(destinationItem);
    149143    if (dIndex == -1)
     
    189183          // Moving down
    190184          if (pooled) transformers.add(new PooledChildrenTransformer<Extract>(dc, true, Extract.getQuery()));
    191           transformers.add(new ExtractToLabeledExtractTransformer(dc));
    192185        }
    193186        else
     
    198191        }
    199192      }
    200       else if (sourceItem == Item.LABELEDEXTRACT)
    201       {
    202         // Moving up
    203         if (pooled) transformers.add(new PooledParentsTransformer<LabeledExtract>(dc, true, LabeledExtract.getQuery()));
    204         transformers.add(new LabeledExtractToExtractTransformer(dc));
    205       }
    206193      sIndex += step;
    207194      sourceItem = INDEX.get(sIndex);
  • trunk/src/core/net/sf/basedb/util/overview/loader/BasicItemNodeLoaderFactory.java

    r5500 r5641  
    218218    registerCheckedNodeLoader(Item.SAMPLE, SampleLoader.class);
    219219    registerCheckedNodeLoader(Item.EXTRACT, ExtractLoader.class);
    220     registerCheckedNodeLoader(Item.LABELEDEXTRACT, LabeledExtractLoader.class);
    221220    registerCheckedNodeLoader(Item.ARRAYDESIGN, ArrayDesignLoader.class);
    222221    registerCheckedNodeLoader(Item.ARRAYBATCH, ArrayBatchLoader.class);
  • trunk/src/core/net/sf/basedb/util/overview/loader/ExtractLoader.java

    r5500 r5641  
    2424import net.sf.basedb.core.DbControl;
    2525import net.sf.basedb.core.Extract;
     26import net.sf.basedb.core.Hybridization;
    2627import net.sf.basedb.core.Item;
    2728import net.sf.basedb.core.ItemQuery;
    2829import net.sf.basedb.core.ItemResultIterator;
    29 import net.sf.basedb.core.LabeledExtract;
    30 import net.sf.basedb.core.PermissionDeniedException;
     30import net.sf.basedb.core.RawBioAssay;
    3131import net.sf.basedb.core.Sample;
    3232import net.sf.basedb.util.overview.Fix;
     
    3434import net.sf.basedb.util.overview.OverviewUtil;
    3535import net.sf.basedb.util.overview.Validator;
     36import net.sf.basedb.util.overview.filter.ItemTypeFilter;
    3637import net.sf.basedb.util.overview.node.ChildNodeDirection;
    3738import net.sf.basedb.util.overview.node.NameableNameGenerator;
     
    4243  Node loader implementation for extracts. The forward-loading
    4344  direction goes from {@link Sample}:s -&gt; {@link Extract}:s -&gt;
    44   {@link LabeledExtract}:s. The reverse-loading direction is the opposite
     45  {@link Hybridization}:s. The reverse-loading direction is the opposite
    4546  direction. In both cases we also need to consider pooled extracts.
    4647
     
    6566  /**
    6667    Create forward-loading extract nodes from a given parent sample
    67     of extract. In both cases the returned node is a folder-type node
     68    or extract. In both cases the returned node is a folder-type node
    6869    that contains the child extracts.
    6970    @return The folder node for the extracts
     
    8687 
    8788  /**
    88     Create reverse-loading extract nodes from a labeled extract node
     89    Create reverse-loading extract nodes from a physical bioassay node
    8990    or from a pooled extract. In the first case, the returned node is an
    9091    item-type node with the parent extract. In the second case, the returned
     
    9798    Node returnNode = null;
    9899    Item parentItem = parentNode.getItemType();
    99     if (parentItem == Item.LABELEDEXTRACT)
    100     {
    101       returnNode = createReverseNode((LabeledExtract)parentNode.getItem(dc), dc, context, parentNode);
     100    if (parentItem == Item.HYBRIDIZATION)
     101    {
     102      returnNode = createReverseNode((Hybridization)parentNode.getItem(dc), dc, context, parentNode);
    102103    }
    103104    else if (parentItem == Item.EXTRACT)
     
    128129
    129130  /**
    130     Loads the pooled extracts and labled extracts that has been created from
     131    Loads the pooled extracts and hybridizations that has been created from
    131132    this extract.
    132133    @see ExtractLoader#createForwardNode(DbControl, OverviewContext, Node)
    133     @see ExtractLoader#createForwardNode(DbControl, OverviewContext, Node)
     134    @see HybridizationLoader#createForwardNode(DbControl, OverviewContext, Node)
    134135  */
    135136  @Override
    136137  protected void loadForwardChildNodes(DbControl dc, OverviewContext context, Node extractNode)
    137138  {
    138     getNodeLoader(context, Item.LABELEDEXTRACT).createForwardNode(dc, context, extractNode);
     139    getNodeLoader(context, Item.HYBRIDIZATION).createForwardNode(dc, context, extractNode);
    139140    getNodeLoader(context, Item.EXTRACT).createForwardNode(dc, context, extractNode);
    140141  }
     
    202203
    203204  /**
     205    Create reverse-loading extract nodes from a hybridization. Eg. the child nodes
     206    are the extracts that has been used on a hybridization.
     207  */
     208  private Node createReverseNode(Hybridization hyb, DbControl dc, OverviewContext context, Node parentNode)
     209  {
     210    Node folderNode = null;
     211    NodeFactory<Extract> nf = getNodeFactory(dc, context);
     212 
     213    // If we have followed this path from a raw bioassay we should
     214    // only load labeled extracts on the specific 'array index'
     215    Node rbaNode = parentNode.getFirstParent(new ItemTypeFilter(Item.RAWBIOASSAY));
     216    int arrayNum = 0;
     217    if (rbaNode != null)
     218    {
     219      arrayNum = ((RawBioAssay)rbaNode.getItem()).getArrayNum();
     220    }
     221    ItemQuery<Extract> query = context.initQuery(hyb.getLabeledExtracts(arrayNum), "name");
     222    ItemResultIterator<Extract> it = query.iterate(dc);
     223    while (it.hasNext())
     224    {
     225      Extract extract = it.next();
     226      if (folderNode == null)
     227      {
     228        folderNode = new Node("labeledextracts", "Labeled extracts", parentNode, ChildNodeDirection.REVERSE);
     229      }
     230      createItemNode(nf, extract, extract, false, folderNode, ChildNodeDirection.REVERSE);
     231    }
     232    postValidateFolder(nf, folderNode, parentNode, rbaNode == null);
     233    return folderNode;
     234  }
     235
     236 
     237  /**
    204238    Create a reverse-loading extract node from a labeled extract. Eg. the child node
    205239    is the extract that is the parent of the (non-pooled) labeled extract.
    206240  */
     241  /*
    207242  private Node createReverseNode(LabeledExtract labeledExtract, DbControl dc, OverviewContext context, Node parentNode)
    208243  {
     
    222257    return extractNode;
    223258  }
     259  */
    224260
    225261  /**
  • trunk/src/core/net/sf/basedb/util/overview/loader/HybridizationLoader.java

    r5500 r5641  
    2424import net.sf.basedb.core.ArraySlide;
    2525import net.sf.basedb.core.DbControl;
     26import net.sf.basedb.core.Extract;
    2627import net.sf.basedb.core.Hybridization;
    2728import net.sf.basedb.core.Item;
    2829import net.sf.basedb.core.ItemQuery;
    2930import net.sf.basedb.core.ItemResultIterator;
    30 import net.sf.basedb.core.LabeledExtract;
    3131import net.sf.basedb.core.PermissionDeniedException;
    3232import net.sf.basedb.core.RawBioAssay;
     
    8282    Node returnNode = null;
    8383    Item parentType = parentNode.getItemType();
    84     if (parentType == Item.LABELEDEXTRACT)
    85     {
    86       returnNode = createForwardNode((LabeledExtract)parentNode.getItem(dc), dc, context, parentNode);
     84    if (parentType == Item.EXTRACT)
     85    {
     86      returnNode = createForwardNode((Extract)parentNode.getItem(dc), dc, context, parentNode);
    8787    }
    8888    else if (parentType == Item.ARRAYSLIDE)
     
    166166    }
    167167    Item parentItemType = parent == null ? null : parent.getItemType();
    168     if (parentItemType == Item.LABELEDEXTRACT)
     168    if (parentItemType == Item.EXTRACT)
    169169    {
    170170      getNodeLoader(context, Item.ARRAYSLIDE).createReverseNode(dc, context, hybNode);
     
    172172    if (parentItemType == Item.ARRAYSLIDE)
    173173    {
    174       getNodeLoader(context, Item.LABELEDEXTRACT).createReverseNode(dc, context, hybNode);
     174      getNodeLoader(context, Item.EXTRACT).createReverseNode(dc, context, hybNode);
    175175    }
    176176  }
     
    186186  protected void loadReverseChildNodes(DbControl dc, OverviewContext context, Node hybNode)
    187187  {
    188     getNodeLoader(context, Item.LABELEDEXTRACT).createReverseNode(dc, context, hybNode);
     188    getNodeLoader(context, Item.EXTRACT).createReverseNode(dc, context, hybNode);
    189189    getNodeLoader(context, Item.ARRAYSLIDE).createReverseNode(dc, context, hybNode);
    190190  }
     
    195195    that has a given labeled extract as a source.
    196196  */
    197   private Node createForwardNode(LabeledExtract extract, DbControl dc, OverviewContext context, Node parentNode)
     197  private Node createForwardNode(Extract extract, DbControl dc, OverviewContext context, Node parentNode)
    198198  {
    199199    NodeFactory<Hybridization> nf = getNodeFactory(dc, context);
  • trunk/src/core/net/sf/basedb/util/overview/loader/RawBioAssayLoader.java

    r5500 r5641  
    2525import net.sf.basedb.core.DbControl;
    2626import net.sf.basedb.core.Experiment;
     27import net.sf.basedb.core.Extract;
    2728import net.sf.basedb.core.Hybridization;
    2829import net.sf.basedb.core.Item;
    2930import net.sf.basedb.core.ItemQuery;
    3031import net.sf.basedb.core.ItemResultIterator;
    31 import net.sf.basedb.core.LabeledExtract;
    3232import net.sf.basedb.core.RawBioAssay;
    3333import net.sf.basedb.core.Scan;
     
    8787    if (hybNode != null)
    8888    {
    89       Node labeledExtractNode = hybNode.getFirstParent(new ItemTypeFilter(Item.LABELEDEXTRACT));
     89      Node labeledExtractNode = hybNode.getFirstParent(new ItemTypeFilter(Item.EXTRACT));
    9090      if (labeledExtractNode != null)
    9191      {
    9292        hyb = (Hybridization)hybNode.getItem(dc);
    93         LabeledExtract extract = (LabeledExtract)labeledExtractNode.getItem();
     93        Extract extract = (Extract)labeledExtractNode.getItem();
    9494        arrayNum = hyb.getCreationEvent().getSourceGroup(extract);
    9595      }
  • trunk/src/core/net/sf/basedb/util/overview/loader/ScanLoader.java

    r5500 r5641  
    2323
    2424import net.sf.basedb.core.DbControl;
     25import net.sf.basedb.core.Extract;
    2526import net.sf.basedb.core.Hybridization;
    2627import net.sf.basedb.core.Item;
    2728import net.sf.basedb.core.ItemQuery;
    2829import net.sf.basedb.core.ItemResultIterator;
    29 import net.sf.basedb.core.LabeledExtract;
    3030import net.sf.basedb.core.PermissionDeniedException;
    3131import net.sf.basedb.core.RawBioAssay;
     
    8080    // to be able to load the correct raw bioassays later -- The same hyb may have
    8181    // other raw bioassays that are NOT related to the same labeled extract
    82     Node labeledExtractNode = hybridizationNode.getFirstParent(new ItemTypeFilter(Item.LABELEDEXTRACT));
     82    Node labeledExtractNode = hybridizationNode.getFirstParent(new ItemTypeFilter(Item.EXTRACT));
    8383    int arrayIndex = 0;
    8484    if (labeledExtractNode != null)
    8585    {
    86       LabeledExtract extract = (LabeledExtract)labeledExtractNode.getItem();
     86      Extract extract = (Extract)labeledExtractNode.getItem();
    8787      arrayIndex = hyb.getCreationEvent().getSourceGroup(extract);
    8888    }
  • trunk/src/core/net/sf/basedb/util/overview/validator/BasicItemNodeValidatorFactory.java

    r5500 r5641  
    194194    registerCheckedNodeValidator(Item.SAMPLE, SampleValidator.class);
    195195    registerCheckedNodeValidator(Item.EXTRACT, ExtractValidator.class);
    196     registerCheckedNodeValidator(Item.LABELEDEXTRACT, LabeledExtractValidator.class);
    197196    registerCheckedNodeValidator(Item.ARRAYDESIGN, ArrayDesignValidator.class);
    198197    registerCheckedNodeValidator(Item.ARRAYBATCH, ArrayBatchValidator.class);
  • trunk/src/core/net/sf/basedb/util/overview/validator/ExtractValidator.java

    r4764 r5641  
    2525import net.sf.basedb.core.Extract;
    2626import net.sf.basedb.core.Item;
    27 import net.sf.basedb.core.LabeledExtract;
    2827import net.sf.basedb.util.overview.Fix;
    2928import net.sf.basedb.util.overview.Validator;
     
    6463    Item parentType = parentNode.getItemType();
    6564    BasicItem parentItem = parentNode.getItem();
    66     if (parentType == Item.LABELEDEXTRACT)
     65    /*
     66    if (parentType == Item.PHYSICALBIOASSAY)
    6767    {
    6868      fix =  new Fix("Add parent extract to '" + ((LabeledExtract)parentItem).getName() + "'", parentItem);
    6969    }
    70     else if (parentType == Item.EXTRACT)
     70    else */if (parentType == Item.EXTRACT)
    7171    {
    7272      fix = new Fix("Add parent extracts to '" + ((Extract)parentItem).getName() + "'", parentItem);
  • trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/AbstractItemImporter.java

    r5632 r5641  
    6161import net.sf.basedb.core.ItemSubtype;
    6262import net.sf.basedb.core.Job;
    63 import net.sf.basedb.core.LabeledExtract;
    6463import net.sf.basedb.core.NumberOutOfRangeException;
    6564import net.sf.basedb.core.Permission;
     
    8483import net.sf.basedb.core.StringTooLongException;
    8584import net.sf.basedb.core.StringUtil;
     85import net.sf.basedb.core.SystemItems;
    8686import net.sf.basedb.core.Tag;
    8787import net.sf.basedb.core.Type;
     
    14431443  {
    14441444    if (identifier == null) return null;
    1445     if (extractQuery == null) extractQuery = initReferenceQuery(dc, idMethod, Extract.getQuery());
     1445    if (extractQuery == null)
     1446    {
     1447      extractQuery = initReferenceQuery(dc, idMethod, Extract.getQuery());
     1448      extractQuery.restrictPermanent(Restrictions.eq(Hql.property("itemSubtype"), null));
     1449
     1450    }
    14461451    return findReferencedItem(dc, idMethod, extractQuery, identifier, false);
    14471452  }
    14481453
    1449   private ItemQuery<LabeledExtract> labeledExtractQuery;
     1454  private ItemQuery<Extract> labeledExtractQuery;
    14501455  /**
    14511456    Find a labled extract with a given identifier. This is a utility method that
     
    14611466    @return A labeled extract, or null if no item could be found
    14621467  */
    1463   protected LabeledExtract findLabeledExtract(DbControl dc, IdMethod idMethod, String identifier)
     1468  protected Extract findLabeledExtract(DbControl dc, IdMethod idMethod, String identifier)
    14641469  {
    14651470    if (identifier == null) return null;
    14661471    if (labeledExtractQuery == null)
    14671472    {
    1468       labeledExtractQuery = initReferenceQuery(dc, idMethod, LabeledExtract.getQuery());
     1473      labeledExtractQuery = initReferenceQuery(dc, idMethod, Extract.getQuery());
     1474      labeledExtractQuery.restrictPermanent(
     1475        Restrictions.eq(
     1476          Hql.property("itemSubtype"),
     1477          Expressions.integer(SystemItems.getId(Extract.LABELED))
     1478        )
     1479      );
    14691480    }
    14701481    return findReferencedItem(dc, idMethod, labeledExtractQuery, identifier, false);
  • trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/ArraySlideImporter.java

    r5612 r5641  
    3131import net.sf.basedb.core.Item;
    3232import net.sf.basedb.core.ItemQuery;
    33 import net.sf.basedb.core.LabeledExtract;
    3433import net.sf.basedb.core.PluginParameter;
    3534import net.sf.basedb.core.plugin.GuiContext;
     
    166165  {
    167166    nameMapper = getMapper(ffp, (String)job.getValue("nameColumnMapping"),
    168         cropStrings ? LabeledExtract.MAX_NAME_LENGTH : null, null);
     167        cropStrings ? ArraySlide.MAX_NAME_LENGTH : null, null);
    169168    descriptionMapper = getMapper(ffp, (String)job.getValue("descriptionColumnMapping"),
    170         cropStrings ? LabeledExtract.MAX_DESCRIPTION_LENGTH : null, null);
     169        cropStrings ? ArraySlide.MAX_DESCRIPTION_LENGTH : null, null);
    171170    arrayBatchMapper = getMapper(ffp, (String)job.getValue("arrayBatchColumnMapping"), null, null);
    172171    indexMapper = getMapper(ffp, (String)job.getValue("indexColumnMapping"), null, null);
  • trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/BioPlateImporter.java

    r5630 r5641  
    3434import net.sf.basedb.core.ItemQuery;
    3535import net.sf.basedb.core.ItemSubtype;
    36 import net.sf.basedb.core.LabeledExtract;
    3736import net.sf.basedb.core.PlateGeometry;
    3837import net.sf.basedb.core.PluginParameter;
     
    172171  {
    173172    nameMapper = getMapper(ffp, (String)job.getValue("nameColumnMapping"),
    174         cropStrings ? LabeledExtract.MAX_NAME_LENGTH : null, null);
     173        cropStrings ? BioPlate.MAX_NAME_LENGTH : null, null);
    175174    descriptionMapper = getMapper(ffp, (String)job.getValue("descriptionColumnMapping"),
    176         cropStrings ? LabeledExtract.MAX_DESCRIPTION_LENGTH : null, null);
     175        cropStrings ? BioPlate.MAX_DESCRIPTION_LENGTH : null, null);
    177176    bioPlateTypeMapper = getMapper(ffp, (String)job.getValue("bioPlateTypeColumnMapping"), null, null);
    178177    plateGeometryMapper = getMapper(ffp, (String)job.getValue("plateGeometryColumnMapping"), null, null);
  • trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/HybridizationImporter.java

    r5630 r5641  
    3030import net.sf.basedb.core.BioMaterialEvent;
    3131import net.sf.basedb.core.DbControl;
     32import net.sf.basedb.core.Extract;
    3233import net.sf.basedb.core.Hardware;
    3334import net.sf.basedb.core.Hybridization;
     
    3637import net.sf.basedb.core.ItemQuery;
    3738import net.sf.basedb.core.ItemSubtype;
    38 import net.sf.basedb.core.LabeledExtract;
    3939import net.sf.basedb.core.Permission;
    4040import net.sf.basedb.core.PermissionDeniedException;
     
    289289    {
    290290      String nameOrId = parentMapper.getValue(data);
    291       LabeledExtract parent = findLabeledExtract(dc, FallbackIdMethod.NAME_OR_EXTERNALID_OR_ID, nameOrId);
     291      Extract parent = findExtract(dc, FallbackIdMethod.NAME_OR_EXTERNALID_OR_ID, nameOrId);
    292292      if (parent != null)
    293293      {
  • trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/LabeledExtractImporter.java

    r5632 r5641  
    3434import net.sf.basedb.core.ItemQuery;
    3535import net.sf.basedb.core.ItemSubtype;
    36 import net.sf.basedb.core.LabeledExtract;
    3736import net.sf.basedb.core.PluginParameter;
    3837import net.sf.basedb.core.Protocol;
     
    4039import net.sf.basedb.core.Tag;
    4140import net.sf.basedb.core.plugin.GuiContext;
     41import net.sf.basedb.core.query.Expressions;
     42import net.sf.basedb.core.query.Hql;
     43import net.sf.basedb.core.query.Restrictions;
    4244import net.sf.basedb.util.Values;
    4345import net.sf.basedb.util.parser.FlatFileParser;
     
    5355*/
    5456public class LabeledExtractImporter
    55   extends AbstractItemImporter<LabeledExtract>
     57  extends AbstractItemImporter<Extract>
    5658{
    5759
    5860  private static final Set<GuiContext> guiContexts = 
    59     Collections.singleton(new GuiContext(Item.LABELEDEXTRACT, GuiContext.Type.LIST));
     61    Collections.singleton(new GuiContext(Item.EXTRACT, GuiContext.Type.LIST));
    6062
    6163
     
    149151  */
    150152  @Override
    151   protected ItemQuery<LabeledExtract> createItemQuery()
    152   {
    153     return LabeledExtract.getQuery();
     153  protected ItemQuery<Extract> createItemQuery()
     154  {
     155    ItemQuery<Extract> query = Extract.getQuery();
     156    query.restrictPermanent(
     157        Restrictions.eq(
     158          Hql.property("itemSubtype"),
     159          Expressions.integer(SystemItems.getId(Extract.LABELED))
     160        )
     161      );
     162    return query;
    154163  }
    155164 
     
    158167  {
    159168    nameMapper = getMapper(ffp, (String)job.getValue("nameColumnMapping"),
    160         cropStrings ? LabeledExtract.MAX_NAME_LENGTH : null, null);
     169        cropStrings ? Extract.MAX_NAME_LENGTH : null, null);
    161170    descriptionMapper = getMapper(ffp, (String)job.getValue("descriptionColumnMapping"),
    162         cropStrings ? LabeledExtract.MAX_DESCRIPTION_LENGTH : null, null);
     171        cropStrings ? Extract.MAX_DESCRIPTION_LENGTH : null, null);
    163172    externalIdMapper = getMapper(ffp, (String)job.getValue("externalIdColumnMapping"),
    164         cropStrings ? LabeledExtract.MAX_EXTERNAL_ID_LENGTH : null, null);
     173        cropStrings ? Extract.MAX_EXTERNAL_ID_LENGTH : null, null);
    165174    labelMapper = getMapper(ffp, (String)job.getValue("labelColumnMapping"), null, null);
    166175    originalQuantityMapper = getMapper(ffp, (String)job.getValue("originalQuantityColumnMapping"), null, null);
     
    176185 
    177186  @Override
    178   protected LabeledExtract createItem(DbControl dc, FlatFileParser.Data data)
     187  protected Extract createItem(DbControl dc, FlatFileParser.Data data)
    179188  {
    180189    Tag label = null;
     
    190199        Values.getBoolean(pooledMapper.getValue(data)))
    191200      {
    192         LabeledExtract parent = findLabeledExtract(dc, FallbackIdMethod.NAME_OR_ID, parentMapper.getValue(data));
    193         if (parent != null) label = parent.getLabel();
    194       }
    195     }
    196     LabeledExtract e = LabeledExtract.getNew(dc, label);
     201        Extract parent = findLabeledExtract(dc, FallbackIdMethod.NAME_OR_ID, parentMapper.getValue(data));
     202        if (parent != null) label = parent.getTag();
     203      }
     204    }
     205    Extract e = Extract.getNew(dc);
     206    e.setTag(label);
    197207    updateItem(dc, e, data);
    198208    return e;
     
    200210 
    201211  @Override
    202   protected void updateItem(DbControl dc, LabeledExtract extract, FlatFileParser.Data data)
     212  protected void updateItem(DbControl dc, Extract extract, FlatFileParser.Data data)
    203213  {
    204214    if (nameMapper != null) extract.setName(nameMapper.getValue(data));
     
    227237        ItemSubtype labelType = ItemSubtype.getById(dc, SystemItems.getId(Tag.LABEL));
    228238        Tag label = findTag(dc, FallbackIdMethod.NAME_OR_ID, labelMapper.getValue(data), labelType);
    229         extract.setLabel(label);
     239        extract.setTag(label);
    230240      }
    231241    }
     
    263273  */
    264274  @Override
    265   protected void updateMultiLineItem(DbControl dc, LabeledExtract extract,
     275  protected void updateMultiLineItem(DbControl dc, Extract extract,
    266276    FlatFileParser.Data data, int multiLineNum)
    267277  {
     
    269279    {
    270280      String nameOrId = parentMapper.getValue(data);
    271       LabeledExtract parent = findLabeledExtract(dc, FallbackIdMethod.NAME_OR_EXTERNALID_OR_ID, nameOrId);
     281      Extract parent = findLabeledExtract(dc, FallbackIdMethod.NAME_OR_EXTERNALID_OR_ID, nameOrId);
    272282      if (parent != null)
    273283      {
  • trunk/src/test/TestAll.java

    r5632 r5641  
    8080    results.put("TestExtract", TestExtract.test_all());
    8181    results.put("TestTag", TestTag.test_all());
    82     results.put("TestLabeledExtract", TestLabeledExtract.test_all());
    8382    results.put("TestBioMaterialList", TestBioMaterialList.test_all());
    8483    results.put("TestBioPlateType", TestBioPlateType.test_all());
  • trunk/src/test/TestBioPlate.java

    r5632 r5641  
    3131import net.sf.basedb.core.ItemProxy;
    3232import net.sf.basedb.core.ItemResultList;
    33 import net.sf.basedb.core.LabeledExtract;
    3433import net.sf.basedb.core.MeasuredBioMaterial;
    3534import net.sf.basedb.core.Permission;
     
    7372    int sample2Id = TestSample.test_create(0, "Sample A.2", true);
    7473    int sample3Id = TestSample.test_create(0, "Sample A.3", true);
    75     int extractId = TestExtract.test_create(sampleId, true);
     74    int extractId = TestExtract.test_create(sampleId, "Extract A.1", 0, 0, true);
    7675    int labelId = TestTag.test_create("Test label", SystemItems.getId(Tag.LABEL), true);
    77     int labeledExtractId = TestLabeledExtract.test_create(extractId, labelId, true);
     76    int labeledExtractId = TestExtract.test_create(extractId, "Labeled extract A.1",
     77        SystemItems.getId(Extract.LABELED), labelId, true);
    7878    int freezerId = TestHardware.test_create(SystemItems.getId(Hardware.FREEZER), null, false);
    7979    int protocolId = TestProtocol.test_create(SystemItems.getId(Protocol.SAMPLING),
     
    116116    if (TestUtil.waitBeforeDelete()) TestUtil.waitForEnter();
    117117    // Standard test: Delete
    118     TestLabeledExtract.test_delete(labeledExtractId);
     118    TestExtract.test_delete(labeledExtractId);
    119119    TestTag.test_delete(labelId);
    120120    TestExtract.test_delete(extractId);
     
    518518            item = Extract.getNew(dc);
    519519          }
    520           else if (itemType == Item.LABELEDEXTRACT)
    521           {
    522             item = LabeledExtract.getNew(dc, label);
    523           }
    524520          item.setName(rootName + " [" + rowFormat.format(row) + colFormat.format(col) + "]");
    525521          dc.saveItem(item);
  • trunk/src/test/TestChangeHistory.java

    r5072 r5641  
    7070    TestAnnotation.test_annotatate(Item.SAMPLE, sampleId, annotationTypeId, 0, 2);
    7171    TestAnnotation.test_remove_annotation(Item.SAMPLE, sampleId, annotationTypeId);
    72     int extractId = TestExtract.test_create(sampleId, false);
     72    int extractId = TestExtract.test_create(sampleId, "Extract 1", 0, 0, false);
    7373    TestExtract.test_delete(extractId);
    7474   
  • trunk/src/test/TestExtract.java

    r5340 r5641  
    4444    write_header();
    4545    // Standard tests: create, load, list
    46     int id = test_create(0, true);
    47     int id2 = test_create(0, false);
    48    
    49     int sampleId = TestSample.test_create(0, null, true);
    50     int id3 = test_create(sampleId, false);
     46    int sampleId = TestSample.test_create(0, "Parent sample", true);
     47    int tagId = TestTag.test_create("Test", SystemItems.getId(Tag.LABEL), true);
     48    int id = test_create(0, "Extract #1 (standalone)", 0, 0, true);
     49    int id2 = test_create(sampleId, "Extract #2", 0, 0, false);
     50    int id3 = test_create(id2, "Extract #3 (labeled)", SystemItems.getId(Extract.LABELED), tagId, false);
    5151    int id4 = test_create_pooled(id, id2, id3);
    5252
     
    6161    test_list_sources(id3, 1); // The sample
    6262    test_list_sources(id4, 3); // The three id, id2 and id3 extracts
    63     test_list_pooledChildren(id2, 1);
     63    test_list_pooledChildren(id2, 2);
    6464
    6565    if (TestUtil.waitBeforeDelete()) TestUtil.waitForEnter();
     
    7575  }
    7676
    77   static int test_create(int sampleId, boolean setAll)
     77  static int test_create(int parentId, String name, int subtypeId, int tagId, boolean setAll)
    7878  {
    7979    if (!TestUtil.hasPermission(Permission.CREATE, Item.EXTRACT)) return 0;
     
    9191        e.setOriginalQuantity(500.0f);
    9292      }
    93       if (sampleId != 0)
    94       {
    95         Sample s = Sample.getById(dc, sampleId);
    96         e.setSample(s, 200.0f);
    97         e.setName(s.getName() + ".e");
     93      if (parentId != 0)
     94      {
     95        BioMaterial parent = BioMaterial.getById(dc, parentId);
     96        if (parent.getType() == Item.SAMPLE)
     97        {
     98          Sample s = (Sample)parent;
     99          e.setSample(s, 200.0f);
     100          e.setName(s.getName() + ".e");
     101        }
     102        else
     103        {
     104          e.setPooled(true);
     105          e.getCreationEvent().addSource((MeasuredBioMaterial)parent,  200.0f);
     106        }
     107      }
     108      if (subtypeId > 0)
     109      {
     110        e.setItemSubtype(ItemSubtype.getById(dc, subtypeId));
     111      }
     112      if (tagId > 0)
     113      {
     114        e.setTag(Tag.getById(dc, tagId));
    98115      }
    99116      dc.saveItem(e);
     
    269286    if (!TestUtil.getSilent())
    270287    {
    271       write("   \tID \tName      \tDescription\tExternal id\tPooled\tSample\tQuantity\tRemain");
    272       write("-- \t-- \t--------- \t-----------\t-----------\t------\t------\t--------\t------");
     288      write("   \tID \tName      \tSubtype\tDescription\tExternal id\tPooled\tSample\tTag\tQuantity\tRemain");
     289      write("-- \t-- \t--------- \t-------\t-----------\t-----------\t------\t------\t---\t--------\t------");
    273290    }
    274291  }
     
    276293    throws BaseException
    277294  {
    278     if (!TestUtil.getSilent()) System.out.println(i+":\t"+e.getId()+"\t"+e.getName()+"\t"+e.getDescription()+
    279       "\t"+e.getExternalId()+"\t"+e.isPooled()+"\t"+e.getSample()+"\t"+e.getOriginalQuantity()+"\t"+e.getRemainingQuantity());
     295    if (!TestUtil.getSilent()) System.out.println(i+":\t"+e.getId()+"\t"+e.getName()+"\t"+e.getItemSubtype()+"\t"+e.getDescription()+
     296      "\t"+e.getExternalId()+"\t"+e.isPooled()+"\t"+e.getSample()+"\t"+e.getTag()+"\t"+e.getOriginalQuantity()+"\t"+e.getRemainingQuantity());
    280297  }
    281298  static void write_events_header()
     
    292309    if (!TestUtil.getSilent()) System.out.println(i+":\t"+evt.getId()+"\t"+evt.getBioMaterial()+"\t"+evt.getEventType()+
    293310      "\t"+evt.getEventDate()+"\t"+evt.getEntryDate()+"\t"+evt.getUsedQuantity(e)+"\t"+evt.getComment());
     311  }
     312  static void write_item(int i, Hybridization h)
     313    throws BaseException
     314  {
     315    if (!TestUtil.getSilent()) System.out.println(i+":\t"+h.getId()+"\t"+h.getName()+"\t"+h.getDescription());
    294316  }
    295317  static void write_sources_header()
     
    440462    }
    441463  }
     464 
     465  static void test_list_hybridizations(int extractId, int expectedResults)
     466  {
     467    if (extractId == 0) return;
     468    DbControl dc = null;
     469    try
     470    {
     471      dc = TestUtil.getDbControl();
     472      Extract le = Extract.getById(dc, extractId);
     473      ItemResultList<Hybridization> l = le.getHybridizations().list(dc);
     474      for (int i = 0; i<l.size(); i++)
     475      {
     476        write_item(i, l.get(i));
     477      }
     478      if (expectedResults >= 0 && expectedResults != l.size())
     479      {
     480        throw new BaseException("Expected "+expectedResults+" results, not "+l.size());
     481      }
     482      write("--List hybridizations for labeled extract OK ("+l.size()+")");
     483    }
     484    catch (Throwable ex)
     485    {
     486      write("--List hybridizations for labeled extract FAILED");
     487      ex.printStackTrace();
     488      ok = false;
     489    }
     490    finally
     491    {
     492      if (dc != null) dc.close();
     493    }
     494  }
     495 
    442496}
  • trunk/src/test/TestGenericOverview.java

    r5632 r5641  
    2525import net.sf.basedb.core.DataFileType;
    2626import net.sf.basedb.core.DbControl;
     27import net.sf.basedb.core.Extract;
    2728import net.sf.basedb.core.Hardware;
    2829import net.sf.basedb.core.Item;
     
    8889    int sample1 = TestSample.test_create(biosource, "Test GO #1", false);
    8990    int sample2 = TestSample.test_create(biosource, "Test GO #2", false);
    90     int extract1 = TestExtract.test_create(sample1, false);
    91     int extract2 = TestExtract.test_create(sample2, false);
     91    int extract1 = TestExtract.test_create(sample1, "Test GO #1", 0, 0, false);
     92    int extract2 = TestExtract.test_create(sample2, "Test GO #2", 0, 0, false);
    9293    int extractPooled = TestExtract.test_create_pooled(extract1, extract2);
    9394   
    9495    int cy3 = TestTag.test_load("cy3");
    9596    int cy5 = TestTag.test_load("cy5");
    96     int labeledExtract1 = TestLabeledExtract.test_create(extract1, cy3, false);
    97     int labeledExtract2 = TestLabeledExtract.test_create(extract2, cy3, false);
    98     int labeledExtract1Ref = TestLabeledExtract.test_create(extractPooled, cy5, false);
    99     int labeledExtract2Ref = TestLabeledExtract.test_create(extractPooled, cy5, false);
     97    int labeledExtract = SystemItems.getId(Extract.LABELED);
     98    int labeledExtract1 = TestExtract.test_create(extract1, "Labeled GO #1 (cy3)", labeledExtract, cy3, false);
     99    int labeledExtract2 = TestExtract.test_create(extract2, "Labeled GO #2 (cy3)", labeledExtract, cy3, false);
     100    int labeledExtract1Ref = TestExtract.test_create(extractPooled, "Labeled GO #1 (cy5)", labeledExtract, cy5, false);
     101    int labeledExtract2Ref = TestExtract.test_create(extractPooled, "Labeled GO #2 (cy5)", labeledExtract, cy5, false);
    100102
    101103    // Array design
     
    151153    TestArrayBatch.test_delete(arrayBatch);
    152154    TestArrayDesign.test_delete(arrayDesign);
    153     TestLabeledExtract.test_delete(labeledExtract1);
    154     TestLabeledExtract.test_delete(labeledExtract1Ref);
    155     TestLabeledExtract.test_delete(labeledExtract2);
    156     TestLabeledExtract.test_delete(labeledExtract2Ref);
     155    TestExtract.test_delete(labeledExtract1);
     156    TestExtract.test_delete(labeledExtract1Ref);
     157    TestExtract.test_delete(labeledExtract2);
     158    TestExtract.test_delete(labeledExtract2Ref);
    157159    TestExtract.test_delete(extractPooled);
    158160    TestExtract.test_delete(extract1);
  • trunk/src/test/TestHybridization.java

    r5632 r5641  
    5353    int id3 = test_create(arraySlideId, false);
    5454   
    55     int labelId1 = TestTag.test_create("Test label #1", SystemItems.getId(Tag.LABEL), false);
    56     int labelId2 = TestTag.test_create("Test label #2", SystemItems.getId(Tag.LABEL), false);
    57     int labeledExtractId1 = TestLabeledExtract.test_create(0, labelId1, false);
    58     int labeledExtractId2 = TestLabeledExtract.test_create(0, labelId2, false);
     55    int cy3 = TestTag.test_load("cy3");
     56    int cy5 = TestTag.test_load("cy5");
     57    int labeledExtract = SystemItems.getId(Extract.LABELED);
     58    int labeledExtractId1 = TestExtract.test_create(0, "Labeled #1", labeledExtract, cy3, false);
     59    int labeledExtractId2 = TestExtract.test_create(0, "Labeled #2", labeledExtract, cy5, false);
    5960    int id4 = test_create(0, false, labeledExtractId1, labeledExtractId2);
    6061   
    6162    test_list(-1);
    6263   
    63     TestLabeledExtract.test_list_hybridizations(labeledExtractId1, 1);
    64     ok = ok && TestLabeledExtract.ok;
     64    TestExtract.test_list_hybridizations(labeledExtractId1, 1);
     65    ok = ok && TestExtract.ok;
    6566
    6667    // Standard test: Delete
     
    7172    test_delete(id4);
    7273   
    73     TestLabeledExtract.test_delete(labeledExtractId1);
    74     TestLabeledExtract.test_delete(labeledExtractId2);
    75     TestTag.test_delete(labelId1);
    76     TestTag.test_delete(labelId2);
     74    TestExtract.test_delete(labeledExtractId1);
     75    TestExtract.test_delete(labeledExtractId2);
    7776   
    7877    TestArraySlide.test_delete(arraySlideId);
     
    104103      for (int labeledExtractId : labeledExtractIds)
    105104      {
    106         LabeledExtract le = LabeledExtract.getById(dc, labeledExtractId);
     105        Extract le = Extract.getById(dc, labeledExtractId);
    107106        evt.addSource(le, 100.0f);
    108107      }
     
    272271      dc = TestUtil.getDbControl();
    273272      Hybridization h = Hybridization.getById(dc, hybId);
    274       LabeledExtract le = LabeledExtract.getById(dc, labeledExtractId);
     273      Extract le = Extract.getById(dc, labeledExtractId);
    275274      BioMaterialEvent event = h.getCreationEvent();
    276275      event.addSource(le, usedQuantity);
  • trunk/src/test/TestItemImporter.java

    r5630 r5641  
    105105    int labledExtractFileId = TestFile.test_create("data/test.batchimport.labeledextracts.txt", false, false);
    106106    int labledExtractImporterId  = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.LabeledExtractImporter");
    107     int labledExtractJobId = test_create_item_import_job(Item.LABELEDEXTRACT, labledExtractImporterId, labledExtractFileId);
     107    int labledExtractJobId = test_create_item_import_job(Item.EXTRACT, labledExtractImporterId, labledExtractFileId);
    108108    ok &= TestJob.test_execute(labledExtractJobId, false);
    109     TestLabeledExtract.test_list(7);
     109    TestExtract.test_list(11);
    110110   
    111111    // Import array designs
     
    196196   
    197197    // Delete labeled extracts
    198     TestLabeledExtract.test_delete_all();
     198    TestExtract.test_delete_all();
    199199    TestJob.test_delete(labledExtractJobId);
    200200    TestFile.test_delete(labledExtractFileId);
     
    257257      //write_request_information(request.getRequestInformation());
    258258      request.getRequestInformation();
    259      
    260       request.setParameterValue("file", File.getById(dc, fileId));
     259      File file = File.getById(dc, fileId);
     260      request.setParameterValue("file", file);
    261261      setParserParameters(request);
    262       setColumnMappingParameters(request, itemType);
     262      setColumnMappingParameters(request, itemType, file);
    263263      PluginResponse response = request.invoke();
    264264      if (response.getStatus() != Response.Status.CONTINUE)
     
    330330  }
    331331 
    332   private static void setColumnMappingParameters(PluginConfigurationRequest request, Item itemType)
     332  private static void setColumnMappingParameters(PluginConfigurationRequest request, Item itemType, File file)
    333333  {
    334334    request.setParameterValue("nameColumnMapping", "\\Name\\");
     
    341341      request.setParameterValue("hardwareColumnMapping", "\\Freezer\\");
    342342    }
    343     if (itemType == Item.SAMPLE || itemType == Item.EXTRACT || itemType == Item.LABELEDEXTRACT)
     343    if (itemType == Item.SAMPLE || itemType == Item.EXTRACT)
    344344    {
    345345      request.setParameterValue("externalIdColumnMapping", "\\External ID\\");
     
    351351      request.setParameterValue("usedQuantityColumnMapping", "\\Used quantity\\");
    352352    }
    353     if (itemType == Item.LABELEDEXTRACT)
     353    if (file.getName().contains("labeledextracts"))
    354354    {
    355355      request.setParameterValue("labelColumnMapping", "\\Label\\");
  • trunk/src/test/TestItemSubtype.java

    r5630 r5641  
    4949
    5050    // Extra tests:
    51     int extractId = TestExtract.test_create(0, true);
     51    int extractId = TestExtract.test_create(0, "Test extract", 0, 0, true);
    5252    test_set_on_item(id, extractId);
    5353
  • trunk/src/test/TestMetadata.java

    r5632 r5641  
    2727import net.sf.basedb.core.BasicItem;
    2828import net.sf.basedb.core.DbControl;
     29import net.sf.basedb.core.Extract;
    2930import net.sf.basedb.core.Formula;
    3031import net.sf.basedb.core.Item;
     
    8788    int slideId = TestArraySlide.test_create(batchId, true);
    8889    int labelId = TestTag.test_create("Test label", SystemItems.getId(Tag.LABEL), true);
    89     int labeledExtractId = TestLabeledExtract.test_create(0, labelId, true);
     90    int labeledExtractId = TestExtract.test_create(0, "Test extract", SystemItems.getId(Extract.LABELED), labelId, true);
    9091    int hybId = TestHybridization.test_create(slideId, true, labeledExtractId);
    9192    int scanId = TestScan.test_create(hybId, 0, 0, true);
     
    110111    TestScan.test_delete(scanId);
    111112    TestHybridization.test_delete(hybId);
    112     TestLabeledExtract.test_delete(labeledExtractId);
     113    TestExtract.test_delete(labeledExtractId);
    113114    TestTag.test_delete(labelId);
    114115    TestArraySlide.test_delete(slideId);
  • trunk/src/test/net/sf/basedb/test/roles/PowerUserTest.java

    r5630 r5641  
    230230      p.setDefaultItem(dc, sampling, Project.Default.SAMPLING_PROTOCOL);
    231231      p.setDefaultItem(dc, extraction, Project.Default.EXTRACTING_PROTOCOL);
    232       p.setDefaultItem(dc, labeling, Project.Default.LABELING_PROTOCOL);
    233232      p.setDefaultItem(dc, hybridization, Project.Default.HYBRIDIZATION_PROTOCOL);
    234233      p.setDefaultItem(dc, feature, Project.Default.FEATURE_EXTRACTION_PROTOCOL);
  • trunk/src/test/net/sf/basedb/test/roles/UserTest.java

    r5632 r5641  
    4343import net.sf.basedb.core.ItemQuery;
    4444import net.sf.basedb.core.Job;
    45 import net.sf.basedb.core.LabeledExtract;
    4645import net.sf.basedb.core.PlateGeometry;
    4746import net.sf.basedb.core.Platform;
     
    206205        Tag cy3 = Util.findTag(dc, "cy3");     
    207206        Tag cy5 = Util.findTag(dc, "cy5");     
    208         LabeledExtract le1 = createLabeledExtract(dc, "Labeled extract A.00h", e1, cy3);
     207        Extract le1 = createLabeledExtract(dc, "Labeled extract A.00h", e1, cy3);
    209208        le1.setBioWell(bioPlate.getBioWell(2, 0));
    210         LabeledExtract le1DyeSwap = createLabeledExtract(dc, "Labeled extract A.00h (dye-swap)", e1, cy5);
     209        Extract le1DyeSwap = createLabeledExtract(dc, "Labeled extract A.00h (dye-swap)", e1, cy5);
    211210        le1DyeSwap.setBioWell(bioPlate.getBioWell(3, 0));
    212         LabeledExtract le2 = createLabeledExtract(dc, "Labeled extract A.24h", e2, cy3);
     211        Extract le2 = createLabeledExtract(dc, "Labeled extract A.24h", e2, cy3);
    213212        le2.setBioWell(bioPlate.getBioWell(2, 1));
    214         LabeledExtract le2DyeSwap = createLabeledExtract(dc, "Labeled extract A.24h (dye-swap)", e2, cy5);
     213        Extract le2DyeSwap = createLabeledExtract(dc, "Labeled extract A.24h (dye-swap)", e2, cy5);
    215214        le2DyeSwap.setBioWell(bioPlate.getBioWell(3, 1));
    216         LabeledExtract leRef = createLabeledExtract(dc, "Labeled extract A.ref", eRef, cy5);
     215        Extract leRef = createLabeledExtract(dc, "Labeled extract A.ref", eRef, cy5);
    217216        leRef.setBioWell(bioPlate.getBioWell(2, 2));
    218         LabeledExtract leRefDyeSwap = createLabeledExtract(dc, "Labeled extract A.ref (dye-swap)", eRef, cy3);
     217        Extract leRefDyeSwap = createLabeledExtract(dc, "Labeled extract A.ref (dye-swap)", eRef, cy3);
    219218        leRefDyeSwap.setBioWell(bioPlate.getBioWell(3, 2));
    220219//        dc.commit();
     
    407406    Create a labeled extract.
    408407  */
    409   public static LabeledExtract createLabeledExtract(DbControl dc, String name, Extract extract, Tag label)
     408  public static Extract createLabeledExtract(DbControl dc, String name, Extract extract, Tag label)
    410409  {
    411410    TestUtil.write("--Creating labeled extract: " + name + "\n");
    412411   
    413     LabeledExtract labeledExtract = LabeledExtract.getNew(dc, label);
     412    Extract labeledExtract = Extract.getNew(dc);
    414413    labeledExtract.setName(name);
    415414    labeledExtract.setOriginalQuantity(100.0f);
    416     labeledExtract.setExtract(extract, 50.0f);
     415    labeledExtract.setTag(label);
     416    labeledExtract.setPooled(true);
    417417    labeledExtract.getCreationEvent().setProtocol(Util.findProtocol(dc, "Labeling A"));
     418    labeledExtract.getCreationEvent().addSource(extract, 50.0f);
    418419    dc.saveItem(labeledExtract);
    419420    return labeledExtract;
     
    435436    Create a hybridization.
    436437  */
    437   public static Hybridization createHybridization(DbControl dc, String name, String arraySlideName, LabeledExtract... extracts)
     438  public static Hybridization createHybridization(DbControl dc, String name, String arraySlideName, Extract... extracts)
    438439  {
    439440    TestUtil.write("--Creating hybridization: " + name + "\n");
     
    444445    creationEvent.setProtocol(Util.findProtocol(dc, "Hybridization A"));
    445446    creationEvent.setHardware(Util.findHardware(dc, "Hybridization station A"));
    446     for (LabeledExtract le : extracts)
     447    for (Extract le : extracts)
    447448    {
    448449      creationEvent.addSource(le, 50.0f);
  • trunk/www/biomaterials/bioplates/list_bioplates.jsp

    r5566 r5641  
    8383    bioMaterialTypes.add(Integer.toString(Item.SAMPLE.getValue()), Item.SAMPLE.toString());
    8484    bioMaterialTypes.add(Integer.toString(Item.EXTRACT.getValue()), Item.EXTRACT.toString());
    85     bioMaterialTypes.add(Integer.toString(Item.LABELEDEXTRACT.getValue()), Item.LABELEDEXTRACT.toString());
    8685  }
    8786%>
  • trunk/www/biomaterials/bioplates/view_bioplate.jsp

    r5566 r5641  
    315315        image="add.png"
    316316        onclick="createChildBioPlate()"
    317         title="<%="Create child bioplate" + (bioMaterialType == Item.LABELEDEXTRACT ? "/hybridization" : "") +"&hellip;"%>"
     317        title="<%="Create child bioplate" + (bioMaterialType == Item.EXTRACT ? "/hybridization" : "") +"&hellip;"%>"
    318318        tooltip="Create one or more child biomaterial plates"
    319319        visible="<%=bioMaterialType != null%>"
  • trunk/www/biomaterials/bioplates/wells/edit_biowell.jsp

    r5492 r5641  
    3434  import="net.sf.basedb.core.Sample"
    3535  import="net.sf.basedb.core.Extract"
    36   import="net.sf.basedb.core.LabeledExtract"
    3736  import="net.sf.basedb.core.PermissionDeniedException"
    3837  import="net.sf.basedb.core.BaseException"
     
    195194              <option value="<%=Item.EXTRACT.name()%>"
    196195                <%=currentBmType == Item.EXTRACT || bioMaterialType == Item.EXTRACT ? "selected" : ""%>>Extract
    197               <option value="<%=Item.LABELEDEXTRACT.name()%>"
    198                 <%=currentBmType == Item.LABELEDEXTRACT || bioMaterialType == Item.LABELEDEXTRACT ? "selected" : ""%>>Labeled extract
    199196              <%
    200197            }
  • trunk/www/biomaterials/bioplatetypes/edit_platetype.jsp

    r5492 r5641  
    160160            <option value="<%=Item.SAMPLE.name()%>">Sample
    161161            <option value="<%=Item.EXTRACT.name()%>">Extract
    162             <option value="<%=Item.LABELEDEXTRACT.name()%>">Labeled extract
    163162            </select>
    164163          </td>
  • trunk/www/biomaterials/bioplatetypes/list_platetypes.jsp

    r5590 r5641  
    7373    bioMaterialTypes.add(Integer.toString(Item.SAMPLE.getValue()), Item.SAMPLE.toString());
    7474    bioMaterialTypes.add(Integer.toString(Item.EXTRACT.getValue()), Item.EXTRACT.toString());
    75     bioMaterialTypes.add(Integer.toString(Item.LABELEDEXTRACT.getValue()), Item.LABELEDEXTRACT.toString());
    7675  }
    7776  private static Enumeration<String, String> lockModes = new Enumeration<String, String>();
  • trunk/www/biomaterials/events/list_events.jsp

    r5525 r5641  
    105105    listName = "Extracts";
    106106    viewPage = "../extracts/index.jsp";
    107   }
    108   else if (bioMaterialType == Item.LABELEDEXTRACT)
    109   {
    110     listName = "Labeled extracts";
    111     viewPage = "../labeledextracts/index.jsp";
    112107  }
    113108 
  • trunk/www/biomaterials/events/view_event.jsp

    r5530 r5641  
    118118    viewPage = "../extracts/index.jsp";
    119119  }
    120   else if (bioMaterialType == Item.LABELEDEXTRACT)
    121   {
    122     listName = "Labeled extracts";
    123     viewPage = "../labeledextracts/index.jsp";
    124   }
    125120
    126121  final boolean writePermission = event.hasPermission(Permission.WRITE) && eventType == BioMaterialEvent.Type.OTHER;
  • trunk/www/biomaterials/extracts/index.jsp

    r5590 r5641  
    3535  import="net.sf.basedb.core.BioWell"
    3636  import="net.sf.basedb.core.Protocol"
     37  import="net.sf.basedb.core.Hybridization"
    3738  import="net.sf.basedb.core.ItemQuery"
    3839  import="net.sf.basedb.core.ItemResultIterator"
    39   import="net.sf.basedb.core.LabeledExtract"
    4040  import="net.sf.basedb.core.Permission"
    4141  import="net.sf.basedb.core.ItemContext"
     
    8686    cc.setObject("export.formatter.&children(name)", new NameableFormatter());
    8787    cc.setObject("export.formatter.&creationEvent.sourceBioMaterials(name)", new NameableFormatter());
     88    cc.setObject("export.formatter.&sourceEvents(event.hybridization.name)", new NameableFormatter());
    8889    cc.setObject("export.formatter.&sourceEvents(event.bioMaterial.name)", new NameableFormatter());
    8990   
     
    9192    String restrictionParameter = "extract";
    9293
    93     // Child labeled extracts
    94     ItemQuery<LabeledExtract> labeledExtractQuery = LabeledExtract.getQuery();
    95     labeledExtractQuery.include(cc.getInclude());
    96     labeledExtractQuery.restrict(Restrictions.eq(Hql.property("parent"), Expressions.parameter(restrictionParameter)));
    97     labeledExtractQuery.order(Orders.asc(Hql.property("name")));
    98     cc.setObject("export.dataloader.&children(name)", new ItemQueryLoader(labeledExtractQuery, restrictionParameter));
     94    // Hybridizations
     95    ItemQuery<Hybridization> hybQuery = Hybridization.getQuery();
     96    hybQuery.join(Hql.innerJoin("creationEvent", "ce"));
     97    hybQuery.join(Hql.innerJoin("ce", "sources", "src"));
     98    hybQuery.restrict(Restrictions.eq(Hql.index("src", null), Expressions.parameter(restrictionParameter)));
     99    hybQuery.order(Orders.asc(Hql.property("name")));
     100    hybQuery.include(cc.getInclude());
     101    cc.setObject("export.dataloader.&sourceEvents(event.hybridization.name)", new ItemQueryLoader(hybQuery, restrictionParameter));
    99102
    100103    // Child extracts
     
    192195    cc.setId(0);
    193196    forward = editPage+"&pooled="+true;
     197  }
     198  else if ("NewHybridization".equals(cmd))
     199  {
     200    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
     201    redirect = "../../views/hybridizations/index.jsp?ID="+ID+"&cmd=NewItem&useParents=true";
    194202  }
    195203  else if ("UpdateItem".equals(cmd))
  • trunk/www/biomaterials/extracts/list_extracts.jsp

    r5567 r5641  
    2929  import="net.sf.basedb.core.Item"
    3030  import="net.sf.basedb.core.Extract"
    31   import="net.sf.basedb.core.LabeledExtract"
    3231  import="net.sf.basedb.core.Sample"
     32  import="net.sf.basedb.core.Hybridization"
    3333  import="net.sf.basedb.core.BioPlate"
    3434  import="net.sf.basedb.core.BioMaterialEvent"
     
    9999{
    100100  final ItemQuery<AnnotationType> annotationTypeQuery = Base.getAnnotationTypesQuery(itemType);
    101   final boolean createLabeledExtractPermission = sc.hasPermission(Permission.CREATE, Item.LABELEDEXTRACT);
    102   final ItemQuery<LabeledExtract> labeledExtractQuery = LabeledExtract.getQuery();
    103   labeledExtractQuery.include(cc.getInclude());
    104   labeledExtractQuery.restrict(Restrictions.eq(Hql.property("parent"), Hql.entityParameter("extract", Item.EXTRACT)));
    105   labeledExtractQuery.order(Orders.asc(Hql.property("name"))); 
     101  final boolean createHybridizationPermission = sc.hasPermission(Permission.CREATE, Item.HYBRIDIZATION);
     102
     103  final ItemQuery<Hybridization> hybQuery = Hybridization.getQuery();
     104  hybQuery.join(Hql.innerJoin("creationEvent", "ce"));
     105  hybQuery.join(Hql.innerJoin("ce", "sources", "src"));
     106  hybQuery.restrict(Restrictions.eq(Hql.index("src", null), Hql.entityParameter("extract", Item.EXTRACT)));
     107  hybQuery.order(Orders.asc(Hql.property("name")));
     108  hybQuery.include(cc.getInclude());
    106109
    107110  final ItemQuery<Extract> childExtractsQuery = Extract.getQuery();
     
    164167      Table.poolItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'NewPooledItem');
    165168    }
     169    function newHybridization()
     170    {
     171      Table.poolItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'NewHybridization');
     172    }
    166173    function editItem(itemId)
    167174    {
     
    395402      />
    396403      <tbl:columndef
    397         id="labeledextracts"
    398         title="Labeled extracts"
    399         property="&children(name)"
     404        id="hybridizations"
     405        title="Hybridizations"
     406        property="&sourceEvents(event.hybridization.name)"
    400407        datatype="string"
    401408        filterable="true"
     
    523530          title="Pool&hellip;"
    524531          tooltip="<%=createPermission ? "Create new pooled extract" : "You do not have permission to create extracts"%>"
     532        />
     533        <tbl:button
     534          disabled="<%=createHybridizationPermission ? false : true%>"
     535          image="<%=createHybridizationPermission ? "add.png" : "add_disabled.png"%>"
     536          onclick="newHybridization()"
     537          title="New hybridzation&hellip;"
     538          tooltip="<%=createHybridizationPermission ? "Create new hybridization with the selected extracts" : "You do not have permission to create hybridizations"%>"
    525539        />
    526540        <tbl:button
     
    749763                  %>
    750764                </tbl:cell>
    751                 <tbl:cell column="labeledextracts">
    752                   <%
    753                   labeledExtractQuery.setEntityParameter("extract", item);
     765                <tbl:cell column="hybridizations">
     766                  <%                 
    754767                  try
    755768                  {
     769                    hybQuery.setEntityParameter("extract", item);
    756770                    String separator = "";
    757                     for (LabeledExtract le : labeledExtractQuery.list(dc))
     771                    for (Hybridization h : hybQuery.list(dc))
    758772                    {
    759773                      out.write(separator);
    760774                      if (mode.hasPropertyLink())
    761775                      {
    762                         out.write(Base.getLinkedName(ID, le, false, mode.hasEditLink()));
     776                        out.write(Base.getLinkedName(ID, h, false, mode.hasEditLink()));
    763777                      }
    764778                      else
    765779                      {
    766                         out.write(HTML.encodeTags(le.getName()));
     780                        out.write(HTML.encodeTags(h.getName()));
    767781                      }
    768                       %>
    769                       (<base:propertyvalue
    770                         item="<%=le%>" property="label"
    771                         enableEditLink="<%=mode.hasEditLink()%>"
    772                         enablePropertyLink="<%=mode.hasPropertyLink()%>"/>)
    773                       <%
    774782                      separator = ", ";
    775783                    }
     
    782790                  }
    783791                  %>
    784                   <base:icon
    785                     image="add.png"
    786                     onclick="<%="newLabeledExtract("+itemId+")"%>"
    787                     tooltip="Create a new labeled extract"
    788                     visible="<%=mode.hasEditLink() && createLabeledExtractPermission && usePermission%>"
    789                   /></tbl:cell>
    790                
     792                  </tbl:cell>
    791793                <%               
    792794                BioWell well = null;
  • trunk/www/biomaterials/extracts/view_extract.jsp

    r5496 r5641  
    3434  import="net.sf.basedb.core.Permission"
    3535  import="net.sf.basedb.core.Extract"
    36   import="net.sf.basedb.core.LabeledExtract"
     36  import="net.sf.basedb.core.Hybridization"
    3737  import="net.sf.basedb.core.Sample"
    3838  import="net.sf.basedb.core.BioMaterialEvent"
     
    176176      }
    177177    }
    178     function newLabeledExtract()
    179     {
    180       Main.viewOrEditItem('<%=ID%>', 'LABELEDEXTRACT', 0, true, '&extract_id=<%=itemId%>')
     178    function newHybridization()
     179    {
     180      Main.viewOrEditItem('<%=ID%>', 'HYBRIDIZATION', 0, true, '&extract_id='+<%=itemId%>);
    181181    }
    182182    </script>
     
    233233      <tbl:button
    234234        image="add.png"
    235         onclick="newLabeledExtract()"
    236         title="New labeled extract&hellip;"
    237         tooltip="Create a new labeled extract from this extract"
    238         visible="<%=sc.hasPermission(Permission.CREATE, Item.LABELEDEXTRACT) && usePermission %>"
     235        onclick="newHybridization()"
     236        title="New hybridization&hellip;"
     237        tooltip="Create a new hybridization from this labeled extract"
     238        visible="<%=sc.hasPermission(Permission.CREATE, Item.HYBRIDIZATION) && usePermission%>"
    239239      />
    240240      <tbl:button
     
    513513        <%
    514514      }
    515        
    516       ItemQuery<LabeledExtract> labeledExtractQuery = LabeledExtract.getQuery();
    517       labeledExtractQuery.include(Include.ALL);
    518       labeledExtractQuery.restrict(Restrictions.eq(Hql.property("parent"), Expressions.parameter("extracts")));
    519       labeledExtractQuery.setParameter("extracts", itemId, Type.INT);
    520       labeledExtractQuery.order(Orders.asc(Hql.property("name")));
    521       ItemResultList<LabeledExtract> labeledExtracts = labeledExtractQuery.list(dc);
    522515     
    523       if (labeledExtracts.size() == 0)
    524       {
    525         %>
    526         <h4>Labeled extracts</h4>
    527         No labeled extracts have been created from this extract
     516      ItemQuery<Hybridization> hybridizationQuery = extract.getHybridizations();
     517      hybridizationQuery.include(Include.ALL);
     518      hybridizationQuery.order(Orders.asc(Hql.property("name")));
     519      ItemResultList<Hybridization>hybridizations = hybridizationQuery.list(dc);
     520      if (hybridizations.size() == 0)
     521      {
     522        %>
     523        <h4>Hybridizations</h4>
     524        No hybridizations have been created from this extract
    528525        (or you don't have the permission to view them)
    529526        <%
     
    533530        %>
    534531        <base:section
    535           id="labeledExtractSection"
    536           title="<%="Labeled extracts (" + labeledExtracts.size() + ")"%>"
     532          id="hybridizationSection"
     533          title="<%="Hybridizations (" + hybridizations.size() + ")"%>"
    537534          context="<%=cc%>"
    538535          >
    539536          <tbl:table
    540             id="labeledextracts"
     537            id="hybridizations"
    541538            clazz="itemlist"
    542539            columns="all"
     
    558555              <tbl:rows>
    559556                <%
    560                 for (LabeledExtract lbe : labeledExtracts)
     557                for (Hybridization hyb : hybridizations)
    561558                {
    562559                  %>
     
    565562                      image="deleted.gif"
    566563                      tooltip="This item has been scheduled for deletion"
    567                       visible="<%=lbe.isRemoved()%>"
    568                     /><%=Base.getLinkedName(ID, lbe, false, true)%></tbl:cell>
    569                     <tbl:cell column="quantity"><%=Values.formatNumber(lbe.getCreationEvent().getUsedQuantity(extract), 2)%></tbl:cell>
    570                     <tbl:cell column="description"><%=HTML.encodeTags(lbe.getDescription())%></tbl:cell>
     564                      visible="<%=hyb.isRemoved()%>"
     565                    /><%=Base.getLinkedName(ID, hyb, false, true)%></tbl:cell>
     566                    <tbl:cell column="quantity"><%=Values.formatNumber(hyb.getCreationEvent().getUsedQuantity(extract), 2)%></tbl:cell>
     567                    <tbl:cell column="description"><%=HTML.encodeTags(hyb.getDescription())%></tbl:cell>
    571568                  </tbl:row>
    572569                  <%
  • trunk/www/biomaterials/lists/edit_list.jsp

    r5526 r5641  
    221221            <option value="SAMPLE" <%=memberType == Item.SAMPLE ? "selected" : ""%>>Sample
    222222            <option value="EXTRACT" <%=memberType == Item.EXTRACT ? "selected" : ""%>>Extract
    223             <option value="LABELEDEXTRACT" <%=memberType == Item.LABELEDEXTRACT ? "selected" : ""%>>Labeled extract
    224223          </select>
    225224        </td>
  • trunk/www/biomaterials/lists/index.jsp

    r5590 r5641  
    4848  import="net.sf.basedb.util.biomaterial.BioSourceToSampleTransformer"
    4949  import="net.sf.basedb.util.biomaterial.SampleToExtractTransformer"
    50   import="net.sf.basedb.util.biomaterial.ExtractToLabeledExtractTransformer"
    5150  import="net.sf.basedb.util.biomaterial.PooledChildrenTransformer"
    5251  import="net.sf.basedb.util.collections.CollectionTransformer"
  • trunk/www/biomaterials/lists/list_lists.jsp

    r5590 r5641  
    3131  import="net.sf.basedb.core.ItemResultIterator"
    3232  import="net.sf.basedb.core.ItemContext"
    33   import="net.sf.basedb.core.LabeledExtract"
    3433  import="net.sf.basedb.core.Nameable"
    3534  import="net.sf.basedb.core.Permission"
     
    6766    memberTypes.add(Integer.toString(Item.SAMPLE.getValue()), Item.SAMPLE.toString());
    6867    memberTypes.add(Integer.toString(Item.EXTRACT.getValue()), Item.EXTRACT.toString());
    69     memberTypes.add(Integer.toString(Item.LABELEDEXTRACT.getValue()), Item.LABELEDEXTRACT.toString());
    7068  }
    7169
  • trunk/www/biomaterials/lists/members/add_members_frameset.jsp

    r5426 r5641  
    5656    urlToController = "extracts";
    5757  }
    58   else if (memberType == Item.LABELEDEXTRACT)
    59   {
    60     urlToController = "labeledextracts";
    61   }
    6258}
    6359finally
  • trunk/www/biomaterials/tags/view_tag.jsp

    r5632 r5641  
    138138      Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&item_id=<%=itemId%>', 'RunPlugin'+cmd, 740, 540);
    139139    }
    140     function newLabeledExtract()
    141     {
    142       Main.viewOrEditItem('<%=ID%>', 'LABELEDEXTRACT', 0, true, '&label_id='+<%=itemId%>);
    143     }
    144140    </script>
    145141  </base:head>
     
    191187        title="Set owner&hellip;"
    192188        tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>"
    193       />
    194       <tbl:button
    195         image="add.png"
    196         onclick="newLabeledExtract()"
    197         title="New labeled extract&hellip;"
    198         tooltip="Create a new labeled extract with this label"
    199         visible="<%=sc.hasPermission(Permission.CREATE, Item.LABELEDEXTRACT) && usePermission%>"
    200189      />
    201190      <tbl:button
  • trunk/www/biomaterials/wizards/create_child_bioplate_step1.jsp

    r5630 r5641  
    3131  import="net.sf.basedb.core.Hardware"
    3232  import="net.sf.basedb.core.Protocol"
    33   import="net.sf.basedb.core.Label"
     33  import="net.sf.basedb.core.Tag"
    3434  import="net.sf.basedb.core.DbControl"
    3535  import="net.sf.basedb.core.Item"
     
    360360                %>
    361361                <option value="EXTRACT">Extract → Extract
    362                 <option value="LABELEDEXTRACT" selected>Extract → Labeled extract
    363                 <%
    364               }
    365               else if (sourceBioMaterialType == Item.LABELEDEXTRACT)
    366               {
    367                 %>
    368                 <option value="LABELEDEXTRACT">Labled extract → Labeled extract
    369                 <option value="HYBRIDIZATION" selected>Labled extract → Hybridization
     362                <option value="HYBRIDIZATION" selected>Extract → Hybridization
    370363                <%
    371364              }
     
    377370        if (sourceBioMaterialType == Item.EXTRACT)
    378371        {
    379           final ItemQuery<Label> labelsQuery = Label.getQuery();
    380           labelsQuery.order(Orders.asc(Hql.property("name")));
    381           labelsQuery.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS);
    382           labelsQuery.setCacheResult(true);
    383           final List<Label> labels = labelsQuery.list(dc);
     372          final ItemQuery<Tag> tagsQuery = Tag.getQuery();
     373          tagsQuery.order(Orders.asc(Hql.property("name")));
     374          tagsQuery.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS);
     375          tagsQuery.setCacheResult(true);
     376          final List<Tag> tags = tagsQuery.list(dc);
    384377          %>
    385378          <tr id="labelDiv">
     
    389382                style="width: 20em;">
    390383                <%
    391                 for (Label label : labels)
     384                for (Tag tag : tags)
    392385                {
    393386                  %>
    394                   <option value="<%=label.getId()%>"><%=HTML.encodeTags(label.getName())%>
     387                  <option value="<%=tag.getId()%>"><%=HTML.encodeTags(tag.getName())%>
    395388                  <%
    396389                }
  • trunk/www/biomaterials/wizards/create_child_bioplate_step2.jsp

    r5630 r5641  
    8181  {
    8282    childNameSuffix = "e";
    83   }
    84   else if (childBioMaterialType == Item.LABELEDEXTRACT)
    85   {
    86     childNameSuffix = "le";
    8783  }
    8884 
  • trunk/www/biomaterials/wizards/index.jsp

    r5561 r5641  
    4141  import="net.sf.basedb.core.Sample"
    4242  import="net.sf.basedb.core.Extract"
    43   import="net.sf.basedb.core.LabeledExtract"
    44   import="net.sf.basedb.core.Label"
     43  import="net.sf.basedb.core.Tag"
    4544  import="net.sf.basedb.core.PlateGeometry"
    4645  import="net.sf.basedb.core.InvalidDataException"
     
    311310                if (!pooled) ((Extract)child).setSample((Sample)parent, usedQuantity);
    312311              }
     312              /*
    313313              else if (childBioMaterialType == Item.LABELEDEXTRACT)
    314314              {
     
    317317                if (!pooled) ((LabeledExtract)child).setExtract((Extract)parent, usedQuantity);
    318318              }
     319              */
    319320              else
    320321              {
  • trunk/www/include/menu.jsp

    r5632 r5641  
    653653    final boolean hasExtracts           = !sc.hasPermission(Permission.DENIED, Item.EXTRACT);
    654654    final boolean createExtracts        =  sc.hasPermission(Permission.CREATE, Item.EXTRACT);
    655 
    656     final boolean hasLabeledExtracts    = !sc.hasPermission(Permission.DENIED, Item.LABELEDEXTRACT);
    657     final boolean createLabeledExtracts =  sc.hasPermission(Permission.CREATE, Item.LABELEDEXTRACT);
    658655   
    659656    final boolean hasBioMaterialLists   = !sc.hasPermission(Permission.DENIED, Item.BIOMATERIALLIST);
     
    664661    final boolean hasBioPlateEventTypes = !sc.hasPermission(Permission.DENIED, Item.BIOPLATEEVENTTYPE);
    665662    final boolean hasBioLims      =  hasTags || hasBioSources || hasSamples || hasExtracts ||
    666                       hasLabeledExtracts || hasBioMaterialLists || hasBioPlates ||
     663                      hasBioMaterialLists || hasBioPlates ||
    667664                      hasBioPlateTypes || hasBioPlateEventTypes;
    668665   
     
    691688          tooltip="<%=menu.getString("extracts.tooltip", hasExtracts)%>"
    692689          enabled="<%=hasExtracts%>"
    693         />
    694         <m:menuitem
    695           title="<%=common.getString("item.labeledextract+")%>"
    696           onclick="<%="Menu.openUrl('"+root+"biomaterials/labeledextracts/index.jsp?ID="+ID+"')"%>"
    697           tooltip="<%=menu.getString("labeledextracts.tooltip", hasLabeledExtracts)%>"
    698           enabled="<%=hasLabeledExtracts%>"
    699690        />
    700691        <m:menuitem
  • trunk/www/include/scripts/main.js

    r5632 r5641  
    540540    this.controllers['SESSION'] = { url:'views/sessions/index.jsp', width:400, height:300, popup:true, edit:false };
    541541    this.controllers['TAG'] = { url:'biomaterials/tags/index.jsp', width:450, height:280 };
    542     this.controllers['LABELEDEXTRACT'] = { url:'biomaterials/labeledextracts/index.jsp', width:800, height:500 };
    543542    this.controllers['EXTRACT'] = { url:'biomaterials/extracts/index.jsp', width:800, height:500 };
    544543    this.controllers['SAMPLE'] = { url:'biomaterials/samples/index.jsp', width:800, height:500 };
  • trunk/www/views/hybridizations/edit_hybridization.jsp

    r5630 r5641  
    3939  import="net.sf.basedb.core.Protocol"
    4040  import="net.sf.basedb.core.Project"
    41   import="net.sf.basedb.core.LabeledExtract"
     41  import="net.sf.basedb.core.Extract"
    4242  import="net.sf.basedb.core.ItemQuery"
    4343  import="net.sf.basedb.core.ItemResultList"
     
    8282  BioMaterialEvent creationEvent = null;
    8383  Date eventDate = null;
    84   ItemQuery<LabeledExtract> labeledExtractsQuery = null;
     84  ItemQuery<Extract> labeledExtractsQuery = null;
    8585 
    8686  boolean readCurrentArraySlide = true;
     
    141141    if (Values.getBoolean(request.getParameter("useParents")))
    142142    {
    143       ItemContext lc = sc.getCurrentContext(Item.LABELEDEXTRACT);
     143      ItemContext lc = sc.getCurrentContext(Item.EXTRACT);
    144144      if (lc.getSelected().size() > 0)
    145145      {
    146         labeledExtractsQuery = LabeledExtract.getQuery();
     146        labeledExtractsQuery = Extract.getQuery();
    147147        labeledExtractsQuery.include(Include.ALL);
    148148        labeledExtractsQuery.order(Orders.asc(Hql.property("name")));
     
    151151      }
    152152    }
    153     else if (request.getParameter("labeledextract_id") != null)
    154     {
    155       int leId = Values.getInt(request.getParameter("labeledextract_id"));
    156       labeledExtractsQuery = LabeledExtract.getQuery();
     153    else if (request.getParameter("extract_id") != null)
     154    {
     155      int leId = Values.getInt(request.getParameter("extract_id"));
     156      labeledExtractsQuery = Extract.getQuery();
    157157      labeledExtractsQuery.include(Include.ALL);
    158158      labeledExtractsQuery.restrict(Restrictions.eq(Hql.property("id"),
     
    194194   
    195195    // Query to retrieve source labeled extracts
    196     labeledExtractsQuery = (ItemQuery<LabeledExtract>)creationEvent.getSources();
     196    labeledExtractsQuery = (ItemQuery<Extract>)creationEvent.getSources();
    197197    labeledExtractsQuery.include(Include.ALL);
    198198    labeledExtractsQuery.order(Orders.asc(Hql.property("name")));
     
    306306      if (ids.length > 0)
    307307      {
    308         parents[parents.length] = 'LABELEDEXTRACT:'+ids.join(':');
     308        parents[parents.length] = 'EXTRACT:'+ids.join(':');
    309309      }
    310310      return parents;
     
    434434      var excludes = ids.join(',');
    435435     
    436       var url = '../../biomaterials/labeledextracts/index.jsp?ID=<%=ID%>&mode=selectmultiple&callback=addLabeledExtractCallback';
     436      var url = '../../biomaterials/extracts/index.jsp?ID=<%=ID%>&mode=selectmultiple&callback=addLabeledExtractCallback';
    437437      url += '&exclude='+excludes;
    438438      Main.openPopup(url, 'AddLabeledExtracts', 1000, 700);
     
    514514      if (labeledExtractsQuery != null)
    515515      {
    516         ItemResultList<LabeledExtract> labeledExtracts = labeledExtractsQuery.list(dc);
    517         for (LabeledExtract le : labeledExtracts)
     516        ItemResultList<Extract> labeledExtracts = labeledExtractsQuery.list(dc);
     517        for (Extract le : labeledExtracts)
    518518        {
    519519          if (hyb == null)
  • trunk/www/views/hybridizations/index.jsp

    r5590 r5641  
    3232  import="net.sf.basedb.core.ArraySlide"
    3333  import="net.sf.basedb.core.BioMaterialEvent"
    34   import="net.sf.basedb.core.LabeledExtract"
     34  import="net.sf.basedb.core.Extract"
    3535  import="net.sf.basedb.core.Protocol"
    3636  import="net.sf.basedb.core.Hardware"
     
    8686    // Register dataloaders
    8787    String hybridizationParameter = "hybridization";
    88     ItemQuery<LabeledExtract> labeledExtractQuery = LabeledExtract.getQuery();   
     88    ItemQuery<Extract> labeledExtractQuery = Extract.getQuery();   
    8989    labeledExtractQuery.include(cc.getInclude());
    9090    labeledExtractQuery.join(Hql.innerJoin("sourceEvents", "srcevt"));
     
    228228        if (leId != -1)
    229229        {
    230           LabeledExtract le = LabeledExtract.getById(dc, leId);
     230          Extract le = Extract.getById(dc, leId);
    231231          String[] extra = request.getParameter("L"+leId).split(":");
    232232          Float usedQuantity = Values.getFloat(extra[0], null);
     
    240240      {
    241241        int leId = Values.getInt(removedLabeledExtracts[i], -1);
    242         if (leId != -1) creationEvent.removeSource(LabeledExtract.getById(dc, leId));
     242        if (leId != -1) creationEvent.removeSource(Extract.getById(dc, leId));
    243243      }
    244244     
  • trunk/www/views/hybridizations/list_hybridizations.jsp

    r5559 r5641  
    2929  import="net.sf.basedb.core.Item"
    3030  import="net.sf.basedb.core.Hybridization"
    31   import="net.sf.basedb.core.LabeledExtract"
    32   import="net.sf.basedb.core.Label"
     31  import="net.sf.basedb.core.Extract"
     32  import="net.sf.basedb.core.Tag"
    3333  import="net.sf.basedb.core.Scan"
    3434  import="net.sf.basedb.core.BioMaterialEvent"
     
    9696
    9797  // Query for labeled extracts relatated to the current hybridization
    98   final ItemQuery<LabeledExtract> labeledExtractQuery = LabeledExtract.getQuery();
     98  final ItemQuery<Extract> labeledExtractQuery = Extract.getQuery();
    9999  labeledExtractQuery.include(cc.getInclude());
    100100  labeledExtractQuery.join(Hql.innerJoin("sourceEvents", "srcevt"));
     
    576576                    String separator = "";
    577577                    boolean isMultiArrayHyb = item.getNumArrays() > 1;
    578                     for (LabeledExtract le : labeledExtractQuery.list(dc))
     578                    for (Extract le : labeledExtractQuery.list(dc))
    579579                    {
    580                       Label label = null;
     580                      Tag label = null;
    581581                      boolean readLabel = true;
    582582                      try
    583583                      {
    584                         label = le.getLabel();
     584                        label = le.getTag();
    585585                      }
    586586                      catch (PermissionDeniedException ex)
  • trunk/www/views/hybridizations/view_hybridization.jsp

    r5559 r5641  
    4141  import="net.sf.basedb.core.Hardware"
    4242  import="net.sf.basedb.core.User"
    43   import="net.sf.basedb.core.LabeledExtract"
    44   import="net.sf.basedb.core.Label"
     43  import="net.sf.basedb.core.Extract"
     44  import="net.sf.basedb.core.Tag"
    4545  import="net.sf.basedb.core.MultiPermissions"
    4646  import="net.sf.basedb.core.ItemQuery"
     
    322322     
    323323      <%
    324       ItemQuery<LabeledExtract> labeledExtractsQuery = (ItemQuery<LabeledExtract>)creationEvent.getSources();
     324      ItemQuery<Extract> labeledExtractsQuery = (ItemQuery<Extract>)creationEvent.getSources();
    325325      labeledExtractsQuery.include(Include.ALL);
    326326      labeledExtractsQuery.order(Orders.asc(Hql.property("srcevt", "sourceGroup")));
    327327      labeledExtractsQuery.order(Orders.asc(Hql.property("name")));
    328       ItemResultList<LabeledExtract> labeledExtracts = labeledExtractsQuery.list(dc);
     328      ItemResultList<Extract> labeledExtracts = labeledExtractsQuery.list(dc);
    329329      if (labeledExtracts.size() == 0)
    330330      {
     
    374374            <tbl:rows>
    375375            <%
    376             for (LabeledExtract item : labeledExtracts)
     376            for (Extract item : labeledExtracts)
    377377            {
    378378              %>
     
    384384                    visible="<%=item.isRemoved()%>"
    385385                  /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell>
    386                 <tbl:cell column="label"><base:propertyvalue item="<%=item%>" property="label" /></tbl:cell>
     386                <tbl:cell column="label"><base:propertyvalue item="<%=item%>" property="tag" /></tbl:cell>
    387387                <tbl:cell column="quantity"><%=Values.formatNumber(creationEvent.getUsedQuantity(item), 2)%></tbl:cell>
    388388                <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell>
Note: See TracChangeset for help on using the changeset viewer.