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
public class MessagingConnectorAction extends ServiceableAction
This class is the action used by the messaging connector plugin. It uses the correct mail server component.
-
-
Field Summary
Fields Modifier and Type Field Description protected static Map<Locale,DateFormat>
__DATETIME_FORMATS
Date format cache for different locale (date and time)protected static Map<Locale,DateFormat>
__TIME_FORMATS
Date format cache for different locale (time only)protected CurrentUserProvider
_currentUserProvider
The current user providerprotected String
_mailServerId
mailServer selectedprotected MessagingConnector
_messagingConnector
The messaging connector that will be usedprotected UserManager
_usersManager
The user managerprotected static DateFormat
DATE_FORMAT
The output date format.private static String
MAX_DAYS
The max days parameter from the URLprivate static String
MAX_EVENTS
The max events parameter from the URL-
Fields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
-
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
-
-
Constructor Summary
Constructors Constructor Description MessagingConnectorAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
_getFormattedDate(Date date, Locale locale)
Format a Date to a String using a locale to set the correct dateMap
act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters)
protected List<Map<String,Object>>
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
getLocale(Request request, Map objectModel)
Get the current localevoid
service(ServiceManager smanager)
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
__DATETIME_FORMATS
protected static final Map<Locale,DateFormat> __DATETIME_FORMATS
Date format cache for different locale (date and time)
-
__TIME_FORMATS
protected static final Map<Locale,DateFormat> __TIME_FORMATS
Date format cache for different locale (time only)
-
DATE_FORMAT
protected static final DateFormat DATE_FORMAT
The output date format.
-
MAX_DAYS
private static final String MAX_DAYS
The max days parameter from the URL- See Also:
- Constant Field Values
-
MAX_EVENTS
private static final String MAX_EVENTS
The max events parameter from the URL- See Also:
- Constant Field Values
-
_mailServerId
protected String _mailServerId
mailServer selected
-
_currentUserProvider
protected CurrentUserProvider _currentUserProvider
The current user provider
-
_usersManager
protected UserManager _usersManager
The user manager
-
_messagingConnector
protected MessagingConnector _messagingConnector
The messaging connector that will be used
-
-
Constructor Detail
-
MessagingConnectorAction
public MessagingConnectorAction()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- 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
protected Locale getLocale(Request request, Map objectModel)
Get the current locale- Parameters:
request
- The requestobjectModel
- The object model- Returns:
- the locale to use
-
eventsToJson
protected List<Map<String,Object>> 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.- Parameters:
events
- the events to be displayedlocale
- the locale of the user- Returns:
- A list of Maps destined for Json
-
_getFormattedDate
protected String _getFormattedDate(Date date, Locale locale)
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
-
-