Changeset 5642


Ignore:
Timestamp:
May 26, 2011, 9:37:32 AM (10 years ago)
Author:
Nicklas Nordborg
Message:

References #1153: Handling short read transcript sequence data

Replaced Hybridization with PhysicalBioAssay.
All test programs pass and the web client is usable. Terminology has to be modified in some places. Links to Scan remain but will be replaced later.

Location:
trunk
Files:
1 added
2 deleted
69 edited
4 copied
4 moved

Legend:

Unmodified
Added
Removed
  • trunk/config/dist/ehcache.xml

    r5632 r5642  
    135135  />
    136136  <cache
    137     name="net.sf.basedb.core.data.HybridizationData"
    138     maxElementsInMemory="100"
    139     eternal="false"
    140     timeToIdleSeconds="3600"
    141     timeToLiveSeconds="3600"
    142     overflowToDisk="false"
    143   />
    144   <cache
    145137    name="net.sf.basedb.core.data.ItemSubtypeData"
    146138    maxElementsInMemory="100"
     
    167159  />
    168160  <cache
     161    name="net.sf.basedb.core.data.PhysicalBioAssayData"
     162    maxElementsInMemory="100"
     163    eternal="false"
     164    timeToIdleSeconds="3600"
     165    timeToLiveSeconds="3600"
     166    overflowToDisk="false"
     167  />
     168  <cache
    169169    name="net.sf.basedb.core.data.PlateData"
    170170    maxElementsInMemory="100"
  • trunk/config/dist/hibernate.cfg.xml

    r5632 r5642  
    9999    />
    100100    <class-cache
    101       class="net.sf.basedb.core.data.HybridizationData"
    102       usage="nonstrict-read-write"
    103     />
    104     <class-cache
    105101      class="net.sf.basedb.core.data.ItemSubtypeData"
    106102      usage="nonstrict-read-write"
     
    115111    />
    116112    <class-cache
     113      class="net.sf.basedb.core.data.PhysicalBioAssayData"
     114      usage="nonstrict-read-write"
     115    />
     116    <class-cache
    117117      class="net.sf.basedb.core.data.PlateData"
    118118      usage="nonstrict-read-write"
  • trunk/src/clients/web/net/sf/basedb/clients/web/PermissionUtil.java

    r5641 r5642  
    198198          Item.BIOSOURCE, Item.SAMPLE, Item.EXTRACT, Item.TAG,
    199199          Item.BIOMATERIALLIST, Item.BIOPLATE, Item.BIOPLATETYPE, Item.BIOPLATEEVENT, Item.BIOPLATEEVENTTYPE,
    200           Item.HYBRIDIZATION, Item.SCAN, Item.RAWBIOASSAY, Item.EXPERIMENT, Item.FORMULA
     200          Item.PHYSICALBIOASSAY, Item.SCAN, Item.RAWBIOASSAY, Item.EXPERIMENT, Item.FORMULA
    201201        })
    202202      );
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/edit/EditUtil.java

    r5641 r5642  
    6363      Item.PLATEGEOMETRY, Item.PLATEMAPPING,
    6464      Item.DIRECTORY, Item.FILE, Item.FILESERVER, Item.PROJECT, Item.PERMISSIONTEMPLATE,
    65       Item.HYBRIDIZATION, Item.SCAN, Item.IMAGE, Item.RAWBIOASSAY,
     65      Item.PHYSICALBIOASSAY, Item.SCAN, Item.IMAGE, Item.RAWBIOASSAY,
    6666      Item.FORMULA, Item.REPORTER, Item.REPORTERLIST,
    6767      Item.EXPERIMENT, Item.TRANSFORMATION, Item.BIOASSAYSET, Item.BIOASSAY,
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/toolbar/ToolbarUtil.java

    r5641 r5642  
    6060      Item.RAWBIOASSAY, Item.RAWDATA, Item.FORMULA,
    6161      Item.REPORTER, Item.REPORTERLIST, Item.REPORTERSCORE,
    62       Item.SCAN, Item.IMAGE, Item.HYBRIDIZATION,
     62      Item.SCAN, Item.IMAGE, Item.PHYSICALBIOASSAY,
    6363      Item.BIOSOURCE, Item.SAMPLE, Item.EXTRACT,
    6464      Item.TAG, Item.BIOMATERIALEVENT,
  • trunk/src/clients/web/net/sf/basedb/clients/web/resources/common.properties

    r5641 r5642  
    8282item.session  Session
    8383item.session+ Sessions
    84 item.hybridization  Hybridization
    85 item.hybridization+ Hybridizations
     84item.physicalbioassay Physical bioassay
     85item.physicalbioassay+  Physical bioassays
    8686item.scan Scan
    8787item.scan+  Scans
  • trunk/src/clients/web/net/sf/basedb/clients/web/resources/menu.properties

    r5641 r5642  
    8585sessions.tooltip.0  You do not have permission to access sessions
    8686# --------------
    87 hybridizations.tooltip.1  Manage hybridizations
    88 hybridizations.tooltip.0  You do not have permission to manage hybridizations
     87physicalbioassays.tooltip.1 Manage physical bioassays
     88physicalbioassays.tooltip.0 You do not have permission to manage physical bioassays
    8989scans.tooltip.1 Manage scans
    9090scans.tooltip.0 You do not have permission to manage scans
  • trunk/src/core/common-queries.xml

    r5632 r5642  
    10621062  </query>
    10631063 
    1064   <query id="GET_LABELED_EXTRACTS_FOR_EXTRACT" type="HQL">
    1065     <sql>
    1066       SELECT {1}
    1067       FROM LabeledExtractData le
    1068       WHERE le.parent = :extract
    1069     </sql>
    1070     <description>
    1071       A Hibernate query that gets labeled extracts
    1072       created from a given extract.
    1073     </description>
    1074   </query>
    1075 
    10761064  <query id="GET_EXTRACTS_FOR_TAG" type="HQL">
    10771065    <sql>
  • trunk/src/core/net/sf/basedb/core/ArraySlide.java

    r4889 r5642  
    2424
    2525import net.sf.basedb.core.data.ArraySlideData;
    26 import net.sf.basedb.core.data.HybridizationData;
     26import net.sf.basedb.core.data.PhysicalBioAssayData;
    2727
    2828import java.util.Date;
     
    186186    throws BaseException
    187187  {
    188     return getData().getHybridization() != null || super.isUsed();
    189   }
    190   /**
    191     Get the hybridization that was used on this plate.
     188    return getData().getPhysicalBioAssay() != null || super.isUsed();
     189  }
     190  /**
     191    Get the bioassay that was used on this plate.
    192192    @since 2.2
    193193  */
     
    197197  {
    198198    Set<ItemProxy> using = super.getUsingItems();
    199     Hybridization item = getHybridization();
     199    PhysicalBioAssay item = getPhysicalBioAssay();
    200200    if (item != null) using.add(new ItemProxy(item.getId(), item.getType()));
    201201    return using;
     
    313313 
    314314  /**
    315     Get the {@link Hybridization} item which was used on this slide. To set the
    316     hybridization use the {@link Hybridization#setArraySlide(ArraySlide)} method.
    317 
    318     @return The <code>Hybridization</code> item
     315    Get the {@link PhysicalBioAssay} item which was used on this slide. To set,
     316    use the {@link PhysicalBioAssay#setArraySlide(ArraySlide)} method.
     317
     318    @return The <code>PhysicalBioAssay</code> item, or null
    319319    @throws PermissionDeniedException This exception is thrown if
    320320      the logged in user doesn't have read permission to the item
    321321    @throws BaseException If there is another error
    322   */
    323   public Hybridization getHybridization()
     322    @since 3.0
     323  */
     324  public PhysicalBioAssay getPhysicalBioAssay()
    324325    throws PermissionDeniedException, BaseException
    325326  {
    326     return getDbControl().getItem(Hybridization.class, getData().getHybridization());
    327   }
    328  
    329   /**
    330     Checks if this array design is used by a different hybridization
     327    return getDbControl().getItem(PhysicalBioAssay.class, getData().getPhysicalBioAssay());
     328  }
     329 
     330  /**
     331    Checks if this array slide is used by a different bioassay
    331332    than the given one.
    332     @param hyb The hybridization to check, or null to check if the slide is used
    333       by any hybridization
    334     @return TRUE if the slide is used by a different hybridization, or
    335       FALSE if it is used by the given hybridization, or not used at all
     333    @param pba The bioassay to check, or null to check if the slide is used
     334      by any bioassay
     335    @return TRUE if the slide is used by a different bioassay, or
     336      FALSE if it is used by the given bioassay, or not used at all
    336337    @since 2.8.3
    337338  */
    338   public boolean isUsedByOther(Hybridization hyb)
    339   {
    340     HybridizationData usedBy = getData().getHybridization();
     339  public boolean isUsedByOther(PhysicalBioAssay pba)
     340  {
     341    PhysicalBioAssayData usedBy = getData().getPhysicalBioAssay();
    341342    if (usedBy == null) return false;
    342     if (hyb == null) return true;
    343     return !usedBy.equals(hyb.getData());
     343    if (pba == null) return true;
     344    return !usedBy.equals(pba.getData());
    344345  }
    345346 
  • trunk/src/core/net/sf/basedb/core/BioMaterialEvent.java

    r5641 r5642  
    155155 
    156156  /**
    157     Create a new <code>BioMaterialEvent</code> of the {@link Type#HYBRIDIZATION}
     157    Create a new <code>BioMaterialEvent</code> of the {@link Type#BIOASSAY}
    158158    type.
    159159    @param dc The <code>DbControl</code> which will be used for
    160160      permission checking and database access
    161     @param hybridization The hybridization that was created.
     161    @param physicalBioAssay The hybridization that was created.
    162162    @param master The master bioplate event or null
    163163    @return The new <code>BioMaterialEvent</code> item
     
    165165    @since 2.17
    166166  */
    167   static BioMaterialEvent getNewHybridizationEvent(DbControl dc, Hybridization hybridization, BioPlateEventParticipant master)
     167  static BioMaterialEvent getNewBioAssayEvent(DbControl dc, PhysicalBioAssay physicalBioAssay, BioPlateEventParticipant master)
    168168    throws BaseException
    169169  {
    170170    BioMaterialEvent bme = dc.newItem(BioMaterialEvent.class);
    171     bme.setHybridization(hybridization);
    172     bme.getData().setEventType(Type.HYBRIDIZATION.getValue());
     171    bme.setPhysicalBioAssay(physicalBioAssay);
     172    bme.getData().setEventType(Type.BIOASSAY.getValue());
    173173    if (master != null)
    174174    {
     
    296296        break;
    297297      }
    298       case HYBRIDIZATION:
     298      case BIOASSAY:
    299299      {
    300300        granted |= Permission.grant(Permission.READ);
     
    332332    Project.Default defaultHardwareType = null;
    333333
    334     if (getEventType() == Type.HYBRIDIZATION)
     334    if (getEventType() == Type.BIOASSAY)
    335335    {
    336336      defaultProtocolType = Project.Default.HYBRIDIZATION_PROTOCOL;
     
    385385        return getData().getBioMaterial();
    386386      }
    387       case HYBRIDIZATION:
    388       {
    389         return getData().getHybridization();
     387      case BIOASSAY:
     388      {
     389        return getData().getPhysicalBioAssay();
    390390      }
    391391      case OTHER:
     
    436436 
    437437  /**
    438     Get the {@link Hybridization} that was created by this event.
    439     @return A <code>Hybridization</code> item or null if this isn't a
    440       hybridization event
     438    Get the {@link PhysicalBioAssay} that was created by this event.
     439    @return A <code>PhysicalBioAssay</code> item or null if this isn't a
     440      bioassay event
    441441    @throws PermissionDeniedException If the logged in user doesn't have
    442       read permission to the hybridization
     442      read permission to the bioassay
    443443    @throws BaseException If there is another error
    444444  */
    445   public Hybridization getHybridization()
     445  public PhysicalBioAssay getPhysicalBioAssay()
    446446    throws PermissionDeniedException, BaseException
    447447  {
    448     return getDbControl().getItem(Hybridization.class, getData().getHybridization());
     448    return getDbControl().getItem(PhysicalBioAssay.class, getData().getPhysicalBioAssay());
    449449  }
    450450
     
    452452    Set the hybidization that was created by this event.
    453453  */
    454   private void setHybridization(Hybridization hybridization)
     454  private void setPhysicalBioAssay(PhysicalBioAssay physicalBioAssay)
    455455    throws PermissionDeniedException, InvalidDataException
    456456  {
    457457    // No write permission check since this is only called at object creation
    458     if (hybridization == null) throw new InvalidUseOfNullException("hybridization");
    459     hybridization.checkPermission(Permission.USE);
    460     getData().setHybridization(hybridization.getData());
     458    if (physicalBioAssay == null) throw new InvalidUseOfNullException("physicalBioAssay");
     459    physicalBioAssay.checkPermission(Permission.USE);
     460    getData().setPhysicalBioAssay(physicalBioAssay.getData());
    461461  }
    462462
     
    667667    where it is essential to know which array a labeled extract goes on. The source
    668668    group is then simply the number of the array on the hybridization and should be
    669     a value between 1 and {@link Hybridization#getNumArrays()}.
     669    a value between 1 and {@link PhysicalBioAssay#getSize()}.
    670670    <p>
    671671    A single labeled extract can only be used in a single group. Experiments using a n-channel
     
    746746        throw new InvalidDataException("OTHER events can't have sources");
    747747      }
    748       case HYBRIDIZATION:
     748      case BIOASSAY:
    749749      {
    750750        if (bioMaterial.getType() != Item.EXTRACT)
    751751        {
    752           throw new InvalidDataException("The source for a hybridization must be a labeled extract");
     752          throw new InvalidDataException("The source for a physical bioassay must be an extract");
    753753        }
    754754        break;
     
    782782    to specify the parent.
    783783    @see Extract#setSample(Sample, Float)
    784     @see LabeledExtract#setExtract(Extract, Float)
    785784  */
    786785  void setSource(MeasuredBioMaterial bioMaterial, Float usedQuantity)
     
    837836    MeasuredBioMaterialData bioMaterialData = getData().getBioMaterial();
    838837    boolean pooled = bioMaterialData != null ? bioMaterialData.isPooled() : false;
    839     Item parentType = Item.fromDataObject(bioMaterialData == null ? getData().getHybridization() : bioMaterialData);
     838    Item parentType = Item.fromDataObject(bioMaterialData == null ? getData().getPhysicalBioAssay() : bioMaterialData);
    840839    switch (parentType)
    841840    {
     
    857856        break;
    858857      }
    859       case HYBRIDIZATION:
     858      case PHYSICALBIOASSAY:
    860859      {
    861860        query = Extract.getQuery();
     
    950949
    951950    /**
    952       An event of this type created a hybridization.
     951      An event of this type created a physical bioassay.
    953952    */
    954     HYBRIDIZATION(2, "Hybridization"),
     953    BIOASSAY(2, "Bioassay creation"),
    955954   
    956955    /**
  • trunk/src/core/net/sf/basedb/core/BioPlateEventType.java

    r5559 r5642  
    6969    The system ID for "Hybridization" event type.
    7070  */
    71   public static final String HYBRIDIZATION = "net.sf.basedb.core.BioPlateEventType.HYBRIDIZATION";
     71  public static final String PHYSICAL_BIOASSAY = "net.sf.basedb.core.BioPlateEventType.PHYSICAL_BIOASSAY";
    7272
    7373 
  • trunk/src/core/net/sf/basedb/core/Extract.java

    r5641 r5642  
    5858  */
    5959  public static final String LABELED = "net.sf.basedb.core.ExtractType.LABELED";
     60
     61  /**
     62    The id for the <code>ExtractType</code> item representing a library.
     63    @since 3.0
     64  */
     65  public static final String LIBRARY = "net.sf.basedb.core.ExtractType.LIBRARY";
    6066
    6167  /**
     
    327333
    328334  /**
    329     Get a query that returns all hybridizations created from this
     335    Get a query that returns all bioassays created from this
    330336    extract.
    331337    @return An {@link ItemQuery} object
    332338  */
    333   public ItemQuery<Hybridization> getHybridizations()
    334   {
    335     ItemQuery<Hybridization> query = Hybridization.getQuery();
     339  public ItemQuery<PhysicalBioAssay> getPhysicalBioAssays()
     340  {
     341    ItemQuery<PhysicalBioAssay> query = PhysicalBioAssay.getQuery();
    336342    query.joinPermanent(Hql.innerJoin("creationEvent.sources", Item.EXTRACT.getAlias()));
    337343    query.restrictPermanent(
  • trunk/src/core/net/sf/basedb/core/Hardware.java

    r5630 r5642  
    6868  */
    6969  public static final String HYBRIDIZATION_STATION = "net.sf.basedb.core.HardwareType.HYBRIDIZATION_STATION";
    70  
     70
     71  /**
     72    The id for the <code>HardwareType</code> object representing a
     73    sequencer.
     74    @since 3.0
     75  */
     76  public static final String SEQUENCER = "net.sf.basedb.core.HardwareType.SEQUENCER";
     77
    7178  /**
    7279    The id for the <code>HardwareType</code> object representing a
     
    270277    <li>{@link Scan}:s with this hardware
    271278    <li>{@link ArrayBatch}:s with this hardware
    272     <li>{@link BioMaterial}:s and {@link Hybridization}:s with this hardware
     279    <li>{@link BioMaterial}:s and {@link PhysicalBioAssay}:s with this hardware
    273280    <li>{@link Plate}:s with this hardware
    274281    <ul>
     
    316323    // BioMaterial events - hybridizations
    317324    query = HibernateUtil.getPredefinedQuery(session,
    318       "GET_BIOMATERIALEVENTS_FOR_HARDWARE", "bme.hybridization");
     325      "GET_BIOMATERIALEVENTS_FOR_HARDWARE", "bme.physicalBioAssay");
    319326      /*
    320327        SELECT {1}
  • trunk/src/core/net/sf/basedb/core/Install.java

    r5641 r5642  
    367367 
    368368      // Hybridization, raw data and experiments
    369       createRoleKey(Item.HYBRIDIZATION, "Hybridizations", "Gives access to hybridizations", users_create);
     369      createRoleKey(Item.PHYSICALBIOASSAY, "Physical bioassays", "Gives access to physical bioassays", users_create);
    370370      createRoleKey(Item.SCAN, "Scans", "Gives access to scan", users_create);
    371371      createRoleKey(Item.RAWBIOASSAY, "Raw bioassays", "Gives access to raw bioassays", users_create);
     
    440440      createItemSubtype(Item.PROTOCOL, Protocol.SAMPLING, "Sampling", "Protocols used for creating samples.", protocolFileType);
    441441      createItemSubtype(Item.PROTOCOL, Protocol.EXTRACTION, "Extraction", "Protocols used for creating extracts.", protocolFileType);
    442       ItemSubtypeData labelingProtocol = createItemSubtype(Item.PROTOCOL, Protocol.LABELING, "Labeling",
    443           "Protocols used for creating labeled extracts.", protocolFileType);
     442      ItemSubtypeData labelingProtocol = createItemSubtype(Item.PROTOCOL, Protocol.LABELING,
     443          "Labeling", "Protocols used for creating labeled extracts.", protocolFileType);
     444      ItemSubtypeData libraryPreparation = createItemSubtype(Item.PROTOCOL, Protocol.LIBRARY_PREPARATION,
     445          "Library preparation", "Protocols used for library preparation", protocolFileType);
    444446      createItemSubtype(Item.PROTOCOL, Protocol.POOLING, "Pooling", "Protocols used for creating pooled biomaterails.", protocolFileType);
    445       createItemSubtype(Item.PROTOCOL, Protocol.HYBRIDIZATION, "Hybridization", "Protocols used for creating hybridizations.", protocolFileType);
     447      ItemSubtypeData hybProtocol = createItemSubtype(Item.PROTOCOL, Protocol.HYBRIDIZATION,
     448          "Hybridization", "Protocols used for creating hybridizations.", protocolFileType);
     449      ItemSubtypeData sequencingProtocol = createItemSubtype(Item.PROTOCOL, Protocol.SEQUENCING,
     450          "Sequencing", "Protocol used while sequencing", protocolFileType);
    446451      createItemSubtype(Item.PROTOCOL, Protocol.PRINTING, "Printing", "Protocols used for printing a batch of array slides.", protocolFileType);
    447452      createItemSubtype(Item.PROTOCOL, Protocol.SCANNING, "Scanning", "Protocols used for scanning microarray images.", protocolFileType);
     
    452457      ItemSubtypeData robot = createItemSubtype(Item.HARDWARE, Hardware.PRINT_ROBOT, "Print robot", "Spot the probe on the array.");
    453458      ItemSubtypeData hybStation = createItemSubtype(Item.HARDWARE, Hardware.HYBRIDIZATION_STATION, "Hybridization station", "Automate the hybridization of microarrays on slides.");
     459      ItemSubtypeData sequencer = createItemSubtype(Item.HARDWARE, Hardware.SEQUENCER, "Sequencer", "Determines the sequence of DNA or RNA");
    454460      ItemSubtypeData freezer = createItemSubtype(Item.HARDWARE, Hardware.FREEZER, "Freezer", "Storage area for bioplates");
    455461      ItemSubtypeData otherHardware = createItemSubtype(Item.HARDWARE, Hardware.OTHER, "Other", "Other kinds of hardware that is used for some process.");
     
    465471     
    466472      // Biomaterial subtypes
    467       createItemSubtype(Item.EXTRACT, Extract.LABELED, "Labeled extract",
     473      ItemSubtypeData labeledExtract = createItemSubtype(Item.EXTRACT, Extract.LABELED, "Labeled extract",
    468474        "A labeled extract is an extract which has been tagged with a label",
    469475        labelTag, labelingProtocol);
     476      ItemSubtypeData library = createItemSubtype(Item.EXTRACT, Extract.LIBRARY, "Library",
     477        "An extract that has been prepared with an adaptor sequence before sequencing",
     478        barcodeTag, libraryPreparation);
     479     
     480      // Physical bioassay subtypes
     481      createItemSubtype(Item.PHYSICALBIOASSAY, PhysicalBioAssay.HYBRIDIZATION, "Hybridization",
     482        "", hybProtocol, hybStation, labeledExtract);
     483      createItemSubtype(Item.PHYSICALBIOASSAY, PhysicalBioAssay.FLOW_CELL, "Flow cell",
     484        "", sequencingProtocol, sequencer, library);
    470485     
    471486      // Hardware
     
    482497      createHardware("OmniGrid", "100", "", robot, rootUser, keyEveryoneUse);
    483498      createHardware("Qarray", "Max", "", robot, rootUser, keyEveryoneUse);
     499      // Sequencers
     500      createHardware("Illumina HiSeq 2000", null, "", sequencer, rootUser, keyEveryoneUse);
    484501 
    485502      // Software
     
    622639          "An event that creates child biomaterial. It is recommended that the creation event is " +
    623640          "linked with the destination plate.");
    624       BioPlateEventTypeData hybridizationEvent = createBioPlateEventType("Hybridization", BioPlateEventType.HYBRIDIZATION,
    625           "An event that creates child hybridizations.");
     641      BioPlateEventTypeData bioAssayEvent = createBioPlateEventType("Physical bioassay", BioPlateEventType.PHYSICAL_BIOASSAY,
     642          "An event that creates child physical bioassays.");
    626643     
    627644      // Tags
  • trunk/src/core/net/sf/basedb/core/Item.java

    r5641 r5642  
    422422 
    423423  /**
    424     The item is a {@link Hybridization}.
    425   */
    426   HYBRIDIZATION(261, "Hybridization", "hyb", Hybridization.class, HybridizationData.class, DefinedPermissions.shareable,
     424    The item is a {@link PhysicalBioAssay}.
     425  */
     426  PHYSICALBIOASSAY(261, "Physical bioassay", "pba", PhysicalBioAssay.class, PhysicalBioAssayData.class, DefinedPermissions.shareable,
    427427    350),
    428428  /**
  • trunk/src/core/net/sf/basedb/core/PhysicalBioAssay.java

    r5641 r5642  
    22  $Id$
    33
    4   Copyright (C) 2005 Johan Enell, Nicklas Nordborg
    5   Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg
     4  Copyright (C) 2011 Nicklas Nordborg
    65 
    76  This file is part of BASE - BioArray Software Environment.
     
    2423
    2524import net.sf.basedb.core.data.ArraySlideData;
    26 import net.sf.basedb.core.data.HybridizationData;
     25import net.sf.basedb.core.data.PhysicalBioAssayData;
    2726import net.sf.basedb.core.query.Expressions;
    2827import net.sf.basedb.core.query.Restrictions;
    2928import net.sf.basedb.core.query.Hql;
    3029
     30import java.util.Collection;
    3131import java.util.Date;
    3232import java.util.Set;
     
    3434
    3535/**
    36   A hybridization is a representation of the process of hybridizing
    37   one or more {@link LabeledExtract}:s on an {@link ArraySlide}.
    38 
    39   @author Enell, Nicklas
    40   @version 2.0
     36  A physical bioassay is a representation of the process of
     37  performing an experiment one or more {@link Extract}:s.
     38
     39  @author Nicklas
     40  @since 3.0
    4141  @base.modified $Date$
    4242*/
    43 public class Hybridization
    44   extends AnnotatedItem<HybridizationData>
    45   implements Registered
     43public class PhysicalBioAssay
     44  extends AnnotatedItem<PhysicalBioAssayData>
     45  implements Registered, Subtypable, FileStoreEnabled
    4646{
    4747  /**
    4848    The type of item represented by this class.
    49     @see Item#HYBRIDIZATION
     49    @see Item#PHYSICALBIOASSAY
    5050    @see #getType()
    5151  */
    52   public static final Item TYPE = Item.HYBRIDIZATION;
    53 
    54   /**
    55     Create a new <code>Hybridization</code> item.
     52  public static final Item TYPE = Item.PHYSICALBIOASSAY;
     53
     54  /**
     55    The id for the <code>PhysicalBioAssayType</code> item representing a
     56    hybridization.
     57  */
     58  public static final String HYBRIDIZATION = "net.sf.basedb.core.PhysicalBioAssayType.HYBRIDIZATION";
     59
     60  /**
     61    The id for the <code>PhysicalBioAssayType</code> item representing a
     62    flow cell.
     63  */
     64  public static final String FLOW_CELL = "net.sf.basedb.core.PhysicalBioAssayType.FLOW_CELL";
     65
     66 
     67  /**
     68    Create a new <code>PhysicalBioAssay</code> item.
    5669
    5770    @param dc The <code>DbControl</code> which will be used for
    5871      permission checking and database access
    59     @return The new <code>Hybridization</code> item
     72    @return The new <code>PhysicalBioAssay</code> item
    6073    @throws BaseException If there is an error
    6174  */
    62   public static Hybridization getNew(DbControl dc)
     75  public static PhysicalBioAssay getNew(DbControl dc)
    6376    throws BaseException
    6477  {
     
    6780
    6881  /**
    69     Create a new <code>Hybridization</code> item as part of a
     82    Create a new <code>PhysicalBioAssay</code> item as part of a
    7083    master bioplate event.
    7184 
     
    7386      permission checking and database access
    7487    @param master The master bioplate event participant or null
    75     @return The new <code>Hybridization</code> item
     88    @return The new <code>PhysicalBioAssay</code> item
    7689    @throws BaseException If there is an error
    7790    @since 2.17
    7891  */
    79   public static Hybridization getNew(DbControl dc, BioPlateEventParticipant master)
    80     throws BaseException
    81   {
    82     Hybridization h = dc.newItem(Hybridization.class);
     92  public static PhysicalBioAssay getNew(DbControl dc, BioPlateEventParticipant master)
     93    throws BaseException
     94  {
     95    PhysicalBioAssay h = dc.newItem(PhysicalBioAssay.class);
    8396    h.setName("New hybridization");
    84     h.setNumArrays(1);
     97    h.setSize(1);
    8598    h.setBioPlateEventParticipant(master);
    8699    return h;
     
    100113    @throws BaseException If there is another error
    101114  */
    102   public static Hybridization getById(DbControl dc, int id)
     115  public static PhysicalBioAssay getById(DbControl dc, int id)
    103116    throws ItemNotFoundException, PermissionDeniedException, BaseException
    104117  {
    105     Hybridization h = dc.loadItem(Hybridization.class, id);
    106     if (h == null) throw new ItemNotFoundException("Hybridization[id="+id+"]");
    107     return h;
    108   }
    109 
    110   /**
    111     Get a query that returns hybridizations.
     118    PhysicalBioAssay pba = dc.loadItem(PhysicalBioAssay.class, id);
     119    if (pba == null) throw new ItemNotFoundException("PhysicalBioAssay[id="+id+"]");
     120    return pba;
     121  }
     122
     123  /**
     124    Get a query that returns physical bioassays.
    112125    @return An {@link ItemQuery} object
    113126  */
    114   public static ItemQuery<Hybridization> getQuery()
    115   {
    116     return new ItemQuery<Hybridization>(Hybridization.class);
     127  public static ItemQuery<PhysicalBioAssay> getQuery()
     128  {
     129    return new ItemQuery<PhysicalBioAssay>(PhysicalBioAssay.class);
    117130  }
    118131
     
    121134  private BioPlateEventParticipant bioPlateEventParticipant;
    122135
    123   Hybridization(HybridizationData hybridizationData)
    124   {
    125     super(hybridizationData);
     136  PhysicalBioAssay(PhysicalBioAssayData physicalBioAssayData)
     137  {
     138    super(physicalBioAssayData);
    126139  }
    127140 
     
    167180  }
    168181  // -------------------------------------------
     182  /*
     183    From the Subtypable interface
     184    -----------------------------
     185  */
     186  @Override
     187  @SubtypableRelatedItems({Item.HARDWARE, Item.PROTOCOL, Item.EXTRACT})
     188  public ItemSubtype getItemSubtype()
     189  {
     190    return getDbControl().getItem(ItemSubtype.class, getData().getItemSubtype());
     191  }
     192  @Override
     193  public void setItemSubtype(ItemSubtype subtype)
     194  {
     195    checkPermission(Permission.WRITE);
     196    if (subtype != null)
     197    {
     198      subtype.setOnItem(this);
     199    }
     200    else
     201    {
     202      getData().setItemSubtype(null);
     203    }
     204  }
     205  // -------------------------------------------
     206  /*
     207    From the FileStoreEnabled interface
     208    -------------------------------------------
     209  */
     210  @Override
     211  public FileSet getFileSet()
     212  {
     213    DbControl dc = getDbControl();
     214    FileSet fs = dc.getItem(FileSet.class, getData().getFileSet(), this);
     215    if (fs == null)
     216    {
     217      fs = FileSet.getNew(dc, this);
     218      getData().setFileSet(fs.getData());
     219      dc.saveItemIf(this, fs, false);
     220    }
     221    return fs;
     222  }
     223  @Override
     224  public boolean hasFileSet()
     225  {
     226    return getData().getFileSet() != null;
     227  }
     228  /**
     229    @return Always null
     230  */
     231  @Override
     232  public Platform getPlatform()
     233  {
     234    return null;
     235  }
     236  /**
     237    @return Always null
     238  */
     239  @Override
     240  public PlatformVariant getVariant()
     241  {
     242    return null;
     243  }
     244  /**
     245    @return Always null
     246  */
     247  @Override
     248  public Collection<FileSet> getParentFileSets()
     249  {
     250    return null;
     251  }
     252  // -------------------------------------------
     253
    169254  /*
    170255    From the BasicItem class
     
    226311
    227312  /**
    228     Get the labeled extracts, possible on a specific array,
    229     and the array slide.
    230     @param arrayNum If > 0 only include the labeled extracts which has been
     313    Get the extracts, possible on a specific assay index, and the array slide.
     314    @param index If > 0 only include the extracts which has been
    231315      linked with {@link BioMaterialEvent#setSourceGroup(MeasuredBioMaterial, int)}.
    232       If <= 0 include all labeled extracts.
     316      If <= 0 include all extracts.
    233317  */
    234318  @SuppressWarnings("unchecked")
    235   public Set<Annotatable> getAnnotatableParents(int arrayNum)
     319  public Set<Annotatable> getAnnotatableParents(int index)
    236320    throws BaseException
    237321  {
     
    242326      ItemQuery<Extract> query = (ItemQuery<Extract>)event.getSources();
    243327      query.include(Include.ALL);
    244       if (arrayNum > 0)
     328      if (index > 0)
    245329      {
    246330        query.restrict(
    247331          Restrictions.eq(
    248332            Hql.property("srcevt", "sourceGroup"),
    249             Expressions.integer(arrayNum)
     333            Expressions.integer(index)
    250334          )
    251335        );
     
    274358      if (!isInDatabase())
    275359      {
    276         creationEvent = BioMaterialEvent.getNewHybridizationEvent(dc, this, bioPlateEventParticipant);
     360        creationEvent = BioMaterialEvent.getNewBioAssayEvent(dc, this, bioPlateEventParticipant);
    277361      }
    278362      else
     
    322406      arraySlide.checkPermission(Permission.USE);
    323407      data = arraySlide.getData();
    324       data.setHybridization(getData());
     408      data.setPhysicalBioAssay(getData());
    325409    }
    326410    getData().setArraySlide(data);
     
    328412 
    329413  /**
    330     Get the number of arrays that on the slide.
     414    Get the size of the bioassay. The size is the number of
     415    independent positions for biomaterial.
    331416    The default value is 1.
    332     @since 2.6
    333   */
    334   public int getNumArrays()
    335   {
    336     return getData().getNumArrays();
    337   }
    338   /**
    339     Set the number of arrays on a single slide. The value should be
    340     between 1 and the number of arrays specified by the connected array
    341     design. The latter requiremed is not checked.
    342     @param numArrays A value > 0
     417  */
     418  public int getSize()
     419  {
     420    return getData().getSize();
     421  }
     422  /**
     423    Set the size of the bioassay.
     424    @param size A value > 0
    343425    @throws NumberOutOfRangeException If the value is <=0
    344     @since 2.6
    345   */
    346   public void setNumArrays(int numArrays)
     426  */
     427  public void setSize(int size)
    347428  {
    348429    checkPermission(Permission.WRITE);
    349     if (numArrays <= 0) throw new NumberOutOfRangeException("numArrays", numArrays, 0, false);
    350     getData().setNumArrays(numArrays);
    351   }
    352  
    353   /**
    354     Get a query that returns labeled extracts connected to
    355     this hybridization.
    356     @param arrayNum If > 0 only labeled extracts on the specific sub-array
    357       are returned by the query, if <= 0, all labeled extracts
     430    if (size <= 0) throw new NumberOutOfRangeException("size", size, 0, false);
     431    getData().setSize(size);
     432  }
     433 
     434  /**
     435    Get a query that returns extracts connected to
     436    this bioassay.
     437    @param index If > 0 only extracts on the specific position
     438      are returned by the query, if <= 0, all extracts
    358439      are returned
    359440    @return An {@link ItemQuery} object
    360     @since 2.6
    361441  */
    362442  @SuppressWarnings("unchecked")
    363   public ItemQuery<Extract> getLabeledExtracts(int arrayNum)
     443  public ItemQuery<Extract> getExtracts(int index)
    364444  {
    365445    ItemQuery<Extract> query = (ItemQuery<Extract>)getCreationEvent().getSources();
    366     if (arrayNum > 0)
     446    if (index > 0)
    367447    {
    368448      query.restrictPermanent(
    369449        Restrictions.eq(
    370450          Hql.property("srcevt", "sourceGroup"),
    371           Expressions.integer(arrayNum)
     451          Expressions.integer(index)
    372452        )
    373453      );
  • trunk/src/core/net/sf/basedb/core/Project.java

    r5641 r5642  
    835835    SOFTWARE("default_software", "Software", Item.SOFTWARE, Software.FEATURE_EXTRACTION, Item.RAWBIOASSAY),
    836836    ARRAYDESIGN("default_arraydesign", "Array design", Item.ARRAYDESIGN, null, null),
    837     HYBRIDIZATION_HARDWARE("default_hybridization_hardware", "Hybridization station", Item.HARDWARE, Hardware.HYBRIDIZATION_STATION, Item.HYBRIDIZATION),
     837    HYBRIDIZATION_HARDWARE("default_hybridization_hardware", "Hybridization station", Item.HARDWARE, Hardware.HYBRIDIZATION_STATION, Item.PHYSICALBIOASSAY),
    838838    SCANNER_HARDWARE("default_scanner_hardware", "Scanner", Item.HARDWARE, Hardware.SCANNER, Item.SCAN), 
    839839    PRINTROBOT_HARDWARE("default_print_robot_hardware", "Print robot", Item.HARDWARE, Hardware.PRINT_ROBOT, Item.ARRAYBATCH),
     
    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     HYBRIDIZATION_PROTOCOL("default_hybridization_protocol", "Hybridization protocol", Item.PROTOCOL, Protocol.HYBRIDIZATION, Item.HYBRIDIZATION),
     843    HYBRIDIZATION_PROTOCOL("default_hybridization_protocol", "Hybridization protocol", Item.PROTOCOL, Protocol.HYBRIDIZATION, Item.PHYSICALBIOASSAY),
    844844    FEATURE_EXTRACTION_PROTOCOL("default_feature_extraction_protocol", "Feat. extraction protocol", Item.PROTOCOL, Protocol.FEATURE_EXTRACTION, Item.RAWBIOASSAY),
    845845    POOLING_PROTOCOL("default_pooling_protocol", "Pooling protocol", Item.PROTOCOL, Protocol.POOLING, null),
  • trunk/src/core/net/sf/basedb/core/Protocol.java

    r5631 r5642  
    6666  /**
    6767    The ID for the labeling protocol type, for example a protocol
    68     used when creating a {@link LabeledExtract} from
    69     an {@link Extract}.
     68    used when creating a labeled extract from an {@link Extract}.
    7069    @since 3.0
    7170  */
    7271  public static final String LABELING = "net.sf.basedb.core.ProtocolType.LABELING";
     72
     73  /**
     74    The ID for the library preparation protocol type, for example a protocol
     75    used when creating a library extract from an {@link Extract}.
     76    @since 3.0
     77  */
     78  public static final String LIBRARY_PREPARATION = "net.sf.basedb.core.ProtocolType.LIBRARY_PREPARATION";
     79
    7380 
    7481  /**
    7582    The ID for the pooling protocol type, for example a protocol
    76     used when creating a biomaterial item ({@link Sample},
    77     {@link Extract} or {@link LabeledExtract})
    78     from a set of other biomaterial items.
     83    used when creating a biomaterial item ({@link Sample} or
     84    {@link Extract}) from a set of other biomaterial items.
    7985    @since 3.0
    8086  */
     
    8389  /**
    8490    The ID for the hybridization protocol type, for example a protocol
    85     used when creating a {@link Hybridization} from a set of
    86     {@link LabeledExtract}:s.
     91    used when creating a {@link PhysicalBioAssay} from a set of
     92    (labeled) {@link Extract}:s.
    8793    @since 3.0
    8894  */
    8995  public static final String HYBRIDIZATION = "net.sf.basedb.core.ProtocolType.HYBRIDIZATION";
     96 
     97  /**
     98    The ID for the sequencing protocol type, for example a protocol
     99    used when creating a {@link PhysicalBioAssay} from a set of
     100    (library) {@link Extract}:s.
     101    @since 3.0
     102  */
     103  public static final String SEQUENCING = "net.sf.basedb.core.ProtocolType.SEQUENCING";
     104
    90105 
    91106  /**
     
    338353    Get all:
    339354    <ul>
    340     <li>a {@link BioMaterial}:s and {@link Hybridization}:s using this protocol
     355    <li>a {@link BioMaterial}:s and {@link PhysicalBioAssay}:s using this protocol
    341356    <li>a {@link Plate}:s using this protocol
    342357    <li>an {@link ArrayBatch}:s using this protocol
     
    365380    // Biomaterial events - hybridizations
    366381    query = HibernateUtil.getPredefinedQuery(session,
    367       "GET_BIOMATERIALEVENTS_FOR_PROTOCOL", "bme.hybridization");
     382      "GET_BIOMATERIALEVENTS_FOR_PROTOCOL", "bme.physicalBioAssay");
    368383      /*
    369384        SELECT {1}
  • trunk/src/core/net/sf/basedb/core/RawBioAssay.java

    r5623 r5642  
    617617    Set the hybridization array number this raw bioassay is linked to. The value should be
    618618    between 1 and the number of arrays specified by the hybridization,
    619     {@link Hybridization#getNumArrays()}.
     619    {@link PhysicalBioAssay#getNumArrays()}.
    620620    @param arrayNum A value > 0
    621621    @throws NumberOutOfRangeException If the value is <=0
  • trunk/src/core/net/sf/basedb/core/Scan.java

    r5590 r5642  
    2626import net.sf.basedb.core.data.ArraySlideData;
    2727import net.sf.basedb.core.data.HardwareData;
    28 import net.sf.basedb.core.data.HybridizationData;
     28import net.sf.basedb.core.data.PhysicalBioAssayData;
    2929import net.sf.basedb.core.data.ProtocolData;
    3030import net.sf.basedb.core.data.ScanData;
     
    3737
    3838/**
    39   A scan represents the scanning of a {@link Hybridization} by
     39  A scan represents the scanning of a {@link PhysicalBioAssay} by
    4040  some scanner. A single hybridization may be scanned multiple
    4141  times by the same or different scanner.
     
    6464    @param dc The <code>DbControl</code> which will be used for
    6565      permission checking and database access
    66     @param hybridization The hybridization the scan originates from
     66    @param physicalBioAssay The hybridization the scan originates from
    6767    @return The new <code>Scan</code> item
    6868    @throws PermissionDeniedException If the logged in user doesn't
     
    7070    @throws BaseException If there is an error
    7171  */
    72   public static Scan getNew(DbControl dc, Hybridization hybridization)
     72  public static Scan getNew(DbControl dc, PhysicalBioAssay physicalBioAssay)
    7373    throws PermissionDeniedException, BaseException
    7474  {
    7575    Scan scn = dc.newItem(Scan.class);
    76     scn.setHybridization(hybridization);
     76    scn.setHybridization(physicalBioAssay);
    7777    scn.setName("New scan");
    7878    scn.getData().setEntryDate(new Date());
     
    216216
    217217  /**
    218     Get the {@link Hybridization} this scan is created from. A scan
     218    Get the {@link PhysicalBioAssay} this scan is created from. A scan
    219219    must always have a hybridization.
    220220
     
    224224    @throws BaseException If there is another error.
    225225  */
    226   public Hybridization getHybridization()
    227     throws PermissionDeniedException, BaseException
    228   {
    229     return getDbControl().getItem(Hybridization.class, getData().getHybridization());
     226  public PhysicalBioAssay getHybridization()
     227    throws PermissionDeniedException, BaseException
     228  {
     229    return getDbControl().getItem(PhysicalBioAssay.class, getData().getHybridization());
    230230  }
    231231 
     
    233233    Set the {@link ArraySlide} this hybridization is using.
    234234
    235     @param hybridization The hybridization, null is not allowed
     235    @param physicalBioAssay The hybridization, null is not allowed
    236236    @throws InvalidDataException If the hybridization is null
    237237    @throws PermissionDeniedException If the logged in user doesn't have
     
    239239    @throws BaseException If there is another error
    240240  */
    241   public void setHybridization(Hybridization hybridization)
     241  public void setHybridization(PhysicalBioAssay physicalBioAssay)
    242242    throws InvalidDataException, PermissionDeniedException
    243243  {
    244244    checkPermission(Permission.WRITE);
    245     if (hybridization == null) throw new InvalidUseOfNullException("hybridization");
    246     hybridization.checkPermission(Permission.USE);
    247     getData().setHybridization(hybridization.getData());
     245    if (physicalBioAssay == null) throw new InvalidUseOfNullException("hybridization");
     246    physicalBioAssay.checkPermission(Permission.USE);
     247    getData().setHybridization(physicalBioAssay.getData());
    248248  }
    249249
     
    324324    throws PermissionDeniedException, BaseException
    325325  {
    326     HybridizationData hyb = getData().getHybridization();
     326    PhysicalBioAssayData hyb = getData().getHybridization();
    327327    if (hyb == null) return null;
    328328    ArraySlideData slide = hyb.getArraySlide();
  • trunk/src/core/net/sf/basedb/core/data/ArraySlideData.java

    r5119 r5642  
    121121  }
    122122
    123   private HybridizationData hybridization;
     123  private PhysicalBioAssayData bioassay;
    124124
    125125  /**
    126    Get the hybridization
    127    @hibernate.one-to-one property-ref="arraySlide"
    128    */
    129   public HybridizationData getHybridization()
     126    Get the bioassay.
     127    @hibernate.one-to-one property-ref="arraySlide"
     128    @since 3.0
     129  */
     130  public PhysicalBioAssayData getPhysicalBioAssay()
    130131  {
    131     return hybridization;
     132    return bioassay;
    132133  }
    133134
    134   public void setHybridization(HybridizationData hybridization)
     135  public void setPhysicalBioAssay(PhysicalBioAssayData bioassay)
    135136  {
    136     this.hybridization = hybridization;
     137    this.bioassay = bioassay;
    137138  }
    138139}
  • trunk/src/core/net/sf/basedb/core/data/BioMaterialEventData.java

    r5523 r5642  
    121121 
    122122 
    123   private HybridizationData hybridization;
     123  private PhysicalBioAssayData bioassay;
    124124  /**
    125125    Get the hybridization that was created by this event.
    126     @hibernate.many-to-one column="`hybridization_id`" not-null="false" outer-join="false" update="false"
    127   */
    128   public HybridizationData getHybridization()
    129   {
    130     return hybridization;
    131   }
    132   public void setHybridization(HybridizationData hybridization)
    133   {
    134     this.hybridization = hybridization;
     126    @hibernate.many-to-one column="`physicalbioassay_id`" not-null="false" outer-join="false" update="false"
     127  */
     128  public PhysicalBioAssayData getPhysicalBioAssay()
     129  {
     130    return bioassay;
     131  }
     132  public void setPhysicalBioAssay(PhysicalBioAssayData bioassay)
     133  {
     134    this.bioassay = bioassay;
    135135  }
    136136
  • trunk/src/core/net/sf/basedb/core/data/PhysicalBioAssayData.java

    r5640 r5642  
    11/*
    2  $Id$
     2  $Id$
    33
    4   Copyright (C) 2005 Johan Enell, Nicklas Nordborg
    5   Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg
     4  Copyright (C) 2011 Nicklas Nordborg
    65
    76  This file is part of BASE - BioArray Software Environment.
    87  Available at http://base.thep.lu.se/
    98
    10  BASE is free software; you can redistribute it and/or
    11  modify it under the terms of the GNU General Public License
    12  as published by the Free Software Foundation; either version 3
    13  of the License, or (at your option) any later version.
    14 
    15  BASE is distributed in the hope that it will be useful,
    16  but WITHOUT ANY WARRANTY; without even the implied warranty of
    17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    18  GNU General Public License for more details.
    19 
    20  You should have received a copy of the GNU General Public License
    21  along with BASE. If not, see <http://www.gnu.org/licenses/>.
    22  */
     9  BASE is free software; you can redistribute it and/or
     10  modify it under the terms of the GNU General Public License
     11  as published by the Free Software Foundation; either version 3
     12  of the License, or (at your option) any later version.
     13 
     14  BASE is distributed in the hope that it will be useful,
     15  but WITHOUT ANY WARRANTY; without even the implied warranty of
     16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     17  GNU General Public License for more details.
     18 
     19  You should have received a copy of the GNU General Public License
     20  along with BASE. If not, see <http://www.gnu.org/licenses/>.
     21*/
    2322package net.sf.basedb.core.data;
    2423
     
    2625
    2726/**
    28   This class holds information about an hybridization.
     27  This class holds information about a physical bioassay (eg. a hybridization or similar).
    2928 
    3029  @author Nicklas
    31   @version 2.0
    32   @see net.sf.basedb.core.Hybridization
    33   @see <a href="../../../../../../html/developerdoc/api/data_api.rawdata.html">Hybridzations and raw data overview</a>
     30  @since 3.0
     31  @see net.sf.basedb.core.PhysicalBioAssay
    3432  @base.modified $Date$
    35   @hibernate.class table="`Hybridizations`" lazy="true"
     33  @hibernate.class table="`PhysicalBioAssays`" lazy="true"
    3634*/
    37 public class HybridizationData
     35public class PhysicalBioAssayData
    3836  extends AnnotatedData
     37  implements SubtypableData, FileStoreEnabledData
    3938{
    4039
    41   public HybridizationData()
     40  public PhysicalBioAssayData()
    4241  {}
     42
     43  /*
     44    From the SubtypableData interface
     45    ----------------------------------
     46  */
     47  private ItemSubtypeData subtype;
     48  @Override
     49  public ItemSubtypeData getItemSubtype()
     50  {
     51     return subtype;
     52  }
     53  @Override
     54  public void setItemSubtype(ItemSubtypeData subtype)
     55  {
     56     this.subtype = subtype;
     57  }
     58  // ------------------------------
     59
     60  /*
     61    From the FileStoreEnabledData interface
     62    -------------------------------------------
     63  */
     64  private FileSetData fileSet;
     65  public FileSetData getFileSet()
     66  {
     67     return fileSet;
     68  }
     69  public void setFileSet(FileSetData fileSet)
     70  {
     71     this.fileSet = fileSet;
     72  }
     73  // -------------------------------------------
    4374
    4475  private ArraySlideData arraySlide;
     
    6091  private BioMaterialEventData creationEvent;
    6192  /**
    62     Get the event that created this hybidization. Mapping is defined
    63     in hibernate-properties-HybridizationData.xml since XDoclet cannot
    64     generate it.
     93    Get the event that created this bioassay. Mapping is defined
     94    in hibernate-properties-PhysicalBioassayData.xml since XDoclet
     95    cannot generate it.
    6596  */
    6697  public BioMaterialEventData getCreationEvent()
     
    73104  }
    74105 
    75   private int numArrays;
     106  private int size;
    76107  /**
    77     The number of arrays that was hybridized. Shold be <= ArrayDesign.numArrays
    78     @hibernate.property column="`num_arrays`" type="int" not-null="true"
    79     @since 2.6
     108    The number size of the bioassay. Eg. the number of biomaterial positions that
     109    it has. A single position may or may not hold more than one biomaterial.
     110    @hibernate.property column="`size`" type="int" not-null="true"
    80111  */
    81   public int getNumArrays()
     112  public int getSize()
    82113  {
    83     return numArrays;
     114    return size;
    84115  }
    85   public void setNumArrays(int numArrays)
     116  public void setSize(int size)
    86117  {
    87     this.numArrays = numArrays;
     118    this.size = size;
    88119  }
    89120
     
    105136  }
    106137
     138
    107139}
  • trunk/src/core/net/sf/basedb/core/data/ScanData.java

    r4889 r5642  
    5959  // -------------------------------------------
    6060
    61   private HybridizationData hybridization;
     61  private PhysicalBioAssayData hybridization;
    6262  /**
    6363    Get the hybridization.
    6464    @hibernate.many-to-one column="`hybridization_id`" not-null="true" outer-join="false"
    6565  */
    66   public HybridizationData getHybridization()
     66  public PhysicalBioAssayData getHybridization()
    6767  {
    6868    return hybridization;
    6969  }
    70   public void setHybridization(HybridizationData hybridization)
     70  public void setHybridization(PhysicalBioAssayData hybridization)
    7171  {
    7272    this.hybridization = hybridization;
  • trunk/src/core/net/sf/basedb/core/data/hibernate-properties-BioMaterialEventData.xml

    r4889 r5642  
    5656
    5757  <properties
    58     name="hybridizationEvent"
     58    name="bioAssayEvent"
    5959    >
    6060    <property
     
    6868    />
    6969    <many-to-one
    70       name="hybridization"
    71       class="net.sf.basedb.core.data.HybridizationData"
     70      name="physicalBioAssay"
     71      class="net.sf.basedb.core.data.PhysicalBioAssayData"
    7272      cascade="none"
    7373      fetch="select"
     
    7575      insert="false"
    7676      access="property"
    77       column="`hybridization_id`"
     77      column="`physicalbioassay_id`"
    7878      not-null="false"
    7979    />
  • trunk/src/core/net/sf/basedb/core/data/hibernate-properties-PhysicalBioAssayData.xml

    r5640 r5642  
    3434    class="net.sf.basedb.core.data.BioMaterialEventData"
    3535    fetch="select"
    36     property-ref="hybridizationEvent"
     36    property-ref="bioAssayEvent"
    3737    cascade="delete"
    3838    >
  • trunk/src/core/net/sf/basedb/core/log/db/BioMaterialEventLogger.java

    r5384 r5642  
    7474        change = details.toChangeHistoryDetailData(event.getBioMaterial(), ChangeType.UPDATE, detailedProperties);
    7575      }
    76       else if (eventType == BioMaterialEvent.Type.HYBRIDIZATION)
     76      else if (eventType == BioMaterialEvent.Type.BIOASSAY)
    7777      {
    78         change = details.toChangeHistoryDetailData(event.getHybridization(), ChangeType.UPDATE, detailedProperties);
     78        change = details.toChangeHistoryDetailData(event.getPhysicalBioAssay(), ChangeType.UPDATE, detailedProperties);
    7979      }
    8080    }
  • trunk/src/core/net/sf/basedb/util/AnnotationUtil.java

    r5384 r5642  
    3131import net.sf.basedb.core.BaseException;
    3232import net.sf.basedb.core.DbControl;
    33 import net.sf.basedb.core.Hybridization;
     33import net.sf.basedb.core.PhysicalBioAssay;
    3434import net.sf.basedb.core.RawBioAssay;
    3535import net.sf.basedb.core.Scan;
     
    102102    that. The array num is kept as we move up to Scan and Hybridization.
    103103    When the Hybridization is reached we use the arrayNum to call
    104     {@link Hybridization#getAnnotatableParents(int)} so that we only
     104    {@link PhysicalBioAssay#getAnnotatableParents(int)} so that we only
    105105    get labeled extracts that are linked with the correct array num.
    106106  */
     
    121121        return ((RawBioAssay)item).getArrayNum();
    122122      }
    123       else if (item instanceof Scan || item instanceof Hybridization)
     123      else if (item instanceof Scan || item instanceof PhysicalBioAssay)
    124124      {
    125125        return arrayNum;
     
    153153      Set<Annotatable> parents = null;
    154154      Set<AnnotatableWrapper> wrappedParents = Collections.emptySet();
    155       if (item instanceof Hybridization)
     155      if (item instanceof PhysicalBioAssay)
    156156      {
    157         parents = ((Hybridization)item).getAnnotatableParents(arrayNum);
     157        parents = ((PhysicalBioAssay)item).getAnnotatableParents(arrayNum);
    158158      }
    159159      else
  • trunk/src/core/net/sf/basedb/util/overview/OverviewUtil.java

    r5500 r5642  
    3737import net.sf.basedb.core.DbControl;
    3838import net.sf.basedb.core.Presets;
    39 import net.sf.basedb.core.Hybridization;
     39import net.sf.basedb.core.PhysicalBioAssay;
    4040import net.sf.basedb.core.Item;
    4141import net.sf.basedb.core.ItemQuery;
     
    366366    String cacheKey = "annotatable.parent." + item.getType().name() + "." + item.getId();
    367367
    368     Hybridization hyb = null;
     368    PhysicalBioAssay hyb = null;
    369369    int arrayNum = 1;
    370370    // Special case when starting with a raw bioassay since we only
     
    379379        cacheKey += "#" + arrayNum;
    380380      }
    381       else if (item instanceof Hybridization)
    382       {
    383         hyb = (Hybridization)item;
     381      else if (item instanceof PhysicalBioAssay)
     382      {
     383        hyb = (PhysicalBioAssay)item;
    384384        cacheKey += "#" + arrayNum;
    385385      }
  • trunk/src/core/net/sf/basedb/util/overview/loader/ArraySlideLoader.java

    r5500 r5642  
    2525import net.sf.basedb.core.ArraySlide;
    2626import net.sf.basedb.core.DbControl;
    27 import net.sf.basedb.core.Hybridization;
     27import net.sf.basedb.core.PhysicalBioAssay;
    2828import net.sf.basedb.core.Item;
    2929import net.sf.basedb.core.ItemQuery;
     
    3939  Node loader implementation for array slides. The forward-loading
    4040  direction goes from {@link ArrayBatch}:s -&gt; {@link ArraySlide}:s -&gt;
    41   {@link Hybridization}:s. The reverse-loading direction is the opposite
     41  {@link PhysicalBioAssay}:s. The reverse-loading direction is the opposite
    4242  direction.
    4343
     
    9999    try
    100100    {
    101       slide = ((Hybridization)hybNode.getItem(dc)).getArraySlide();
     101      slide = ((PhysicalBioAssay)hybNode.getItem(dc)).getArraySlide();
    102102    }
    103103    catch (PermissionDeniedException ex)
     
    128128
    129129  /**
    130     Loads the hybridization node that is related to the given array slide node.
     130    Loads the physical bioassay node that is related to the given array slide node.
    131131    @see HybridizationLoader#createForwardNode(DbControl, OverviewContext, Node)
    132132  */
     
    134134  protected void loadForwardChildNodes(DbControl dc, OverviewContext context, Node slideNode)
    135135  {
    136     getNodeLoader(context, Item.HYBRIDIZATION).createForwardNode(dc, context, slideNode);
     136    getNodeLoader(context, Item.PHYSICALBIOASSAY).createForwardNode(dc, context, slideNode);
    137137  }
    138138 
  • trunk/src/core/net/sf/basedb/util/overview/loader/BasicItemNodeLoaderFactory.java

    r5641 r5642  
    221221    registerCheckedNodeLoader(Item.ARRAYBATCH, ArrayBatchLoader.class);
    222222    registerCheckedNodeLoader(Item.ARRAYSLIDE, ArraySlideLoader.class);
    223     registerCheckedNodeLoader(Item.HYBRIDIZATION, HybridizationLoader.class);
     223    registerCheckedNodeLoader(Item.PHYSICALBIOASSAY, HybridizationLoader.class);
    224224    registerCheckedNodeLoader(Item.SCAN, ScanLoader.class);
    225225    registerCheckedNodeLoader(Item.RAWBIOASSAY, RawBioAssayLoader.class);
  • trunk/src/core/net/sf/basedb/util/overview/loader/ExtractLoader.java

    r5641 r5642  
    2424import net.sf.basedb.core.DbControl;
    2525import net.sf.basedb.core.Extract;
    26 import net.sf.basedb.core.Hybridization;
     26import net.sf.basedb.core.PhysicalBioAssay;
    2727import net.sf.basedb.core.Item;
    2828import net.sf.basedb.core.ItemQuery;
     
    4343  Node loader implementation for extracts. The forward-loading
    4444  direction goes from {@link Sample}:s -&gt; {@link Extract}:s -&gt;
    45   {@link Hybridization}:s. The reverse-loading direction is the opposite
     45  {@link PhysicalBioAssay}:s. The reverse-loading direction is the opposite
    4646  direction. In both cases we also need to consider pooled extracts.
    4747
     
    9898    Node returnNode = null;
    9999    Item parentItem = parentNode.getItemType();
    100     if (parentItem == Item.HYBRIDIZATION)
    101     {
    102       returnNode = createReverseNode((Hybridization)parentNode.getItem(dc), dc, context, parentNode);
     100    if (parentItem == Item.PHYSICALBIOASSAY)
     101    {
     102      returnNode = createReverseNode((PhysicalBioAssay)parentNode.getItem(dc), dc, context, parentNode);
    103103    }
    104104    else if (parentItem == Item.EXTRACT)
     
    129129
    130130  /**
    131     Loads the pooled extracts and hybridizations that has been created from
     131    Loads the pooled extracts and physical bioassays that has been created from
    132132    this extract.
    133133    @see ExtractLoader#createForwardNode(DbControl, OverviewContext, Node)
     
    137137  protected void loadForwardChildNodes(DbControl dc, OverviewContext context, Node extractNode)
    138138  {
    139     getNodeLoader(context, Item.HYBRIDIZATION).createForwardNode(dc, context, extractNode);
     139    getNodeLoader(context, Item.PHYSICALBIOASSAY).createForwardNode(dc, context, extractNode);
    140140    getNodeLoader(context, Item.EXTRACT).createForwardNode(dc, context, extractNode);
    141141  }
     
    203203
    204204  /**
    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)
     205    Create reverse-loading extract nodes from a physical bioassay. Eg. the child nodes
     206    are the extracts that has been used on a bioassay.
     207  */
     208  private Node createReverseNode(PhysicalBioAssay hyb, DbControl dc, OverviewContext context, Node parentNode)
    209209  {
    210210    Node folderNode = null;
     
    212212 
    213213    // If we have followed this path from a raw bioassay we should
    214     // only load labeled extracts on the specific 'array index'
     214    // only load extracts on the specific 'array index'
    215215    Node rbaNode = parentNode.getFirstParent(new ItemTypeFilter(Item.RAWBIOASSAY));
    216216    int arrayNum = 0;
     
    219219      arrayNum = ((RawBioAssay)rbaNode.getItem()).getArrayNum();
    220220    }
    221     ItemQuery<Extract> query = context.initQuery(hyb.getLabeledExtracts(arrayNum), "name");
     221    ItemQuery<Extract> query = context.initQuery(hyb.getExtracts(arrayNum), "name");
    222222    ItemResultIterator<Extract> it = query.iterate(dc);
    223223    while (it.hasNext())
  • trunk/src/core/net/sf/basedb/util/overview/loader/HardwareLoader.java

    r4748 r5642  
    2626import net.sf.basedb.core.DbControl;
    2727import net.sf.basedb.core.Hardware;
    28 import net.sf.basedb.core.Hybridization;
     28import net.sf.basedb.core.PhysicalBioAssay;
    2929import net.sf.basedb.core.Item;
    3030import net.sf.basedb.core.PermissionDeniedException;
     
    8282        hardware = ((Scan)parentItem).getScanner();
    8383      }
    84       else if (parentItem instanceof Hybridization)
     84      else if (parentItem instanceof PhysicalBioAssay)
    8585      {
    8686        nodeTitlePrefix = "Hyb. station";
    87         hardware = ((Hybridization)parentItem).getCreationEvent().getHardware();
     87        hardware = ((PhysicalBioAssay)parentItem).getCreationEvent().getHardware();
    8888      }
    8989      else if (parentItem instanceof ArrayBatch)
  • trunk/src/core/net/sf/basedb/util/overview/loader/HybridizationLoader.java

    r5641 r5642  
    2525import net.sf.basedb.core.DbControl;
    2626import net.sf.basedb.core.Extract;
    27 import net.sf.basedb.core.Hybridization;
     27import net.sf.basedb.core.PhysicalBioAssay;
    2828import net.sf.basedb.core.Item;
    2929import net.sf.basedb.core.ItemQuery;
     
    4444  directions:
    4545  <ol>
    46   <li>{@link LabeledExtract}:s -&gt; {@link Hybridization}:s -&gt;
     46  <li>{@link LabeledExtract}:s -&gt; {@link PhysicalBioAssay}:s -&gt;
    4747  {@link Scan}:s.
    48   <li>{@link ArraySlide}:s -&gt; {@link Hybridization}:s -&gt;
     48  <li>{@link ArraySlide}:s -&gt; {@link PhysicalBioAssay}:s -&gt;
    4949  {@link Scan}:s
    5050  </ol>
     
    5858*/
    5959public class HybridizationLoader
    60   extends BasicItemNodeLoader<Hybridization>
     60  extends BasicItemNodeLoader<PhysicalBioAssay>
    6161{
    6262  public HybridizationLoader()
    6363  {
    64     super(Item.HYBRIDIZATION, ALLOW_ROOT_NODE,
    65         new NameableNameGenerator<Hybridization>("hybridization", "Hybridization"));
     64    super(Item.PHYSICALBIOASSAY, ALLOW_ROOT_NODE,
     65        new NameableNameGenerator<PhysicalBioAssay>("hybridization", "Hybridization"));
    6666  }
    6767
     
    101101  public Node createReverseNode(DbControl dc, OverviewContext context, Node scanNode)
    102102  {
    103     NodeFactory<Hybridization> nf = getNodeFactory(dc, context);
    104     Hybridization hyb = null;
     103    NodeFactory<PhysicalBioAssay> nf = getNodeFactory(dc, context);
     104    PhysicalBioAssay hyb = null;
    105105    boolean denied = false;
    106106    int arrayNum = 0;
     
    197197  private Node createForwardNode(Extract extract, DbControl dc, OverviewContext context, Node parentNode)
    198198  {
    199     NodeFactory<Hybridization> nf = getNodeFactory(dc, context);
     199    NodeFactory<PhysicalBioAssay> nf = getNodeFactory(dc, context);
    200200    Node folderNode = null;
    201     ItemQuery<Hybridization> query = context.initQuery(extract.getHybridizations(), "name");
    202     ItemResultIterator<Hybridization> it = query.iterate(dc);
     201    ItemQuery<PhysicalBioAssay> query = context.initQuery(extract.getPhysicalBioAssays(), "name");
     202    ItemResultIterator<PhysicalBioAssay> it = query.iterate(dc);
    203203    while (it.hasNext())
    204204    {
    205       Hybridization hyb = it.next();
     205      PhysicalBioAssay hyb = it.next();
    206206      int arrayNum = hyb.getCreationEvent().getSourceGroup(extract);
    207207      Object cacheKey = arrayNum == 0 ? hyb : new IndexedCacheKey(hyb, arrayNum);
     
    221221  private Node createForwardNode(ArraySlide slide, DbControl dc, OverviewContext context, Node parentNode)
    222222  {
    223     NodeFactory<Hybridization> nf = getNodeFactory(dc, context);
    224     Hybridization hyb = null;
     223    NodeFactory<PhysicalBioAssay> nf = getNodeFactory(dc, context);
     224    PhysicalBioAssay hyb = null;
    225225    boolean denied = false;
    226226    try
    227227    {
    228       hyb = slide.getHybridization();
     228      hyb = slide.getPhysicalBioAssay();
    229229    }
    230230    catch (PermissionDeniedException ex)
  • trunk/src/core/net/sf/basedb/util/overview/loader/RawBioAssayLoader.java

    r5641 r5642  
    2626import net.sf.basedb.core.Experiment;
    2727import net.sf.basedb.core.Extract;
    28 import net.sf.basedb.core.Hybridization;
     28import net.sf.basedb.core.PhysicalBioAssay;
    2929import net.sf.basedb.core.Item;
    3030import net.sf.basedb.core.ItemQuery;
     
    7979    ItemQuery<RawBioAssay> query = context.initQuery(scan.getRawBioAssays(), "name");
    8080   
    81     // If we have a labeled extract as parent we need to know the array number
    82     // to be able to load the correct raw bioassays -- The same hyb may have
    83     // other raw bioassays that are NOT related to the same labeled extract
     81    // If we have a extract as parent we need to know the array number
     82    // to be able to load the correct raw bioassays -- The same physical bioassay
     83    // may have other raw bioassays that are NOT related to the same extract
    8484    int arrayNum = 0;
    85     Hybridization hyb = null;
    86     Node hybNode = scanNode.getFirstParent(new ItemTypeFilter(Item.HYBRIDIZATION));
    87     if (hybNode != null)
     85    PhysicalBioAssay hyb = null;
     86    Node assayNode = scanNode.getFirstParent(new ItemTypeFilter(Item.PHYSICALBIOASSAY));
     87    if (assayNode != null)
    8888    {
    89       Node labeledExtractNode = hybNode.getFirstParent(new ItemTypeFilter(Item.EXTRACT));
    90       if (labeledExtractNode != null)
     89      Node extractNode = assayNode.getFirstParent(new ItemTypeFilter(Item.EXTRACT));
     90      if (extractNode != null)
    9191      {
    92         hyb = (Hybridization)hybNode.getItem(dc);
    93         Extract extract = (Extract)labeledExtractNode.getItem();
     92        hyb = (PhysicalBioAssay)assayNode.getItem(dc);
     93        Extract extract = (Extract)extractNode.getItem();
    9494        arrayNum = hyb.getCreationEvent().getSourceGroup(extract);
    9595      }
  • trunk/src/core/net/sf/basedb/util/overview/loader/ScanLoader.java

    r5641 r5642  
    2424import net.sf.basedb.core.DbControl;
    2525import net.sf.basedb.core.Extract;
    26 import net.sf.basedb.core.Hybridization;
     26import net.sf.basedb.core.PhysicalBioAssay;
    2727import net.sf.basedb.core.Item;
    2828import net.sf.basedb.core.ItemQuery;
     
    4141/**
    4242  Node loader implementation for scans. The forward-loading
    43   direction goes from {@link Hybridization}:s -&gt; {@link Scan}:s -&gt;
     43  direction goes from {@link PhysicalBioAssay}:s -&gt; {@link Scan}:s -&gt;
    4444  {@link RawBioAssay}:s. The reverse-loading direction is the opposite
    4545  direction.
     
    7474    NodeFactory<Scan> nf = getNodeFactory(dc, context);
    7575    Node folderNode = null;
    76     Hybridization hyb = (Hybridization)hybridizationNode.getItem(dc);
     76    PhysicalBioAssay hyb = (PhysicalBioAssay)hybridizationNode.getItem(dc);
    7777    ItemQuery<Scan> scanQuery = context.initQuery(hyb.getScans(), "name");
    7878
     
    164164 
    165165  /**
    166     Loads the hybridization node that is the parent of this scan.
     166    Loads the physical bioassay node that is the parent of this scan.
    167167    @see HybridizationLoader#createReverseNode(DbControl, OverviewContext, Node)
    168168  */
     
    170170  protected void loadReverseChildNodes(DbControl dc, OverviewContext context, Node scanNode)
    171171  {
    172     getNodeLoader(context, Item.HYBRIDIZATION).createReverseNode(dc, context, scanNode);
     172    getNodeLoader(context, Item.PHYSICALBIOASSAY).createReverseNode(dc, context, scanNode);
    173173  }
    174174  // ---------------------------------------
  • trunk/src/core/net/sf/basedb/util/overview/validator/BasicItemNodeValidatorFactory.java

    r5641 r5642  
    197197    registerCheckedNodeValidator(Item.ARRAYBATCH, ArrayBatchValidator.class);
    198198    registerCheckedNodeValidator(Item.ARRAYSLIDE, ArraySlideValidator.class);
    199     registerCheckedNodeValidator(Item.HYBRIDIZATION, HybridizationValidator.class);
     199    registerCheckedNodeValidator(Item.PHYSICALBIOASSAY, HybridizationValidator.class);
    200200    registerCheckedNodeValidator(Item.SCAN, ScanValidator.class);
    201201    registerCheckedNodeValidator(Item.RAWBIOASSAY, RawBioAssayValidator.class);
  • trunk/src/core/net/sf/basedb/util/overview/validator/HybridizationValidator.java

    r4764 r5642  
    2222package net.sf.basedb.util.overview.validator;
    2323
    24 import net.sf.basedb.core.Hybridization;
     24import net.sf.basedb.core.PhysicalBioAssay;
    2525import net.sf.basedb.core.Item;
    2626import net.sf.basedb.util.overview.Fix;
     
    4040*/
    4141public class HybridizationValidator
    42   extends NameableNodeValidator<Hybridization>
     42  extends NameableNodeValidator<PhysicalBioAssay>
    4343{
    4444 
  • trunk/src/core/net/sf/basedb/util/overview/validator/RawBioAssayValidator.java

    r5384 r5642  
    2727import net.sf.basedb.core.ArrayDesign;
    2828import net.sf.basedb.core.DbControl;
    29 import net.sf.basedb.core.Hybridization;
     29import net.sf.basedb.core.PhysicalBioAssay;
    3030import net.sf.basedb.core.Project;
    3131import net.sf.basedb.core.RawBioAssay;
     
    120120      }
    121121     
    122       Hybridization hyb = scan.getHybridization();
    123       if (arrayIndex > hyb.getNumArrays() || arrayIndex < 1)
     122      PhysicalBioAssay hyb = scan.getHybridization();
     123      if (arrayIndex > hyb.getSize() || arrayIndex < 1)
    124124      {
    125125        context.createFailure(Validator.INCORRECT_ARRAY_NUM, node,
    126126          "Incorrect sub-array index: " + arrayIndex +
    127             " (expected 1.." + hyb.getNumArrays() + ")",
     127            " (expected 1.." + hyb.getSize() + ")",
    128128          new Fix("Change array index on raw bioassay", rba),
    129129          new Fix("Increase arrays on hybridization", hyb));
  • trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/AbstractItemImporter.java

    r5641 r5642  
    4848import net.sf.basedb.core.File;
    4949import net.sf.basedb.core.Hardware;
    50 import net.sf.basedb.core.Hybridization;
     50import net.sf.basedb.core.PhysicalBioAssay;
    5151import net.sf.basedb.core.Image;
    5252import net.sf.basedb.core.Include;
     
    15571557  }
    15581558 
    1559   private ItemQuery<Hybridization> hybQuery;
     1559  private ItemQuery<PhysicalBioAssay> hybQuery;
    15601560  /**
    15611561    Find a hybridization with a given identifier. This is a utility method that
     
    15711571    @return A hybridization, or null if no item could be found
    15721572  */
    1573   protected Hybridization findHybridization(DbControl dc, IdMethod idMethod, String identifier)
     1573  protected PhysicalBioAssay findHybridization(DbControl dc, IdMethod idMethod, String identifier)
    15741574  {
    15751575    if (identifier == null) return null;
    15761576    if (hybQuery == null)
    15771577    {
    1578       hybQuery = initReferenceQuery(dc, idMethod, Hybridization.getQuery());
     1578      hybQuery = initReferenceQuery(dc, idMethod, PhysicalBioAssay.getQuery());
    15791579    }
    15801580    return findReferencedItem(dc, idMethod, hybQuery, identifier, false);
  • trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/ArrayDesignImporter.java

    r5623 r5642  
    3030import net.sf.basedb.core.DbControl;
    3131import net.sf.basedb.core.File;
    32 import net.sf.basedb.core.Hybridization;
     32import net.sf.basedb.core.PhysicalBioAssay;
    3333import net.sf.basedb.core.Item;
    3434import net.sf.basedb.core.ItemQuery;
     
    190190 
    191191  /**
    192     Calls {@link Hybridization#getQuery()}.
     192    Calls {@link PhysicalBioAssay#getQuery()}.
    193193  */
    194194  @Override
  • trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/HybridizationImporter.java

    r5641 r5642  
    3232import net.sf.basedb.core.Extract;
    3333import net.sf.basedb.core.Hardware;
    34 import net.sf.basedb.core.Hybridization;
     34import net.sf.basedb.core.PhysicalBioAssay;
    3535import net.sf.basedb.core.InvalidDataException;
    3636import net.sf.basedb.core.Item;
     
    5656*/
    5757public class HybridizationImporter
    58   extends AbstractItemImporter<Hybridization>
     58  extends AbstractItemImporter<PhysicalBioAssay>
    5959{
    6060
    6161  private static final Set<GuiContext> guiContexts = 
    62     Collections.singleton(new GuiContext(Item.HYBRIDIZATION, GuiContext.Type.LIST));
     62    Collections.singleton(new GuiContext(Item.PHYSICALBIOASSAY, GuiContext.Type.LIST));
    6363 
    6464  protected static final PluginParameter<String> hardwareColumnMapping = new PluginParameter<String>(
     
    192192 
    193193  /**
    194     Calls {@link Hybridization#getQuery()}.
    195   */
    196   @Override
    197   protected ItemQuery<Hybridization> createItemQuery()
    198   {
    199     return Hybridization.getQuery();
     194    Calls {@link PhysicalBioAssay#getQuery()}.
     195  */
     196  @Override
     197  protected ItemQuery<PhysicalBioAssay> createItemQuery()
     198  {
     199    return PhysicalBioAssay.getQuery();
    200200  }
    201201 
     
    204204  {
    205205    nameMapper = getMapper(ffp, (String)job.getValue("nameColumnMapping"),
    206         cropStrings ? Hybridization.MAX_NAME_LENGTH : null, null);
     206        cropStrings ? PhysicalBioAssay.MAX_NAME_LENGTH : null, null);
    207207    descriptionMapper = getMapper(ffp, (String)job.getValue("descriptionColumnMapping"),
    208         cropStrings ? Hybridization.MAX_DESCRIPTION_LENGTH : null, null);
     208        cropStrings ? PhysicalBioAssay.MAX_DESCRIPTION_LENGTH : null, null);
    209209    numArraysMapper = getMapper(ffp, (String)job.getValue("numArraysColumnMapping"), null, null);
    210210    createdMapper = getMapper(ffp, (String)job.getValue("createdColumnMapping"), null, null);
     
    219219 
    220220  @Override
    221   protected Hybridization createItem(DbControl dc, FlatFileParser.Data data)
    222   {
    223     Hybridization hyb = Hybridization.getNew(dc);
     221  protected PhysicalBioAssay createItem(DbControl dc, FlatFileParser.Data data)
     222  {
     223    PhysicalBioAssay hyb = PhysicalBioAssay.getNew(dc);
    224224    updateItem(dc, hyb, data);
    225225    return hyb;
     
    227227 
    228228  @Override
    229   protected void updateItem(DbControl dc, Hybridization hyb, FlatFileParser.Data data)
     229  protected void updateItem(DbControl dc, PhysicalBioAssay hyb, FlatFileParser.Data data)
    230230  {
    231231    if (nameMapper != null) hyb.setName(nameMapper.getValue(data));
    232232    if (descriptionMapper != null) hyb.setDescription(descriptionMapper.getValue(data));
    233     if (numArraysMapper != null) hyb.setNumArrays(numArraysMapper.getInt(data));
     233    if (numArraysMapper != null) hyb.setSize(numArraysMapper.getInt(data));
    234234    BioMaterialEvent creationEvent = hyb.getCreationEvent();
    235235    if (createdMapper != null) creationEvent.setEventDate(parseDate(createdMapper.getValue(data)));
     
    269269          try
    270270          {
    271             hyb.setNumArrays(slide.getArrayBatch().getArrayDesign().getNumArrays());
     271            hyb.setSize(slide.getArrayBatch().getArrayDesign().getNumArrays());
    272272          }
    273273          catch (RuntimeException ex)
     
    283283  */
    284284  @Override
    285   protected void updateMultiLineItem(DbControl dc, Hybridization hyb,
     285  protected void updateMultiLineItem(DbControl dc, PhysicalBioAssay hyb,
    286286    FlatFileParser.Data data, int multiLineNum)
    287287  {
  • trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/ScanImporter.java

    r5630 r5642  
    2525import net.sf.basedb.core.File;
    2626import net.sf.basedb.core.Hardware;
    27 import net.sf.basedb.core.Hybridization;
     27import net.sf.basedb.core.PhysicalBioAssay;
    2828import net.sf.basedb.core.Image;
    2929import net.sf.basedb.core.Item;
     
    245245  protected Scan createItem(DbControl dc, FlatFileParser.Data data)
    246246  {
    247     Hybridization hyb = null;
     247    PhysicalBioAssay hyb = null;
    248248    if (hybridizationMapper != null)
    249249    {
     
    266266      if (nameOrId != null)
    267267      {
    268         Hybridization hyb = findHybridization(dc, FallbackIdMethod.NAME_OR_ID, hybridizationMapper.getValue(data));
     268        PhysicalBioAssay hyb = findHybridization(dc, FallbackIdMethod.NAME_OR_ID, hybridizationMapper.getValue(data));
    269269        scan.setHybridization(hyb);
    270270      }
  • trunk/src/test/TestAll.java

    r5641 r5642  
    113113    results.put("TestArraySlide", TestArraySlide.test_all());
    114114
    115     // Hybridizations and raw data
    116     results.put("TestHybridization", TestHybridization.test_all());
     115    // Physical bioassays and raw data
     116    results.put("TestPhysicalBioAssay", TestPhysicalBioAssay.test_all());
    117117    results.put("TestScan", TestScan.test_all());
    118118    results.put("TestRawBioAssay", TestRawBioAssay.test_all());
  • trunk/src/test/TestExtract.java

    r5641 r5642  
    310310      "\t"+evt.getEventDate()+"\t"+evt.getEntryDate()+"\t"+evt.getUsedQuantity(e)+"\t"+evt.getComment());
    311311  }
    312   static void write_item(int i, Hybridization h)
     312  static void write_item(int i, PhysicalBioAssay h)
    313313    throws BaseException
    314314  {
     
    463463  }
    464464 
    465   static void test_list_hybridizations(int extractId, int expectedResults)
     465  static void test_list_bioassays(int extractId, int expectedResults)
    466466  {
    467467    if (extractId == 0) return;
     
    471471      dc = TestUtil.getDbControl();
    472472      Extract le = Extract.getById(dc, extractId);
    473       ItemResultList<Hybridization> l = le.getHybridizations().list(dc);
     473      ItemResultList<PhysicalBioAssay> l = le.getPhysicalBioAssays().list(dc);
    474474      for (int i = 0; i<l.size(); i++)
    475475      {
     
    480480        throw new BaseException("Expected "+expectedResults+" results, not "+l.size());
    481481      }
    482       write("--List hybridizations for labeled extract OK ("+l.size()+")");
    483     }
    484     catch (Throwable ex)
    485     {
    486       write("--List hybridizations for labeled extract FAILED");
     482      write("--List bioassays for extract OK ("+l.size()+")");
     483    }
     484    catch (Throwable ex)
     485    {
     486      write("--List bioassays for extract FAILED");
    487487      ex.printStackTrace();
    488488      ok = false;
  • trunk/src/test/TestGenericOverview.java

    r5641 r5642  
    2828import net.sf.basedb.core.Hardware;
    2929import net.sf.basedb.core.Item;
     30import net.sf.basedb.core.PhysicalBioAssay;
    3031import net.sf.basedb.core.Platform;
    3132import net.sf.basedb.core.Protocol;
     
    110111   
    111112    // Hybridization
    112     int hyb = TestHybridization.test_create(arraySlide, false);
    113     TestHybridization.test_add_labeledextract(hyb, labeledExtract1, 1, null);
    114     TestHybridization.test_add_labeledextract(hyb, labeledExtract1Ref, 1, null);
    115     TestHybridization.test_add_labeledextract(hyb, labeledExtract2, 2, null);
    116     TestHybridization.test_add_labeledextract(hyb, labeledExtract2Ref, 2, null);
     113    int hyb = TestPhysicalBioAssay.test_create(arraySlide, SystemItems.getId(PhysicalBioAssay.HYBRIDIZATION), false);
     114    TestPhysicalBioAssay.test_add_labeledextract(hyb, labeledExtract1, 1, null);
     115    TestPhysicalBioAssay.test_add_labeledextract(hyb, labeledExtract1Ref, 1, null);
     116    TestPhysicalBioAssay.test_add_labeledextract(hyb, labeledExtract2, 2, null);
     117    TestPhysicalBioAssay.test_add_labeledextract(hyb, labeledExtract2Ref, 2, null);
    117118
    118119    // Scan
     
    138139    // Show some overviews
    139140    test_overview(Item.BIOSOURCE, biosource);
    140     test_overview(Item.HYBRIDIZATION, hyb);
     141    test_overview(Item.PHYSICALBIOASSAY, hyb);
    141142    test_overview(Item.ARRAYDESIGN, arrayDesign);
    142143    test_overview(Item.EXPERIMENT, experiment);
     
    149150    TestRawBioAssay.test_delete(rawBioAssay2);
    150151    TestScan.test_delete(scan);
    151     TestHybridization.test_delete(hyb);
     152    TestPhysicalBioAssay.test_delete(hyb);
    152153    TestArraySlide.test_delete(arraySlide);
    153154    TestArrayBatch.test_delete(arrayBatch);
  • trunk/src/test/TestIlluminaImporter.java

    r5630 r5642  
    4343    TestReporter.test_import_from_file("data/test.illumina.reporters.txt", "Search_key,Target,ProbeId.*", ",(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))", 1, 1);
    4444    int fileId = TestFile.test_create("data/test.illumina.rawdata.txt", false, false);
    45     int hybId = TestHybridization.test_create(0, false, new int[] {});
     45    int hybId = TestPhysicalBioAssay.test_create(0, 0, false);
    4646    int scanId = TestScan.test_create(hybId, 0, 0, false);
    4747    int protocolId = TestProtocol.test_create(SystemItems.getId(Protocol.FEATURE_EXTRACTION), null, false);
     
    7575    TestSoftware.test_delete(softwareId);
    7676    TestProtocol.test_delete(protocolId);
    77     TestHybridization.test_delete(hybId);
     77    TestPhysicalBioAssay.test_delete(hybId);
    7878    TestFile.test_delete(fileId);
    7979    TestReporter.test_delete();
  • trunk/src/test/TestItemImporter.java

    r5641 r5642  
    137137    int hybFileId = TestFile.test_create("data/test.batchimport.hybridizations.txt", false, false);
    138138    int hybImporterId  = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.HybridizationImporter");
    139     int hybJobId = test_create_item_import_job(Item.HYBRIDIZATION, hybImporterId, hybFileId);
     139    int hybJobId = test_create_item_import_job(Item.PHYSICALBIOASSAY, hybImporterId, hybFileId);
    140140    ok &= TestJob.test_execute(hybJobId, false);
    141     TestHybridization.test_list(3);
     141    TestPhysicalBioAssay.test_list(3);
    142142   
    143143    // Import scans
     
    174174
    175175    // Delete hybridizations
    176     TestHybridization.test_delete_all();
     176    TestPhysicalBioAssay.test_delete_all();
    177177    TestJob.test_delete(hybJobId);
    178178    TestFile.test_delete(hybFileId);
     
    355355      request.setParameterValue("labelColumnMapping", "\\Label\\");
    356356    }
    357     if (itemType == Item.HYBRIDIZATION)
     357    if (itemType == Item.PHYSICALBIOASSAY)
    358358    {
    359359      request.setParameterValue("numArraysColumnMapping", "\\Num arrays\\");
  • trunk/src/test/TestMetadata.java

    r5641 r5642  
    3131import net.sf.basedb.core.Item;
    3232import net.sf.basedb.core.Metadata;
     33import net.sf.basedb.core.PhysicalBioAssay;
    3334import net.sf.basedb.core.Platform;
    3435import net.sf.basedb.core.RawBioAssay;
     
    8990    int labelId = TestTag.test_create("Test label", SystemItems.getId(Tag.LABEL), true);
    9091    int labeledExtractId = TestExtract.test_create(0, "Test extract", SystemItems.getId(Extract.LABELED), labelId, true);
    91     int hybId = TestHybridization.test_create(slideId, true, labeledExtractId);
     92    int hybId = TestPhysicalBioAssay.test_create(slideId, SystemItems.getId(PhysicalBioAssay.HYBRIDIZATION), true, labeledExtractId);
    9293    int scanId = TestScan.test_create(hybId, 0, 0, true);
    9394    int rawId = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "My raw bioassay",
     
    110111    TestRawBioAssay.test_delete(rawId);
    111112    TestScan.test_delete(scanId);
    112     TestHybridization.test_delete(hybId);
     113    TestPhysicalBioAssay.test_delete(hybId);
    113114    TestExtract.test_delete(labeledExtractId);
    114115    TestTag.test_delete(labelId);
  • trunk/src/test/TestPhysicalBioAssay.java

    r5641 r5642  
    2626import java.util.Set;
    2727
    28 public class TestHybridization
     28public class TestPhysicalBioAssay
    2929{
    3030
     
    4040  static boolean test_all()
    4141  {
    42     write("++Testing hybridizations");
     42    write("++Testing physical bioassays");
    4343    write_header();
    4444    // Standard tests: create, load, list
    45     int id = test_create(0, true);
    46     int id2 = test_create(0, false);
     45    int id = test_create(0, SystemItems.getId(PhysicalBioAssay.HYBRIDIZATION), true);
     46    int id2 = test_create(0, SystemItems.getId(PhysicalBioAssay.FLOW_CELL), false);
    4747   
    4848    test_load(id);
     
    5151    int arrayBatchId = TestArrayBatch.test_create(arrayDesignId, false);
    5252    int arraySlideId = TestArraySlide.test_create(arrayBatchId, false);
    53     int id3 = test_create(arraySlideId, false);
     53    int id3 = test_create(arraySlideId, 0, false);
    5454   
    5555    int cy3 = TestTag.test_load("cy3");
     
    5858    int labeledExtractId1 = TestExtract.test_create(0, "Labeled #1", labeledExtract, cy3, false);
    5959    int labeledExtractId2 = TestExtract.test_create(0, "Labeled #2", labeledExtract, cy5, false);
    60     int id4 = test_create(0, false, labeledExtractId1, labeledExtractId2);
     60    int id4 = test_create(0, SystemItems.getId(PhysicalBioAssay.HYBRIDIZATION), false, labeledExtractId1, labeledExtractId2);
    6161   
    6262    test_list(-1);
    6363   
    64     TestExtract.test_list_hybridizations(labeledExtractId1, 1);
     64    TestExtract.test_list_bioassays(labeledExtractId1, 1);
    6565    ok = ok && TestExtract.ok;
    6666
     
    7878    TestArrayBatch.test_delete(arrayBatchId);
    7979    TestArrayDesign.test_delete(arrayDesignId);
    80     write("++Testing hybridizations "+(ok ? "OK" : "Failed")+"\n");
     80    write("++Testing physical bioassays "+(ok ? "OK" : "Failed")+"\n");
    8181    return ok;
    8282  }
    8383
    84   static int test_create(int arraySlideId, boolean setAll, int... labeledExtractIds)
    85   {
    86     if (!TestUtil.hasPermission(Permission.CREATE, Item.HYBRIDIZATION)) return 0;
     84  static int test_create(int arraySlideId, int subtypeId, boolean setAll, int... labeledExtractIds)
     85  {
     86    if (!TestUtil.hasPermission(Permission.CREATE, Item.PHYSICALBIOASSAY)) return 0;
    8787    int id = 0;
    8888    DbControl dc = null;
     
    9090    {
    9191      dc = TestUtil.getDbControl();
    92       Hybridization h = Hybridization.getNew(dc);
     92      PhysicalBioAssay h = PhysicalBioAssay.getNew(dc);
    9393      if (setAll)
    9494      {
    95         h.setName("Test hybridization");
     95        h.setName("Test physical bioassay");
    9696        h.setDescription("Added at "+new Date());
     97      }
     98      if (subtypeId != 0)
     99      {
     100        h.setItemSubtype(ItemSubtype.getById(dc, subtypeId));
    97101      }
    98102      if (arraySlideId != 0)
     
    113117      dc.reattachItem(h.getCreationEvent(), false);
    114118      write_item(0, h);
    115       write("--Create hybridization OK");
    116     }
    117     catch (Throwable ex)
    118     {
    119       write("--Create hybridization FAILED");
     119      write("--Create physical bioassay OK");
     120    }
     121    catch (Throwable ex)
     122    {
     123      write("--Create physical bioassay FAILED");
    120124      ex.printStackTrace();
    121125      ok = false;
     
    135139    {
    136140      dc = TestUtil.getDbControl();
    137       Hybridization h = Hybridization.getById(dc, id);
     141      PhysicalBioAssay h = PhysicalBioAssay.getById(dc, id);
    138142      write_item(0, h);
    139       write("--Load hybridization OK");
    140     }
    141     catch (Throwable ex)
    142     {
    143       write("--Load hybridization FAILED");
     143      write("--Load physical bioassay OK");
     144    }
     145    catch (Throwable ex)
     146    {
     147      write("--Load physical bioassay FAILED");
    144148      ex.printStackTrace();
    145149      ok = false;
     
    157161    {
    158162      dc = TestUtil.getDbControl();
    159       ItemResultList<Hybridization> l = Hybridization.getQuery().list(dc);
     163      ItemResultList<PhysicalBioAssay> l = PhysicalBioAssay.getQuery().list(dc);
    160164      for (int i = 0; i<l.size(); i++)
    161165      {
     
    166170        throw new BaseException("Expected "+expectedResults+" results, not "+l.size());
    167171      }
    168       write("--List hybridizations OK ("+l.size()+")");
    169     }
    170     catch (Throwable ex)
    171     {
    172       write("--List hybridizations FAILED");
     172      write("--List physical bioassay OK ("+l.size()+")");
     173    }
     174    catch (Throwable ex)
     175    {
     176      write("--List physical bioassay FAILED");
    173177      ex.printStackTrace();
    174178      ok = false;
     
    187191    {
    188192      dc = TestUtil.getDbControl();
    189       Hybridization h = Hybridization.getById(dc, id);
     193      PhysicalBioAssay h = PhysicalBioAssay.getById(dc, id);
    190194      dc.deleteItem(h);
    191195      Set<ItemProxy> using = h.getUsingItems();
     
    195199      }
    196200      dc.commit();
    197       write("--Delete hybridization OK");
    198     }
    199     catch (Throwable ex)
    200     {
    201       write("--Delete hybridization FAILED");
     201      write("--Delete physical bioassay OK");
     202    }
     203    catch (Throwable ex)
     204    {
     205      write("--Delete physical bioassay FAILED");
    202206      ex.printStackTrace();
    203207      ok = false;
     
    215219    {
    216220      dc = TestUtil.getDbControl();
    217       ItemResultList<Hybridization> l = Hybridization.getQuery().list(dc);
     221      ItemResultList<PhysicalBioAssay> l = PhysicalBioAssay.getQuery().list(dc);
    218222      Trashcan.delete(dc.getSessionControl(), l, true, null);
    219223      dc.commit();
    220       write("--Delete all hybridizations OK ("+l.size()+")");
    221     }
    222     catch (Throwable ex)
    223     {
    224       write("--Delete all hybridizations FAILED");
     224      write("--Delete all physical bioassay OK ("+l.size()+")");
     225    }
     226    catch (Throwable ex)
     227    {
     228      write("--Delete all physical bioassay FAILED");
    225229      ex.printStackTrace();
    226230      ok = false;
     
    237241    if (!TestUtil.getSilent())
    238242    {
    239       write("   \tID \tName      \tDescription\tArray slide\tLabeled extracts");
    240       write("-- \t-- \t--------- \t-----------\t-----------\t----------------");
    241     }
    242   }
    243   static void write_item(int i, Hybridization h)
     243      write("   \tID \tName      \tType\tDescription\tArray slide\tLabeled extracts");
     244      write("-- \t-- \t--------- \t----\t-----------\t-----------\t----------------");
     245    }
     246  }
     247  static void write_item(int i, PhysicalBioAssay h)
    244248    throws BaseException
    245249  {
     
    254258      }
    255259      sb.append("]");
    256       System.out.println(i+":\t"+h.getId()+"\t"+h.getName()+"\t"+h.getDescription()+
     260      System.out.println(i+":\t"+h.getId()+"\t"+h.getName()+"\t"+h.getItemSubtype()+"\t"+h.getDescription()+
    257261        "\t"+h.getArraySlide()+"\t"+sb);
    258262    }
     
    270274    {
    271275      dc = TestUtil.getDbControl();
    272       Hybridization h = Hybridization.getById(dc, hybId);
     276      PhysicalBioAssay h = PhysicalBioAssay.getById(dc, hybId);
    273277      Extract le = Extract.getById(dc, labeledExtractId);
    274278      BioMaterialEvent event = h.getCreationEvent();
  • trunk/src/test/TestProject.java

    r5630 r5642  
    8383    test_activate_project(id, pp);
    8484    int sampleId = TestSample.test_create(0, "Sample (shared)", false);
    85     int hybId = TestHybridization.test_create(0, false, new int[] {});
     85    int hybId = TestPhysicalBioAssay.test_create(0, 0, false);
    8686    test_list_items(id, pp, 2);
    8787    test_noactive_project();
     
    8989    if (TestUtil.waitBeforeDelete()) TestUtil.waitForEnter();
    9090    TestSample.test_delete(sampleId);
    91     TestHybridization.test_delete(hybId);
     91    TestPhysicalBioAssay.test_delete(hybId);
    9292   
    9393    // Standard test: Delete
  • trunk/src/test/TestRawBioAssay.java

    r5630 r5642  
    5454    write_header();
    5555   
    56     int hybridizationId = TestHybridization.test_create(0, false);
     56    int hybridizationId = TestPhysicalBioAssay.test_create(0, 0, false);
    5757    int scanId = TestScan.test_create(hybridizationId, 0, 0, false);
    5858    int arrayDesignId = TestArrayDesign.test_create(Platform.GENERIC, false);
     
    103103    TestFile.test_delete(celId);
    104104    TestScan.test_delete(scanId);
    105     TestHybridization.test_delete(hybridizationId);
     105    TestPhysicalBioAssay.test_delete(hybridizationId);
    106106    TestArrayDesign.test_delete(arrayDesignId);
    107107    TestArrayDesign.test_delete(arrayDesignId2);
  • trunk/src/test/TestScan.java

    r5630 r5642  
    4343    write_header();
    4444   
    45     int hybridizationId = TestHybridization.test_create(0, false);
     45    int hybridizationId = TestPhysicalBioAssay.test_create(0, 0, false);
    4646    int scannerId = TestHardware.test_create(SystemItems.getId(Hardware.SCANNER), null, false);
    4747    int protocolId = TestProtocol.test_create(SystemItems.getId(Protocol.SCANNING), null, false);
     
    6161    test_delete(id2);
    6262   
    63     TestHybridization.test_delete(hybridizationId);
     63    TestPhysicalBioAssay.test_delete(hybridizationId);
    6464    TestHardware.test_delete(scannerId);
    6565    TestProtocol.test_delete(protocolId);
     
    7676    {
    7777      dc = TestUtil.getDbControl();
    78       Scan s = Scan.getNew(dc, Hybridization.getById(dc, hybridizationId));
     78      Scan s = Scan.getNew(dc, PhysicalBioAssay.getById(dc, hybridizationId));
    7979      if (setAll)
    8080      {
  • trunk/src/test/net/sf/basedb/test/roles/UserTest.java

    r5641 r5642  
    3737import net.sf.basedb.core.File;
    3838import net.sf.basedb.core.FileParameterType;
    39 import net.sf.basedb.core.Hybridization;
     39import net.sf.basedb.core.PhysicalBioAssay;
    4040import net.sf.basedb.core.Include;
    4141import net.sf.basedb.core.Item;
     
    221221        // Hybridizations, etc.
    222222//        dc = TestUtil.getDbControl();
    223         Hybridization h1 = createHybridization(dc, "Hybridization A.00h", "Array slide A.1", le1, leRef);
    224         Hybridization h2 = createHybridization(dc, "Hybridization A.24h", "Array slide A.2", le2, leRef);
    225         Hybridization h1DyeSwap = createHybridization(dc, "Hybridization A.00h (dye-swap)", "Array slide A.3", le1DyeSwap, leRefDyeSwap);
    226         Hybridization h2DyeSwap = createHybridization(dc, "Hybridization A.24h (dye-swap)", "Array slide A.4", le2DyeSwap, leRefDyeSwap);
     223        PhysicalBioAssay h1 = createHybridization(dc, "Hybridization A.00h", "Array slide A.1", le1, leRef);
     224        PhysicalBioAssay h2 = createHybridization(dc, "Hybridization A.24h", "Array slide A.2", le2, leRef);
     225        PhysicalBioAssay h1DyeSwap = createHybridization(dc, "Hybridization A.00h (dye-swap)", "Array slide A.3", le1DyeSwap, leRefDyeSwap);
     226        PhysicalBioAssay h2DyeSwap = createHybridization(dc, "Hybridization A.24h (dye-swap)", "Array slide A.4", le2DyeSwap, leRefDyeSwap);
    227227 
    228228        // Affymetrix
    229         Hybridization affyHyb1 = createHybridization(dc, "Affymetrix hyb A.1", "Affymetrix slide A.1", le1);
    230         Hybridization affyHyb2 = createHybridization(dc, "Affymetrix hyb A.2", "Affymetrix slide A.2", le2);
    231         Hybridization affyHyb3 = createHybridization(dc, "Affymetrix hyb A.3", "Affymetrix slide A.3", leRef);
     229        PhysicalBioAssay affyHyb1 = createHybridization(dc, "Affymetrix hyb A.1", "Affymetrix slide A.1", le1);
     230        PhysicalBioAssay affyHyb2 = createHybridization(dc, "Affymetrix hyb A.2", "Affymetrix slide A.2", le2);
     231        PhysicalBioAssay affyHyb3 = createHybridization(dc, "Affymetrix hyb A.3", "Affymetrix slide A.3", leRef);
    232232       
    233233        sc1 = createScan(dc, "Scan A.00h", h1, 400f, volt);
     
    436436    Create a hybridization.
    437437  */
    438   public static Hybridization createHybridization(DbControl dc, String name, String arraySlideName, Extract... extracts)
     438  public static PhysicalBioAssay createHybridization(DbControl dc, String name, String arraySlideName, Extract... extracts)
    439439  {
    440440    TestUtil.write("--Creating hybridization: " + name + "\n");
    441     Hybridization hyb = Hybridization.getNew(dc);
     441    PhysicalBioAssay hyb = PhysicalBioAssay.getNew(dc);
    442442    hyb.setName(name);
    443443    hyb.setArraySlide(Util.findArraySlide(dc, arraySlideName));
     
    456456    Create a scan.
    457457  */
    458   public static Scan createScan(DbControl dc, String name, Hybridization hyb, Float pmtGain, Unit unit)
     458  public static Scan createScan(DbControl dc, String name, PhysicalBioAssay hyb, Float pmtGain, Unit unit)
    459459  {
    460460    TestUtil.write("--Creating scan: " + name + "\n");
  • trunk/www/biomaterials/bioplates/events/view_event.jsp

    r5525 r5642  
    3535  import="net.sf.basedb.core.BioMaterialEvent"
    3636  import="net.sf.basedb.core.MeasuredBioMaterial"
    37   import="net.sf.basedb.core.Hybridization"
     37  import="net.sf.basedb.core.PhysicalBioAssay"
    3838  import="net.sf.basedb.core.Protocol"
    3939  import="net.sf.basedb.core.Hardware"
     
    385385      ItemQuery<BioMaterialEvent> eventQuery = event.getBioMaterialEvents();
    386386      eventQuery.join(Hql.leftJoin("bioMaterial", "bm"));
    387       eventQuery.join(Hql.leftJoin("hybridization", "hyb"));
     387      eventQuery.join(Hql.leftJoin("physicalBioAssay", "pba"));
    388388      eventQuery.include(Include.ALL);
    389389      eventQuery.order(Orders.asc(Hql.property("bm", "name")));
    390       eventQuery.order(Orders.asc(Hql.property("hyb", "name")));
     390      eventQuery.order(Orders.asc(Hql.property("pba", "name")));
    391391      ItemResultList<BioMaterialEvent> events = eventQuery.list(dc);
    392392      if (events.size() == 0)
     
    413413            <tbl:columndef
    414414              id="item"
    415               title="Biomaterial/Hybridization"
     415              title="Biomaterial/Bioassay"
    416416            />
    417417            <tbl:columndef
     
    437437                  try
    438438                  {
    439                     if (eventType == BioMaterialEvent.Type.HYBRIDIZATION)
     439                    if (eventType == BioMaterialEvent.Type.BIOASSAY)
    440440                    {
    441                       item = bmEvent.getHybridization();
     441                      item = bmEvent.getPhysicalBioAssay();
    442442                    }
    443443                    else
  • trunk/www/biomaterials/bioplates/view_bioplate.jsp

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

    r5641 r5642  
    523523                    }
    524524                  }
    525                   else if (eventType == BioMaterialEvent.Type.HYBRIDIZATION)
     525                  else if (eventType == BioMaterialEvent.Type.BIOASSAY)
    526526                  {
    527527                    %>
    528528                    <div class="link" onclick="viewItem(<%=itemId%>)">
    529                     Hybridization: <base:propertyvalue
     529                    Bioassay: <base:propertyvalue
    530530                              item="<%=item%>"
    531                               property="hybridization"
     531                              property="physicalBioAssay"
    532532                              enableEditLink="<%=false%>"
    533533                              enablePropertyLink="<%=false%>"
  • trunk/www/biomaterials/events/view_event.jsp

    r5641 r5642  
    3636  import="net.sf.basedb.core.BioPlate"
    3737  import="net.sf.basedb.core.MeasuredBioMaterial"
    38   import="net.sf.basedb.core.Hybridization"
     38  import="net.sf.basedb.core.PhysicalBioAssay"
    3939  import="net.sf.basedb.core.Protocol"
    4040  import="net.sf.basedb.core.PermissionDeniedException"
     
    268268          <%
    269269        }
    270         else if (eventType == BioMaterialEvent.Type.HYBRIDIZATION)
     270        else if (eventType == BioMaterialEvent.Type.BIOASSAY)
    271271        {         
    272272          %>
    273273          <tr>
    274             <td class="prompt">Hybridization</td>
    275             <td><base:propertyvalue item="<%=event%>" property="hybridization"/></td>
    276           </tr>
    277           <tr>
    278             <td class="prompt">Labeled extracts</td>
    279             <td>
    280             </td>
     274            <td class="prompt">Physical bioassay</td>
     275            <td><base:propertyvalue item="<%=event%>" property="physicalBioAssay"/></td>
    281276          </tr>
    282277          <%
  • trunk/www/biomaterials/extracts/index.jsp

    r5641 r5642  
    3535  import="net.sf.basedb.core.BioWell"
    3636  import="net.sf.basedb.core.Protocol"
    37   import="net.sf.basedb.core.Hybridization"
     37  import="net.sf.basedb.core.PhysicalBioAssay"
    3838  import="net.sf.basedb.core.ItemQuery"
    3939  import="net.sf.basedb.core.ItemResultIterator"
     
    7777<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
    7878<%!
    79   private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,originalQuantity,remainingQuantity,labeledextracts,description");
     79  private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,originalQuantity,remainingQuantity,physicalBioAssays,description");
    8080  private static final Item itemType = Item.EXTRACT;
    8181 
     
    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());
     88    cc.setObject("export.formatter.&sourceEvents(event.physicalBioAssay.name)", new NameableFormatter());
    8989    cc.setObject("export.formatter.&sourceEvents(event.bioMaterial.name)", new NameableFormatter());
    9090   
     
    9292    String restrictionParameter = "extract";
    9393
    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));
     94    // Physical bioassays
     95    ItemQuery<PhysicalBioAssay> bioAssayQuery = PhysicalBioAssay.getQuery();
     96    bioAssayQuery.join(Hql.innerJoin("creationEvent", "ce"));
     97    bioAssayQuery.join(Hql.innerJoin("ce", "sources", "src"));
     98    bioAssayQuery.restrict(Restrictions.eq(Hql.index("src", null), Expressions.parameter(restrictionParameter)));
     99    bioAssayQuery.order(Orders.asc(Hql.property("name")));
     100    bioAssayQuery.include(cc.getInclude());
     101    cc.setObject("export.dataloader.&sourceEvents(event.physicalBioAssay.name)", new ItemQueryLoader(bioAssayQuery, restrictionParameter));
    102102
    103103    // Child extracts
     
    196196    forward = editPage+"&pooled="+true;
    197197  }
    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";
     198  else if ("NewPhysicalBioAssay".equals(cmd))
     199  {
     200    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
     201    redirect = "../../views/physicalbioassays/index.jsp?ID="+ID+"&cmd=NewItem&useParents=true";
    202202  }
    203203  else if ("UpdateItem".equals(cmd))
  • trunk/www/biomaterials/extracts/list_extracts.jsp

    r5641 r5642  
    3030  import="net.sf.basedb.core.Extract"
    3131  import="net.sf.basedb.core.Sample"
    32   import="net.sf.basedb.core.Hybridization"
     32  import="net.sf.basedb.core.PhysicalBioAssay"
    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 createHybridizationPermission = sc.hasPermission(Permission.CREATE, Item.HYBRIDIZATION);
     101  final boolean createBioAssayPermission = sc.hasPermission(Permission.CREATE, Item.PHYSICALBIOASSAY);
    102102
    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());
     103  final ItemQuery<PhysicalBioAssay> bioAssayQuery = PhysicalBioAssay.getQuery();
     104  bioAssayQuery.join(Hql.innerJoin("creationEvent", "ce"));
     105  bioAssayQuery.join(Hql.innerJoin("ce", "sources", "src"));
     106  bioAssayQuery.restrict(Restrictions.eq(Hql.index("src", null), Hql.entityParameter("extract", Item.EXTRACT)));
     107  bioAssayQuery.order(Orders.asc(Hql.property("name")));
     108  bioAssayQuery.include(cc.getInclude());
    109109
    110110  final ItemQuery<Extract> childExtractsQuery = Extract.getQuery();
     
    167167      Table.poolItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'NewPooledItem');
    168168    }
    169     function newHybridization()
    170     {
    171       Table.poolItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'NewHybridization');
     169    function newPhysicalBioAssay()
     170    {
     171      Table.poolItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'NewPhysicalBioAssay');
    172172    }
    173173    function editItem(itemId)
     
    182182    {
    183183      Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewItem, editItem, returnSelected);
    184     }
    185     function newLabeledExtract(extractId)
    186     {
    187       Main.viewOrEditItem('<%=ID%>', 'LABELEDEXTRACT', 0, true, '&extract_id='+extractId);
    188184    }
    189185    function deleteItems()
     
    402398      />
    403399      <tbl:columndef
    404         id="hybridizations"
    405         title="Hybridizations"
    406         property="&sourceEvents(event.hybridization.name)"
     400        id="physicalBioAssays"
     401        title="Physical bioassays"
     402        property="&sourceEvents(event.physicalBioAssay.name)"
    407403        datatype="string"
    408404        filterable="true"
     
    532528        />
    533529        <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"%>"
     530          disabled="<%=createBioAssayPermission ? false : true%>"
     531          image="<%=createBioAssayPermission ? "add.png" : "add_disabled.png"%>"
     532          onclick="newPhysicalBioAssay()"
     533          title="New physical bioassay&hellip;"
     534          tooltip="<%=createBioAssayPermission ? "Create new bioassay with the selected extracts" : "You do not have permission to create bioassays"%>"
    539535        />
    540536        <tbl:button
     
    763759                  %>
    764760                </tbl:cell>
    765                 <tbl:cell column="hybridizations">
     761                <tbl:cell column="physicalBioAssays">
    766762                  <%                 
    767763                  try
    768764                  {
    769                     hybQuery.setEntityParameter("extract", item);
     765                    bioAssayQuery.setEntityParameter("extract", item);
    770766                    String separator = "";
    771                     for (Hybridization h : hybQuery.list(dc))
     767                    for (PhysicalBioAssay pba : bioAssayQuery.list(dc))
    772768                    {
    773769                      out.write(separator);
    774770                      if (mode.hasPropertyLink())
    775771                      {
    776                         out.write(Base.getLinkedName(ID, h, false, mode.hasEditLink()));
     772                        out.write(Base.getLinkedName(ID, pba, false, mode.hasEditLink()));
    777773                      }
    778774                      else
    779775                      {
    780                         out.write(HTML.encodeTags(h.getName()));
     776                        out.write(HTML.encodeTags(pba.getName()));
    781777                      }
    782778                      separator = ", ";
  • trunk/www/biomaterials/extracts/view_extract.jsp

    r5641 r5642  
    3434  import="net.sf.basedb.core.Permission"
    3535  import="net.sf.basedb.core.Extract"
    36   import="net.sf.basedb.core.Hybridization"
     36  import="net.sf.basedb.core.PhysicalBioAssay"
    3737  import="net.sf.basedb.core.Sample"
    3838  import="net.sf.basedb.core.BioMaterialEvent"
     
    176176      }
    177177    }
    178     function newHybridization()
    179     {
    180       Main.viewOrEditItem('<%=ID%>', 'HYBRIDIZATION', 0, true, '&extract_id='+<%=itemId%>);
     178    function newPhysicalBioAssay()
     179    {
     180      Main.viewOrEditItem('<%=ID%>', 'PHYSICALBIOASSAY', 0, true, '&extract_id='+<%=itemId%>);
    181181    }
    182182    </script>
     
    233233      <tbl:button
    234234        image="add.png"
    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%>"
     235        onclick="newPhysicalBioAssay()"
     236        title="New physical bioassay&hellip;"
     237        tooltip="Create a new physical bioassay from this extract"
     238        visible="<%=sc.hasPermission(Permission.CREATE, Item.PHYSICALBIOASSAY) && usePermission%>"
    239239      />
    240240      <tbl:button
     
    514514      }
    515515     
    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
     516      ItemQuery<PhysicalBioAssay> bioAssayQuery = extract.getPhysicalBioAssays();
     517      bioAssayQuery.include(Include.ALL);
     518      bioAssayQuery.order(Orders.asc(Hql.property("name")));
     519      ItemResultList<PhysicalBioAssay> bioAssays = bioAssayQuery.list(dc);
     520      if (bioAssays.size() == 0)
     521      {
     522        %>
     523        <h4>Physical bioassays</h4>
     524        No bioassays have been created from this extract
    525525        (or you don't have the permission to view them)
    526526        <%
     
    530530        %>
    531531        <base:section
    532           id="hybridizationSection"
    533           title="<%="Hybridizations (" + hybridizations.size() + ")"%>"
     532          id="bioAssaysSection"
     533          title="<%="Physical bioassays (" + bioAssays.size() + ")"%>"
    534534          context="<%=cc%>"
    535535          >
    536536          <tbl:table
    537             id="hybridizations"
     537            id="bioAssays"
    538538            clazz="itemlist"
    539539            columns="all"
     
    555555              <tbl:rows>
    556556                <%
    557                 for (Hybridization hyb : hybridizations)
     557                for (PhysicalBioAssay pba : bioAssays)
    558558                {
    559559                  %>
     
    562562                      image="deleted.gif"
    563563                      tooltip="This item has been scheduled for deletion"
    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>
     564                      visible="<%=pba.isRemoved()%>"
     565                    /><%=Base.getLinkedName(ID, pba, false, true)%></tbl:cell>
     566                    <tbl:cell column="quantity"><%=Values.formatNumber(pba.getCreationEvent().getUsedQuantity(extract), 2)%></tbl:cell>
     567                    <tbl:cell column="description"><%=HTML.encodeTags(pba.getDescription())%></tbl:cell>
    568568                  </tbl:row>
    569569                  <%
  • trunk/www/biomaterials/wizards/create_child_bioplate_step1.jsp

    r5641 r5642  
    109109        return;
    110110      }
    111       if (frm.plategeometry_id.length == 0 && childType != 'HYBRIDIZATION')
     111      if (frm.plategeometry_id.length == 0 && childType != 'PHYSICALBIOASSAY')
    112112      {
    113113        alert("You must select a plate geometry");
     
    115115        return false;
    116116      }
    117       if (frm.bioplatetype_id.length == 0 && childType != 'HYBRIDIZATION')
     117      if (frm.bioplatetype_id.length == 0 && childType != 'PHYSICALBIOASSAY')
    118118      {
    119119        alert("You must select a plate type");
     
    242242      var frm = document.forms['main'];
    243243      var childType = frm.child_biomaterial_type[frm.child_biomaterial_type.selectedIndex].value;
    244       Main.showHide('labelDiv', childType == 'LABELEDEXTRACT');
    245       var isHyb = childType == 'HYBRIDIZATION';
    246       Main.showHide('originalQuantityDiv', !isHyb);
    247       Main.showHide('freezerDiv', !isHyb);
    248       Main.showHide('plateTypeDiv', !isHyb);
    249       Main.showHide('geometryDiv', !isHyb);
    250       Main.showHide('numArraysDiv', isHyb);
     244      Main.showHide('tagDiv', childType == 'EXTRACT');
     245      var isBioAssay = childType == 'PHYSICALBIOASSAY';
     246      Main.showHide('originalQuantityDiv', !isBioAssay);
     247      Main.showHide('freezerDiv', !isBioAssay);
     248      Main.showHide('plateTypeDiv', !isBioAssay);
     249      Main.showHide('geometryDiv', !isBioAssay);
     250      Main.showHide('sizeDiv', isBioAssay);
    251251    }
    252252   
     
    360360                %>
    361361                <option value="EXTRACT">Extract → Extract
    362                 <option value="HYBRIDIZATION" selected>Extract → Hybridization
     362                <option value="PHYSICALBIOASSAY" selected>Extract → Physical bioassay
    363363                <%
    364364              }
     
    376376          final List<Tag> tags = tagsQuery.list(dc);
    377377          %>
    378           <tr id="labelDiv">
    379             <td class="prompt">Label</td>
     378          <tr id="tagDiv">
     379            <td class="prompt">Tag</td>
    380380            <td>
    381               <select name="label_id" size="1" class="required"
     381              <select name="tag_id" size="1"
    382382                style="width: 20em;">
     383                <option value="">- none -
    383384                <%
    384385                for (Tag tag : tags)
     
    451452          </td>
    452453        </tr>
    453         <tr id="numArraysDiv" style="display: none;">
    454           <td class="prompt">Number of arrays/hyb</td>
    455           <td><input <%=requiredClazz%> type="text" name="num_arrays" size="12"
     454        <tr id="sizeDiv" style="display: none;">
     455          <td class="prompt">Size of bioassay</td>
     456          <td><input <%=requiredClazz%> type="text" name="size" size="12"
    456457            value="<%=sourceGeometry.getRows() %>"
    457458            maxlength="10" onkeypress="return Numbers.numberOnly(event)"></td>
  • trunk/www/biomaterials/wizards/create_child_bioplate_step2.jsp

    r5641 r5642  
    6767  final BioPlate sourcePlate = BioPlate.getById(dc, sourcePlateId);
    6868  final Item childBioMaterialType = Item.valueOf(request.getParameter("child_biomaterial_type"));
    69   final boolean isHybridizationEvent = childBioMaterialType == Item.HYBRIDIZATION;
    70 
    71   final PlateGeometry geometry = isHybridizationEvent ? null : PlateGeometry.getById(dc, childPlateGeometryId);
    72   final int numArrays = Values.getInt(request.getParameter("num_arrays"));
     69  final boolean isBioAssayEvent = childBioMaterialType == Item.PHYSICALBIOASSAY;
     70
     71  final PlateGeometry geometry = isBioAssayEvent ? null : PlateGeometry.getById(dc, childPlateGeometryId);
     72  final int size = Values.getInt(request.getParameter("size"));
    7373  final BioPlateType sourceType = sourcePlate.getBioPlateType();
    7474  final Item sourceBioMaterialType = sourceType.getBioMaterialType();
     
    9595    <script language="javascript">
    9696 
    97     var isHybridizationEvent = <%=isHybridizationEvent ? "true" : "false"%>;
     97    var isBioAssayEvent = <%=isBioAssayEvent ? "true" : "false"%>;
    9898   
    9999    // For drawing
     
    121121      selectedPen = new jsPen(new jsColor('445577'), 2);
    122122      setSourceBioPlate(<%=sourcePlateId%>, '<%=HTML.javaScriptEncode(sourcePlate.getName())%>');
    123       createDestinationPlates(<%=numChildPlates%>, <%=isHybridizationEvent ? 1 : geometry.getRows()%>, <%=isHybridizationEvent ? numArrays : geometry.getColumns()%>, '<%=HTML.javaScriptEncode(childPlateNamePrefix)%>');
     123      createDestinationPlates(<%=numChildPlates%>, <%=isBioAssayEvent ? 1 : geometry.getRows()%>, <%=isBioAssayEvent ? size : geometry.getColumns()%>, '<%=HTML.javaScriptEncode(childPlateNamePrefix)%>');
    124124    }
    125125
     
    387387      var request = Ajax.getXmlHttpRequest();
    388388      var url = '../bioplates/ajax.jsp?ID=<%=ID%>&cmd=GetFullPlateInfo&item_id=' + bioPlateId;
    389       if (!isHybridizationEvent)
     389      if (!isBioAssayEvent)
    390390      {
    391391        url += '&countChildren=<%=sourceBioMaterialType == childBioMaterialType ? "pooled" : "1"%>';
     
    422422          well.id = bmInfo.id;
    423423          well.name = bmInfo.name;
    424           if (!isHybridizationEvent)
     424          if (!isBioAssayEvent)
    425425          {
    426426            well.childCount = bmInfo.childCount;
     
    538538        var destPlate = destPlates[plateNo];
    539539        Forms.createHidden(frm, 'plate.' + plateNo + '.name', destPlate.name);
    540         if (!isHybridizationEvent)
     540        if (!isBioAssayEvent)
    541541        {
    542542          Forms.createHidden(frm, 'plate.' + plateNo + '.barcode', destPlate.barcode);
     
    551551              var prefix = 'well.' +plateNo + '.' + row + '.' + column;
    552552              Forms.createHidden(frm, prefix, well.mappedWell.id);
    553               if (!isHybridizationEvent)
     553              if (!isBioAssayEvent)
    554554              {
    555555                Forms.createHidden(frm, prefix + '.name', well.mappedWell.childName);
     
    658658      {
    659659        frm.plate_name.value = editingPlate.name;
    660         if (!isHybridizationEvent)
     660        if (!isBioAssayEvent)
    661661        {
    662662          frm.plate_barcode.value = editingPlate.barcode;
     
    664664        Main.show('childplate.info');
    665665      }
    666       if (editingWell && !isHybridizationEvent)
     666      if (editingWell && !isBioAssayEvent)
    667667      {
    668668        frm.biomaterial_name.value = editingWell.childName;
     
    674674    {
    675675      var frm = document.forms['main'];
    676       if (editingWell && !isHybridizationEvent)
     676      if (editingWell && !isBioAssayEvent)
    677677      {
    678678        Main.hide('childbiomaterial.info');
     
    684684        Main.hide('childplate.info');
    685685        editingPlate.name = frm.plate_name.value;
    686         if (!isHybridizationEvent)
     686        if (!isBioAssayEvent)
    687687        {
    688688          editingPlate.barcode = frm.plate_barcode.value;
     
    710710      <!-- child plate properties -->
    711711      <input type="hidden" name="number_of_plates" value="<%=numChildPlates%>">
    712       <input type="hidden" name="num_arrays" value="<%=numArrays%>">
     712      <input type="hidden" name="size" value="<%=size%>">
    713713      <input type="hidden" name="plategeometry_id" value="<%=childPlateGeometryId%>">
    714714      <input type="hidden" name="bioplatetype_id" value="<%=childPlateTypeId%>">
     
    755755        <td style="width: 50%;">
    756756          <div style="max-height: <%=(int)(scale*350)%>px; overflow: auto;">
    757             <b><%=isHybridizationEvent ?
    758                 "Hybridization(s)" : "Destination plate(s):"%></b>
     757            <b><%=isBioAssayEvent ?
     758                "Physical bioassay(s)" : "Destination plate(s):"%></b>
    759759                <span id="plate.dest.info"><i>not created</i></span>
    760760           
     
    774774      <tr valign="top">
    775775      <td width="50%">
    776         <h3><%=isHybridizationEvent ? "Hybridization" : "Child plate:"%></h3>
     776        <h3><%=isBioAssayEvent ? "Physical bioassay" : "Child plate:"%></h3>
    777777        <table class="form" cellspacing="0" id="childplate.info" style="display: none;">
    778778        <tr>
     
    782782        </tr>
    783783        <%
    784         if (!isHybridizationEvent)
     784        if (!isBioAssayEvent)
    785785        {
    786786          %>
     
    797797      <td width="50%">
    798798        <%
    799         if (!isHybridizationEvent)
     799        if (!isBioAssayEvent)
    800800        {
    801801          %>
  • trunk/www/biomaterials/wizards/index.jsp

    r5641 r5642  
    3232  import="net.sf.basedb.core.BioPlateEventParticipant"
    3333  import="net.sf.basedb.core.BioWell"
    34   import="net.sf.basedb.core.Hybridization"
     34  import="net.sf.basedb.core.PhysicalBioAssay"
    3535  import="net.sf.basedb.core.DbControl"
    3636  import="net.sf.basedb.core.Item"
     
    200200    Item sourceBioMaterialType = sourcePlate.getBioPlateType().getBioMaterialType();
    201201    Item childBioMaterialType = Item.valueOf(request.getParameter("child_biomaterial_type"));
    202     boolean isHybridizationEvent = childBioMaterialType == Item.HYBRIDIZATION;
     202    boolean isBioAssayEvent = childBioMaterialType == Item.PHYSICALBIOASSAY;
    203203   
    204204    // The event object
    205205    BioPlateEventType createBioMaterial = BioPlateEventType.getById(dc,
    206         isHybridizationEvent ? BioPlateEventType.HYBRIDIZATION :  BioPlateEventType.CREATE_BIOMATERIAL);
     206        isBioAssayEvent ? BioPlateEventType.PHYSICAL_BIOASSAY :  BioPlateEventType.CREATE_BIOMATERIAL);
    207207    BioPlateEvent event = BioPlateEvent.getNew(dc, createBioMaterial);
    208208    event.setName(Values.getStringOrNull(request.getParameter("event_name")));
     
    229229    // Child plates & biomaterial
    230230    Hardware freezer = null;
    231     if (!isHybridizationEvent)
     231    if (!isBioAssayEvent)
    232232    {
    233233      int freezerId = Values.getInt(request.getParameter("freezer_id"));
     
    239239    }
    240240    int numChildPlates = Values.getInt(request.getParameter("number_of_plates"));
    241     int numArrays = Values.getInt(request.getParameter("num_arrays"));
     241    int size = Values.getInt(request.getParameter("size"));
    242242    PlateGeometry childGeometry = null;
    243     if (!isHybridizationEvent)
     243    if (!isBioAssayEvent)
    244244    {
    245245      childGeometry = PlateGeometry.getById(dc, Values.getInt(request.getParameter("plategeometry_id")));
    246246      cc.setRecent(childGeometry, sourceBioMaterialType.name(), maxRecent);
    247247    }
    248     int rows = isHybridizationEvent ? 1 : childGeometry.getRows();
    249     int columns = isHybridizationEvent ? numArrays : childGeometry.getColumns();
     248    int rows = isBioAssayEvent ? 1 : childGeometry.getRows();
     249    int columns = isBioAssayEvent ? size : childGeometry.getColumns();
    250250    int numCreated = 0;
    251251    BioPlateType childPlateType = null;
    252     if (!isHybridizationEvent)
     252    if (!isBioAssayEvent)
    253253    {
    254254      childPlateType = BioPlateType.getById(dc, Values.getInt(request.getParameter("bioplatetype_id")));
     
    259259    for (int plateNo = 0; plateNo < numChildPlates; ++plateNo)
    260260    {
    261       Hybridization hyb = null;
    262       BioMaterialEvent hybCreationEvent = null;
     261      PhysicalBioAssay pba = null;
     262      BioMaterialEvent pbaCreationEvent = null;
    263263      BioPlate childPlate = null;
    264264      BioPlateEventParticipant destParticipant = null;
    265       if (isHybridizationEvent)
    266       {
    267         hyb = Hybridization.getNew(dc, sourceParticipant);
    268         hyb.setName(Values.getStringOrNull(request.getParameter("plate." + plateNo + ".name")));
    269         hyb.setDescription(Values.getStringOrNull(request.getParameter("plate_description")));
    270         hyb.setNumArrays(numArrays);
    271         dc.saveItem(hyb);
    272         hybCreationEvent = hyb.getCreationEvent();
     265      if (isBioAssayEvent)
     266      {
     267        pba = PhysicalBioAssay.getNew(dc, sourceParticipant);
     268        pba.setName(Values.getStringOrNull(request.getParameter("plate." + plateNo + ".name")));
     269        pba.setDescription(Values.getStringOrNull(request.getParameter("plate_description")));
     270        pba.setSize(size);
     271        dc.saveItem(pba);
     272        pbaCreationEvent = pba.getCreationEvent();
    273273      }
    274274      else
     
    291291          {
    292292            MeasuredBioMaterial parent = (MeasuredBioMaterial)sourceBioMaterialType.getById(dc, bioMaterialId);
    293             if (isHybridizationEvent)
     293            if (isBioAssayEvent)
    294294            {
    295               hybCreationEvent.addSource(parent, usedQuantity);
    296               hybCreationEvent.setSourceGroup(parent, column+1);
     295              pbaCreationEvent.addSource(parent, usedQuantity);
     296              pbaCreationEvent.setSourceGroup(parent, column+1);
    297297            }
    298298            else
     
    341341
    342342    dc.commit();
    343     if (isHybridizationEvent)
    344     {
    345       message = "Hybridized " + numCreated + " items on " + numChildPlates + " hybridizations(s)";
     343    if (isBioAssayEvent)
     344    {
     345      message = "Used " + numCreated + " items on " + numChildPlates + " physical bioassay(s)";
    346346    }
    347347    else
  • trunk/www/common/annotations/inherit.jsp

    r5426 r5642  
    3939  import="net.sf.basedb.core.Annotation"
    4040  import="net.sf.basedb.core.RawBioAssay"
    41   import="net.sf.basedb.core.Hybridization"
     41  import="net.sf.basedb.core.PhysicalBioAssay"
    4242  import="net.sf.basedb.core.ItemQuery"
    4343  import="net.sf.basedb.core.Include"
     
    6666{
    6767  Set<Annotatable> parents = null;
    68   if (root instanceof RawBioAssay && current instanceof Hybridization)
    69   {
    70     Hybridization hyb = (Hybridization)current;
     68  if (root instanceof RawBioAssay && current instanceof PhysicalBioAssay)
     69  {
     70    PhysicalBioAssay hyb = (PhysicalBioAssay)current;
    7171    RawBioAssay rba = (RawBioAssay)root;
    7272    parents = hyb.getAnnotatableParents(rba.getArrayNum());
  • trunk/www/include/menu.jsp

    r5641 r5642  
    464464    final boolean createMessages        =  sc.hasPermission(Permission.CREATE, Item.MESSAGE);
    465465
    466     final boolean hasHybridizations     = !sc.hasPermission(Permission.DENIED, Item.HYBRIDIZATION);
    467     final boolean createHybridizations  =  sc.hasPermission(Permission.CREATE, Item.HYBRIDIZATION);
     466    final boolean hasPhysicalBioAssays     = !sc.hasPermission(Permission.DENIED, Item.PHYSICALBIOASSAY);
    468467
    469468    final boolean hasScans              = !sc.hasPermission(Permission.DENIED, Item.SCAN);
     
    546545      <m:menuseparator />
    547546      <m:menuitem
    548         title="<%=common.getString("item.hybridization+")%>"
    549         onclick="<%="Menu.openUrl('"+root+"views/hybridizations/index.jsp?ID="+ID+"')"%>"
    550         tooltip="<%=menu.getString("hybridizations.tooltip", hasHybridizations)%>"
    551         enabled="<%=hasHybridizations%>"
     547        title="<%=common.getString("item.physicalbioassay+")%>"
     548        onclick="<%="Menu.openUrl('"+root+"views/physicalbioassays/index.jsp?ID="+ID+"')"%>"
     549        tooltip="<%=menu.getString("physicalbioassays.tooltip", hasPhysicalBioAssays)%>"
     550        enabled="<%=hasPhysicalBioAssays%>"
    552551      />
    553552      <m:menuitem
  • trunk/www/include/scripts/main.js

    r5641 r5642  
    530530    this.controllers['JOB'] = { url:'views/jobs/index.jsp', width:640, height:480, popup:true, edit:false };
    531531    this.controllers['FORMULA'] = { url:'views/formulas/index.jsp', width:850, height:600 };
    532     this.controllers['HYBRIDIZATION'] = { url:'views/hybridizations/index.jsp', width:800, height:500 };
     532    this.controllers['PHYSICALBIOASSAY'] = { url:'views/physicalbioassays/index.jsp', width:800, height:500 };
    533533    this.controllers['RAWBIOASSAY'] = { url:'views/rawbioassays/index.jsp', width:800, height:500 };
    534534    this.controllers['RAWDATA'] = { url:'views/rawbioassays/rawdata/index.jsp', width:700, height:500, popup: true, edit:false };
  • trunk/www/lims/arrayslides/index.jsp

    r5590 r5642  
    3030  import="net.sf.basedb.core.Item"
    3131  import="net.sf.basedb.core.Include"
    32   import="net.sf.basedb.core.Hybridization"
     32  import="net.sf.basedb.core.PhysicalBioAssay "
    3333  import="net.sf.basedb.core.ArraySlide"
    3434  import="net.sf.basedb.core.ArrayBatch"
     
    6666<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
    6767<%!
    68   private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,arrayDesign,hybridization,description");
     68  private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,arrayDesign,physicalBioAssay,description");
    6969  private static final Item itemType = Item.ARRAYSLIDE;
    7070%>
  • trunk/www/lims/arrayslides/list_slides.jsp

    r5426 r5642  
    2828  import="net.sf.basedb.core.DbControl"
    2929  import="net.sf.basedb.core.Item"
    30   import="net.sf.basedb.core.Hybridization"
     30  import="net.sf.basedb.core.PhysicalBioAssay"
    3131  import="net.sf.basedb.core.ArraySlide"
    3232  import="net.sf.basedb.core.AnnotationType"
     
    271271      />
    272272      <tbl:columndef
    273         id="hybridization"
    274         property="hybridization.name"
    275         datatype="string"
    276         title="Hybridization"
     273        id="physicalBioAssay"
     274        property="physicalBioassay.name"
     275        datatype="string"
     276        title="Physical bioassay"
    277277        sortable="true"
    278278        filterable="true"
     
    554554                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
    555555                  /></tbl:cell>
    556                 <tbl:cell column="hybridization"
     556                <tbl:cell column="physicalBioAssay"
    557557                  ><base:propertyvalue
    558558                    item="<%=item%>"
    559                     property="hybridization"
     559                    property="physicalBioAssay"
    560560                    enableEditLink="<%=mode.hasEditLink()%>"
    561561                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
  • trunk/www/lims/arrayslides/view_slide.jsp

    r5499 r5642  
    3333  import="net.sf.basedb.core.AnnotationType"
    3434  import="net.sf.basedb.core.AnnotationSet"
    35   import="net.sf.basedb.core.Hybridization"
     35  import="net.sf.basedb.core.PhysicalBioAssay"
    3636  import="net.sf.basedb.core.ArraySlide"
    3737  import="net.sf.basedb.core.ArrayBatch"
     
    278278      </tr>
    279279      <tr>
    280         <td class="prompt">Hybridization</td>
    281         <td><base:propertyvalue item="<%=slide%>" property="hybridization" /></td>
     280        <td class="prompt">Physical bioassay</td>
     281        <td><base:propertyvalue item="<%=slide%>" property="physicalBioAssay" /></td>
    282282      </tr>
    283283      <tr>
  • trunk/www/views/physicalbioassays/edit_bioassay.jsp

    r5641 r5642  
    2020  along with BASE. If not, see <http://www.gnu.org/licenses/>.
    2121  ------------------------------------------------------------------
    22 
    2322
    2423  @author Nicklas
     
    3433  import="net.sf.basedb.core.Include"
    3534  import="net.sf.basedb.core.Hardware"
    36   import="net.sf.basedb.core.Hybridization"
     35  import="net.sf.basedb.core.PhysicalBioAssay"
    3736  import="net.sf.basedb.core.BioMaterialEvent"
    3837  import="net.sf.basedb.core.ArraySlide"
     
    6867<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %>
    6968<%
    70 final Item itemType = Item.HYBRIDIZATION;
     69final Item itemType = Item.PHYSICALBIOASSAY;
    7170final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
    7271final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
     
    7978  String title = null;
    8079  String name = null;
    81   Hybridization hyb = null;
     80  PhysicalBioAssay pba = null;
    8281  BioMaterialEvent creationEvent = null;
    8382  Date eventDate = null;
    84   ItemQuery<Extract> labeledExtractsQuery = null;
     83  ItemQuery<Extract> extractsQuery = null;
    8584 
    8685  boolean readCurrentArraySlide = true;
     
    9190  Protocol defaultProtocol = null;
    9291 
    93   boolean readCurrentHybStation = true;
    94   Hardware currentHybStation = null;
    95   Hardware defaultHybStation = null;
     92  boolean readCurrentHardware = true;
     93  Hardware currentHardware = null;
     94  Hardware defaultHardware = null;
    9695
    9796  // Load recently used items
    9897  List<Protocol> recentProtocols = (List<Protocol>)cc.getRecent(dc, Item.PROTOCOL);
    99   List<Hardware> recentStations = (List<Hardware>)cc.getRecent(dc, Item.HARDWARE);
     98  List<Hardware> recentHardware = (List<Hardware>)cc.getRecent(dc, Item.HARDWARE);
    10099 
    101100  int activeProjectId = sc.getActiveProjectId();
     
    113112    try
    114113    {
    115       defaultHybStation = (Hardware)activeProject.getDefaultItem(dc, Project.Default.HYBRIDIZATION_HARDWARE);
     114      defaultHardware = (Hardware)activeProject.getDefaultItem(dc, Project.Default.HYBRIDIZATION_HARDWARE);
    116115    }
    117116    catch (PermissionDeniedException pdex)
    118117    {
    119       defaultHybStation = null;
     118      defaultHardware = null;
    120119    }
    121120  }
    122121  if (itemId == 0)
    123122  {
    124     title = "Create hybridization";
     123    title = "Create physical bioassay";
    125124    cc.removeObject("item");
    126125    if (cc.getPropertyFilter("creationEvent.protocol.name") != null)
     
    130129    if (cc.getPropertyFilter("creationEvent.hardware.name") != null)
    131130    {
    132       currentHybStation = Base.getFirstMatching(dc, Hardware.getQuery(), "name", cc.getPropertyFilter("creationEvent.hardware.name"));
     131      currentHardware = Base.getFirstMatching(dc, Hardware.getQuery(), "name", cc.getPropertyFilter("creationEvent.hardware.name"));
    133132    }
    134133    if (cc.getPropertyFilter("arraySlide.name") != null)
     
    144143      if (lc.getSelected().size() > 0)
    145144      {
    146         labeledExtractsQuery = Extract.getQuery();
    147         labeledExtractsQuery.include(Include.ALL);
    148         labeledExtractsQuery.order(Orders.asc(Hql.property("name")));
    149         labeledExtractsQuery.restrict(Restrictions.in(Hql.property("id"),
     145        extractsQuery = Extract.getQuery();
     146        extractsQuery.include(Include.ALL);
     147        extractsQuery.order(Orders.asc(Hql.property("name")));
     148        extractsQuery.restrict(Restrictions.in(Hql.property("id"),
    150149          Expressions.parameter("selected", lc.getSelected(), Type.INT)));
    151150      }
     
    154153    {
    155154      int leId = Values.getInt(request.getParameter("extract_id"));
    156       labeledExtractsQuery = Extract.getQuery();
    157       labeledExtractsQuery.include(Include.ALL);
    158       labeledExtractsQuery.restrict(Restrictions.eq(Hql.property("id"),
     155      extractsQuery = Extract.getQuery();
     156      extractsQuery.include(Include.ALL);
     157      extractsQuery.restrict(Restrictions.eq(Hql.property("id"),
    159158        Expressions.integer(leId)));
    160159    }
     
    162161  else
    163162  {
    164     hyb = Hybridization.getById(dc, itemId);
    165     creationEvent = hyb.getCreationEvent();
     163    pba = PhysicalBioAssay.getById(dc, itemId);
     164    creationEvent = pba.getCreationEvent();
    166165    eventDate = creationEvent.getEventDate();
    167     cc.setObject("item", hyb);
    168     title = "Edit hybridization -- " + HTML.encodeTags(hyb.getName());
    169     name = hyb.getName();
     166    cc.setObject("item", pba);
     167    title = "Edit physical bioassay -- " + HTML.encodeTags(pba.getName());
     168    name = pba.getName();
    170169    try
    171170    {
    172       currentArraySlide = hyb.getArraySlide();
     171      currentArraySlide = pba.getArraySlide();
    173172    }
    174173    catch (PermissionDeniedException ex)
     
    186185    try
    187186    {
    188       currentHybStation = creationEvent.getHardware();
     187      currentHardware = creationEvent.getHardware();
    189188    }
    190189    catch (PermissionDeniedException ex)
    191190    {
    192       readCurrentHybStation = false;
    193     }
    194    
    195     // Query to retrieve source labeled extracts
    196     labeledExtractsQuery = (ItemQuery<Extract>)creationEvent.getSources();
    197     labeledExtractsQuery.include(Include.ALL);
    198     labeledExtractsQuery.order(Orders.asc(Hql.property("name")));
     191      readCurrentHardware = false;
     192    }
     193   
     194    // Query to retrieve source extracts
     195    extractsQuery = (ItemQuery<Extract>)creationEvent.getSources();
     196    extractsQuery.include(Include.ALL);
     197    extractsQuery.order(Orders.asc(Hql.property("name")));
    199198   
    200199  }
    201   if (hyb != null) hyb.checkPermission(Permission.WRITE);
     200  if (pba != null) pba.checkPermission(Permission.WRITE);
    202201
    203202  final String clazz = "class=\"text\"";
     
    207206  String jsDateFormat = HTML.javaScriptEncode(dateFormat);
    208207  String htmlDateFormat = HTML.encodeTags(dateFormat);
    209   JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), hyb);
     208  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), pba);
    210209  ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext);
    211210  %>
     
    215214    <ext:stylesheets context="<%=jspContext%>" />
    216215    <script language="JavaScript">
    217     // Validate the "Hybridization" tab
    218     function validateHybridization()
    219     {
    220       var frm = document.forms['hybridization'];
     216    // Validate the "Physical bioassay" tab
     217    function validatePhysicalBioAssay()
     218    {
     219      var frm = document.forms['bioassay'];
    221220      if (Main.trimString(frm.name.value) == '')
    222221      {
     
    225224        return false;
    226225      }
    227       else if (!Numbers.isInteger(frm.numArrays.value))
    228       {
    229         alert("'" + frm.numArrays.value + "' is not a valid number");
    230         frm.numArrays.focus();
     226      else if (!Numbers.isInteger(frm.size.value))
     227      {
     228        alert("'" + frm.size.value + "' is not a valid number");
     229        frm.size.focus();
    231230        return false;
    232231      }
    233       else if (parseInt(frm.numArrays.value) <= 0)
    234       {
    235         alert("Number of arrays must be > 0");
    236         frm.numArrays.focus();
     232      else if (parseInt(frm.size.value) <= 0)
     233      {
     234        alert("Size must be > 0");
     235        frm.size.focus();
    237236        return false;
    238237      }
     
    243242    function saveSettings()
    244243    {
    245       var frm = document.forms['hybridization'];
     244      var frm = document.forms['bioassay'];
    246245      if (TabControl.validateActiveTab('settings'))
    247246      {
     
    254253          Annotations.addInheritedAnnotationsToForm(frames.inheritedAnnotations, frm);
    255254        }
    256         frm.modifiedLabeledExtracts.value = Link.exportModified(frm, 'L', true).join(',');
    257         frm.removedLabeledExtracts.value = Link.getActionIds(-1, 'L').join(',');
     255        frm.modifiedExtracts.value = Link.exportModified(frm, 'E', true).join(',');
     256        frm.removedExtracts.value = Link.getActionIds(-1, 'E').join(',');
    258257        frm.submit();
    259258      }
     
    270269        if (tabId == 'annotations' && (protocolChanged || !annotationsLoaded))
    271270        {
    272           Annotations.loadAnnotateFrame(frames.annotations, '<%=ID%>', '<%=itemType.name()%>', <%=hyb == null ? 0 : hyb.getId()%>, getProtocolId());
     271          Annotations.loadAnnotateFrame(frames.annotations, '<%=ID%>', '<%=itemType.name()%>', <%=pba == null ? 0 : pba.getId()%>, getProtocolId());
    273272          annotationsLoaded = true;
    274273          protocolChanged = false;
     
    286285    function getProtocolId()
    287286    {
    288       var frm = document.forms['hybridization'];
     287      var frm = document.forms['bioassay'];
    289288      var protocolId = 0;
    290289      if (frm.protocol_id.length > 0 && !frm.protocol_id.disabled)
     
    297296    function getParents()
    298297    {
    299       var frm = document.forms['hybridization'];
     298      var frm = document.forms['bioassay'];
    300299      var parents = new Array();
    301300
     
    303302      if (arraySlideId > 0) parents[parents.length] = 'ARRAYSLIDE:'+arraySlideId;
    304303
    305       var ids = Link.getListIds(frm.labeled_extracts, 'L');
     304      var ids = Link.getListIds(frm.extracts, 'L');
    306305      if (ids.length > 0)
    307306      {
     
    313312    function selectProtocolOnClick()
    314313    {
    315       var frm = document.forms['hybridization'];
     314      var frm = document.forms['bioassay'];
    316315      var url = '../../admin/protocols/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setProtocolCallback';
    317316      if (frm.protocol_id.length > 1)
     
    325324    function setProtocolCallback(id, name)
    326325    {
    327       var frm = document.forms['hybridization'];
     326      var frm = document.forms['bioassay'];
    328327      var list = frm.protocol_id;
    329328      if (list.length < 2 || list[1].value == '0') // >
     
    341340    }
    342341   
    343     function selectHybStationOnClick()
    344     {
    345       var frm = document.forms['hybridization'];
    346       var url = '../../admin/hardware/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setHybStationCallback';
     342    function selectHardwareOnClick()
     343    {
     344      var frm = document.forms['bioassay'];
     345      var url = '../../admin/hardware/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setHardwareCallback';
    347346      if (frm.hardware_id.length > 1)
    348347      {
     
    351350      }
    352351      url += '&resetTemporary=1&tmpfilter:INT:itemSubtype=<%=SystemItems.getId(Hardware.HYBRIDIZATION_STATION)%>';
    353       Main.openPopup(url, 'SelectHybStation', 1000, 700);
    354     }
    355     function setHybStationCallback(id, name)
    356     {
    357       var frm = document.forms['hybridization'];
     352      Main.openPopup(url, 'SelectHardware', 1000, 700);
     353    }
     354    function setHardwareCallback(id, name)
     355    {
     356      var frm = document.forms['bioassay'];
    358357      var list = frm.hardware_id;
    359358      if (list.length < 2 || list[1].value == '0') // >
     
    368367    function arraySlideOnChange()
    369368    {
    370       var frm = document.forms['hybridization'];
     369      var frm = document.forms['bioassay'];
    371370      var selectedIndex = frm.arrayslide_id.selectedIndex
    372371      var arraySlideId = frm.arrayslide_id[selectedIndex].value;
    373       if (arraySlideId > 0) updateNumArrays(arraySlideId);
     372      if (arraySlideId > 0) updateSize(arraySlideId);
    374373      parentsChanged = true;
    375374    }
    376375    function selectArraySlideOnClick()
    377376    {
    378       var frm = document.forms['hybridization'];
     377      var frm = document.forms['bioassay'];
    379378      var url = '../../lims/arrayslides/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setArraySlideCallback';
    380379      if (frm.arrayslide_id.length > 1)
     
    383382        url += '&item_id='+id;
    384383      }
    385       url += '&resetTemporary=1&tmpfilter:STRING:hybridization.name==';
     384      url += '&resetTemporary=1&tmpfilter:STRING:physicalBioAssay.name==';
    386385      url += '&tmpfilter:BOOLEAN:destroyed=false';
    387386      Main.openPopup(url, 'SelectArraySlide', 1000, 700);
     
    389388    function setArraySlideCallback(arraySlideId, name)
    390389    {
    391       var frm = document.forms['hybridization'];
     390      var frm = document.forms['bioassay'];
    392391      if (frm.arrayslide_id.length < 2) // >
    393392      {
     
    397396      frm.arrayslide_id[1].text = name;
    398397      frm.arrayslide_id.selectedIndex = 1;
    399       updateNumArrays(arraySlideId);
     398      updateSize(arraySlideId);
    400399      parentsChanged = true;
    401400    }
     
    414413    function updateNumArraysCallback(request)
    415414    {
    416       var frm = document.forms['hybridization'];
     415      var frm = document.forms['bioassay'];
    417416      var response = Ajax.parseJsonResponse(request.responseText);
    418417      if (response.status != 'ok')
     
    424423      if (response.numArrays)
    425424      {
    426         frm.numArrays.value = response.numArrays;
    427       }
    428     }
    429    
    430     function addLabeledExtractsOnClick()
    431     {
    432       var frm = document.forms['hybridization'];
    433       var ids = Link.getListIds(frm.labeled_extracts, 'L');
     425        frm.size.value = response.numArrays;
     426      }
     427    }
     428   
     429    function addExtractsOnClick()
     430    {
     431      var frm = document.forms['bioassay'];
     432      var ids = Link.getListIds(frm.extracts, 'L');
    434433      var excludes = ids.join(',');
    435434     
    436       var url = '../../biomaterials/extracts/index.jsp?ID=<%=ID%>&mode=selectmultiple&callback=addLabeledExtractCallback';
     435      var url = '../../biomaterials/extracts/index.jsp?ID=<%=ID%>&mode=selectmultiple&callback=addExtractCallback';
    437436      url += '&exclude='+excludes;
    438       Main.openPopup(url, 'AddLabeledExtracts', 1000, 700);
    439     }
    440     function addLabeledExtractCallback(labeledExtractId, name)
    441     {
    442       var item = Link.getItem('L', labeledExtractId);
    443       if (!item) item = new Item('L', labeledExtractId, '1: '+name+' [-]', '', '');
    444       Link.addItem(document.forms['hybridization'].labeled_extracts, item);
     437      Main.openPopup(url, 'AddExtracts', 1000, 700);
     438    }
     439    function addExtractCallback(extractId, name)
     440    {
     441      var item = Link.getItem('E', extractId);
     442      if (!item) item = new Item('E', extractId, '1: '+name+' [-]', '', '');
     443      Link.addItem(document.forms['bioassay'].extracts, item);
    445444      parentsChanged = true;
    446       labeledExtractsOnChange();
    447     }
    448     function labeledExtractsOnChange()
    449     {
    450       var frm = document.forms['hybridization'];
    451       var item = frm.labeled_extracts[frm.labeled_extracts.selectedIndex].item;
     445      extractsOnChange();
     446    }
     447    function extractsOnChange()
     448    {
     449      var frm = document.forms['bioassay'];
     450      var item = frm.extracts[frm.extracts.selectedIndex].item;
    452451      if (item && item.id)
    453452      {
     
    465464    function usedQuantityOnBlur()
    466465    {
    467       var frm = document.forms['hybridization'];
     466      var frm = document.forms['bioassay'];
    468467      var usedQuantity = frm.used_quantity.value;
    469468      var arrayIndex = frm.array_index.value;
    470       var numArrays = parseInt(frm.numArrays.value);
    471       if (arrayIndex != '' && (arrayIndex > numArrays || arrayIndex <= 0))
    472       {
    473         alert('Array index must be between 1 and ' + numArrays);
     469      var size = parseInt(frm.size.value);
     470      if (arrayIndex != '' && (arrayIndex > size || arrayIndex <= 0))
     471      {
     472        alert('Array index must be between 1 and ' + size);
    474473        return;
    475474      }
    476475      if (arrayIndex == '') arrayIndex = 1;
    477476      var displayQuantity = usedQuantity == '' ? '-' : usedQuantity+' µg';
    478       for (var i = 0; i < frm.labeled_extracts.length; i++) // >
    479       {
    480         var option = frm.labeled_extracts[i];
     477      for (var i = 0; i < frm.extracts.length; i++) // >
     478      {
     479        var option = frm.extracts[i];
    481480        if (option.selected && option.item.id)
    482481        {
     
    495494    function removeOnClick()
    496495    {
    497       Link.removeSelected(document.forms['hybridization'].labeled_extracts);
     496      Link.removeSelected(document.forms['bioassay'].extracts);
    498497      parentsChanged = true;
    499498    }
     
    502501    function init()
    503502    {
    504       var frm = document.forms['hybridization'];
    505       var labeledExtracts = frm.labeled_extracts;
     503      var frm = document.forms['bioassay'];
     504      var extracts = frm.extracts;
    506505      <%
    507       if (hyb == null)
     506      if (pba == null)
    508507      {
    509508        %>
     
    512511        <%
    513512      }
    514       if (labeledExtractsQuery != null)
    515       {
    516         ItemResultList<Extract> labeledExtracts = labeledExtractsQuery.list(dc);
    517         for (Extract le : labeledExtracts)
     513      if (extractsQuery != null)
     514      {
     515        ItemResultList<Extract> extracts = extractsQuery.list(dc);
     516        for (Extract extract : extracts)
    518517        {
    519           if (hyb == null)
     518          if (pba == null)
    520519          {
    521520            %>
    522             Link.addItem(labeledExtracts, new Item('L', <%=le.getId()%>, '1: <%=HTML.javaScriptEncode(le.getName())%> [-]', ':1'));
     521            Link.addItem(extracts, new Item('E', <%=extract.getId()%>, '1: <%=HTML.javaScriptEncode(extract.getName())%> [-]', ':1'));
    523522            <%
    524523          }
    525524          else
    526525          {
    527             Float used = creationEvent.getUsedQuantity(le);
     526            Float used = creationEvent.getUsedQuantity(extract);
    528527            String usedQuantity = Values.formatNumber(used, -1);
    529528            String usedWithUnit = used == null ? "-" : usedQuantity + " µg";
    530             int arrayIndex = creationEvent.getSourceGroup(le);
     529            int arrayIndex = creationEvent.getSourceGroup(extract);
    531530            %>
    532             Link.addNewItem(labeledExtracts, new Item('L', <%=le.getId()%>, '<%=arrayIndex + ": " + HTML.javaScriptEncode(le.getName())%> [<%=usedWithUnit%>]', '<%=usedQuantity%>:<%=arrayIndex%>'));
     531            Link.addNewItem(extracts, new Item('E', <%=extract.getId()%>, '<%=arrayIndex + ": " + HTML.javaScriptEncode(extract.getName())%> [<%=usedWithUnit%>]', '<%=usedQuantity%>:<%=arrayIndex%>'));
    533532            <%
    534533          }
     
    541540  <base:body onload="init()">
    542541    <p>
    543     <form action="index.jsp?ID=<%=ID%>" method="post" name="hybridization" onsubmit="return false;">
     542    <form action="index.jsp?ID=<%=ID%>" method="post" name="bioassay" onsubmit="return false;">
    544543    <input type="hidden" name="cmd" value="UpdateItem">
    545544
    546545    <h3 class="docked"><%=title%> <base:help tabcontrol="settings" /></h3>
    547546    <t:tabcontrol id="settings" contentstyle="<%="height: "+(int)(scale*370)+"px;"%>"
    548       position="bottom"  remember="<%=hyb != null%>" switch="switchTab"
     547      position="bottom"  remember="<%=pba != null%>" switch="switchTab"
    549548      extensions="<%=invoker%>">
    550     <t:tab id="info" title="Hybridization" validate="validateHybridization()" helpid="hybridization.edit">
     549    <t:tab id="info" title="Physical bioassay" validate="validatePhysicalBioAssay()" helpid="physicalbioassay.edit">
    551550      <table class="form" cellspacing=0>
    552551      <tr>
     
    554553        <td><input <%=requiredClazz%> type="text" name="name"
    555554          value="<%=name%>"
    556           size="40" maxlength="<%=Hybridization.MAX_NAME_LENGTH%>"></td>
    557       </tr>
    558       <tr>
    559         <td class="prompt">Arrays</td>
    560         <td><input <%=requiredClazz%> type="text" name="numArrays"
    561           value="<%=hyb == null ? Values.getString(cc.getPropertyValue("numArrays"), "1") : hyb.getNumArrays()%>"
     555          size="40" maxlength="<%=PhysicalBioAssay.MAX_NAME_LENGTH%>"></td>
     556      </tr>
     557      <tr>
     558        <td class="prompt">Size</td>
     559        <td><input <%=requiredClazz%> type="text" name="size"
     560          value="<%=pba == null ? Values.getString(cc.getPropertyValue("size"), "1") : pba.getSize()%>"
    562561          size="12" maxlength="10" onkeypress="return Numbers.integerOnly(event)"></td>
    563562      </tr>
     
    575574          <td>
    576575          <base:button
    577             onclick="<%="Dates.selectDate('Created', 'hybridization', 'event_date', null, '"+jsDateFormat+"')"%>"
     576            onclick="<%="Dates.selectDate('Created', 'bioassay', 'event_date', null, '"+jsDateFormat+"')"%>"
    578577            image="calendar.png"
    579578            title="Calendar&hellip;"
     
    600599            recent="<%=recentProtocols%>"
    601600            defaultitem="<%=defaultProtocol%>"
    602             newitem="<%=hyb == null%>"
     601            newitem="<%=pba == null%>"
    603602            onselect="selectProtocolOnClick()"
    604603            onchange="protocolOnChange()"
     
    613612            clazz="selectionlist"
    614613            required="false"
    615             current="<%=currentHybStation%>"
    616             denied="<%=!readCurrentHybStation%>"
    617             recent="<%=recentStations%>"
    618             defaultitem="<%=defaultHybStation%>"
    619             newitem="<%=hyb == null%>"
    620             onselect="selectHybStationOnClick()"
     614            current="<%=currentHardware%>"
     615            denied="<%=!readCurrentHardware%>"
     616            recent="<%=recentHardware%>"
     617            defaultitem="<%=defaultHardware%>"
     618            newitem="<%=pba == null%>"
     619            onselect="selectHardwareOnClick()"
    621620          />
    622621        </td>
     
    631630            current="<%=currentArraySlide%>"
    632631            denied="<%=!readCurrentArraySlide%>"
    633             newitem="<%=hyb == null%>"
     632            newitem="<%=pba == null%>"
    634633            onselect="selectArraySlideOnClick()"
    635634            onchange="arraySlideOnChange()"
     
    641640        <td nowrap>
    642641          <textarea <%=clazz%> rows="4" cols="40" name="description" wrap="virtual"
    643             ><%=HTML.encodeTags(hyb == null ? cc.getPropertyValue("description") : hyb.getDescription())%></textarea>
    644           <a href="javascript:Main.zoom('Description', 'hybridization', 'description')"
     642            ><%=HTML.encodeTags(pba == null ? cc.getPropertyValue("description") : pba.getDescription())%></textarea>
     643          <a href="javascript:Main.zoom('Description', 'bioassay', 'description')"
    645644            title="Edit in larger window"><base:icon image="zoom.gif" /></a>
    646645        </td>
     
    650649    </t:tab>
    651650   
    652     <t:tab id="labeledExtracts" title="Labeled extracts" helpid="hybridization.labeledextracts">
    653       <input type="hidden" name="modifiedLabeledExtracts" value="">
    654       <input type="hidden" name="removedLabeledExtracts" value="">
     651    <t:tab id="extracts" title="Extracts" helpid="physicalbioassay.extracts">
     652      <input type="hidden" name="modifiedExtracts" value="">
     653      <input type="hidden" name="removedExtracts" value="">
    655654   
    656655      <table class="form" cellspacing=0>
    657656      <tr valign="top">
    658         <td class="prompt">Labeled extracts</td>
     657        <td class="prompt">Extracts</td>
    659658        <td>
    660659          <table border="0" cellspacing="0" cellpadding="0">
    661660          <tr valign="top">
    662661          <td>
    663             <select name="labeled_extracts" size="5" multiple style="width: 20em;"
    664               onchange="labeledExtractsOnChange()">
     662            <select name="extracts" size="5" multiple style="width: 20em;"
     663              onchange="extractsOnChange()">
    665664            </select>&nbsp;<br>
    666665          </td>
     
    668667            <table border="0">
    669668            <tr><td width="150"><base:button
    670               onclick="addLabeledExtractsOnClick()"
    671               title="Add&nbsp;labeled&nbsp;extracts&hellip;"
    672               tooltip="Add labeled extracts"
     669              onclick="addExtractsOnClick()"
     670              title="Add&nbsp;extracts&hellip;"
     671              tooltip="Add extracts"
    673672              /></td></tr>
    674673            <tr><td width="150"><base:button
    675674              onclick="removeOnClick()"
    676675              title="Remove"
    677               tooltip="Remove the selected labeled extracts"
     676              tooltip="Remove the selected extracts"
    678677            /></td></tr>
    679678            </table>
  • trunk/www/views/physicalbioassays/index.jsp

    r5641 r5642  
    2929  import="net.sf.basedb.core.Item"
    3030  import="net.sf.basedb.core.Include"
    31   import="net.sf.basedb.core.Hybridization"
     31  import="net.sf.basedb.core.PhysicalBioAssay"
    3232  import="net.sf.basedb.core.ArraySlide"
    3333  import="net.sf.basedb.core.BioMaterialEvent"
     
    7575<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
    7676<%!
    77   private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,labeledExtracts,arraySlide,scans,description");
    78   private static final Item itemType = Item.HYBRIDIZATION;
     77  private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,extracts,arraySlide,scans,description");
     78  private static final Item itemType = Item.PHYSICALBIOASSAY;
    7979 
    8080  private static void registerExportUtils(ItemContext cc)
     
    8585   
    8686    // Register dataloaders
    87     String hybridizationParameter = "hybridization";
    88     ItemQuery<Extract> labeledExtractQuery = Extract.getQuery();   
    89     labeledExtractQuery.include(cc.getInclude());
    90     labeledExtractQuery.join(Hql.innerJoin("sourceEvents", "srcevt"));
    91     labeledExtractQuery.join(Hql.innerJoin("srcevt", "event", "evt"));
    92     labeledExtractQuery.restrict(Restrictions.eq(Hql.property("evt", "hybridization"), Expressions.parameter(hybridizationParameter)));
    93     labeledExtractQuery.order(Orders.asc(Hql.property("name")));
    94     cc.setObject("export.dataloader.&creationEvent.sourceBioMaterials(name)", new ItemQueryLoader(labeledExtractQuery, hybridizationParameter));
     87    String bioassayParameter = "bioassay";
     88    ItemQuery<Extract> extractQuery = Extract.getQuery();   
     89    extractQuery.include(cc.getInclude());
     90    extractQuery.join(Hql.innerJoin("sourceEvents", "srcevt"));
     91    extractQuery.join(Hql.innerJoin("srcevt", "event", "evt"));
     92    extractQuery.restrict(Restrictions.eq(Hql.property("evt", "physicalBioAssay"), Expressions.parameter(bioassayParameter)));
     93    extractQuery.order(Orders.asc(Hql.property("name")));
     94    cc.setObject("export.dataloader.&creationEvent.sourceBioMaterials(name)", new ItemQueryLoader(extractQuery, bioassayParameter));
    9595   
    9696    ItemQuery<Scan> scanQuery = Scan.getQuery();
    9797    scanQuery.include(cc.getInclude());
    98     scanQuery.restrict(Restrictions.eq(Hql.property("hybridization"), Expressions.parameter(hybridizationParameter)));
     98    scanQuery.restrict(Restrictions.eq(Hql.property("hybridization"), Expressions.parameter(bioassayParameter)));
    9999    scanQuery.order(Orders.asc(Hql.property("name")));
    100     cc.setObject("export.dataloader.&scans(name)", new ItemQueryLoader(scanQuery, hybridizationParameter));
     100    cc.setObject("export.dataloader.&scans(name)", new ItemQueryLoader(scanQuery, bioassayParameter));
    101101  }
    102102%>
     
    109109final String callback = request.getParameter("callback");
    110110final String itemId = request.getParameter("item_id");
    111 final String listPage = "list_hybridizations.jsp?ID="+ID
     111final String listPage = "list_bioassays.jsp?ID="+ID
    112112  +(mode == null ? "" : "&mode="+mode)
    113113  +(callback == null ? "" : "&callback="+callback)
    114114  +(itemId == null ? "" : "&item_id="+itemId);
    115 final String viewPage = "view_hybridization.jsp?ID="+ID;
    116 final String editPage = "edit_hybridization.jsp?ID="+ID;
     115final String viewPage = "view_bioassay.jsp?ID="+ID;
     116final String editPage = "edit_bioassay.jsp?ID="+ID;
    117117
    118118String forward = null;
     
    172172    final int maxRecent = Base.getMaxRecent(sc);
    173173    dc = sc.newDbControl();
    174     Hybridization hyb = (Hybridization)cc.getObject("item");
     174    PhysicalBioAssay pba = (PhysicalBioAssay)cc.getObject("item");
    175175    BioMaterialEvent creationEvent = null;
    176     if (hyb == null)
    177     {
    178       hyb = Hybridization.getNew(dc);
    179       creationEvent = hyb.getCreationEvent();
    180       message = "Hybridization created";
    181       dc.saveItem(hyb);
     176    if (pba == null)
     177    {
     178      pba = PhysicalBioAssay.getNew(dc);
     179      creationEvent = pba.getCreationEvent();
     180      message = "Physical bioassay created";
     181      dc.saveItem(pba);
    182182    }
    183183    else
    184184    {
    185       creationEvent = hyb.getCreationEvent();
    186       dc.reattachItem(hyb, false);
     185      creationEvent = pba.getCreationEvent();
     186      dc.reattachItem(pba, false);
    187187      dc.reattachItem(creationEvent, false);
    188       message = "Hybridization updated";
    189     }
    190     JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(Item.HYBRIDIZATION), hyb);
     188      message = "Physical bioassay updated";
     189    }
     190    JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(Item.PHYSICALBIOASSAY), pba);
    191191    ExtensionsInvoker invoker = EditUtil.useOnSaveExtensions(jspContext);
    192192    try
    193193    {
    194       hyb.setName(Values.getStringOrNull(request.getParameter("name")));
    195       hyb.setDescription(Values.getStringOrNull(request.getParameter("description")));
    196       hyb.setNumArrays(Values.getInt(request.getParameter("numArrays"), 1));
     194      pba.setName(Values.getStringOrNull(request.getParameter("name")));
     195      pba.setDescription(Values.getStringOrNull(request.getParameter("description")));
     196      pba.setSize(Values.getInt(request.getParameter("size"), 1));
    197197     
    198198      int arraySlideId = Values.getInt(request.getParameter("arrayslide_id"), -1);
     
    200200      {
    201201        ArraySlide slide = arraySlideId == 0 ? null : ArraySlide.getById(dc, arraySlideId);
    202         hyb.setArraySlide(slide);
     202        pba.setArraySlide(slide);
    203203      }
    204204      Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc);
     
    212212      }
    213213     
    214       //Hybridization station
    215       int hybStationId = Values.getInt(request.getParameter("hardware_id"), -1);
    216       if (hybStationId >= 0) // < 0 denied or unchanged
     214      //Hardware
     215      int hardwareId = Values.getInt(request.getParameter("hardware_id"), -1);
     216      if (hardwareId >= 0) // < 0 denied or unchanged
    217217      {
    218         Hardware hw = hybStationId == 0 ? null : Hardware.getById(dc, hybStationId);
     218        Hardware hw = hardwareId == 0 ? null : Hardware.getById(dc, hardwareId);
    219219        creationEvent.setHardware(hw);
    220220        if (hw != null) cc.setRecent(hw, maxRecent);
    221221      }
    222222     
    223       // Labeled extracts
    224       String[] modifiedLabeledExtracts = Values.getString(request.getParameter("modifiedLabeledExtracts")).split(",");
    225       for (int i = 0; i < modifiedLabeledExtracts.length; ++i)
     223      // Extracts
     224      String[] modifiedExtracts = Values.getString(request.getParameter("modifiedExtracts")).split(",");
     225      for (int i = 0; i < modifiedExtracts.length; ++i)
    226226      {
    227         int leId = Values.getInt(modifiedLabeledExtracts[i], -1);
    228         if (leId != -1)
     227        int extractId = Values.getInt(modifiedExtracts[i], -1);
     228        if (extractId != -1)
    229229        {
    230           Extract le = Extract.getById(dc, leId);
    231           String[] extra = request.getParameter("L"+leId).split(":");
     230          Extract e = Extract.getById(dc, extractId);
     231          String[] extra = request.getParameter("E"+extractId).split(":");
    232232          Float usedQuantity = Values.getFloat(extra[0], null);
    233233          int arrayIndex = extra.length > 1 ? Values.getInt(extra[1], 1) : 1;
    234           creationEvent.addSource(le, usedQuantity);
    235           creationEvent.setSourceGroup(le, arrayIndex);
     234          creationEvent.addSource(e, usedQuantity);
     235          creationEvent.setSourceGroup(e, arrayIndex);
    236236        }
    237237      }
    238       String[] removedLabeledExtracts = Values.getString(request.getParameter("removedLabeledExtracts")).split(",");
    239       for (int i = 0; i < removedLabeledExtracts.length; ++i)
     238      String[] removedExtracts = Values.getString(request.getParameter("removedExtracts")).split(",");
     239      for (int i = 0; i < removedExtracts.length; ++i)
    240240      {
    241         int leId = Values.getInt(removedLabeledExtracts[i], -1);
    242         if (leId != -1) creationEvent.removeSource(Extract.getById(dc, leId));
     241        int extractId = Values.getInt(removedExtracts[i], -1);
     242        if (extractId != -1) creationEvent.removeSource(Extract.getById(dc, extractId));
    243243      }
    244244     
    245245      // Annotations tab
    246       Base.updateAnnotations(dc, hyb, hyb, request);
     246      Base.updateAnnotations(dc, pba, pba, request);
    247247     
    248248      // OnSave extensions
     
    354354    // Run an export plugin in a list context
    355355    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
    356     final ItemQuery<Hybridization> query = Hybridization.getQuery();
     356    final ItemQuery<PhysicalBioAssay> query = PhysicalBioAssay.getQuery();
    357357    registerExportUtils(cc);
    358358    dc = sc.newDbControl();
     
    360360    dc.close();
    361361    cc.setQuery(query);
    362     redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Export+hybridizations";
     362    redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Export+physical+bioassays";
    363363  }
    364364  else if ("ExportItem".equals(cmd))
     
    367367    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
    368368    registerExportUtils(cc);
    369     redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Export+hybridization";
     369    redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Export+physical+bioassay";
    370370  }
    371371  else if ("ImportItems".equals(cmd))
     
    373373    // Run an import plugin in a list context
    374374    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
    375     final ItemQuery<Hybridization> query = Hybridization.getQuery();
     375    final ItemQuery<PhysicalBioAssay> query = PhysicalBioAssay.getQuery();
    376376    dc = sc.newDbControl();
    377377    cc.configureQuery(dc, query, true);
    378378    dc.close();
    379379    cc.setQuery(query);
    380     redirect = "../../common/import/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Import+hybrydizations";
     380    redirect = "../../common/import/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Import+physical+bioassays";
    381381  }
    382382  else if ("ImportItem".equals(cmd))
     
    384384    // Run an import plugin in single-item context
    385385    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
    386     redirect = "../../common/import/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Import+hybridization";
     386    redirect = "../../common/import/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Import+physical+bioassay";
    387387  }
    388388  else if ("RunListPlugin".equals(cmd))
     
    390390    // Run another plugin in a list context
    391391    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
    392     final ItemQuery<Hybridization> query = Hybridization.getQuery();
     392    final ItemQuery<PhysicalBioAssay> query = PhysicalBioAssay.getQuery();
    393393    dc = sc.newDbControl();
    394394    cc.configureQuery(dc, query, true);
  • trunk/www/views/physicalbioassays/list_bioassays.jsp

    r5641 r5642  
    2828  import="net.sf.basedb.core.DbControl"
    2929  import="net.sf.basedb.core.Item"
    30   import="net.sf.basedb.core.Hybridization"
     30  import="net.sf.basedb.core.PhysicalBioAssay"
    3131  import="net.sf.basedb.core.Extract"
    3232  import="net.sf.basedb.core.Tag"
     
    7676<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
    7777<%!
    78   private static final Item itemType = Item.HYBRIDIZATION;
     78  private static final Item itemType = Item.PHYSICALBIOASSAY;
    7979  private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST);
    8080%>
     
    8787final ModeInfo mode = ModeInfo.get(request.getParameter("mode"));
    8888final String callback = request.getParameter("callback");
    89 final String title = mode.generateTitle("hybridization", "hybridizations");
     89final String title = mode.generateTitle("physical bioassay", "physical bioassays");
    9090final DbControl dc = sc.newDbControl();
    91 ItemResultIterator<Hybridization> hybridizations = null;
     91ItemResultIterator<PhysicalBioAssay> bioAssays = null;
    9292ItemResultList<AnnotationType> annotationTypes = null;
    9393try
     
    9595  final ItemQuery<AnnotationType> annotationTypeQuery = Base.getAnnotationTypesQuery(itemType);
    9696
    97   // Query for labeled extracts relatated to the current hybridization
    98   final ItemQuery<Extract> labeledExtractQuery = Extract.getQuery();
    99   labeledExtractQuery.include(cc.getInclude());
    100   labeledExtractQuery.join(Hql.innerJoin("sourceEvents", "srcevt"));
    101   labeledExtractQuery.join(Hql.innerJoin("srcevt", "event", "evt"));
    102   labeledExtractQuery.restrict(Restrictions.eq(Hql.property("evt", "hybridization"), Expressions.parameter("hybridization")));
    103   labeledExtractQuery.order(Orders.asc(Hql.property("srcevt", "sourceGroup")));
    104   labeledExtractQuery.order(Orders.asc(Hql.property("name")));
     97  // Query for extracts relatated to the current bioassay
     98  final ItemQuery<Extract> extractQuery = Extract.getQuery();
     99  extractQuery.include(cc.getInclude());
     100  extractQuery.join(Hql.innerJoin("sourceEvents", "srcevt"));
     101  extractQuery.join(Hql.innerJoin("srcevt", "event", "evt"));
     102  extractQuery.restrict(Restrictions.eq(Hql.property("evt", "physicalBioAssay"), Expressions.parameter("bioAssay")));
     103  extractQuery.order(Orders.asc(Hql.property("srcevt", "sourceGroup")));
     104  extractQuery.order(Orders.asc(Hql.property("name")));
    105105
    106106  // Query for scans relatated to the current hybridization
     
    115115  try
    116116  {
    117     final ItemQuery<Hybridization> query = Base.getConfiguredQuery(dc, cc, true, Hybridization.getQuery(), mode);
    118     hybridizations = query.iterate(dc);
     117    final ItemQuery<PhysicalBioAssay> query = Base.getConfiguredQuery(dc, cc, true, PhysicalBioAssay.getQuery(), mode);
     118    bioAssays = query.iterate(dc);
    119119  }
    120120  catch (Throwable t)
     
    128128  ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext);
    129129  %>
    130   <base:page title="<%=title==null ? "Hybridizations" : title%>" type="<%=mode.getPageType()%>">
     130  <base:page title="<%=title==null ? "Physical bioassays" : title%>" type="<%=mode.getPageType()%>">
    131131  <base:head scripts="menu.js,table.js" styles="menu.css,table.css">
    132132    <ext:scripts context="<%=jspContext%>" />
     
    134134    <script language="JavaScript">
    135135    var submitPage = 'index.jsp';
    136     var formId = 'hybridizations';
     136    var formId = 'bioassays';
    137137    function newItem()
    138138    {
     
    185185    function shareItem(itemId)
    186186    {
    187       Main.openPopup('index.jsp?ID=<%=ID%>&cmd=ShareItem&item_id='+itemId, 'ShareHybridizations', 600, 400);
     187      Main.openPopup('index.jsp?ID=<%=ID%>&cmd=ShareItem&item_id='+itemId, 'ShareItem', 600, 400);
    188188    }
    189189    function shareItems()
     
    226226    %>
    227227    <tbl:table
    228       id="hybridizations"
     228      id="bioassays"
    229229      clazz="itemlist"
    230230      columns="<%=cc.getSetting("columns")%>"
     
    266266      />
    267267      <tbl:columndef
    268         id="numArrays"
    269         property="numArrays"
     268        id="size"
     269        property="size"
    270270        datatype="int"
    271         title="Arrays/slide"
     271        title="Size"
    272272        sortable="true"
    273273        filterable="true"
     
    275275      />
    276276      <tbl:columndef
    277         id="labeledExtracts"
    278         title="Labeled extracts"
     277        id="extracts"
     278        title="Extracts"
    279279        property="&creationEvent.sourceBioMaterials(name)"
    280280        datatype="string"
     
    312312      />
    313313      <tbl:columndef
    314         id="hybStation"
     314        id="hardware"
    315315        property="creationEvent.hardware"
    316316        datatype="string"
     
    409409          onclick="newItem()"
    410410          title="New&hellip;"
    411           tooltip="<%=createPermission ? "Create new hybridization" : "You do not have permission to create hybridizations"%>"
     411          tooltip="<%=createPermission ? "Create new physical bioassay" : "You do not have permission to create physical bioassays"%>"
    412412        />
    413413        <tbl:button
     
    468468        page="<%=cc.getPage()%>"
    469469        rowsperpage="<%=cc.getRowsPerPage()%>"
    470         totalrows="<%=hybridizations == null ? 0 : hybridizations.getTotalCount()%>"
     470        totalrows="<%=bioAssays == null ? 0 : bioAssays.getTotalCount()%>"
    471471        visible="<%=mode.hasNavigator()%>"
    472472      />
     
    507507          int index = cc.getPage()*cc.getRowsPerPage();
    508508          int selectedItemId = cc.getId();
    509           if (hybridizations != null)
     509          if (bioAssays != null)
    510510          {           
    511             while (hybridizations.hasNext())
     511            while (bioAssays.hasNext())
    512512            {
    513               Hybridization item = hybridizations.next();
     513              PhysicalBioAssay item = bioAssays.next();
    514514              BioMaterialEvent creationEvent = item.getCreationEvent();
    515515              int itemId = item.getId();
     
    568568                  title="<%=tooltip%>"><%=name%></div></tbl:cell>
    569569                <tbl:cell column="id"><%=item.getId()%></tbl:cell>
    570                 <tbl:cell column="numArrays"><%=item.getNumArrays()%></tbl:cell>
    571                 <tbl:cell column="labeledExtracts">
     570                <tbl:cell column="size"><%=item.getSize()%></tbl:cell>
     571                <tbl:cell column="extracts">
    572572                  <%
    573                   labeledExtractQuery.setParameter("hybridization", itemId, Type.INT);
     573                  extractQuery.setParameter("bioAssay", itemId, Type.INT);
    574574                  try
    575575                  {
    576576                    String separator = "";
    577                     boolean isMultiArrayHyb = item.getNumArrays() > 1;
    578                     for (Extract le : labeledExtractQuery.list(dc))
     577                    boolean needIndex = item.getSize() > 1;
     578                    for (Extract extract : extractQuery.list(dc))
    579579                    {
    580                       Tag label = null;
    581                       boolean readLabel = true;
     580                      Tag tag = null;
     581                      boolean readTag = true;
    582582                      try
    583583                      {
    584                         label = le.getTag();
     584                        tag = extract.getTag();
    585585                      }
    586586                      catch (PermissionDeniedException ex)
    587587                      {
    588                         readLabel = false;
     588                        readTag = false;
    589589                      }
    590590                      out.write(separator);
    591                       if (isMultiArrayHyb)
     591                      if (needIndex)
    592592                      {
    593                         out.write(creationEvent.getSourceGroup(le) + ": ");
     593                        out.write(creationEvent.getSourceGroup(extract) + ": ");
    594594                      }
    595595                      if (mode.hasPropertyLink())
    596596                      {
    597                         out.write(Base.getLinkedName(ID, le, false, mode.hasEditLink()));
    598                         out.write(" (" + Base.getLinkedName(ID, label, !readLabel, mode.hasEditLink()) + ")");
     597                        out.write(Base.getLinkedName(ID, extract, false, mode.hasEditLink()));
     598                        out.write(" (" + Base.getLinkedName(ID, tag, !readTag, mode.hasEditLink()) + ")");
    599599                      }
    600600                      else
    601601                      {
    602                         out.write(HTML.encodeTags(le.getName()));
    603                         out.write(" (" + Base.getEncodedName(label, !readLabel) + ")");
     602                        out.write(HTML.encodeTags(extract.getName()));
     603                        out.write(" (" + Base.getEncodedName(tag, !readTag) + ")");
    604604                      }
    605605                      separator = ", ";
     
    662662                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
    663663                  /></tbl:cell>
    664                 <tbl:cell column="hybStation"
     664                <tbl:cell column="hardware"
    665665                  ><base:propertyvalue
    666666                    item="<%=creationEvent%>"
     
    732732      {
    733733        %>
    734         <tbl:panel><%=hybridizations == null || hybridizations.getTotalCount() == 0 ? "No hybridizations were found" : "No hybridizations on this page. Please select another page!" %></tbl:panel>
     734        <tbl:panel><%=bioAssays == null || bioAssays.getTotalCount() == 0 ? "No physical bioassays were found" : "No physical bioassays on this page. Please select another page!" %></tbl:panel>
    735735        <%
    736736      }
     
    741741          page="<%=cc.getPage()%>"
    742742          rowsperpage="<%=cc.getRowsPerPage()%>"
    743           totalrows="<%=hybridizations == null ? 0 : hybridizations.getTotalCount()%>"
     743          totalrows="<%=bioAssays == null ? 0 : bioAssays.getTotalCount()%>"
    744744          visible="<%=mode.hasNavigator()%>"
    745745          locked="true"
     
    761761finally
    762762{
    763   if (hybridizations != null) hybridizations.close();
     763  if (bioAssays != null) bioAssays.close();
    764764  if (dc != null) dc.close();
    765765}
  • trunk/www/views/physicalbioassays/view_bioassay.jsp

    r5641 r5642  
    3333  import="net.sf.basedb.core.AnnotationType"
    3434  import="net.sf.basedb.core.AnnotationSet"
    35   import="net.sf.basedb.core.Hybridization"
     35  import="net.sf.basedb.core.PhysicalBioAssay"
    3636  import="net.sf.basedb.core.ArraySlide"
    3737  import="net.sf.basedb.core.BioMaterialEvent"
     
    7979<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
    8080<%!
    81   private static final Item itemType = Item.HYBRIDIZATION;
     81  private static final Item itemType = Item.PHYSICALBIOASSAY;
    8282  private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.ITEM);
    8383%>
     
    9696
    9797  String title = null;
    98   Hybridization hyb = Hybridization.getById(dc, itemId);
    99   BioMaterialEvent creationEvent = hyb.getCreationEvent();
     98  PhysicalBioAssay pba = PhysicalBioAssay.getById(dc, itemId);
     99  BioMaterialEvent creationEvent = pba.getCreationEvent();
    100100 
    101   final boolean usePermission = hyb.hasPermission(Permission.USE);
    102   final boolean writePermission = hyb.hasPermission(Permission.WRITE);
    103   final boolean deletePermission = hyb.hasPermission(Permission.DELETE);
    104   final boolean sharePermission = hyb.hasPermission(Permission.SET_PERMISSION);
    105   final boolean setOwnerPermission = hyb.hasPermission(Permission.SET_OWNER);
    106   final boolean isRemoved = hyb.isRemoved();
    107   final boolean isUsed = isRemoved && hyb.isUsed();
     101  final boolean usePermission = pba.hasPermission(Permission.USE);
     102  final boolean writePermission = pba.hasPermission(Permission.WRITE);
     103  final boolean deletePermission = pba.hasPermission(Permission.DELETE);
     104  final boolean sharePermission = pba.hasPermission(Permission.SET_PERMISSION);
     105  final boolean setOwnerPermission = pba.hasPermission(Permission.SET_OWNER);
     106  final boolean isRemoved = pba.isRemoved();
     107  final boolean isUsed = isRemoved && pba.isUsed();
    108108  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    109   final boolean isOwner = hyb.isOwner();
    110   JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, hyb);
     109  final boolean isOwner = pba.isOwner();
     110  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, pba);
    111111  ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext);
    112112  %>
     
    122122    function shareItem()
    123123    {
    124       Main.openPopup('index.jsp?ID=<%=ID%>&cmd=ShareItem&item_id=<%=itemId%>', 'ShareHybridization', 600, 400);
     124      Main.openPopup('index.jsp?ID=<%=ID%>&cmd=ShareItem&item_id=<%=itemId%>', 'SharePhysicalBioAssay', 600, 400);
    125125    }
    126126    function deleteItem()
     
    174174    <p>
    175175    <p:path>
    176       <p:pathelement title="Hybridizations" href="<%="index.jsp?ID="+ID%>" />
    177       <p:pathelement title="<%=HTML.encodeTags(hyb.getName())%>" />
     176      <p:pathelement title="Physical bioassays" href="<%="index.jsp?ID="+ID%>" />
     177      <p:pathelement title="<%=HTML.encodeTags(pba.getName())%>" />
    178178    </p:path>
    179179    <t:tabcontrol id="main" active="<%=tab%>" switch="switchTab" remember="false">
     
    187187        onclick="editItem()"
    188188        title="Edit&hellip;"
    189         tooltip="<%=writePermission ? "Edit this hybridization" : "You do not have permission to edit this hybridization"%>"
     189        tooltip="<%=writePermission ? "Edit this physical bioassay" : "You do not have permission to edit this physical bioassay"%>"
    190190      />
    191191      <tbl:button
     
    194194        onclick="deleteItem()"
    195195        title="Delete"
    196         visible="<%=!hyb.isRemoved()%>"
    197         tooltip="<%=deletePermission ? "Delete this hybridization" : "You do not have permission to delete this hybridization"%>"
     196        visible="<%=!pba.isRemoved()%>"
     197        tooltip="<%=deletePermission ? "Delete this physical bioassay" : "You do not have permission to delete this physical bioassay"%>"
    198198      />
    199199      <tbl:button
     
    202202        onclick="restoreItem()"
    203203        title="Restore"
    204         visible="<%=hyb.isRemoved()%>"
    205         tooltip="<%=writePermission ? "Restore this hybridization" : "You do not have permission to restore this hybridization"%>"
     204        visible="<%=pba.isRemoved()%>"
     205        tooltip="<%=writePermission ? "Restore this physical bioassay" : "You do not have permission to restore this physical bioassay"%>"
    206206      />
    207207      <tbl:button
     
    210210        onclick="shareItem()"
    211211        title="Share&hellip;"
    212         tooltip="<%=sharePermission ? "Share this hybridization to other user, groups and projects" : "You do not have permission to share this hybridization"%>"
     212        tooltip="<%=sharePermission ? "Share this physical bioassay to other user, groups and projects" : "You do not have permission to share this physical bioassay"%>"
    213213      />
    214214      <tbl:button
     
    251251      <tbl:button
    252252        image="help.gif"
    253         onclick="<%="Main.openHelp('" + ID +"', 'hybridization.view.properties')"%>"
     253        onclick="<%="Main.openHelp('" + ID +"', 'physicalbioassay.view.properties')"%>"
    254254        title="Help&hellip;"
    255255        tooltip="Get help about this page"
     
    257257      </tbl:toolbar>
    258258    <div class="boxedbottom">
    259       <div class="itemstatus">Permissions on this item: <i><%=PermissionUtil.getFullPermissionNames(hyb)%></i></div>
     259      <div class="itemstatus">Permissions on this item: <i><%=PermissionUtil.getFullPermissionNames(pba)%></i></div>
    260260      <%
    261       if (hyb.isRemoved() || hyb.isShared())
     261      if (pba.isRemoved() || pba.isShared())
    262262      {
    263263        %>
     
    273273            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    274274          <base:icon image="shared.gif"
    275             visible="<%=hyb.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
     275            visible="<%=pba.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
    276276        </div>
    277277        <%
     
    281281      <tr>
    282282        <td class="prompt">Name</td>
    283         <td><%=HTML.encodeTags(hyb.getName())%></td>
    284       </tr>
    285       <tr>
    286         <td class="prompt">Arrays</td>
    287         <td><%=hyb.getNumArrays()%></td>
     283        <td><%=HTML.encodeTags(pba.getName())%></td>
     284      </tr>
     285      <tr>
     286        <td class="prompt">Size</td>
     287        <td><%=pba.getSize()%></td>
    288288      </tr>
    289289      <tr>
    290290        <td class="prompt">Array slide</td>
    291         <td><base:propertyvalue item="<%=hyb%>" property="arraySlide" /></td>
     291        <td><base:propertyvalue item="<%=pba%>" property="arraySlide" /></td>
    292292      </tr>
    293293      <tr>
    294294        <td class="subprompt">-barcode</td>
    295         <td><base:propertyvalue item="<%=hyb%>" property="arraySlide.barcode" /></td>
     295        <td><base:propertyvalue item="<%=pba%>" property="arraySlide.barcode" /></td>
    296296      </tr>
    297297      <tr>
     
    313313      <tr>
    314314        <td class="prompt">Owner</td>
    315         <td><base:propertyvalue item="<%=hyb%>" property="owner" /></td>
     315        <td><base:propertyvalue item="<%=pba%>" property="owner" /></td>
    316316      </tr>
    317317      <tr>
    318318        <td class="prompt">Description</td>
    319         <td><%=HTML.niceFormat(hyb.getDescription())%></td>
     319        <td><%=HTML.niceFormat(pba.getDescription())%></td>
    320320      </tr>
    321321      </table>
    322322     
    323323      <%
    324       ItemQuery<Extract> labeledExtractsQuery = (ItemQuery<Extract>)creationEvent.getSources();
    325       labeledExtractsQuery.include(Include.ALL);
    326       labeledExtractsQuery.order(Orders.asc(Hql.property("srcevt", "sourceGroup")));
    327       labeledExtractsQuery.order(Orders.asc(Hql.property("name")));
    328       ItemResultList<Extract> labeledExtracts = labeledExtractsQuery.list(dc);
    329       if (labeledExtracts.size() == 0)
    330       {
    331         %>
    332         <h4>Labeled extracts</h4>
    333         No labeled extracts has been added to this hybridization
     324      ItemQuery<Extract> extractsQuery = (ItemQuery<Extract>)creationEvent.getSources();
     325      extractsQuery.include(Include.ALL);
     326      extractsQuery.order(Orders.asc(Hql.property("srcevt", "sourceGroup")));
     327      extractsQuery.order(Orders.asc(Hql.property("name")));
     328      ItemResultList<Extract> extracts = extractsQuery.list(dc);
     329      if (extracts.size() == 0)
     330      {
     331        %>
     332        <h4>Extracts</h4>
     333        No extracts has been added to this physical bioassay
    334334        (or, you don't have permission to view them).
    335335        <%
     
    339339        %>
    340340        <base:section
    341           id="labeledExtractSection"
    342           title="<%="Labeled extracts (" + labeledExtracts.size() + ")"%>"
     341          id="extractSection"
     342          title="<%="Extracts (" + extracts.size() + ")"%>"
    343343          context="<%=cc%>"
    344344          >
    345345          <tbl:table
    346             id="labeledextracts"
     346            id="extracts"
    347347            clazz="itemlist"
    348348            columns="all"
    349349            >
    350350          <tbl:columndef
    351             id="arrayNum"
    352             title="Array"
    353             show="<%=hyb.getNumArrays() > 1 ? "always" : "never"%>"
     351            id="position"
     352            title="Position"
     353            show="<%=pba.getSize() > 1 ? "always" : "never"%>"
    354354          />
    355355          <tbl:columndef
     
    358358          />
    359359          <tbl:columndef
    360             id="label"
    361             title="Label"
     360            id="tag"
     361            title="Tag"
    362362          />
    363363          <tbl:columndef
     
    374374            <tbl:rows>
    375375            <%
    376             for (Extract item : labeledExtracts)
     376            for (Extract item : extracts)
    377377            {
    378378              %>
    379379              <tbl:row>
    380                 <tbl:cell column="arrayNum"><%=creationEvent.getSourceGroup(item)%></tbl:cell>
     380                <tbl:cell column="position"><%=creationEvent.getSourceGroup(item)%></tbl:cell>
    381381                <tbl:cell column="name"><base:icon
    382382                    image="deleted.gif"
     
    384384                    visible="<%=item.isRemoved()%>"
    385385                  /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell>
    386                 <tbl:cell column="label"><base:propertyvalue item="<%=item%>" property="tag" /></tbl:cell>
     386                <tbl:cell column="tag"><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>
     
    400400     
    401401      <%
    402       ItemQuery<Scan> scanQuery = (ItemQuery<Scan>)hyb.getScans();
     402      ItemQuery<Scan> scanQuery = (ItemQuery<Scan>)pba.getScans();
    403403      scanQuery.include(Include.ALL);
    404404      scanQuery.order(Orders.asc(Hql.property("name")));
     
    469469        <jsp:param name="item_type" value="<%=itemType.name()%>" />
    470470        <jsp:param name="item_id" value="<%=itemId%>" />
    471         <jsp:param name="title" value="Other items related to this hybridization" />
     471        <jsp:param name="title" value="Other items related to this physical bioassay" />
    472472      </jsp:include>
    473473      <%
    474474      // Tables with users/groups/projects that this item is shared to
    475       MultiPermissions mp = new MultiPermissions(Collections.singleton(hyb));
     475      MultiPermissions mp = new MultiPermissions(Collections.singleton(pba));
    476476      ItemResultList<User> users = mp.getUsers().list(dc);
    477477      ItemResultList<Group> groups = mp.getGroups().list(dc);
  • trunk/www/views/scans/edit_scan.jsp

    r5630 r5642  
    3434  import="net.sf.basedb.core.Permission"
    3535  import="net.sf.basedb.core.Scan"
    36   import="net.sf.basedb.core.Hybridization"
     36  import="net.sf.basedb.core.PhysicalBioAssay"
    3737  import="net.sf.basedb.core.Protocol"
    3838  import="net.sf.basedb.core.Project"
     
    7171 
    7272  boolean readCurrentHybridization = true;
    73   Hybridization currentHybridization = null;
     73  PhysicalBioAssay currentHybridization = null;
    7474  boolean readCurrentProtocol = true;
    7575  Protocol currentProtocol = null; 
     
    8282  List<Protocol> recentProtocols = (List<Protocol>)cc.getRecent(dc, Item.PROTOCOL);
    8383  List<Hardware> recentScanners = (List<Hardware>)cc.getRecent(dc, Item.HARDWARE);
    84   List<Hybridization> recentHybridizations = (List<Hybridization>)cc.getRecent(dc, Item.HYBRIDIZATION);
     84  List<PhysicalBioAssay> recentHybridizations = (List<PhysicalBioAssay>)cc.getRecent(dc, Item.PHYSICALBIOASSAY);
    8585
    8686  int activeProjectId = sc.getActiveProjectId();
     
    120120    if (hybridizationId != 0)
    121121    {
    122       currentHybridization = Hybridization.getById(dc, hybridizationId);
     122      currentHybridization = PhysicalBioAssay.getById(dc, hybridizationId);
    123123    }
    124124    else if (cc.getPropertyFilter("hybridization.name") != null)
    125125    {
    126       currentHybridization = Base.getFirstMatching(dc, Hybridization.getQuery(), "name", cc.getPropertyFilter("hybridization.name"));
     126      currentHybridization = Base.getFirstMatching(dc, PhysicalBioAssay.getQuery(), "name", cc.getPropertyFilter("hybridization.name"));
    127127    }
    128128     
     
    257257      var parents = new Array();
    258258      var hybridizationId = Math.abs(parseInt(frm.hybridization_id[frm.hybridization_id.selectedIndex].value));
    259       if (hybridizationId > 0) parents[parents.length] = 'HYBRIDIZATION:'+hybridizationId;
     259      if (hybridizationId > 0) parents[parents.length] = 'PHYSICALBIOASSAY:'+hybridizationId;
    260260      return parents;
    261261    }
     
    324324    {
    325325      var frm = document.forms['scan'];
    326       var url = '../hybridizations/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setHybridizationCallback';
     326      var url = '../physicalbioassays/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setHybridizationCallback';
    327327      if (frm.hybridization_id.length > 0)
    328328      {
  • trunk/www/views/scans/index.jsp

    r5590 r5642  
    3030  import="net.sf.basedb.core.Include"
    3131  import="net.sf.basedb.core.Scan"
    32   import="net.sf.basedb.core.Hybridization"
     32  import="net.sf.basedb.core.PhysicalBioAssay"
    3333  import="net.sf.basedb.core.Protocol"
    3434  import="net.sf.basedb.core.Hardware"
     
    162162    if (scan == null)
    163163    {
    164       scan = Scan.getNew(dc, Hybridization.getById(dc, hybridizationId));
     164      scan = Scan.getNew(dc, PhysicalBioAssay.getById(dc, hybridizationId));
    165165      message = "Scan created";
    166166      dc.saveItem(scan);
     
    193193      if (hybridizationId >= 0) // < 0 = denied or unchanged
    194194      {
    195         Hybridization hyb = hybridizationId == 0 ? null : Hybridization.getById(dc, hybridizationId);
     195        PhysicalBioAssay hyb = hybridizationId == 0 ? null : PhysicalBioAssay.getById(dc, hybridizationId);
    196196        scan.setHybridization(hyb);
    197197        if (hyb != null) cc.setRecent(hyb, maxRecent);
  • trunk/www/views/scans/view_scan.jsp

    r5502 r5642  
    3737  import="net.sf.basedb.core.Protocol"
    3838  import="net.sf.basedb.core.Hardware"
    39   import="net.sf.basedb.core.Hybridization"
     39  import="net.sf.basedb.core.PhysicalBioAssay"
    4040  import="net.sf.basedb.core.User"
    4141  import="net.sf.basedb.core.Group"
     
    291291      </tr>
    292292      <tr>
    293         <td class="prompt">Hybridization</td>
     293        <td class="prompt">Physical bioassay</td>
    294294        <td><base:propertyvalue item="<%=scan%>" property="hybridization" /></td>
    295295      </tr>
Note: See TracChangeset for help on using the changeset viewer.