public class ImportSubscribersAction extends ServiceableAction
Modifier and Type | Field and Description |
---|---|
private static Pattern |
__EMAIL_VALIDATOR |
private static String[] |
_ALLOWED_EXTENSIONS |
protected CategoryProviderExtensionPoint |
_categoryProviderEP
The category provider extension point.
|
protected SubscribersDAO |
_subscribersDao
The subscribers DAO.
|
manager
EMPTY_MAP
Constructor and Description |
---|
ImportSubscribersAction() |
Modifier and Type | Method and Description |
---|---|
Map |
act(Redirector redirector,
SourceResolver resolver,
Map objectModel,
String source,
Parameters parameters) |
protected Collection<String> |
getEmails(BOMInputStream bomIS)
Extract the emails from the file.
|
protected void |
insertSubscribers(Collection<String> emails,
String categoryId,
String siteName,
Map<String,String> result)
Insert subscribers
|
void |
service(ServiceManager smanager) |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
private static final String[] _ALLOWED_EXTENSIONS
private static final Pattern __EMAIL_VALIDATOR
protected SubscribersDAO _subscribersDao
protected CategoryProviderExtensionPoint _categoryProviderEP
public ImportSubscribersAction()
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
service
in class ServiceableAction
ServiceException
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception
Exception
protected Collection<String> getEmails(BOMInputStream bomIS) throws IOException
bomIS
- the input streamIOException
- if an error occurs reading the file.protected void insertSubscribers(Collection<String> emails, String categoryId, String siteName, Map<String,String> result)
emails
- the emails to insertcategoryId
- the id of categorysiteName
- the site name of categoryresult
- the result map