Class ContentFilterHelper

    • Method Detail

      • getMatchingContentIds

        public List<StringgetMatchingContentIds​(WebContentFilter filter,
                                                  String siteName,
                                                  String lang,
                                                  Page page)
        Get the ID of all contents matching the given filter. This method filters orphan contents and limits the results if necessary.
        Parameters:
        filter - The filter
        siteName - The current site name. Can be null.
        lang - The current language. Can be null.
        page - The current page. Can be null.
        Returns:
        a List of all content IDs.
      • saxContent

        public void saxContent​(ContentHandler handler,
                               Content content,
                               String viewName,
                               boolean checkUserAccess)
                        throws SAXException,
                               IOException
        SAX a content in its specific view
        Parameters:
        handler - The content handler to SAX into
        content - The content to SAX
        viewName - The view to use
        checkUserAccess - Set to true to check FO user access when rendering content
        Throws:
        SAXException - If an error occurs while SAXing
        IOException - If an error occurs while retrieving content.
      • isContentValid

        public boolean isContentValid​(Content content,
                                      Page currentPage,
                                      ContentFilter filter)
        Test if the content is accessible in accordance with the filter options (mask orphans, access limitation policy, ...)
        Parameters:
        content - the content to test.
        currentPage - the current page.
        filter - the content filter.
        Returns:
        true if the content is accessible, false otherwise.
      • isAccessible

        protected boolean isAccessible​(Content content,
                                       Page currentPage,
                                       WebContentFilter filter)
        Test if the content is accessible in accordance with the filter's access limitation policy.
        Parameters:
        content - the content to test.
        currentPage - the current page.
        filter - the web content filter.
        Returns:
        true if the content is accessible, false otherwise.
      • isOrphan

        protected boolean isOrphan​(Content content)
        Determines if a content is orphan
        Parameters:
        content - the content to test
        Returns:
        true if the content is orphan