org.mmbase.module
Class sessions

java.lang.Object
  |
  +--org.mmbase.module.Module
        |
        +--org.mmbase.module.ProcessorModule
              |
              +--org.mmbase.module.sessions
All Implemented Interfaces:
ProcessorInterface, sessionsInterface

public class sessions
extends ProcessorModule
implements sessionsInterface

CLEARSET-NAME : This command clears the session variable called NAME ADDSET-NAME-VALUE : This command adds VALUE to the SESSION variable set called NAME, no duplicates are allowed PUTSET-NAME-VALUE : This command adds VALUE to the SESSION variable set called NAME, duplicates are allowed DELSET-NAME-VALUE : This command deletes VALUE form the SESSION variable set called NAME. CONTAINSSET-NAME-VALUE : returns "YES" if the session variable NAME contains the VALUE, otherwise returns "NO" SETSTRING-NAME : This command gives all values of the session variable NAME, comma separated. SETCOUNT-NAME : This command gives the number of values contained by the session variable NAME. AVGSET-NAME : This command returns the average of a set numbers. CLEARSESSIONINFO : This command clears the SessionInfo.

Version:
$Id: sessions.java,v 1.22 2001/04/10 20:23:50 michiel Exp $
Author:
Daniel Ockeloen

Constructor Summary
sessions()
          SimpleModule
 
Method Summary
 void addSetValue(sessionInfo session, java.lang.String key, java.lang.String value)
          Adds a String to a set.
 void addSetValues(sessionInfo session, java.lang.String key, java.util.Vector values)
          Adds a number of Strings to a set.
 java.lang.String doAddSet(scanpage sp, java.util.StringTokenizer tok)
          Adds a sessionvariable with specified value
 java.lang.String doClearSet(scanpage sp, java.util.StringTokenizer tok)
          This methode clears a SESSION variable
 java.lang.String doDelSet(scanpage sp, java.util.StringTokenizer tok)
           
 java.util.Vector doGetSet(scanpage sp, java.util.StringTokenizer tok)
           
 java.lang.String doPutSet(scanpage sp, java.util.StringTokenizer tok)
           
 void forgetSession(java.lang.String wanted)
           
 java.lang.String getAvgSet(scanpage sp, java.util.StringTokenizer tok)
           
 java.lang.String getContainsSet(scanpage sp, java.util.StringTokenizer tok)
          Checks if a Session variable contains a certain value.
 java.util.Vector getList(scanpage sp, StringTagger tagger, java.lang.String cmd)
          Generate a list of values from a command to the processor
 sessionInfo getSession(scanpage sp, java.lang.String wanted)
           
 java.lang.String getSetCount(scanpage sp, java.util.StringTokenizer tok)
          gives the number of values contained by a certain session variable
 java.lang.String getSetString(scanpage sp, java.util.StringTokenizer tok)
          returns the values of a session variable comma separated
 int getSize()
           
 java.lang.String getValue(sessionInfo session, java.lang.String wanted)
           
 void init()
          Initializes the module.
 void loadNewProperties(sessionInfo session)
           
 void loadProperties(sessionInfo session)
           
 void onload()
           
 java.lang.String replace(scanpage sp, java.lang.String cmds)
          Handle a $MOD command
 java.lang.String saveValue(sessionInfo session, java.lang.String key)
           
 java.lang.String saveValueNew(sessionInfo session, java.lang.String key)
           
 java.lang.String setValue(sessionInfo session, java.lang.String key, java.lang.String value)
          Sets or changes a parameter in a sessionInfo.
 void setValueFromNode(sessionInfo session, MMObjectNode node)
           
 void shutdown()
           
 java.util.Hashtable state()
          state, returns the state hashtable that is/can be used to debug.
 void unload()
           
 java.lang.String xmlEscape(java.lang.String s)
          the XML reader will correct the escaped characters again.
 
Methods inherited from class org.mmbase.module.ProcessorModule
cacheCheck, getListBuilder, getNodeList, process, reload, replace
 
Methods inherited from class org.mmbase.module.Module
getClassName, getInitParameter, getInitParameters, getMaintainer, getMimeType, getMimeTypeFile, getModule, getModule, getModuleInfo, getModules, getName, getProperties, getProperty, getVersion, hasStarted, loadModulesFromDisk, maintainance, setClassName, setInitParameter, setMaintainer, setName, setVersion, startModule, startModules
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

sessions

public sessions()
SimpleModule
Method Detail

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.
Specified by:
init in interface sessionsInterface
Overrides:
init in class ProcessorModule

