Class SitemapDAO

All Implemented Interfaces:
Component, LogEnabled, Serviceable

public class SitemapDAO extends AbstractLogEnabled implements Serviceable, Component
DAO for manipulating pages
  • Field Details

    • ROLE

      public static final String ROLE
      The component's role
  • Constructor Details

  • Method Details

    • service

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

      public Map<String,Object> getSitemap(String sitemapId)
      Get sitemap properties
      Parameters:
      sitemapId - the sitemap ID
      Returns:
      the sitemap's properties or null if not found
    • getProperties

      public Map<String,Object> getProperties(String siteName, String lang)
      Get properties of a site, sitemap or on sites root node
      Parameters:
      siteName - the site name. Set to null to get properties of sites root node
      lang - the sitemap language. Set to null to get properties of site node
      Returns:
      the properties
    • getSitemapProperties

      public Map<String,Object> getSitemapProperties(String siteName, String lang, List<String> rights)
      Get the sitemap properties as JSON object
      Parameters:
      siteName - the site name. Set to null to get properties of sites root node
      lang - the sitemap language. Set to null to get properties of site node
      rights - If not null, the sitemap properties will contain a 'isAllowed' property based on user rights. Can be null.
      Returns:
      the sitemap properties
    • getSitemapProperties

      public Map<String,Object> getSitemapProperties(Sitemap sitemap, List<String> rightsToCheck)
      Get the sitemap properties into a JSON object
      Parameters:
      sitemap - The sitemap
      rightsToCheck - If not null, the sitemap properties will contain a 'isAllowed' property based on user rights. Can be null.
      Returns:
      the sitemap properties
    • getPageProperties

      Get the properties of a page in order to display it into a sitemap tree
      Parameters:
      pageId - The page's id
      Returns:
      The page's properties
    • getPageProperties

      Get the properties of a page in order to display it into a sitemap tree
      Parameters:
      page - The page
      Returns:
      The page's properties
    • getPageProperties

      public Map<String,Object> getPageProperties(Page page, List<String> rightsToCheck)
      Get the properties of a page in order to display it into a sitemap tree
      Parameters:
      page - The page
      rightsToCheck - If not null, the page properties will contain a 'isAllowed' property based on user rights
      Returns:
      The page's properties
    • isCurrentUserAllowed

      public boolean isCurrentUserAllowed(PagesContainer pageContainer, List<String> rights)
      Determines if the current user has the requested right on this pages container
      Parameters:
      pageContainer - The pages container
      rights - The rights to check
      Returns:
      true if the current user is allowed
    • filterPagesByRegExp

      Get the path of pages which match filter regexp
      Parameters:
      id - The id of page or sitemap to start search
      value - the value to match
      Returns:
      the matching paths
    • getDecorators

      public List<Map<String,Object>> getDecorators(String siteName)
      Get the sitemap's decorators
      Parameters:
      siteName - the site name
      Returns:
      the list of decorators
    • convertPathToId

      public String convertPathToId(String siteName, String lang, String path)
      Get the id of a page from its site name, language and sitemap's path
      Parameters:
      siteName - The site name
      lang - The language
      path - the page's path. Can be null to get sitemap's id
      Returns:
      the page id or null if not found
    • getUserRights

      protected Set<String> getUserRights(Sitemap sitemap)
      Get the user rights on a sitemap
      Parameters:
      sitemap - the sitemap
      Returns:
      The user's rights