Class CategoryTagProvider
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.cms.tag.AbstractTagProvider<CMSTag>
-
- org.ametys.plugins.workspaces.categories.CategoryTagProvider
-
- All Implemented Interfaces:
TagProvider<CMSTag>
,PluginAware
,Configurable
,LogEnabled
,Serviceable
public class CategoryTagProvider extends AbstractTagProvider<CMSTag> implements Serviceable
Class representing categories as CMS tag provider. This directly useCategoryJCRProvider
and transform the categories inCMSTag
-
-
Field Summary
Fields Modifier and Type Field Description protected CategoryProviderExtensionPoint
_categoryProviderEP
Category tag providerprotected CategoryJCRProvider
_jcrCategoryProvider
The JCR category providerprotected TagTargetTypeExtensionPoint
_targetTypeEP
Target types-
Fields inherited from class org.ametys.cms.tag.AbstractTagProvider
_description, _featureName, _id, _label, _pluginName
-
-
Constructor Summary
Constructors Constructor Description CategoryTagProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CategoryCMSTag
_transformToCMSTag(Category category, Map<String,Object> contextualParameters)
Transform aCategory
in aCategoryCMSTag
, forcing visibility to public and target to CONTENTCMSTag
getTag(String tagName, Map<String,Object> contextualParameters)
Returns the provider's tag.Collection<CMSTag>
getTags(String tagName, Map<String,Object> contextualParameters)
Returns the direct children of the provider's tag.Map<String,CMSTag>
getTags(Map<String,Object> contextualParameters)
Returns the provider's tags.boolean
hasTag(String tagName, Map<String,Object> contextualParameters)
Determines if the tag exists.void
service(ServiceManager smanager)
-
Methods inherited from class org.ametys.cms.tag.AbstractTagProvider
configure, configureDescription, configureLabel, getDescription, getId, getLabel, getPluginName, setPluginInfo
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_targetTypeEP
protected TagTargetTypeExtensionPoint _targetTypeEP
Target types
-
_categoryProviderEP
protected CategoryProviderExtensionPoint _categoryProviderEP
Category tag provider
-
_jcrCategoryProvider
protected CategoryJCRProvider _jcrCategoryProvider
The JCR category provider
-
-
Constructor Detail
-
CategoryTagProvider
public CategoryTagProvider()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getTags
public Map<String,CMSTag> getTags(Map<String,Object> contextualParameters)
Description copied from interface:TagProvider
Returns the provider's tags.- Specified by:
getTags
in interfaceTagProvider<CMSTag>
- Parameters:
contextualParameters
- contextual parameters- Returns:
- the provider's tags.
-
getTag
public CMSTag getTag(String tagName, Map<String,Object> contextualParameters)
Description copied from interface:TagProvider
Returns the provider's tag.- Specified by:
getTag
in interfaceTagProvider<CMSTag>
- Parameters:
tagName
- The tag namecontextualParameters
- contextual parameters- Returns:
- the provider's tag.
-
getTags
public Collection<CMSTag> getTags(String tagName, Map<String,Object> contextualParameters)
Description copied from interface:TagProvider
Returns the direct children of the provider's tag.- Specified by:
getTags
in interfaceTagProvider<CMSTag>
- Parameters:
tagName
- The tag namecontextualParameters
- contextual parameters- Returns:
- the provider's tag.
-
hasTag
public boolean hasTag(String tagName, Map<String,Object> contextualParameters)
Description copied from interface:TagProvider
Determines if the tag exists.- Specified by:
hasTag
in interfaceTagProvider<CMSTag>
- Parameters:
tagName
- The tag unique namecontextualParameters
- contextual parameters- Returns:
- true if the tag exists.
-
_transformToCMSTag
protected CategoryCMSTag _transformToCMSTag(Category category, Map<String,Object> contextualParameters)
Transform aCategory
in aCategoryCMSTag
, forcing visibility to public and target to CONTENT- Parameters:
category
- the category to transformcontextualParameters
- the contextual parameters- Returns:
- a
CategoryCMSTag
with the same values
-
-