public class JCRCategoryProvider extends Object implements LogEnabled, CategoryProvider, Serviceable, Configurable, PluginAware
Modifier and Type | Field and Description |
---|---|
protected I18nizableText |
_description
The description
|
protected String |
_featureName
The feature name
|
protected String |
_id
The id
|
protected I18nizableText |
_label
The label
|
protected Logger |
_logger
The Logger
|
protected String |
_pluginName
The plugin name
|
private AmetysObjectResolver |
_resolver |
private SiteManager |
_siteManager |
Constructor and Description |
---|
JCRCategoryProvider() |
Modifier and Type | Method and Description |
---|---|
private TraversableAmetysObject |
_getRootNode(String sitename,
String lang) |
protected void |
addCategories(Set<Category> categories,
TraversableAmetysObject parentObject,
String siteName,
String lang)
Recursively find
JCRCategory objects in the given TraversableAmetysObject. |
void |
configure(Configuration configuration) |
protected I18nizableText |
configureDescription(Configuration configuration)
Configure description from the passed configuration
|
protected I18nizableText |
configureLabel(Configuration configuration)
Configure label from the passed configuration
|
void |
enableLogging(Logger logger) |
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 category
|
List<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 category
|
String |
getPluginName()
Get the plugin name
|
String |
getRootId(String siteName,
String lang)
Get the root id
|
boolean |
hasCategory(String categoryID)
Determines if the category exists.
|
boolean |
hasChildren(String categoryID)
Determines if the category has sub-categories
|
boolean |
hasNewsletters(String categoryID,
String siteName,
String lang)
Determines if a category has categories linked with
|
boolean |
isWritable()
Determines if the categories can be modified
|
void |
service(ServiceManager serviceManager) |
void |
setAutomatic(String categoryId,
Collection<String> automaticNewsletterIds)
Set automatic property.
|
void |
setPluginInfo(String pluginName,
String featureName,
String id)
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level. |
void |
setTemplate(Category category,
String templateName)
Affect a template to category
|
protected I18nizableText _label
protected I18nizableText _description
protected String _pluginName
protected String _featureName
private AmetysObjectResolver _resolver
private SiteManager _siteManager
public JCRCategoryProvider()
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
ServiceException
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
public void enableLogging(Logger logger)
enableLogging
in interface LogEnabled
public boolean isWritable()
CategoryProvider
isWritable
in interface CategoryProvider
public List<Category> getCategories(String siteName, String lang)
CategoryProvider
getCategories
in interface CategoryProvider
siteName
- The site name. Can be null for all siteslang
- The languages. Can be null for all languagespublic Collection<Category> getAllCategories(String siteName, String lang)
CategoryProvider
getAllCategories
in interface CategoryProvider
siteName
- The site name.lang
- The languages.protected void addCategories(Set<Category> categories, TraversableAmetysObject parentObject, String siteName, String lang)
JCRCategory
objects in the given TraversableAmetysObject.categories
- the Set to fill with categories.parentObject
- the parent TraversableAmetysObject
.siteName
- the site name.lang
- the language.public Category getCategory(String categoryID)
CategoryProvider
getCategory
in interface CategoryProvider
categoryID
- The category idpublic void setTemplate(Category category, String templateName)
CategoryProvider
setTemplate
in interface CategoryProvider
category
- The categorytemplateName
- The template namepublic Collection<String> getAutomaticIds(String categoryId)
CategoryProvider
getAutomaticIds
in interface CategoryProvider
categoryId
- The category id.public void setAutomatic(String categoryId, Collection<String> automaticNewsletterIds)
CategoryProvider
setAutomatic
in interface CategoryProvider
categoryId
- The category id.automaticNewsletterIds
- The automatic newsletter IDs or empty to set non-automatic.public boolean hasCategory(String categoryID)
CategoryProvider
hasCategory
in interface CategoryProvider
categoryID
- The category idpublic List<Category> getCategories(String categoryID)
CategoryProvider
getCategories
in interface CategoryProvider
categoryID
- The category idpublic boolean hasChildren(String categoryID)
CategoryProvider
hasChildren
in interface CategoryProvider
categoryID
- The category idpublic AmetysObjectIterable<Content> getNewsletters(String categoryID, String siteName, String lang)
CategoryProvider
getNewsletters
in interface CategoryProvider
categoryID
- The category idsiteName
- The site namelang
- The language namepublic boolean hasNewsletters(String categoryID, String siteName, String lang)
CategoryProvider
hasNewsletters
in interface CategoryProvider
categoryID
- The category idsiteName
- The site namelang
- The language namepublic I18nizableText getLabel()
CategoryProvider
getLabel
in interface CategoryProvider
public I18nizableText getDescription()
CategoryProvider
getDescription
in interface CategoryProvider
public String getId()
CategoryProvider
getId
in interface CategoryProvider
protected I18nizableText configureLabel(Configuration configuration) throws ConfigurationException
configuration
- The configurationConfigurationException
- If an error occurredprotected I18nizableText configureDescription(Configuration configuration) throws ConfigurationException
configuration
- The configurationConfigurationException
- If an error occurredpublic void setPluginInfo(String pluginName, String featureName, String id)
PluginAware
setPluginInfo
in interface PluginAware
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this componentpublic String getPluginName()
public String getRootId(String siteName, String lang)
CategoryProvider
getRootId
in interface CategoryProvider
siteName
- The site namelang
- The language nameprivate TraversableAmetysObject _getRootNode(String sitename, String lang) throws RepositoryException
RepositoryException