LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.app.behavior
Class LyLoginBehavior

java.lang.Object
  extended by leon.app.behavior.LyBehavior
      extended by leon.app.behavior.LyActionBehavior
          extended by leon.app.behavior.LyLoginBehavior
All Implemented Interfaces:
LyActionBehaviorInterface, LyBehaviorInterface, LyLoginBehaviorInterface, LyUserInputBehaviorInterface, LyGetSessionInterface

public class LyLoginBehavior
extends LyActionBehavior
implements LyLoginBehaviorInterface, LyUserInputBehaviorInterface

Default behavior for the login behavior interface. Applications may override this class or implement their own instance of LyLoginBehaviorInterface

See Also:
LyLoginController, LyLoginBehaviorInterface

Field Summary
static java.lang.String __VERSION
          File version
 
Constructor Summary
LyLoginBehavior()
          Default constructor : must have no parameter to enable automatic creation of instance from meta-model files.
 
Method Summary
 void completeInitializeLogin(LyLoginController loginController)
          Complete login initialization with default values or extra fields adding for input.
 boolean confirmReconnect(LyLoginController loginController)
          Returns a boolean value that indicates if the reconnect must be confirmed or not.
 void endLogin(LyLoginController loginController, LyParameterValues values)
          Ends the login.
 LySession getExistingSessionForUser(LyLoginController loginController, LyObject currentUser, LyParameterValues values)
          Gets any existing session for the given user.
 LyObject getUser(LyLoginController loginController, LyParameterValues values)
          Gets the user associated to the given login and password values.
 void initializeLogin(LyLoginController loginController)
          Login initialization of manipulated classInfo, loginFieldInfo and passwordFieldInfo.
 void userInputDemand(LyController controller, LyDemand demand)
          Invoked when the user validates the input content.
 boolean validate(LyLoginController loginController, java.lang.String login, java.lang.String password, LyParameterValues values)
          Deprecated. since V1.2. Replaced by validate(loginController, login, password, values, new StringBuffer()) .
 boolean validate(LyLoginController loginController, java.lang.String login, java.lang.String password, LyParameterValues values, java.lang.StringBuffer error)
          Validate the login: checks that one unique user exists for the given values.
 boolean validateUser(LyLoginController loginController, LyObject user, LyParameterValues values, java.lang.StringBuffer error, boolean autoLogin)
          Validate the login: checks that user is valid.
 
Methods inherited from class leon.app.behavior.LyActionBehavior
endAction, getClientContext, getContextTitle, getHelpFile, getImage, getImageTooltip, getKeyValue, getMenuItemImage, getTitle, reset, startAction
 
Methods inherited from class leon.app.behavior.LyBehavior
free, getSession, handleDemand, init
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface leon.app.behaviorinterface.LyActionBehaviorInterface
endAction, getClientContext, getContextTitle, getHelpFile, getImage, getImageTooltip, getKeyValue, getMenuItemImage, getTitle, reset, startAction
 
Methods inherited from interface leon.app.behaviorinterface.LyBehaviorInterface
free, handleDemand, init
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File version

See Also:
Constant Field Values
Constructor Detail

LyLoginBehavior

public LyLoginBehavior()
Default constructor : must have no parameter to enable automatic creation of instance from meta-model files.

Method Detail

initializeLogin

public void initializeLogin(LyLoginController loginController)
Login initialization of manipulated classInfo, loginFieldInfo and passwordFieldInfo.
The default implementation does nothing, this initialization may be implemented in subclasses.

Specified by:
initializeLogin in interface LyLoginBehaviorInterface
Parameters:
loginController - current controller

completeInitializeLogin

public void completeInitializeLogin(LyLoginController loginController)
Complete login initialization with default values or extra fields adding for input.
The default implementation does nothing.

Specified by:
completeInitializeLogin in interface LyLoginBehaviorInterface
Parameters:
loginController - current controller

validate

public boolean validate(LyLoginController loginController,
                        java.lang.String login,
                        java.lang.String password,
                        LyParameterValues values)
Deprecated. since V1.2. Replaced by validate(loginController, login, password, values, new StringBuffer()) .

Validate the login.
This method is deprecated and only calls validate(LyLoginController, String, String, LyParameterValues, StringBuffer)

Specified by:
validate in interface LyLoginBehaviorInterface
Parameters:
loginController - current controller
login - value typed in by the user
password - value typed in by the user
values - extra values from the login controller validation.
Returns:
true if login is ok, false for default login tries

validate

public boolean validate(LyLoginController loginController,
                        java.lang.String login,
                        java.lang.String password,
                        LyParameterValues values,
                        java.lang.StringBuffer error)
Validate the login: checks that one unique user exists for the given values.

Specified by:
validate in interface LyLoginBehaviorInterface
Parameters:
loginController - current controller
login - value typed in by the user
password - value typed in by the user
values - extra values from the login controller validation.
error - error message to show in case of invalid login. It is a result parameter.
Returns:
true if login is valid, false otherwise

validateUser

public boolean validateUser(LyLoginController loginController,
                            LyObject user,
                            LyParameterValues values,
                            java.lang.StringBuffer error,
                            boolean autoLogin)
Validate the login: checks that user is valid.

Specified by:
validateUser in interface LyLoginBehaviorInterface
Parameters:
loginController - current controller
user - user that logged in.
values - extra values from the login controller validation.
error - error message to show in case of invalid login. It is a result parameter.
autoLogin - boolean indicating if the call results from an auto-login.
Returns:
true if login is valid, false otherwise

endLogin

public void endLogin(LyLoginController loginController,
                     LyParameterValues values)
Ends the login.
The default implementation closes user session if login is not valid (LyLoginController.Status#LOGIN_FAILED) or cancelled (LyLoginController.Status#LOGIN_CANCELLED) and if the login action is the root action, else if the login is ok or missing (LyLoginController.Status#LOGIN_OK or LyLoginController.Status#LOGIN_MISSING) then invoke the next action.

Specified by:
endLogin in interface LyLoginBehaviorInterface
Parameters:
loginController - current controller
values - extra values from the login controller validation.

getUser

public LyObject getUser(LyLoginController loginController,
                        LyParameterValues values)
Gets the user associated to the given login and password values.

Specified by:
getUser in interface LyLoginBehaviorInterface
Parameters:
loginController - current controller
values - values from the login controller.
Returns:
The object that represents the user corresponding to given parameters if found, null otherwise.

userInputDemand

public void userInputDemand(LyController controller,
                            LyDemand demand)
Invoked when the user validates the input content.
The default implementation checks the login if demand source is validate, closes it if demand source is cancel.

Specified by:
userInputDemand in interface LyUserInputBehaviorInterface
Parameters:
controller - the current LyUserInputController instance
demand - demand parameters sent by the view component.

getExistingSessionForUser

public LySession getExistingSessionForUser(LyLoginController loginController,
                                           LyObject currentUser,
                                           LyParameterValues values)
Gets any existing session for the given user.

Specified by:
getExistingSessionForUser in interface LyLoginBehaviorInterface
Parameters:
loginController - current controller
currentUser - the current user
values - the values of the current view
Returns:
a session with the current user as the logged-in user.

confirmReconnect

public boolean confirmReconnect(LyLoginController loginController)
Returns a boolean value that indicates if the reconnect must be confirmed or not.

Specified by:
confirmReconnect in interface LyLoginBehaviorInterface
Parameters:
loginController - the login controller
Returns:
true if the reconnection has to be confirmed by the user.

(c) January 2013 - W4 S.A.

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