|
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.core.plugin.AbstractAnalysisPlugin net.sf.basedb.plugins.Base1PluginExecuter
public class Base1PluginExecuter
This plug-in executes a plug-in from the Base1 system. It takes a base1 configuration file to create its configuration.
Nested Class Summary | |
---|---|
private static class |
Base1PluginExecuter.Base1JobParameterType
|
private class |
Base1PluginExecuter.JobParameter
|
Nested classes/interfaces inherited from interface net.sf.basedb.core.plugin.Plugin |
---|
Plugin.MainType |
Field Summary | |
---|---|
private static About |
about
Plugin description |
private static String |
COMMAND_MANUAL_CONFIG
This command is used if the user decides to configure the plugin by hand. |
private RequestInformation |
configureJob
Holds info about a job configuration request. |
private RequestInformation |
configureManual
Holds information about a manual plugin configuration request. |
private RequestInformation |
configurePlugin
Holds information about a plugin configuration request. |
private static URL |
dtdFile
|
private File |
execDirectory
This is the directory where the plugin will generate its output. |
private PluginParameter<String> |
execNameParameter
The name of the executable. |
private static PluginParameter<String> |
execPathParameter
The path to where the plug-in executer can find the executables. |
private static PluginParameter<File> |
fileParameter
Parameter definition that asks for the configuration file that should be imported. |
private PluginParameter<Boolean> |
geneAveragesParameter
If the data should be exported averaged per gene. |
private List<PluginParameter<?>> |
jobParameters
This list holds the job parameters derived from the configuration file. |
private PluginParameter<String> |
jobParametersParameter
This parameter describes the job parameters that the base1 plugin needs. |
private PluginParameter<Boolean> |
leaveStdinParameter
If the plug-in should leave the stdin.txt after execution. |
private PluginParameter<Boolean> |
leaveStdoutParameter
If the plug-in should leave the stdout.txt after execution. |
private PluginParameter<Integer> |
maxChannelsParameter
The maximum number of channels, 0 means unlimited. |
private PluginParameter<Integer> |
minChannelsParameter
The minimum number of channels. |
private static Set<Permissions> |
permissions
The plug-in permissions. |
private PluginParameter<String> |
pluginDirectoryParameter
The directory where the plug-in will store it's output. |
private PluginParameter<Boolean> |
serialFormatParameter
This parameter describes if the data should be exported in serial format or in matrix. |
private ThreadSignalHandler |
signalHandler
|
private PluginParameter<String> |
usedColumnsParameter
The reporter fields that should be exported as a tab separated string of column headers. |
private PluginParameter<String> |
usedFieldsParameter
The spot fields that should be exported as a tab separated string of column headers. |
private PluginParameter<String> |
versionNumberParameter
The version number of the plug-in. |
Fields inherited from class net.sf.basedb.core.plugin.AbstractAnalysisPlugin |
---|
CHILD_DESCRIPTION, CHILD_NAME, CONTEXT_BIOASSAYS, CONTEXT_BIOASSAYSET, defaultGuiContexts, nameType, optionalNameType, SOURCE_BIOASSAYS, SOURCE_BIOASSAYSET, TRANSFORMATION_NAME |
Fields inherited from class net.sf.basedb.core.plugin.AbstractPlugin |
---|
annotationSection, configuration, COPY_ANNOTATIONS, job, OVERWRITE_ANNOTATIONS, sc |
Constructor Summary | |
---|---|
Base1PluginExecuter()
|
Method Summary | |
---|---|
private void |
associateFiles(DbControl dc,
Transformation trans,
Directory homeDirectory)
|
void |
configure(GuiContext context,
Request request,
Response response)
Configure the plugin. |
private void |
copy(File f,
File d)
Copies the content from a File to a directory on the file system. |
private boolean |
deleteDir(File dir)
Deletes all files and sub directories under dir. |
private File |
exportData(DbControl dc,
Directory workingDirectory,
ProgressReporter progress)
Export the bioassay set to a file called 'stdin.txt' in the plugin directory. |
About |
getAbout()
Get information about the plugin, such as name, version, authors, etc. |
private List<AnnotationType> |
getAnnotationTypes()
Get the experimental factors connected to a experiment. |
private Boolean |
getBoolean(String s)
Creates a boolean from a string. |
private RequestInformation |
getConfigureJobParameters()
Creates the information needed for job configuration and initiates the parameters. |
private RequestInformation |
getConfigurePluginParameters()
Creates the information needed for plugin configuration and initiates the parameters. |
private File |
getExecDirectory()
Get the exec directory as a java.io.File. |
private String |
getExecLine()
|
private FlatFileParser |
getInitializedFlatFileParser(InputStream stream,
String charset)
Creates a FlatFileParser for a plugin configuration file. |
private Map<String,Base1PluginExecuter.JobParameter> |
getJobParameterObjectsFromXML(String xml,
boolean hideRemoved)
|
private List<PluginParameter<?>> |
getJobParameters()
Reads the configuration file an creates the parameters found there. |
private List<PluginParameter<?>> |
getJobParametersFromXML(String xml,
boolean hideRemoved)
|
private RequestInformation |
getManualConfigureParameters()
Creates the information needed for manual configuration and initiates the parameters. |
private Map<String,String> |
getParametersFromBaseFile(File f)
Get the data from the configuration file. |
Collection<Permissions> |
getPermissions()
Return null, which gives the plugin the same permissions as the logged in user. |
private Directory |
getPluginDirectory(DbControl dc,
String pathName)
Get a directory |
RequestInformation |
getRequestInformation(GuiContext context,
String command)
This method will return the RequestInformation for a given command, i.e. |
SignalHandler |
getSignalHandler()
Get the signal handler that is handling signals on behalf of this object. |
private BioAssaySet |
importData(DbControl dc,
File stdout,
Transformation t,
IntensityTransform resultTransform,
ProgressReporter progress)
Imports the data from the file stdout.txt in the execution directory. |
private void |
importTempFiles(DbControl dc,
File[] files,
Directory d)
|
String |
isInContext(GuiContext context,
Object item)
Checks if the BioAssaySet has the number of channels specified by the configuration and that it has the extra values. |
boolean |
requiresConfiguration()
Returns FALSE, since that is how the plugins used to work before this method was introduced. |
void |
run(Request request,
Response response,
ProgressReporter progress)
Run the plugin. |
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.core.plugin.AbstractAnalysisPlugin |
---|
getChildDescriptionParameter, getChildNameParameter, getCurrentBioAssaySet, getCurrentExperiment, getGuiContexts, getMainType, getSourceBioAssays, getSourceBioAssaySet, getSourceBioAssaySetParameter, getSourceBioAssaysParameter, getTransformationName, getTransformationNameParameter, restrictSource |
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.InteractivePlugin |
---|
getGuiContexts |
Methods inherited from interface net.sf.basedb.core.plugin.Plugin |
---|
done, getMainType, init |
Field Detail |
---|
private static final About about
private static final Set<Permissions> permissions
private static final URL dtdFile
private static final PluginParameter<File> fileParameter
private static PluginParameter<String> execPathParameter
private PluginParameter<Boolean> serialFormatParameter
private PluginParameter<String> versionNumberParameter
private PluginParameter<String> execNameParameter
private PluginParameter<Boolean> geneAveragesParameter
private PluginParameter<Integer> minChannelsParameter
private PluginParameter<Integer> maxChannelsParameter
private PluginParameter<Boolean> leaveStdinParameter
private PluginParameter<Boolean> leaveStdoutParameter
private PluginParameter<String> usedColumnsParameter
private PluginParameter<String> usedFieldsParameter
private PluginParameter<String> jobParametersParameter
private PluginParameter<String> pluginDirectoryParameter
private static final String COMMAND_MANUAL_CONFIG
private RequestInformation configureJob
private RequestInformation configurePlugin
private RequestInformation configureManual
private List<PluginParameter<?>> jobParameters
private File execDirectory
private ThreadSignalHandler signalHandler
Constructor Detail |
---|
public Base1PluginExecuter()
Method Detail |
---|
public String isInContext(GuiContext context, Object item)
isInContext
in interface InteractivePlugin
isInContext
in class AbstractAnalysisPlugin
context
- The context from where the plugin is invoked.item
- The item that should be checked if it is in context.
AbstractAnalysisPlugin.isInContext(net.sf.basedb.core.plugin.GuiContext, java.lang.Object)
public RequestInformation getRequestInformation(GuiContext context, String command) throws BaseException
InteractivePlugin
RequestInformation
for a given command, i.e.
the list of parameters and some nice help text.
getRequestInformation
in interface InteractivePlugin
context
- The current context of the client application,
it is one of the values found in set returned by InteractivePlugin.getGuiContexts()
command
- The command
RequestInformation
for the command
BaseException
- if there is an errorpublic void configure(GuiContext context, Request request, Response response)
InteractivePlugin
InteractivePlugin.getRequestInformation(GuiContext, String)
.
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
throughprivate void copy(File f, File d) throws IOException
f
- The file to be copied.d
- The directory where the file will be written.
IOException
- If there is any error with target.private boolean deleteDir(File dir)
dir
-
public Collection<Permissions> getPermissions()
AbstractPlugin
getPermissions
in interface Plugin
getPermissions
in class AbstractPlugin
public About getAbout()
Plugin
getAbout
in interface Plugin
About
objectpublic boolean supportsConfigurations()
AbstractPlugin
supportsConfigurations
in interface Plugin
supportsConfigurations
in class AbstractPlugin
public boolean requiresConfiguration()
AbstractPlugin
requiresConfiguration
in interface Plugin
requiresConfiguration
in class AbstractPlugin
public void run(Request request, Response response, ProgressReporter progress)
Plugin
run
in interface Plugin
request
- Request object with the command and parametersresponse
- Response object in for the plugin to response
throughprogress
- A ProgressReporter
where the plugin can report
its progess, can be nullpublic SignalHandler getSignalHandler()
SignalTarget
getSignalHandler
in interface SignalTarget
private File exportData(DbControl dc, Directory workingDirectory, ProgressReporter progress)
dc
- DbControl used to access the databaseworkingDirectory
- Where in base' file system the exported BASEFile should be stored.
private List<AnnotationType> getAnnotationTypes()
AnnotationType
:sprivate Map<String,String> getParametersFromBaseFile(File f) throws IOException
f
- The file.
IOException
- If there i any problem reading from file.private Map<String,Base1PluginExecuter.JobParameter> getJobParameterObjectsFromXML(String xml, boolean hideRemoved)
private List<PluginParameter<?>> getJobParametersFromXML(String xml, boolean hideRemoved)
private Boolean getBoolean(String s)
s
- The string.
private RequestInformation getManualConfigureParameters()
private RequestInformation getConfigureJobParameters()
private RequestInformation getConfigurePluginParameters()
private File getExecDirectory() throws IOException
IOException
private String getExecLine()
private FlatFileParser getInitializedFlatFileParser(InputStream stream, String charset)
FlatFileParser
for a plugin configuration file.
stream
- The stream that the parser should read from.
private List<PluginParameter<?>> getJobParameters() throws BaseException
PluginParameter
:s
BaseException
private Directory getPluginDirectory(DbControl dc, String pathName)
directory
private BioAssaySet importData(DbControl dc, File stdout, Transformation t, IntensityTransform resultTransform, ProgressReporter progress) throws SQLException, IOException
IOException
- if there is any error reading from stdout.txt
SQLException
private void associateFiles(DbControl dc, Transformation trans, Directory homeDirectory)
private void importTempFiles(DbControl dc, File[] files, Directory d)
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |