planetj.dataengine
Class ExecutingContext

java.lang.Object
  extended byplanetj.dataengine.ExecutingContext
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
HttpExecutingContext

public class ExecutingContext
extends java.lang.Object
implements java.io.Serializable

An ExecutingContext contains information or data to be used for the currently executing state of some action, operation, or request being carried out by the user.

See Also:
Serialized Form

Nested Class Summary
static class ExecutingContext.RenderingMode
          The rendering mode indicates what type of rendering is currently occurring.
 
Field Summary
static ExecutingContext.RenderingMode RENDERING_MODE_CSV
          Rendering to a CSV file
static ExecutingContext.RenderingMode RENDERING_MODE_HTML
          Rendering in HTML
static ExecutingContext.RenderingMode RENDERING_MODE_PDF
          Rendering to PDF
static ExecutingContext.RenderingMode RENDERING_MODE_SPLF
          Rendering to a Spooled File
 
Constructor Summary
ExecutingContext()
          Creates a new ExecutingContext object
ExecutingContext(IUser user)
          Creates a new ExecutingContext object
ExecutingContext(IUser user, Application application)
          Creates a new ExecutingContext object
 
Method Summary
 void addReplacementLibraries(java.util.Map replacements)
          Sets any replacement libraries
static void clearCurrentExecutingContext()
          Sets the current executing context
 Application getApplication()
          Get the current application of this executing context.
static ExecutingContext getCurrentExecutingContext()
          Gets the current executing context
static ExecutingContext getCurrentExecutingContext(IUser user)
          Gets the current executing context.
static HttpExecutingContext getCurrentHttpExecutingContext()
          Gets the current Http executing context
 int getCurrentTabIndex()
          Get current tab index.
static ExecutingContext getDefaultExecutingContext()
          Return a default ExecutingContext with unknown user and application
