public class ArrayDesignImporter extends AbstractItemImporter<ArrayDesign>
Plugin.MainType
Modifier and Type | Field and Description |
---|---|
private String |
dataDirectory |
private DefaultItemFunction<Platform> |
defaultPlatformFunction |
private DefaultItemFunction<PlatformVariant> |
defaultVariantFunction |
private Mapper |
descriptionMapper |
protected static PluginParameter<String> |
fileColumnMapping |
private Mapper |
fileMapper |
protected static PluginParameter<String> |
fileTypeColumnMapping |
private Mapper |
fileTypeMapper |
private static Set<GuiContext> |
guiContexts |
private Mapper |
nameMapper |
protected static PluginParameter<String> |
numArraysColumnMapping |
private Mapper |
numArraysMapper |
protected static PluginParameter<String> |
platformColumnMapping |
private Mapper |
platformMapper |
protected static PluginParameter<String> |
variantColumnMapping |
private Mapper |
variantMapper |
defaultsSection, descriptionColumnMapping, externalIdColumnMapping, identificationSection, internalIdColumnMapping, kitColumnMapping, nameColumnMapping, optionalColumnMapping, permissionTemplateColumnMapping, protocolColumnMapping, requiredColumnMapping, subtypeColumnMapping
complexMappings, dataFooterRegexpParameter, dataHeaderRegexpParameter, dataSplitterRegexpParameter, defaultErrorParameter, errorSection, fileParameter, fileType, headerRegexpParameter, ignoreRegexpParameter, invalidUseOfNullErrorParameter, mappingSection, maxDataColumnsParameter, minDataColumnsParameter, numberFormatErrorParameter, numberOutOfRangeErrorParameter, numDataColumnsType, optionalRegexpType, parserSection, requiredRegexpType, sectionRegexpParameter, stringTooLongErrorParameter, trimQuotesParameter
annotationSection, configuration, COPY_ANNOTATIONS, job, OVERWRITE_ANNOTATIONS, sc
Constructor and Description |
---|
ArrayDesignImporter() |
Modifier and Type | Method and Description |
---|---|
protected void |
addMoreColumnMappingParameters(List<PluginParameter<?>> parameters)
Adds column mappings for name, externalId, description,
protocol, creation date, original quantity, pooled, parent
and used quantity from parent.
|
protected void |
addMoreJobParameters(List<PluginParameter<?>> parameters)
Add parameter for "Data directory" directory where data files may be located.
|
protected void |
createColumnMappers(FlatFileParser ffp,
boolean cropStrings)
Create mappers that can be used to extract data values from the file
that is currently being parsed by the
ffp FlatFileParser . |
protected ArrayDesign |
createItem(DbControl dc,
FlatFileParser.Data data)
Create a new item and populate it with data from the current line.
|
protected ItemQuery<ArrayDesign> |
createItemQuery()
Calls
PhysicalBioAssay.getQuery() . |
protected void |
doneWithItem(DbControl dc,
ArrayDesign design,
int numMultiLines)
Validate data files if they have been set.
|
Set<GuiContext> |
getGuiContexts()
Get a set containing all items that the plugin handles.
|
protected IdMethod[] |
getIdMethods()
|
protected void |
updateItem(DbControl dc,
ArrayDesign design,
FlatFileParser.Data data)
Update an item with data from the current line.
|
protected void |
updateMultiLineItem(DbControl dc,
ArrayDesign design,
FlatFileParser.Data data,
int multiLineNum)
Add data files
|
addMoreErrorParameters, addMoreParsingParameters, begin, beginData, configure, end, findAnnotationTypeCategory, findArrayBatch, findArrayDesign, findArraySlide, findBioPlate, findBioPlateType, findBioSource, findBioSource, findBioWell, findDataFileType, findDerivedBioAssay, findExtract, findExtract, findFileServer, findHardware, findHardware, findHybridization, findItemSubtype, findItemSubtype, findKit, findLabeledExtract, findPermissionTemplate, findPhysicalBioAssay, findPlateGeometry, findPlatform, findProtocol, findProtocol, findRawDataType, findReferencedItem, findReferencedItemWithSubtype, findSample, findSample, findSoftware, findSoftware, findTag, findTag, findUnit, findVariant, getConfigureOptionsParameters, getConfigureParserParameters, getDefaultItemFunction, getIdMethod, getInitializedFlatFileParser, getInitializedFlatFileParser, getItemForSubtypes, getProjectDefaultPlatform, getProjectDefaultRawDataType, getProjectDefaultVariant, getRequestInformation, getSuccessMessage, handleData, initReferenceQuery, isInContext, parseDate, requiresConfiguration, setOrAddFile, setUpErrorHandling, supportsConfigurations, updateItemSubtype, updatePermissions
addErrorHandler, checkColumnMapping, checkColumnMapping, continueWithNextFileAfterError, doImport, finish, getCharset, getCharset, getDecimalSeparator, getErrorHandler, getErrorOption, getFileIterator, getMainType, getMapper, getMapper, getNumberFormat, getNumBytes, getPattern, getProgress, getSignalHandler, getTotalFileSize, handleHeader, handleSection, isImportable, isImportable, log, log, log, log, run, start, wrapInputStream
cloneParameterWithDefaultValue, closeLogFile, createLogFile, done, getCopyAnnotationsParmeter, getCurrentConfiguration, getCurrentJob, getJobOrConfigurationValue, getOverwriteAnnotationsParameters, getPermissions, init, log, log, storeValue, storeValue, storeValues, validateRequestParameters
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
done, getMainType, getPermissions, init, run
private static final Set<GuiContext> guiContexts
protected static final PluginParameter<String> numArraysColumnMapping
protected static final PluginParameter<String> platformColumnMapping
protected static final PluginParameter<String> variantColumnMapping
protected static final PluginParameter<String> fileTypeColumnMapping
protected static final PluginParameter<String> fileColumnMapping
private Mapper nameMapper
private Mapper descriptionMapper
private Mapper numArraysMapper
private Mapper platformMapper
private DefaultItemFunction<Platform> defaultPlatformFunction
private Mapper variantMapper
private DefaultItemFunction<PlatformVariant> defaultVariantFunction
private Mapper fileTypeMapper
private Mapper fileMapper
private String dataDirectory
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()
getIdMethods
in class AbstractItemImporter<ArrayDesign>
protected void addMoreJobParameters(List<PluginParameter<?>> parameters)
addMoreJobParameters
in class AbstractItemImporter<ArrayDesign>
parameters
- The list of parameters to add the column
mapping parameters toprotected void addMoreColumnMappingParameters(List<PluginParameter<?>> parameters)
addMoreColumnMappingParameters
in class AbstractItemImporter<ArrayDesign>
parameters
- The list of parameters to add the column
mapping parameters toprotected ItemQuery<ArrayDesign> createItemQuery()
PhysicalBioAssay.getQuery()
.createItemQuery
in class AbstractItemImporter<ArrayDesign>
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<ArrayDesign>
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 ArrayDesign 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<ArrayDesign>
dc
- The DbControl to use for database accessdata
- The current data lineprotected void updateItem(DbControl dc, ArrayDesign design, 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<ArrayDesign>
dc
- The DbControl to use for database accessdesign
- The item to updatedata
- The current data lineprotected void updateMultiLineItem(DbControl dc, ArrayDesign design, FlatFileParser.Data data, int multiLineNum)
updateMultiLineItem
in class AbstractItemImporter<ArrayDesign>
dc
- The DbControl to use for database accessdesign
- The item to updatedata
- The current data linemultiLineNum
- The number of the multi-line entry, starting with 1
for the first multi-lineprotected void doneWithItem(DbControl dc, ArrayDesign design, int numMultiLines)
doneWithItem
in class AbstractItemImporter<ArrayDesign>
dc
- The DbControl to use for database accessdesign
- The item to updatenumMultiLines
- The number of the multi-line entries, starting with 1
for the first multi-line (0 for single-line entries)