Package org.ametys.plugins.forms.helper
Class ScheduleOpeningHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.forms.helper.ScheduleOpeningHelper
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
The helper to schedule opening of form
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected CurrentUserProvider
The current user providerprotected FormDAO
The form DAOprotected FormMailHelper
The form mail helperprotected AmetysObjectResolver
Ametys object resolver.protected UserManager
The users managerstatic final String
Avalon ROLE. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetScheduledDates
(String formId) Get the scheduled dates of a formGet the opening status of the formvoid
service
(ServiceManager manager) boolean
setScheduledDate
(String formId, String startDateAsStr, String endDateAsStr) Set date of publication of formMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
Avalon ROLE. -
_resolver
Ametys object resolver. -
_userManager
The users manager -
_formMailHelper
The form mail helper -
_formDAO
The form DAO -
_currentUserProvider
The current user provider
-
-
Constructor Details
-
ScheduleOpeningHelper
public ScheduleOpeningHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getScheduledDates
Get the scheduled dates of a form- Parameters:
formId
- the id of the form- Returns:
- a map with start date and end date
-
setScheduledDate
Set date of publication of form- Parameters:
formId
- The form idstartDateAsStr
- The start date. Can be null.endDateAsStr
- The end date. Can be null.- Returns:
- true if operation has succeeded.
-
getStatus
Get the opening status of the form- Parameters:
form
- the form- Returns:
- 'open', 'over', or 'coming' depending on today's date
-