|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.app.behavior.LyDataSessionBehavior
leon.app.behavior.LySessionBehavior
public class LySessionBehavior
This class implements the default behavior of a session.
LySession
,
LySessionBehaviorInterface
Field Summary | |
---|---|
static java.lang.String |
__VERSION
File version |
static java.lang.String |
ENABLE_ACTION
|
static java.lang.String |
VALIDATE_ACTION
|
Constructor Summary | |
---|---|
LySessionBehavior()
Constructor. |
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 this listener of this session. |
LyController |
invokeAction(LySession session,
LyController controller,
LyAction action,
LyClassInfo classInfo,
LyObjectList objects,
boolean show)
Invoke an action. |
boolean |
invokeExtraAction(LySession session,
LyController controller,
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 |
questionAnswer(boolean result,
java.lang.Object clientData)
Answer to a askQuestion request. |
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 controller)
Show the log file. |
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 class leon.app.behavior.LyDataSessionBehavior |
---|
close, connectionLost, controlBeforeCommit, free, getDefaultUnitForField, getKeyValue, getUser, handleException, start, updateUndoRedo |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface leon.app.behaviorinterface.LyDataSessionBehaviorInterface |
---|
close, connectionLost, controlBeforeCommit, free, getDefaultUnitForField, getKeyValue, getUser, handleException, start, updateUndoRedo |
Field Detail |
---|
public static final java.lang.String __VERSION
public static final java.lang.String ENABLE_ACTION
public static final java.lang.String VALIDATE_ACTION
Constructor Detail |
---|
public LySessionBehavior()
Method Detail |
---|
public void start(LySession session)
validate
the session if the root action is not a
login action.
start
in interface LySessionBehaviorInterface
session
- the started session.public LyAction getRootAction(LySession session)
getRootAction
in interface LySessionBehaviorInterface
session
- current session.
public LyInfoList<LyInfo> loadUserPreferences(LySession session, java.lang.String userId)
loadUserPreferences
in interface LySessionBehaviorInterface
session
- Session on which preferences are loaded.userId
- Id of the session user (may be null if preference is shared).
public LyInfoList<LyInfo> loadUserStickers(LySession session, java.lang.String userId)
loadUserStickers
in interface LySessionBehaviorInterface
session
- Session on which stickers are loaded.userId
- Id of the session user (may be null if preference is shared).
public void close(LySession session)
LySession.confirmClosing()
method.
close
in interface LySessionBehaviorInterface
session
- the closed session.public void exit(LySession session)
asks confirmation
to the
user before exiting.
exit
in interface LySessionBehaviorInterface
session
- Session to exit frompublic void questionAnswer(boolean result, java.lang.Object clientData)
questionAnswer
in interface LyQuestionAnswerInterface
result
- true if the user has clicked on Yes or OkclientData
- data specified in the askQuestion methodLyViewManager.askQuestion(leon.view.LyComponent, String,
LyQuestionAnswerInterface, Object)
public java.lang.String checkControllerId(LyController controller, java.lang.String id)
checkControllerId
in interface LySessionBehaviorInterface
controller
- The new controller.id
- Desired id.
public void controllerAdded(LySession session, LyController controller)
controllerAdded
in interface LySessionBehaviorInterface
session
- Session in which a controller is added.controller
- Controller added to the session.public void controllerRemoved(LySession session, LyController controller)
controllerRemoved
in interface LySessionBehaviorInterface
session
- Session in which a controller is removed.controller
- Controller removed from the session.public void viewControllerShown(LySession session, LyViewController viewController)
viewControllerShown
in interface LySessionBehaviorInterface
session
- the sessionviewController
- The view controller that is shown.public void viewControllerHidden(LySession session, LyViewController viewController)
viewControllerHidden
in interface LySessionBehaviorInterface
session
- the sessionviewController
- The view controller that is hidden.public boolean validateAction(LySession session, LyAction action, LyController controller)
validateAction
in interface LySessionBehaviorInterface
session
- the current sessionaction
- the action to validatecontroller
- the controller for this action
public boolean enableAction(LySession session, LyAction action, LyController controller, LyObjectList objects, boolean showError)
enableAction
in interface LySessionBehaviorInterface
session
- the current sessionaction
- the action to enablecontroller
- the controller for this actionobjects
- list of objects on which the action has to be enabledshowError
- report an error if the action is not enabled
public boolean enableTransverseAction(LySession session, LyAction action, LyClassInfo classInfo, LyController controller, LyObjectList objects, boolean showError)
enableAction(session, action, controller, objects,
showError)
and returns its result.
enableTransverseAction
in interface LySessionBehaviorInterface
session
- the current sessionaction
- the action to enableclassInfo
- the classInfo in which the action is checkedcontroller
- the controller for this actionobjects
- list of objects on which the action has to be enabledshowError
- report an error if the action is not enabled
public boolean invokeExtraAction(LySession session, LyController controller, LyAction action, LyClassInfo classInfo, LyObjectList objects, boolean show)
invokeExtraAction
in interface LySessionBehaviorInterface
session
- the current sessioncontroller
- the source controlleraction
- the action to executeclassInfo
- class on which the action appliesobjects
- list of objects on which the action appliesshow
- indicates if the action must be shown or not
public LyController invokeAction(LySession session, LyController controller, LyAction action, LyClassInfo classInfo, LyObjectList objects, boolean show)
invokeAction
in interface LySessionBehaviorInterface
session
- the current sessioncontroller
- the source controlleraction
- the action to executeclassInfo
- class on which the action appliesobjects
- list of objects on which the action appliesshow
- indicates if the action must be shown or not
public int getSessionTimeout(LySession session)
getSessionTimeout
in interface LySessionBehaviorInterface
session
- the current session
public LyController getRootContextController(LySession session)
getRootContextController
in interface LySessionBehaviorInterface
session
- the current session
public void sessionTimeout(LySession session)
sessionTimeout
in interface LySessionBehaviorInterface
session
- the current sessionpublic void showAbout(LySession session, LyController parent)
logs out
the 'about' message otherwise.
showAbout
in interface LySessionBehaviorInterface
session
- the current sessionparent
- the parent controllerpublic void showHelp(LySession session, LyController parent)
showHelp
in interface LySessionBehaviorInterface
session
- the current sessionparent
- the parent controllerpublic void showVersion(LySession session, LyController parent)
logs out
the 'version' message otherwise.
showVersion
in interface LySessionBehaviorInterface
session
- the current sessionparent
- the parent controllerpublic boolean handleDemand(LySession session, LyController controller, LyDemand demand)
handleDemand
in interface LySessionBehaviorInterface
session
- the current sessioncontroller
- controller that routed the demand.demand
- demand parameters sent by the view component.
public LyController findExistingController(LySession session, LyController parent, LyAction action, LyClassInfo classInfo, LyObjectList objects, boolean recurseAllSessions)
findExistingController
in interface LySessionBehaviorInterface
session
- the current sessionparent
- 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 into all sessions of the application.
invokeAction(leon.app.LySession, leon.control.LyController, leon.info.LyAction, leon.info.LyClassInfo, leon.data.LyObjectList, boolean)
public java.lang.String getHelpFile(LySession session, LyController controller, LyAction action)
getHelpFile
in interface LySessionBehaviorInterface
session
- the current session.controller
- the controller of the action.action
- the action for which the helpfile is required.
public void showLog(LySession session, LyController controller)
showLog
in interface LySessionBehaviorInterface
session
- the current sessioncontroller
- the parent controller
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |