org.mmbase.module
Class Poll
java.lang.Object
|
+--org.mmbase.module.Module
|
+--org.mmbase.module.ProcessorModule
|
+--org.mmbase.module.Poll
- All Implemented Interfaces:
- ProcessorInterface
- public class Poll
- extends ProcessorModule
- Author:
- Arjan Houtman, Rico Jansen
|
Constructor Summary |
Poll()
|
|
Method Summary |
static int |
calculateIntPercentage(int votes,
int total,
double scale)
|
java.lang.String |
getAnswerId(MMObjectNode relNode)
|
java.util.Vector |
getList(scanpage sp,
StringTagger tagger,
java.lang.String value)
[what] - ANSWERS-[question-id]
example: ANSWERS-903200 |
java.lang.String |
getModuleInfo()
provide some info on the module |
void |
init()
Initializes the module. |
void |
maintainance()
maintainance call, will be called by the admin to perform managment
tasks. |
static java.util.Hashtable |
makeHashtable(java.lang.String s,
java.lang.String d1,
java.lang.String d2)
|
static java.lang.String |
makeString(java.util.Hashtable h,
java.lang.String d1,
java.lang.String d2)
|
boolean |
process(scanpage sp,
java.util.Hashtable cmds,
java.util.Hashtable vars)
Execute the commands provided in the form values |
java.lang.String |
replace(scanpage sp,
java.lang.String mod)
Handle a $MOD command |
| Methods inherited from class org.mmbase.module.Module |
getClassName, getInitParameter, getInitParameters, getMaintainer, getMimeType, getMimeTypeFile, getModule, getModule, getModules, getName, getProperties, getProperty, getVersion, hasStarted, loadModulesFromDisk, setClassName, setInitParameter, setMaintainer, setName, setVersion, startModule, startModules, state |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Poll
public Poll()
init
public void init()
- Description copied from class:
Module
- Initializes the module.
Init can be overridden to read the environment variables it needs.
This method is called by Module.startModule(), which makes sure it is not called
more than once. You should not call init() directly, call startModule() instead.
- Overrides:
init in class ProcessorModule
getList
public java.util.Vector getList(scanpage sp,
StringTagger tagger,
java.lang.String value)
throws ParseException
[what] - ANSWERS-[question-id]
example: ANSWERS-903200
- Overrides:
getList in class ProcessorModule
- Following copied from class:
org.mmbase.module.ProcessorModule
- Parameters:
sp - the page contextparams - contains the attributes for the listcommand - the list command to execute.
process
public boolean process(scanpage sp,
java.util.Hashtable cmds,
java.util.Hashtable vars)
- Execute the commands provided in the form values
- Overrides:
process in class ProcessorModule
replace
public java.lang.String replace(scanpage sp,
java.lang.String mod)
- Handle a $MOD command
- Overrides:
replace in class ProcessorModule
calculateIntPercentage
public static int calculateIntPercentage(int votes,
int total,
double scale)
makeHashtable
public static java.util.Hashtable makeHashtable(java.lang.String s,
java.lang.String d1,
java.lang.String d2)
makeString
public static java.lang.String makeString(java.util.Hashtable h,
java.lang.String d1,
java.lang.String d2)
getModuleInfo
public java.lang.String getModuleInfo()
- Description copied from class:
Module
- provide some info on the module
- Overrides:
getModuleInfo in class Module
maintainance
public void maintainance()
- maintainance call, will be called by the admin to perform managment
tasks. This can be used instead of its own thread.
- Overrides:
maintainance in class Module
getAnswerId
public java.lang.String getAnswerId(MMObjectNode relNode)
MMBase 2001