3.2.4: 2013-12-06

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

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

public class ExtractLoader
extends BasicItemNodeLoader<Extract>

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

Version:
2.10
Author:
Nicklas
Last modified
$Date: 2012-08-24 14:23:25 +0200 (Fri, 24 Aug 2012) $

Field Summary
 
Fields inherited from class net.sf.basedb.util.overview.loader.BasicItemNodeLoader
ALLOW_ROOT_NODE, allowAsRootNode, DENY_ROOT_NODE, factoryKey, nameGenerator
 
Constructor Summary
ExtractLoader()
           
 
Method Summary
private  void createForwardNode(BioMaterialList list, DbControl dc, OverviewContext context, Node listNode)
           
 Node createForwardNode(DbControl dc, OverviewContext context, Node parentNode)
          Create forward-loading extract nodes from a given parent sample or extract.
private  Node createForwardNode(Extract parentExtract, DbControl dc, OverviewContext context, Node parentNode, boolean onlyPushAnnotationTypes)
          Create forward-loading extract nodes for the (pooled) extract that has a given extract among their parents.
private  Node createForwardNode(Sample sample, DbControl dc, OverviewContext context, Node parentNode, boolean onlyPushAnnotationTypes)
          Create forward-loading extract nodes for the extracts that has a given sample as their parent.
private  Node createPooledReverseNode(Extract product, DbControl dc, OverviewContext context, Node parentNode)
          Create reverse-loading extract nodes of a pooled extract.
 Node createPropertyNode(DbControl dc, OverviewContext context, Node parentNode)
          A property node is created when moving in the reverse direction so that we can load child extracts+physical bioassays with the ItemSubtype.getPushAnnotations() flag set.
 Node createReverseNode(DbControl dc, OverviewContext context, Node parentNode)
          The parent node can be one of: Physical bioassay: Load the source extract(s) and return a folder-type node Extract: Load the parent extracts and return either a folder-type or item-type node depending on the number of parents Raw bioassay: Load the parent extract and return an item-type node Derived bioassay: Load the parent extract and return an item-type node
private  Node createReverseNode(DerivedBioAssay bioAssay, DbControl dc, OverviewContext context, Node bioAssayNode)
           
private  Node createReverseNode(PhysicalBioAssay bioAssay, DbControl dc, OverviewContext context, Node bioAssayNode)
          Create reverse-loading extract nodes from a physical bioassay.
private  Node createReverseNode(RawBioAssay raw, DbControl dc, OverviewContext context, Node rawNode)
           
private  Node createSingleParentReverseNode(Extract bioMaterial, DbControl dc, OverviewContext context, Node parentNode)
          Create a reverse-loading extract node from an extract.
private  Set<Integer> getExtractChain(Node node)
           
protected  void loadForwardChildNodes(DbControl dc, OverviewContext context, Node extractNode)
          Loads the child extracts and physical bioassays that has been created from this extract.
protected  void loadPropertyChildNodes(DbControl dc, OverviewContext context, Node extractNode)
          Loads property nodes of an extract.
protected  void loadReverseChildNodes(DbControl dc, OverviewContext context, Node extractNode)
          Load either the parent sample or extract(s) and child extracts+physical bioassays with a subtype that has ItemSubtype.getPushAnnotations() flag set.
 
Methods inherited from class net.sf.basedb.util.overview.loader.BasicItemNodeLoader
createItemNode, createRootNode, getNodeFactory, getNodeFactory, getNodeLoader, getNodeLoaderFactory, getNodeNameGenerator, getNodeValidator, getNodeValidatorFactory, postValidateFolder
 
Methods inherited from class net.sf.basedb.util.overview.loader.AbstractNodeLoader
loadChildNodes, loadChildNodesOfFolderNode, loadChildNodesOfItemNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtractLoader

public ExtractLoader()
Method Detail

createForwardNode

public Node createForwardNode(DbControl dc,
                              OverviewContext context,
                              Node parentNode)
