Class SubscribeAction
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.acting.AbstractAction
-
- org.apache.cocoon.acting.ServiceableAction
-
- org.ametys.plugins.newsletter.subscribe.SubscribeAction
-
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
,Action
public class SubscribeAction extends ServiceableAction
This action subscribes an email address to a newsletter
-
-
Field Summary
Fields Modifier and Type Field Description protected CategoryProviderExtensionPoint
_categoryProviderEP
The category providers managerprotected PageHelper
_pageHelper
Page helperprotected AmetysObjectResolver
_resolver
The Ametys object resolverprotected SiteConfigurationExtensionPoint
_siteConfiguration
The site configurationprotected SubscribersDAO
_subscribersDao
The subscribers DAOstatic Pattern
EMAIL_PATTERN
The email pattern-
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 SubscribeAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Category
_getCategory(String categoryID)
Get the categoryprotected boolean
_validCategory(String[] categories)
Determines if the categories are validprotected boolean
_validEmail(String email)
Determines if the email address is validMap
act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters)
void
service(ServiceManager smanager)
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
EMAIL_PATTERN
public static final Pattern EMAIL_PATTERN
The email pattern
-
_subscribersDao
protected SubscribersDAO _subscribersDao
The subscribers DAO
-
_categoryProviderEP
protected CategoryProviderExtensionPoint _categoryProviderEP
The category providers manager
-
_siteConfiguration
protected SiteConfigurationExtensionPoint _siteConfiguration
The site configuration
-
_resolver
protected AmetysObjectResolver _resolver
The Ametys object resolver
-
_pageHelper
protected PageHelper _pageHelper
Page helper
-
-
Constructor Detail
-
SubscribeAction
public SubscribeAction()
-
-
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) throws Exception
- Throws:
Exception
-
_validEmail
protected boolean _validEmail(String email)
Determines if the email address is valid- Parameters:
email
- The email address- Returns:
- true if the email is valid
-
_validCategory
protected boolean _validCategory(String[] categories)
Determines if the categories are valid- Parameters:
categories
- The categories id- Returns:
- true if the categories are valid
-
_getCategory
protected Category _getCategory(String categoryID)
Get the category- Parameters:
categoryID
- The category id- Returns:
- the category
-
-