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
FieldsModifier and TypeFieldDescriptionprotected SurveyAnswerDaoThe ametys object resolver.static final StringAvalon role -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCookieName(Request request, Survey survey) Return the name of cookie if the survey was already taken ornullotherwise.getSubmissionDate(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 Details
-
ROLE
Avalon role -
_answerDao
The ametys object resolver.
-
-
Constructor Details
-
SurveyAccessHelper
public SurveyAccessHelper()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
getSubmissionDate
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
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.
-