Class AbstractTagsDAO

All Implemented Interfaces:
Component, LogEnabled, Serviceable
Direct Known Subclasses:
CategoriesDAO, KeywordsDAO, ProjectTagsDAO, TagsDAO, ThemesDAO

public abstract class AbstractTagsDAO extends AbstractLogEnabled implements Serviceable, Component
DAO for manipulating tags
  • Field Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager manager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • getTagProviderEPRole

      public abstract String getTagProviderEPRole()
      Get the tag provider extension point role
      Returns:
      the tag provider extension point role
    • getTagPaths

      public List<String> getTagPaths(List<String> tagNames, Map<String,Object> contextualParameters)
      Get the paths of given tags
      Parameters:
      tagNames - The name of tags
      contextualParameters - Contextual parameters
      Returns:
      {String} path
    • getFullPath

      protected String getFullPath(String tagName, Map<String,Object> contextualParameters)
      Get the full path of a tag, with its provider
      Parameters:
      tagName - The tag name
      contextualParameters - Contextual parameters
      Returns:
      the full path of tag or null if not found
    • getTag

      public Tag getTag(String tagName, Map<String,Object> contextualParameters)
      Get a tag by its name
      Parameters:
      tagName - The tag name
      contextualParameters - Contextual parameters
      Returns:
      The tag or null if not found
    • getPath

      protected String getPath(Tag tag)
      Get the path of a tag inside its provider. The path is composed of tags name and '/' as a separator
      Parameters:
      tag - The tag
      Returns:
      The path
    • getTagsTitle

      public Map<String,Object> getTagsTitle(List<String> tagNames, Map<String,Object> contextualParameters)
      Get the title of given tags
      Parameters:
      tagNames - The name of tags
      contextualParameters - Contextual parameters
      Returns:
      the labels
    • filterTagsByRegExp

      public List<String> filterTagsByRegExp(String value, Map<String,Object> contextualParameters)
      Get the path of node which match filter regexp
      Parameters:
      value - the value to match
      contextualParameters - Contextual parameters
      Returns:
      the matching paths
    • filterTagsFromListByRegExp

      public List<String> filterTagsFromListByRegExp(String filter, List<String> tagNames, Map<String,Object> contextualParameters)
      Get the path of node which match filter regexp
      Parameters:
      filter - the value to match
      tagNames - the list of tag's name to search inside
      contextualParameters - Contextual parameters
      Returns:
      the matching paths
    • checkTags

      public List<String> checkTags(List<String> tagNames, boolean onlyCustomTags, Map<String,Object> otherParameters, Map<String,Object> contextualParameters)
      Test if tags exists
      Parameters:
      tagNames - The tag names to test
      onlyCustomTags - If true, return only custom tags
      otherParameters - the other parameters
      contextualParameters - Contextual parameters
      Returns:
      The list of tag names without the invalid values.
    • _getFilteredTagName

      protected String _getFilteredTagName(TagProvider<? extends Tag> tagProvider, String tagName, Map<String,Object> otherParameters, Map<String,Object> contextualParameters)
      Get filtered tag name
      Parameters:
      tagProvider - the tag provider
      tagName - the tag name
      otherParameters - the other parameters
      contextualParameters - the contextual parameters
      Returns:
      the tag name if it match
    • getCustomTagProvider

      protected abstract List<TagProvider<? extends Tag>> getCustomTagProvider()
      Get the list of custom tag provider
      Returns:
      the list of custom tag provider