Snapper 3.0 API

org.enhydra.snapperAdmin.presentation
Class BasePO

java.lang.Object
  extended by org.enhydra.snapperAdmin.presentation.BasePO
All Implemented Interfaces:
com.lutris.appserver.server.httpPresentation.HttpPresentation
Direct Known Subclasses:
BlankPresentation, CreatedPresentation, DeleteIndexed, DeletePath, DeleteSite, DM_DownloadPO, IndexedSitesPresentation, IndexPresentation, IndexSitePresentation, ListDocumentGroups, ListFileTypes, NewDocumentGroup, NewFileType, NewFileTypeCreation, NewGroupInput, NewSitePresentation, NotImplPresentation, NotIndexedPresentation, OptimizeSite, PathListPresentation, SiteListPresentation, StatusPresentation, TopPresentation, UpdateSite, UpdateSitePresentation

public abstract class BasePO
extends java.lang.Object
implements com.lutris.appserver.server.httpPresentation.HttpPresentation

Base abstract presentation class used for dynamic representation of particular java DOM generated objects. This class is super class for all presentation objects used in Versicherungsmathemathik application.


Field Summary
protected  com.lutris.appserver.server.httpPresentation.HttpPresentationComms comms
          Storage for HttpPresentationComms object passed to presentation object.
static java.lang.String ENCODING
          Page Encoding definition.
protected  java.lang.String errorText
          Error passed from other page which should be shown on this page.
protected  java.lang.String infoText
          Info passed from other page which should be shown on this page.
protected  int pageId
          Page identification (unique on session level)
static java.lang.String paramDelimiter
          Argument is used as parameter delimiter in bundled parameters.
 
Constructor Summary
BasePO()
           
 
Method Summary
protected  void addHiddenInputField(java.lang.String name, java.lang.String value, org.w3c.dom.html.HTMLElement root)
          Create hidden field.
protected  void addHiddenInputFields(java.lang.String paramNamePrefix, org.w3c.dom.html.HTMLElement root)
          Dynamicaly creates an array of input html fields and append they to the passed root html element.
protected  void addHiddenInputFields(java.lang.String paramNamePrefix, org.w3c.dom.html.HTMLElement root, java.lang.String[] exludePrefix)
          Dynamicaly creates an array of input html fields and append they to the passed root html element.
 void clearError()
          Clears the current error
protected  org.w3c.dom.html.HTMLInputElement createInputField(java.util.Hashtable attributes, org.w3c.dom.Document document)
          Create custom field.
protected  java.lang.String formParameterList(java.lang.String[] arg)
          Method used to form list of parameters delimited with delimiter
protected  com.lutris.util.Config getAppConfiguration()
          Returns information about application configuration defined in config file via Config object.
protected  boolean getBoolParameter(java.lang.String name)
          Read value of parameter from http request.
protected abstract  org.enhydra.xml.xmlc.XMLObject getDOM()
          This abstract method should be overriden by presentation class, and it is responsible for generation of http response to user in form of XMLObject instance.
 java.lang.Exception getError()
          Returns the current error
protected  java.lang.String getFromURL(java.lang.String searchPath)
          Find return page from search path.
protected  java.lang.String getLevelUp(java.lang.String searchPath)
          Method will make new search path,one level up.
protected  java.lang.String getParamValue(java.lang.String parameters, java.lang.String paramName)
          Gets value of parameter, when parametrs are delimited with paramDelimiter
protected  java.lang.String getReturnURL(java.lang.String searchPath)
          Find return page from search path.
protected  java.lang.String getStartSearchURL(java.lang.String searchPath)
          Find start search page from search path.
 boolean isIn(java.lang.String searchVal, java.lang.String[] definedGroup)
           
protected  void listAllParameters()
          Method is used to list all HTTP request parameters passed to presentation object, and their's corresponding values, to log file.
static void printFreeMemory(java.lang.String prefix)
           
protected  java.lang.String[] reformParameterList(java.lang.String str)
          Method used to form array of parameters from string with parameters delimited with delimiter
 void removeIdAttrFromTree(org.w3c.dom.Node rootNode)
          Removes id attributes from given html tag (represented as Node implementation) and all it's sub tags.
 void run(com.lutris.appserver.server.httpPresentation.HttpPresentationComms comms)
          Implementation of run() method from HttpPresentation interface.
 void setError(java.lang.Exception err)
          Sets error withouth possibility of overriding already existed error.
 void setError(java.lang.Exception err, boolean override)
          Sets error with possibility of overriding already existed error.
