Class SuggestionCriteria


  • @Vetoed
    public class SuggestionCriteria
    extends Object
    Class that permits to set suggestion search criteria for suggestion box application.
    Author:
    Yohann Chastagnier
    • Method Detail

      • from

        public static SuggestionCriteria from​(SuggestionBox suggestionBox)
        Initializes suggestion search criteria axed on the given suggestion box.
        Parameters:
        suggestionBox - the base suggestion box of suggestion criteria.
        Returns:
        an instance of suggestion criteria based on the specified suggestion box.
      • createdBy

        public SuggestionCriteria createdBy​(org.silverpeas.core.admin.user.model.User user)
        Sets the creator criterion to find suggestion created by the given user.
        Parameters:
        user - the user that must be the creator of the suggestion(s).
        Returns:
        the suggestion criteria itself with the new criterion on the suggestion creator.
      • paginatedBy

        public SuggestionCriteria paginatedBy​(org.silverpeas.core.admin.PaginationPage pagination)
        Sets the pagination criterion on the result of the criteria.
        Parameters:
        pagination - the pagination to apply on the result.
        Returns:
        the suggestion criteria itself set with the criterion on the pagination.
      • statusIsOneOf

        public SuggestionCriteria statusIsOneOf​(org.silverpeas.core.contribution.ContributionStatus... statuses)
        Sets the list of status criterion to find suggestions which have their status equals to one of the given ones.
        Parameters:
        statuses - the status list that the suggestion statuses must verify.
        Returns:
        the suggestion criteria itself with the new criterion on the suggestion statuses.
      • applyJoinOnData

        public SuggestionCriteria applyJoinOnData​(SuggestionCriteria.JOIN_DATA_APPLY... joinDataApplies)
        Configures the data join to apply on the suggestion list.
        Parameters:
        joinDataApplies - the list of join by directives.
        Returns:
        the suggestion criteria itself with the join data list criterion.
      • orderedBy

        public SuggestionCriteria orderedBy​(SuggestionCriteria.QUERY_ORDER_BY... orderBies)
        Configures the order of the suggestion list.
        Parameters:
        orderBies - the list of order by directives.
        Returns:
        the suggestion criteria itself with the list ordering criterion.
      • identifierIsOneOf

        public SuggestionCriteria identifierIsOneOf​(String... identifiers)
        Sets the identifiers criterion to find the suggestions with an identifier equals to one of the specified ones.
        Parameters:
        identifiers - a list of identifiers the suggestions to find should have.
        Returns:
        the suggestion criteria itself with the new criterion on the suggestion identifiers.
      • withWysiwygContent

        public SuggestionCriteria withWysiwygContent()
        Indicates that the content of the suggestions must be loaded before returning the result.
        Returns:
        the suggestion criteria itself with the criterion on the WYSIWYG content loading.
      • getSuggestionBox

        public SuggestionBox getSuggestionBox()
        Gets the suggestion box criteria value. from(SuggestionBox)
        Returns:
        the criterion on the suggestion box to which the suggestions should belong.
      • mustLoadWysiwygContent

        public boolean mustLoadWysiwygContent()
        Indicates if suggestion contents must be loaded.
        Returns:
        true if suggestion contents mus be loaded.
      • processWith

        public void processWith​(SuggestionCriteriaProcessor processor)
        Processes this criteria with the specified processor. It chains in a given order the different criterion to process.
        Parameters:
        processor - the processor to use for processing each criterion in this criteria.