Class SitemapDAO

    • Method Detail

      • getSitemap

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

        public Map<String,​ObjectgetProperties​(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,​ObjectgetSitemapProperties​(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,​ObjectgetSitemapProperties​(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

        public Map<String,​ObjectgetPageProperties​(String pageId)
        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

        public Map<String,​ObjectgetPageProperties​(Page page)
        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,​ObjectgetPageProperties​(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

        public List<StringfilterPagesByRegExp​(String id,
                                                String value)
        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
      • 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<StringgetUserRights​(Sitemap sitemap)
        Get the user rights on a sitemap
        Parameters:
        sitemap - the sitemap
        Returns:
        The user's rights