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
Modifier and TypeFieldDescriptionprotected SurveyAnswerDao
The ametys object resolver.static final String
Avalon role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetCookieName
(Request request, Survey survey) Return the name of cookie if the survey was already taken ornull
otherwise.getSubmissionDate
(String surveyId, UserIdentity user) Returns the date on which the user answered to the survey ornull
if he was never answeredvoid
service
(ServiceManager manager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
ROLE
Avalon role -
_answerDao
The ametys object resolver.
-
-
Constructor Details
-
SurveyAccessHelper
public SurveyAccessHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getSubmissionDate
Returns the date on which the user answered to the survey ornull
if he was never answered- Parameters:
surveyId
- the survey ID.user
- the user.- Returns:
- the date on which the survey was taken, or
null
if the user never took the survey.
-
getCookieName
Return the name of cookie if the survey was already taken ornull
otherwise.- Parameters:
request
- the request.survey
- the survey.- Returns:
- the name of cookie if the survey was already taken, or
null
otherwise.
-