org.mmbase.module
Class INFO

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

public class INFO
extends ProcessorModule

The INFO module provides access to the environment on which the mmbase system resides. It can retrieve information on the file system, system memory, time, current user or browser, and miscellaneous information that is not directly related to the object cloud. Most functions in this module are specific for SCAN - other scripting languages generally have their own ways of obtaining this data.

Version:
$Id: INFO.java,v 1.43 2002/01/25 09:53:00 pierre Exp $ .
Author:
Daniel Ockeloen, Eduard Witteveen, Pierre van Rooden

Field Summary
static int Dutch
           
static int English
           
static int Not
           
 
Constructor Summary
INFO()
          Constructor for
 
Method Summary
 java.lang.String doExists(scanpage sp, java.util.StringTokenizer tok)
          Tests whether a given filename exists either as a directory, as a file, or as a path (depending on the subcommand given).
Subcommands are DIR, FILE, and PATH.
 java.util.Vector getList(scanpage sp, StringTagger tagger, java.lang.String value)
          Generate a list of values from a command to the processor.
The commands processed are :
COLOR-BASIC : returns a list of (system) color names and their RGB values
RANGE-X-Y-Z : returns a list of values in the numeric range X to Y, using Z as the increment factor (step) i.e RANGE-0-12-3 returns the values 0, 3 ,6 ,9, 12
The default values of X, Y and Z are 1, 10 and 1.
RANGE-ALPHA : returns the values 'A' thru 'Z'
SCANDATE :returns a list of dates (date, month, day, day-of-week) of all directories in a given path with a file length of 10 characters.
 java.lang.String getModuleInfo()
          Returns a description of the module.
 void init()
          Initializes the module.
 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 cmds)
          Handle a $MOD command.
 
Methods inherited from class org.mmbase.module.ProcessorModule
cacheCheck, getListBuilder, getNodeList, onload, reload, replace, shutdown, unload
 
Methods inherited from class org.mmbase.module.Module
getClassName, getInitParameter, getInitParameters, getMaintainer, getMimeType, getMimeTypeFile, getModule, getModule, getModules, getName, getProperties, getProperty, getVersion, hasStarted, loadModulesFromDisk, maintainance, 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
 

Field Detail

Not

public static final int Not

Dutch

public static final int Dutch

English

public static final int English
Constructor Detail

INFO

public INFO()
Constructor for
Method Detail

init

public void init()
Initializes the module. Determines the document root by reading system properties.
Overrides:
init in class ProcessorModule

getList

public java.util.Vector getList(scanpage sp,
                                StringTagger tagger,
                                java.lang.String value)
                         throws ParseException
Generate a list of values from a command to the processor.
The commands processed are :
COLOR-BASIC : returns a list of (system) color names and their RGB values
RANGE-X-Y-Z : returns a list of values in the numeric range X to Y, using Z as the increment factor (step) i.e RANGE-0-12-3 returns the values 0, 3 ,6 ,9, 12
The default values of X, Y and Z are 1, 10 and 1.
RANGE-ALPHA : returns the values 'A' thru 'Z'
SCANDATE :returns a list of dates (date, month, day, day-of-week) of all directories in a given path with a file length of 10 characters. No, I don't get it either.
Overrides:
getList in class ProcessorModule
Parameters:
sp - the current page context
tagger - the parameters (name-value pairs) belonging to the command to process
value - the command to process
Returns:
a Vector containing the requested values.

process

public boolean process(scanpage sp,
                       java.util.Hashtable cmds,
                       java.util.Hashtable vars)
Execute the commands provided in the form values. Does not do anything except output debug code.
Overrides:
process in class ProcessorModule
Parameters:
sp - the current page context
cmds - the command to process
vars - the variables to process
Returns:
alwyas false

replace

public java.lang.String replace(scanpage sp,
                                java.lang.String cmds)
Handle a $MOD command. This generally replaces the command in the SCAN page with the value returned by the command. Commands include:
BROWSER : returns browser or host name
DECODE : decodes a URL-encodes stringvalue
ENCODE : URL-encodes a strignvalue
ESCAPE : escapes the single quotes in a stringvalue
EXISTS : test if a file exists MEMORY : returns free meory
MOVE : Move a file on the system OS : retrieve the name of the user's Operating System RANDOM : returns a random number RELTIME : convert (relative) time values TIME : return a specific time value TIMEFORMAT/TIMEFORMATSEC : format a timevalue PARSETIME : parse time to seconds STRING : USER :
Overrides:
replace in class ProcessorModule
Parameters:
sp - the current page context
cmds - the command to process
Returns:
a String with the command's result value

getModuleInfo

public java.lang.String getModuleInfo()
Returns a description of the module.
Overrides:
getModuleInfo in class Module
Returns:
a String describing the module's function.

doExists

public java.lang.String doExists(scanpage sp,
                                 java.util.StringTokenizer tok)
Tests whether a given filename exists either as a directory, as a file, or as a path (depending on the subcommand given).
Subcommands are DIR, FILE, and PATH. This subcommand need be followed by a filename.
Parameters:
sp - the current page context
tok - the commands to be executed
Returns:
a String withe the value 'YES' if the check succeeded, 'NO' if it failed.


MMBase 2002