Interface CategoryProvider

    • Method Detail

      • isWritable

        boolean isWritable()
        Determines if the categories can be modified
        Returns:
        true if the categories can be modified
      • getId

        String getId()
        Returns the provider's id.
        Returns:
        the provider's id.
      • getCategories

        List<CategorygetCategories​(String siteName,
                                     String lang)
        Returns the provider's root categories.
        Parameters:
        siteName - The site name. Can be null for all sites
        lang - The languages. Can be null for all languages
        Returns:
        the provider's root categories.
      • getAllCategories

        Collection<CategorygetAllCategories​(String siteName,
                                              String lang)
        Returns all the provider's categories, recursively.
        Parameters:
        siteName - The site name.
        lang - The languages.
        Returns:
        all the provider's categories.
      • getCategory

        Category getCategory​(String categoryID)
        Returns the provider's category.
        Parameters:
        categoryID - The category id
        Returns:
        the provider's category.
      • hasCategory

        boolean hasCategory​(String categoryID)
        Determines if the category exists.
        Parameters:
        categoryID - The category id
        Returns:
        true if the category exists.
      • hasChildren

        boolean hasChildren​(String categoryID)
        Determines if the category has sub-categories
        Parameters:
        categoryID - The category id
        Returns:
        true if the category have sub-categories
      • getCategories

        List<CategorygetCategories​(String categoryID)
        Get the sub-categories of a category
        Parameters:
        categoryID - The category id
        Returns:
        the sub-categories
      • hasNewsletters

        boolean hasNewsletters​(String categoryID,
                               String siteName,
                               String lang)
        Determines if a category has categories linked with
        Parameters:
        categoryID - The category id
        siteName - The site name
        lang - The language name
        Returns:
        if a category has categories linked with
      • getRootId

        String getRootId​(String siteName,
                         String lang)
        Get the root id
        Parameters:
        siteName - The site name
        lang - The language name
        Returns:
        the root id
      • setTemplate

        void setTemplate​(Category category,
                         String templateName)
        Affect a template to category
        Parameters:
        category - The category
        templateName - The template name
      • getAutomaticIds

        Collection<StringgetAutomaticIds​(String categoryId)
        Get automatic property.
        Parameters:
        categoryId - The category id.
        Returns:
        the list of automatic newsletter IDs.
      • setAutomatic

        void setAutomatic​(String categoryId,
                          Collection<String> automaticNewsletterIds)
        Set automatic property.
        Parameters:
        categoryId - The category id.
        automaticNewsletterIds - The automatic newsletter IDs or empty to set non-automatic.