|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.proteios.core.BasicItem<D>
org.proteios.core.OwnedItem<D>
org.proteios.core.SharedItem<PluginDefinitionData>
org.proteios.core.PluginDefinition
public class PluginDefinition
A plugin definition represents the executable plugin. Ie. the class name of a
class implementing the Plugin interface.
| Field Summary | |
|---|---|
static int |
MAX_CLASSNAME_LENGTH
The maximum length of the class name that can be stored in the database. |
static int |
MAX_CONTACT_LENGTH
The maximum length of the contact information that can be stored in the database. |
static int |
MAX_COPYRIGHT_LENGTH
The maximum length of the copyright notice that can be stored in the database. |
static int |
MAX_EMAIL_LENGTH
The maximum length of the email address that can be stored in the database. |
static int |
MAX_JARPATH_LENGTH
The maximum length of the jar path name that can be stored in the database. |
static int |
MAX_NAME_LENGTH
The maximum length of the name that can be stored in the database. |
static int |
MAX_PLUGIN_VERSION_LENGTH
The maximum length of the plugin version that can be stored in the database. |
static int |
MAX_URL_LENGTH
The maximum length of the url that can be stored in the database. |
static Item |
TYPE
The type of item represented by this class. |
| Method Summary | ||
|---|---|---|
static Map<Plugin.MainType,Integer> |
countPlugins(DbControl dc,
GuiContext gc)
Count the number of plugins that can be used in a given context. |
|
static PluginDefinition |
getByClassName(DbControl dc,
String className)
Get a PluginDefinition item when you know the class name. |
|
static PluginDefinition |
getById(DbControl dc,
int id)
Get a PluginDefinition item when you know the ID. |
|
String |
getClassName()
Get the class name of the Java class that implements this plugin. |
|
String |
getContact()
Get contact information for the plugin. |
|
String |
getCopyright()
Get a copyright notice for the plugin. |
|
String |
getDescription()
Get a description of the plugin. |
|
String |
getEmail()
Get an email address that can be used to get more information about the plugin. |
|
Set<GuiContext> |
getGuiContexts()
Get the Item types where it makes sense to use this plugin for a
client application. |
|
String |
getJarPath()
Get the path to the JAR file that contains the plugin class file. |
|
Plugin.MainType |
getMainType()
Get the type of plugin. |
|
String |
getName()
Get the name of the plugin. |
|
static PluginDefinition |
getNew(DbControl dc,
String className)
Create a new PluginDefinition item. |
|
static PluginDefinition |
getNew(DbControl dc,
String className,
File jarFile)
|
|
ItemQuery<PluginConfiguration> |
getPluginConfigurations()
Get a query that returns the configurations for this plugin definition. |
|
ItemQuery<PluginType> |
getPluginTypes()
Get a query that returns the plugin types for this plugin definition. |
|
String |
getPluginVersion()
Get the plugin version. |
|
static ItemQuery<PluginDefinition> |
getQuery()
Get a query that returns plugin definitions. |
|
static ItemQuery<PluginDefinition> |
getQuery(GuiContext gc,
String interfaceName)
Get a query that returns all plugins related to a specified GUI context and implementing a certain interface. |
|
Item |
getType()
Get the type of item represented by the object. |
|
String |
getUrl()
Get a URL with more information about the plugin. |
|
boolean |
isInContext(GuiContext context)
Check if it makes sense to use this plugin in the context of the specified item. |
|
boolean |
isInteractive()
Check if the plugin is interactive or not. |
|
boolean |
isRemoved()
Check if the removed flag is set for this item. |
|
boolean |
isUsed()
Check if a PluginConfiguration is using this definition. |
|
void |
loadPluginInformation(String jarPath,
String className)
Load a plugin and copy all information, ie. plugin.about(), to the internal data structure. |
|
|
newInstance(Class<P> clazz,
SessionControl sc,
PluginConfiguration configuration,
Job job)
|
|
PluginConfiguration |
newPluginConfiguration()
Create a new PluginConfiguration for this plugin. |
|
protected void |
setDescription(String description)
The description cannot be changed. |
|
void |
setRemoved(boolean removed)
Set the removed flag for this item. |
|
boolean |
supports(PluginType pluginType)
Check if a plugin implements the interface specified by the plugin type. |
|
boolean |
supports(String interfaceName)
Check if a plugin implements the interface specified by the plugin type. |
|
| Methods inherited from class org.proteios.core.SharedItem |
|---|
getItemKey, getProjectKey, isShared, setItemKey, setProjectKey |
| Methods inherited from class org.proteios.core.OwnedItem |
|---|
getOwner, setOwner |
| Methods inherited from class org.proteios.core.BasicItem |
|---|
checkPermission, equals, getDbControl, getId, getPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.proteios.core.Identifiable |
|---|
getId, getVersion |
| Methods inherited from interface org.proteios.core.AccessControlled |
|---|
checkPermission, hasPermission |
| Methods inherited from interface org.proteios.core.Ownable |
|---|
getOwner, setOwner |
| Field Detail |
|---|
public static final Item TYPE
Item.PLUGINDEFINITION,
getType()public static final int MAX_CLASSNAME_LENGTH
setClassName method to avoid exceptions.
public static final int MAX_JARPATH_LENGTH
public static final int MAX_NAME_LENGTH
public static final int MAX_PLUGIN_VERSION_LENGTH
public static final int MAX_COPYRIGHT_LENGTH
public static final int MAX_CONTACT_LENGTH
public static final int MAX_EMAIL_LENGTH
public static final int MAX_URL_LENGTH
| Method Detail |
|---|
public static PluginDefinition getNew(DbControl dc,
String className)
throws BaseException
PluginDefinition item.
dc - The DbControl which will be used for permission
checking and database access.className - The name of the class that implements the plugin
interface
PluginDefinition item
BaseException - If there is an error
public static PluginDefinition getNew(DbControl dc,
String className,
File jarFile)
throws BaseException
BaseException
public static PluginDefinition getById(DbControl dc,
int id)
throws ItemNotFoundException,
PermissionDeniedException,
BaseException
PluginDefinition item when you know the ID.
dc - The DbControl which will be used for permission
checking and database access.id - The ID of the item to load.
PluginDefinition item.
ItemNotFoundException - If an item with the specified ID is not
found.
PermissionDeniedException - If the logged in user doesn't have
READ permission for the item.
BaseException - If there is another error.
public static PluginDefinition getByClassName(DbControl dc,
String className)
throws ItemNotFoundException,
PermissionDeniedException,
BaseException
PluginDefinition item when you know the class name.
dc - The DbControl which will be used for permission
checking and database access.className - The class name of the item to load.
PluginDefinition item.
ItemNotFoundException - If an item with the specified class name is
not found.
PermissionDeniedException - If the logged in user doesn't have
READ permission for the item.
BaseException - If there is another error.public static ItemQuery<PluginDefinition> getQuery()
ItemQuery object
public static ItemQuery<PluginDefinition> getQuery(GuiContext gc,
String interfaceName)
isInContext(GuiContext) returns true for the
specified item, and supports(PluginType) returns
true for the specified interface.
gc - The context the plugin should be related to, or null if this
parameter is irrelevantinterfaceName - The complete name of the interface that the plugin
must implement, or null if this parameter is irrelevant
public static Map<Plugin.MainType,Integer> countPlugins(DbControl dc,
GuiContext gc)
throws BaseException
dc - An open DbControl objectgc - The context to count plugins for
BaseExceptionpublic Item getType()
IdentifiableItem enumeration.
getType in interface Identifiablepublic boolean isRemoved()
Removable
isRemoved in interface Removable
public void setRemoved(boolean removed)
throws PermissionDeniedException
Removable
setRemoved in interface Removableremoved - TRUE if the item should be flagged as removed,
FALSE otherwise
PermissionDeniedException - If the logged in user doesn't
have Permission.DELETE permission for setting the flag
to TRUE or Permission.WRITE permission for setting the
flag to FALSE
public boolean isUsed()
throws BaseException
PluginConfiguration is using this definition.
isUsed in class BasicItem<PluginDefinitionData>BaseExceptionpublic String getClassName()
Plugin interface.
public String getJarPath()
public String getName()
public String getPluginVersion()
public String getDescription()
protected void setDescription(String description)
throws InvalidDataException
InvalidDataException - If the description is too longloadPluginInformation(String, String)public String getCopyright()
public String getContact()
public String getEmail()
public String getUrl()
public Plugin.MainType getMainType()
Plugin.MainType.public boolean isInteractive()
InteractivePlugin interface and can be dynamically
configured by telling the client application what configuration
parameters it needs.
public boolean isInContext(GuiContext context)
Item.PROTEIOS_PEAK.
context - The GuiContext type
public Set<GuiContext> getGuiContexts()
Item types where it makes sense to use this plugin for a
client application.
Set of Item:s or an empty set if
the plugin is not concerned about items
public PluginConfiguration newPluginConfiguration()
throws PermissionDeniedException,
BaseException
PluginConfiguration for this plugin.
PluginConfiguration item
PermissionDeniedException - If the logged in user doesn't have use
permission for this plugin definition
BaseException - If there is another errorpublic ItemQuery<PluginConfiguration> getPluginConfigurations()
ItemQuery objectpublic ItemQuery<PluginType> getPluginTypes()
ItemQuery objectpublic boolean supports(PluginType pluginType)
pluginType - The pluginType to check
public boolean supports(String interfaceName)
interfaceName - The pluginType to check
public <P extends Plugin> P newInstance(Class<P> clazz,
SessionControl sc,
PluginConfiguration configuration,
Job job)
throws PermissionDeniedException,
BaseException
PermissionDeniedException
BaseException
public void loadPluginInformation(String jarPath,
String className)
throws PermissionDeniedException,
InvalidDataException,
BaseException
PermissionDeniedException
InvalidDataException
BaseException
|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||