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 Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager manager) throws ServiceException
      Specified by:
      service in interface Serviceable
      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 category
      title - The title
      description - The description
      siteName - The site name
      lang - 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 edit
      title - The title
      description - 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

      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
    • applyTemplates

      public Map<String,Object> applyTemplates(List<String> categoryIds, String template)
      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