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
    • addTags

      public List<Map<String,Object>> addTags(String[] tagNames)
      Add tags from FO
      Parameters:
      tagNames - The name of tags to add
      Returns:
      The new tags descriptions
    • _getTagJCRDAO

      protected abstract AbstractJCRTagsDAO _getTagJCRDAO()
      Get the tag JCR DAO
      Returns:
      the tag JCR DAO
    • _tagsToJSON

      protected List<Map<String,Object>> _tagsToJSON(Collection<? extends Tag> tags)
      Get tags to json
      Parameters:
      tags - the tags
      Returns:
      the tags to json
    • _tagToJSON

      protected Map<String,Object> _tagToJSON(JCRTag tag)
      JCR tag to json
      Parameters:
      tag - the jcr tag
      Returns:
      the jcr tag to json
    • tagToJSON

      public Map<String,Object> tagToJSON(Tag tag)
      Tag to json
      Parameters:
      tag - the tag
      Returns:
      the tag to json