|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.plugin.AbstractPlugin net.sf.basedb.plugins.AbstractFlatFileImporter net.sf.basedb.plugins.PrintMapFlatFileImporter
public class PrintMapFlatFileImporter
A plugin that imports an ArrayDesign
from a printmap. The
formats supported are TAM and MwBr
Nested Class Summary | |
---|---|
private static class |
PrintMapFlatFileImporter.FormatType
|
private static class |
PrintMapFlatFileImporter.MetaBlock
|
private static class |
PrintMapFlatFileImporter.Section
|
Nested classes/interfaces inherited from interface net.sf.basedb.core.plugin.Plugin |
---|
Plugin.MainType |
Field Summary | |
---|---|
private static About |
about
|
private ArrayDesign |
arrayDesign
|
private PluginParameter<ArrayDesign> |
arrayDesignParameter
|
private ItemParameterType<ArrayDesign> |
arrayDesignType
|
private FeatureBatcher |
batcher
|
private Map<BlockInfo,ArrayDesignBlock> |
blocks
|
private RequestInformation |
configureJob
|
private DbControl |
dc
|
private int |
expectedNumBlocks
|
private PrintMapFlatFileImporter.FormatType |
formatType
|
private static Set<GuiContext> |
guiContexts
|
private Map<Integer,PrintMapFlatFileImporter.MetaBlock> |
metaBlocks
|
protected static PluginParameter<String> |
missingWellErrorParameter
|
private int |
numBlocks
|
private int |
numFeatures
|
private static Set<Permissions> |
permissions
|
private FileSetMember |
printMapMember
|
private PrintMapFlatFileImporter.Section |
section
|
private int |
spotSize
|
Fields inherited from class net.sf.basedb.core.plugin.AbstractPlugin |
---|
annotationSection, configuration, COPY_ANNOTATIONS, job, OVERWRITE_ANNOTATIONS, sc |
Constructor Summary | |
---|---|
PrintMapFlatFileImporter()
|
Method Summary | |
---|---|
protected void |
begin(FlatFileParser ffp)
Create a DbControl and a FeatureBatcher . |
void |
configure(GuiContext context,
Request request,
Response response)
Store configuration settings for Request.COMMAND_CONFIGURE_PLUGIN
and Request.COMMAND_CONFIGURE_JOB . |
protected void |
end(boolean success)
Called just after the last line of the file has been parsed, or immediately after an error has ocurred. |
private Well |
findWell(int platePosition,
int row,
int column)
|
About |
getAbout()
Get information about the plugin, such as name, version, authors, etc. |
private RequestInformation |
getConfigureJobParameters(GuiContext context)
|
Set<GuiContext> |
getGuiContexts()
Get a set containing all items that the plugin handles. |
protected FlatFileParser |
getInitializedFlatFileParser()
Create and initialise a flat file parser by setting all regular expressions and other options. |
Collection<Permissions> |
getPermissions()
Request write access to ArrayDesign:s, read access to Plate:s, Reporter:s, DataFileType:s, Platform:s and File:s. |
RequestInformation |
getRequestInformation(GuiContext context,
String command)
The Request.COMMAND_CONFIGURE_PLUGIN command will ask for
parser regular expressions and column mappings. |
protected String |
getSuccessMessage(int skippedLines)
Called if the parsing was successful to let the subclass generate a simple message that is sent back to the core and user interface. |
protected void |
handleData(FlatFileParser.Data data)
Called by the parser for every line in the file that is a data line. |
protected void |
handleHeader(FlatFileParser.Line line)
Called by the parser for every line in the file that is a header line. |
protected void |
handleSection(FlatFileParser.Line line)
Called by the parser for every line in the file that is a section line. |
protected boolean |
isImportable(FlatFileParser ffp)
Check that the file is a TAM or MwBr file. |
String |
isInContext(GuiContext context,
Object item)
Returns null if the item is a ArrayDesign that doesn't already have
any features and isn't an affy design. |
boolean |
requiresConfiguration()
Return TRUE, since the implementation requires it for finding the regular expressions used by the FlatFileParser . |
private void |
setBlockValue(PrintMapFlatFileImporter.MetaBlock block,
FlatFileParser.Line line)
|
boolean |
supportsConfigurations()
Returns TRUE, since that is how the plugins used to work before this method was introduced. |
Methods inherited from class net.sf.basedb.plugins.AbstractFlatFileImporter |
---|
addErrorHandler, beginData, checkColumnMapping, checkColumnMapping, continueWithNextFileAfterError, doImport, finish, getCharset, getCharset, getCharsetParameter, getDecimalSeparator, getDecimalSeparatorParameter, getErrorHandler, getErrorOption, getFileIterator, getMainType, getMapper, getNumberFormat, getNumBytes, getPrimaryLocationFilter, getProgress, getSignalHandler, getTotalFileSize, isImportable, log, log, log, log, run, setUpErrorHandling, start, wrapInputStream |
Methods inherited from class net.sf.basedb.core.plugin.AbstractPlugin |
---|
checkInterrupted, cloneParameterWithDefaultValue, closeLogFile, createLogFile, done, getCopyAnnotationsParmeter, getCurrentConfiguration, getCurrentJob, getJobOrConfigurationValue, getOverwriteAnnotationsParameters, 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, init, run |
Field Detail |
---|
private static final About about
private static final Set<GuiContext> guiContexts
private static final Set<Permissions> permissions
protected static final PluginParameter<String> missingWellErrorParameter
private RequestInformation configureJob
private DbControl dc
private FeatureBatcher batcher
private Map<BlockInfo,ArrayDesignBlock> blocks
private Map<Integer,PrintMapFlatFileImporter.MetaBlock> metaBlocks
private ArrayDesign arrayDesign
private FileSetMember printMapMember
private ItemParameterType<ArrayDesign> arrayDesignType
private PluginParameter<ArrayDesign> arrayDesignParameter
private int numFeatures
private int numBlocks
private PrintMapFlatFileImporter.Section section
private PrintMapFlatFileImporter.FormatType formatType
private int expectedNumBlocks
private int spotSize
Constructor Detail |
---|
public PrintMapFlatFileImporter()
Method Detail |
---|
public About getAbout()
Plugin
getAbout
in interface Plugin
About
objectpublic boolean supportsConfigurations()
AbstractPlugin
supportsConfigurations
in interface Plugin
supportsConfigurations
in class AbstractPlugin
public boolean requiresConfiguration()
AbstractFlatFileImporter
FlatFileParser
. If this
method is overridden and returns FALSE, the subclass must also override
the AbstractFlatFileImporter.getInitializedFlatFileParser()
method and provide a
parser with all regular expressions and other options set.
requiresConfiguration
in interface Plugin
requiresConfiguration
in class AbstractFlatFileImporter
public Collection<Permissions> getPermissions()
getPermissions
in interface Plugin
getPermissions
in class AbstractPlugin
public String isInContext(GuiContext context, Object item)
ArrayDesign
that doesn't already have
any features and isn't an affy design.
isInContext
in interface InteractivePlugin
context
- The current context of the client application,
it is one of the values found in set returned by InteractivePlugin.getGuiContexts()
item
- The currently active item, it's type should match the
GuiContext.getItem()
type, or null if the context is a list
context
Null
if the plugin can use that item, or
a warning-level message explaining why the plugin can't be usedpublic 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.
getGuiContexts
in interface InteractivePlugin
Set
containing Item
:s, or null
if the plugin is not concerned about itemspublic RequestInformation getRequestInformation(GuiContext context, String command) throws BaseException
Request.COMMAND_CONFIGURE_PLUGIN
command will ask for
parser regular expressions and column mappings.
The Request.COMMAND_CONFIGURE_JOB
command will ask for
a file and the array design that features should be added to.
getRequestInformation
in interface InteractivePlugin
command
- the command for the requestcontext
- The current context of the client application,
it is one of the values found in set returned by InteractivePlugin.getGuiContexts()
RequestInformation
for the command
BaseException
- if there is an errorpublic void configure(GuiContext context, Request request, Response response)
Request.COMMAND_CONFIGURE_PLUGIN
and Request.COMMAND_CONFIGURE_JOB
.
configure
in interface InteractivePlugin
context
- The current context of the client application,
it is one of the values found in set returned by InteractivePlugin.getGuiContexts()
request
- Request object with the command and parametersresponse
- Response object in for the plugin to response
throughprotected boolean isImportable(FlatFileParser ffp)
isImportable
in class AbstractFlatFileImporter
ffp
- The FlatFileParser object used to parse the file
protected void begin(FlatFileParser ffp) throws BaseException
DbControl
and a FeatureBatcher
.
Check that the ArrayDesign
doesn't already have features.
begin
in class AbstractFlatFileImporter
BaseException
AbstractFlatFileImporter.end(boolean)
protected void handleHeader(FlatFileParser.Line line) throws BaseException
AbstractFlatFileImporter
handleHeader
in class AbstractFlatFileImporter
BaseException
protected void handleSection(FlatFileParser.Line line) throws BaseException
AbstractFlatFileImporter
handleSection
in class AbstractFlatFileImporter
BaseException
protected void handleData(FlatFileParser.Data data) throws BaseException
AbstractFlatFileImporter
handleData
in class AbstractFlatFileImporter
BaseException
protected void end(boolean success) throws BaseException
AbstractFlatFileImporter
AbstractFlatFileImporter.begin(FlatFileParser)
method here.
Note that this metod is called once for every file returned by the
AbstractFlatFileImporter.getFileIterator()
iterator.
end
in class AbstractFlatFileImporter
success
- TRUE if the file was parsed successfully, FALSE otherwise
BaseException
AbstractFlatFileImporter.begin(FlatFileParser)
protected String getSuccessMessage(int skippedLines)
AbstractFlatFileImporter
178 reporters imported successfully
.
The default implementation always return null. Note that this method is called
once for every file returned by AbstractFlatFileImporter.getFileIterator()
.
getSuccessMessage
in class AbstractFlatFileImporter
skippedLines
- The number of data lines that were skipped due to errorsprotected FlatFileParser getInitializedFlatFileParser() throws BaseException
AbstractFlatFileImporter
AbstractPlugin.job
or AbstractPlugin.configuration
settings. If a subclass doesn't store the
parameters there it must override this method and initialise the parser. Note that
this method is called once for each file returned by the
AbstractFlatFileImporter.getFileIterator()
and that a new parser is needed for each file.
getInitializedFlatFileParser
in class AbstractFlatFileImporter
BaseException
private RequestInformation getConfigureJobParameters(GuiContext context)
private Well findWell(int platePosition, int row, int column)
private void setBlockValue(PrintMapFlatFileImporter.MetaBlock block, FlatFileParser.Line line) throws BaseException
BaseException
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |