Class SuggestionFinderByCriteria
- java.lang.Object
-
- org.silverpeas.components.suggestionbox.common.SuggestionFinderByCriteria
-
- All Implemented Interfaces:
SuggestionCriteriaProcessor
public class SuggestionFinderByCriteria extends Object implements SuggestionCriteriaProcessor
A finder of suggestions in the given suggestion box by applying a criteria on the suggestion in the business service layer.It applies the criteria on the suggestions by using the several business services on which a suggestion is relied on. For example, a suggestion used the WYSIWYG service for its rich content as well as the comment service for the user comments on it.
- Author:
- mmoquillon
-
-
Constructor Summary
Constructors Constructor Description SuggestionFinderByCriteria()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endProcessing()
Informs the processor the process is ended.SuggestionCriteriaProcessor
processCreator(org.silverpeas.core.admin.user.model.User creator)
Processes the criterion on the creator of the suggestions.SuggestionCriteriaProcessor
processIdentifiers(List<String> identifiers)
Processes the criterion on the suggestion identifiers.SuggestionCriteriaProcessor
processJoinDataApply(List<SuggestionCriteria.JOIN_DATA_APPLY> joinDataApplies)
Processes the criterion on data joins of the suggestions matching the criteria.SuggestionCriteriaProcessor
processOrdering(List<SuggestionCriteria.QUERY_ORDER_BY> orderings)
Processes the criterion on orderings of the suggestions matching the criteria.SuggestionCriteriaProcessor
processPagination(org.silverpeas.core.admin.PaginationPage pagination)
Processes the criterion on the pagination to apply on the suggestions to return.SuggestionCriteriaProcessor
processStatus(List<org.silverpeas.core.contribution.ContributionStatus> status)
Processes the criterion on suggestion status.SuggestionCriteriaProcessor
processSuggestionBox(SuggestionBox box)
Processes the criterion on the suggestion box.List<Suggestion>
result()
Gets the result of the processing.void
startProcessing()
Informs the processor the start of the process.SuggestionCriteriaProcessor
then()
Informs the processor that there is a new criterion to process.
-
-
-
Method Detail
-
startProcessing
public void startProcessing()
Description copied from interface:SuggestionCriteriaProcessor
Informs the processor the start of the process. The processor use this method to allocate all the resources required by the processing here. It uses it to initialize the processor state machine.- Specified by:
startProcessing
in interfaceSuggestionCriteriaProcessor
-
endProcessing
public void endProcessing()
Description copied from interface:SuggestionCriteriaProcessor
Informs the processor the process is ended. The processor use this method to deallocate all the resources that were used during the processing. It uses it to tear down the processor state machine or to finalize some treatments. The processing has to stop once this method is called. Hence, the call of process methods should result to nothing or to an exception.- Specified by:
endProcessing
in interfaceSuggestionCriteriaProcessor
-
then
public SuggestionCriteriaProcessor then()
Description copied from interface:SuggestionCriteriaProcessor
Informs the processor that there is a new criterion to process. This method must be used by the caller to chain the different criterion processings.- Specified by:
then
in interfaceSuggestionCriteriaProcessor
- Returns:
- the processor itself.
-
processSuggestionBox
public SuggestionCriteriaProcessor processSuggestionBox(SuggestionBox box)
Description copied from interface:SuggestionCriteriaProcessor
Processes the criterion on the suggestion box.- Specified by:
processSuggestionBox
in interfaceSuggestionCriteriaProcessor
- Parameters:
box
- the suggestion box concerned by the criterion.- Returns:
- the processor itself.
-
processCreator
public SuggestionCriteriaProcessor processCreator(org.silverpeas.core.admin.user.model.User creator)
Description copied from interface:SuggestionCriteriaProcessor
Processes the criterion on the creator of the suggestions.- Specified by:
processCreator
in interfaceSuggestionCriteriaProcessor
- Parameters:
creator
- the user concerned by the criterion.- Returns:
- the processor itself.
-
processStatus
public SuggestionCriteriaProcessor processStatus(List<org.silverpeas.core.contribution.ContributionStatus> status)
Description copied from interface:SuggestionCriteriaProcessor
Processes the criterion on suggestion status.- Specified by:
processStatus
in interfaceSuggestionCriteriaProcessor
- Parameters:
status
- the suggestion status concerned by the criterion.- Returns:
- the processor itself.
-
processJoinDataApply
public SuggestionCriteriaProcessor processJoinDataApply(List<SuggestionCriteria.JOIN_DATA_APPLY> joinDataApplies)
Description copied from interface:SuggestionCriteriaProcessor
Processes the criterion on data joins of the suggestions matching the criteria.- Specified by:
processJoinDataApply
in interfaceSuggestionCriteriaProcessor
- Parameters:
joinDataApplies
- the result data joins concerned by the criterion.- Returns:
- the processor itself.
-
processOrdering
public SuggestionCriteriaProcessor processOrdering(List<SuggestionCriteria.QUERY_ORDER_BY> orderings)
Description copied from interface:SuggestionCriteriaProcessor
Processes the criterion on orderings of the suggestions matching the criteria.- Specified by:
processOrdering
in interfaceSuggestionCriteriaProcessor
- Parameters:
orderings
- the result orderings concerned by the criterion.- Returns:
- the processor itself.
-
processIdentifiers
public SuggestionCriteriaProcessor processIdentifiers(List<String> identifiers)
Description copied from interface:SuggestionCriteriaProcessor
Processes the criterion on the suggestion identifiers.- Specified by:
processIdentifiers
in interfaceSuggestionCriteriaProcessor
- Parameters:
identifiers
- the suggestion identifiers concerned by the criterion.- Returns:
- the processor itself.
-
processPagination
public SuggestionCriteriaProcessor processPagination(org.silverpeas.core.admin.PaginationPage pagination)
Description copied from interface:SuggestionCriteriaProcessor
Processes the criterion on the pagination to apply on the suggestions to return.- Specified by:
processPagination
in interfaceSuggestionCriteriaProcessor
- Parameters:
pagination
- a pagination definition.- Returns:
- the processor itself.
-
result
public List<Suggestion> result()
Description copied from interface:SuggestionCriteriaProcessor
Gets the result of the processing. Warning, the result can be incomplete if called before the processing ending (triggered with the call ofSuggestionCriteriaProcessor.endProcessing()
method).- Specified by:
result
in interfaceSuggestionCriteriaProcessor
- Returns:
- the processing result.
-
-