3.2.1: 2012-12-13

net.sf.basedb.plugins.batchimport
Class ScanImporter

java.lang.Object
  extended by net.sf.basedb.core.plugin.AbstractPlugin
      extended by net.sf.basedb.plugins.AbstractFlatFileImporter
          extended by net.sf.basedb.plugins.batchimport.AbstractItemImporter<DerivedBioAssay>
              extended by net.sf.basedb.plugins.batchimport.ScanImporter
All Implemented Interfaces:
AutoDetectingImporter, InteractivePlugin, Plugin, SignalTarget, ConfigureByExample

Deprecated. In 3.0, use DerivedBioAssayImporter instead

@Deprecated
public class ScanImporter
extends AbstractItemImporter<DerivedBioAssay>

Plug-in for importing scan items in a batch. The plug-in can create new items and updated existing items.

Version:
2.8
Author:
nicklas
Last modified
$Date: 2011-09-13 11:41:48 +0200 (Tue, 13 Sep 2011) $

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.sf.basedb.core.plugin.Plugin
Plugin.MainType
 
Field Summary
private  Mapper descriptionMapper
          Deprecated.  
private static Set<GuiContext> guiContexts
          Deprecated.  
protected static PluginParameter<String> hardwareColumnMapping
          Deprecated.  
private  Mapper hardwareMapper
          Deprecated.  
protected static PluginParameter<String> hybridizationColumnMapping
          Deprecated.  
private  Mapper hybridizationMapper
          Deprecated.  
protected static PluginParameter<String> imageFileColumnMapping
          Deprecated.  
private  Mapper imageFileMapper
          Deprecated.  
private  String imagesDirectory
          Deprecated.  
private  Mapper nameMapper
          Deprecated.  
private  Mapper protocolMapper
          Deprecated.  
 
Fields inherited from class net.sf.basedb.plugins.batchimport.AbstractItemImporter
defaultsSection, descriptionColumnMapping, externalIdColumnMapping, identificationSection, internalIdColumnMapping, nameColumnMapping, optionalColumnMapping, permissionTemplateColumnMapping, protocolColumnMapping, requiredColumnMapping, subtypeColumnMapping
 
Fields inherited from class net.sf.basedb.plugins.AbstractFlatFileImporter
complexMappings, dataFooterRegexpParameter, dataHeaderRegexpParameter, dataSplitterRegexpParameter, defaultErrorParameter, errorSection, fileParameter, fileType, headerRegexpParameter, ignoreRegexpParameter, invalidUseOfNullErrorParameter, mappingSection, maxDataColumnsParameter, minDataColumnsParameter, numberFormatErrorParameter, numberOutOfRangeErrorParameter, numDataColumnsType, optionalRegexpType, parserSection, requiredRegexpType, sectionRegexpParameter, stringTooLongErrorParameter, trimQuotesParameter
 
Fields inherited from class net.sf.basedb.core.plugin.AbstractPlugin
annotationSection, configuration, COPY_ANNOTATIONS, job, OVERWRITE_ANNOTATIONS, sc
 
Constructor Summary
ScanImporter()
          Deprecated.  
 
Method Summary
protected  void addMoreColumnMappingParameters(List<PluginParameter<?>> parameters)
          Deprecated. Adds column mappings for name, internalId, description, hybridization, protocol, hardware, image-file, image-name, image-format and image-description.
protected  void addMoreJobParameters(List<PluginParameter<?>> parameters)
          Deprecated. Add parameter for "Image directory" directory where image files may be located.
protected  void createColumnMappers(FlatFileParser ffp, boolean cropStrings)
          Deprecated. Create mappers that can be used to extract data values from the file that is currently being parsed by the ffp FlatFileParser.
protected  DerivedBioAssay createItem(DbControl dc, FlatFileParser.Data data)
          Deprecated. Create a new item and populate it with data from the current line.
protected  ItemQuery<DerivedBioAssay> createItemQuery()
          Deprecated. Calls DerivedBioAssay.getQuery() and set a subtype filter for DerivedBioAssay.SCAN.
 Set<GuiContext> getGuiContexts()
          Deprecated. Get a set containing all items that the plugin handles.
