Changeset 5685


Ignore:
Timestamp:
Aug 4, 2011, 12:58:23 PM (10 years ago)
Author:
Nicklas Nordborg
Message:

References #1153: Handling short read transcript sequence data

Simplified the design by only keeping DerivedBioAssay between PhysicalBioAssay and RawBioAssay. This should make batch importer, validation, etc. easier to implement and also provides the better backwards compatibility with array experiments. The web gui is usable but may need improvements in some cases.

Location:
trunk
Files:
2 added
4 deleted
41 edited
3 copied
5 moved

Legend:

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

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

    r5652 r5685  
    6363      Item.PLATEGEOMETRY, Item.PLATEMAPPING,
    6464      Item.DIRECTORY, Item.FILE, Item.FILESERVER, Item.PROJECT, Item.PERMISSIONTEMPLATE,
    65       Item.PHYSICALBIOASSAY, Item.DERIVEDBIOASSAYSET, Item.RAWBIOASSAY,
     65      Item.PHYSICALBIOASSAY, Item.DERIVEDBIOASSAY, 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

    r5652 r5685  
    6060      Item.RAWBIOASSAY, Item.RAWDATA, Item.FORMULA,
    6161      Item.REPORTER, Item.REPORTERLIST, Item.REPORTERSCORE,
    62       Item.DERIVEDBIOASSAYSET, Item.PHYSICALBIOASSAY,
     62      Item.DERIVEDBIOASSAY, 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

    r5652 r5685  
    8484item.physicalbioassay Physical bioassay
    8585item.physicalbioassay+  Physical bioassays
    86 item.derivedbioassayset Derived bioassay set
    87 item.derivedbioassayset+  Derived bioassay sets
    8886item.derivedbioassay  Derived bioassay
    8987item.derivedbioassay+ Derived bioassays
  • trunk/src/clients/web/net/sf/basedb/clients/web/resources/menu.properties

    r5652 r5685  
    8787physicalbioassays.tooltip.1 Manage physical bioassays
    8888physicalbioassays.tooltip.0 You do not have permission to manage physical bioassays
     89derivedbioassays.tooltip.1    Manage derived bioassays
     90derivedbioassays.tooltip.0    You do not have permission to manage derived bioassays
    8991rawbioassays.tooltip.1  Manage raw bioassays
    9092rawbioassays.tooltip.0  You do not have permission to manage raw bioassays
  • trunk/src/core/common-queries.xml

    r5663 r5685  
    855855  </query>
    856856
    857   <query id="GET_DERIVEDBIOASSAYSET_FOR_PROTOCOL" type="HQL">
    858     <sql>
    859       SELECT {1}
    860       FROM DerivedBioAssaySetData dbas
    861       WHERE dbas.protocol = :protocol
    862     </sql>
    863     <description>
    864       A Hibernate query that gets derived bioassay sets
     857  <query id="GET_DERIVEDBIOASSAY_FOR_PROTOCOL" type="HQL">
     858    <sql>
     859      SELECT {1}
     860      FROM DerivedBioAssayData dba
     861      WHERE dba.protocol = :protocol
     862    </sql>
     863    <description>
     864      A Hibernate query that gets derived bioassays
    865865      using a protocol.
    866866    </description>
     
    917917  </query>
    918918 
    919   <query id="GET_DERIVEDBIOASSAYSETS_FOR_HARDWARE" type="HQL">
     919  <query id="GET_DERIVEDBIOASSAYS_FOR_HARDWARE" type="HQL">
    920920    <sql>
    921921        SELECT {1}
    922         FROM DerivedBioAssaySetData dbas
    923         WHERE dbas.hardware = :hardware
     922        FROM DerivedBioAssayData dba
     923        WHERE dba.hardware = :hardware
    924924    </sql>
    925925    <description>
     
    10001000  </query>
    10011001
    1002   <query id="GET_DERIVEDBIOASSAYSETS_FOR_SOFTWARE" type="HQL">
    1003     <sql>
    1004       SELECT {1}
    1005       FROM DerivedBioAssaySetData dbas
    1006       WHERE dbas.software = :software
    1007     </sql>
    1008     <description>
    1009       A Hibernate query that gets the derived bioassay sets
     1002  <query id="GET_DERIVEDBIOASSAYS_FOR_SOFTWARE" type="HQL">
     1003    <sql>
     1004      SELECT {1}
     1005      FROM DerivedBioAssayData dba
     1006      WHERE dba.software = :software
     1007    </sql>
     1008    <description>
     1009      A Hibernate query that gets the derived bioassay
    10101010      using a given software.
    10111011    </description>
     
    13691369  </query>
    13701370
    1371   <query id="GET_ROOT_DERIVEDBIOASSAYSETS_FOR_PHYSICALBIOASSAY" type="HQL">
    1372     <sql>
    1373       SELECT {1}
    1374       FROM DerivedBioAssaySetData dbs
    1375       WHERE dbs.physicalBioAssay = :bioAssay
    1376       AND dbs.parent is null
    1377     </sql>
    1378     <description>
    1379       A Hibernate query that gets root derived bioassay sets
    1380       created for a specific physical bioassay.
    1381     </description>
    1382   </query>
    1383 
    1384   <query id="GET_RAWBIOASSAYS_FOR_SCAN" type="HQL">
     1371  <query id="GET_ROOT_DERIVEDBIOASSAYS_FOR_PHYSICALBIOASSAY" type="HQL">
     1372    <sql>
     1373      SELECT {1}
     1374      FROM DerivedBioAssayData dba
     1375      WHERE dba.physicalBioAssay = :bioAssay
     1376      AND dba.parent is null
     1377    </sql>
     1378    <description>
     1379      A Hibernate query that gets root derived bioassays
     1380      created from a specific physical bioassay.
     1381    </description>
     1382  </query>
     1383
     1384  <query id="GET_RAWBIOASSAYS_FOR_DERIVEDBIOASSAY" type="HQL">
    13851385    <sql>
    13861386      SELECT {1}
    13871387      FROM RawBioAssayData rba
    1388       WHERE rba.scan = :scan
     1388      WHERE rba.parentBioAssay = :bioAssay
    13891389    </sql>
    13901390    <description>
    13911391      A Hibernate query that gets raw bioassays
    1392       created from a specific scan.
    1393     </description>
    1394   </query>
    1395 
    1396   <query id="GET_IMAGES_FOR_SCAN" type="HQL">
    1397     <sql>
    1398       SELECT {1}
    1399       FROM ImageData img
    1400       WHERE img.scan = :scan
    1401     </sql>
    1402     <description>
    1403       A Hibernate query that gets images
    1404       created from a specific scan.
     1392      created from a specific derived bioassay.
    14051393    </description>
    14061394  </query>
  • trunk/src/core/net/sf/basedb/core/DerivedBioAssay.java

    r5684 r5685  
    2727import java.util.Set;
    2828
    29 import net.sf.basedb.core.data.DerivedBioAssaySetData;
     29import net.sf.basedb.core.data.ArrayBatchData;
     30import net.sf.basedb.core.data.ArraySlideData;
     31import net.sf.basedb.core.data.DerivedBioAssayData;
    3032import net.sf.basedb.core.data.HardwareData;
     33import net.sf.basedb.core.data.PhysicalBioAssayData;
    3134import net.sf.basedb.core.data.ProtocolData;
    3235import net.sf.basedb.core.data.SoftwareData;
     
    4043  @base.modified $Date$
    4144*/
    42 public class DerivedBioAssaySet
    43   extends AnnotatedItem<DerivedBioAssaySetData>
     45public class DerivedBioAssay
     46  extends AnnotatedItem<DerivedBioAssayData>
    4447  implements Registered, FileStoreEnabled, Subtypable
    4548{
     
    4750  /**
    4851    The type of item represented by this class.
    49     @see Item#DERIVEDBIOASSAYSET
     52    @see Item#DERIVEDBIOASSAY
    5053    @see #getType()
    5154  */
    52   public static final Item TYPE = Item.DERIVEDBIOASSAYSET;
    53  
    54   /**
    55     The id for the <code>DerivedBioAssaySetType</code> item representing a
     55  public static final Item TYPE = Item.DERIVEDBIOASSAY;
     56 
     57  /**
     58    The id for the <code>DerivedBioAssayType</code> item representing a
    5659    scanned hybridization.
    5760  */
    58   public static final String SCAN = "net.sf.basedb.core.DerivedBioAssaySetType.SCAN";
    59 
    60  
    61   /**
    62     The id for the <code>DerivedBioAssaySetType</code> item representing
     61  public static final String SCAN = "net.sf.basedb.core.DerivedBioAssayType.SCAN";
     62
     63 
     64  /**
     65    The id for the <code>DerivedBioAssayType</code> item representing
    6366    original sequenced data.
    6467  */
    65   public static final String SEQUENCED = "net.sf.basedb.core.DerivedBioAssaySetType.SEQUENCED";
    66  
    67   /**
    68     The id for the <code>DerivedBioAssaySetType</code> item representing
     68  public static final String SEQUENCED = "net.sf.basedb.core.DerivedBioAssayType.SEQUENCED";
     69 
     70  /**
     71    The id for the <code>DerivedBioAssayType</code> item representing
    6972    sequenced data that has been aligned to a reference database.
    7073  */
    71   public static final String ASSEMBLY = "net.sf.basedb.core.DerivedBioAssaySetType.ASSEMBLY";
    72 
    73  
    74   /**
    75     Get a <code>DerivedBioAssaySet</code> item when you know the id.
     74  public static final String ASSEMBLY = "net.sf.basedb.core.DerivedBioAssayType.ASSEMBLY";
     75
     76 
     77  /**
     78    Get a <code>DerivedBioAssay</code> item when you know the id.
    7679 
    7780    @param dc The <code>DbControl</code> which will be used for
    7881      permission checking and database access.
    7982    @param id The id of the item to load
    80     @return The <code>DerivedBioAssaySet</code> item
     83    @return The <code>DerivedBioAssay</code> item
    8184    @throws ItemNotFoundException If an item with the specified
    8285      id is not found
     
    8588    @throws BaseException If there is another error
    8689  */
    87   public static DerivedBioAssaySet getById(DbControl dc, int id)
     90  public static DerivedBioAssay getById(DbControl dc, int id)
    8891    throws ItemNotFoundException, PermissionDeniedException, BaseException
    8992  {
    90     DerivedBioAssaySet dbas = dc.loadItem(DerivedBioAssaySet.class, id);
    91     if (dbas == null) throw new ItemNotFoundException("DerivedBioAssaySet[id="+id+"]");
     93    DerivedBioAssay dbas = dc.loadItem(DerivedBioAssay.class, id);
     94    if (dbas == null) throw new ItemNotFoundException("DerivedBioAssay[id="+id+"]");
    9295    return dbas;
    9396  }
    9497 
    9598  /**
    96     Create a new (root) derived bioassay set from a physical bioasay.
     99    Create a new (root) derived bioassay from a physical bioassay.
    97100    @param dc The <code>DbControl</code> which will be used for
    98101      permission checking and database access
    99102    @param bioAssay The parent physical bioassay
    100     @return A new DerivedBioAssaySet item
    101   */
    102   public static DerivedBioAssaySet getNew(DbControl dc, PhysicalBioAssay bioAssay)
     103    @return A new DerivedBioAssay item
     104  */
     105  public static DerivedBioAssay getNew(DbControl dc, PhysicalBioAssay bioAssay)
    103106  {
    104107    if (bioAssay == null) throw new InvalidUseOfNullException("bioAssay");
    105108    bioAssay.checkPermission(Permission.USE);
    106109   
    107     DerivedBioAssaySet dbas = dc.newItem(DerivedBioAssaySet.class);
    108     dbas.setName("New derived bioassay set");
     110    DerivedBioAssay dbas = dc.newItem(DerivedBioAssay.class);
     111    dbas.setName("New derived bioassay");
    109112    dbas.getData().setPhysicalBioAssay(bioAssay.getData());
    110113    dbas.getData().setEntryDate(new Date());
     
    113116 
    114117  /**
    115     Create a new child derived bioassay set from a parent bioassay set.
     118    Create a new child derived bioassay from a parent derived bioassay.
    116119    @param dc The <code>DbControl</code> which will be used for
    117120      permission checking and database access
    118     @param parent The parent bioassay set
    119     @return A new DerivedBioAssaySet item
    120   */
    121   public static DerivedBioAssaySet getNew(DbControl dc, DerivedBioAssaySet parent)
     121    @param parent The parent bioassay
     122    @return A new DerivedBioAssay item
     123  */
     124  public static DerivedBioAssay getNew(DbControl dc, DerivedBioAssay parent)
    122125  {
    123126    if (parent == null) throw new InvalidUseOfNullException("parent");
    124127    parent.checkPermission(Permission.USE);
    125128   
    126     DerivedBioAssaySet dbas = dc.newItem(DerivedBioAssaySet.class);
    127     dbas.setName("New derived bioassay set");
     129    DerivedBioAssay dbas = dc.newItem(DerivedBioAssay.class);
     130    dbas.setName("New derived bioassay");
    128131    dbas.getData().setParent(parent.getData());
    129132    dbas.getData().setPhysicalBioAssay(parent.getData().getPhysicalBioAssay());
     133    dbas.getData().setExtract(parent.getData().getExtract());
    130134    dbas.getData().setEntryDate(new Date());
    131135    return dbas;
     
    133137 
    134138  /**
    135     Get a query that returns derived bioassay sets.
     139    Get a query that returns derived bioassay.
    136140    @return An {@link ItemQuery} object
    137141  */
    138   public static ItemQuery<DerivedBioAssaySet> getQuery()
    139   {
    140     return new ItemQuery<DerivedBioAssaySet>(DerivedBioAssaySet.class);
    141   }
    142  
    143   DerivedBioAssaySet(DerivedBioAssaySetData data)
     142  public static ItemQuery<DerivedBioAssay> getQuery()
     143  {
     144    return new ItemQuery<DerivedBioAssay>(DerivedBioAssay.class);
     145  }
     146 
     147  DerivedBioAssay(DerivedBioAssayData data)
    144148  {
    145149    super(data);
     
    252256    try
    253257    {
    254       DerivedBioAssaySet parent = getParent();
     258      DerivedBioAssay parent = getParent();
    255259      if (parent != null)
    256260      {
     
    277281  */
    278282  @Override
    279   @SubtypableRelatedItems({Item.PHYSICALBIOASSAY, Item.DERIVEDBIOASSAYSET, Item.SOFTWARE, Item.HARDWARE, Item.PROTOCOL})
     283  @SubtypableRelatedItems({Item.PHYSICALBIOASSAY, Item.DERIVEDBIOASSAY, Item.SOFTWARE, Item.HARDWARE, Item.PROTOCOL})
    280284  public ItemSubtype getItemSubtype()
    281285  {
     
    362366    @return The parent bioassay set or null if this item is a root bioassay set
    363367  */
    364   public DerivedBioAssaySet getParent()
    365   {
    366     return getDbControl().getItem(DerivedBioAssaySet.class, getData().getParent());
     368  public DerivedBioAssay getParent()
     369  {
     370    return getDbControl().getItem(DerivedBioAssay.class, getData().getParent());
    367371  }
    368372
     
    377381  }
    378382 
    379   public ItemQuery<DerivedBioAssaySet> getChildren()
    380   {
    381     ItemQuery<DerivedBioAssaySet> query = DerivedBioAssaySet.getQuery();
     383  public Extract getExtract()
     384  {
     385    return getDbControl().getItem(Extract.class, getData().getExtract());
     386  }
     387 
     388  public void setExtract(Extract extract)
     389  {
     390    checkPermission(Permission.WRITE);
     391    if (extract != null) extract.checkPermission(Permission.USE);
     392    getData().setExtract(extract == null ? null : extract.getData());
     393  }
     394 
     395  public ItemQuery<DerivedBioAssay> getChildren()
     396  {
     397    ItemQuery<DerivedBioAssay> query = DerivedBioAssay.getQuery();
    382398    query.restrictPermanent(
    383399      Restrictions.eq(
     
    389405  }
    390406
    391   /**
    392     Create a new bioassay that is part of the bioassay set. The
    393     biomaterial is optional. If given, it should be one of the
    394     biomaterials that was part of the physical bioassay that this
    395     bioassay set is derived from. It is only possible to create
    396     one bioassay for each biomaterial.
    397    
    398     @param extract The biomaterial this extract is related to
    399     @return A new child bioassay
    400   */
    401   public DerivedBioAssay newBioAssay(Extract extract)
    402   {
    403     checkPermission(Permission.WRITE);
    404     // TODO - Check if the extract is a source to the parent physical bioassay
    405    
    406     return DerivedBioAssay.getNew(getDbControl(), this, extract);
    407   }
    408  
    409   public ItemQuery<DerivedBioAssay> getBioAssays()
    410   {
    411     ItemQuery<DerivedBioAssay> query = new ItemQuery<DerivedBioAssay>(DerivedBioAssay.class, null);
    412     query.restrictPermanent(
    413       Restrictions.eq(
    414         Hql.property("bioAssaySet"),
    415         Hql.entity(this)
    416       )
    417     );
    418     return query;
    419   }
    420  
    421407  public Job getJob()
    422408  {
     
    495481  }
    496482
     483 
     484  public ItemQuery<RawBioAssay> getRawBioAssays()
     485  {
     486    ItemQuery<RawBioAssay> query = RawBioAssay.getQuery();
     487    query.restrictPermanent(
     488      Restrictions.eq(
     489        Hql.property("parentBioAssay"),
     490        Hql.entity(this)
     491      )
     492    );
     493    return query;
     494  }
     495 
     496  /**
     497    Get the array design connected to this derived bioassay by
     498    following the path from the physical bioassay to the array slide to
     499    the array batch  to the array design.
     500    @return The array design, or null if no array design is connected
     501    @throws PermissionDeniedException If the logged in user doesn't have
     502      read permission for the array design
     503    @throws BaseException If there is another error.
     504  */
     505  public ArrayDesign getArrayDesign()
     506    throws PermissionDeniedException, BaseException
     507  {
     508    PhysicalBioAssayData pba = getData().getPhysicalBioAssay();
     509    if (pba == null) return null;
     510    ArraySlideData slide = pba.getArraySlide();
     511    if (slide == null) return null;
     512    ArrayBatchData batch = slide.getArrayBatch();
     513    if (batch == null) return null;
     514    return getDbControl().getItem(ArrayDesign.class, batch.getArrayDesign());
     515  }
     516
     517  /**
     518    Counts all raw bioassays that have been created from this bioassay. The count
     519    includes raw bioassays that the logged in user doesn't have access to.
     520    @return The number of raw bioassays
     521    @throws BaseException If the raw bioassays couldn't be counted.
     522  */
     523  public long countRawBioAssays()
     524    throws BaseException
     525  {
     526    org.hibernate.Session session = getDbControl().getHibernateSession();
     527    org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session,
     528      "GET_RAWBIOASSAYS_FOR_DERIVEDBIOASSAY", "count(*)");
     529    /*
     530      SELECT {1}
     531      FROM RawBioAssayData rba
     532      WHERE rba.parentBioAssay = :bioAssay
     533    */
     534    query.setEntity("bioAssay", this.getData());
     535    return HibernateUtil.loadData(Long.class, query);
     536  }
     537
    497538}
  • trunk/src/core/net/sf/basedb/core/Hardware.java

    r5652 r5685  
    227227    Check if:
    228228    <ul>
    229     <li>a {@link DerivedBioAssaySet} is linked to this hardware
     229    <li>a {@link DerivedBioAssay} is linked to this hardware
    230230    <li>an {@link ArrayBatch} is linked to this hardware
    231231    <li>a {@link BioMaterialEvent} is linked to this hardware
     
    245245    {
    246246      org.hibernate.Query q = HibernateUtil.getPredefinedQuery(session,
    247         "GET_DERIVEDBIOASSAYSETS_FOR_HARDWARE", "count(*)");
    248       /*
    249         SELECT {1}
    250         FROM DerivedBioAssaySetData dbas
    251         WHERE dbas.hardware = :hardware
     247        "GET_DERIVEDBIOASSAYS_FOR_HARDWARE", "count(*)");
     248      /*
     249        SELECT {1}
     250        FROM DerivedBioAssayData dba
     251        WHERE dba.hardware = :hardware
    252252      */
    253253      q.setEntity("hardware", this.getData());
     
    295295    Get all:
    296296    <ul>
    297     <li>{@link DerivedBioAssaySet}:s with this hardware
     297    <li>{@link DerivedBioAssay}:s with this hardware
    298298    <li>{@link ArrayBatch}:s with this hardware
    299299    <li>{@link BioMaterial}:s and {@link PhysicalBioAssay}:s with this hardware
     
    310310    // Derived bioassay sets
    311311    org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session,
    312       "GET_DERIVEDBIOASSAYSETS_FOR_HARDWARE", "dbas.id");
    313       /*
    314         SELECT {1}
    315         FROM DerivedBioAssaySetData dbas
    316         WHERE dbas.hardware = :hardware
     312      "GET_DERIVEDBIOASSAYS_FOR_HARDWARE", "dba.id");
     313      /*
     314        SELECT {1}
     315        FROM DerivedBioAssayData dba
     316        WHERE dba.hardware = :hardware
    317317      */
    318318    query.setEntity("hardware", this.getData());
    319     addUsingItems(using, Item.DERIVEDBIOASSAYSET, query);
     319    addUsingItems(using, Item.DERIVEDBIOASSAY, query);
    320320
    321321    // Array batches
  • trunk/src/core/net/sf/basedb/core/Install.java

    r5652 r5685  
    368368      // Hybridization, raw data and experiments
    369369      createRoleKey(Item.PHYSICALBIOASSAY, "Physical bioassays", "Gives access to physical bioassays", users_create);
    370       createRoleKey(Item.DERIVEDBIOASSAYSET, "Derived bioassay sets", "Gives access to derived bioassay sets", users_create);
     370      createRoleKey(Item.DERIVEDBIOASSAY, "Derived bioassays", "Gives access to derived bioassays", users_create);
    371371      createRoleKey(Item.RAWBIOASSAY, "Raw bioassays", "Gives access to raw bioassays", users_create);
    372372      createRoleKey(Item.EXPERIMENT, "Experiments", "Gives access to experiments", users_create);
     
    491491     
    492492      // Derived bioassay set subtypes
    493       createItemSubtype(Item.DERIVEDBIOASSAYSET, DerivedBioAssaySet.SCAN,
     493      createItemSubtype(Item.DERIVEDBIOASSAY, DerivedBioAssay.SCAN,
    494494        "Scan", "A hybridization that has been scanned to produce one or more images.",
    495495        hybridization, scanner, scanningProtocol);
    496       createItemSubtype(Item.DERIVEDBIOASSAYSET, DerivedBioAssaySet.SEQUENCED,
     496      createItemSubtype(Item.DERIVEDBIOASSAY, DerivedBioAssay.SEQUENCED,
    497497        "Sequenced", "A flow cell that has been sequenced.",
    498498        flowCell, sequencer, sequencingProtocol);
    499       createItemSubtype(Item.DERIVEDBIOASSAYSET, DerivedBioAssaySet.ASSEMBLY,
     499      createItemSubtype(Item.DERIVEDBIOASSAY, DerivedBioAssay.ASSEMBLY,
    500500        "Assembly", "A data set of sequences that has been aligned against a reference database",
    501501        alignmentSoftware);
  • trunk/src/core/net/sf/basedb/core/Item.java

    r5652 r5685  
    428428
    429429  /**
    430     The item is a {@link DerivedBioAssaySet}.
    431   */
    432   DERIVEDBIOASSAYSET(267, "Derived bioassay set", "dbs", DerivedBioAssaySet.class, DerivedBioAssaySetData.class, DefinedPermissions.shareable,
     430    The item is a {@link DerivedBioAssay}.
     431  */
     432  DERIVEDBIOASSAY(267, "Derived bioassay", "dba", DerivedBioAssay.class, DerivedBioAssayData.class, DefinedPermissions.shareable,
    433433    330),
    434434   
    435   /**
    436     The item is a {@link DerivedBioAssay}.
    437   */
    438   DERIVEDBIOASSAY(268, "Derived bioassay", "dby", DerivedBioAssay.class, DerivedBioAssayData.class, null,
    439     330),
    440  
    441435  /**
    442436    The item is a {@link RawBioAssay}.
  • trunk/src/core/net/sf/basedb/core/PhysicalBioAssay.java

    r5657 r5685  
    258258    Check that:
    259259    <ul>
    260     <li>No {@link DerivedBioAssaySet}:s use the physical bioassay
     260    <li>No {@link DerivedBioAssay}:s use the physical bioassay
    261261    </ul>
    262262  */
     
    264264    throws BaseException
    265265  {
    266     return countRootDerivedBioAssaySets() > 0 || super.isUsed();
     266    return countRootDerivedBioAssays() > 0 || super.isUsed();
    267267  }
    268268  /**
    269269    Get all:
    270270    <ul>
    271     <li>(root) {@link DerivedBioAssaySet}:s created from this physical bioassay
     271    <li>(root) {@link DerivedBioAssay}:s created from this physical bioassay
    272272    <ul>
    273273    @since 2.2
     
    279279    org.hibernate.Session session = getDbControl().getHibernateSession();
    280280    org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session,
    281       "GET_ROOT_DERIVEDBIOASSAYSETS_FOR_PHYSICALBIOASSAY", "dbs.id");
     281      "GET_ROOT_DERIVEDBIOASSAYS_FOR_PHYSICALBIOASSAY", "dbs.id");
    282282      /*
    283283        SELECT {1}
    284         FROM DerivedBioAssaySetData dbs
     284        FROM DerivedBioAssayData dbs
    285285        WHERE dbs.physicalBioAssay = :bioAssay
    286286        AND dbs.creationEvent.parent is null
    287287      */
    288288    query.setEntity("bioAssay", this.getData());
    289     addUsingItems(using, Item.DERIVEDBIOASSAYSET, query);
     289    addUsingItems(using, Item.DERIVEDBIOASSAY, query);
    290290    return using;
    291291  }
     
    457457 
    458458  /**
    459     Get a query that returns all derived bioassay sets created from this
     459    Get a query that returns all derived bioassay created from this
    460460    physical bioassay.
    461461    @return An {@link ItemQuery} object
    462462  */
    463   public ItemQuery<DerivedBioAssaySet> getDerivedBioAssaySets()
    464   {
    465     ItemQuery<DerivedBioAssaySet> query = DerivedBioAssaySet.getQuery();
     463  public ItemQuery<DerivedBioAssay> getDerivedBioAssays()
     464  {
     465    ItemQuery<DerivedBioAssay> query = DerivedBioAssay.getQuery();
    466466    query.restrictPermanent(
    467467      Restrictions.eq(
     
    474474 
    475475  /**
    476     Get a query that returns all root derived bioassay sets created from this
     476    Get a query that returns all root derived bioassay created from this
    477477    physical bioassay.
    478478    @return An {@link ItemQuery} object
    479479  */
    480   public ItemQuery<DerivedBioAssaySet> getRootDerivedBioAssaySets()
    481   {
    482     ItemQuery<DerivedBioAssaySet> query = DerivedBioAssaySet.getQuery();
     480  public ItemQuery<DerivedBioAssay> getRootDerivedBioAssays()
     481  {
     482    ItemQuery<DerivedBioAssay> query = DerivedBioAssay.getQuery();
    483483    query.restrictPermanent(
    484484      Restrictions.eq(
     
    493493 
    494494  /**
    495     Counts all root derived bioassay sets that have been created from this physical bioassay.
    496     The count includes bioassay sets that the logged in user doesn't have access to.
    497     @return The number of root bioassay sets
    498     @throws BaseException If the bioassay sets could not be counted.
     495    Counts all root derived bioassays that have been created from this physical bioassay.
     496    The count includes bioassays that the logged in user doesn't have access to.
     497    @return The number of root bioassay
     498    @throws BaseException If the bioassay could not be counted.
    499499   */
    500   public long countRootDerivedBioAssaySets()
     500  public long countRootDerivedBioAssays()
    501501    throws BaseException
    502502  {
    503503    org.hibernate.Session session = getDbControl().getHibernateSession();
    504504    org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session,
    505       "GET_ROOT_DERIVEDBIOASSAYSETS_FOR_PHYSICALBIOASSAY", "count(*)");
     505      "GET_ROOT_DERIVEDBIOASSAYS_FOR_PHYSICALBIOASSAY", "count(*)");
    506506    /*
    507507      SELECT {1}
    508       FROM DerivedBioAssaySetData dbs
     508      FROM DerivedBioAssayData dba
    509509      WHERE dbs.physicalBioAssay = :bioAssay
    510       AND dbs.parent is null
     510      AND dba.parent is null
    511511    */
    512512    query.setEntity("bioAssay", this.getData());
  • trunk/src/core/net/sf/basedb/core/Protocol.java

    r5652 r5685  
    357357    {
    358358      org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session,
    359         "GET_DERIVEDBIOASSAYSET_FOR_PROTOCOL", "count(*)");
    360       /*
    361         SELECT {1}
    362         FROM DerivedBioAssaySetData dbas
    363         WHERE dbas.protocol = :protocol
     359        "GET_DERIVEDBIOASSAY_FOR_PROTOCOL", "count(*)");
     360      /*
     361        SELECT {1}
     362        FROM DerivedBioAssayData dba
     363        WHERE dba.protocol = :protocol
    364364      */
    365365      query.setEntity("protocol", this.getData());
     
    386386    <li>a {@link Plate}:s using this protocol
    387387    <li>an {@link ArrayBatch}:s using this protocol
    388     <li>a {@link DerivedBioAssaySet}:s using this protocol
     388    <li>a {@link DerivedBioAssay}:s using this protocol
    389389    <li>a {@link RawBioAssay}:s using this protocol
    390390    <ul>
     
    443443    // Scans
    444444    query = HibernateUtil.getPredefinedQuery(session,
    445       "GET_DERIVEDBIOASSAYSET_FOR_PROTOCOL", "dbas.id");
    446       /*
    447         SELECT {1}
    448         FROM DerivedBioAssaySetData dbas
    449         WHERE dbas.protocol = :protocol
     445      "GET_DERIVEDBIOASSAY_FOR_PROTOCOL", "dba.id");
     446      /*
     447        SELECT {1}
     448        FROM DerivedBioAssayData dba
     449        WHERE dba.protocol = :protocol
    450450      */
    451451    query.setEntity("protocol", this.getData());
    452     addUsingItems(using, Item.DERIVEDBIOASSAYSET, query);
     452    addUsingItems(using, Item.DERIVEDBIOASSAY, query);
    453453   
    454454    // Raw bioassays
  • trunk/src/core/net/sf/basedb/core/RawBioAssay.java

    r5657 r5685  
    657657    @since 3.0
    658658  */
    659   public void setParentBioAssay(Extract extract)
     659  public void setParentExtract(Extract extract)
    660660    throws PermissionDeniedException
    661661  {
  • trunk/src/core/net/sf/basedb/core/Software.java

    r5652 r5685  
    203203    <ul>
    204204    <li>a RawBioAssay was created with this software
    205     <li>a DerivedBioassaySet was created with this software
     205    <li>a DerivedBioassay was created with this software
    206206    </ul>
    207207  */
     
    215215    {
    216216      org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session,
    217         "GET_DERIVEDBIOASSAYSETS_FOR_SOFTWARE", "count(*)");
     217        "GET_DERIVEDBIOASSAYS_FOR_SOFTWARE", "count(*)");
    218218      /*
    219219        SELECT {1}
    220         FROM DerivedBioAssaySetData dbas
    221         WHERE dbas.software = :software
     220        FROM DerivedBioAssayData dba
     221        WHERE dba.software = :software
    222222      */
    223223      query.setEntity("software", this.getData());
     
    242242    <ul>
    243243    <li>{@link RawBioAssay}:s created with this software
    244     <li>{@link DerivedBioAssaySet}: created with this software
     244    <li>{@link DerivedBioAssay}: created with this software
    245245    <ul>
    246246    @since 2.2
     
    263263    // Derived bioassay sets
    264264    query = HibernateUtil.getPredefinedQuery(session,
    265       "GET_DERIVEDBIOASSAYSETS_FOR_SOFTWARE", "dbas.id");
     265      "GET_DERIVEDBIOASSAYS_FOR_SOFTWARE", "dba.id");
    266266      /*
    267267        SELECT {1}
    268         FROM DerivedBioAssaySetData dbas
    269         WHERE dbas.software = :software
     268        FROM DerivedBioAssayData dba
     269        WHERE dba.software = :software
    270270      */
    271271    query.setEntity("software", this.getData());
    272     addUsingItems(using, Item.DERIVEDBIOASSAYSET, query);
     272    addUsingItems(using, Item.DERIVEDBIOASSAY, query);
    273273    return using;
    274274  }
  • trunk/src/core/net/sf/basedb/core/data/DerivedBioAssayData.java

    r5684 r5685  
    3030  @since 3.0
    3131  @base.modified $Date$
    32   @hibernate.class table="`DerivedBioAssaySets`" lazy="true"
     32  @hibernate.class table="`DerivedBioAssays`" lazy="true"
    3333*/
    34 public class DerivedBioAssaySetData
     34public class DerivedBioAssayData
    3535  extends AnnotatedData
    3636  implements RegisteredData, FileStoreEnabledData, SubtypableData
    3737{
    3838
    39   public DerivedBioAssaySetData()
     39  public DerivedBioAssayData()
    4040  {}
    4141 
     
    103103  }
    104104
    105   private DerivedBioAssaySetData parent;
    106   /**
    107     Get the bioassay set that is the parent of this bioassay set. null if this bioassay set was
     105  private DerivedBioAssayData parent;
     106  /**
     107    Get the bioassay that is the parent of this bioassay. Null if this bioassay was
    108108    created from a physical bioassay.
    109109    @hibernate.many-to-one column="`parent_id`" not-null="false" update="false" outer-join="false"
    110110  */
    111   public DerivedBioAssaySetData getParent()
     111  public DerivedBioAssayData getParent()
    112112  {
    113113    return parent;
    114114  }
    115   public void setParent(DerivedBioAssaySetData parent)
     115  public void setParent(DerivedBioAssayData parent)
    116116  {
    117117    this.parent = parent;
    118118  }
    119119
    120   private Set<DerivedBioAssaySetData> children;
     120  private Set<DerivedBioAssayData> children;
    121121  /**
    122122    This is the inverse end.
    123     @see DerivedBioAssaySetData#getParent()
     123    @see DerivedBioAssayData#getParent()
    124124    @hibernate.set lazy="true" inverse="true"
    125125    @hibernate.collection-key column="`parent_id`"
    126     @hibernate.collection-one-to-many class="net.sf.basedb.core.data.DerivedBioAssaySetData"
    127   */
    128   Set<DerivedBioAssaySetData> getChildren()
     126    @hibernate.collection-one-to-many class="net.sf.basedb.core.data.DerivedBioAssayData"
     127  */
     128  Set<DerivedBioAssayData> getChildren()
    129129  {
    130130    return children;
    131131  }
    132   void setChildren(Set<DerivedBioAssaySetData> children)
     132  void setChildren(Set<DerivedBioAssayData> children)
    133133  {
    134134    this.children = children;
    135135  }
    136136
    137   private Set<DerivedBioAssayData> bioAssays;
     137  private Set<RawBioAssayData> rawBioAssays;
    138138  /**
    139139    This is the inverse end.
    140     @see DerivedBioAssayData#getBioAssaySet()
    141     @hibernate.set lazy="true" inverse="true" cascade="delete"
    142     @hibernate.collection-key column="`bioassayset_id`"
    143     @hibernate.collection-one-to-many class="net.sf.basedb.core.data.DerivedBioAssayData"
    144   */
    145   Set<DerivedBioAssayData> getBioAssays()
    146   {
    147     return bioAssays;
    148   }
    149   void setBioAssays(Set<DerivedBioAssayData> bioAssays)
    150   {
    151     this.bioAssays = bioAssays;
     140    @see RawBioAssayData#getParentBioAssay()
     141    @hibernate.set lazy="true" inverse="true"
     142    @hibernate.collection-key column="`bioassay_id`"
     143    @hibernate.collection-one-to-many class="net.sf.basedb.core.data.RawBioAssayData"
     144  */
     145  Set<RawBioAssayData> getRawBioAssays()
     146  {
     147    return rawBioAssays;
     148  }
     149  void setRawBioAssays(Set<RawBioAssayData> rawBioAssays)
     150  {
     151    this.rawBioAssays = rawBioAssays;
    152152  }
    153153
     
    209209  }
    210210
     211  private ExtractData extract;
     212  /**
     213    Get the extract that this bioassay is related to.
     214    @hibernate.many-to-one column="`extract_id`" not-null="false" outer-join="false"
     215  */
     216  public ExtractData getExtract()
     217  {
     218    return extract;
     219  }
     220  public void setExtract(ExtractData extract)
     221  {
     222    this.extract = extract;
     223  }
    211224 
    212225}
  • trunk/src/core/net/sf/basedb/core/data/PhysicalBioAssayData.java

    r5652 r5685  
    119119  }
    120120
    121   private Set<DerivedBioAssaySetData> rootDerivedBioAssaySets;
     121  private Set<DerivedBioAssayData> rootDerivedBioAssays;
    122122  /**
    123123    This is the inverse end with an extra restriction
    124     @see DerivedBioAssaySetData#getPhysicalBioAssay()
     124    @see DerivedBioAssayData#getPhysicalBioAssay()
    125125    @hibernate.set lazy="true" inverse="true" where="`parent_id` is null"
    126126    @hibernate.collection-key column="`bioassay_id`"
    127     @hibernate.collection-one-to-many class="net.sf.basedb.core.data.DerivedBioAssaySetData"
     127    @hibernate.collection-one-to-many class="net.sf.basedb.core.data.DerivedBioAssayData"
    128128  */
    129   Set<DerivedBioAssaySetData> getRootDerivedBioAssaySets()
     129  Set<DerivedBioAssayData> getRootDerivedBioAssays()
    130130  {
    131     return rootDerivedBioAssaySets;
     131    return rootDerivedBioAssays;
    132132  }
    133   void setRootDerivedBioAssaySets(Set<DerivedBioAssaySetData> rootDerivedBioAssaySets)
     133  void setRootDerivedBioAssays(Set<DerivedBioAssayData> rootDerivedBioAssays)
    134134  {
    135     this.rootDerivedBioAssaySets = rootDerivedBioAssaySets;
     135    this.rootDerivedBioAssays = rootDerivedBioAssays;
    136136  }
    137137 
    138   private Set<DerivedBioAssaySetData> derivedBioAssaySets;
     138  private Set<DerivedBioAssayData> derivedBioAssays;
    139139  /**
    140140    This is the inverse end.
    141     @see DerivedBioAssaySetData#getPhysicalBioAssay()
     141    @see DerivedBioAssayData#getPhysicalBioAssay()
    142142    @hibernate.set lazy="true" inverse="true"
    143143    @hibernate.collection-key column="`bioassay_id`"
    144     @hibernate.collection-one-to-many class="net.sf.basedb.core.data.DerivedBioAssaySetData"
     144    @hibernate.collection-one-to-many class="net.sf.basedb.core.data.DerivedBioAssayData"
    145145  */
    146   Set<DerivedBioAssaySetData> getDerivedBioAssaySets()
     146  Set<DerivedBioAssayData> getDerivedBioAssays()
    147147  {
    148     return derivedBioAssaySets;
     148    return derivedBioAssays;
    149149  }
    150   void setDerivedBioAssaySets(Set<DerivedBioAssaySetData> derivedBioAssaySets)
     150  void setDerivedBioAssays(Set<DerivedBioAssayData> derivedBioAssays)
    151151  {
    152     this.derivedBioAssaySets = derivedBioAssaySets;
     152    this.derivedBioAssays = derivedBioAssays;
    153153  }
    154154
  • trunk/src/core/net/sf/basedb/util/AnnotationUtil.java

    r5657 r5685  
    3131import net.sf.basedb.core.BaseException;
    3232import net.sf.basedb.core.DbControl;
    33 import net.sf.basedb.core.DerivedBioAssaySet;
     33import net.sf.basedb.core.DerivedBioAssay;
    3434import net.sf.basedb.core.PhysicalBioAssay;
    3535import net.sf.basedb.core.RawBioAssay;
     
    112112      <ul>
    113113      <li>{@link RawBioAssay#getArrayNum()} if the item is a raw bioassay
    114       <li>'arrayNum' if the items is a DerivedBioAssaySet or PhysicalBioAssay
     114      <li>'arrayNum' if the items is a DerivedBioAssay or PhysicalBioAssay
    115115      <li>0 in all other cases.
    116116    */
     
    122122        return arrayNum;
    123123      }
    124       else if (item instanceof DerivedBioAssaySet || item instanceof PhysicalBioAssay)
     124      else if (item instanceof DerivedBioAssay || item instanceof PhysicalBioAssay)
    125125      {
    126126        return arrayNum;
  • trunk/src/core/net/sf/basedb/util/overview/OverviewUtil.java

    r5657 r5685  
    3535import net.sf.basedb.core.BasicItem;
    3636import net.sf.basedb.core.DbControl;
    37 import net.sf.basedb.core.DerivedBioAssaySet;
     37import net.sf.basedb.core.DerivedBioAssay;
    3838import net.sf.basedb.core.Presets;
    3939import net.sf.basedb.core.PhysicalBioAssay;
  • trunk/src/core/net/sf/basedb/util/overview/loader/BasicItemNodeLoaderFactory.java

    r5652 r5685  
    222222    registerCheckedNodeLoader(Item.ARRAYSLIDE, ArraySlideLoader.class);
    223223    registerCheckedNodeLoader(Item.PHYSICALBIOASSAY, PhysicalBioAssayLoader.class);
    224     registerCheckedNodeLoader(Item.DERIVEDBIOASSAYSET, DerivedBioAssaySetLoader.class);
    225224    registerCheckedNodeLoader(Item.DERIVEDBIOASSAY, DerivedBioAssayLoader.class);
    226225    registerCheckedNodeLoader(Item.RAWBIOASSAY, RawBioAssayLoader.class);
  • trunk/src/core/net/sf/basedb/util/overview/loader/DerivedBioAssayLoader.java

    r5684 r5685  
    2222package net.sf.basedb.util.overview.loader;
    2323
    24 import net.sf.basedb.core.BioSource;
    2524import net.sf.basedb.core.DbControl;
    2625import net.sf.basedb.core.DerivedBioAssay;
    27 import net.sf.basedb.core.DerivedBioAssaySet;
    28 import net.sf.basedb.core.Extract;
    2926import net.sf.basedb.core.Item;
    3027import net.sf.basedb.core.ItemQuery;
     
    3229import net.sf.basedb.core.PermissionDeniedException;
    3330import net.sf.basedb.core.PhysicalBioAssay;
    34 import net.sf.basedb.core.RawBioAssay;
    35 import net.sf.basedb.core.Sample;
    36 import net.sf.basedb.core.query.Hql;
    37 import net.sf.basedb.core.query.Restrictions;
    3831import net.sf.basedb.util.overview.Node;
    3932import net.sf.basedb.util.overview.OverviewContext;
     
    5043  @base.modified $Date$
    5144*/
    52 public class DerivedBioAssaySetLoader
    53   extends BasicItemNodeLoader<DerivedBioAssaySet>
     45public class DerivedBioAssayLoader
     46  extends BasicItemNodeLoader<DerivedBioAssay>
    5447{
    55   public DerivedBioAssaySetLoader()
    56   {
    57     super(Item.DERIVEDBIOASSAYSET, ALLOW_ROOT_NODE,
    58         new NameableNameGenerator<DerivedBioAssaySet>("bioassayset", "Bioassay set"));
     48  public DerivedBioAssayLoader()
     49  {
     50    super(Item.DERIVEDBIOASSAY, ALLOW_ROOT_NODE,
     51        new NameableNameGenerator<DerivedBioAssay>("bioassayset", "Bioassay"));
    5952  }
    6053 
     
    7871      returnNode = createForwardNode((PhysicalBioAssay)parentNode.getItem(dc), dc, context, parentNode);
    7972    }
    80     else if (parentType == Item.DERIVEDBIOASSAYSET)
    81     {
    82       returnNode = createForwardNode((DerivedBioAssaySet)parentNode.getItem(dc), dc, context, parentNode);
     73    else if (parentType == Item.DERIVEDBIOASSAY)
     74    {
     75      returnNode = createForwardNode((DerivedBioAssay)parentNode.getItem(dc), dc, context, parentNode);
    8376    }
    8477   
     
    134127      returnNode = createReverseNode((DerivedBioAssay)parentNode.getItem(dc), dc, context, parentNode);
    135128    }
    136     else if (parentType == Item.DERIVEDBIOASSAYSET)
    137     {
    138       returnNode = createReverseNode((DerivedBioAssaySet)parentNode.getItem(dc), dc, context, parentNode);
    139     }
    140129   
    141130    /*
     
    188177
    189178  /**
    190     Loads all child derived bioassay and bioassay set nodes.
    191     @see DerivedBioAssaySetLoader#createForwardNode(DbControl, OverviewContext, Node)
     179    Loads all child derived bioassay and raw bioassay nodes.
    192180    @see DerivedBioAssayLoader#createForwardNode(DbControl, OverviewContext, Node)
     181    @see RawBioAssayLoader#createForwardNode(DbControl, OverviewContext, Node)
    193182  */
    194183  @Override
    195184  protected void loadForwardChildNodes(DbControl dc, OverviewContext context, Node parentNode)
    196185  {
    197     getNodeLoader(context, Item.DERIVEDBIOASSAYSET).createForwardNode(dc, context, parentNode);
    198186    getNodeLoader(context, Item.DERIVEDBIOASSAY).createForwardNode(dc, context, parentNode);
     187    getNodeLoader(context, Item.RAWBIOASSAY).createForwardNode(dc, context, parentNode);
    199188  }
    200189 
     
    202191    Loads the parent bioassay set or the parent physical bioassay.
    203192    @see PhysicalBioAssayLoader#createReverseNode(DbControl, OverviewContext, Node)
    204     @see DerivedBioAssaySetLoader#createReverseNode(DbControl, OverviewContext, Node)
     193    @see DerivedBioAssayLoader#createReverseNode(DbControl, OverviewContext, Node)
    205194  */
    206195  @Override
    207196  protected void loadReverseChildNodes(DbControl dc, OverviewContext context, Node bioAssaySetNode)
    208197  {
    209     DerivedBioAssaySet dbas = (DerivedBioAssaySet)bioAssaySetNode.getItem(dc);
     198    DerivedBioAssay dbas = (DerivedBioAssay)bioAssaySetNode.getItem(dc);
    210199    if (dbas.isRoot())
    211200    {
     
    214203    else
    215204    {
    216       getNodeLoader(context, Item.DERIVEDBIOASSAYSET).createReverseNode(dc, context, bioAssaySetNode);
     205      getNodeLoader(context, Item.DERIVEDBIOASSAY).createReverseNode(dc, context, bioAssaySetNode);
    217206    }
    218207  }
     
    221210 
    222211  /**
    223     Create forward-loading derived bioassay set nodes that have the given
    224     physical bioassay as the immediate parent (eg. root bioassay sets).
     212    Create forward-loading derived bioassay nodes that have the given
     213    physical bioassay as the immediate parent (eg. root bioassays).
    225214  */
    226215  private Node createForwardNode(PhysicalBioAssay bioAssay, DbControl dc, OverviewContext context, Node parentNode)
    227216  {
    228     NodeFactory<DerivedBioAssaySet> nf = getNodeFactory(dc, context);
     217    NodeFactory<DerivedBioAssay> nf = getNodeFactory(dc, context);
    229218    int cacheIndex = getCacheIndex(parentNode);
    230219 
    231220    Node folderNode = null;
    232     ItemQuery<DerivedBioAssaySet> query = context.initQuery(bioAssay.getRootDerivedBioAssaySets(), "name");
    233     ItemResultIterator<DerivedBioAssaySet> it = query.iterate(dc);
     221    ItemQuery<DerivedBioAssay> query = context.initQuery(bioAssay.getRootDerivedBioAssays(), "name");
     222    ItemResultIterator<DerivedBioAssay> it = query.iterate(dc);
    234223    while (it.hasNext())
    235224    {
    236       DerivedBioAssaySet bioAssaySet = it.next();
     225      DerivedBioAssay bioAssaySet = it.next();
    237226      if (folderNode == null)
    238227      {
     
    250239    derived bioassay set as the parent
    251240  */
    252   private Node createForwardNode(DerivedBioAssaySet parent, DbControl dc, OverviewContext context, Node parentNode)
    253   {
    254     NodeFactory<DerivedBioAssaySet> nf = getNodeFactory(dc, context);
     241  private Node createForwardNode(DerivedBioAssay parent, DbControl dc, OverviewContext context, Node parentNode)
     242  {
     243    NodeFactory<DerivedBioAssay> nf = getNodeFactory(dc, context);
    255244    Node folderNode = null;
    256245    int cacheIndex = getCacheIndex(parentNode);
    257     ItemQuery<DerivedBioAssaySet> query = context.initQuery(parent.getChildren(), "name");
    258     ItemResultIterator<DerivedBioAssaySet> it = query.iterate(dc);
     246    ItemQuery<DerivedBioAssay> query = context.initQuery(parent.getChildren(), "name");
     247    ItemResultIterator<DerivedBioAssay> it = query.iterate(dc);
    259248    while (it.hasNext())
    260249    {
    261       DerivedBioAssaySet bioAssaySet = it.next();
     250      DerivedBioAssay bioAssaySet = it.next();
    262251      if (folderNode == null)
    263252      {
     
    273262  private Node createReverseNode(DerivedBioAssay child, DbControl dc, OverviewContext context, Node parentNode)
    274263  {
    275     NodeFactory<DerivedBioAssaySet> nf = getNodeFactory(dc, context);
    276     DerivedBioAssaySet bioAssaySet = null;
     264    NodeFactory<DerivedBioAssay> nf = getNodeFactory(dc, context);
     265    DerivedBioAssay bioAssaySet = null;
    277266    boolean denied = false;
    278267    try
    279268    {
    280       bioAssaySet = child.getBioAssaySet();
     269      bioAssaySet = child.getParent();
    281270    }
    282271    catch (PermissionDeniedException ex)
     
    289278  }
    290279
    291   private Node createReverseNode(DerivedBioAssaySet child, DbControl dc, OverviewContext context, Node parentNode)
    292   {
    293     NodeFactory<DerivedBioAssaySet> nf = getNodeFactory(dc, context);
    294     DerivedBioAssaySet bioAssaySet = null;
    295     boolean denied = false;
    296     try
    297     {
    298       bioAssaySet = child.getParent();
    299     }
    300     catch (PermissionDeniedException ex)
    301     {
    302       denied = true;
    303     }
    304     Node bioAssaySetNode = createItemNode(nf, bioAssaySet, bioAssaySet, denied,
    305         parentNode, ChildNodeDirection.REVERSE);
    306     return bioAssaySetNode;
    307   }
    308 
    309280  /**
    310281    If we have an extract in the parent chaing we need to keep track of that
  • trunk/src/core/net/sf/basedb/util/overview/loader/ExtractLoader.java

    r5663 r5685  
    274274    try
    275275    {
    276       extract = bioAssay.getExtract();
     276      //extract = bioAssay.getExtract();
    277277    }
    278278    catch (PermissionDeniedException ex)
  • trunk/src/core/net/sf/basedb/util/overview/loader/HardwareLoader.java

    r5652 r5685  
    2525import net.sf.basedb.core.BasicItem;
    2626import net.sf.basedb.core.DbControl;
    27 import net.sf.basedb.core.DerivedBioAssaySet;
     27import net.sf.basedb.core.DerivedBioAssay;
    2828import net.sf.basedb.core.Hardware;
    2929import net.sf.basedb.core.MeasuredBioMaterial;
     
    7777    {
    7878      BasicItem parentItem = (BasicItem)parentNode.getItem(dc);
    79       if (parentItem instanceof DerivedBioAssaySet)
     79      if (parentItem instanceof DerivedBioAssay)
    8080      {
    81         hardware = ((DerivedBioAssaySet)parentItem).getHardware();
     81        hardware = ((DerivedBioAssay)parentItem).getHardware();
    8282      }
    8383      else if (parentItem instanceof PhysicalBioAssay)
  • trunk/src/core/net/sf/basedb/util/overview/loader/PhysicalBioAssayLoader.java

    r5662 r5685  
    2424import net.sf.basedb.core.ArraySlide;
    2525import net.sf.basedb.core.DbControl;
    26 import net.sf.basedb.core.DerivedBioAssaySet;
     26import net.sf.basedb.core.DerivedBioAssay;
    2727import net.sf.basedb.core.Extract;
    2828import net.sf.basedb.core.PhysicalBioAssay;
     
    4545  <ol>
    4646  <li>{@link Extract}:s -&gt; {@link PhysicalBioAssay}:s -&gt;
    47   {@link DerivedBioAssaySet}:s.
     47  {@link DerivedBioAssay}:s.
    4848  <li>{@link ArraySlide}:s -&gt; {@link PhysicalBioAssay}:s -&gt;
    49   {@link DerivedBioAssaySet}:s
     49  {@link DerivedBioAssay}:s
    5050  </ol>
    5151 
     
    9494 
    9595  /**
    96     Create a reverse-loading bioassay node from the derived bioassay set node.
     96    Create a reverse-loading bioassay node from the derived bioassay node.
    9797    @return A bioassay node
    9898  */
    9999  @Override
    100   public Node createReverseNode(DbControl dc, OverviewContext context, Node derivedBioAssaySetNode)
     100  public Node createReverseNode(DbControl dc, OverviewContext context, Node derivedBioAssayNode)
    101101  {
    102102    NodeFactory<PhysicalBioAssay> nf = getNodeFactory(dc, context);
     
    105105    try
    106106    {
    107       DerivedBioAssaySet bas = (DerivedBioAssaySet)derivedBioAssaySetNode.getItem(dc);
     107      DerivedBioAssay bas = (DerivedBioAssay)derivedBioAssayNode.getItem(dc);
    108108      bioAssay = bas.getPhysicalBioAssay();
    109       Node rbaNode = derivedBioAssaySetNode.getFirstParent(new ItemTypeFilter(Item.RAWBIOASSAY));
     109      Node rbaNode = derivedBioAssayNode.getFirstParent(new ItemTypeFilter(Item.RAWBIOASSAY));
    110110      if (rbaNode != null)
    111111      {
     
    117117      denied = true;
    118118    }
    119     Node bioAssayNode = createItemNode(nf, bioAssay, bioAssay, denied, derivedBioAssaySetNode, ChildNodeDirection.REVERSE);
     119    Node bioAssayNode = createItemNode(nf, bioAssay, bioAssay, denied, derivedBioAssayNode, ChildNodeDirection.REVERSE);
    120120    return bioAssayNode;
    121121  }
     
    145145    Load forward-loading child nodes:
    146146    <ul>
    147     <li>Derived bioassay sets (root): {@link DerivedBioAssaySetLoader#createForwardNode(DbControl, OverviewContext, Node)}
     147    <li>Derived bioassay sets (root): {@link DerivedBioAssayLoader#createForwardNode(DbControl, OverviewContext, Node)}
    148148    <li>Array slide in reverse direction (if the parent node is an extract):
    149149      {@link ArraySlideLoader#createReverseNode(DbControl, OverviewContext, Node)}
     
    155155  protected void loadForwardChildNodes(DbControl dc, OverviewContext context, Node bioAssayNode)
    156156  {
    157     getNodeLoader(context, Item.DERIVEDBIOASSAYSET).createForwardNode(dc, context, bioAssayNode);
     157    getNodeLoader(context, Item.DERIVEDBIOASSAY).createForwardNode(dc, context, bioAssayNode);
    158158    Node parent = bioAssayNode.getParent();
    159159    if (parent != null && parent.getNodeType() == Node.Type.FOLDER)
  • trunk/src/core/net/sf/basedb/util/overview/loader/SoftwareLoader.java

    r5652 r5685  
    2424import net.sf.basedb.core.BasicItem;
    2525import net.sf.basedb.core.DbControl;
    26 import net.sf.basedb.core.DerivedBioAssaySet;
     26import net.sf.basedb.core.DerivedBioAssay;
    2727import net.sf.basedb.core.Item;
    2828import net.sf.basedb.core.PermissionDeniedException;
     
    7171        software = ((RawBioAssay)parentItem).getSoftware();
    7272      }
    73       else if (parentItem instanceof DerivedBioAssaySet)
     73      else if (parentItem instanceof DerivedBioAssay)
    7474      {
    75         software = ((DerivedBioAssaySet)parentItem).getSoftware();
     75        software = ((DerivedBioAssay)parentItem).getSoftware();
    7676      }
    7777
  • trunk/src/core/net/sf/basedb/util/overview/validator/BasicItemNodeValidatorFactory.java

    r5652 r5685  
    198198    registerCheckedNodeValidator(Item.ARRAYSLIDE, ArraySlideValidator.class);
    199199    registerCheckedNodeValidator(Item.PHYSICALBIOASSAY, PhysicalBioAssayValidator.class);
    200 //    registerCheckedNodeValidator(Item.DERIVEDBIOASSAYSET, DerivedBioAssaySetValidator.class);
    201200//    registerCheckedNodeValidator(Item.DERIVEDBIOASSAY, DerivedBioAssayValidator.class);
    202201    registerCheckedNodeValidator(Item.RAWBIOASSAY, RawBioAssayValidator.class);
  • trunk/src/core/net/sf/basedb/util/overview/validator/RawBioAssayValidator.java

    r5657 r5685  
    2828import net.sf.basedb.core.DbControl;
    2929import net.sf.basedb.core.DerivedBioAssay;
    30 import net.sf.basedb.core.PhysicalBioAssay;
    3130import net.sf.basedb.core.Project;
    3231import net.sf.basedb.core.RawBioAssay;
  • trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/ScanImporter.java

    r5652 r5685  
    2323
    2424import net.sf.basedb.core.DbControl;
    25 import net.sf.basedb.core.DerivedBioAssaySet;
     25import net.sf.basedb.core.DerivedBioAssay;
    2626import net.sf.basedb.core.File;
    2727import net.sf.basedb.core.Hardware;
     
    5252*/
    5353public class ScanImporter
    54   extends AbstractItemImporter<DerivedBioAssaySet>
     54  extends AbstractItemImporter<DerivedBioAssay>
    5555{
    5656
    5757  private static final Set<GuiContext> guiContexts = 
    58     Collections.singleton(new GuiContext(Item.DERIVEDBIOASSAYSET, GuiContext.Type.LIST));
     58    Collections.singleton(new GuiContext(Item.DERIVEDBIOASSAY, GuiContext.Type.LIST));
    5959 
    6060  protected static final PluginParameter<String> hardwareColumnMapping = new PluginParameter<String>(
     
    211211 
    212212  /**
    213     Calls {@link DerivedBioAssaySet#getQuery()}.
    214   */
    215   @Override
    216   protected ItemQuery<DerivedBioAssaySet> createItemQuery()
    217   {
    218     return DerivedBioAssaySet.getQuery();
     213    Calls {@link DerivedBioAssay#getQuery()}.
     214  */
     215  @Override
     216  protected ItemQuery<DerivedBioAssay> createItemQuery()
     217  {
     218    return DerivedBioAssay.getQuery();
    219219  }
    220220 
     
    223223  {
    224224    nameMapper = getMapper(ffp, (String)job.getValue("nameColumnMapping"),
    225         cropStrings ? DerivedBioAssaySet.MAX_NAME_LENGTH : null, null);
     225        cropStrings ? DerivedBioAssay.MAX_NAME_LENGTH : null, null);
    226226    descriptionMapper = getMapper(ffp, (String)job.getValue("descriptionColumnMapping"),
    227         cropStrings ? DerivedBioAssaySet.MAX_DESCRIPTION_LENGTH : null, null);
     227        cropStrings ? DerivedBioAssay.MAX_DESCRIPTION_LENGTH : null, null);
    228228    protocolMapper = getMapper(ffp, (String)job.getValue("protocolColumnMapping"), null, null);
    229229    hardwareMapper = getMapper(ffp, (String)job.getValue("hardwareColumnMapping"), null, null);
     
    242242 
    243243  @Override
    244   protected DerivedBioAssaySet createItem(DbControl dc, FlatFileParser.Data data)
     244  protected DerivedBioAssay createItem(DbControl dc, FlatFileParser.Data data)
    245245  {
    246246    PhysicalBioAssay hyb = null;
     
    250250    }
    251251
    252     DerivedBioAssaySet scan = DerivedBioAssaySet.getNew(dc, hyb);
     252    DerivedBioAssay scan = DerivedBioAssay.getNew(dc, hyb);
    253253    updateItem(dc, scan, data);
    254254    return scan;
     
    256256 
    257257  @Override
    258   protected void updateItem(DbControl dc, DerivedBioAssaySet scan, FlatFileParser.Data data)
     258  protected void updateItem(DbControl dc, DerivedBioAssay scan, FlatFileParser.Data data)
    259259  {
    260260    if (nameMapper != null) scan.setName(nameMapper.getValue(data));
     
    290290 
    291291  @Override
    292   protected void updateMultiLineItem(DbControl dc, DerivedBioAssaySet scan, FlatFileParser.Data data, int multiLineNum)
     292  protected void updateMultiLineItem(DbControl dc, DerivedBioAssay scan, FlatFileParser.Data data, int multiLineNum)
    293293  {
    294294  //  Image image = null;
  • trunk/src/test/TestAll.java

    r5652 r5685  
    115115    // Physical bioassays and raw data
    116116    results.put("TestPhysicalBioAssay", TestPhysicalBioAssay.test_all());
    117     results.put("TestDerivedBioAssaySet", TestDerivedBioAssaySet.test_all());
     117    results.put("TestDerivedBioAssay", TestDerivedBioAssay.test_all());
    118118    results.put("TestRawBioAssay", TestRawBioAssay.test_all());
    119119    results.put("TestSpotImages", TestSpotImages.test_all());
  • trunk/src/test/TestDerivedBioAssay.java

    r5684 r5685  
    2626import java.util.Set;
    2727
    28 public class TestDerivedBioAssaySet
     28public class TestDerivedBioAssay
    2929{
    3030
     
    4040  static boolean test_all()
    4141  {
    42     write("++Testing derived bioassay sets");
     42    write("++Testing derived bioassays");
    4343    write_header();
    4444   
     
    5151   
    5252    // Standard tests: create, load, list
    53     int id = test_create_root("Scan #1", hybridizationId, SystemItems.getId(DerivedBioAssaySet.SCAN), protocolId, scannerId, 0);
     53    int id = test_create_root("Scan #1", hybridizationId, SystemItems.getId(DerivedBioAssay.SCAN), protocolId, scannerId, 0);
    5454    int id2 = test_create_root("Scan #2", hybridizationId, 0, 0, 0, 0);
    5555   
     
    5757    int child1 = test_create_child("Child #1", id, 0, 0, 0, 0);
    5858    int child2 = test_create_child("Child #2", id, 0, 0, 0, 0);
    59     int bioAssay1 = test_add_bioassay(id, extractId1, "Bioassay #1");
    60     int bioAssay2 = test_add_bioassay(id, extractId2, "Bioassay #2");
     59    //int bioAssay1 = test_add_bioassay(id, extractId1, "Bioassay #1");
     60    //int bioAssay2 = test_add_bioassay(id, extractId2, "Bioassay #2");
    6161
    6262    // Listing
     
    6464    test_list(hybridizationId, 2);
    6565    test_list_children(id, 2);
    66     test_list_bioassays(id, 2);
     66    //test_list_bioassays(id, 2);
    6767   
    6868    // Adding files
    6969    int samId = TestFile.test_create("data/test.assembly.sam", false, false);
    70     TestDataFileType.test_set_file(Item.DERIVEDBIOASSAY, bioAssay1, DataFileType.SAM, samId);
     70    //TestDataFileType.test_set_file(Item.DERIVEDBIOASSAY, bioAssay1, DataFileType.SAM, samId);
    7171   
    7272    // Standard test: Delete
     
    8181    TestHardware.test_delete(scannerId);
    8282    TestProtocol.test_delete(protocolId);
    83     write("++Testing derived bioassay sets "+(ok ? "OK" : "Failed")+"\n");
     83    write("++Testing derived bioassays "+(ok ? "OK" : "Failed")+"\n");
    8484    return ok;
    8585  }
     
    8787  static int test_create_root(String name, int bioAssayId, int subtypeId, int protocolId, int hardwareId, int softwareId)
    8888  {
    89     if (bioAssayId == 0 || !TestUtil.hasPermission(Permission.CREATE, Item.DERIVEDBIOASSAYSET)) return 0;
     89    if (bioAssayId == 0 || !TestUtil.hasPermission(Permission.CREATE, Item.DERIVEDBIOASSAY)) return 0;
    9090    int id = 0;
    9191    DbControl dc = null;
     
    9393    {
    9494      dc = TestUtil.getDbControl();
    95       DerivedBioAssaySet dbas = DerivedBioAssaySet.getNew(dc, PhysicalBioAssay.getById(dc, bioAssayId));
     95      DerivedBioAssay dbas = DerivedBioAssay.getNew(dc, PhysicalBioAssay.getById(dc, bioAssayId));
    9696      dbas.setName(name);
    9797      dbas.setDescription("Added at "+new Date());
     
    118118      dc.reattachItem(dbas, false);
    119119      write_item(0, dbas);
    120       write("--Create root derived bioassay set OK");
    121     }
    122     catch (Throwable ex)
    123     {
    124       write("--Create root derived bioassay set FAILED");
     120      write("--Create root derived bioassay OK");
     121    }
     122    catch (Throwable ex)
     123    {
     124      write("--Create root derived bioassay FAILED");
    125125      ex.printStackTrace();
    126126      ok = false;
     
    141141    {
    142142      dc = TestUtil.getDbControl();
    143       DerivedBioAssaySet dbas = DerivedBioAssaySet.getNew(dc, DerivedBioAssaySet.getById(dc, parentId));
     143      DerivedBioAssay dbas = DerivedBioAssay.getNew(dc, DerivedBioAssay.getById(dc, parentId));
    144144      dbas.setName(name);
    145145      dbas.setDescription("Added at "+new Date());
     
    166166      dc.reattachItem(dbas, false);
    167167      write_item(0, dbas);
    168       write("--Create child derived bioassay set OK");
    169     }
    170     catch (Throwable ex)
    171     {
    172       write("--Create child derived bioassay set FAILED");
     168      write("--Create child derived bioassay OK");
     169    }
     170    catch (Throwable ex)
     171    {
     172      write("--Create child derived bioassay FAILED");
    173173      ex.printStackTrace();
    174174      ok = false;
     
    189189    {
    190190      dc = TestUtil.getDbControl();
    191       DerivedBioAssaySet dbas = DerivedBioAssaySet.getById(dc, id);
     191      DerivedBioAssay dbas = DerivedBioAssay.getById(dc, id);
    192192      write_item(0, dbas);
    193       write("--Load derived bioassay set OK");
    194     }
    195     catch (Throwable ex)
    196     {
    197       write("--Load derived bioassay set FAILED");
     193      write("--Load derived bioassay OK");
     194    }
     195    catch (Throwable ex)
     196    {
     197      write("--Load derived bioassay FAILED");
    198198      ex.printStackTrace();
    199199      ok = false;
     
    211211    {
    212212      dc = TestUtil.getDbControl();
    213       ItemQuery<DerivedBioAssaySet> query = null;
     213      ItemQuery<DerivedBioAssay> query = null;
    214214      if (physicalBioAssayId == 0)
    215215      {
    216         query = DerivedBioAssaySet.getQuery();
     216        query = DerivedBioAssay.getQuery();
    217217      }
    218218      else
    219219      {
    220220        PhysicalBioAssay bioAssay = PhysicalBioAssay.getById(dc, physicalBioAssayId);
    221         query = bioAssay.getRootDerivedBioAssaySets();
    222       }
    223       ItemResultList<DerivedBioAssaySet> l = query.list(dc);
     221        query = bioAssay.getRootDerivedBioAssays();
     222      }
     223      ItemResultList<DerivedBioAssay> l = query.list(dc);
    224224      for (int i = 0; i<l.size(); i++)
    225225      {
     
    230230        throw new BaseException("Expected "+expectedResults+" results, not "+l.size());
    231231      }
    232       write("--List derived bioassay sets OK ("+l.size()+")");
    233     }
    234     catch (Throwable ex)
    235     {
    236       write("--List derived bioassay sets FAILED");
     232      write("--List derived bioassays OK ("+l.size()+")");
     233    }
     234    catch (Throwable ex)
     235    {
     236      write("--List derived bioassays FAILED");
    237237      ex.printStackTrace();
    238238      ok = false;
     
    251251    {
    252252      dc = TestUtil.getDbControl();
    253       DerivedBioAssaySet dbas = DerivedBioAssaySet.getById(dc, id);
     253      DerivedBioAssay dbas = DerivedBioAssay.getById(dc, id);
    254254      dc.deleteItem(dbas);
    255255      Set<ItemProxy> using = dbas.getUsingItems();
     
    259259      }
    260260      dc.commit();
    261       write("--Delete derived bioassay set OK");
    262     }
    263     catch (Throwable ex)
    264     {
    265       write("--Delete derived bioassay set FAILED");
     261      write("--Delete derived bioassay OK");
     262    }
     263    catch (Throwable ex)
     264    {
     265      write("--Delete derived bioassay FAILED");
    266266      ex.printStackTrace();
    267267      ok = false;
     
    279279    {
    280280      dc = TestUtil.getDbControl();
    281       ItemResultList<DerivedBioAssaySet> l = DerivedBioAssaySet.getQuery().list(dc);
     281      ItemResultList<DerivedBioAssay> l = DerivedBioAssay.getQuery().list(dc);
    282282      Trashcan.delete(dc.getSessionControl(), l, true, null);
    283283      dc.commit();
    284       write("--Delete all derived bioassay sets OK ("+l.size()+")");
    285     }
    286     catch (Throwable ex)
    287     {
    288       write("--Delete all derived bioassay sets FAILED");
     284      write("--Delete all derived bioassays OK ("+l.size()+")");
     285    }
     286    catch (Throwable ex)
     287    {
     288      write("--Delete all derived bioassays FAILED");
    289289      ex.printStackTrace();
    290290      ok = false;
     
    305305    }
    306306  }
    307   static void write_item(int i, DerivedBioAssaySet dbas)
     307  static void write_item(int i, DerivedBioAssay dbas)
    308308    throws BaseException
    309309  {
     
    316316  }
    317317 
    318   static void write_item(int i, DerivedBioAssay ba)
    319     throws BaseException
    320   {
    321     if (!TestUtil.getSilent())
    322     {
    323       System.out.println(i+":\t"+ba.getId()+"\t"+ba.getName()+"\t"+
    324         ba.getDescription()+"\t"+ba.getBioAssaySet()+"\t"+ba.getExtract());
    325     }
    326   }
    327 
    328  
    329318  static void write(String message)
    330319  {
    331320    System.out.println(message);
    332   }
    333  
    334   static int test_add_bioassay(int bioAssaySetid, int extractId, String name)
    335   {
    336     if (bioAssaySetid == 0) return 0;
    337     int id = 0;
    338     DbControl dc = null;
    339     try
    340     {
    341       dc = TestUtil.getDbControl();
    342       DerivedBioAssaySet dbas = DerivedBioAssaySet.getById(dc, bioAssaySetid);
    343       Extract extract = null;
    344       if (extractId != 0) extract = Extract.getById(dc, extractId);
    345       DerivedBioAssay ba = dbas.newBioAssay(extract);
    346       ba.setName(name);
    347       ba.setDescription("Added at "+new Date());
    348       dc.saveItem(ba);
    349       dc.commit();
    350       id = ba.getId();
    351       dc = TestUtil.getDbControl();
    352       dc.reattachItem(ba, false);
    353       write_item(0, ba);
    354       write("--Add bioassay to bioassay set OK");
    355     }
    356     catch (Throwable ex)
    357     {
    358       write("--Add bioassay to bioassay set FAILED");
    359       ex.printStackTrace();
    360       ok = false;
    361     }
    362     finally
    363     {
    364       if (dc != null) dc.close();
    365     }
    366     return id;
    367321  }
    368322 
     
    374328    {
    375329      dc = TestUtil.getDbControl();
    376       DerivedBioAssaySet parent = DerivedBioAssaySet.getById(dc, id);
    377       ItemResultList<DerivedBioAssaySet> l = parent.getChildren().list(dc);
     330      DerivedBioAssay parent = DerivedBioAssay.getById(dc, id);
     331      ItemResultList<DerivedBioAssay> l = parent.getChildren().list(dc);
    378332      for (int i = 0; i<l.size(); i++)
    379333      {
     
    384338        throw new BaseException("Expected "+expectedResults+" results, not "+l.size());
    385339      }
    386       write("--List child derived bioassay sets OK ("+l.size()+")");
    387     }
    388     catch (Throwable ex)
    389     {
    390       write("--List child derived bioassay sets FAILED");
    391       ex.printStackTrace();
    392       ok = false;
    393     }
    394     finally
    395     {
    396       if (dc != null) dc.close();
    397     }
    398   }
    399 
    400   static void test_list_bioassays(int id, int expectedResults)
    401   {
    402     if (id == 0) return;
    403     DbControl dc = null;
    404     try
    405     {
    406       dc = TestUtil.getDbControl();
    407       DerivedBioAssaySet parent = DerivedBioAssaySet.getById(dc, id);
    408       ItemResultList<DerivedBioAssay> l = parent.getBioAssays().list(dc);
    409       for (int i = 0; i<l.size(); i++)
    410       {
    411         write_item(i, l.get(i));
    412       }
    413       if (expectedResults >= 0 && expectedResults != l.size())
    414       {
    415         throw new BaseException("Expected "+expectedResults+" results, not "+l.size());
    416       }
    417340      write("--List child derived bioassays OK ("+l.size()+")");
    418341    }
  • trunk/src/test/TestGenericOverview.java

    r5663 r5685  
    2525import net.sf.basedb.core.DataFileType;
    2626import net.sf.basedb.core.DbControl;
    27 import net.sf.basedb.core.DerivedBioAssaySet;
     27import net.sf.basedb.core.DerivedBioAssay;
    2828import net.sf.basedb.core.Extract;
    2929import net.sf.basedb.core.Hardware;
     
    7373    int milliWatt = TestUnit.test_load_by_symbol(power, "mW");
    7474    int scanPower = TestAnnotationType.test_create("Power", Type.FLOAT, milliWatt,
    75         null, null, Item.DERIVEDBIOASSAYSET, 1, null, false);
     75        null, null, Item.DERIVEDBIOASSAY, 1, null, false);
    7676    TestProtocol.test_set_protocol_parameter(scanningProtocol, scanPower);
    7777
     
    128128
    129129    // Scan
    130     int scan = TestDerivedBioAssaySet.test_create_root("Scanned hyb", hyb,
    131         SystemItems.getId(DerivedBioAssaySet.SCAN), scanningProtocol, scanner, 0);
    132     TestAnnotation.test_annotatate(Item.DERIVEDBIOASSAYSET, scan, scanPower, 0, 15.0f);
    133     int scannedAssayId1 = TestDerivedBioAssaySet.test_add_bioassay(scan, labeledExtract1, "Scanned GO #1");
    134     int scannedAssayId2 = TestDerivedBioAssaySet.test_add_bioassay(scan, labeledExtract2, "Scanned GO #2");
     130    int scan = TestDerivedBioAssay.test_create_root("Scanned hyb", hyb,
     131        SystemItems.getId(DerivedBioAssay.SCAN), scanningProtocol, scanner, 0);
     132    TestAnnotation.test_annotatate(Item.DERIVEDBIOASSAY, scan, scanPower, 0, 15.0f);
     133//    int scannedAssayId1 = TestDerivedBioAssaySet.test_add_bioassay(scan, labeledExtract1, "Scanned GO #1");
     134//    int scannedAssayId2 = TestDerivedBioAssaySet.test_add_bioassay(scan, labeledExtract2, "Scanned GO #2");
    135135   
    136136    // Raw bioassay #1
    137     int rawBioAssay1 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "RBA #1", scannedAssayId1, software, featureProtocol, arrayDesign, false);
     137    int rawBioAssay1 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "RBA #1", scan, software, featureProtocol, arrayDesign, false);
    138138    TestDataFileType.test_set_file(Item.RAWBIOASSAY, rawBioAssay1, DataFileType.GENERIC_RAW_DATA, genePixFile);
    139139    TestDataFileType.test_set_file(Item.RAWBIOASSAY, rawBioAssay1, DataFileType.AFFYMETRIX_CEL, celFile);
     
    141141
    142142    // Raw bioassay #2
    143     int rawBioAssay2 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "RBA #2", scannedAssayId2, software, featureProtocol, arrayDesign, false);
     143    int rawBioAssay2 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "RBA #2", scan, software, featureProtocol, arrayDesign, false);
    144144    TestDataFileType.test_set_file(Item.RAWBIOASSAY, rawBioAssay2, DataFileType.GENERIC_RAW_DATA, genePixFile);
    145145
     
    156156   
    157157    // Sequencing
    158     int sequencing = TestDerivedBioAssaySet.test_create_root("Sequenced GO", flowCell,
    159       SystemItems.getId(DerivedBioAssaySet.SEQUENCED), sequencingProtocol, sequencer, 0);
    160     int assembly = TestDerivedBioAssaySet.test_create_child("Assembly GO", sequencing,
    161       SystemItems.getId(DerivedBioAssaySet.ASSEMBLY), 0, 0, alignmentSoftware);
    162     int alignedAssayId1 = TestDerivedBioAssaySet.test_add_bioassay(assembly, library1, "Aligned GO #1");
    163     int alignedAssayId2 = TestDerivedBioAssaySet.test_add_bioassay(assembly, library2, "Aligned GO #2");
     158    int sequencing = TestDerivedBioAssay.test_create_root("Sequenced GO", flowCell,
     159      SystemItems.getId(DerivedBioAssay.SEQUENCED), sequencingProtocol, sequencer, 0);
     160   
     161    int alignedAssayId1 = TestDerivedBioAssay.test_create_child("Aligned GO #1", sequencing,
     162      SystemItems.getId(DerivedBioAssay.ASSEMBLY), 0, 0, alignmentSoftware);
     163    int alignedAssayId2 = TestDerivedBioAssay.test_create_child("Aligned GO #2", sequencing,
     164        SystemItems.getId(DerivedBioAssay.ASSEMBLY), 0, 0, alignmentSoftware);
    164165    TestDataFileType.test_set_file(Item.DERIVEDBIOASSAY, alignedAssayId1, DataFileType.SAM, samFile);
    165166    TestDataFileType.test_set_file(Item.DERIVEDBIOASSAY, alignedAssayId2, DataFileType.SAM, samFile);
     
    187188    TestRawBioAssay.test_delete(seqRaw1);
    188189    TestRawBioAssay.test_delete(seqRaw2);
    189     TestDerivedBioAssaySet.test_delete(assembly);
    190     TestDerivedBioAssaySet.test_delete(sequencing);
     190    TestDerivedBioAssay.test_delete(alignedAssayId1);
     191    TestDerivedBioAssay.test_delete(alignedAssayId2);
     192    TestDerivedBioAssay.test_delete(sequencing);
    191193    TestPhysicalBioAssay.test_delete(flowCell);
    192194    TestExtract.test_delete(library1);
     
    195197    TestRawBioAssay.test_delete(rawBioAssay1);
    196198    TestRawBioAssay.test_delete(rawBioAssay2);
    197     TestDerivedBioAssaySet.test_delete(scan);
     199    TestDerivedBioAssay.test_delete(scan);
    198200    TestPhysicalBioAssay.test_delete(hyb);
    199201    TestArraySlide.test_delete(arraySlide);
  • trunk/src/test/TestMetadata.java

    r5657 r5685  
    2828import net.sf.basedb.core.DbControl;
    2929import net.sf.basedb.core.DerivedBioAssay;
    30 import net.sf.basedb.core.DerivedBioAssaySet;
    3130import net.sf.basedb.core.Extract;
    3231import net.sf.basedb.core.Formula;
     
    6059      test_create_property_path(RawBioAssay.class, "name", false);
    6160    // Association + id property
    62     PropertyPath<RawBioAssay, DerivedBioAssaySet> scan =
     61    PropertyPath<RawBioAssay, DerivedBioAssay> scan =
    6362      test_create_property_path(RawBioAssay.class, "parent.bioAssaySet.id", false);
    6463    // Null association
     
    8483   
    8584    // Collection of entities should fail
    86     test_create_property_path(DerivedBioAssaySet.class, "bioAssays", true);
     85    test_create_property_path(DerivedBioAssay.class, "bioAssays", true);
    8786   
    8887    int designId = TestArrayDesign.test_create(Platform.GENERIC, true);
  • trunk/src/test/TestRawBioAssay.java

    r5657 r5685  
    5555   
    5656    int hybridizationId = TestPhysicalBioAssay.test_create(0, "Test hyb", 0, 1);
    57     int bioAssaySetId = TestDerivedBioAssaySet.test_create_root("Scan", hybridizationId,
    58       SystemItems.getId(DerivedBioAssaySet.SCAN), 0, 0, 0);
    59     int bioAssayId = TestDerivedBioAssaySet.test_add_bioassay(bioAssaySetId, 0, "Bioassay 1");
     57    int bioAssaySetId = TestDerivedBioAssay.test_create_root("Scan", hybridizationId,
     58      SystemItems.getId(DerivedBioAssay.SCAN), 0, 0, 0);
    6059    int arrayDesignId = TestArrayDesign.test_create(Platform.GENERIC, false);
    6160    int arrayDesignId2 = TestArrayDesign.test_create(Platform.GENERIC, false);
     
    7271   
    7372    // Standard tests: create, load, list
    74     int id = test_create(Platform.GENERIC, "genepix", null, bioAssayId, softwareId, protocolId, arrayDesignId, true);
     73    int id = test_create(Platform.GENERIC, "genepix", null, bioAssaySetId, softwareId, protocolId, arrayDesignId, true);
    7574    int id2 = test_create(Platform.GENERIC, "genepix", null, 0, 0, 0, 0, false);   
    7675    int id3 = test_create(Platform.AFFYMETRIX, null, null, 0, 0, 0, 0, false);
     
    105104
    106105    TestFile.test_delete(celId);
    107     TestDerivedBioAssaySet.test_delete(bioAssaySetId);
     106    TestDerivedBioAssay.test_delete(bioAssaySetId);
    108107    TestPhysicalBioAssay.test_delete(hybridizationId);
    109108    TestArrayDesign.test_delete(arrayDesignId);
  • trunk/src/test/net/sf/basedb/test/roles/PowerUserTest.java

    r5652 r5685  
    134134      Unit volt = potential.getUnit("V");
    135135      AnnotationType pmtGain = createProtocolParameter(dc, "PMT gain",
    136           Type.FLOAT, volt, null, new Item[] { Item.DERIVEDBIOASSAYSET }
     136          Type.FLOAT, volt, null, new Item[] { Item.DERIVEDBIOASSAY }
    137137      );
    138138     
  • trunk/src/test/net/sf/basedb/test/roles/UserTest.java

    r5663 r5685  
    3333import net.sf.basedb.core.DataFileType;
    3434import net.sf.basedb.core.DbControl;
    35 import net.sf.basedb.core.DerivedBioAssaySet;
     35import net.sf.basedb.core.DerivedBioAssay;
    3636import net.sf.basedb.core.Experiment;
    3737import net.sf.basedb.core.Extract;
     
    169169      Sample sRef = null;
    170170     
    171       DerivedBioAssaySet sc1 = null;
    172       DerivedBioAssaySet sc2 = null;
    173       DerivedBioAssaySet sc1DyeSwap = null;
    174       DerivedBioAssaySet sc2DyeSwap = null;
    175       DerivedBioAssaySet affyScan1 = null;
    176       DerivedBioAssaySet affyScan2 = null;
    177       DerivedBioAssaySet affyScan3 = null;
     171      DerivedBioAssay sc1 = null;
     172      DerivedBioAssay sc2 = null;
     173      DerivedBioAssay sc1DyeSwap = null;
     174      DerivedBioAssay sc2DyeSwap = null;
     175      DerivedBioAssay affyScan1 = null;
     176      DerivedBioAssay affyScan2 = null;
     177      DerivedBioAssay affyScan3 = null;
    178178
    179179      RawBioAssay rba1 = null;
     
    278278        importHybridizations(hybridizationBatchImporter, batchImportFile_Hybridization);     
    279279        importScans(scanBatchImporter, batchImportFile_Scan);
    280         importAnnotations(annotationImporter, batchImportFile_Scan, Item.DERIVEDBIOASSAYSET, getScanColumnHeaders(), "\\t");
     280        importAnnotations(annotationImporter, batchImportFile_Scan, Item.DERIVEDBIOASSAY, getScanColumnHeaders(), "\\t");
    281281        importRawBioAssays(rawBioAssayBatchImporter, batchImportFile_RawBioAssay);
    282282        bioSource = Util.findBioSource(dc, "Biosource A");
     
    458458    Create a scan.
    459459  */
    460   public static DerivedBioAssaySet createScan(DbControl dc, String name, PhysicalBioAssay hyb, Float pmtGain, Unit unit)
     460  public static DerivedBioAssay createScan(DbControl dc, String name, PhysicalBioAssay hyb, Float pmtGain, Unit unit)
    461461  {
    462462    TestUtil.write("--Creating scan: " + name + "\n");
    463     DerivedBioAssaySet scan = DerivedBioAssaySet.getNew(dc, hyb);
    464     scan.setItemSubtype(ItemSubtype.getById(dc, SystemItems.getId(DerivedBioAssaySet.SCAN)));
     463    DerivedBioAssay scan = DerivedBioAssay.getNew(dc, hyb);
     464    scan.setItemSubtype(ItemSubtype.getById(dc, SystemItems.getId(DerivedBioAssay.SCAN)));
    465465    scan.setName(name);
    466466    scan.setProtocol(Util.findProtocol(dc, "Scanning A"));
     
    470470    if (pmtGain != null)
    471471    {
    472       AnnotationType at = Util.findAnnotationType(dc, "PMT gain", Item.DERIVEDBIOASSAYSET);
     472      AnnotationType at = Util.findAnnotationType(dc, "PMT gain", Item.DERIVEDBIOASSAY);
    473473      Util.setAnnotation(scan, at, pmtGain, unit);
    474474    }
     
    481481  */
    482482  public static RawBioAssay createRawBioAssay(DbControl dc, Platform platform,
    483     RawDataType rawDataType, String name, DerivedBioAssaySet scan, ArrayDesign design)
     483    RawDataType rawDataType, String name, DerivedBioAssay scan, ArrayDesign design)
    484484  {
    485485    TestUtil.write("--Creating raw bioassay: " + name + "\n");
  • trunk/src/test/net/sf/basedb/test/roles/Util.java

    r5652 r5685  
    3535import net.sf.basedb.core.BioSource;
    3636import net.sf.basedb.core.DbControl;
    37 import net.sf.basedb.core.DerivedBioAssaySet;
     37import net.sf.basedb.core.DerivedBioAssay;
    3838import net.sf.basedb.core.Experiment;
    3939import net.sf.basedb.core.Formula;
     
    321321    Returns the first scan that was found with a certain name
    322322   */
    323   public static DerivedBioAssaySet findScan(DbControl dc, String name)
    324   {
    325     ItemQuery<DerivedBioAssaySet> query = DerivedBioAssaySet.getQuery();
    326     query.restrict(Restrictions.eq(Hql.property("itemSubtype"), Expressions.integer(SystemItems.getId(DerivedBioAssaySet.SCAN))));
     323  public static DerivedBioAssay findScan(DbControl dc, String name)
     324  {
     325    ItemQuery<DerivedBioAssay> query = DerivedBioAssay.getQuery();
     326    query.restrict(Restrictions.eq(Hql.property("itemSubtype"), Expressions.integer(SystemItems.getId(DerivedBioAssay.SCAN))));
    327327    query.restrict(Restrictions.eq(Hql.property("name"), Expressions.string(name)));
    328328    return query.list(dc).get(0);
  • trunk/www/include/menu.jsp

    r5657 r5685  
    464464    final boolean createMessages        =  sc.hasPermission(Permission.CREATE, Item.MESSAGE);
    465465
    466     final boolean hasPhysicalBioAssays     = !sc.hasPermission(Permission.DENIED, Item.PHYSICALBIOASSAY);
    467     final boolean hasDerivedBioAssaySets   = !sc.hasPermission(Permission.DENIED, Item.DERIVEDBIOASSAYSET);
     466    final boolean hasPhysicalBioAssays  = !sc.hasPermission(Permission.DENIED, Item.PHYSICALBIOASSAY);
     467    final boolean hasDerivedBioAssays   = !sc.hasPermission(Permission.DENIED, Item.DERIVEDBIOASSAY);
    468468
    469469    final boolean hasRawBioAssays       = !sc.hasPermission(Permission.DENIED, Item.RAWBIOASSAY);
     
    550550      />
    551551      <m:menuitem
    552         title="<%=common.getString("item.derivedbioassayset+")%>"
    553         onclick="<%="Menu.openUrl('"+root+"views/derivedbioassaysets/index.jsp?ID="+ID+"')"%>"
    554         tooltip="<%=menu.getString("derivedbioassaysets.tooltip", hasDerivedBioAssaySets)%>"
    555         enabled="<%=hasDerivedBioAssaySets%>"
     552        title="<%=common.getString("item.derivedbioassay+")%>"
     553        onclick="<%="Menu.openUrl('"+root+"views/derivedbioassays/index.jsp?ID="+ID+"')"%>"
     554        tooltip="<%=menu.getString("derivedbioassays.tooltip", hasDerivedBioAssays)%>"
     555        enabled="<%=hasDerivedBioAssays%>"
    556556      />
    557557      <m:menuitem
  • trunk/www/include/scripts/main.js

    r5657 r5685  
    531531    this.controllers['FORMULA'] = { url:'views/formulas/index.jsp', width:850, height:600 };
    532532    this.controllers['PHYSICALBIOASSAY'] = { url:'views/physicalbioassays/index.jsp', width:800, height:500 };
    533     this.controllers['DERIVEDBIOASSAYSET'] = { url:'views/derivedbioassaysets/index.jsp', width:800, height:500 };
    534     this.controllers['DERIVEDBIOASSAY'] = { url:'views/derivedbioassaysets/bioassays/index.jsp', width:800, height:500 };
     533    this.controllers['DERIVEDBIOASSAY'] = { url:'views/derivedbioassays/index.jsp', width:800, height:500 };
    535534    this.controllers['RAWBIOASSAY'] = { url:'views/rawbioassays/index.jsp', width:800, height:500 };
    536535    this.controllers['RAWDATA'] = { url:'views/rawbioassays/rawdata/index.jsp', width:700, height:500, popup: true, edit:false };
  • trunk/www/views/derivedbioassays/edit_bioassay.jsp

    r5684 r5685  
    2020  ------------------------------------------------------------------
    2121--%>
    22 <%@page import="net.sf.basedb.core.PhysicalBioAssay"%>
    2322<%@ page pageEncoding="UTF-8" session="false"
    2423  import="net.sf.basedb.core.SessionControl"
    2524  import="net.sf.basedb.core.DbControl"
    26   import="net.sf.basedb.core.DerivedBioAssaySet"
     25  import="net.sf.basedb.core.DerivedBioAssay"
     26  import="net.sf.basedb.core.PhysicalBioAssay"
     27  import="net.sf.basedb.core.Extract"
    2728  import="net.sf.basedb.core.ItemSubtype"
    2829  import="net.sf.basedb.core.Protocol"
     
    5354<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %>
    5455<%
    55 final Item itemType = Item.DERIVEDBIOASSAYSET;
     56final Item itemType = Item.DERIVEDBIOASSAY;
    5657final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
    5758final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
     
    6263try
    6364{
    64   DerivedBioAssaySet bioAssaySet = null;
     65  DerivedBioAssay bioAssay = null;
    6566  String title = null;
    6667 
     
    7071  boolean readCurrentPhysicalBioAssay = true;
    7172  PhysicalBioAssay currentPhysicalBioAssay = null;
    72   DerivedBioAssaySet currentParentBioAssaySet = null;
    7373 
     74  boolean readCurrentParentBioAssay = true;
     75  DerivedBioAssay currentParentBioAssay = null;
     76 
     77  boolean readCurrentExtract = true;
     78  Extract currentExtract = null;
     79
    7480  boolean readCurrentProtocol = true;
    7581  Protocol currentProtocol = null;
     
    8692  // Load recently used items
    8793  List<PhysicalBioAssay> recentPhysicalBioAssays = (List<PhysicalBioAssay>)cc.getRecent(dc, Item.PHYSICALBIOASSAY);
    88   List<DerivedBioAssaySet> recentParentBioAssaySets = (List<DerivedBioAssaySet>)cc.getRecent(dc, Item.DERIVEDBIOASSAYSET);
     94  List<DerivedBioAssay> recentParentBioAssays = (List<DerivedBioAssay>)cc.getRecent(dc, Item.DERIVEDBIOASSAY);
    8995  List<Protocol> recentProtocols = (List<Protocol>)cc.getRecent(dc, Item.PROTOCOL);
    9096  List<Hardware> recentHardware = (List<Hardware>)cc.getRecent(dc, Item.HARDWARE);
     
    9399  if (itemId == 0)
    94100  {
    95     title = "New bioassay set";
     101    title = "New derived bioassay";
    96102    cc.removeObject("item");
    97103    currentSubtypeId = Values.getInt(request.getParameter("subtype_id"));
     
    105111    if (parentId != 0)
    106112    {
    107       currentParentBioAssaySet = DerivedBioAssaySet.getById(dc, parentId);
     113      currentParentBioAssay = DerivedBioAssay.getById(dc, parentId);
    108114      try
    109115      {
    110         currentPhysicalBioAssay = currentParentBioAssaySet.getPhysicalBioAssay();
     116        currentPhysicalBioAssay = currentParentBioAssay.getPhysicalBioAssay();
    111117      }
    112118      catch (PermissionDeniedException ex)
     
    114120        readCurrentPhysicalBioAssay = false;
    115121      }
     122      try
     123      {
     124        currentExtract = currentParentBioAssay.getExtract();
     125      }
     126      catch (PermissionDeniedException ex)
     127      {}
    116128    }
    117129    else
     
    127139  else
    128140  {
    129     bioAssaySet = DerivedBioAssaySet.getById(dc, itemId);
    130     bioAssaySet.checkPermission(Permission.WRITE);
    131     cc.setObject("item", bioAssaySet);
    132     title = "Edit bioassay set -- " + HTML.encodeTags(bioAssaySet.getName());
     141    bioAssay = DerivedBioAssay.getById(dc, itemId);
     142    bioAssay.checkPermission(Permission.WRITE);
     143    cc.setObject("item", bioAssay);
     144    title = "Edit bioassay -- " + HTML.encodeTags(bioAssay.getName());
    133145   
    134146    try
    135147    {
    136       ItemSubtype subtype = bioAssaySet.getItemSubtype();
     148      ItemSubtype subtype = bioAssay.getItemSubtype();
    137149      if (subtype != null) currentSubtypeId = subtype.getId();
    138150    }
     
    143155    try
    144156    {
    145       currentPhysicalBioAssay = bioAssaySet.getPhysicalBioAssay();
     157      currentParentBioAssay = bioAssay.getParent();
    146158    }
    147159    catch (PermissionDeniedException ex)
    148160    {
     161      readCurrentParentBioAssay = false;
     162    }
     163    try
     164    {
     165      currentPhysicalBioAssay = bioAssay.getPhysicalBioAssay();
     166    }
     167    catch (PermissionDeniedException ex)
     168    {
    149169      readCurrentPhysicalBioAssay = false;
    150170    }
    151171    try
    152172    {
    153       currentProtocol = bioAssaySet.getProtocol();
     173      currentExtract = bioAssay.getExtract();
    154174    }
    155175    catch (PermissionDeniedException ex)
    156176    {
     177      readCurrentExtract = false;
     178    }
     179    try
     180    {
     181      currentProtocol = bioAssay.getProtocol();
     182    }
     183    catch (PermissionDeniedException ex)
     184    {
    157185      readCurrentProtocol = false;
    158186    }
    159187    try
    160188    {
    161       currentHardware = bioAssaySet.getHardware();
     189      currentHardware = bioAssay.getHardware();
    162190    }
    163191    catch (PermissionDeniedException ex)
     
    167195    try
    168196    {
    169       currentSoftware = bioAssaySet.getSoftware();
     197      currentSoftware = bioAssay.getSoftware();
    170198    }
    171199    catch (PermissionDeniedException ex)
     
    180208  final String clazz = "class=\"text\"";
    181209  final String requiredClazz = "class=\"text required\"";
    182   JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), bioAssaySet);
     210  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), bioAssay);
    183211  ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext);
    184212  %>
     
    188216    <ext:stylesheets context="<%=jspContext%>" />
    189217    <script language="JavaScript">
    190     // Validate the "BioAssaySet" tab
    191     function validateBioAssaySet()
    192     {
    193       var frm = document.forms['bioAssaySet'];
     218    // Validate the "BioAssay" tab
     219    function validateBioAssay()
     220    {
     221      var frm = document.forms['bioAssay'];
    194222      if (Main.trimString(frm.name.value) == '')
    195223      {
     
    213241          if (frm.parent_id.selectedIndex < 0)
    214242          {
    215             alert("You must select a parent bioassay set");
     243            alert("You must select a parent bioassay");
    216244            frm.parent_id.focus();
    217245            return false;
     
    226254    function saveSettings()
    227255    {
    228       var frm = document.forms['bioAssaySet'];
     256      var frm = document.forms['bioAssay'];
    229257      if (TabControl.validateActiveTab('settings'))
    230258      {
     
    290318    function getProtocolId()
    291319    {
    292       var frm = document.forms['bioAssaySet'];
     320      var frm = document.forms['bioAssay'];
    293321      var protocolId = 0;
    294322      if (frm.protocol_id.length > 0 && !frm.protocol_id.disabled)
     
    301329    function getParents()
    302330    {
    303       var frm = document.forms['bioAssaySet'];
     331      var frm = document.forms['bioAssay'];
    304332      if (!frm.physicalbioassay_id) return;
    305333     
     
    312340      else
    313341      {
    314         var bioAssaySetId = Math.abs(parseInt(frm.parent_id[frm.parent_id.selectedIndex].value));
    315         if (bioAssaySetId > 0) parents[parents.length] = 'DERIVEDBIOASSAYSET:'+bioAssaySetId;
     342        var bioAssayId = Math.abs(parseInt(frm.parent_id[frm.parent_id.selectedIndex].value));
     343        if (bioAssayId > 0) parents[parents.length] = 'DERIVEDBIOASSAY:'+bioAssayId;
    316344      }
    317345      return parents;
    318 
    319346    }
    320347   
    321348    function selectProtocolOnClick()
    322349    {
    323       var frm = document.forms['bioAssaySet'];
     350      var frm = document.forms['bioAssay'];
    324351      var url = '../../../admin/protocols/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone';
    325352      url += '&callback=setProtocolCallback&resetTemporary=1';
    326       url += ItemSubtype.createRelatedFilter('bioAssaySet', 'PROTOCOL');
     353      url += ItemSubtype.createRelatedFilter('bioAssay', 'PROTOCOL');
    327354      if (frm.protocol_id.length > 1)
    328355      {
     
    334361    function setProtocolCallback(id, name)
    335362    {
    336       var frm = document.forms['bioAssaySet'];
     363      var frm = document.forms['bioAssay'];
    337364      var list = frm.protocol_id;
    338365      if (list.length < 2 || list[1].value == '0') // >
     
    352379    function selectPhysicalBioAssayOnClick()
    353380    {
    354       var frm = document.forms['bioAssaySet'];
     381      var frm = document.forms['bioAssay'];
    355382      var url = '../physicalbioassays/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone';
    356383      url += '&callback=setPhysicalBioAssayCallback&resetTemporary=1';
    357       url += ItemSubtype.createRelatedFilter('bioAssaySet', 'PHYSICALBIOASSAY');
     384      url += ItemSubtype.createRelatedFilter('bioAssay', 'PHYSICALBIOASSAY');
    358385      if (frm.physicalbioassay_id.selectedIndex >= 0)
    359386      {
     
    365392    function setPhysicalBioAssayCallback(id, name)
    366393    {
    367       var frm = document.forms['bioAssaySet'];
     394      var frm = document.forms['bioAssay'];
    368395      var list = frm.physicalbioassay_id;
     396      if (list.length < 1 || list[0].value == '0') // >
     397      {
     398        Forms.addListOption(list, 0, new Option());
     399      }
     400      list[0].value = id;
     401      list[0].text = name;
     402      list.selectedIndex = 0;
     403      physicalBioAssayOnChange();
     404    }
     405    function physicalBioAssayOnChange()
     406    {
     407      parentsChanged = true;
     408      var frm = document.forms['bioAssay'];
     409      initExtracts();
     410    }
     411   
     412    function selectParentBioAssayOnClick()
     413    {
     414      var frm = document.forms['bioAssay'];
     415      var url = 'index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone';
     416      url += '&callback=setParentBioAssayCallback&resetTemporary=1';
     417      url += ItemSubtype.createRelatedFilter('bioAssay', 'DERIVEDBIOASSAY');
     418      if (frm.parent_id.selectedIndex >= 0)
     419      {
     420        var id = Math.abs(parseInt(frm.physicalbioassay_id[frm.parent_id.selectedIndex].value));       
     421        url += '&item_id='+id;
     422      }
     423      Main.openPopup(url, 'SelectParentBioAssay', 1000, 700);
     424    }
     425    function setParentBioAssayCallback(id, name)
     426    {
     427      var frm = document.forms['bioAssay'];
     428      var list = frm.parent_id;
    369429      if (list.length < 1 || list[0].value == '0') // >
    370430      {
     
    376436      parentsChanged = true;
    377437    }
    378     function physicalBioAssayOnChange()
     438    function parentBioAssayOnChange()
    379439    {
    380440      parentsChanged = true;
    381441    }
    382442   
    383     function selectParentBioAssaySetOnClick()
    384     {
    385       var frm = document.forms['bioAssaySet'];
    386       var url = 'index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone';
    387       url += '&callback=setParentBioAssaySetCallback&resetTemporary=1';
    388       url += ItemSubtype.createRelatedFilter('bioAssaySet', 'DERIVEDBIOASSAYSET');
    389       if (frm.parent_id.selectedIndex >= 0)
    390       {
    391         var id = Math.abs(parseInt(frm.physicalbioassay_id[frm.parent_id.selectedIndex].value));       
    392         url += '&item_id='+id;
    393       }
    394       Main.openPopup(url, 'SelectParentBioAssaySet', 1000, 700);
    395     }
    396     function setParentBioAssaySetCallback(id, name)
    397     {
    398       var frm = document.forms['bioAssaySet'];
    399       var list = frm.parent_id;
    400       if (list.length < 1 || list[0].value == '0') // >
    401       {
    402         Forms.addListOption(list, 0, new Option());
    403       }
    404       list[0].value = id;
    405       list[0].text = name;
    406       list.selectedIndex = 0;
    407       parentsChanged = true;
    408     }
    409     function parentBioAssaySetOnChange()
    410     {
    411       parentsChanged = true;
    412     }
    413    
    414443    function selectHardwareOnClick()
    415444    {
    416       var frm = document.forms['bioAssaySet'];
     445      var frm = document.forms['bioAssay'];
    417446      var url = '../../../admin/hardware/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone';
    418447      url += '&callback=setHardwareCallback&resetTemporary=1';
    419       url += ItemSubtype.createRelatedFilter('bioAssaySet', 'HARDWARE');
     448      url += ItemSubtype.createRelatedFilter('bioAssay', 'HARDWARE');
    420449      if (frm.hardware_id.length > 1)
    421450      {
     
    427456    function setHardwareCallback(id, name)
    428457    {
    429       var frm = document.forms['bioAssaySet'];
     458      var frm = document.forms['bioAssay'];
    430459      var list = frm.hardware_id;
    431460      if (list.length < 2 || list[1].value == '0') // >
     
    439468    function selectSoftwareOnClick()
    440469    {
    441       var frm = document.forms['bioAssaySet'];
     470      var frm = document.forms['bioAssay'];
    442471      var url = '../../../admin/software/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone';
    443472      url += '&callback=setSoftwareCallback&resetTemporary=1';
    444       url += ItemSubtype.createRelatedFilter('bioAssaySet', 'SOFTWARE');
     473      url += ItemSubtype.createRelatedFilter('bioAssay', 'SOFTWARE');
    445474      if (frm.software_id.length > 1)
    446475      {
     
    452481    function setSoftwareCallback(id, name)
    453482    {
    454       var frm = document.forms['bioAssaySet'];
     483      var frm = document.forms['bioAssay'];
    455484      var list = frm.software_id;
    456485      if (list.length < 2 || list[1].value == '0') // >
     
    463492    }
    464493
    465    
    466494    function init()
    467495    {
    468       var frm = document.forms['bioAssaySet'];
     496      var frm = document.forms['bioAssay'];
    469497      <%
    470       if (bioAssaySet == null)
     498      if (bioAssay == null)
    471499      {
    472500        %>
     
    476504      }
    477505      %>
    478       isRootOnChange();
     506      if (frm.isRoot)
     507      {
     508        isRootOnChange();
     509      }
     510      else
     511      {
     512        initExtracts();
     513      }
    479514    }
    480515   
    481516    function isRootOnChange()
    482517    {
    483       var frm = document.forms['bioAssaySet'];
     518      var frm = document.forms['bioAssay'];
    484519      var isRoot = frm.isRoot[0].checked;
    485520      Main.showHide('physicalBioAssaySection', isRoot);
    486       Main.showHide('parentBioAssaySetSection', !isRoot);
    487     }
    488    
     521      Main.showHide('parentBioAssaySection', !isRoot);
     522      initExtracts();
     523    }
     524   
     525    function initExtracts()
     526    {
     527      var frm = document.forms['bioAssay'];
     528      frm.extract_id.length = 0;
     529      var extracts;
     530      <%
     531      if (bioAssay == null)
     532      {
     533        %>
     534        if (frm.isRoot[0].checked)
     535        {
     536          extracts = getExtractsFromPhysicalBioAssay(frm.physicalbioassay_id[frm.physicalbioassay_id.selectedIndex].value);
     537        }
     538        else
     539        {
     540          extracts = getExtractsFromParentBioassay(frm.parent_id[frm.parent_id.selectedIndex].value);
     541        }
     542        <%
     543      }
     544      else
     545      {
     546        if (currentParentBioAssay != null)
     547        {
     548          %>
     549          extracts = getExtractsFromParentBioassay(<%=currentParentBioAssay.getId()%>);
     550          <%
     551        }
     552        else if (currentPhysicalBioAssay != null)
     553        {
     554          %>
     555          extracts = getExtractsFromPhysicalBioAssay(<%=currentPhysicalBioAssay.getId()%>);
     556          <%
     557        }
     558      }
     559      %>
     560
     561      var frm = document.forms['bioAssay'];
     562      frm.extract_id.length = 0;
     563      frm.extract_id[frm.extract_id.length] = new Option('- none -', 0);
     564      var currentExtractId = <%=currentExtract == null ? 0 : currentExtract.getId()%>;
     565      var currentWasFound = 0;
     566      for (var i = 0; i < extracts.length; i++)
     567      {
     568        var position = extracts[i].position;
     569        var prefix = position ? position + ': ' : '';
     570        frm.extract_id[frm.extract_id.length] = new Option(prefix + extracts[i].name, extracts[i].id);
     571        if (currentExtractId == extracts[i].id)
     572        {
     573          frm.extract_id.selectedIndex = frm.extract_id.length - 1;
     574          currentWasFound = 1;
     575        }
     576      }
     577      <%
     578      if (currentExtract != null)
     579      {
     580        %>
     581        if (currentExtractId && !currentWasFound)
     582        {
     583          frm.extract_id[frm.extract_id.length] = new Option('<%=HTML.javaScriptEncode(currentExtract.getName())%>', currentExtractId);
     584          frm.extract_id.selectedIndex = frm.extract_id.length - 1;
     585        }
     586        <%
     587      }
     588      %>
     589    }
     590   
     591    function getExtractsFromPhysicalBioAssay(physicalBioAssayId)
     592    {
     593      var request = Ajax.getXmlHttpRequest();
     594      var url = '../physicalbioassays/ajax.jsp?ID=<%=ID%>&cmd=GetSources';
     595      url += '&item_id=' + physicalBioAssayId;
     596      request.open("GET", url, false);
     597      request.send(null);
     598     
     599      var response = JSON.parse(request.responseText);
     600      if (response.status != 'ok')
     601      {
     602        alert(response.message);
     603        return;
     604      }
     605      return response.sources;
     606    }
     607 
     608    function getExtractsFromParentBioassay(bioAssayId)
     609    {
     610      var request = Ajax.getXmlHttpRequest();
     611      var url = 'ajax.jsp?ID=<%=ID%>&cmd=GetExtracts';
     612      url += '&item_id=' + bioAssayId;
     613      request.open("GET", url, false);
     614      request.send(null);
     615
     616      var response = JSON.parse(request.responseText);
     617      if (response.status != 'ok')
     618      {
     619        alert(response.message);
     620        return;
     621      }
     622     
     623      return response.sources;
     624    }
    489625    </script>
    490626  </base:head>
    491627  <base:body onload="init()">
    492628    <p>
    493     <form action="index.jsp?ID=<%=ID%>" method="post" name="bioAssaySet" onsubmit="return false;">
     629    <form action="index.jsp?ID=<%=ID%>" method="post" name="bioAssay" onsubmit="return false;">
    494630    <input type="hidden" name="cmd" value="UpdateItem">
    495631
    496632    <h3 class="docked"><%=title%> <base:help tabcontrol="settings" /></h3>
    497633    <t:tabcontrol id="settings" contentstyle="<%="height: "+(int)(scale*370)+"px;"%>"
    498       position="bottom"  remember="<%=bioAssaySet != null%>" switch="switchTab"
     634      position="bottom"  remember="<%=bioAssay != null%>" switch="switchTab"
    499635      extensions="<%=invoker%>">
    500     <t:tab id="info" title="Bioassay set" validate="validateBioAssaySet()" helpid="bioassayset.edit">
     636    <t:tab id="info" title="Bioassay" validate="validateBioAssay()" helpid="derivedbioassay.edit">
    501637      <table class="form" cellspacing=0>
    502638      <tr>
    503639        <td class="prompt" width="120px">Name</td>
    504640        <td><input <%=requiredClazz%> type="text" name="name"
    505           value="<%=HTML.encodeTags(bioAssaySet == null ? Values.getString(cc.getPropertyValue("name"), "New bioassay set") : bioAssaySet.getName())%>"
    506           size="40" maxlength="<%=DerivedBioAssaySet.MAX_NAME_LENGTH%>"></td>
     641          value="<%=HTML.encodeTags(bioAssay == null ? Values.getString(cc.getPropertyValue("name"), "New derived bioassay") : bioAssay.getName())%>"
     642          size="40" maxlength="<%=DerivedBioAssay.MAX_NAME_LENGTH%>"></td>
    507643      </tr>
    508644
     
    529665              if (id != currentSubtypeId && subtype.isRemoved()) continue;
    530666              %>
    531               <option value="<%=id == currentSubtypeId && bioAssaySet != null ? -id : id%>"
     667              <option value="<%=id == currentSubtypeId && bioAssay != null ? -id : id%>"
    532668                <%=id == currentSubtypeId ? "selected" : ""%>
    533669                title="<%=HTML.encodeTags(subtype.getDescription()) %>"
     
    541677      </tr>
    542678      <%
    543       if (bioAssaySet == null)
     679      if (bioAssay == null)
    544680      {
    545681        %>
     
    548684          <td>
    549685            <input id="isRoot" type="radio" name="isRoot" value="1"
    550               <%=currentParentBioAssaySet == null ? "checked" : "" %>
     686              <%=currentParentBioAssay == null ? "checked" : "" %>
    551687              onchange="isRootOnChange()"><label for="isRoot">Physical bioassay</label>
    552688            <input id="isChild" type="radio" name="isRoot" value="0"
    553               <%=currentParentBioAssaySet == null ? "" : "checked" %>
    554               onchange="isRootOnChange()"><label for="isChild">Other bioassay set</label><br>
     689              <%=currentParentBioAssay == null ? "" : "checked" %>
     690              onchange="isRootOnChange()"><label for="isChild">Derived bioassay</label><br>
    555691          </td>
    556692        </tr>
     
    570706          </td>
    571707        </tr>
    572         <tr id="parentBioAssaySetSection" style="display: none;">
    573           <td class="subprompt">-bioassay set</td>
     708        <tr id="parentBioAssaySection" style="display: none;">
     709          <td class="subprompt">-bioassay</td>
    574710          <td>
    575711            <base:select
     
    577713              clazz="selectionlist unchangeable"
    578714              required="true"
    579               current="<%=currentParentBioAssaySet%>"
    580               recent="<%=recentParentBioAssaySets%>"
     715              current="<%=currentParentBioAssay%>"
     716              recent="<%=recentParentBioAssays%>"
    581717              newitem="true"
    582               onselect="selectParentBioAssaySetOnClick()"
    583               onchange="parentBioAssaySetOnChange()"
     718              onselect="selectParentBioAssayOnClick()"
     719              onchange="parentBioAssayOnChange()"
    584720            />
    585721          </td>
     
    588724      }
    589725      %>
     726      <tr>
     727        <td class="prompt">Extract</td>
     728        <td>
     729          <select name="extract_id" class="selectionlist"></select>
     730        </td>
     731      </tr>
    590732      <tr>
    591733        <td class="prompt">Protocol</td>
     
    599741            recent="<%=recentProtocols%>"
    600742            defaultitem="<%=defaultProtocol%>"
    601             newitem="<%=bioAssaySet == null%>"
     743            newitem="<%=bioAssay == null%>"
    602744            onselect="selectProtocolOnClick()"
    603745            onchange="protocolOnChange()"
     
    616758            recent="<%=recentHardware%>"
    617759            defaultitem="<%=defaultHardware%>"
    618             newitem="<%=bioAssaySet == null%>"
     760            newitem="<%=bioAssay == null%>"
    619761            onselect="selectHardwareOnClick()"
    620762          />
     
    632774            recent="<%=recentSoftware%>"
    633775            defaultitem="<%=defaultSoftware%>"
    634             newitem="<%=bioAssaySet == null%>"
     776            newitem="<%=bioAssay == null%>"
    635777            onselect="selectSoftwareOnClick()"
    636778          />
     
    642784        <td nowrap>
    643785          <textarea <%=clazz%> rows="4" cols="40" name="description" wrap="virtual"
    644             ><%=HTML.encodeTags(bioAssaySet == null ? cc.getPropertyValue("description") : bioAssaySet.getDescription())%></textarea>
    645           <a href="javascript:Main.zoom('Description', 'bioAssaySet', 'description')"
     786            ><%=HTML.encodeTags(bioAssay == null ? cc.getPropertyValue("description") : bioAssay.getDescription())%></textarea>
     787          <a href="javascript:Main.zoom('Description', 'bioAssay', 'description')"
    646788            title="Edit in larger window"><base:icon image="zoom.gif" /></a>
    647789        </td>
     
    649791      </table>
    650792      <div align=right>&nbsp;<i><base:icon image="required.gif" /> = required information</i>
    651       <%if (bioAssaySet == null) {%><br>
     793      <%if (bioAssay == null) {%><br>
    652794        <i><base:icon image="unchangeable.gif" /> = can't be changed later</i>
    653795      <%}%>
  • trunk/www/views/derivedbioassays/index.jsp

    r5657 r5685  
    2626  import="net.sf.basedb.core.SessionControl"
    2727  import="net.sf.basedb.core.DbControl"
    28   import="net.sf.basedb.core.DerivedBioAssaySet"
     28  import="net.sf.basedb.core.DerivedBioAssay"
    2929  import="net.sf.basedb.core.PhysicalBioAssay"
     30  import="net.sf.basedb.core.RawBioAssay"
    3031  import="net.sf.basedb.core.ItemSubtype"
     32  import="net.sf.basedb.core.Extract"
    3133  import="net.sf.basedb.core.Protocol"
    3234  import="net.sf.basedb.core.Software"
     
    4446  import="net.sf.basedb.core.PermissionDeniedException"
    4547  import="net.sf.basedb.core.ItemAlreadyExistsException"
    46   import="net.sf.basedb.core.query.Restriction"
     48  import="net.sf.basedb.core.query.Hql"
     49  import="net.sf.basedb.core.query.Orders"
     50  import="net.sf.basedb.core.query.Restrictions"
     51  import="net.sf.basedb.core.query.Expressions"
    4752  import="net.sf.basedb.util.RemovableUtil"
    4853  import="net.sf.basedb.util.ShareableUtil"
     
    5459  import="net.sf.basedb.core.plugin.GuiContext"
    5560  import="net.sf.basedb.util.extensions.ExtensionsInvoker"
     61  import="net.sf.basedb.util.formatter.NameableFormatter"
    5662  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
    5763  import="net.sf.basedb.clients.web.extensions.JspContext"
    5864  import="net.sf.basedb.clients.web.extensions.edit.EditUtil"
    5965  import="net.sf.basedb.clients.web.extensions.edit.OnSaveRenderer"
     66  import="net.sf.basedb.clients.web.plugins.ItemQueryLoader"
    6067  import="java.util.Enumeration"
    6168  import="java.util.Set"
     
    6875<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
    6976<%!
    70   private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,itemSubtype,physicalBioAssay,parent,description");
    71   private static final Item itemType = Item.DERIVEDBIOASSAYSET;
     77  private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,itemSubtype,physicalBioAssay,extract,parent,description");
     78  private static final Item itemType = Item.DERIVEDBIOASSAY;
     79 
     80  private static void registerExportUtils(ItemContext cc)
     81  {
     82    // Register formatters
     83    cc.setObject("export.formatter.&children(name)", new NameableFormatter());
     84    cc.setObject("export.formatter.&rawBioAssays(name)", new NameableFormatter());
     85   
     86    // Register dataloaders
     87    String bioassayParameter = "bioassay";
     88    // Child bioassays
     89    ItemQuery<DerivedBioAssay> dbasQuery = DerivedBioAssay.getQuery();
     90    dbasQuery.include(cc.getInclude());
     91    dbasQuery.restrict(Restrictions.eq(Hql.property("parent"), Expressions.parameter(bioassayParameter)));
     92    dbasQuery.order(Orders.asc(Hql.property("name")));
     93    cc.setObject("export.dataloader.&children(name)", new ItemQueryLoader(dbasQuery, bioassayParameter));
     94   
     95    // Child raw bioassays
     96    ItemQuery<RawBioAssay> rawQuery = RawBioAssay.getQuery();
     97    rawQuery.include(cc.getInclude());
     98    rawQuery.restrict(Restrictions.eq(Hql.property("parentBioAssay"), Expressions.parameter(bioassayParameter)));
     99    rawQuery.order(Orders.asc(Hql.property("name")));
     100    cc.setObject("export.dataloader.&rawBioAssays(name)", new ItemQueryLoader(rawQuery, bioassayParameter));
     101
     102  }
     103
    72104%>
    73105<%
     
    79111final String callback = request.getParameter("callback");
    80112final String itemId = request.getParameter("item_id");
    81 final String listPage = "list_bioassaysets.jsp?ID="+ID+"&item_id="+itemId
     113final String listPage = "list_bioassays.jsp?ID="+ID+"&item_id="+itemId
    82114  +(mode == null ? "" : "&mode="+mode)
    83115  +(callback == null ? "" : "&callback="+callback)
    84116  +(itemId == null ? "" : "&item_id="+itemId);
    85 final String viewPage = "view_bioassayset.jsp?ID="+ID;
    86 final String editPage = "edit_bioassayset.jsp?ID="+ID;
     117final String viewPage = "view_bioassay.jsp?ID="+ID;
     118final String editPage = "edit_bioassay.jsp?ID="+ID;
    87119
    88120String forward = null;
     
    142174    dc = sc.newDbControl();
    143175   
    144     DerivedBioAssaySet bas = (DerivedBioAssaySet)cc.getObject("item");
     176    DerivedBioAssay bas = (DerivedBioAssay)cc.getObject("item");
    145177    if (bas == null)
    146178    {
     
    150182      {
    151183        PhysicalBioAssay bioAssay = PhysicalBioAssay.getById(dc, physicalBioAssayId);
    152         bas = DerivedBioAssaySet.getNew(dc, bioAssay);
     184        bas = DerivedBioAssay.getNew(dc, bioAssay);
    153185        cc.setRecent(bioAssay, maxRecent);
    154186      }
    155187      else
    156188      {
    157         DerivedBioAssaySet parent = DerivedBioAssaySet.getById(dc, parentId);
    158         bas = DerivedBioAssaySet.getNew(dc, parent);
     189        DerivedBioAssay parent = DerivedBioAssay.getById(dc, parentId);
     190        bas = DerivedBioAssay.getNew(dc, parent);
    159191        cc.setRecent(parent, maxRecent);
    160192      }
    161193      dc.saveItem(bas);
    162       message = "Bioassay set created";
     194      message = "Derived bioassay created";
    163195    }
    164196    else
    165197    {
    166198      dc.reattachItem(bas, false);
    167       message = "Bioassay set updated";
     199      message = "Derived bioassay updated";
    168200    }
    169201
     
    181213        bas.setItemSubtype(subtype);
    182214        if (subtype != null) cc.setRecent(subtype, maxRecent);
     215      }
     216     
     217      int extractId = Values.getInt(request.getParameter("extract_id"), -1);
     218      if (extractId >= 0) // < 0 = denied or unchanged
     219      {
     220        Extract extract = extractId == 0 ? null : Extract.getById(dc, extractId);
     221        bas.setExtract(extract);
    183222      }
    184223
     
    322361    // Run an export plugin in a list context
    323362    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
    324     final ItemQuery<DerivedBioAssaySet> query = DerivedBioAssaySet.getQuery();
     363    final ItemQuery<DerivedBioAssay> query = DerivedBioAssay.getQuery();
     364    registerExportUtils(cc);
    325365    dc = sc.newDbControl();
    326366    cc.configureQuery(dc, query, true);
     
    333373    // Run an export plugin in single-item context
    334374    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
     375    registerExportUtils(cc);
    335376    redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Export+bioassay+set";
    336377  }
     
    339380    // Run an import plugin in a list context
    340381    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
    341     final ItemQuery<DerivedBioAssaySet> query = DerivedBioAssaySet.getQuery();
     382    final ItemQuery<DerivedBioAssay> query = DerivedBioAssay.getQuery();
    342383    dc = sc.newDbControl();
    343384    cc.configureQuery(dc, query, true);
     
    356397    // Run another plugin in a list context
    357398    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
    358     final ItemQuery<DerivedBioAssaySet> query = DerivedBioAssaySet.getQuery();
     399    final ItemQuery<DerivedBioAssay> query = DerivedBioAssay.getQuery();
    359400    dc = sc.newDbControl();
    360401    cc.configureQuery(dc, query, true);
  • trunk/www/views/derivedbioassays/list_bioassays.jsp

    r5684 r5685  
    2626  import="net.sf.basedb.core.Item"
    2727  import="net.sf.basedb.core.PhysicalBioAssay"
    28   import="net.sf.basedb.core.DerivedBioAssaySet"
     28  import="net.sf.basedb.core.DerivedBioAssay"
     29  import="net.sf.basedb.core.RawBioAssay"
    2930  import="net.sf.basedb.core.BioMaterialEvent"
    3031  import="net.sf.basedb.core.AnnotationType"
     
    7273<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
    7374<%!
    74   private static final Item itemType = Item.DERIVEDBIOASSAYSET;
     75  private static final Item itemType = Item.DERIVEDBIOASSAY;
    7576  private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST);
    7677%>
     
    7980final String ID = sc.getId();
    8081final boolean createPermission = sc.hasPermission(Permission.CREATE, itemType);
     82final boolean createRawBioAssayPermission = sc.hasPermission(Permission.CREATE, Item.RAWBIOASSAY);
    8183final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
    8284
    8385final ModeInfo mode = ModeInfo.get(request.getParameter("mode"));
    8486final String callback = request.getParameter("callback");
    85 final String title = mode.generateTitle("derived bioassay set", "derived bioassay sets");
     87final String title = mode.generateTitle("derived bioassay", "derived bioassays");
    8688final DbControl dc = sc.newDbControl();
    87 ItemResultIterator<DerivedBioAssaySet> bioAssaySets = null;
     89ItemResultIterator<DerivedBioAssay> bioAssays = null;
    8890ItemResultList<AnnotationType> annotationTypes = null;
    8991try
     
    9294  final ItemQuery<ItemSubtype> subtypesQuery = Base.getSubtypesQuery(itemType);
    9395
    94   // Query for extracts relatated to the current bioassay
    95   /*
    96   final ItemQuery<Extract> extractQuery = Extract.getQuery();
    97   extractQuery.include(cc.getInclude());
    98   extractQuery.join(Hql.innerJoin("sourceEvents", "srcevt"));
    99   extractQuery.join(Hql.innerJoin("srcevt", "event", "evt"));
    100   extractQuery.restrict(Restrictions.eq(Hql.property("evt", "physicalBioAssay"), Expressions.parameter("bioAssay")));
    101   extractQuery.order(Orders.asc(Hql.property("srcevt", "sourceGroup")));
    102   extractQuery.order(Orders.asc(Hql.property("name")));
    103   */
    104 
    105   // Query for child bioassay sets to the current bioassay set
    106   final ItemQuery<DerivedBioAssaySet> childQuery = DerivedBioAssaySet.getQuery();
     96  // Query for child bioassays to the current bioassay
     97  final ItemQuery<DerivedBioAssay> childQuery = DerivedBioAssay.getQuery();
    10798  childQuery.include(cc.getInclude());
    108   childQuery.restrict(Restrictions.eq(Hql.property("parent"), Expressions.parameter("bioAssaySet")));
     99  childQuery.restrict(Restrictions.eq(Hql.property("parent"), Expressions.parameter("bioAssay")));
    109100  childQuery.order(Orders.asc(Hql.property("name")));
     101
     102  // Query for raw bioassays to the current bioassay
     103  final ItemQuery<RawBioAssay> rawBioAssayQuery = RawBioAssay.getQuery();
     104  rawBioAssayQuery.include(cc.getInclude());
     105  rawBioAssayQuery.restrict(Restrictions.eq(Hql.property("parentBioAssay"), Expressions.parameter("bioAssay")));
     106  rawBioAssayQuery.order(Orders.asc(Hql.property("name")));
    110107 
    111108  Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext);
     
    113110  try
    114111  {
    115     final ItemQuery<DerivedBioAssaySet> query = Base.getConfiguredQuery(dc, cc, true, DerivedBioAssaySet.getQuery(), mode);
    116     bioAssaySets = query.iterate(dc);
     112    final ItemQuery<DerivedBioAssay> query = Base.getConfiguredQuery(dc, cc, true, DerivedBioAssay.getQuery(), mode);
     113    bioAssays = query.iterate(dc);
    117114  }
    118115  catch (Throwable t)
     
    126123  ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext);
    127124  %>
    128   <base:page title="<%=title==null ? "Derived bioassay sets" : title%>" type="<%=mode.getPageType()%>">
     125  <base:page title="<%=title==null ? "Derived bioassays" : title%>" type="<%=mode.getPageType()%>">
    129126  <base:head scripts="menu.js,table.js" styles="menu.css,table.css">
    130127    <ext:scripts context="<%=jspContext%>" />
     
    132129    <script language="JavaScript">
    133130    var submitPage = 'index.jsp';
    134     var formId = 'bioassaysets';
     131    var formId = 'bioassays';
    135132    function newItem()
    136133    {
     
    206203      Table.presetOnChange('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>');
    207204    }
    208     function newChildBioAssaySet(parentId)
    209     {
    210       Main.viewOrEditItem('<%=ID%>', 'DERIVEDBIOASSAYSET', 0, true, '&parent_id='+parentId);
     205    function newChildBioAssay(parentId)
     206    {
     207      Main.viewOrEditItem('<%=ID%>', 'DERIVEDBIOASSAY', 0, true, '&parent_id='+parentId);
     208    }
     209    function newRawBioAssay(parentId)
     210    {
     211      Main.viewOrEditItem('<%=ID%>', 'RAWBIOASSAY', 0, true, '&bioassay_id='+parentId);
    211212    }
    212213    </script>
     
    224225    %>
    225226    <tbl:table
    226       id="bioassaysets"
     227      id="bioassays"
    227228      clazz="itemlist"
    228229      columns="<%=cc.getSetting("columns")%>"
     
    288289        property="parent.name"
    289290        datatype="string"
    290         title="Parent bioassay set"
     291        title="Parent bioassay"
    291292        sortable="true"
    292293        filterable="true"
     
    295296      <tbl:columndef
    296297        id="children"
    297         title="Child bioassay sets"
     298        title="Child bioassays"
    298299        property="&children(name)"
     300        datatype="string"
     301        filterable="true"
     302        exportable="true"
     303      />
     304      <tbl:columndef
     305        id="extract"
     306        property="extract.name"
     307        datatype="string"
     308        title="Extract"
     309        sortable="true"
     310        filterable="true"
     311        exportable="true"
     312      />
     313      <tbl:columndef
     314        id="rawBioAssays"
     315        title="Raw bioassays"
     316        property="&rawBioAssays(name)"
    299317        datatype="string"
    300318        filterable="true"
     
    408426          onclick="newItem()"
    409427          title="New&hellip;"
    410           tooltip="<%=createPermission ? "Create new derived bioassay set" : "You do not have permission to create derived bioassay sets"%>"
     428          tooltip="<%=createPermission ? "Create new derived bioassay" : "You do not have permission to create derived bioassays"%>"
    411429        />
    412430        <tbl:button
     
    467485        page="<%=cc.getPage()%>"
    468486        rowsperpage="<%=cc.getRowsPerPage()%>"
    469         totalrows="<%=bioAssaySets == null ? 0 : bioAssaySets.getTotalCount()%>"
     487        totalrows="<%=bioAssays == null ? 0 : bioAssays.getTotalCount()%>"
    470488        visible="<%=mode.hasNavigator()%>"
    471489      />
     
    506524          int index = cc.getPage()*cc.getRowsPerPage();
    507525          int selectedItemId = cc.getId();
    508           if (bioAssaySets != null)
     526          if (bioAssays != null)
    509527          {           
    510             while (bioAssaySets.hasNext())
     528            while (bioAssays.hasNext())
    511529            {
    512               DerivedBioAssaySet item = bioAssaySets.next();
     530              DerivedBioAssay item = bioAssays.next();
    513531              int itemId = item.getId();
    514532              boolean usePermission = item.hasPermission(Permission.USE);
     
    574592                <tbl:cell column="children">
    575593                  <%
    576                   childQuery.setParameter("bioAssaySet", itemId, Type.INT);
     594                  childQuery.setParameter("bioAssay", itemId, Type.INT);
    577595                  try
    578596                  {
    579597                    String separator = "";
    580                     for (DerivedBioAssaySet child : childQuery.list(dc))
     598                    for (DerivedBioAssay child : childQuery.list(dc))
    581599                    {
    582600                      out.write(separator);
     
    601619                  <base:icon
    602620                    image="add.png"
    603                     onclick="<%="newChildBioAssaySet("+itemId+")"%>"
    604                     tooltip="Create new child bioassay set"
     621                    onclick="<%="newChildBioAssay("+itemId+")"%>"
     622                    tooltip="Create new child bioassay"
    605623                    visible="<%=mode.hasEditLink() && createPermission && usePermission %>"
     624                  />
     625                </tbl:cell>
     626                <tbl:cell column="rawBioAssays">
     627                  <%
     628                  rawBioAssayQuery.setParameter("bioAssay", itemId, Type.INT);
     629                  try
     630                  {
     631                    String separator = "";
     632                    for (RawBioAssay rba : rawBioAssayQuery.list(dc))
     633                    {
     634                      out.write(separator);
     635                      if (mode.hasPropertyLink())
     636                      {
     637                        out.write(Base.getLinkedName(ID, rba, false, mode.hasEditLink()));
     638                      }
     639                      else
     640                      {
     641                        out.write(HTML.encodeTags(rba.getName()));
     642                      }
     643                      separator = ", ";
     644                    }
     645                  }
     646                  catch (Throwable t)
     647                  {
     648                    %>
     649                    <div class="error"><%=t.getMessage()%></div>
     650                    <%
     651                  }
     652                  %>             
     653                  <base:icon
     654                    image="add.png"
     655                    onclick="<%="newRawBioAssay("+itemId+")"%>"
     656                    tooltip="Create new raw bioassay"
     657                    visible="<%=mode.hasEditLink() && createRawBioAssayPermission && usePermission %>"
    606658                  />
    607659                </tbl:cell>
     
    617669                    item="<%=item%>"
    618670                    property="parent"
     671                    enableEditLink="<%=mode.hasEditLink()%>"
     672                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
     673                  /></tbl:cell>
     674                <tbl:cell column="extract"
     675                  ><base:propertyvalue
     676                    item="<%=item%>"
     677                    property="extract"
    619678                    enableEditLink="<%=mode.hasEditLink()%>"
    620679                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
     
    703762      {
    704763        %>
    705         <tbl:panel><%=bioAssaySets == null || bioAssaySets.getTotalCount() == 0 ? "No bioassay sets were found" : "No bioassay sets on this page. Please select another page!" %></tbl:panel>
     764        <tbl:panel><%=bioAssays == null || bioAssays.getTotalCount() == 0 ? "No bioassays were found" : "No bioassays on this page. Please select another page!" %></tbl:panel>
    706765        <%
    707766      }
     
    712771          page="<%=cc.getPage()%>"
    713772          rowsperpage="<%=cc.getRowsPerPage()%>"
    714           totalrows="<%=bioAssaySets == null ? 0 : bioAssaySets.getTotalCount()%>"
     773          totalrows="<%=bioAssays == null ? 0 : bioAssays.getTotalCount()%>"
    715774          visible="<%=mode.hasNavigator()%>"
    716775          locked="true"
     
    732791finally
    733792{
    734   if (bioAssaySets != null) bioAssaySets.close();
     793  if (bioAssays != null) bioAssays.close();
    735794  if (dc != null) dc.close();
    736795}
  • trunk/www/views/derivedbioassays/view_bioassay.jsp

    r5684 r5685  
    2121
    2222--%>
     23<%@page import="net.sf.basedb.core.RawBioAssay"%>
    2324<%@ page pageEncoding="UTF-8" session="false"
    2425  import="net.sf.basedb.core.SessionControl"
    2526  import="net.sf.basedb.core.DbControl"
    26   import="net.sf.basedb.core.DerivedBioAssaySet"
    2727  import="net.sf.basedb.core.DerivedBioAssay"
    2828  import="net.sf.basedb.core.PhysicalBioAssay"
     
    7575<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
    7676<%!
    77   private static final Item itemType = Item.DERIVEDBIOASSAYSET;
     77  private static final Item itemType = Item.DERIVEDBIOASSAY;
    7878  private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.ITEM);
    7979%>
     
    9393
    9494  String title = null;
    95   final DerivedBioAssaySet bioAssaySet = DerivedBioAssaySet.getById(dc, itemId);
     95  final DerivedBioAssay bioAssay = DerivedBioAssay.getById(dc, itemId);
    9696 
    9797  Job job = null;
     
    104104  try
    105105  {
    106     job = bioAssaySet.getJob();
     106    job = bioAssay.getJob();
    107107  }
    108108  catch (PermissionDeniedException ex)
     
    132132  }
    133133 
    134   final boolean usePermission = bioAssaySet.hasPermission(Permission.USE);
    135   final boolean writePermission = bioAssaySet.hasPermission(Permission.WRITE);
    136   final boolean deletePermission = bioAssaySet.hasPermission(Permission.DELETE);
    137   final boolean sharePermission = bioAssaySet.hasPermission(Permission.SET_PERMISSION);
    138   final boolean setOwnerPermission = bioAssaySet.hasPermission(Permission.SET_OWNER);
    139   final boolean isRemoved = bioAssaySet.isRemoved();
    140   final boolean isUsed = isRemoved && bioAssaySet.isUsed();
     134  final boolean usePermission = bioAssay.hasPermission(Permission.USE);
     135  final boolean writePermission = bioAssay.hasPermission(Permission.WRITE);
     136  final boolean deletePermission = bioAssay.hasPermission(Permission.DELETE);
     137  final boolean sharePermission = bioAssay.hasPermission(Permission.SET_PERMISSION);
     138  final boolean setOwnerPermission = bioAssay.hasPermission(Permission.SET_OWNER);
     139  final boolean isRemoved = bioAssay.isRemoved();
     140  final boolean isUsed = isRemoved && bioAssay.isUsed();
    141141  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    142   final boolean isOwner = bioAssaySet.isOwner();
     142  final boolean isOwner = bioAssay.isOwner();
    143143  Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc);
    144144  Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc);
    145   JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, bioAssaySet);
     145  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, bioAssay);
    146146  ExtensionsInvoker toolbarInvoker = ToolbarUtil.useExtensions(jspContext);
    147147  %>
     
    165165    function shareItem()
    166166    {
    167       Main.openPopup('index.jsp?ID=<%=ID%>&cmd=ShareItem&item_id=<%=itemId%>', 'ShareBioAssaySet', 600, 400);
     167      Main.openPopup('index.jsp?ID=<%=ID%>&cmd=ShareItem&item_id=<%=itemId%>', 'ShareBioAssay', 600, 400);
    168168    }
    169169    function setOwner()
     
    187187      Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&item_id=<%=itemId%>', 'RunPlugin'+cmd, 740, 540);
    188188    }
    189     function newChildBioAssaySet()
    190     {
    191       Main.viewOrEditItem('<%=ID%>', 'DERIVEDBIOASSAYSET', 0, true, '&parent_id=<%=itemId%>');
     189    function newChildBioAssay()
     190    {
     191      Main.viewOrEditItem('<%=ID%>', 'DERIVEDBIOASSAY', 0, true, '&parent_id=<%=itemId%>');
     192    }
     193    function newRawBioAssay()
     194    {
     195      Main.viewOrEditItem('<%=ID%>', 'RAWBIOASSAY', 0, true, '&bioassay_id=<%=itemId%>');
    192196    }
    193197    </script>
     
    196200    <p>
    197201    <p:path>
    198       <p:pathelement title="Derived bioassay sets" href="<%="index.jsp?ID="+ID%>" />
    199       <p:pathelement title="<%=HTML.encodeTags(bioAssaySet.getName())%>" />
     202      <p:pathelement title="Derived bioassays" href="<%="index.jsp?ID="+ID%>" />
     203      <p:pathelement title="<%=HTML.encodeTags(bioAssay.getName())%>" />
    200204    </p:path>
    201205   
     
    209213        onclick="editItem()"
    210214        title="Edit&hellip;"
    211         tooltip="<%=writePermission ? "Edit this bioassay set" : "You do not have permission to edit this bioassay set"%>"
     215        tooltip="<%=writePermission ? "Edit this bioassay" : "You do not have permission to edit this bioassay"%>"
    212216      />
    213217      <tbl:button
     
    216220        onclick="deleteItem()"
    217221        title="Delete"
    218         visible="<%=!bioAssaySet.isRemoved()%>"
    219         tooltip="<%=deletePermission ? "Delete this bioassay set" : "You do not have permission to delete this bioassay set"%>"
     222        visible="<%=!bioAssay.isRemoved()%>"
     223        tooltip="<%=deletePermission ? "Delete this bioassay" : "You do not have permission to delete this bioassay"%>"
    220224      />
    221225      <tbl:button
     
    224228        onclick="restoreItem()"
    225229        title="Restore"
    226         visible="<%=bioAssaySet.isRemoved()%>"
    227         tooltip="<%=writePermission ? "Restore this bioassay set" : "You do not have permission to restore this bioassay set"%>"
     230        visible="<%=bioAssay.isRemoved()%>"
     231        tooltip="<%=writePermission ? "Restore this bioassay" : "You do not have permission to restore this bioassay"%>"
    228232      />
    229233      <tbl:button
     
    232236        onclick="shareItem()"
    233237        title="Share&hellip;"
    234         tooltip="<%=sharePermission ? "Share this bioassay set to other user, groups and projects" : "You do not have permission to share this bioassay set"%>"
     238        tooltip="<%=sharePermission ? "Share this bioassay to other user, groups and projects" : "You do not have permission to share this bioassay"%>"
    235239      />
    236240      <tbl:button
     
    243247      <tbl:button
    244248        image="add.png"
    245         onclick="newChildBioAssaySet()"
    246         title="New child bioassay set&hellip;"
    247         tooltip="Create a child bioassay set from this bioassay set"
    248         visible="<%=sc.hasPermission(Permission.CREATE, Item.DERIVEDBIOASSAYSET) && usePermission%>"
     249        onclick="newChildBioAssay()"
     250        title="New child bioassay&hellip;"
     251        tooltip="Create a child bioassay from this bioassay"
     252        visible="<%=sc.hasPermission(Permission.CREATE, Item.DERIVEDBIOASSAY) && usePermission%>"
     253      />
     254      <tbl:button
     255        image="add.png"
     256        onclick="newRawBioAssay()"
     257        title="New raw bioassay&hellip;"
     258        tooltip="Create a raw bioassay from this bioassay"
     259        visible="<%=sc.hasPermission(Permission.CREATE, Item.RAWBIOASSAY) && usePermission%>"
    249260      />
    250261      <tbl:button
     
    273284      <tbl:button
    274285        image="help.gif"
    275         onclick="<%="Main.openHelp('" + ID +"', 'derivedbioassayset.view.properties')"%>"
     286        onclick="<%="Main.openHelp('" + ID +"', 'derivedbioassay.view.properties')"%>"
    276287        title="Help&hellip;"
    277288        tooltip="Get help about this page"
     
    279290      </tbl:toolbar>
    280291    <div class="boxedbottom">
    281       <div class="itemstatus">Permissions on this item: <i><%=PermissionUtil.getFullPermissionNames(bioAssaySet)%></i></div>
     292      <div class="itemstatus">Permissions on this item: <i><%=PermissionUtil.getFullPermissionNames(bioAssay)%></i></div>
    282293      <%
    283       if (isRemoved || bioAssaySet.isShared())
     294      if (isRemoved || bioAssay.isShared())
    284295      {
    285296        %>
     
    295306            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    296307          <base:icon image="shared.gif"
    297             visible="<%=bioAssaySet.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
     308            visible="<%=bioAssay.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
    298309        </div>
    299310        <%
     
    308319        <tr>
    309320          <td class="prompt">Name</td>
    310           <td><%=HTML.encodeTags(bioAssaySet.getName())%></td>
     321          <td><%=HTML.encodeTags(bioAssay.getName())%></td>
    311322        </tr>
    312323        <tr>
    313324          <td class="prompt">Type</td>
    314           <td><base:propertyvalue item="<%=bioAssaySet%>" property="itemSubtype" /></td>
     325          <td><base:propertyvalue item="<%=bioAssay%>" property="itemSubtype" /></td>
    315326        </tr>
    316327        <tr>
    317328          <td class="prompt">Physical bioassay</td>
    318           <td><base:propertyvalue item="<%=bioAssaySet%>" property="physicalBioAssay" /></td>
    319         </tr>
    320         <tr>
    321           <td class="prompt">Parent bioassay set</td>
    322           <td><base:propertyvalue item="<%=bioAssaySet%>" property="parent" /></td>
     329          <td><base:propertyvalue item="<%=bioAssay%>" property="physicalBioAssay" /></td>
     330        </tr>
     331        <tr>
     332          <td class="prompt">Parent bioassay</td>
     333          <td><base:propertyvalue item="<%=bioAssay%>" property="parent" /></td>
     334        </tr>
     335        <tr>
     336          <td class="prompt">Extract</td>
     337          <td><base:propertyvalue item="<%=bioAssay%>" property="extract" /></td>
    323338        </tr>
    324339        <tr>
    325340          <td class="prompt">Protocol</td>
    326           <td><base:propertyvalue item="<%=bioAssaySet%>" property="protocol" /></td>
     341          <td><base:propertyvalue item="<%=bioAssay%>" property="protocol" /></td>
    327342        </tr>
    328343        <tr>
    329344          <td class="prompt">Hardware</td>
    330           <td><base:propertyvalue item="<%=bioAssaySet%>" property="hardware" /></td>
     345          <td><base:propertyvalue item="<%=bioAssay%>" property="hardware" /></td>
    331346        </tr>
    332347        <tr>
    333348          <td class="prompt">Software</td>
    334           <td><base:propertyvalue item="<%=bioAssaySet%>" property="software" /></td>
     349          <td><base:propertyvalue item="<%=bioAssay%>" property="software" /></td>
    335350        </tr>
    336351        <tr>
    337352          <td class="prompt">Owner</td>
    338           <td><base:propertyvalue item="<%=bioAssaySet%>" property="owner" /></td>
     353          <td><base:propertyvalue item="<%=bioAssay%>" property="owner" /></td>
    339354        </tr>
    340355        <tr>
    341356          <td class="prompt">Description</td>
    342           <td><%=HTML.niceFormat(bioAssaySet.getDescription())%></td>
     357          <td><%=HTML.niceFormat(bioAssay.getDescription())%></td>
    343358        </tr>
    344359        </table>
     
    469484     
    470485      <%
    471       ItemQuery<DerivedBioAssay> bioAssayQuery = bioAssaySet.getBioAssays();
    472       bioAssayQuery.include(Include.ALL);
    473       bioAssayQuery.order(Orders.asc(Hql.property("name")));
    474       ItemResultList<DerivedBioAssay> bioAssays = bioAssayQuery.list(dc);
    475       if (bioAssays.size() == 0)
     486      ItemQuery<DerivedBioAssay> childQuery = bioAssay.getChildren();
     487      childQuery.include(Include.ALL);
     488      childQuery.order(Orders.asc(Hql.property("name")));
     489      ItemResultList<DerivedBioAssay> children = childQuery.list(dc);
     490      if (children.size() == 0)
    476491      {
    477492        %>
    478         <h4>Bioassays</h4>
    479         This bioassay set doesn't have any bioassays.
     493        <h4>Child bioassays</h4>
     494        This bioassay doesn't have any child bioassays
     495        (or you don't have permission to view them).
    480496        <%
    481497      }
     
    484500        %>
    485501        <base:section
    486           id="bioAssays"
    487           title="<%="Bioassays (" + bioAssays.size() + ")"%>"
    488           context="<%=cc%>"
    489           >
    490           <tbl:table
    491             id="bioAssays"
    492             clazz="itemlist"
    493             columns="all"
    494             >
    495           <tbl:columndef
    496             id="name"
    497             title="Name"
    498           />
    499           <tbl:columndef
    500             id="extract"
    501             title="Extract"
    502           />
    503           <tbl:columndef
    504             id="description"
    505             title="Description"
    506           />
    507           <tbl:data>
    508             <tbl:columns>
    509             </tbl:columns>
    510             <tbl:rows>
    511             <%
    512             for (DerivedBioAssay item : bioAssays)
    513             {
    514               %>
    515               <tbl:row>
    516                 <tbl:cell column="name"><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell>
    517                 <tbl:cell column="extract"><base:propertyvalue item="<%=item%>" property="extract" /></tbl:cell>
    518                 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell>
    519               </tbl:row>
    520               <%
    521             }
    522             %>
    523             </tbl:rows>
    524           </tbl:data>
    525           </tbl:table>
    526         </base:section>
    527         <%
    528       }
    529       %>
    530  
    531       <%
    532       ItemQuery<DerivedBioAssaySet> childQuery = bioAssaySet.getChildren();
    533       childQuery.include(Include.ALL);
    534       childQuery.order(Orders.asc(Hql.property("name")));
    535       ItemResultList<DerivedBioAssaySet> children = childQuery.list(dc);
    536       if (children.size() == 0)
    537       {
    538         %>
    539         <h4>Child bioassay sets</h4>
    540         This bioassay set doesn't have any child bioassay set.
    541         <%
    542       }
    543       else
    544       {
    545         %>
    546         <base:section
    547502          id="children"
    548           title="<%="Child bioassay sets (" + children.size() + ")"%>"
     503          title="<%="Child bioassays (" + children.size() + ")"%>"
    549504          context="<%=cc%>"
    550505          >
     
    571526            <tbl:rows>
    572527            <%
    573             for (DerivedBioAssaySet item : children)
     528            for (DerivedBioAssay item : children)
    574529            {
    575530              %>
     
    590545      %>
    591546 
     547      <%
     548      ItemQuery<RawBioAssay> rawQuery = bioAssay.getRawBioAssays();
     549      rawQuery.include(Include.ALL);
     550      rawQuery.order(Orders.asc(Hql.property("name")));
     551      ItemResultList<RawBioAssay> rawBioAssays = rawQuery.list(dc);
     552      if (rawBioAssays.size() == 0)
     553      {
     554        %>
     555        <h4>Raw bioassays</h4>
     556        This bioassay doesn't have any child raw bioassays
     557        (or you don't have permission to view them).
     558        <%
     559      }
     560      else
     561      {
     562        %>
     563        <base:section
     564          id="children"
     565          title="<%="Raw bioassays (" + rawBioAssays.size() + ")"%>"
     566          context="<%=cc%>"
     567          >
     568          <tbl:table
     569            id="rawBioAssays"
     570            clazz="itemlist"
     571            columns="all"
     572            >
     573          <tbl:columndef
     574            id="name"
     575            title="Name"
     576          />
     577          <tbl:columndef
     578            id="platform"
     579            title="Platform"
     580          />
     581          <tbl:columndef
     582            id="description"
     583            title="Description"
     584          />
     585          <tbl:data>
     586            <tbl:columns>
     587            </tbl:columns>
     588            <tbl:rows>
     589            <%
     590            for (RawBioAssay item : rawBioAssays)
     591            {
     592              %>
     593              <tbl:row>
     594                <tbl:cell column="name"><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell>
     595                <tbl:cell column="platform"><base:propertyvalue item="<%=item%>" property="platform" /></tbl:cell>
     596                <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell>
     597              </tbl:row>
     598              <%
     599            }
     600            %>
     601            </tbl:rows>
     602          </tbl:data>
     603          </tbl:table>
     604        </base:section>
     605        <%
     606      }
     607      %>
    592608     
    593609      <jsp:include page="../../common/datafiles/list_files.jsp">
  • trunk/www/views/physicalbioassays/index.jsp

    r5662 r5685  
    3737  import="net.sf.basedb.core.Hardware"
    3838  import="net.sf.basedb.core.ItemSubtype"
    39   import="net.sf.basedb.core.DerivedBioAssaySet"
     39  import="net.sf.basedb.core.DerivedBioAssay"
    4040  import="net.sf.basedb.core.ItemQuery"
    4141  import="net.sf.basedb.core.ItemResultIterator"
     
    8383  {
    8484    // Register formatters
    85     cc.setObject("export.formatter.&creationEvent.sourceBioMaterials(name)", new NameableFormatter());
    86     cc.setObject("export.formatter.&scans(name)", new NameableFormatter());
     85    cc.setObject("export.formatter.&creationEvent.sources(bioMaterial.name)", new NameableFormatter());
     86    cc.setObject("export.formatter.&rootDerivedBioAssays(name)", new NameableFormatter());
    8787   
    8888    // Register dataloaders
     
    9090    ItemQuery<Extract> extractQuery = Extract.getQuery();   
    9191    extractQuery.include(cc.getInclude());
    92     extractQuery.join(Hql.innerJoin("sourceEvents", "srcevt"));
    93     extractQuery.join(Hql.innerJoin("srcevt", "event", "evt"));
     92    extractQuery.join(Hql.innerJoin("childCreationEvents", "cce"));
     93    extractQuery.join(Hql.innerJoin("cce", "event", "evt"));
    9494    extractQuery.restrict(Restrictions.eq(Hql.property("evt", "physicalBioAssay"), Expressions.parameter(bioassayParameter)));
    9595    extractQuery.order(Orders.asc(Hql.property("name")));
    96     cc.setObject("export.dataloader.&creationEvent.sourceBioMaterials(name)", new ItemQueryLoader(extractQuery, bioassayParameter));
    97 
    98     ItemQuery<DerivedBioAssaySet> dbasQuery = DerivedBioAssaySet.getQuery();
     96    cc.setObject("export.dataloader.&creationEvent.sources(bioMaterial.name)", new ItemQueryLoader(extractQuery, bioassayParameter));
     97
     98    ItemQuery<DerivedBioAssay> dbasQuery = DerivedBioAssay.getQuery();
    9999    dbasQuery.include(cc.getInclude());
    100100    dbasQuery.restrict(Restrictions.eq(Hql.property("physicalBioAssay"), Expressions.parameter(bioassayParameter)));
    101101    dbasQuery.restrict(Restrictions.eq(Hql.property("parent"), null));
    102102    dbasQuery.order(Orders.asc(Hql.property("name")));
    103     cc.setObject("export.dataloader.&rootDerivedBioAssaySets(name)", new ItemQueryLoader(dbasQuery, bioassayParameter));
     103    cc.setObject("export.dataloader.&rootDerivedBioAssays(name)", new ItemQueryLoader(dbasQuery, bioassayParameter));
    104104  }
    105105%>
  • trunk/www/views/physicalbioassays/list_bioassays.jsp

    r5674 r5685  
    3131  import="net.sf.basedb.core.Extract"
    3232  import="net.sf.basedb.core.Tag"
    33   import="net.sf.basedb.core.DerivedBioAssaySet"
     33  import="net.sf.basedb.core.DerivedBioAssay"
    3434  import="net.sf.basedb.core.BioMaterialEvent"
    3535  import="net.sf.basedb.core.BioMaterialEventSource"
     
    108108
    109109  // Query for derived bioassay sets from to the current bioassay
    110   final ItemQuery<DerivedBioAssaySet> dbasQuery = DerivedBioAssaySet.getQuery();
     110  final ItemQuery<DerivedBioAssay> dbasQuery = DerivedBioAssay.getQuery();
    111111  dbasQuery.include(cc.getInclude());
    112112  dbasQuery.restrict(Restrictions.eq(Hql.property("physicalBioAssay"), Expressions.parameter("bioAssay")));
    113113  dbasQuery.restrict(Restrictions.eq(Hql.property("parent"), null));
    114114  dbasQuery.order(Orders.asc(Hql.property("name")));
    115   final boolean createDerivedBioAssaySetPermission = sc.hasPermission(Permission.CREATE, Item.DERIVEDBIOASSAYSET); 
     115  final boolean createDerivedBioAssayPermission = sc.hasPermission(Permission.CREATE, Item.DERIVEDBIOASSAY); 
    116116 
    117117  Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext);
     
    212212      Table.presetOnChange('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>');
    213213    }
    214     function newDerivedBioAssaySet(bioAssayId)
    215     {
    216       Main.viewOrEditItem('<%=ID%>', 'DERIVEDBIOASSAYSET', 0, true, '&physicalbioassay_id='+bioAssayId);
     214    function newDerivedBioAssay(bioAssayId)
     215    {
     216      Main.viewOrEditItem('<%=ID%>', 'DERIVEDBIOASSAY', 0, true, '&physicalbioassay_id='+bioAssayId);
    217217    }
    218218    </script>
     
    308308      />
    309309      <tbl:columndef
    310         id="derivedBioAssaySets"
    311         title="Derived bioassay sets"
    312         property="&rootDerivedBioAssaySets(name)"
     310        id="derivedBioAssays"
     311        title="Derived bioassays"
     312        property="&rootDerivedBioAssays(name)"
    313313        datatype="string"
    314314        filterable="true"
     
    641641                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
    642642                  /></tbl:cell>
    643                 <tbl:cell column="derivedBioAssaySets">
     643                <tbl:cell column="derivedBioAssays">
    644644                  <%
    645645                  dbasQuery.setParameter("bioAssay", itemId, Type.INT);
     
    647647                  {
    648648                    String separator = "";
    649                     for (DerivedBioAssaySet dbas : dbasQuery.list(dc))
     649                    for (DerivedBioAssay dbas : dbasQuery.list(dc))
    650650                    {
    651651                      out.write(separator);
     
    670670                  <base:icon
    671671                    image="add.png"
    672                     onclick="<%="newDerivedBioAssaySet("+itemId+")"%>"
    673                     tooltip="Create new derived bioassay set"
    674                     visible="<%=mode.hasEditLink() && createDerivedBioAssaySetPermission && usePermission %>"
     672                    onclick="<%="newDerivedBioAssay("+itemId+")"%>"
     673                    tooltip="Create new derived bioassay"
     674                    visible="<%=mode.hasEditLink() && createDerivedBioAssayPermission && usePermission %>"
    675675                  />
    676676                </tbl:cell>
  • trunk/www/views/physicalbioassays/view_bioassay.jsp

    r5664 r5685  
    3939  import="net.sf.basedb.core.BioMaterialEventSource"
    4040  import="net.sf.basedb.core.Protocol"
    41   import="net.sf.basedb.core.DerivedBioAssaySet"
     41  import="net.sf.basedb.core.DerivedBioAssay"
    4242  import="net.sf.basedb.core.Group"
    4343  import="net.sf.basedb.core.Hardware"
     
    167167      }
    168168    }
    169     function newDerivedBioAssaySet()
    170     {
    171       Main.viewOrEditItem('<%=ID%>', 'DERIVEDBIOASSAYSET', 0, true, '&physicalbioassay_id=<%=itemId%>');
     169    function newDerivedBioAssay()
     170    {
     171      Main.viewOrEditItem('<%=ID%>', 'DERIVEDBIOASSAY', 0, true, '&physicalbioassay_id=<%=itemId%>');
    172172    }
    173173    </script>
     
    223223      <tbl:button
    224224        image="add.png"
    225         onclick="newDerivedBioAssaySet()"
    226         title="New derived bioassay set&hellip;"
    227         tooltip="Create a derived bioassay set from this bioassay"
    228         visible="<%=sc.hasPermission(Permission.CREATE, Item.DERIVEDBIOASSAYSET) && usePermission%>"
     225        onclick="newDerivedBioAssay()"
     226        title="New derived bioassay&hellip;"
     227        tooltip="Create a derived bioassay from this bioassay"
     228        visible="<%=sc.hasPermission(Permission.CREATE, Item.DERIVEDBIOASSAY) && usePermission%>"
    229229      />
    230230      <tbl:button
     
    280280      }
    281281      %>
     282      <a href="ajax.jsp?ID=<%=ID%>&item_id=<%=itemId %>&cmd=GetSources">test sources</a>
    282283      <table class="form" cellspacing="0">
    283284      <tr>
     
    412413
    413414      <%
    414       ItemQuery<DerivedBioAssaySet> childQuery = pba.getDerivedBioAssaySets();
     415      ItemQuery<DerivedBioAssay> childQuery = pba.getRootDerivedBioAssays();
    415416      childQuery.include(Include.ALL);
    416417      childQuery.order(Orders.asc(Hql.property("name")));
    417       ItemResultList<DerivedBioAssaySet> children = childQuery.list(dc);
     418      ItemResultList<DerivedBioAssay> children = childQuery.list(dc);
    418419      if (children.size() == 0)
    419420      {
    420421        %>
    421         <h4>Derived bioassay sets</h4>
    422         This bioassay doesn't have any derived bioassay sets.
     422        <h4>Derived bioassays</h4>
     423        This bioassay doesn't have any derived bioassays.
    423424        <%
    424425      }
     
    428429        <base:section
    429430          id="children"
    430           title="<%="Derived bioassay sets (" + children.size() + ")"%>"
     431          title="<%="Derived bioassays (" + children.size() + ")"%>"
    431432          context="<%=cc%>"
    432433          >
     
    453454            <tbl:rows>
    454455            <%
    455             for (DerivedBioAssaySet item : children)
     456            for (DerivedBioAssay item : children)
    456457            {
    457458              %>
  • trunk/www/views/rawbioassays/edit_rawbioassay.jsp

    r5657 r5685  
    4040  import="net.sf.basedb.core.Software"
    4141  import="net.sf.basedb.core.ArrayDesign"
     42  import="net.sf.basedb.core.Extract"
     43  import="net.sf.basedb.core.DerivedBioAssay"
    4244  import="net.sf.basedb.core.ItemSubtype"
    4345  import="net.sf.basedb.core.File"
     
    8789  PlatformVariant defaultVariant = null;
    8890 
     91  boolean readCurrentBioAssay = true;
     92  DerivedBioAssay currentBioAssay = null;
     93  boolean readCurrentExtract = true;
     94  Extract currentExtract = null;
    8995  boolean readCurrentProtocol = true;
    9096  Protocol currentProtocol = null;
     
    104110  List<ArrayDesign> recentArrayDesigns = (List<ArrayDesign>)cc.getRecent(dc, Item.ARRAYDESIGN);
    105111  List<File> recentFiles = (List<File>)cc.getRecent(dc, Item.FILE);
     112  List<DerivedBioAssay> recentBioAssays = (List<DerivedBioAssay>)cc.getRecent(dc, Item.DERIVEDBIOASSAY);
     113  List<Extract> recentExtracts = (List<Extract>)cc.getRecent(dc, Item.EXTRACT);
    106114 
    107115  int activeProjectId = sc.getActiveProjectId();
     
    178186    if (currentRawDataType == null) currentRawDataType = defaultRawDataType;
    179187
    180     name = Values.getString(cc.getPropertyValue("name"), "New raw bioassay");
     188   
     189    int bioAssayId = Values.getInt(request.getParameter("bioassay_id"));
     190    if (bioAssayId != 0)
     191    {
     192      currentBioAssay = DerivedBioAssay.getById(dc, bioAssayId);
     193    }
     194    else if (cc.getPropertyFilter("derivedBioAssay.name") != null)
     195    {
     196      currentBioAssay = Base.getFirstMatching(dc, DerivedBioAssay.getQuery(), "name", cc.getPropertyFilter("derivedBioAssay.name"));
     197    }
     198
     199    if (currentBioAssay != null)
     200    {
     201      name = currentBioAssay.getName() + ".r" + (currentBioAssay.countRawBioAssays() + 1);
     202    }
     203    else
     204    {
     205      name = Values.getString(cc.getPropertyValue("name"), "New raw bioassay");
     206    }
     207
    181208    if (cc.getPropertyFilter("protocol.name") != null)
    182209    {
     
    188215      currentSoftware = Base.getFirstMatching(dc, Software.getQuery(), "name", cc.getPropertyFilter("software.name"));
    189216    }
    190     /*
    191     if (currentScan != null)
     217
     218    if (currentBioAssay != null)
    192219    {
    193220      try
    194221      {
    195         currentArrayDesign = currentScan.getArrayDesign();
     222        currentArrayDesign = currentBioAssay.getArrayDesign();
    196223      }
    197224      catch (PermissionDeniedException ex)
    198225      {}
    199     }
    200     */
     226      try
     227      {
     228        currentExtract = currentBioAssay.getExtract();
     229      }
     230      catch (PermissionDeniedException ex)
     231      {}
     232    }
    201233    if (currentArrayDesign == null && cc.getPropertyFilter("arrayDesign.name") != null)
    202234    {
     
    229261    }
    230262   
     263    try
     264    {
     265      currentBioAssay = rawBioAssay.getParentBioAssay();
     266    }
     267    catch (PermissionDeniedException ex)
     268    {
     269      readCurrentBioAssay = false;
     270    }
     271    try
     272    {
     273      currentExtract = rawBioAssay.getParentExtract();
     274    }
     275    catch (PermissionDeniedException ex)
     276    {
     277      readCurrentExtract = false;
     278    }
    231279    try
    232280    {
     
    396444      var parents = new Array();
    397445
     446      var bioAssayId = Math.abs(parseInt(frm.bioassay_id[frm.bioassay_id.selectedIndex].value));
     447      if (bioAssayId > 0) parents[parents.length] = 'DERIVEDBIOASSAY:'+bioAssayId;
     448      var extractId = Math.abs(parseInt(frm.bioassay_id[frm.extract_id.selectedIndex].value));
     449      if (extractId > 0) parents[parents.length] = 'EXTRACT:'+extractId;
    398450      if (frm.arraydesign_id)
    399451      {
     
    433485      protocolChanged = true;
    434486    }
     487   
     488    function bioAssayOnChange()
     489    {
     490      var frm = document.forms['rawbioassay'];
     491      var selectedIndex = frm.bioassay_id.selectedIndex
     492      var bioAssayId = frm.bioassay_id[selectedIndex].value;
     493      if (bioAssayId > 0) updateArrayDesign(bioAssayId);
     494      parentsChanged = true;
     495    }
     496    function selectBioAssayOnClick()
     497    {
     498      var frm = document.forms['rawbioassay'];
     499      var url = '../derivedbioassays/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setBioAssayCallback';
     500      if (frm.bioassay_id.length > 1)
     501      {
     502        var id = Math.abs(parseInt(frm.bioassay_id[1].value));
     503        url += '&item_id='+id;
     504      }
     505      Main.openPopup(url, 'SelectDerivedBioAssay', 1000, 700);
     506    }
     507    function setBioAssayCallback(id, name)
     508    {
     509      var frm = document.forms['rawbioassay'];
     510      var list = frm.bioassay_id;
     511      if (list.length < 2 || list[1].value == '0') // >
     512      {
     513        Forms.addListOption(list, 1, new Option());
     514      }
     515      list[1].value = id;
     516      list[1].text = name;
     517      list.selectedIndex = 1;
     518      updateArrayDesign(id)
     519      parentsChanged = true;
     520    }
     521
    435522   
    436523    function selectSoftwareOnClick()
     
    507594      parentsChanged = true;
    508595      arrayDesignOnChange();
     596    }
     597   
     598    function updateArrayDesign(bioAssayId)
     599    {
     600      var request = Ajax.getXmlHttpRequest();
     601      if (request != null)
     602      {
     603        var url = '../derivedbioassays/ajax.jsp?ID=<%=ID%>&cmd=GetArrayDesign&item_id=' + bioAssayId;
     604        request.open("GET", url, true);
     605        Ajax.setReadyStateHandler(request, updateArrayDesignCallback);
     606        request.send(null);
     607      }
     608      return request != null;
     609    }
     610    function updateArrayDesignCallback(request)
     611    {
     612      var frm = document.forms['rawbioassay'];
     613      var response = Ajax.parseJsonResponse(request.responseText);
     614      if (response.status != 'ok')
     615      {
     616        alert(response.message);
     617        return false;
     618      }
     619     
     620      if (response.id)
     621      {
     622        var designList = frm.arraydesign_id;
     623        if (designList.length < 2 || designList[1].value == '0') // >
     624        {
     625          Forms.addListOption(designList, 1, new Option());
     626        }
     627        designList[1].value = response.id;
     628        designList[1].text = response.name;
     629        designList.selectedIndex = 1;
     630      }
    509631    }
    510632
     
    608730        </td>
    609731      </tr>
    610      
     732      <tr>
     733        <td class="prompt">Parent bioassay</td>
     734        <td>
     735          <base:select
     736            id="bioassay_id"
     737            clazz="selectionlist"
     738            required="false"
     739            current="<%=currentBioAssay%>"
     740            denied="<%=!readCurrentBioAssay%>"
     741            recent="<%=recentBioAssays%>"
     742            newitem="<%=rawBioAssay == null%>"
     743            onselect="selectBioAssayOnClick()"
     744            onchange="bioAssayOnChange()"
     745          />
     746        </td>
     747      </tr>
     748      <tr>
     749        <td class="prompt">Parent extract</td>
     750        <td>
     751          <base:select
     752            id="extract_id"
     753            clazz="selectionlist"
     754            required="false"
     755            current="<%=currentExtract%>"
     756            denied="<%=!readCurrentExtract%>"
     757            recent="<%=recentExtracts%>"
     758            newitem="<%=rawBioAssay == null%>"
     759            onselect="selectExtractOnClick()"
     760            onchange="extractOnChange()"
     761          />
     762        </td>
     763      </tr>
    611764      <tr>
    612765        <td class="prompt">Array design</td>
  • trunk/www/views/rawbioassays/index.jsp

    r5657 r5685  
    3636  import="net.sf.basedb.core.Software"
    3737  import="net.sf.basedb.core.ArrayDesign"
     38  import="net.sf.basedb.core.Extract"
     39  import="net.sf.basedb.core.DerivedBioAssay"
    3840  import="net.sf.basedb.core.Experiment"
    3941  import="net.sf.basedb.core.File"
     
    311313        if (sw != null) cc.setRecent(sw, maxRecent);
    312314      }
     315      int bioAssayId = Values.getInt(request.getParameter("bioassay_id"), -1);
     316      if (bioAssayId >= 0) // < 0 = denied or unchanged
     317      {
     318        DerivedBioAssay bioAssay = bioAssayId == 0 ? null : DerivedBioAssay.getById(dc, bioAssayId);
     319        rba.setParentBioAssay(bioAssay);
     320        if (bioAssay != null) cc.setRecent(bioAssay, maxRecent);
     321      }
     322      int extractId = Values.getInt(request.getParameter("extract_id"), -1);
     323      if (extractId >= 0) // < 0 = denied or unchanged
     324      {
     325        Extract extract = extractId == 0 ? null : Extract.getById(dc, extractId);
     326        rba.setParentExtract(extract);
     327        if (extract != null) cc.setRecent(extract, maxRecent);
     328      }
    313329
    314330      Job job = null;
  • trunk/www/views/rawbioassays/list_rawbioassays.jsp

    r5674 r5685  
    373373      />
    374374      <tbl:columndef
    375         id="parent"
    376         property="parent.name"
    377         datatype="string"
    378         title="Parent"
     375        id="parentBioAssay"
     376        property="parentBioAssay.name"
     377        datatype="string"
     378        title="Parent bioassay"
     379        sortable="true"
     380        filterable="true"
     381        exportable="true"
     382      />
     383      <tbl:columndef
     384        id="parentExtract"
     385        property="parentExtract.name"
     386        datatype="string"
     387        title="Parent extract"
    379388        sortable="true"
    380389        filterable="true"
     
    714723                <tbl:cell column="rawDataType"><%=HTML.encodeTags(item.getRawDataType().getName())%></tbl:cell>
    715724                <tbl:cell column="hasData"><%=item.hasData()%></tbl:cell>
    716                 <tbl:cell column="parent"
     725                <tbl:cell column="parentBioAssay"
    717726                  ><base:propertyvalue
    718727                    item="<%=item%>"
    719                     property="parent"
     728                    property="parentBioAssay"
     729                    enableEditLink="<%=mode.hasEditLink()%>"
     730                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
     731                  /></tbl:cell>
     732                <tbl:cell column="parentExtract"
     733                  ><base:propertyvalue
     734                    item="<%=item%>"
     735                    property="parentExtract"
    720736                    enableEditLink="<%=mode.hasEditLink()%>"
    721737                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
  • trunk/www/views/rawbioassays/view_rawbioassay.jsp

    r5657 r5685  
    335335      </tr>
    336336      <tr>
    337         <td class="prompt">Array index</td>
    338         <td><%=rawBioAssay.getArrayNum()%></td>
    339       </tr>
    340       <tr>
    341337        <td class="prompt">Spots</td>
    342338        <td><%=rawBioAssay.hasData() ? "yes (db: " + rawBioAssay.getNumDbSpots() +
     
    344340      </tr>
    345341      <tr>
     342        <td class="prompt">Parent bioassay</td>
     343        <td><base:propertyvalue item="<%=rawBioAssay%>" property="parentBioAssay" /></td>
     344      </tr>
     345      <tr>
     346        <td class="prompt">Parent extract</td>
     347        <td><base:propertyvalue item="<%=rawBioAssay%>" property="parentExtract" /></td>
     348      </tr>
     349      <tr>
    346350        <td class="prompt">Protocol</td>
    347351        <td><base:propertyvalue item="<%=rawBioAssay%>" property="protocol" /></td>
    348       </tr>
    349       <tr>
    350         <td class="prompt">Parent bioassay</td>
    351         <td><base:propertyvalue item="<%=rawBioAssay%>" property="parent" /></td>
    352352      </tr>
    353353      <tr>
Note: See TracChangeset for help on using the changeset viewer.