com.objectplanet.survey.plugin
Class Plugin

java.lang.Object
  |
  +--com.objectplanet.survey.plugin.Plugin
Direct Known Subclasses:
Plugin.Broken

public abstract class Plugin
extends java.lang.Object

Plugin is an abstract class that all plugins must implement. The methods required is interface between the system and a plugin.

Author:
Torgeir Punnerud
Created:
26. august 2002

Nested Class Summary
static class Plugin.Broken
          A placeholder for a plugin that didn't load.
static class Plugin.JAR
          A JAR file.
 
Constructor Summary
Plugin()
           
 
Method Summary
 java.lang.String getActionHTML()
          NOTE: this method is not yet used by Opinio.
 java.lang.String getClassName()
          Returns the plugin's class name.
 java.lang.String getErrorMsg()
          Sets the error message
 java.lang.String getHelpHTML()
          NOTE: this method is not yet used by Opinio.
 Plugin.JAR getJAR()
          Returns the JAR file containing this plugin.
 java.lang.String getSetupHTML()
          Gets the HTML code needed to perform setup/config operations on this plugin.
 java.lang.String processSetup(java.util.Map values)
          Method for processing the setup screen.
 void setErrorMsg(java.lang.String errorMsg)
          Sets the error message.
 void start()
          Any PluginBus registrations should be done here.
 void stop()
          Method called by the system before exiting.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Plugin

public Plugin()
Method Detail

getClassName

public java.lang.String getClassName()
Returns the plugin's class name.

Returns:
The className value

getJAR

public Plugin.JAR getJAR()
Returns the JAR file containing this plugin.

Returns:
The JAR object, representing a jar file

setErrorMsg

public final void setErrorMsg(java.lang.String errorMsg)
Sets the error message. If this is set, configuration of the plugin was unsuccessful, and displayed to the user.

Parameters:
errorMsg - The error message

getErrorMsg

public final java.lang.String getErrorMsg()
Sets the error message

Returns:
The error message

getSetupHTML

public java.lang.String getSetupHTML()
Gets the HTML code needed to perform setup/config operations on this plugin. It is entirely up to the plugin how this setup screen is built. It is recommended that the look & feel of Opinio is used.

The setup must be done with an HTML form. All the form elements/values will be captured by the system on submit, and returned in an map to the plugin through the processSetup() method.

This method is not required by the plugin. If not implemented, a standard no-op text is returned.

Returns:
The HTML code for setup of this plugin.

getActionHTML

public java.lang.String getActionHTML()
NOTE: this method is not yet used by Opinio.

Gets the HTML code needed to perform actions on the plugin. Actions are things like reset, start/stop, release resources etc. It is entirely up to the plugin how this is feature is implemented. It works exactly like the getSetupHTML() method (see this method for more info).

Returns:
The HTML code for running actions on this plugin.

getHelpHTML

public java.lang.String getHelpHTML()
NOTE: this method is not yet used by Opinio.

Gets the HTML code for displaying help. It is not required, but recommended. A plugin without help is most likely useless for everyone except the developer.

Returns:
The help HTML code

start

public void start()
Any PluginBus registrations should be done here.


stop

public void stop()
Method called by the system before exiting. Usually, nothing needs to be done here. If the plugin holds any resources, release them here.


processSetup

public java.lang.String processSetup(java.util.Map values)
Method for processing the setup screen. The values from the setup screen is collected by the system and passed to this method in a Map. It is up to the implementor (developer) of this method to process the values appropriately.

Parameters:
values - The values entered by the user in the setup screen.
Returns:
The confirmation message. Let the user know what happened with the processing of the setup values.

Copyright © ObjectPlanet Inc. All Rights Reserved.

Built on May 7 2003