|
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
public abstract class AbstractAnalysisPlugin
This is a base class that is useful for all analysis type plugins. It has helper methods for generating some common parameter types needed by many plugins, such as the source bioassay set and child bioassay set name and description, etc.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface net.sf.basedb.core.plugin.Plugin |
---|
Plugin.MainType |
Field Summary | |
---|---|
protected static String |
CHILD_DESCRIPTION
The name of the parameter that asks for the description of the child bioassay set. |
protected static String |
CHILD_NAME
The name of the parameter that asks for the name of the child bioassay set. |
protected static GuiContext |
CONTEXT_BIOASSAYS
GuiContext = [Item.BIOASSAY, GuiContext.Type.LIST] |
protected static GuiContext |
CONTEXT_BIOASSAYSET
GuiContext = [Item.BIOASSAYSET, GuiContext.Type.ITEM] |
protected static Set<GuiContext> |
defaultGuiContexts
The default gui contexts where it makes sense to use an analysis plugin. |
private static StringParameterType |
descriptionType
A parameter type for description parameters. |
protected static StringParameterType |
nameType
A parameter type for name parameters which are required and must have a value. |
protected static StringParameterType |
optionalNameType
A parameter type for name parameters which are optional. |
protected static String |
SOURCE_BIOASSAYS
|
protected static String |
SOURCE_BIOASSAYSET
|
private static ItemParameterType<BioAssaySet> |
sourceBioAssaySetType
The parameter type for the source bioassay set. |
private PluginParameter<BioAssaySet> |
sourceParameter
The source parameter. |
private PluginParameter<BioAssay> |
sourceSubSetParameter
The bioAssays subset parameter. |
protected static String |
TRANSFORMATION_NAME
The name of the parameter that asks for the name of the transformation. |
Fields inherited from class net.sf.basedb.core.plugin.AbstractPlugin |
---|
annotationSection, configuration, COPY_ANNOTATIONS, job, OVERWRITE_ANNOTATIONS, sc |
Constructor Summary | |
---|---|
protected |
AbstractAnalysisPlugin()
Create a new AbstractAnalysisPlugin . |
Method Summary | |
---|---|
protected PluginParameter<String> |
getChildDescriptionParameter(String label,
String description,
String defaultValue)
Create a plugin parameter that asks for the description of the child bioassay set. |
protected PluginParameter<String> |
getChildNameParameter(String label,
String description,
String defaultValue)
Create a plugin parameter that asks for the name of the child bioassay set. |
protected BioAssaySet |
getCurrentBioAssaySet(DbControl dc)
Get the current source bioassay set. |
protected Experiment |
getCurrentExperiment(DbControl dc)
Get the current experiment from information in the current context: SessionControl.getCurrentContext(Item.EXPERIMENT) . |
Set<GuiContext> |
getGuiContexts()
|
Plugin.MainType |
getMainType()
Get the type of the plugin. |
protected List<BioAssay> |
getSourceBioAssays(DbControl dc)
Gets a list of bioassays that were selected from the current bioassay set, to use for the analysis. |
protected BioAssaySet |
getSourceBioAssaySet(DbControl dc)
Get the bioassay set that is used as the source for the plugin. |
protected PluginParameter<BioAssaySet> |
getSourceBioAssaySetParameter(String label,
String description)
Get a plugin parameter that asks for a bioassay set to use as data source for the plugin. |
protected PluginParameter<BioAssay> |
getSourceBioAssaysParameter(String label,
String description)
Gets a plugin parameter that asks for a subset of bioassays to use as data source for the plugin. |
protected String |
getTransformationName(DbControl dc)
Generate a name for the transformation based on the plugin and it's configuration. |
protected PluginParameter<String> |
getTransformationNameParameter(String label,
String description,
String defaultValue)
Create a plugin parameter that asks for the name of the transformation. |
String |
isInContext(GuiContext context,
Object item)
Check that the item is a bioassayset and that the logged in user has permission to use the current experiment. |
protected DynamicSpotQuery |
restrictSource(DynamicSpotQuery query,
List<BioAssay> bioAssays)
Restricts a query to only include values from listed bioassays |
Methods inherited from class net.sf.basedb.core.plugin.AbstractPlugin |
---|
checkInterrupted, cloneParameterWithDefaultValue, closeLogFile, createLogFile, done, getCopyAnnotationsParmeter, getCurrentConfiguration, getCurrentJob, getJobOrConfigurationValue, getOverwriteAnnotationsParameters, getPermissions, init, log, log, requiresConfiguration, storeValue, storeValue, storeValues, supportsConfigurations, 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 |
---|
getAbout, run |
Field Detail |
---|
protected static final GuiContext CONTEXT_BIOASSAYSET
protected static final GuiContext CONTEXT_BIOASSAYS
protected static final Set<GuiContext> defaultGuiContexts
InteractivePlugin.getGuiContexts()
method to
specify other contexts. This set can't be modified. This set only
includes the CONTEXT_BIOASSAYSET
.
protected static final StringParameterType nameType
protected static final StringParameterType optionalNameType
private static final StringParameterType descriptionType
private static final ItemParameterType<BioAssaySet> sourceBioAssaySetType
private PluginParameter<BioAssaySet> sourceParameter
getSourceBioAssaySetParameter(String, String)
private PluginParameter<BioAssay> sourceSubSetParameter
getSourceBioAssaysParameter(String, String)
protected static final String SOURCE_BIOASSAYSET
protected static final String SOURCE_BIOASSAYS
protected static final String CHILD_NAME
getChildNameParameter(String, String, String)
,
Constant Field Valuesprotected static final String CHILD_DESCRIPTION
getChildDescriptionParameter(String, String, String)
,
Constant Field Valuesprotected static final String TRANSFORMATION_NAME
getTransformationNameParameter(String, String, String)
,
Constant Field ValuesConstructor Detail |
---|
protected AbstractAnalysisPlugin()
AbstractAnalysisPlugin
.
Method Detail |
---|
public Plugin.MainType getMainType()
Plugin
Plugin.MainType.ANALYZE
public Set<GuiContext> getGuiContexts()
public String isInContext(GuiContext context, Object item)
context
- Current guicontextitem
- The item to check.
PermissionDeniedException
- If the logged in user dosen't have
permission to use the Experimentprotected PluginParameter<BioAssaySet> getSourceBioAssaySetParameter(String label, String description)
label
- The parameter label, or null to use the default (Source bioasay set)description
- The parameter description, or null to use the default
(The bioassay set that is used as the data source for this job.)protected PluginParameter<BioAssay> getSourceBioAssaysParameter(String label, String description)
label
- The parameter's label. Uses a default value if null.description
- Description of the parameter. Uses a default value if null.
protected PluginParameter<String> getChildNameParameter(String label, String description, String defaultValue)
label
- The label to use for the parameter or null to use the default label
(Child name)description
- The description to use for the parameter or null to use the
default description (The name of the child bioassay set)defaultValue
- The default value for the child name or null to use
the default value (New bioassay set)
protected PluginParameter<String> getChildDescriptionParameter(String label, String description, String defaultValue)
label
- The label to use for the parameter or null to use the default label
(Child description)description
- The description to use for the parameter or null to use the
default description (An optional description of the child bioassay set)defaultValue
- The default value for the child name or null to not use any
default value
protected PluginParameter<String> getTransformationNameParameter(String label, String description, String defaultValue)
label
- The label to use for the parameter or null to use the default label
(Transformation name)description
- The description to use for the parameter or null to use the
default description (The name of the transformation)defaultValue
- The default value for the transformation name or null to not
use any default
protected Experiment getCurrentExperiment(DbControl dc)
SessionControl.getCurrentContext(Item.EXPERIMENT)
. Note
that this information is normally only available during the configuration
phase of a plugin, not during the execution phase.
dc
- The DbControl to use for database access
protected BioAssaySet getCurrentBioAssaySet(DbControl dc)
getSourceBioAssaySet(DbControl)
method. If this
returns null we check the information in the current context:
SessionControl.getCurrentContext(Item.BIOASSAYSET)
. Note
that this information is normally only available during the configuration
phase of a plugin, not during the execution phase.
dc
- The DbControl to use for database access
getSourceBioAssaySet(DbControl)
protected BioAssaySet getSourceBioAssaySet(DbControl dc)
getSourceBioAssaySetParameter(String, String)
protected List<BioAssay> getSourceBioAssays(DbControl dc)
dc
- The DbControl to access the database with
protected String getTransformationName(DbControl dc)
About.getName()
method and combine it with the configuration used.
If no configuration is used only the plugin name is used.
dc
- The DbControl to use for database access
protected DynamicSpotQuery restrictSource(DynamicSpotQuery query, List<BioAssay> bioAssays)
query
- The query to set restriction onbioAssays
- A list with bioassays the restriction should include
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |