Class MessagingConnectorAction
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.acting.AbstractAction
org.apache.cocoon.acting.ServiceableAction
org.ametys.plugins.messagingconnector.MessagingConnectorAction
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
,Action
This class is the action used by the messaging connector plugin.
It uses the correct mail server component.
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final Map<Locale,
DateFormat> Date format cache for different locale (date and time)protected static final Map<Locale,
DateFormat> Date format cache for different locale (time only)protected CurrentUserProvider
The current user providerprotected I18nUtils
The I18N utilsprotected String
mailServer selectedprotected MessagingConnector
The messaging connector that will be usedprotected UserManager
The user managerprotected static final DateFormat
The output date format.Fields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
_getFormattedDate
(Date date, Locale locale) Format a Date to a String using a locale to set the correct dateact
(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) eventsToJson
(List<CalendarEvent> events, Locale locale) This methods is used to create a List with all the correct informations in order to be displayed by the plugin.protected Locale
Get the current localevoid
service
(ServiceManager smanager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
__DATETIME_FORMATS
Date format cache for different locale (date and time) -
__TIME_FORMATS
Date format cache for different locale (time only) -
DATE_FORMAT
The output date format. -
_mailServerId
mailServer selected -
_currentUserProvider
The current user provider -
_usersManager
The user manager -
_messagingConnector
The messaging connector that will be used -
_i18nUtils
The I18N utils
-
-
Constructor Details
-
MessagingConnectorAction
public MessagingConnectorAction()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableAction
- Throws:
ServiceException
-
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) -
getLocale
Get the current locale- Parameters:
request
- The requestobjectModel
- The object model- Returns:
- the locale to use
-
eventsToJson
This methods is used to create a List with all the correct informations in order to be displayed by the plugin.- Parameters:
events
- the events to be displayedlocale
- the locale of the user- Returns:
- A list of Maps destined for Json
-
_getFormattedDate
Format a Date to a String using a locale to set the correct date- Parameters:
date
- the date to formatlocale
- the locale of the user- Returns:
- The date formated with the given locale
-