Package com.jalios.jcms.alert
Class AlertQueryBuilder
- java.lang.Object
-
- com.jalios.jcms.alert.AlertQueryBuilder
-
public class AlertQueryBuilder extends java.lang.Object
Helper to query Alerts.- Since:
- jcms-10.0
- Version:
- $Revision: 114560 $
- Author:
- Sylvain Devaux
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AlertQueryBuilder.ReadMode
ReadMode represents the state of alert (Read, unread, read & unread)
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
RECIPIENT_EXCEPTION_EXPECTED_MESSAGE
static java.lang.String
REVISION
-
Constructor Summary
Constructors Constructor Description AlertQueryBuilder()
AlertQueryBuilder(AlertQueryBuilder other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AlertQueryBuilder
author(Member author)
Sets the author to filter on currentAlertQueryBuilder
AlertQueryBuilder
endDate(java.util.Calendar endCal)
Sets the endDate to filter on currentAlertQueryBuilder
AlertQueryBuilder
endDate(java.util.Date endDate)
Sets the endDate to filter on currentAlertQueryBuilder
PageResult<Alert>
getResults()
Returns alert paginated resultint
getResultsCount()
Count (without sorting and first/max criteria for performance reason)AlertQueryBuilder
levels(Alert.Level... levels)
Sets the levels to filter on currentAlertQueryBuilder
AlertQueryBuilder
pagerAll(boolean pagerAll)
Defines if all results should be displayed for currentAlertQueryBuilder
void
pagerParams(PagerParams pagerParams)
AlertQueryBuilder
pageSize(int pageSize)
Sets the page size on currentAlertQueryBuilder
AlertQueryBuilder
read(AlertQueryBuilder.ReadMode readMode)
Sets the read mode to filter on currentAlertQueryBuilder
AlertQueryBuilder
recipient(Member recipient)
Sets the recipient to filter on currentAlertQueryBuilder
AlertQueryBuilder
reverse(boolean reverse)
Defines if results have to be reversed on currentAlertQueryBuilder
AlertQueryBuilder
sort(java.lang.String sort)
Sets the sort on currentAlertQueryBuilder
AlertQueryBuilder
start(int start)
Sets the start (Index) on currentAlertQueryBuilder
AlertQueryBuilder
startDate(java.util.Calendar startCal)
Sets the startDate to filter on currentAlertQueryBuilder
AlertQueryBuilder
startDate(java.util.Date startDate)
Sets the startDate to filter on currentAlertQueryBuilder
java.lang.String
toString()
AlertQueryBuilder
workspace(Workspace workspace)
Sets the workspace to filter on currentAlertQueryBuilder
-
-
-
Field Detail
-
REVISION
public static final java.lang.String REVISION
- See Also:
- Constant Field Values
-
RECIPIENT_EXCEPTION_EXPECTED_MESSAGE
protected static final java.lang.String RECIPIENT_EXCEPTION_EXPECTED_MESSAGE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AlertQueryBuilder
public AlertQueryBuilder()
-
AlertQueryBuilder
public AlertQueryBuilder(AlertQueryBuilder 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 recipient is null
-
getResults
public PageResult<Alert> getResults()
Returns alert paginated result- Returns:
- results as a
PageResult
ofAlert
- Throws:
java.lang.IllegalArgumentException
- if recipient is null
-
author
public AlertQueryBuilder author(Member author)
Sets the author to filter on currentAlertQueryBuilder
- Parameters:
author
- theMember
author of the alert- Returns:
- a reference to this object
-
endDate
public AlertQueryBuilder endDate(java.util.Date endDate)
Sets the endDate to filter on currentAlertQueryBuilder
- Parameters:
endDate
- theDate
- Returns:
- a reference to this object
-
endDate
public AlertQueryBuilder endDate(java.util.Calendar endCal)
Sets the endDate to filter on currentAlertQueryBuilder
- Parameters:
endCal
- theCalendar
- Returns:
- a reference to this object
-
levels
public AlertQueryBuilder levels(Alert.Level... levels)
Sets the levels to filter on currentAlertQueryBuilder
- Parameters:
levels
- the array ofAlert.Level
- Returns:
- a reference to this object
-
recipient
public AlertQueryBuilder recipient(Member recipient)
Sets the recipient to filter on currentAlertQueryBuilder
- Parameters:
recipient
- theMember
- Returns:
- a reference to this object
-
read
public AlertQueryBuilder read(AlertQueryBuilder.ReadMode readMode)
Sets the read mode to filter on currentAlertQueryBuilder
- Parameters:
readMode
- theAlertQueryBuilder.ReadMode
- Returns:
- a reference to this object
-
startDate
public AlertQueryBuilder startDate(java.util.Date startDate)
Sets the startDate to filter on currentAlertQueryBuilder
- Parameters:
startDate
- theDate
- Returns:
- a reference to this object
-
startDate
public AlertQueryBuilder startDate(java.util.Calendar startCal)
Sets the startDate to filter on currentAlertQueryBuilder
- Parameters:
startCal
- theCalendar
- Returns:
- a reference to this object
-
workspace
public AlertQueryBuilder workspace(Workspace workspace)
Sets the workspace to filter on currentAlertQueryBuilder
- Parameters:
workspace
- theWorkspace
- Returns:
- a reference to this object
-
pagerParams
public void pagerParams(PagerParams pagerParams)
-
sort
public AlertQueryBuilder sort(java.lang.String sort)
Sets the sort on currentAlertQueryBuilder
- Parameters:
sort
- the chosen sort on current AlertQueryBuilder- Returns:
- a reference to this object
-
reverse
public AlertQueryBuilder reverse(boolean reverse)
Defines if results have to be reversed on currentAlertQueryBuilder
- Parameters:
reverse
- if true results order will be reversed- Returns:
- a reference to this object
-
start
public AlertQueryBuilder start(int start)
Sets the start (Index) on currentAlertQueryBuilder
- Parameters:
start
- the first index- Returns:
- a reference to this object
-
pageSize
public AlertQueryBuilder pageSize(int pageSize)
Sets the page size on currentAlertQueryBuilder
- Parameters:
pageSize
- the page size for returned PageResult- Returns:
- a reference to this object
-
pagerAll
public AlertQueryBuilder pagerAll(boolean pagerAll)
Defines if all results should be displayed for currentAlertQueryBuilder
- Parameters:
pagerAll
- if true all results will be displayed- Returns:
- a reference to this object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-