static ExecutingContext getDefaultExecutingContext(int pMode)
          Return a default ExecutingContext with unknown user and application, and the specified mode
 java.lang.String getInitParameter(java.lang.String paramName)
          Gets the value of an initialization parameter which was specified in the WEB.XML
 java.lang.String getLibraryList()
          Gets the current library list.
 int getMode()
          Gets the mode of the current action being performed on the database (e.g.
 java.lang.Object getObject(java.lang.Object key)
           
 ExecutingContext.RenderingMode getRenderingMode()
          Gets a RenderingMode object which describes the type of rendering which is currently being performed
 java.util.Map getReplacementLibraries()
          Gets the current replace libraries
 java.lang.String getReplacementLibrary(java.lang.String library)
          Gets the current replacement library for the given library
 java.lang.Object getRuntimeParameterValue(java.lang.String name)
          Gets the value of a runtime parameter
 java.lang.String getThemeId()
          Gets the current theme id.
 IUser getUser()
          Get the current user of this executing context.
 java.lang.String getUserLibrary()
          Gets the current user library.
 java.lang.Object getUserValue(java.lang.String key)
          Convience method that returns the a current user's value for the given field name.
 boolean isLoadParameterValuesFromRequest()
          Do we load parameter values from the http request during the executing of this magic request? If parameters for a context are being displayed and a different context ends up being executed, it may cause a new copy of the first context to be executed as well, and we may not want to load the "old" parameter values into that context.
 boolean isModeCopy()
          Copy mode?
 boolean isModeDelete()
          Delete mode?
 boolean isModeEdit()
          Edit mode?
 boolean isModeInsert()
          Insert mode?
 boolean isModeView()
          View mode?
 java.lang.Object putObject(java.lang.Object key, java.lang.Object value)
           
 java.lang.Object removeObject(java.lang.Object key)
           
 void setApplication(Application application)
          Set the current application of this executing context.
static void setCurrentExecutingContext(ExecutingContext ec)
          Sets the current executing context
 void setCurrentTabIndex(int index)
          Set the current tab index.
 void setDataEngineMode(java.lang.String newMode)
          Sets the mode of the current action being performed by the application (e.g.
 void setLibraryList(java.lang.String libraryList)
          Sets the current library list.
 void setLoadParameterValuesFromRequest(boolean loadValues)
          Do we load parameter values from the http request during the executing of this magic request? If parameters for a context are being displayed and a different context ends up being executed, it may cause a new copy of the first context to be executed as well, and we may not want to load the "old" parameter values into that context.
 void setMode(int newMode)
          Sets the mode of the current action being performed on the database (e.g.
 void setRenderingMode(ExecutingContext.RenderingMode renderingMode)
          Sets a RenderingMode object which describes the type of rendering which is currently being performed
 void setStayOnSameNavigationGroup(boolean stay)
           
 void setThemeId(int themeId)
          Sets the current theme id
 void setThemeId(java.lang.String themeId)
          Sets the current theme id
 void setUser(IUser user)
          Set the current user of this executing context.
 void setUserLibrary(java.lang.String newUserLibrary)
          Sets the current user library
static java.lang.String transformAlias(java.lang.String originalAlias)
          Given a shared connection alias, returns the appropriate connection alias to use for DB access.
 java.lang.String transformSystemAlias(java.lang.String originalAlias)
          Given a shared connection alias, returns the appropriate connection alias to use for DB access.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RENDERING_MODE_HTML

public static final ExecutingContext.RenderingMode RENDERING_MODE_HTML
Rendering in HTML


RENDERING_MODE_CSV

public static final ExecutingContext.RenderingMode RENDERING_MODE_CSV
Rendering to a CSV file


RENDERING_MODE_PDF

public static final ExecutingContext.RenderingMode RENDERING_MODE_PDF
Rendering to PDF


RENDERING_MODE_SPLF

public static final ExecutingContext.RenderingMode RENDERING_MODE_SPLF
Rendering to a Spooled File

Constructor Detail

ExecutingContext

public ExecutingContext()
Creates a new ExecutingContext object


ExecutingContext

public ExecutingContext(IUser user)
Creates a new ExecutingContext object


ExecutingContext

public ExecutingContext(IUser user,
                        Application application)
Creates a new ExecutingContext object

Method Detail

clearCurrentExecutingContext

public static void clearCurrentExecutingContext()
Sets the current executing context


getApplication

public Application getApplication()
Get the current application of this executing context.

Returns:
current application within this executing context

getCurrentTabIndex

public int getCurrentTabIndex()
Get current tab index.


getInitParameter

public java.lang.String getInitParameter(java.lang.String paramName)
Gets the value of an initialization parameter which was specified in the WEB.XML


getLibraryList

public java.lang.String getLibraryList()
Gets the current library list.


getCurrentExecutingContext

public static ExecutingContext getCurrentExecutingContext()
Gets the current executing context


getCurrentHttpExecutingContext

public static HttpExecutingContext getCurrentHttpExecutingContext()
Gets the current Http executing context

Returns:
null if current executing context is not instanceof HttpExecutingContext

getCurrentExecutingContext

public static ExecutingContext getCurrentExecutingContext(IUser user)
Gets the current executing context. If the user passed in is not null and does not match the user in the current executing context, then the user of the current executing context is set to the user passed in as an argument


getDefaultExecutingContext

public static ExecutingContext getDefaultExecutingContext()
Return a default ExecutingContext with unknown user and application

Returns:
ExecutingContext

getDefaultExecutingContext

public static ExecutingContext getDefaultExecutingContext(int pMode)
Return a default ExecutingContext with unknown user and application, and the specified mode

Returns:
ExecutingContext

getMode

public int getMode()
Gets the mode of the current action being performed on the database (e.g. Row.MODE_INSERT, Row.MODE_UPDATE, etc.)


getObject

public java.lang.Object getObject(java.lang.Object key)

getRenderingMode

public ExecutingContext.RenderingMode getRenderingMode()
Gets a RenderingMode object which describes the type of rendering which is currently being performed


getRuntimeParameterValue

public java.lang.Object getRuntimeParameterValue(java.lang.String name)
Gets the value of a runtime parameter


getThemeId

public java.lang.String getThemeId()
Gets the current theme id.


getUser

public IUser getUser()
Get the current user of this executing context.

Returns:
current user requesting some action or operation

getReplacementLibraries

public java.util.Map getReplacementLibraries()
Gets the current replace libraries


getReplacementLibrary

public java.lang.String getReplacementLibrary(java.lang.String library)
Gets the current replacement library for the given library


getUserLibrary

public java.lang.String getUserLibrary()
Gets the current user library. This is never null


getUserValue

public java.lang.Object getUserValue(java.lang.String key)
Convience method that returns the a current user's value for the given field name.


isLoadParameterValuesFromRequest

public boolean isLoadParameterValuesFromRequest()
Do we load parameter values from the http request during the executing of this magic request? If parameters for a context are being displayed and a different context ends up being executed, it may cause a new copy of the first context to be executed as well, and we may not want to load the "old" parameter values into that context. This can happen when parameters for a context are being displayed inside of a tab, and the user reruns the tabbed operation, causing that same tab to be displayed again & run again. In this case we don't want to use the parameter displayed for the context in the tab since the entire tabbed operation has been rerun.


isModeCopy

public boolean isModeCopy()
Copy mode?


isModeDelete

public boolean isModeDelete()
Delete mode?


isModeEdit

public boolean isModeEdit()
Edit mode?


isModeInsert

public boolean isModeInsert()
Insert mode?


isModeView

public boolean isModeView()
View mode?


putObject

public java.lang.Object putObject(java.lang.Object key,
                                  java.lang.Object value)

removeObject

public java.lang.Object removeObject(java.lang.Object key)

setApplication

public void setApplication(Application application)
Set the current application of this executing context.


setCurrentTabIndex

public void setCurrentTabIndex(int index)
Set the current tab index.


setCurrentExecutingContext

public static void setCurrentExecutingContext(ExecutingContext ec)
Sets the current executing context


setDataEngineMode

public void setDataEngineMode(java.lang.String newMode)
Sets the mode of the current action being performed by the application (e.g. IDataEngine.MODE_INSERT, IDataEngine.MODE_UPDATE, etc.)


setLibraryList

public void setLibraryList(java.lang.String libraryList)
Sets the current library list.


setLoadParameterValuesFromRequest

public void setLoadParameterValuesFromRequest(boolean loadValues)
Do we load parameter values from the http request during the executing of this magic request? If parameters for a context are being displayed and a different context ends up being executed, it may cause a new copy of the first context to be executed as well, and we may not want to load the "old" parameter values into that context. This can happen when parameters for a context are being displayed inside of a tab, and the user reruns the tabbed operation, causing that same tab to be displayed again & run again. In this case we don't want to use the parameter displayed for the context in the tab since the entire tabbed operation has been rerun.


setMode

public void setMode(int newMode)
Sets the mode of the current action being performed on the database (e.g. Row.MODE_INSERT, Row.MODE_UPDATE, etc.)


addReplacementLibraries

public void addReplacementLibraries(java.util.Map replacements)
Sets any replacement libraries


setRenderingMode

public void setRenderingMode(ExecutingContext.RenderingMode renderingMode)
Sets a RenderingMode object which describes the type of rendering which is currently being performed


setStayOnSameNavigationGroup

public void setStayOnSameNavigationGroup(boolean stay)

setThemeId

public void setThemeId(int themeId)
Sets the current theme id


setThemeId

public void setThemeId(java.lang.String themeId)
Sets the current theme id


setUser

public void setUser(IUser user)
Set the current user of this executing context.


setUserLibrary

public void setUserLibrary(java.lang.String newUserLibrary)
Sets the current user library


transformAlias

public static java.lang.String transformAlias(java.lang.String originalAlias)
Given a shared connection alias, returns the appropriate connection alias to use for DB access. Usually this is just the same connection alias, however in some cases (like if the user is using a personal connection pool instead of a shared one) the returned alias will be different.


transformSystemAlias

public java.lang.String transformSystemAlias(java.lang.String originalAlias)
Given a shared connection alias, returns the appropriate connection alias to use for DB access. Usually this is just the same connection alias, however in some cases (like if the user is using a personal connection pool instead of a shared one) the returned alias will be different.