static void show(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

comms

protected com.lutris.appserver.server.httpPresentation.HttpPresentationComms comms
Storage for HttpPresentationComms object passed to presentation object.


infoText

protected java.lang.String infoText
Info passed from other page which should be shown on this page.


errorText

protected java.lang.String errorText
Error passed from other page which should be shown on this page.


pageId

protected int pageId
Page identification (unique on session level)


paramDelimiter

public static java.lang.String paramDelimiter
Argument is used as parameter delimiter in bundled parameters.


ENCODING

public static java.lang.String ENCODING
Page Encoding definition.

Constructor Detail

BasePO

public BasePO()
Method Detail

setError

public void setError(java.lang.Exception err)
Sets error withouth possibility of overriding already existed error.

Parameters:
err - BaseException error object

setError

public void setError(java.lang.Exception err,
                     boolean override)
Sets error with possibility of overriding already existed error.

Parameters:
err - BaseException error object
override - flag to indicate overriding (true) or rejecting of new error (false)

getError

public java.lang.Exception getError()
Returns the current error

Returns:

clearError

public void clearError()
Clears the current error


getParamValue

protected java.lang.String getParamValue(java.lang.String parameters,
                                         java.lang.String paramName)
Gets value of parameter, when parametrs are delimited with paramDelimiter

Parameters:
parameters -
paramName -
Returns:
value of parameter

formParameterList

protected java.lang.String formParameterList(java.lang.String[] arg)
Method used to form list of parameters delimited with delimiter

Parameters:
arg - array of parameters and their values
Returns:
list of parameters delimited with delimiter

reformParameterList

protected java.lang.String[] reformParameterList(java.lang.String str)
Method used to form array of parameters from string with parameters delimited with delimiter

Parameters:
str - parameters delimited with delimiter
Returns:
array of parameters

getStartSearchURL

protected java.lang.String getStartSearchURL(java.lang.String searchPath)
Find start search page from search path.

Parameters:
searchPath -
Returns:
start search page ( first page in search path )

getLevelUp

protected java.lang.String getLevelUp(java.lang.String searchPath)
Method will make new search path,one level up.

Parameters:
searchPath - searchPath
Returns:
new search path

getReturnURL

protected java.lang.String getReturnURL(java.lang.String searchPath)
Find return page from search path.

Parameters:
searchPath -
Returns:
return page ( last page in search path )

getFromURL

protected java.lang.String getFromURL(java.lang.String searchPath)
Find return page from search path.

Parameters:
searchPath -
Returns:
return page ( one before last page in search path )

addHiddenInputField

protected void addHiddenInputField(java.lang.String name,
                                   java.lang.String value,
                                   org.w3c.dom.html.HTMLElement root)
Create hidden field.

Parameters:
name -
value -
document -
Throws:
com.lutris.appserver.server.httpPresentation.HttpPresentationException

createInputField

protected org.w3c.dom.html.HTMLInputElement createInputField(java.util.Hashtable attributes,
                                                             org.w3c.dom.Document document)
Create custom field.

Parameters:
attributes -
document -
Returns:
field
Throws:
com.lutris.appserver.server.httpPresentation.HttpPresentationException

addHiddenInputFields

protected void addHiddenInputFields(java.lang.String paramNamePrefix,
                                    org.w3c.dom.html.HTMLElement root)
                             throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
Dynamicaly creates an array of input html fields and append they to the passed root html element. Input fields are created for correspond attribute values which are passed via http request parameteres, and are specified by theirs prefix.

Parameters:
paramNamePrefix - prefix name for group of http request parameters (or full name of one parameter) which values (or value) should be used for creation input fielsd elements.
Throws:
com.lutris.appserver.server.httpPresentation.HttpPresentationException

addHiddenInputFields

protected void addHiddenInputFields(java.lang.String paramNamePrefix,
                                    org.w3c.dom.html.HTMLElement root,
                                    java.lang.String[] exludePrefix)
                             throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
Dynamicaly creates an array of input html fields and append they to the passed root html element. Input fields are created for correspond attribute values which are passed via http request parameteres, and are specified by defined prefix group string with defined excluded prefix names.

Parameters:
paramNamePrefix - prefix name for group of http request parameters (or full name of one parameter) which values (or value) should be used for creation input fielsd elements.
exludePrefix - array with prefix names which have to be excluded from group of http request parameters defined by paramNamePrefix attribute.
Throws:
com.lutris.appserver.server.httpPresentation.HttpPresentationException

isIn

public boolean isIn(java.lang.String searchVal,
                    java.lang.String[] definedGroup)

run

public void run(com.lutris.appserver.server.httpPresentation.HttpPresentationComms comms)
         throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
Implementation of run() method from HttpPresentation interface.

Specified by:
run in interface com.lutris.appserver.server.httpPresentation.HttpPresentation
Parameters:
comms - object passed to presentation objects that contains HTTP and Presentation Manager access and control objects
Throws:
com.lutris.appserver.server.httpPresentation.HttpPresentationException

removeIdAttrFromTree

public void removeIdAttrFromTree(org.w3c.dom.Node rootNode)
Removes id attributes from given html tag (represented as Node implementation) and all it's sub tags.

Parameters:
rootNode - tag in html which has to be examined.
Throws:
com.lutris.appserver.server.httpPresentation.HttpPresentationException

getAppConfiguration

protected com.lutris.util.Config getAppConfiguration()
Returns information about application configuration defined in config file via Config object.

Returns:
Config object which represents configuration file of VersMath application.

listAllParameters

protected void listAllParameters()
Method is used to list all HTTP request parameters passed to presentation object, and their's corresponding values, to log file.


getDOM

protected abstract org.enhydra.xml.xmlc.XMLObject getDOM()
                                                  throws java.lang.Exception
This abstract method should be overriden by presentation class, and it is responsible for generation of http response to user in form of XMLObject instance.

Returns:
dynamically populated XMLObject generated as response to user http request.
Throws:
BaseException
java.lang.Exception

printFreeMemory

public static void printFreeMemory(java.lang.String prefix)

show

public static void show(java.lang.String s)

getBoolParameter

protected boolean getBoolParameter(java.lang.String name)
Read value of parameter from http request.

Parameters:
name - parameter name
Returns:
parameter value

Snapper 3.0 API