Create forward-loading extract nodes from a given parent sample or extract. In both cases the returned node is a folder-type node that contains the child extracts. It can also create all-loading node from a biomaterial list for the member samples.

Specified by:
createForwardNode in interface NodeLoader<Extract>
Overrides:
createForwardNode in class AbstractNodeLoader<Extract>
Parameters:
dc - The DbControl to use for database access
context - The overview context
parentNode - The parent node
Returns:
The folder node for the extracts (or null if used with a list)

createReverseNode

public Node createReverseNode(DbControl dc,
                              OverviewContext context,
                              Node parentNode)
The parent node can be one of:

Specified by:
createReverseNode in interface NodeLoader<Extract>
Overrides:
createReverseNode in class AbstractNodeLoader<Extract>
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

createPropertyNode

public Node createPropertyNode(DbControl dc,
                               OverviewContext context,
                               Node parentNode)
A property node is created when moving in the reverse direction so that we can load child extracts+physical bioassays with the ItemSubtype.getPushAnnotations() flag set. The parent node should be a sample or extract node.

Specified by:
createPropertyNode in interface NodeLoader<Extract>
Overrides:
createPropertyNode in class AbstractNodeLoader<Extract>
Parameters:
dc - The DbControl to use for database access
context - The overview context
parentNode - The parent node
Returns:
A node (may be a folder-type node with many subnodes), or null
Since:
3.1

loadPropertyChildNodes

protected void loadPropertyChildNodes(DbControl dc,
                                      OverviewContext context,
                                      Node extractNode)
Loads property nodes of an extract.

Overrides:
loadPropertyChildNodes in class AbstractNodeLoader<Extract>

loadForwardChildNodes

protected void loadForwardChildNodes(DbControl dc,
                                     OverviewContext context,
                                     Node extractNode)
Loads the child extracts and physical bioassays that has been created from this extract. Raw bioassays linking to this parent extract and doesn't have a parent derived bioassay are alos loaded.

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

loadReverseChildNodes

protected void loadReverseChildNodes(DbControl dc,
                                     OverviewContext context,
                                     Node extractNode)
Load either the parent sample or extract(s) and child extracts+physical bioassays with a subtype that has ItemSubtype.getPushAnnotations() flag set.

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

createPooledReverseNode

private Node createPooledReverseNode(Extract product,
                                     DbControl dc,
                                     OverviewContext context,
                                     Node parentNode)
Create reverse-loading extract nodes of a pooled extract. Eg. the child nodes are the source extracts that was pooled to create the given product.


createSingleParentReverseNode

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


createReverseNode

private Node createReverseNode(PhysicalBioAssay bioAssay,
                               DbControl dc,
                               OverviewContext context,
                               Node bioAssayNode)
Create reverse-loading extract nodes from a physical bioassay. Eg. the child nodes are the extracts that has been used on a bioassay.


createReverseNode

private Node createReverseNode(DerivedBioAssay bioAssay,
                               DbControl dc,
                               OverviewContext context,
                               Node bioAssayNode)

createReverseNode

private Node createReverseNode(RawBioAssay raw,
                               DbControl dc,
                               OverviewContext context,
                               Node rawNode)

createForwardNode

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


createForwardNode

private Node createForwardNode(Extract parentExtract,
                               DbControl dc,
                               OverviewContext context,
                               Node parentNode,
                               boolean onlyPushAnnotationTypes)
Create forward-loading extract nodes for the (pooled) extract that has a given extract among their parents. If the parent node is a forward-loading node all child nodes are loaded, otherwise only child nodes that have an item with a subtype that has ItemSubtype.getPushAnnotations() set.


createForwardNode

private void createForwardNode(BioMaterialList list,
                               DbControl dc,
                               OverviewContext context,
                               Node listNode)

getExtractChain

private Set<Integer> getExtractChain(Node node)

3.2.4: 2013-12-06