protected  IdMethod[] getIdMethods()
          Deprecated. Useable methods are: PropertyIdMethod.NAME InternalIdMethod.INTERNAL_ID FallbackIdMethod.NAME_OR_ID
protected  void updateItem(DbControl dc, DerivedBioAssay scan, FlatFileParser.Data data)
          Deprecated. Update an item with data from the current line.
protected  void updateMultiLineItem(DbControl dc, DerivedBioAssay scan, FlatFileParser.Data data, int multiLineNum)
          Deprecated. Update an item with data from a multi-line entry.
 
Methods inherited from class net.sf.basedb.plugins.batchimport.AbstractItemImporter
addMoreErrorParameters, addMoreParsingParameters, begin, beginData, configure, doneWithItem, end, findArrayBatch, findArrayDesign, findArraySlide, findBioPlate, findBioPlateType, findBioSource, findBioSource, findBioWell, findDataFileType, findDerivedBioAssay, findExtract, findExtract, findHardware, findHardware, findHybridization, findItemSubtype, findItemSubtype, findLabeledExtract, findPermissionTemplate, findPhysicalBioAssay, findPlateGeometry, findPlatform, findProtocol, findProtocol, findRawDataType, findReferencedItem, findReferencedItemWithSubtype, findSample, findSample, findSoftware, findSoftware, findTag, findTag, findVariant, getConfigureOptionsParameters, getConfigureParserParameters, getDefaultItemFunction, getIdMethod, getInitializedFlatFileParser, getInitializedFlatFileParser, getItemForSubtypes, getProjectDefaultPlatform, getProjectDefaultRawDataType, getProjectDefaultVariant, getRequestInformation, getSuccessMessage, handleData, initReferenceQuery, isInContext, parseDate, requiresConfiguration, setOrAddFile, setUpErrorHandling, supportsConfigurations, updateItemSubtype, updatePermissions
 
Methods inherited from class net.sf.basedb.plugins.AbstractFlatFileImporter
addErrorHandler, checkColumnMapping, checkColumnMapping, continueWithNextFileAfterError, doImport, finish, getCharset, getCharset, getDecimalSeparator, getErrorHandler, getErrorOption, getFileIterator, getMainType, getMapper, getMapper, getNumberFormat, getNumBytes, getProgress, getSignalHandler, getTotalFileSize, handleHeader, handleSection, isImportable, isImportable, log, log, log, log, run, start, wrapInputStream
 
Methods inherited from class net.sf.basedb.core.plugin.AbstractPlugin
cloneParameterWithDefaultValue, closeLogFile, createLogFile, done, getCopyAnnotationsParmeter, getCurrentConfiguration, getCurrentJob, getJobOrConfigurationValue, getOverwriteAnnotationsParameters, getPermissions, init, log, log, storeValue, storeValue, storeValues, validateRequestParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.basedb.core.plugin.Plugin
done, getMainType, getPermissions, init, run
 

Field Detail

guiContexts

private static final Set<GuiContext> guiContexts
Deprecated. 

hardwareColumnMapping

protected static final PluginParameter<String> hardwareColumnMapping
Deprecated. 

hybridizationColumnMapping

protected static final PluginParameter<String> hybridizationColumnMapping
Deprecated. 

imageFileColumnMapping

protected static final PluginParameter<String> imageFileColumnMapping
Deprecated. 

nameMapper

private Mapper nameMapper
Deprecated. 

descriptionMapper

private Mapper descriptionMapper
Deprecated. 

protocolMapper

private Mapper protocolMapper
Deprecated. 

hardwareMapper

private Mapper hardwareMapper
Deprecated. 

hybridizationMapper

private Mapper hybridizationMapper
Deprecated. 

imageFileMapper

private Mapper imageFileMapper
Deprecated. 

imagesDirectory

private String imagesDirectory
Deprecated. 
Constructor Detail

ScanImporter

public ScanImporter()
Deprecated. 
Method Detail

getGuiContexts

public Set<GuiContext> getGuiContexts()
Deprecated. 
Description copied from interface: InteractivePlugin
Get a set containing all items that the plugin handles. Ie. if the plugin imports reporters, return a set containing Item.REPORTER. This information is used by client applications to put the plugin in the proper place in the user interface.

