com.objectplanet.survey.plugin.interfaces
Interface ILogin


public interface ILogin

Interface for the login functionality.

A class that implements this interface will be called instead of default login to the admin screens. isLoginVisible() method tells if login screen should be visible to the user. If so, entered login name and password will be sent to getUserId() method when the "Login"- button is clicked. If isLoginVisible() returns false, getUserId() will be called directly with both name and password set to null.

getUserId() should return id of an existing user (a user registered in Opinio).

Author:
Irina Brun

Method Summary
 long getUserId(java.lang.String loginName, java.lang.String password)
          Gets id of the user to login to the system.
 boolean isLoginVisible()
          True if login screen is visible to the user.
 void setRequest(javax.servlet.http.HttpServletRequest request)
          Sets the request object.
 void setResponse(javax.servlet.http.HttpServletResponse response)
          Sets the response object.
 

Method Detail

getUserId

long getUserId(java.lang.String loginName,
               java.lang.String password)
Gets id of the user to login to the system. If isLoginVisible() returns true, the login screen will be shown to the user. When the user clicks the "Login" button, this method will be called with login name and password as parameters.

Parameters:
loginName - Login name entered (if login screen is visible) or null.
password - Password entered (if login screen is visible) or null.
Returns:
Returns id of the user registered in the survey system. If the user does not exist, the login screen will be shown with an error message.

isLoginVisible

boolean isLoginVisible()
True if login screen is visible to the user.

Returns:
The loginVisible value

setResponse

void setResponse(javax.servlet.http.HttpServletResponse response)
Sets the response object. This method will be called before calling getUserId().

Parameters:
response - The response

setRequest

void setRequest(javax.servlet.http.HttpServletRequest request)
Sets the request object. This method will be called before calling getUserId().

Parameters:
request - The request

Copyright ? ObjectPlanet Inc. All Rights Reserved.

Built on December 20 2016