Class CategoryDAO
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.plugins.newsletter.category.CategoryDAO
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
DAO for manipulating newsletter categories.
-
Field Summary
Modifier and TypeFieldDescriptionprotected AmetysObjectResolver
Ametys object resolverstatic final String
The Avalon role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapplyTemplates
(List<String> categoryIds, String template) Applies a template to a given newsletter category.Creates a newsletter category.deleteCategory
(String id) Deletes a newsletter category.editCategory
(String id, String title, String description) Edits a newsletter category.getCategories
(List<String> categoryIds) Gets the properties of given categories.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 Details
-
ROLE
The Avalon role -
_resolver
Ametys object resolver
-
-
Constructor Details
-
CategoryDAO
public CategoryDAO()
-
-
Method Details
-
service
- 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
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
Deletes a newsletter category.- Parameters:
id
- The id of the category to delete- Returns:
- The id of the deleted category, or an error
-
getCategories
Gets the properties of given categories.- Parameters:
categoryIds
- The ids of categories- Returns:
- The properties of categories in a result map
-
getCategory
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
-
applyTemplates
Applies a template to a given newsletter category.- Parameters:
categoryIds
- The ids of the categories to edit.template
- The template to set.- Returns:
- An empty map
-