T
- the tag classpublic abstract class AbstractJCRTagProvider<T extends Tag> extends AbstractTagProvider<T> implements Contextualizable
Modifier and Type | Field and Description |
---|---|
protected Context |
_context
The context
|
protected static String |
CACHE_REQUEST_ATTRIBUTE
The request attribute name with cache information
|
_description, _featureName, _id, _label, _pluginName
Constructor and Description |
---|
AbstractJCRTagProvider() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
_fillCache(TraversableAmetysObject parentTagNode,
T parentTag,
Map<String,T> cache)
Fill cache
|
protected Map<String,T> |
_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) |
void |
contextualize(Context context) |
abstract ModifiableTraversableAmetysObject |
getRootNode(Map<String,Object> contextualParameters)
Get the root node for tags
|
T |
getTag(String tagName,
Map<String,Object> contextualParameters)
Returns the provider's tag.
|
Map<String,T> |
getTags(Map<String,Object> contextualParameters)
Returns the provider's tags.
|
boolean |
hasTag(String tagName,
Map<String,Object> contextualParameters)
Determines if the tag exists.
|
configureDescription, configureLabel, getDescription, getId, getLabel, getPluginName, setPluginInfo
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getTags
protected static final String CACHE_REQUEST_ATTRIBUTE
public AbstractJCRTagProvider()
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
configure
in class AbstractTagProvider<T extends Tag>
ConfigurationException
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
protected Map<String,T> _getCache(Map<String,Object> contextualParameters) throws RepositoryException
contextualParameters
- The contextual parametersRepositoryException
- If the cache cannot be filledpublic Map<String,T> getTags(Map<String,Object> contextualParameters)
TagProvider
getTags
in interface TagProvider<T extends Tag>
contextualParameters
- contextual parameterspublic T getTag(String tagName, Map<String,Object> contextualParameters)
TagProvider
getTag
in interface TagProvider<T extends Tag>
tagName
- The tag namecontextualParameters
- contextual parameterspublic boolean hasTag(String tagName, Map<String,Object> contextualParameters)
TagProvider
hasTag
in interface TagProvider<T extends Tag>
tagName
- The tag unique namecontextualParameters
- contextual parametersprotected abstract void _fillCache(TraversableAmetysObject parentTagNode, T parentTag, Map<String,T> cache) throws RepositoryException
parentTagNode
- The parent tag nodeparentTag
- The parent tagcache
- The cacheRepositoryException
- If an error occurredpublic abstract 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 occurred