Package net.sf.basedb.core.plugin
Interface InteractivePlugin
- All Superinterfaces:
Plugin
- All Known Subinterfaces:
IOSupport
- All Known Implementing Classes:
AbstractFileUnpacker
,AbstractIOSupport
,AbstractItemImporter
,AnnotationFlatFileImporter
,AnnotationTypeImporter
,AnyToAnyImporter
,ArrayBatchImporter
,ArrayDesignImporter
,ArraySlideImporter
,Base1PluginExecuter
,BaseFileExporterPlugin
,BaseFileExporterSupport
,BaseFileImporterSupport
,BfsExporterPlugin
,BfsExporterSupport
,BfsImporterSupport
,BioPlateImporter
,BioSourceImporter
,Bzip2FileUnpacker
,CdfFileReporterImporter
,DerivedBioAssayImporter
,ExternalProgramExecutor
,ExtractImporter
,FileImporter
,FileOnlyImporterSupport
,FormulaFilter
,GalExporter
,GtfReporterImporter
,GtfReporterMapImporter
,GzipFileUnpacker
,HelpExporter
,HelpImporter
,IlluminaRawDataImporter
,IntensityCalculatorPlugin
,JepExtraValueCalculator
,JepIntensityTransformer
,KitImporter
,LowessNormalization
,ManualDerivedBioAssayCreator
,ManualTransformCreator
,MedianRatioNormalization
,PackedFileExporter
,PhysicalBioAssayImporter
,PlateFlatFileImporter
,PlateMappingExporter
,PlateMappingImporter
,PluginConfigurationExporter
,PluginConfigurationImporter
,PrintMapFlatFileImporter
,RawBioAssayImporter
,RawDataFlatFileImporter
,ReporterFlatFileImporter
,ReporterMapFlatFileImporter
,SampleImporter
,SimpleExport
,TagImporter
,TarFileUnpacker
,ZipFileUnpacker
An interactive plugin is a
Plugin
that supports interactive
configuration in a user session. What this means is that a client application
may ask the plugin for the parameters it needs using the
getRequestInformation(GuiContext, String)
method. The client then displays some sort
of interactive interface that asks the user to supply values to those
parameters and then calls the configure(GuiContext, Request, Response)
method to
let the plugin verify and store those parameters in the database.
When configuring a plugin or job the following sequence is followed:
- Create a plugin object, using the default constructor
- Call the
Plugin.init(SessionControl, ParameterValues, ParameterValues)
method which gives the plugin access to it's current configuration and job-specific parameters - Call the
getRequestInformation(GuiContext, String)
method with a command value ofRequest.COMMAND_CONFIGURE_PLUGIN
orRequest.COMMAND_CONFIGURE_JOB
- Call the
configure(GuiContext, Request, Response)
method - If the return status is
Response.Status.CONTINUE
the previous two steps will be repeated with the a command - Call the
Plugin.done()
method - After
done
has been called, the plugin instance is not
- Version:
- 2.0
- Author:
- Nicklas
- Last modified
- $Date: 2009-04-06 14:52:39 +0200 (må, 06 apr 2009) $
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.sf.basedb.core.plugin.Plugin
Plugin.MainType
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(GuiContext context, Request request, Response response) Configure the plugin.Get a set containing all items that the plugin handles.getRequestInformation
(GuiContext context, String command) This method will return theRequestInformation
for a given command, i.e.isInContext
(GuiContext context, Object item) Check if the plugin can be used on the specified object.Methods inherited from interface net.sf.basedb.core.plugin.Plugin
done, getMainType, getPermissions, init, requiresConfiguration, run, supportsConfigurations
-
Method Details
-
getGuiContexts
Set<GuiContext> getGuiContexts()Get a set containing all items that the plugin handles. Ie. if the plugin imports reporters, return a set containingItem.REPORTER
. This information is used by client applications to put the plugin in the proper place in the user interface.- Returns:
- A
Set
containingItem
:s, or null if the plugin is not concerned about items
-
isInContext
Check if the plugin can be used on the specified object. The item is either aBasicItem
orBasicData
object, or null if called from a list context. A client application should only call this method for contexts matching one of the contexts in the set returned by thegetGuiContexts()
method. ForGuiContext.Type.ITEM
contexts an item of the correct type should be passed as a parameter.The plug-in can response with a null value indicating success, a warning-level message or throw an exception to indicate an error-level message. Client application should normally only show error-level messages to users, unless the user has requested to see warning messages.
NOTE! Before BASE 2.4 all messages were treated as error-level messages.
- Parameters:
context
- The current context of the client application, it is one of the values found in set returned bygetGuiContexts()
item
- The currently active item, it's type should match theGuiContext.getItem()
type, or null if the context is a list context- Returns:
Null
if the plugin can use that item, or a warning-level message explaining why the plugin can't be used- Throws:
RuntimeException
- With an error-leve message explaining why the plug-in can't be used
-
getRequestInformation
This method will return theRequestInformation
for a given command, i.e. the list of parameters and some nice help text.- Parameters:
context
- The current context of the client application, it is one of the values found in set returned bygetGuiContexts()
command
- The command- Returns:
- The
RequestInformation
for the command - Throws:
BaseException
- if there is an error
-
configure
Configure the plugin. Hopefully the client is supplying values for the parameters specified bygetRequestInformation(GuiContext, String)
.- Parameters:
context
- The current context of the client application, it is one of the values found in set returned bygetGuiContexts()
request
- Request object with the command and parametersresponse
- Response object in for the plugin to response through
-