org.mmbase.util
Class scanpage

java.lang.Object
  extended by org.mmbase.util.PageInfo
      extended by org.mmbase.util.scanpage

public class scanpage
extends PageInfo

The scanpage is a container class. It holds all information that is needed to identify a user, including servlet objects and MMBase session information. It was introduced to make servscan threadsafe but will probably in the future hold all request related information, because we want to extend the model of offline page generation.

Version:
$Id: scanpage.java 35335 2009-05-21 08:14:41Z michiel $
Author:
Daniel Ockeloen
Application:
SCAN, this class will be troubelsome to move as it is used in MMObjectBuilder and ProcessorModule
Rename:
ScanPage

Field Summary
 String body
           
 String loadmode
           
 String mimetype
           
 String name
           
 Vector<String> params
          The parameters of this page.
 int partlevel
           
 HttpPost poster
          Object for accessing values sent by a form using enctype multipart/form-data.
 ProcessorModule processor
          The processor set for this page.
 String querystring
           
 boolean reload
          Indicates whether elements sucha s 'multilevel' should be reloaded, or whether results stored in cache should be used.
 String req_line
           
 int rstatus
           
 sessionInfo session
          The user's MMBase session object, if available.
 String sname
          The session name.
 String wantCache
           
 
Fields inherited from class org.mmbase.util.PageInfo
req, res
 
Constructor Summary
scanpage()
          Empty constructor for code not yet fixed, constructing its own scanpage Should use new constructor if possible.
scanpage(JamesServlet servlet, HttpServletRequest req, HttpServletResponse res, sessionsInterface sessions)
          Construct a scanpage for a servlet
 
Method Summary
(package private)  void CheckEditorReload()
           
 scanpage duplicate()
          Creates a duplicate of this scanpage
 String getAddress()
          Extract hostname from scanpage, get address and determine the proxies between it.
 String getHeader(String name)
          Retrieve a HTTP request header, if available
 String getParam(int num)
          Get the parameter specified.
 Vector<String> getParamsVector()
          Retrieve all parameters of a page.
 String getReferer()
          Gets the referrer from the request header.
 String getSessionName()
          Return the session name.
 String getUrl()
          Return page URL and parameters
 boolean setParamsLine(String paramline)
          Manually set the parameterline of a page (as if it was a querystring).
 boolean setParamsVector(Vector<String> params)
          Manually set the parameters of a page.
 void setReq(HttpServletRequest req)
          Sets the HttpServletRequest.
 void setRes(HttpServletResponse res)
          Sets the HttpServletResponse.
 void setSessionName(String name)
          Set the session name.
 
Methods inherited from class org.mmbase.util.PageInfo
getCloud, getRequest, getResponse, setRequest, setResponse, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

params

public Vector<String> params
The parameters of this page. These are either set mnaually using setParamsVector(java.util.Vector), or determined from the page using the PageInfo.req field


processor

public ProcessorModule processor
The processor set for this page. This values is set and used by scanparser to determine the default processor to call when interpreting LIST tags.


poster

public HttpPost poster
Object for accessing values sent by a form using enctype multipart/form-data.


session

public sessionInfo session
The user's MMBase session object, if available.


sname

public String sname
The session name.


name

public String name

rstatus

public int rstatus

body

public String body

req_line

public String req_line

wantCache

public String wantCache

mimetype

public String mimetype

querystring

public String querystring

partlevel

public int partlevel

loadmode

public String loadmode

reload

public boolean reload
Indicates whether elements sucha s 'multilevel' should be reloaded, or whether results stored in cache should be used.

Constructor Detail

scanpage

public scanpage()
Empty constructor for code not yet fixed, constructing its own scanpage Should use new constructor if possible.


scanpage

public scanpage(JamesServlet servlet,
                HttpServletRequest req,
                HttpServletResponse res,
                sessionsInterface sessions)
Construct a scanpage for a servlet

Method Detail

CheckEditorReload

void CheckEditorReload()

setReq

public void setReq(HttpServletRequest req)
Sets the HttpServletRequest. This method is invoked either by the MMBase servlets, or through the MMCI.


setRes

public void setRes(HttpServletResponse res)
Sets the HttpServletResponse. This method is invoked either by the MMBase servlets, or through the MMCI.


getParam

public String getParam(int num)
Get the parameter specified.

Parameters:
num - index of the parameter to retrieve
Returns:
the parametervalue

setParamsVector

public boolean setParamsVector(Vector<String> params)
Manually set the parameters of a page.

Parameters:
params - a Vector of parameter values

getParamsVector

public Vector<String> getParamsVector()
Retrieve all parameters of a page.

Returns:
a Vector of parameter values

setParamsLine

public boolean setParamsLine(String paramline)
Manually set the parameterline of a page (as if it was a querystring).

Parameters:
paramline - a string containing teh parametervalues seperated by '+' characters

getHeader

public String getHeader(String name)
Retrieve a HTTP request header, if available

Parameters:
name - the name of the header
Returns:
the header, nul if it can not be retrieved

getSessionName

public String getSessionName()
Return the session name.


setSessionName

public void setSessionName(String name)
Set the session name.


getUrl

public String getUrl()
Return page URL and parameters


getAddress

public String getAddress()
Extract hostname from scanpage, get address and determine the proxies between it. Needed to determine if user comes from internal or external host, because we use two streaming servers, one for external users and one for internal users.
input : scanpage sp, contains hostname as ipaddress
output : String "clientproxy.clientside.com->dialin07.clientside.com"

uses : VPROProxyName, VPROProxyAddress


getReferer

public String getReferer()
Gets the referrer from the request header.

Returns:
a String with the referer, null when reqheader is null.

duplicate

public scanpage duplicate()
Creates a duplicate of this scanpage

Returns:
the duplicate scanpage


MMBase 2.0-SNAPSHOT - null