public class JCRTagProvider extends StaticTagProvider
Modifier and Type | Field and Description |
---|---|
protected AmetysObjectResolver |
_resolver
The Ametys object resolver
|
protected static String |
CACHE_REQUEST_ATTRIBUTE
The request attribute name with cache information
|
static String |
PLUGIN_NODE_NAME
Constant for plugin node name
|
static String |
TAGS_NODENAME
JCR node name for tags
|
static String |
TAGS_NODETYPE
JCR nodetype for tags
|
_context, _description, _featureName, _id, _label, _localIds, _manager, _pluginName, _tags, _targetTypeEP
Constructor and Description |
---|
JCRTagProvider() |
Modifier and Type | Method and Description |
---|---|
protected void |
_fillCache(TraversableAmetysObject parentTagNode,
Tag parentTag,
Map<String,Object> cache)
Fill cache
|
protected Map<String,Object> |
_getCache(Map<String,Object> contextualParameters)
Get the Map of tags by their unique name
|
protected ModifiableTraversableAmetysObject |
_getOrCreateNode(ModifiableTraversableAmetysObject parentNode,
String nodeName,
String nodeType)
Get a node or create it if not exist.
|
void |
configure(Configuration configuration) |
ModifiableTraversableAmetysObject |
getRootNode(Map<String,Object> contextualParameters)
Get the root node for tags
|
Tag |
getTag(String tagName,
Map<String,Object> contextualParameters)
Returns the provider's tag.
|
Map<String,Tag> |
getTags(Map<String,Object> contextualParameters)
Returns the provider's tags.
|
static String |
getXPathQuery(String tagName)
Creates the XPath query corresponding to specified tag name
|
boolean |
hasTag(String tagName,
Map<String,Object> contextualParameters)
Determines if the tag exists.
|
void |
service(ServiceManager smanager) |
configureDescription, configureLabel, configureTags, contextualize, getDescription, getFilteredTags, getId, getLabel, getLocalIds, getPluginName, getTags, setPluginInfo
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
public static final String PLUGIN_NODE_NAME
public static final String TAGS_NODETYPE
public static final String TAGS_NODENAME
protected static final String CACHE_REQUEST_ATTRIBUTE
protected AmetysObjectResolver _resolver
public JCRTagProvider()
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
configure
in class StaticTagProvider
ConfigurationException
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
service
in class StaticTagProvider
ServiceException
protected Map<String,Object> _getCache(Map<String,Object> contextualParameters) throws RepositoryException
contextualParameters
- The contextual parametersRepositoryException
- If the cache cannot be filledprotected void _fillCache(TraversableAmetysObject parentTagNode, Tag parentTag, Map<String,Object> cache) throws RepositoryException
parentTagNode
- The parent tag nodeparentTag
- The parent tagcache
- The cacheRepositoryException
- If an error occurredpublic Map<String,Tag> getTags(Map<String,Object> contextualParameters)
TagProvider
getTags
in interface TagProvider
getTags
in class StaticTagProvider
contextualParameters
- contextual parameterspublic boolean hasTag(String tagName, Map<String,Object> contextualParameters)
TagProvider
hasTag
in interface TagProvider
hasTag
in class StaticTagProvider
tagName
- The tag unique namecontextualParameters
- contextual parameterspublic Tag getTag(String tagName, Map<String,Object> contextualParameters)
TagProvider
getTag
in interface TagProvider
getTag
in class StaticTagProvider
tagName
- The tag namecontextualParameters
- contextual parameterspublic ModifiableTraversableAmetysObject getRootNode(Map<String,Object> contextualParameters) throws RepositoryException
contextualParameters
- The contextual parametersRepositoryException
- if an error occurredprotected ModifiableTraversableAmetysObject _getOrCreateNode(ModifiableTraversableAmetysObject parentNode, String nodeName, String nodeType) throws AmetysRepositoryException
parentNode
- the parent nodenodeName
- the node namenodeType
- the node typeAmetysRepositoryException
- if an error occurredpublic static String getXPathQuery(String tagName)
tagName
- the tag name