LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.control
Class LyLoginController

java.lang.Object
  extended by leon.control.LyController
      extended by leon.control.LyAreaController
          extended by leon.control.LyUserInputController
              extended by leon.control.LyLoginController
All Implemented Interfaces:
LyGetSessionInterface, LyContextInterface, LyGetActionInterface, LySelectFileListenerInterface, LyGuiListener, LyInfoListener, LyEvaluator, LyDemandListener, LyAnswerInterface, LyQuestionAnswerInterface

public class LyLoginController
extends LyUserInputController
implements LyQuestionAnswerInterface

The login controller is an user input controller which describes a login view This controller handles:

The login controller is associated to a behavior which implements LyLoginBehaviorInterface. Usually, this interface is implemented by a LyLoginBehavior class.

See Also:
LyUserInputController, LyLoginBehaviorInterface, LyLoginBehavior

Nested Class Summary
static class LyLoginController.Status
          Define the status of the login
 
Field Summary
static java.lang.String __VERSION
          File Version
static int DEFAULT_COLS
          Default width of string input fields.
static java.lang.String PARAM_KEY_LANGUAGE
          parameter key for language value (received in parameter values).
static java.lang.String PARAM_KEY_LOGIN
          parameter key for login value (received in parameter values).
static java.lang.String PARAM_KEY_PASSWORD
          parameter key for password value (received in parameter values).
static java.lang.String PARAM_KEY_PORTLET_LOGIN
          parameter key for portlet login value
static java.lang.String PARAM_KEY_TARGET
          parameter key for target value (must match LyWebConstants.TARGET_PARAM).
static java.lang.String USER_CLASS_ID
          Default id for user class.
 
Fields inherited from class leon.control.LyAreaController
DEFAULT_MENU_ITEM_IMAGE_SIZE, DEMAND_APPLY, DEMAND_CANCEL, DEMAND_CLOSE, DEMAND_CREATE_CHART, DEMAND_DELETE_CHART, DEMAND_DELETE_OBJECTINFOS, DEMAND_DELETE_PREFERENCE, DEMAND_UPDATE_VIEW, DEMAND_VALIDATE
 
Fields inherited from class leon.control.LyController
_nbControllers, _nextId, CONTROLLER_ID_SEP, DEFAULT_IMAGE_FORMAT, DEMAND_HELP, ID_SEP
 
Constructor Summary
LyLoginController(LySession session, LyController parent, LyAction action, LyClassInfo classInfo, LyObjectList context)
          Constructor.
 
Method Summary
 void actionDemand(LyActionDemand demand)
          Invoked when an action occurs.
 boolean checkLogin(LyParameterValues values)
          This method checks if the login entered by the user is valid.
 void close()
          This method handles closing of the login controller.
 java.lang.Class<?> getBehaviorInterface()
          Method that gives the interface that must be implemented by the behavior associated to this controller.
 LyComponent getComponent()
          Accessor to the view component instance.
 LyAction getCreateAction()
          Get creation action if it is enabled in login form.
 LyFieldInfo getLoginFieldInfo()
          Accessor to the login field in userClassInfo.
 LyFieldInfo getPasswordFieldInfo()
          Accessor to password fieldInfo.
 LyLoginController.Status getStatus()
          Indicates login status : to know if login was successful.
 LyObject getUser()
          Gets user connected on current session (through login or with SSO).
 LyClassInfo getUserClassInfo()
          Accessor to User classInfo.
 int getUserRetries()
          Indicates how many times the user has tried to log in.
 void invokeNextActions()
          Proceed to next actions after a login (login should be valid at that point).
 void loginWithUser(LyObject user)
          Complete login with given user.
 void questionAnswer(boolean result, java.lang.Object clientData)
          Called when the user answer about reconnecting to an existing session
 void setLoginFieldInfo(LyFieldInfo loginFieldInfo)
          Accessor to Login fieldInfo (attribute).
 void setPasswordFieldInfo(LyFieldInfo passwordFieldInfo)
          Accessor to password fieldInfo.
 void setUserClassInfo(LyClassInfo userClassInfo)
          Accessor to User classInfo.
 void showView()
          Shows the Window which contains the view.
 
Methods inherited from class leon.control.LyUserInputController
addBoolean, addBoolean, addChoice, addChoice, addDate, addDate, addFile, addFile, addLabel, addLabel, addList, addList, addNumber, addNumber, addRelation, addRelation, addText, addText, addText, getClassInfo, getFormComponent, getImage, getInputId, getTitleBar, getViewController, isDialog, isViewResizable, reset, setBehavior, setBuilder, setDialog, setImage, setInputId, setTitleBar
 
Methods inherited from class leon.control.LyAreaController
canClose, canFree, clearViewCache, completeMenuBar, completeMessages, free, free, getAction, getAreaStackController, getBehavior, getBuilder, getContent, getContext, getContextClient, getContextTitle, getDefaultAction, getEnvironment, getFastEditionAction, getHelpFile, getImageTooltip, getInfoLabel, getInfoLabel, getKeyValue, getLabel, getLastModified, getMenuItemImage, getName, getParameter, getParameter, getParameterMarks, getParent, getParent, getParentAreaController, getRefreshTime, getSelection, getShortLabel, getTarget, getTitle, getViewController, hasMark, hasNotMark, hasViewController, hideView, infoEvent, initialize, isInitialized, isOutlined, menuDemand, reset, selectFileDemand, setContext, setContext, setContextClient, setIdle, setPreference, setViewController, showView, testParameter, toString, update, updateTitleBar
 
