Interface CategoryProvider
-
- All Known Implementing Classes:
JCRCategoryProvider
,SitemapCategoryProvider
public interface CategoryProvider
This interface represents a category provider.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Collection<Category>
getAllCategories(String siteName, String lang)
Returns all the provider's categories, recursively.Collection<String>
getAutomaticIds(String categoryId)
Get automatic property.List<Category>
getCategories(String categoryID)
Get the sub-categories of a categoryList<Category>
getCategories(String siteName, String lang)
Returns the provider's root categories.Category
getCategory(String categoryID)
Returns the provider's category.I18nizableText
getDescription()
Returns the provider's description.String
getId()
Returns the provider's id.I18nizableText
getLabel()
Returns the provider's label.AmetysObjectIterable<Content>
getNewsletters(String categoryID, String siteName, String lang)
Get the newsletter contents linked to a categoryString
getRootId(String siteName, String lang)
Get the root idboolean
hasCategory(String categoryID)
Determines if the category exists.boolean
hasChildren(String categoryID)
Determines if the category has sub-categoriesboolean
hasNewsletters(String categoryID, String siteName, String lang)
Determines if a category has categories linked withboolean
isWritable()
Determines if the categories can be modifiedvoid
setAutomatic(String categoryId, Collection<String> automaticNewsletterIds)
Set automatic property.void
setTemplate(Category category, String templateName)
Affect a template to category
-
-
-
Method Detail
-
isWritable
boolean isWritable()
Determines if the categories can be modified- Returns:
- true if the categories can be modified
-
getLabel
I18nizableText getLabel()
Returns the provider's label.- Returns:
- the provider's label.
-
getDescription
I18nizableText getDescription()
Returns the provider's description.- Returns:
- the provider's description.
-
getCategories
List<Category> getCategories(String siteName, String lang)
Returns the provider's root categories.- Parameters:
siteName
- The site name. Can be null for all siteslang
- The languages. Can be null for all languages- Returns:
- the provider's root categories.
-
getAllCategories
Collection<Category> getAllCategories(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<Category> getCategories(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 idsiteName
- The site namelang
- The language name- Returns:
- if a category has categories linked with
-
getNewsletters
AmetysObjectIterable<Content> getNewsletters(String categoryID, String siteName, String lang)
Get the newsletter contents linked to a category- Parameters:
categoryID
- The category idsiteName
- The site namelang
- The language name- Returns:
- the newsletter contents
-
getRootId
String getRootId(String siteName, String lang)
Get the root id- Parameters:
siteName
- The site namelang
- The language name- Returns:
- the root id
-
setTemplate
void setTemplate(Category category, String templateName)
Affect a template to category- Parameters:
category
- The categorytemplateName
- The template name
-
getAutomaticIds
Collection<String> getAutomaticIds(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.
-
-