Class SurveyAccessHelper
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.plugins.survey.repository.SurveyAccessHelper
-
- All Implemented Interfaces:
Component,LogEnabled,Serviceable,ThreadSafe
public class SurveyAccessHelper extends AbstractLogEnabled implements Component, ThreadSafe, Serviceable
helper to check survey access
-
-
Field Summary
Fields Modifier and Type Field Description protected SurveyAnswerDao_answerDaoThe ametys object resolver.static StringROLEAvalon role
-
Constructor Summary
Constructors Constructor Description SurveyAccessHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetCookieName(Request request, Survey survey)Return the name of cookie if the survey was already taken ornullotherwise.DategetSubmissionDate(String surveyId, UserIdentity user)Returns the date on which the user answered to the survey ornullif he was never answeredvoidservice(ServiceManager manager)-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_answerDao
protected SurveyAnswerDao _answerDao
The ametys object resolver.
-
-
Constructor Detail
-
SurveyAccessHelper
public SurveyAccessHelper()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
getSubmissionDate
public Date getSubmissionDate(String surveyId, UserIdentity user)
Returns the date on which the user answered to the survey ornullif he was never answered- Parameters:
surveyId- the survey ID.user- the user.- Returns:
- the date on which the survey was taken, or
nullif the user never took the survey.
-
getCookieName
public String getCookieName(Request request, Survey survey)
Return the name of cookie if the survey was already taken ornullotherwise.- Parameters:
request- the request.survey- the survey.- Returns:
- the name of cookie if the survey was already taken, or
nullotherwise.
-
-