LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.app.behaviorinterface
Interface LySessionBehaviorInterface

All Superinterfaces:
LyDataSessionBehaviorInterface
All Known Implementing Classes:
LySessionBehavior

public interface LySessionBehaviorInterface
extends LyDataSessionBehaviorInterface

This interface defines the methods to implement in order to change the default behavior of a session.

See Also:
LySession

Field Summary
static java.lang.String __VERSION
          File version
 
Method Summary
 java.lang.String checkControllerId(LyController controller, java.lang.String id)
          Method to compute id of the given controller.
 void close(LySession session)
          Method called when a session is closed.
 void controllerAdded(LySession session, LyController controller)
          Method called when a controller is added to the session.
 void controllerRemoved(LySession session, LyController controller)
          Method called when a controller is removed from the session.
 boolean enableAction(LySession session, LyAction action, LyController controller, LyObjectList objects, boolean showError)
          Enables the given action on the given list of objects for the given controller.
 boolean enableTransverseAction(LySession session, LyAction action, LyClassInfo classInfo, LyController controller, LyObjectList objects, boolean showError)
          Enables the given transverse action on the given list of objects for the given controller.
 void exit(LySession session)
          Method called when the user ask to quit the given session.
 LyController findExistingController(LySession session, LyController parent, LyAction action, LyClassInfo classInfo, LyObjectList objects, boolean recurseAllSessions)
          Searches for an existing controller being shown, and return it if found.
 java.lang.String getHelpFile(LySession session, LyController controller, LyAction action)
          Get an help file for the given session, the given controller and the given action.
 LyAction getRootAction(LySession session)
          Gets root action for this session.
 LyController getRootContextController(LySession session)
          Get a root level context controller.
 int getSessionTimeout(LySession session)
          Gets the session time out for the current session.
 boolean handleDemand(LySession session, LyController controller, LyDemand demand)
          Invoked when a demand is sent to a listener of this session.
 LyController invokeAction(LySession session, LyController order, LyAction action, LyClassInfo classInfo, LyObjectList objects, boolean show)
          Invoke an action.
 boolean invokeExtraAction(LySession session, LyController order, LyAction action, LyClassInfo classInfo, LyObjectList objects, boolean show)
          Invoke an action that has no controller.
 LyInfoList<LyInfo> loadUserPreferences(LySession session, java.lang.String userId)
          Load session preferences.
 LyInfoList<LyInfo> loadUserStickers(LySession session, java.lang.String userId)
          Load session stickers.
 void sessionTimeout(LySession session)
          Method invoked when a session is in time out.
 void showAbout(LySession session, LyController parent)
          Method invoked when the user ask for the 'about' action.
 void showHelp(LySession session, LyController parent)
          Method invoked when the user ask for the 'help' action.
 void showLog(LySession session, LyController controler)
          Method invoked when the user ask for the 'log' action.
 void showVersion(LySession session, LyController parent)
          Method invoked when the user ask for the 'version' action.
 void start(LySession session)
          Method called when a session is started.
 boolean validateAction(LySession session, LyAction action, LyController controller)
          Validates the given action for the given controller.
 void viewControllerHidden(LySession session, LyViewController viewController)
          Method called when a view controller is hidden within the given session.
 void viewControllerShown(LySession session, LyViewController viewController)
          Method called when a view controller is shown within the given session.
 
Methods inherited from interface leon.app.behaviorinterface.LyDataSessionBehaviorInterface
close, connectionLost, controlBeforeCommit, free, getDefaultUnitForField, getKeyValue, getUser, handleException, start, updateUndoRedo
 

Field Detail

__VERSION

static final java.lang.String __VERSION
File version

See Also:
Constant Field Values
Method Detail

start

void start(LySession session)
Method called when a session is started.

Parameters:
session - the started session.

loadUserPreferences

LyInfoList<LyInfo> loadUserPreferences(LySession session,
                                       java.lang.String userId)
Load session preferences.

Parameters:
session - Session on which preferences are loaded.
userId - Id of the session user.
Returns:
List of preferences of the session.

loadUserStickers

LyInfoList<LyInfo> loadUserStickers(LySession session,
                                    java.lang.String userId)
Load session stickers.

Parameters:
session - Session on which stickers are loaded.
userId - Id of the session user.
Returns:
List of stickers of the session.

close

void close(LySession session)
Method called when a session is closed.

Parameters:
session - the closed session.

getRootAction

LyAction getRootAction(LySession session)
Gets root action for this session.

Parameters:
session - current session.
Returns:
the root action for the session

exit

void exit(LySession session)
Method called when the user ask to quit the given session.

Parameters:
session - Session to exit from

checkControllerId

java.lang.String checkControllerId(LyController controller,
                                   java.lang.String id)
Method to compute id of the given controller.

Parameters:
controller - The new controller.
id - Desired id.
Returns:
Id of the new controller.

controllerAdded

void controllerAdded(LySession session,
                     LyController controller)
Method called when a controller is added to the session.

Parameters:
session - Session in which a controller is added.
controller - Controller added to the session.

controllerRemoved

void controllerRemoved(LySession session,
                       LyController controller)
Method called when a controller is removed from the session.

Parameters:
session - Session in which a controller is removed.
controller - Controller removed from the session.

viewControllerShown

void viewControllerShown(LySession session,
                         LyViewController viewController)
Method called when a view controller is shown within the given session.

Parameters:
session - the session
viewController - The view controller that is shown.

viewControllerHidden

void viewControllerHidden(LySession session,
                          LyViewController viewController)
Method called when a view controller is hidden within the given session.

Parameters:
session - the session
viewController - The view controller that is hidden.

validateAction

boolean validateAction(LySession session,
                       LyAction action,
                       LyController controller)
Validates the given action for the given controller.

Parameters:
session - the current session
action - the action to validate
controller - the controller for this action
Returns:
true if the action is valid, false otherwise.

enableAction

boolean enableAction(LySession session,
                     LyAction action,
                     LyController controller,
                     LyObjectList objects,
                     boolean showError)
Enables the given action on the given list of objects for the given controller.

Parameters:
session - the current session
action - the action to enable
controller - the controller for this action
objects - list of objects on which the action has to be enabled
showError - report an error if the action is not enabled
Returns:
true if the action is enabled, false otherwise.

enableTransverseAction

boolean enableTransverseAction(LySession session,
                               LyAction action,
                               LyClassInfo classInfo,
                               LyController controller,
                               LyObjectList objects,
                               boolean showError)
Enables the given transverse action on the given list of objects for the given controller.

Parameters:
session - the current session
action - the action to enable
classInfo - the classInfo for which the action is checked
controller - the controller for this action
objects - list of objects on which the action has to be enabled
showError - report an error if the action is not enabled
Returns:
true if the action is enabled, false otherwise.

invokeExtraAction

boolean invokeExtraAction(LySession session,
                          LyController order,
                          LyAction action,
                          LyClassInfo classInfo,
                          LyObjectList objects,
                          boolean show)
Invoke an action that has no controller.
This function is the right place to implement an application specific action because it is not driven by a controller.

Parameters:
session - the current session
order - the source controller
action - the action to execute
classInfo - class on which the action applies
objects - list of objects on which the action applies
show - indicates if the action must be shown or not
Returns:
true if the action was handled by this behavior, false otherwise.

invokeAction

LyController invokeAction(LySession session,
                          LyController order,
                          LyAction action,
                          LyClassInfo classInfo,
                          LyObjectList objects,
                          boolean show)
Invoke an action.
This function is the right place to implement an application specific action.

Parameters:
session - the current session
order - the source controller
action - the action to execute
classInfo - class on which the action applies
objects - list of objects on which the action applies
show - indicates if the action must be shown or not
Returns:
the controller corresponding to the invoked action.

getSessionTimeout

int getSessionTimeout(LySession session)
Gets the session time out for the current session.

Parameters:
session - the current session
Returns:
the session timeout in seconds

sessionTimeout

void sessionTimeout(LySession session)
Method invoked when a session is in time out.

Parameters:
session - the current session

getRootContextController

LyController getRootContextController(LySession session)
Get a root level context controller. This controller when created defines a top level session context : GUI modification Like set controller should become subcontext of this context. Usually this method returns null (no controller is a top level context controller). The ImportTableController is defining a root level context to grab all user modifications in the import context while the import table is active.

Parameters:
session - the session
Returns:
the root level context controller if any, or null if it could not be found.

showAbout

void showAbout(LySession session,
               LyController parent)
Method invoked when the user ask for the 'about' action. This method must give the 'about' message to the user.

Parameters:
session - the current session
parent - the parent controller

showLog

void showLog(LySession session,
             LyController controler)
Method invoked when the user ask for the 'log' action. This method must open the log file for the user.

Parameters:
session - the current session
controler - the parent controller

showVersion

void showVersion(LySession session,
                 LyController parent)
Method invoked when the user ask for the 'version' action. This method must give the 'version' message to the user.

Parameters:
session - the current session
parent - the parent controller

showHelp

void showHelp(LySession session,
              LyController parent)
Method invoked when the user ask for the 'help' action. This method must show the corresponding help to the user.

Parameters:
session - the current session
parent - the parent controller

handleDemand

boolean handleDemand(LySession session,
                     LyController controller,
                     LyDemand demand)
Invoked when a demand is sent to a listener of this session.

Parameters:
session - the current session
controller - controller that routed the demand.
demand - demand parameters sent by the view component.
Returns:
Return true if the demand was handled, false otherwise. If false, the demand is transmitted to the controller to try to handle it.

findExistingController

LyController findExistingController(LySession session,
                                    LyController parent,
                                    LyAction action,
                                    LyClassInfo classInfo,
                                    LyObjectList objects,
                                    boolean recurseAllSessions)
Searches for an existing controller being shown, and return it if found.

Parameters:
session - the current session
parent - The source controller.
action - The action to execute.
classInfo - The class on which the action applies.
objects - The list of objects on which the action applies.
recurseAllSessions - indicates if we recurse deeped into all sessions
Returns:
the controller if found, null otherwise
See Also:
LySessionBehavior.invokeAction(leon.app.LySession, leon.control.LyController, leon.info.LyAction, leon.info.LyClassInfo, leon.data.LyObjectList, boolean)

getHelpFile

java.lang.String getHelpFile(LySession session,
                             LyController controller,
                             LyAction action)
Get an help file for the given session, the given controller and the given action.

Parameters:
session - the current session.
controller - the controller of the action.
action - the action for which the helpfile is required.
Returns:
the path to the help file, or null if we have to use the generic help file behavior.

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com