public abstract class AbstractIOSupport extends AbstractPlugin implements IOSupport
IOSupport
interface and don't want to be visible as
standalone plug-ins.ExternalProgramExecutor
Plugin.MainType
Modifier and Type | Field and Description |
---|---|
private ExternalProgramExecutor |
executor |
annotationSection, configuration, COPY_ANNOTATIONS, job, OVERWRITE_ANNOTATIONS, sc
COMMAND_CONFIGURE_IO_JOB, COMMAND_CONFIGURE_IO_PLUGIN, COMMAND_EXECUTE_IO_JOB
Constructor and Description |
---|
AbstractIOSupport() |
Modifier and Type | Method and Description |
---|---|
protected ExternalProgramExecutor |
getExecutor()
Get the external program executor that invoked the plug-in.
|
java.util.Set<GuiContext> |
getGuiContexts()
Get a set containing all items that the plugin handles.
|
java.lang.String |
getShortName()
A default implementation to maintain backwards compatibility.
|
void |
init(SessionControl sc,
ParameterValues configuration,
ParameterValues job,
ExternalProgramExecutor executor)
Replaces the regular plug-in initialisation method.
|
java.lang.String |
isInContext(GuiContext context,
java.lang.Object item)
Check if the plugin can be used on the specified object.
|
protected abstract java.lang.String |
performIO(DbControl dc,
ProgressReporter progress)
Perform the IO operation.
|
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)
Accepts the
IOSupport.COMMAND_EXECUTE_IO_JOB command. |
boolean |
supportsConfigurations()
Returns TRUE, since that is how the plugins used to work before this method
was introduced.
|
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
configure, getRequestInformation
done, getMainType, getPermissions, init
private ExternalProgramExecutor executor
public boolean supportsConfigurations()
AbstractPlugin
supportsConfigurations
in interface Plugin
supportsConfigurations
in class AbstractPlugin
public boolean requiresConfiguration()
AbstractPlugin
requiresConfiguration
in interface Plugin
requiresConfiguration
in class AbstractPlugin
public java.util.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
public java.lang.String isInContext(GuiContext context, java.lang.Object item)
InteractivePlugin
BasicItem
or BasicData
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 the InteractivePlugin.getGuiContexts()
method. For GuiContext.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.
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
contextpublic void run(Request request, Response response, ProgressReporter progress)
IOSupport.COMMAND_EXECUTE_IO_JOB
command. The default
implementation starts a new transaction and then calls
performIO(DbControl, ProgressReporter)
which should be implemented by the
subclass.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 java.lang.String getShortName()
getShortName
in interface IOSupport
public void init(SessionControl sc, ParameterValues configuration, ParameterValues job, ExternalProgramExecutor executor)
IOSupport
Plugin.init(SessionControl, ParameterValues, ParameterValues)
.protected abstract java.lang.String performIO(DbControl dc, ProgressReporter progress) throws java.io.IOException
dc
- A DbControl that can be used by the subclassprogress
- An optional progress reporterjava.io.IOException
protected ExternalProgramExecutor getExecutor()