Package com.jalios.jcms.recommendation
Class RecommendationQueryBuilder
- java.lang.Object
-
- com.jalios.jcms.recommendation.RecommendationQueryBuilder
-
public class RecommendationQueryBuilder extends java.lang.Object
Helper to query Recommendations.- Since:
- jcms-10.0
- Version:
- $Revision: 97278 $
- Author:
- Sylvain Devaux
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RecommendationQueryBuilder.SendMode
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
RECEIVED_RECIPIENT_EXCEPTION_EXPECTED_MESSAGE
static java.lang.String
REVISION
protected static java.lang.String
SEND_AUTHOR_EXCEPTION_EXPECTED_MESSAGE
protected static java.lang.String
SEND_MODE_EXCEPTION_EXPECTED_MESSAGE
-
Constructor Summary
Constructors Constructor Description RecommendationQueryBuilder()
RecommendationQueryBuilder(RecommendationQueryBuilder other)
-
Method Summary
-
-
-
Field Detail
-
REVISION
public static final java.lang.String REVISION
- See Also:
- Constant Field Values
-
RECEIVED_RECIPIENT_EXCEPTION_EXPECTED_MESSAGE
protected static final java.lang.String RECEIVED_RECIPIENT_EXCEPTION_EXPECTED_MESSAGE
-
SEND_AUTHOR_EXCEPTION_EXPECTED_MESSAGE
protected static final java.lang.String SEND_AUTHOR_EXCEPTION_EXPECTED_MESSAGE
-
SEND_MODE_EXCEPTION_EXPECTED_MESSAGE
protected static final java.lang.String SEND_MODE_EXCEPTION_EXPECTED_MESSAGE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RecommendationQueryBuilder
public RecommendationQueryBuilder()
-
RecommendationQueryBuilder
public RecommendationQueryBuilder(RecommendationQueryBuilder other)
-
-
Method Detail
-
getResultsCount
public int getResultsCount()
Count (without sorting and first/max criteria for performance reason)- Returns:
- results count for current user filters
- Throws:
java.lang.IllegalArgumentException
- if missing filters- Since:
- jcms-10.0.2
-
getResults
public PageResult<Recommendation> getResults()
Returns Recommendation paginated result- Returns:
- results as a
PageResult
ofRecommendation
- Throws:
java.lang.IllegalArgumentException
- if missing filters
-
setDateCriterion
public void setDateCriterion(org.hibernate.criterion.Criterion dateCriterion)
Customize dateCriterion (gt, ge, lt, le)- Parameters:
dateCriterion
- the custom criterion on the date
-
getAuthor
public Member getAuthor()
-
getLevels
public Alert.Level[] getLevels()
-
getRecipient
public Member getRecipient()
-
getSendMode
public RecommendationQueryBuilder.SendMode getSendMode()
-
getStartDate
public java.util.Date getStartDate()
-
getEndDate
public java.util.Date getEndDate()
-
author
public RecommendationQueryBuilder author(Member author)
- Parameters:
author
- member to be author of recommendations. Required if sendMode is SENT.- Returns:
- the builder for chaining
-
endDate
public RecommendationQueryBuilder endDate(java.util.Date endDate)
-
endDate
public RecommendationQueryBuilder endDate(java.util.Calendar endCal)
-
levels
public RecommendationQueryBuilder levels(Alert.Level... levels)
-
recipient
public RecommendationQueryBuilder recipient(Member recipient)
- Parameters:
recipient
- member to be recipient of recommendations. Required if sendMode is RECEIVED.- Returns:
- the builder for chaining
-
sendMode
public RecommendationQueryBuilder sendMode(RecommendationQueryBuilder.SendMode sendMode)
- Parameters:
sendMode
-RecommendationQueryBuilder.SendMode
to filter on. Requires either an author or a recipient to be set.- Returns:
- the builder for chaining
-
startDate
public RecommendationQueryBuilder startDate(java.util.Date startDate)
-
startDate
public RecommendationQueryBuilder startDate(java.util.Calendar startCal)
-
workspace
public RecommendationQueryBuilder workspace(Workspace workspace)
-
sort
public RecommendationQueryBuilder sort(java.lang.String sort)
-
reverse
public RecommendationQueryBuilder reverse(boolean reverse)
-
start
public RecommendationQueryBuilder start(int start)
-
pageSize
public RecommendationQueryBuilder pageSize(int pageSize)
-
pagerAll
public RecommendationQueryBuilder pagerAll(boolean pagerAll)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-