2.17.2: 2011-06-17

net.sf.basedb.util.overview.loader
Class SampleLoader

java.lang.Object
  extended by net.sf.basedb.util.overview.loader.AbstractNodeLoader<I>
      extended by net.sf.basedb.util.overview.loader.BasicItemNodeLoader<Sample>
          extended by net.sf.basedb.util.overview.loader.SampleLoader
All Implemented Interfaces:
NodeLoader<Sample>

public class SampleLoader
extends BasicItemNodeLoader<Sample>

Node loader implementation for samples. The forward-loading direction goes from BioSource:s -> Sample:s -> Extract:s. The reverse-loading direction is the opposite direction. In both cases we also need to consider pooled samples.

Version:
2.10
Author:
Nicklas
Last modified
$Date: 2010-11-18 08:26:30 +0100 (Thu, 18 Nov 2010) $

Field Summary
 
Fields inherited from class net.sf.basedb.util.overview.loader.BasicItemNodeLoader
ALLOW_ROOT_NODE, allowAsRootNode, DENY_ROOT_NODE, factoryKey, nameGenerator
 
Constructor Summary
SampleLoader()
           
 
Method Summary
private  Node createForwardNode(BioSource bioSource, DbControl dc, OverviewContext context, Node parentNode)
          Create forward-loading sample nodes for the samples that has a given biosource as their parent.
 Node createForwardNode(DbControl dc, OverviewContext context, Node parentNode)
          Create forward-loading sample nodes from a given parent biosource or sample.
private  Node createForwardNode(Sample parentSample, DbControl dc, OverviewContext context, Node parentNode)
          Create forward-loading sample nodes for the (pooled) samples that has a given sample as their parent.
 Node createReverseNode(DbControl dc, OverviewContext context, Node parentNode)
          Create reverse-loading sample nodes from an extract node or from a pooled sample.
private  Node createReverseNode(Extract extract, DbControl dc, OverviewContext context, Node parentNode)
          Create a reverse-loading sample node from an extract.
private  Node createReverseNode(Sample product, DbControl dc, OverviewContext context, Node parentNode)
          Create reverse-loading samples nodes of a pooled sample.
protected  void loadForwardChildNodes(DbControl dc, OverviewContext context, Node sampleNode)
          Loads the pooled samples and extracts that has been created from this sample.
protected  void loadPropertyChildNodes(DbControl dc, OverviewContext context, Node sampleNode)
          Loads property nodes of a sample.
protected  void loadReverseChildNodes(DbControl dc, OverviewContext context, Node sampleNode)
          If the sample is a pooled sample, loads the parent samples that it was pooled from.
 
Methods inherited from class net.sf.basedb.util.overview.loader.BasicItemNodeLoader
createItemNode, createRootNode, getNodeFactory, getNodeFactory, getNodeLoader, getNodeLoaderFactory, getNodeValidator, getNodeValidatorFactory, postValidateFolder
 
Methods inherited from class net.sf.basedb.util.overview.loader.AbstractNodeLoader
createPropertyNode, loadChildNodes, loadChildNodesOfFolderNode, loadChildNodesOfItemNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SampleLoader

public SampleLoader()
Method Detail

createForwardNode

public Node createForwardNode(DbControl dc,
                              OverviewContext context,
                              Node parentNode)
Create forward-loading sample nodes from a given parent biosource or sample. In both cases the returned node is a folder-type node that contains the child samples.

Specified by:
createForwardNode in interface NodeLoader<Sample>
Overrides:
createForwardNode in class AbstractNodeLoader<Sample>
Parameters:
dc - The DbControl to use for database access
context - The overview context
parentNode - The parent node
Returns:
The folder node for the samples

createReverseNode

public Node createReverseNode(DbControl dc,
                              OverviewContext context,
                              Node parentNode)
Create reverse-loading sample nodes from an extract node or from a pooled sample. In the first case, the returned node is an item-type node with the parent sample. In the second case, the returned node is a folder-type node with the pooled samples.

Specified by:
createReverseNode in interface NodeLoader<Sample>
Overrides:
createReverseNode in class AbstractNodeLoader<Sample>
Parameters:
dc - The DbControl to use for database access
context - The overview context
parentNode - The child node
Returns:
A folder-type or item-type node

loadPropertyChildNodes

protected void loadPropertyChildNodes(DbControl dc,
                                      OverviewContext context,
                                      Node sampleNode)
Loads property nodes of a sample.

Overrides:
loadPropertyChildNodes in class AbstractNodeLoader<Sample>

loadForwardChildNodes

protected void loadForwardChildNodes(DbControl dc,
                                     OverviewContext context,
                                     Node sampleNode)
Loads the pooled samples and extracts that has been created from this sample.

Overrides:
loadForwardChildNodes in class AbstractNodeLoader<Sample>
See Also:
ExtractLoader.createForwardNode(DbControl, OverviewContext, Node), createForwardNode(DbControl, OverviewContext, Node)

loadReverseChildNodes

protected void loadReverseChildNodes(DbControl dc,
                                     OverviewContext context,
                                     Node sampleNode)
If the sample is a pooled sample, loads the parent samples that it was pooled from. Otherwise load the parent biosource.

Overrides:
loadReverseChildNodes in class AbstractNodeLoader<Sample>
See Also:
createReverseNode(DbControl, OverviewContext, Node), BioSourceLoader.createReverseNode(DbControl, OverviewContext, Node)

createReverseNode

private Node createReverseNode(Sample product,
                               DbControl dc,
                               OverviewContext context,
                               Node parentNode)
Create reverse-loading samples nodes of a pooled sample. Eg. the child nodes are the source samples that was pooled to create the given product.


createReverseNode

private Node createReverseNode(Extract extract,
                               DbControl dc,
                               OverviewContext context,
                               Node parentNode)
Create a reverse-loading sample node from an extract. Eg. the child node is the sample that is the parent of the (non-pooled) extract.


createForwardNode

private Node createForwardNode(BioSource bioSource,
                               DbControl dc,
                               OverviewContext context,
                               Node parentNode)
Create forward-loading sample nodes for the samples that has a given biosource as their parent.


createForwardNode

private Node createForwardNode(Sample parentSample,
                               DbControl dc,
                               OverviewContext context,
                               Node parentNode)
Create forward-loading sample nodes for the (pooled) samples that has a given sample as their parent.


2.17.2: 2011-06-17