Package org.ametys.plugins.sms.dao
Class SmsListDAO
- java.lang.Object
-
- org.ametys.plugins.sms.dao.SmsListDAO
-
- All Implemented Interfaces:
Component
,Serviceable
public class SmsListDAO extends Object implements Serviceable, Component
DAO for manipulating SMS subscribers lists.
-
-
Field Summary
Fields Modifier and Type Field Description protected AmetysObjectResolver
_resolver
The object resolverprotected RightManager
_rightManager
The right managerprivate SiteManager
_siteManager
The site managerprotected SubscriberDAO
_subscriberDAO
The subscriber DAOprotected CurrentUserProvider
_userProvider
The user providerstatic String
ROLE
The Avalon role
-
Constructor Summary
Constructors Constructor Description SmsListDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private TraversableAmetysObject
_getRootNode(String sitename, String lang)
Map<String,String>
createList(String title, String description, String siteName, String language)
Creates a new SMS subscribers list.Map<String,String>
deleteLists(ArrayList<String> ids)
Deletes the given SMS subscribers lists.Map<String,String>
editList(String id, String title, String description, String language)
Edits a given SMS subscribers list.Map<String,Object>
getListsProperties(List<String> listIds)
Get the properties of given subscribers listsList<JCRSubscribersList>
getSubscribersLists(String siteName, String lang)
Get all the sms listvoid
service(ServiceManager manager)
-
-
-
Field Detail
-
_resolver
protected AmetysObjectResolver _resolver
The object resolver
-
_rightManager
protected RightManager _rightManager
The right manager
-
_userProvider
protected CurrentUserProvider _userProvider
The user provider
-
_subscriberDAO
protected SubscriberDAO _subscriberDAO
The subscriber DAO
-
_siteManager
private SiteManager _siteManager
The site manager
-
-
Constructor Detail
-
SmsListDAO
public SmsListDAO()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
createList
public Map<String,String> createList(String title, String description, String siteName, String language) throws Exception
Creates a new SMS subscribers list.- Parameters:
title
- The title of the new list.description
- The description of the new list.siteName
- The site name.language
- The language.- Returns:
- The id of the created list, or an empty map if nothing was created.
- Throws:
Exception
- if an error occurs during the list creation process
-
editList
public Map<String,String> editList(String id, String title, String description, String language)
Edits a given SMS subscribers list.- Parameters:
id
- the id of the list to edit.title
- The new title of the list.description
- The new description of the list.language
- The language.- Returns:
- The id of the edited list, or an empty map if nothing was edited.
-
deleteLists
public Map<String,String> deleteLists(ArrayList<String> ids)
Deletes the given SMS subscribers lists.- Parameters:
ids
- the ids of the lists to delete.- Returns:
- An empty map.
-
getListsProperties
public Map<String,Object> getListsProperties(List<String> listIds)
Get the properties of given subscribers lists- Parameters:
listIds
- The ids of lists- Returns:
- the properties of SMS subscribers lists in a result map
-
getSubscribersLists
public List<JCRSubscribersList> getSubscribersLists(String siteName, String lang) throws RepositoryException
Get all the sms list- Parameters:
siteName
- the name of the sitelang
- the language- Returns:
- A list of JCR object (sms-list)
- Throws:
RepositoryException
- if an error occurs while manipulating the repository
-
_getRootNode
private TraversableAmetysObject _getRootNode(String sitename, String lang) throws RepositoryException
- Throws:
RepositoryException
-
-