org.mmbase.module.gui.html
Class scanparser

java.lang.Object
  extended by org.mmbase.util.functions.FunctionProvider
      extended by org.mmbase.util.functions.DescribedFunctionProvider
          extended by org.mmbase.module.Module
              extended by org.mmbase.module.ProcessorModule
                  extended by org.mmbase.module.gui.html.scanparser
All Implemented Interfaces:
Descriptor

public class scanparser
extends ProcessorModule

scanpage is a container class it holds all objects needed per scan page it was introduced to make servscan threadsafe but will probably in the future hold all page related info instead of HttpServletR equest and HttpServletResponse because we want extend the model of offline page generation.

Version:
$Id: scanparser.java 35335 2009-05-21 08:14:41Z michiel $
Author:
Daniel Ockeloen
Application:
SCAN
Javadoc:
Rename:
SCANParser

Nested Class Summary
 
Nested classes/interfaces inherited from class org.mmbase.module.ProcessorModule
ProcessorModule.GetNodeListFunction, ProcessorModule.ProcessFunction, ProcessorModule.ReplaceFunction
 
Field Summary
(package private)  Hashtable Roots
           
static scancacheInterface scancache
           
 
Fields inherited from class org.mmbase.module.ProcessorModule
PARAM_PAGEINFO, PARAMS_PAGEINFO
 
Fields inherited from class org.mmbase.module.Module
configurationPath, getMaintainerFunction, getVersionFunction, properties, STATE_START_TIME
 
Fields inherited from class org.mmbase.util.functions.DescribedFunctionProvider
description, guiName, name
 
Fields inherited from class org.mmbase.util.functions.FunctionProvider
functions, getFunctions
 
Constructor Summary
scanparser()
           
 
Method Summary
static int calccrc32(String str)
           
 String calcPage(String part2, scanpage sp, int cachetype)
           
(package private)  String do_conditions_lif(String body, sessionInfo session, scanpage sp)
          handle if/then/elseif/\/if
(package private)  String do_conditions(String body, sessionInfo session, scanpage sp)
          handle if/then/elseif/\/if
(package private)  String do_if(String body, sessionInfo session, scanpage sp)
           
 void do_proc_input(String rq_line, HttpPost poster, Hashtable proc_var, Hashtable proc_cmd, scanpage sp)
          This does the handling of the Form inputs.
(package private)  boolean do_val(String cmd, sessionInfo session, scanpage sp)
           
(package private)  boolean do_vals(String cmd, sessionInfo session, scanpage sp)
           
 String doEndPart(String template, int last, int rpos, int numitems, int epos)
           
(package private)  Vector doMAlphaSort(List input, String sortonnumbers, int numberofitems)
          davzev changed method syntax from int sortonnumber to String sortonnumbers.
 String doPrePart(String template, int last, int rpos, int numitems, int epos)
           
 String getfile(String where)
           
 String getMimeType(String ext)
          getMimeType: Returns the mimetype using ServletContext.getServletContext which returns the servlet context which is set when servscan is loaded.
 String getMimeTypeFile(String fileName)
           
(package private)  Hashtable getRoots()
           
 String handle_line(String body, sessionInfo session, scanpage sp)
          Process the HTML for our own extensions
 void init()
          Init the servscan, this is needed because it was created using a newInstanceOf().
 void processPage(scanpage sp, String uri)
          Start a process to calculate a page in the background used by scancache to generate new pages for expired ones
 void removeProcess(String uri)
          Remove a PageProcess from the list of pages currently being calculated
 Vector reverse(List input, int num)
           
 
Methods inherited from class org.mmbase.module.ProcessorModule
getList, getListBuilder, getNodeList, onload, process, reload, replace, replace, unload
 
Methods inherited from class org.mmbase.module.Module
addInitParameters, checkModules, getInitParameter, getInitParameter, getInitParameter, getInitParameters, getInitParameters, getMaintainer, getModule, getModule, getModule, getModule, getModuleInfo, getModuleLoader, getModuleReader, getModuleReader, getModules, getState, getStates, getVersion, hasModule, hasStarted, loadInitParameters, loadInitParameters, maintainance, setInitParameter, setMaintainer, setState, setVersion, shutdown, shutdownModules, startModule, startModules
 
