planetj.dataengine
Class HTMLContext

java.lang.Object
  extended byplanetj.dataengine.AbstractContext
      extended byplanetj.dataengine.HTMLContext
All Implemented Interfaces:
java.lang.Cloneable, IContext, INavigationObject, java.io.Serializable
Direct Known Subclasses:
HTMLOperationContext

public class HTMLContext
extends AbstractContext
implements java.io.Serializable, java.lang.Cloneable

See Also:
Serialized Form

Field Summary
static java.lang.String className
          Class name.
 
Fields inherited from class planetj.dataengine.AbstractContext
DEFAULT_TYPE, mCode, mLocked, mParameterized, mParameterNames, mParameterSource, mParameterValues, PARAM_ESCAPE_NUMBERED, PARAM_ESCAPE_TABLE, PARAM_ESCAPE_USAGE_ID, PARAM_ESCAPE_USER, PARAM_ESCAPE_USER_USAGE_ID, PARAM_NUMBERED, PARAM_TABLE, PARAM_USAGE_ID, PARAM_USER, PARAM_USER_USAGE_ID, TYPE_TABLE_PARAMETER
 
Constructor Summary
HTMLContext()
          Constructor
HTMLContext(ExecutingContext ec)
          Constructor
HTMLContext(IUser user)
          Deprecated. replaced with HTMLContext(ExecutingContext)
 
Method Summary
protected  java.lang.StringBuffer appendProperties(java.lang.StringBuffer info)
          Gets a String representation of this context's HTML code.
 java.lang.Object execute()
          Gets a modified HTML code String with parameters replaced with their set values.
static java.lang.String execute(java.lang.String code, Row parameterRow, ExecutingContext ec)
          Creates a new HTMLContext from the given ExecutingContext and executes the context using the given Row for parameter values.
static java.lang.String execute(java.lang.String code, Row parameterRow, int valueType, ExecutingContext ec)
          Creates a new HTMLContext from the given ExecutingContext and executes the context using the given Row for parameter values.
 PropertyGroupList getPropertyGroups()
          Get all the property groups stored in this context.
protected  int handleParameter(int startIndex, java.lang.StringBuffer code)
          Handles a parameter token in a StringBuffer of code.
protected  boolean isParameterTokenEnd(char c)
          Tests if the specified character signals the end of a parameter token
protected  java.lang.String rectifyCode(java.lang.String code)
          Subclasses need to handle the logic of finding parameters out of the code string.
 
Methods inherited from class planetj.dataengine.AbstractContext
appendParameters, clear, clearParameterValues, clone, createParameter, equals, getCode, getCreationSource, getDataTimestamp, getDisplayParameters, getExecutingContext, getFirstDisplayParameter, getFirstParameterForInput, getNavigationKey, getNavigationListKey, getOriginalCode, getParameter, getParameter, getParameterClass, getParameterCollection, getParameterCount, getParameterCount, getParameterDisplayFields, getParameterDisplayFields, getParameterRow, getParameters, getParameters, getParameterSource, getParameterValidationExceptions, getParameterValuesType, getPrimaryContext, getPropertyGroup, getPropertyGroups, getRowParameters, initializeAndStore, isCloneNeeded, isContainsDisplayParameters, isContainsParameters, isLocked, isParameterized, isParameterTokenEnd, isRefreshing, isSecondaryContext, loadGlobalValues, loadParameterRequestAndSessionValues, loadSQLTextReplacementValues, loadUserAndExecutingContextValues, lock, parameterAltered, prepareForExecution, removeNavigationKey, setCode, setCode, setCodeInternal, setCreationSource, setDataTimestamp, setExecutingContext, setNavigationKey, setParameterCollection, setParameterDisplayValues, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setParameterValuesType, setPrimaryContext, setRefreshing, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

className

public static final java.lang.String className
Class name.

Constructor Detail

HTMLContext

public HTMLContext()
Constructor


HTMLContext

public HTMLContext(IUser user)
Deprecated. replaced with HTMLContext(ExecutingContext)

Constructor


HTMLContext

public HTMLContext(ExecutingContext ec)
Constructor

Method Detail

execute

public static java.lang.String execute(java.lang.String code,
                                       Row parameterRow,
                                       ExecutingContext ec)
Creates a new HTMLContext from the given ExecutingContext and executes the context using the given Row for parameter values.


execute

public static java.lang.String execute(java.lang.String code,
                                       Row parameterRow,
                                       int valueType,
                                       ExecutingContext ec)
Creates a new HTMLContext from the given ExecutingContext and executes the context using the given Row for parameter values.

Parameters:
code -
parameterRow -
valueType -
ec -
Returns:

appendProperties

protected java.lang.StringBuffer appendProperties(java.lang.StringBuffer info)
Gets a String representation of this context's HTML code. This method is called by the toString() method. If any subclass wishes to have certain properties displayed besides the code, they can override this method. Note: parameter values are also outputed from toString().

Overrides:
appendProperties in class AbstractContext

execute

public java.lang.Object execute()
                         throws CMException
Gets a modified HTML code String with parameters replaced with their set values.

Specified by:
execute in class AbstractContext
Throws:
CMException

getPropertyGroups

public PropertyGroupList getPropertyGroups()
Get all the property groups stored in this context.

Specified by:
getPropertyGroups in interface IContext
Specified by:
getPropertyGroups in class AbstractContext

handleParameter

protected int handleParameter(int startIndex,
                              java.lang.StringBuffer code)
Handles a parameter token in a StringBuffer of code. A new IParameter is created and stored in this context, and the parameter token in the code is replaced with the parameter's unique ID

Overrides:
handleParameter in class AbstractContext
Returns:
The index of the last character of the parameter's unique ID within the code

isParameterTokenEnd

protected boolean isParameterTokenEnd(char c)
Tests if the specified character signals the end of a parameter token

Specified by:
isParameterTokenEnd in class AbstractContext

rectifyCode

protected java.lang.String rectifyCode(java.lang.String code)
Description copied from class: AbstractContext
Subclasses need to handle the logic of finding parameters out of the code string.

Specified by:
rectifyCode in class AbstractContext