Class CategoryDAO
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.plugins.newsletter.category.CategoryDAO
-
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
public class CategoryDAO extends AbstractLogEnabled implements Serviceable, Component
DAO for manipulating newsletter categories.
-
-
Field Summary
Fields Modifier and Type Field Description private CategoryProviderExtensionPoint
_categoryProviderEP
CategoryProviderprotected AmetysObjectResolver
_resolver
Ametys object resolverstatic String
ROLE
The Avalon role
-
Constructor Summary
Constructors Constructor Description CategoryDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>
applyTemplates(List<String> categoryIds, String template)
Applies a template to a given newsletter category.Map<String,String>
createCategory(String parentId, String title, String description, String siteName, String lang)
Creates a newsletter category.Map<String,String>
deleteCategory(String id)
Deletes a newsletter category.Map<String,String>
editCategory(String id, String title, String description)
Edits a newsletter category.List<Map<String,Object>>
getCategories(List<String> categoryIds)
Gets the properties of given categories.Map<String,Object>
getCategory(String categoryId)
Gets the properties of given categories.void
service(ServiceManager manager)
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_resolver
protected AmetysObjectResolver _resolver
Ametys object resolver
-
_categoryProviderEP
private CategoryProviderExtensionPoint _categoryProviderEP
CategoryProvider
-
-
Constructor Detail
-
CategoryDAO
public CategoryDAO()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
createCategory
public Map<String,String> createCategory(String parentId, String title, String description, String siteName, String lang)
Creates a newsletter category.- Parameters:
parentId
- The id of the parent of the future categorytitle
- The titledescription
- The descriptionsiteName
- The site namelang
- The language- Returns:
- The id and parentId of the created category, or an error
-
editCategory
public Map<String,String> editCategory(String id, String title, String description)
Edits a newsletter category.- Parameters:
id
- The id of the category to edittitle
- The titledescription
- The description- Returns:
- The id and title of the modified category, or an error
-
deleteCategory
public Map<String,String> deleteCategory(String id)
Deletes a newsletter category.- Parameters:
id
- The id of the category to delete- Returns:
- The id of the deleted category, or an error
-
getCategories
public List<Map<String,Object>> getCategories(List<String> categoryIds)
Gets the properties of given categories.- Parameters:
categoryIds
- The ids of categories- Returns:
- The properties of categories in a result map
-
getCategory
public Map<String,Object> getCategory(String categoryId)
Gets the properties of given categories.- Parameters:
categoryId
- The id of the category to look for- Returns:
- The properties of categories in a result map
-
-