public class SubscribersClientSideElement extends StaticClientSideElement
ClientSideElement.Script, ClientSideElement.ScriptFile
Modifier and Type | Field and Description |
---|---|
private static Pattern |
__EMAIL_VALIDATOR |
protected CategoryProviderExtensionPoint |
_categoryProviderEP
The category provider extension point.
|
protected SubscribersDAO |
_subscribersDao
The subscribers DAO.
|
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script
Constructor and Description |
---|
SubscribersClientSideElement() |
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
addSubscribers(String siteName,
String categoryId,
String emailsList)
Add a list of subscribers to the newsletter category of the specified site
|
protected Collection<String> |
getEmails(String emailsList)
Extract the emails from the field.
|
protected void |
insertSubscribers(Collection<String> emails,
String categoryId,
String siteName,
Map<String,Object> result)
Insert subscribers
|
Map<String,Object> |
removeSubscribers(String siteName,
String categoryId,
List<String> emails)
Remove a list of subscribers from the newsletter category of the specified site
|
void |
service(ServiceManager smanager) |
_configureClass, _configureParameters, _configureScript, configureInitialParameters
_configureDependencies, _configureImports, _configureRights, _configureRightsMode, configure, getDependencies, getId, getPluginName, getRights, getScripts, getScripts, hasRight, setPluginInfo, toString
getLogger, setLogger
private static final Pattern __EMAIL_VALIDATOR
protected SubscribersDAO _subscribersDao
protected CategoryProviderExtensionPoint _categoryProviderEP
public SubscribersClientSideElement()
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
service
in class StaticFileImportsClientSideElement
ServiceException
public Map<String,Object> addSubscribers(String siteName, String categoryId, String emailsList)
siteName
- The site namecategoryId
- The category idemailsList
- The list of emails. Emails can be separeted by a new line or a semicolon.protected Collection<String> getEmails(String emailsList)
emailsList
- the list of emailsprotected void insertSubscribers(Collection<String> emails, String categoryId, String siteName, Map<String,Object> result)
emails
- the list of emailscategoryId
- the id of the newsletter categorysiteName
- the name of the sitesresult
- the result mappublic Map<String,Object> removeSubscribers(String siteName, String categoryId, List<String> emails)
siteName
- The site namecategoryId
- The category idemails
- The list of emails.