|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ISurveyLogin
Interface for the survey login functionality.
A class that implements this interface will be called if the login for this
plugin is enabled in the survey.
Method Summary | |
---|---|
boolean |
checkLogin(long surveyId,
java.util.HashMap Resources)
Validates the login. |
java.lang.String |
getLoginScreen(long surveyId,
java.util.HashMap resources)
Gets the login screen for the survey. |
Method Detail |
---|
java.lang.String getLoginScreen(long surveyId, java.util.HashMap resources)
Name: <input type=text name=plugin_login length=10><br> Password: <input type=password name=plugin_pw length=10> <input type=submit value="login" name=plugin_loginButton>As can be seen from this example code, all input field names must start with "plugin". This is to avoid any conflicts with any fields produced by Opinio. The example includes two fields: "plugin_login" and "plugin_pw". When The user enters the values and clicks the button (must also be provided in the code), Opinio will receive the form and return it through a call to the checkLogin() method of this interface. It is then up to the plugin to validate the login by returning true/false.
surveyId
- Id of the surveyresources
- This HashMap contains both the HttpRequest and HttpResponse
objects, if the current survey is web based. In future versions,
other types of objects must be retrieved, if other protocols
are used - WAP, for example. The HTTP objects must be retrieved this way:HttpRequest request = (HttpRequest) resources.get("HttpRequest"); -- or -- HttpResponse response = (HttpResponse) resources.get("HttpResponse");Then these objects should contain the values needed to display the login screen. In most cases, no values are needed at all, but you may want to display some default login name from a cookie, for example.
boolean checkLogin(long surveyId, java.util.HashMap Resources)
surveyId
- Id of the surveyResources
- This HashMap contains both the HttpRequest and HttpResponse
objects, if the current survey is web based. In future versions,
other types of objects must be retrieved, if other protocols
are used - WAP, for example. The HTTP objects must be retrieved this way:HttpRequest request = (HttpRequest) resources.get("HttpRequest"); -- or -- HttpResponse response = (HttpResponse) resources.get("HttpResponse");Then these objects should contain the values needed validate the login, by retrieving the login/pw from the request object, and validating it towards an LDAP directory, for example.
|
Copyright ? ObjectPlanet Inc. All Rights Reserved. | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |