Class ContentQueryHelper


  • public final class ContentQueryHelper
    extends Object
    Helper for creating JCR XPath queries involving content predicates.
    Created XPath queries are like : //element(*, ametys:content)[<content predicate>]
    • Method Detail

      • getContentXPathQuery

        public static String getContentXPathQuery​(Expression contentExpression)
        Creates the XPath query corresponding to specified Expression.
        Parameters:
        contentExpression - the query predicates
        Returns:
        the created XPath query
      • getContentXPathQuery

        public static String getContentXPathQuery​(Expression contentExpression,
                                                  SortCriteria sortCriteria)
        Creates the XPath query corresponding to specified Expression.
        Parameters:
        contentExpression - the query predicates
        sortCriteria - criteria for sorting results
        Returns:
        the created XPath query
      • getWorkflowXPathQuery

        public static String getWorkflowXPathQuery​(Expression workflowExpression,
                                                   Expression contentExpression)
        Creates the XPath query joining criteria on workflow and criteria on content's metadata.
        Parameters:
        workflowExpression - the workflow query predicates
        contentExpression - the content query predicates
        Returns:
        the created XPath query