Methods inherited from class leon.control.LyController
activateViewDemand, demandPerformed, dragDropDemand, getApplication, getClassInfo, getId, getImage, getImage, getImage, getImage, getImageFromPrefix, getImageFromPrefix, getImageFromPrefix, getName, getObjectId, getSession, getUserData, getView, getViewManager, helpDemand, hideView, isFreed, isIdle, selectionDemand, setBuilderClass, setLastModified, setName, setUserData, showError, showError, showWarning, updateViewFromValues
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File Version

See Also:
Constant Field Values

USER_CLASS_ID

public static java.lang.String USER_CLASS_ID
Default id for user class.


DEFAULT_COLS

public static int DEFAULT_COLS
Default width of string input fields.


PARAM_KEY_LOGIN

public static java.lang.String PARAM_KEY_LOGIN
parameter key for login value (received in parameter values).


PARAM_KEY_PASSWORD

public static java.lang.String PARAM_KEY_PASSWORD
parameter key for password value (received in parameter values).


PARAM_KEY_LANGUAGE

public static java.lang.String PARAM_KEY_LANGUAGE
parameter key for language value (received in parameter values).


PARAM_KEY_TARGET

public static java.lang.String PARAM_KEY_TARGET
parameter key for target value (must match LyWebConstants.TARGET_PARAM).


PARAM_KEY_PORTLET_LOGIN

public static java.lang.String PARAM_KEY_PORTLET_LOGIN
parameter key for portlet login value

Constructor Detail

LyLoginController

public LyLoginController(LySession session,
                         LyController parent,
                         LyAction action,
                         LyClassInfo classInfo,
                         LyObjectList context)
Constructor.

Parameters:
session - current session associated to the controller. The controller automatically registers on the specified session.
parent - parent controller (or null for 'root' controller).
action - related action (_login).
classInfo - related classInfo
context - current action context. This context is used for the next actions.
Method Detail

getBehaviorInterface

public java.lang.Class<?> getBehaviorInterface()
Method that gives the interface that must be implemented by the behavior associated to this controller.

Overrides:
getBehaviorInterface in class LyUserInputController
Returns:
Class representing the behavior interface of this controller.

showView

public void showView()
Shows the Window which contains the view.

Overrides:
showView in class LyAreaController

getStatus

public LyLoginController.Status getStatus()
Indicates login status : to know if login was successful.

Returns:
one of the Status.xxx constants

getUserRetries

public int getUserRetries()
Indicates how many times the user has tried to log in.

Returns:
a number between 0 and _maxLoginRetry

getComponent

public LyComponent getComponent()
Accessor to the view component instance. (XML description of the view) This instance is created by the builder, and multiple calls to this method always return the same instance.

Overrides:
getComponent in class LyUserInputController
Returns:
the LyComponent instance of the view package, memory representation (parsed) of the XML description of the view.

checkLogin

public boolean checkLogin(LyParameterValues values)
This method checks if the login entered by the user is valid. It increments the retries counter and use the login method to check the value

Parameters:
values - The values entered by the user
Returns:
true if login is successfull

invokeNextActions

public void invokeNextActions()
Proceed to next actions after a login (login should be valid at that point).


close

public void close()
This method handles closing of the login controller. It is called when the user presses the cancel button.


getUserClassInfo

public LyClassInfo getUserClassInfo()
Accessor to User classInfo.

Returns:
User classInfo

getLoginFieldInfo

public LyFieldInfo getLoginFieldInfo()
Accessor to the login field in userClassInfo.

Returns:
login fieldInfo

getPasswordFieldInfo

public LyFieldInfo getPasswordFieldInfo()
Accessor to password fieldInfo.

Returns:
password fieldInfo

setUserClassInfo

public void setUserClassInfo(LyClassInfo userClassInfo)
Accessor to User classInfo.

Parameters:
userClassInfo - User classInfo

setLoginFieldInfo

public void setLoginFieldInfo(LyFieldInfo loginFieldInfo)
Accessor to Login fieldInfo (attribute).

Parameters:
loginFieldInfo - Login fieldInfo

setPasswordFieldInfo

public void setPasswordFieldInfo(LyFieldInfo passwordFieldInfo)
Accessor to password fieldInfo.

Parameters:
passwordFieldInfo - password fieldInfo

actionDemand

public void actionDemand(LyActionDemand demand)
Invoked when an action occurs.

Overrides:
actionDemand in class LyUserInputController
Parameters:
demand - demand parameters sent by the view component.
See Also:
LyController.demandPerformed(leon.view.event.LyDemand)

questionAnswer

public void questionAnswer(boolean result,
                           java.lang.Object clientData)
Called when the user answer about reconnecting to an existing session

Specified by:
questionAnswer in interface LyQuestionAnswerInterface
Parameters:
result - the result (true or false)
clientData - an array of object: 0 an existing session, 1 view values
See Also:
LyQuestionAnswerInterface

getUser

public LyObject getUser()
Gets user connected on current session (through login or with SSO).

Returns:
The user connected by the login controller, null if not connected or invalid login.

loginWithUser

public void loginWithUser(LyObject user)
Complete login with given user.

Parameters:
user - User to log in.

getCreateAction

public LyAction getCreateAction()
Get creation action if it is enabled in login form.

Returns:
The action to be used for create a new user, null if it doesn't exist or if not enabled.

(c) January 2013 - W4 S.A.

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