onload

public void onload()
Overrides:
onload in class ProcessorModule

unload

public void unload()
Overrides:
unload in class ProcessorModule

shutdown

public void shutdown()
Overrides:
shutdown in class ProcessorModule

getSession

public sessionInfo getSession(scanpage sp,
                              java.lang.String wanted)
Specified by:
getSession in interface sessionsInterface

forgetSession

public void forgetSession(java.lang.String wanted)
Specified by:
forgetSession in interface sessionsInterface

getValue

public java.lang.String getValue(sessionInfo session,
                                 java.lang.String wanted)
Specified by:
getValue in interface sessionsInterface

setValue

public java.lang.String setValue(sessionInfo session,
                                 java.lang.String key,
                                 java.lang.String value)
Sets or changes a parameter in a sessionInfo.
Specified by:
setValue in interface sessionsInterface
Parameters:
session - the sessionInfo wich has to contain the parameter.
key - the name of the parameter to be set.
value - the value to wich the parameter should be set.

addSetValues

public void addSetValues(sessionInfo session,
                         java.lang.String key,
                         java.util.Vector values)
Adds a number of Strings to a set.
Specified by:
addSetValues in interface sessionsInterface
Parameters:
session - the sessionInfo containing the set.
key - the name of the set.
value - a Vector containing the Strings to be added to the set.

addSetValue

public void addSetValue(sessionInfo session,
                        java.lang.String key,
                        java.lang.String value)
Adds a String to a set. If the String is allready contained by the set nothing happens.
Specified by:
addSetValue in interface sessionsInterface
Parameters:
session - the sessionInfo containing the set.
key - the name of the set.
value - the String to be added to the set.

setValueFromNode

public void setValueFromNode(sessionInfo session,
                             MMObjectNode node)
Specified by:
setValueFromNode in interface sessionsInterface

loadProperties

public void loadProperties(sessionInfo session)

loadNewProperties

public void loadNewProperties(sessionInfo session)

saveValue

public java.lang.String saveValue(sessionInfo session,
                                  java.lang.String key)
Specified by:
saveValue in interface sessionsInterface

saveValueNew

public java.lang.String saveValueNew(sessionInfo session,
                                     java.lang.String key)

getList

public java.util.Vector getList(scanpage sp,
                                StringTagger tagger,
                                java.lang.String cmd)
                         throws ParseException
Description copied from class: ProcessorModule
Generate a list of values from a command to the processor
Overrides:
getList in class ProcessorModule
Following copied from class: org.mmbase.module.ProcessorModule
Parameters:
sp - the page context
params - contains the attributes for the list
command - the list command to execute.

replace

public java.lang.String replace(scanpage sp,
                                java.lang.String cmds)
Handle a $MOD command
Specified by:
replace in interface sessionsInterface
Overrides:
replace in class ProcessorModule

doAddSet

public java.lang.String doAddSet(scanpage sp,
                                 java.util.StringTokenizer tok)
Adds a sessionvariable with specified value

doPutSet

public java.lang.String doPutSet(scanpage sp,
                                 java.util.StringTokenizer tok)

doClearSet

public java.lang.String doClearSet(scanpage sp,
                                   java.util.StringTokenizer tok)
This methode clears a SESSION variable

getAvgSet

public java.lang.String getAvgSet(scanpage sp,
                                  java.util.StringTokenizer tok)

doDelSet

public java.lang.String doDelSet(scanpage sp,
                                 java.util.StringTokenizer tok)

getContainsSet

public java.lang.String getContainsSet(scanpage sp,
                                       java.util.StringTokenizer tok)
Checks if a Session variable contains a certain value.

doGetSet

public java.util.Vector doGetSet(scanpage sp,
                                 java.util.StringTokenizer tok)

getSetString

public java.lang.String getSetString(scanpage sp,
                                     java.util.StringTokenizer tok)
returns the values of a session variable comma separated

getSetCount

public java.lang.String getSetCount(scanpage sp,
                                    java.util.StringTokenizer tok)
gives the number of values contained by a certain session variable

getSize

public int getSize()

state

public java.util.Hashtable state()
Description copied from class: Module
state, returns the state hashtable that is/can be used to debug. Should be overridden when live state should be done.
Overrides:
state in class Module

xmlEscape

public java.lang.String xmlEscape(java.lang.String s)
the XML reader will correct the escaped characters again. but scan will not evaluate the tags. only < has to be parsed to &<


MMBase 2001