Returns:
A Set containing Item:s, or null if the plugin is not concerned about items

getIdMethods

protected IdMethod[] getIdMethods()
Deprecated. 
Useable methods are:

Overrides:
getIdMethods in class AbstractItemImporter<DerivedBioAssay>

addMoreColumnMappingParameters

protected void addMoreColumnMappingParameters(List<PluginParameter<?>> parameters)
Deprecated. 
Adds column mappings for name, internalId, description, hybridization, protocol, hardware, image-file, image-name, image-format and image-description.

Overrides:
addMoreColumnMappingParameters in class AbstractItemImporter<DerivedBioAssay>
Parameters:
parameters - The list of parameters to add the column mapping parameters to

addMoreJobParameters

protected void addMoreJobParameters(List<PluginParameter<?>> parameters)
Deprecated. 
Add parameter for "Image directory" directory where image files may be located.

Overrides:
addMoreJobParameters in class AbstractItemImporter<DerivedBioAssay>
Parameters:
parameters - The list of parameters to add the column mapping parameters to

createItemQuery

protected ItemQuery<DerivedBioAssay> createItemQuery()
Deprecated. 
Calls DerivedBioAssay.getQuery() and set a subtype filter for DerivedBioAssay.SCAN.

Specified by:
createItemQuery in class AbstractItemImporter<DerivedBioAssay>
Returns:
A query

createColumnMappers

protected void createColumnMappers(FlatFileParser ffp,
                                   boolean cropStrings)
Deprecated. 
Description copied from class: AbstractItemImporter
Create mappers that can be used to extract data values from the file that is currently being parsed by the ffp FlatFileParser. This method is called during initialisation of the plug-in when the FlatFileParser.parseHeaders() has successfully found the start of data. Use the AbstractFlatFileImporter.getMapper(FlatFileParser, String, Integer, Mapper) to create column mappers. Example:
nameMapper = getMapper(ffp, job.getValue("nameColumnMapping"), 
   cropStrings ? Nameable.MAX_NAME_LENGTH : null, null);

Overrides:
createColumnMappers in class AbstractItemImporter<DerivedBioAssay>
Parameters:
ffp - The parser that is parsing the data file
cropStrings - If strings that are too long to fit in the database should be cropped or not (=generate an error)

createItem

protected DerivedBioAssay createItem(DbControl dc,
                                     FlatFileParser.Data data)
Deprecated. 
Description copied from class: AbstractItemImporter
Create a new item and populate it with data from the current line. Do not call DbControl.saveItem(BasicItem). This is done automatically by the core implementation.
BioSource bs = BioSource.getNew(dc);
// Set properties. See example on updateItem method
return bs;

If the current data line doesn't have data for all required properties, this method should throw an InvalidUseOfNullException exception.

This method is called during import when current item can be found and if the user has selected to create missing item.

Specified by:
createItem in class AbstractItemImporter<DerivedBioAssay>
Parameters:
dc - The DbControl to use for database access
data - The current data line
Returns:
A new item

updateItem

protected void updateItem(DbControl dc,
                          DerivedBioAssay scan,
                          FlatFileParser.Data data)
Deprecated. 
Description copied from class: AbstractItemImporter
Update an item with data from the current line. Example:
if (nameMapper != null) item.setName(nameMapper.getValue(data));
if (descriptionMapper != null) item.setDescription(descriptionMapper.getValue(data));
...
This method is called during import to update an existing item.

Specified by:
updateItem in class AbstractItemImporter<DerivedBioAssay>
Parameters:
dc - The DbControl to use for database access
scan - The item to update
data - The current data line

updateMultiLineItem

protected void updateMultiLineItem(DbControl dc,
                                   DerivedBioAssay scan,
                                   FlatFileParser.Data data,
                                   int multiLineNum)
Deprecated. 
Description copied from class: AbstractItemImporter
Update an item with data from a multi-line entry. Items which can have multiple parents should have data for the other parents on lines following the first line.

Overrides:
updateMultiLineItem in class AbstractItemImporter<DerivedBioAssay>
Parameters:
dc - The DbControl to use for database access
scan - The item to update
data - The current data line
multiLineNum - The number of the multi-line entry, starting with 1 for the first multi-line

3.2.1: 2012-12-13