org.objectweb.telosys.screen.core
Interface ScreenContext

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
StandardScreenContext

public interface ScreenContext
extends java.io.Serializable


Method Summary
 ScreenData beginAction()
          Notify the screen context that an action is about to alter the current screen data
The action needs the current ScreenData instance to work with
The screen context keep an image of the current ScreenData
to do a "cancel" if needed
 void cancelAction()
          Notify the screen context that the current action must be canceled
The screen context restore the original ScreenData (from the ScreenData image)
 void clearCurrentData()
          Remove the current ScreenData of the context
After this operation, getCurrentData() returns 'null'
 ScreenData createNewScreenData()
          Creates a new ScreenData instance and returns it.
 void eventCreate(ScreenSession screenSession, ScreenRequestParameters params)
          ScreenContext 'create' event
 void eventReuse(ScreenSession screenSession, ScreenRequestParameters params)
          ScreenContext 'reuse' event
 java.lang.Object getAttribute(java.lang.String name)
          Gets an object (attribute) from the 'screen context storage space' with the given name
If name is null : return null
 ScreenData getCurrentData()
          Returns the current ScreenData of the context (can be null)
 ScreenData getDataForLoad()
          Creates and returns a new ScreenData instance for 'load' operations
 javax.servlet.http.HttpSession getHttpSession()
          Deprecated. use ScreenRequest|ServiceRequest.getHttpSession() instead
 ScreenData getOrCreateCurrentData()
          Returns the current ScreenData of the context if it's not null,
if the current ScreenData is null : it is created, set as current and returned
 ScreenActions getOrCreateScreenActions()
          Returns the current ScreenActions if not null,
if null the current ScreenActions is created, set as current and returned
 ScreenActions getScreenActions()
          Returns the specific ScreenActions associated with the ScreenContext
 ScreenApplication getScreenApplication()
          Deprecated. use ScreenApplicationManager.getScreenApplication() instead
 int getScreenId()
          Returns the ID of the screen context
 ScreenManager getScreenManager()
          Deprecated. just for backward compatibility (will be removed), do not use
 java.lang.String getScreenName()
          Returns the symbolic screen context name
 ScreenSession getScreenSession()
          Deprecated. use ScreenRequest|ServiceRequest.getScreenSession() instead
 ScreenData getTempData()
          Returns a temporary ScreenData instance for the operations which are
working without modifying the current screen data
 boolean hasBeenReused()
          Returns the state of the "reused" flag
 java.lang.Object removeAttribute(java.lang.String name)
          Removes an object (attribute) from the 'screen context storage space'
If name is null : do nothing and return null
 java.lang.Object setAttribute(java.lang.String name, java.lang.Object value)
          Sets an object (attribute) in the 'screen context storage space', associated with a unique name
If name is null : do nothing
If value is null : remove the attribute associated with the given name
 void setCurrentData(ScreenData data)
          Sets the given ScreenData as the new current ScreenData of the context
 

Method Detail

getScreenName

public java.lang.String getScreenName()
Returns the symbolic screen context name

Returns:
the screen context name

getScreenId

public int getScreenId()
Returns the ID of the screen context

Returns:
: screen context ID ( 0 to N )

getScreenApplication

public ScreenApplication getScreenApplication()
Deprecated. use ScreenApplicationManager.getScreenApplication() instead

Returns the ScreenApplication instance

Returns:
the ScreenApplication

getScreenSession

public ScreenSession getScreenSession()
Deprecated. use ScreenRequest|ServiceRequest.getScreenSession() instead

Returns the ScreenSession to which the ScreenContext belongs

Returns:
the ScreenSession

getHttpSession

public javax.servlet.http.HttpSession getHttpSession()
Deprecated. use ScreenRequest|ServiceRequest.getHttpSession() instead

Returns the standard HttpSession to which the ScreenContext belongs

Returns:

getCurrentData

public ScreenData getCurrentData()
Returns the current ScreenData of the context (can be null)

Returns:
: the current context data or null

createNewScreenData

public ScreenData createNewScreenData()
Creates a new ScreenData instance and returns it.
NB: the ScreenData created is not set as the current ScreenData of the context

Returns:
: the new ScreenData created

getOrCreateCurrentData

public ScreenData getOrCreateCurrentData()
Returns the current ScreenData of the context if it's not null,
if the current ScreenData is null : it is created, set as current and returned

Returns:
: the current data (never null)

setCurrentData

public void setCurrentData(ScreenData data)
Sets the given ScreenData as the new current ScreenData of the context

Parameters:
data - the new ScreenData to set

clearCurrentData

public void clearCurrentData()
Remove the current ScreenData of the context
After this operation, getCurrentData() returns 'null'


beginAction

public ScreenData beginAction()
Notify the screen context that an action is about to alter the current screen data
The action needs the current ScreenData instance to work with
The screen context keep an image of the current ScreenData
to do a "cancel" if needed

Returns:
the current screen data

cancelAction

public void cancelAction()
Notify the screen context that the current action must be canceled
The screen context restore the original ScreenData (from the ScreenData image)


getTempData

public ScreenData getTempData()
Returns a temporary ScreenData instance for the operations which are
working without modifying the current screen data

Returns:
: a temporary ScreenData instance

getDataForLoad

public ScreenData getDataForLoad()
Creates and returns a new ScreenData instance for 'load' operations

Returns:
: ScreenData instance

setAttribute

public java.lang.Object setAttribute(java.lang.String name,
                                     java.lang.Object value)
Sets an object (attribute) in the 'screen context storage space', associated with a unique name
If name is null : do nothing
If value is null : remove the attribute associated with the given name

Parameters:
name - : a string specifying the name of the object
value - : the value
Returns:
: the previous value of the specified key in this hashtable, or null if it did not have one

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Gets an object (attribute) from the 'screen context storage space' with the given name
If name is null : return null

Parameters:
name - : a string specifying the name of the object
Returns:
: value instance ( or null if key is null or not found )

removeAttribute

public java.lang.Object removeAttribute(java.lang.String name)
Removes an object (attribute) from the 'screen context storage space'
If name is null : do nothing and return null

Parameters:
name - : a string specifying the name of the object
Returns:
: the value removed, or null if not found

getScreenActions

public ScreenActions getScreenActions()
Returns the specific ScreenActions associated with the ScreenContext

Returns:
: the ScreenActions (or null)

getScreenManager

public ScreenManager getScreenManager()
Deprecated. just for backward compatibility (will be removed), do not use

Returns the ScreenManager associated with the ScreenContext
This method replaces the "getScreenDataAccessor" method,

Returns:

getOrCreateScreenActions

public ScreenActions getOrCreateScreenActions()
                                       throws TelosysException
Returns the current ScreenActions if not null,
if null the current ScreenActions is created, set as current and returned

Returns:
: the ScreenActions (never null)
Throws:
TelosysException - if the ScreenActions cannot be created

hasBeenReused

public boolean hasBeenReused()
Returns the state of the "reused" flag

Returns:

eventCreate

public void eventCreate(ScreenSession screenSession,
                        ScreenRequestParameters params)
                 throws TelosysException
ScreenContext 'create' event

Parameters:
params -
Throws:
TelosysException

eventReuse

public void eventReuse(ScreenSession screenSession,
                       ScreenRequestParameters params)
                throws TelosysException
ScreenContext 'reuse' event

Parameters:
params -
Throws:
TelosysException