|
3.1.2: 2012-07-31 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.basedb.core.plugin.AbstractPlugin
net.sf.basedb.plugins.AbstractFlatFileImporter
net.sf.basedb.plugins.batchimport.AbstractItemImporter<Extract>
net.sf.basedb.plugins.batchimport.LabeledExtractImporter
ExtractImporter
instead
@Deprecated public class LabeledExtractImporter
Plug-in for importing labled extract items in a batch. The plug-in can create new items and updated existing items.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface net.sf.basedb.core.plugin.Plugin |
---|
Plugin.MainType |
Field Summary | |
---|---|
private Mapper |
bioPlateMapper
Deprecated. |
private Mapper |
bioWellColMapper
Deprecated. |
private Mapper |
bioWellRowMapper
Deprecated. |
private Mapper |
createdMapper
Deprecated. |
private Mapper |
descriptionMapper
Deprecated. |
private Mapper |
externalIdMapper
Deprecated. |
private static Set<GuiContext> |
guiContexts
Deprecated. |
protected static PluginParameter<String> |
labelColumnMapping
Deprecated. |
private Mapper |
labelMapper
Deprecated. |
private Mapper |
nameMapper
Deprecated. |
private Mapper |
originalQuantityMapper
Deprecated. |
private Mapper |
parentMapper
Deprecated. |
private Mapper |
protocolMapper
Deprecated. |
private Mapper |
usedQuantityMapper
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.core.plugin.AbstractPlugin |
---|
annotationSection, configuration, COPY_ANNOTATIONS, job, OVERWRITE_ANNOTATIONS, sc |
Constructor Summary | |
---|---|
LabeledExtractImporter()
Deprecated. |
Method Summary | |
---|---|
protected void |
addMoreColumnMappingParameters(List<PluginParameter<?>> parameters)
Deprecated. Adds column mappings for name, externalId, description, protocol, creation date, original quantity, pooled, parent and used quantity from parent. |
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 Extract |
createItem(DbControl dc,
FlatFileParser.Data data)
Deprecated. Create a new item and populate it with data from the current line. |
protected ItemQuery<Extract> |
createItemQuery()
Deprecated. Calls Extract.getQuery() and set a subtype filter for
Extract.LABELED . |
Set<GuiContext> |
getGuiContexts()
Deprecated. Get a set containing all items that the plugin handles. |
protected IdMethod[] |
getIdMethods()
Deprecated. Useable methods are: PropertyIdMethod.NAME
PropertyIdMethod.EXTERNAL_ID
InternalIdMethod.INTERNAL_ID
FallbackIdMethod.NAME_OR_ID
|
protected void |
updateItem(DbControl dc,
Extract extract,
FlatFileParser.Data data)
Deprecated. Update an item with data from the current line. |
protected void |
updateMultiLineItem(DbControl dc,
Extract extract,
FlatFileParser.Data data,
int multiLineNum)
Deprecated. If the labeled extract is pooled, add the parent labeled extract. |
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 |
---|
private static final Set<GuiContext> guiContexts
protected static final PluginParameter<String> labelColumnMapping
private Mapper nameMapper
private Mapper descriptionMapper
private Mapper externalIdMapper
private Mapper labelMapper
private Mapper originalQuantityMapper
private Mapper createdMapper
private Mapper protocolMapper
private Mapper parentMapper
private Mapper usedQuantityMapper
private Mapper bioPlateMapper
private Mapper bioWellRowMapper
private Mapper bioWellColMapper
Constructor Detail |
---|
public LabeledExtractImporter()
Method Detail |
---|
public Set<GuiContext> getGuiContexts()
InteractivePlugin
Item.REPORTER
.
This information is used by client applications to put the plugin
in the proper place in the user interface.
Set
containing Item
:s, or null
if the plugin is not concerned about itemsprotected IdMethod[] getIdMethods()
PropertyIdMethod.NAME
PropertyIdMethod.EXTERNAL_ID
InternalIdMethod.INTERNAL_ID
FallbackIdMethod.NAME_OR_ID
getIdMethods
in class AbstractItemImporter<Extract>
protected void addMoreColumnMappingParameters(List<PluginParameter<?>> parameters)
addMoreColumnMappingParameters
in class AbstractItemImporter<Extract>
parameters
- The list of parameters to add the column
mapping parameters toprotected ItemQuery<Extract> createItemQuery()
Extract.getQuery()
and set a subtype filter for
Extract.LABELED
.
createItemQuery
in class AbstractItemImporter<Extract>
protected void createColumnMappers(FlatFileParser ffp, boolean cropStrings)
AbstractItemImporter
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);
createColumnMappers
in class AbstractItemImporter<Extract>
ffp
- The parser that is parsing the data filecropStrings
- If strings that are too long to fit in the database
should be cropped or not (=generate an error)protected Extract createItem(DbControl dc, FlatFileParser.Data data)
AbstractItemImporter
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.
createItem
in class AbstractItemImporter<Extract>
dc
- The DbControl to use for database accessdata
- The current data line
protected void updateItem(DbControl dc, Extract extract, FlatFileParser.Data data)
AbstractItemImporter
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.
updateItem
in class AbstractItemImporter<Extract>
dc
- The DbControl to use for database accessextract
- The item to updatedata
- The current data lineprotected void updateMultiLineItem(DbControl dc, Extract extract, FlatFileParser.Data data, int multiLineNum)
updateMultiLineItem
in class AbstractItemImporter<Extract>
dc
- The DbControl to use for database accessextract
- The item to updatedata
- The current data linemultiLineNum
- The number of the multi-line entry, starting with 1
for the first multi-line
|
3.1.2: 2012-07-31 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |