|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.objectplanet.survey.plugin.api.Respondent
ATTENTION: This class is a
facade for the system business Respondent. To improve performance you can
force it to keep the reference to the business object by calling keepBusinessObject()
. Keeping references to objects may cause inconsistencies in the system, so
allways remember to call releaseBusinessObject()
as soon as you
are finished using them.
Respondent is an object that encapsulates information about users response
to a survey like entry date, last response, completed date and so on. Flag
isPersisted
is set to true if respondent is saved in the
storage.
To populate repondent object with user input (answers):
1) getResponse() to create new or get the existing response
2) set values to the response object (respondents answers)
3) call question.validate() method to validate the input
4) update current response: setCurrentResponse()
5) get the next question: getNextQuestion()
6) go to 1) and repeat until you reach the last question
7) store the respondent to the storage: SurveyManager.storeRespondent(). If
the respondent has answered all the questions (getNextQuestion() returns -1),
the completed date will be set and respondent will be removed from the
cache.
Method Summary | |
void |
deleteResponse(int questionNo)
Deletes a response. |
long |
getCompletedDate()
Gets the completed date |
int |
getCurrentResponse()
Gets the current response. |
long |
getEntryDate()
Gets the entry date |
java.lang.String |
getIpAddress()
Gets the ip address. |
int |
getLastResponse()
Gets the question number of last answered question. |
int |
getNextQuestion()
Gets the number of the next question (after current response). |
long |
getRespondentId()
Gets the respondent id |
Response |
getResponse(int questionNo)
Gets a question response. |
long |
getSurveyId()
Gets the survey id |
java.lang.String |
getTicket()
Gets the ticket value |
java.lang.String |
getUserData(int index)
Gets the userdata at a specified index. |
boolean |
hasBusinessObject()
Check if this question has reference to the business Respondent object. |
boolean |
isFilteredOut(int questionNo)
Check if question is filtered out by condition branching. |
boolean |
isPersisted()
Returns true if respondent is persisted (some of the respondent information/responses are saved in the storage). |
void |
keepBusinessObject()
Get and keep business object. |
void |
releaseBusinessObject()
Release business object. |
void |
setCurrentResponse(int currentResponse)
Sets the current response. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public java.lang.String getUserData(int index) throws SurveySystemException
index
- The index of the user data.
SurveySystemException
- If an error occurs in the system.public void setCurrentResponse(int currentResponse) throws java.lang.IllegalArgumentException, SurveySystemException
currentResponse
- The number of the question the
respondent is answering.
java.lang.IllegalArgumentException
- If invalid currentResponse
SurveySystemException
- If an error occurs in the system.public long getCompletedDate() throws SurveySystemException
SurveySystemException
- If an error occurs in the system.public int getCurrentResponse() throws SurveySystemException
SurveySystemException
- If an error occurs in the system.public long getEntryDate() throws SurveySystemException
SurveySystemException
- If an error occurs in the system.public java.lang.String getIpAddress() throws SurveySystemException
SurveySystemException
- If an error occurs in the system.public int getLastResponse() throws SurveySystemException
SurveySystemException
- If an error occurs in the system.public int getNextQuestion() throws SurveySystemException
SurveySystemException
- If an error occurs in the system.public long getRespondentId()
public Response getResponse(int questionNo) throws java.lang.IllegalArgumentException, SurveySystemException
questionNo
- Question number of response to get
java.lang.IllegalArgumentException
- If illegal question number
SurveySystemException
- If an error occurs in the system.public long getSurveyId()
public java.lang.String getTicket() throws SurveySystemException
SurveySystemException
- If an error occurs in the system.public boolean isFilteredOut(int questionNo) throws java.lang.IllegalArgumentException, SurveySystemException
questionNo
- Question number
java.lang.IllegalArgumentException
- If illegal question number
SurveySystemException
- If any error occurs in the system.public boolean isPersisted() throws SurveySystemException
SurveySystemException
- If an error occurs in the system.public void deleteResponse(int questionNo) throws SurveySystemException
questionNo
- Question number of response to remove.
SurveySystemException
- If an error occurs in the system.public boolean hasBusinessObject()
public void keepBusinessObject() throws SurveySystemException
SurveySystemException
- If an error occurs in the system.public void releaseBusinessObject()
|
Copyright © ObjectPlanet Inc. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |