public class SitemapCategoryProvider 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 |
static String |
CATEGORY_PREFIX_ID
The metadata name for newsletter template
|
static String |
METADATA_AUTOMATIC_IDS
The metadata name for automatic newsletter ids.
|
static String |
METADATA_TEMPLATE
The metadata name for newsletter template
|
static String |
TAG_NAME
The root id
|
Constructor and Description |
---|
SitemapCategoryProvider() |
Modifier and Type | Method and Description |
---|---|
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
|
public static final String TAG_NAME
public static final String METADATA_TEMPLATE
public static final String METADATA_AUTOMATIC_IDS
public static final String CATEGORY_PREFIX_ID
protected I18nizableText _label
protected I18nizableText _description
protected String _pluginName
protected String _featureName
private AmetysObjectResolver _resolver
public SitemapCategoryProvider()
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.public List<Category> getCategories(String categoryID)
CategoryProvider
getCategories
in interface CategoryProvider
categoryID
- The category idpublic boolean hasCategory(String categoryID)
CategoryProvider
hasCategory
in interface CategoryProvider
categoryID
- The category idpublic 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 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 hasChildren(String categoryID)
CategoryProvider
hasChildren
in interface CategoryProvider
categoryID
- The category idpublic boolean hasNewsletters(String categoryID, String siteName, String lang)
CategoryProvider
hasNewsletters
in interface CategoryProvider
categoryID
- The category idsiteName
- The site namelang
- The language nameprotected 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 I18nizableText getDescription()
CategoryProvider
getDescription
in interface CategoryProvider
public String getId()
CategoryProvider
getId
in interface CategoryProvider
public I18nizableText getLabel()
CategoryProvider
getLabel
in interface CategoryProvider
public String getRootId(String siteName, String lang)
CategoryProvider
getRootId
in interface CategoryProvider
siteName
- The site namelang
- The language name