Methods inherited from class org.mmbase.util.functions.DescribedFunctionProvider
getDefaultLocale, getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName, setLocalizedDescription, setLocalizedGUIName, setName
 
Methods inherited from class org.mmbase.util.functions.FunctionProvider
addFunction, createParameters, getFunction, getFunctions, getFunctionValue, newFunctionInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scancache

public static scancacheInterface scancache

Roots

Hashtable Roots
Constructor Detail

scanparser

public scanparser()
Method Detail

init

public void init()
Init the servscan, this is needed because it was created using a newInstanceOf().

Overrides:
init in class ProcessorModule

getMimeType

public String getMimeType(String ext)
getMimeType: Returns the mimetype using ServletContext.getServletContext which returns the servlet context which is set when servscan is loaded. Fixed on 22 December 1999 by daniel & davzev.

Parameters:
ext - A String containing the extension.
Returns:
The mimetype.

getMimeTypeFile

public String getMimeTypeFile(String fileName)

doPrePart

public String doPrePart(String template,
                        int last,
                        int rpos,
                        int numitems,
                        int epos)

doEndPart

public String doEndPart(String template,
                        int last,
                        int rpos,
                        int numitems,
                        int epos)

reverse

public Vector reverse(List input,
                      int num)

do_vals

boolean do_vals(String cmd,
                sessionInfo session,
                scanpage sp)
          throws ParseException
Throws:
ParseException

do_val

boolean do_val(String cmd,
               sessionInfo session,
               scanpage sp)
         throws ParseException
Throws:
ParseException

handle_line

public final String handle_line(String body,
                                sessionInfo session,
                                scanpage sp)
                         throws ParseException
Process the HTML for our own extensions

Throws:
ParseException

getfile

public final String getfile(String where)
Parameters:
where - A string with the location of the to be parsed file
Returns:
A html-page

do_conditions_lif

String do_conditions_lif(String body,
                         sessionInfo session,
                         scanpage sp)
                   throws ParseException
handle if/then/elseif/\/if

Throws:
ParseException

do_if

String do_if(String body,
             sessionInfo session,
             scanpage sp)
       throws ParseException
Throws:
ParseException

do_conditions

String do_conditions(String body,
                     sessionInfo session,
                     scanpage sp)
               throws ParseException
handle if/then/elseif/\/if

Throws:
ParseException

getRoots

Hashtable getRoots()

do_proc_input

public final void do_proc_input(String rq_line,
                                HttpPost poster,
                                Hashtable proc_var,
                                Hashtable proc_cmd,
                                scanpage sp)
This does the handling of the Form inputs. It calls the processor to handle the PRC-CMD's it finds after it has done the PRC-VAR's fill in.


calcPage

public String calcPage(String part2,
                       scanpage sp,
                       int cachetype)

processPage

public void processPage(scanpage sp,
                        String uri)
Start a process to calculate a page in the background used by scancache to generate new pages for expired ones

Parameters:
sp - The request of the page (duplicated from the original)
uri - The uri of the request

removeProcess

public void removeProcess(String uri)
Remove a PageProcess from the list of pages currently being calculated

Parameters:
uri - Uri of the request being calculated

doMAlphaSort

Vector doMAlphaSort(List input,
                    String sortonnumbers,
                    int numberofitems)
davzev changed method syntax from int sortonnumber to String sortonnumbers. Sort the lines in the vector, to do this we need to first group them and then sort them by item number defined

Parameters:
input - - the result Vector unsorted.
sortonnumbers - - a String with colpositions eg. "6:4" denoting the order and colpositions for the sort.
numberofitems - - integer with the amount of items.
Returns:
a Vector with sorted items.

calccrc32

public static int calccrc32(String str)


MMBase 2.0-SNAPSHOT - null