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 ObservationManager
Observer manager.protected AmetysObjectResolver
Ametys object resolver.static 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. -
_formDAO
The form DAO -
_currentUserProvider
The current user provider -
_observationManager
Observer manager.
-
-
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
-