Manages dashboard alerts - short messages shown to users in an organisation, optionally targeted by group or organisation type, with a start date and a dismiss control. Reached from JS as the registered service alertsManager. Alerts can be activated for a profile, acknowledged, and queried per profile or for the whole admin dashboard; use newAlertBuilder to create a new one.
Group: Managers
Properties
| Property | Returns | Description |
|---|---|---|
| adminAlerts | List<AlertBean> | Alerts applicable to the current user in the current organisation which have not yet been acknowledged, with any merge field placeholders in the body evaluated. Returns null if building the list fails. |
| alertControls | Map<String,String> | Returns a map of alert control codes and their descriptions. |
Methods
activate(IAlert alert, Profile p) · findAlertsForProfile(Website website, Profile profile) · findAllAlertsForProfile(Website website, Profile profile) · findAlertActivationDateForProfile(IAlert alert, Profile profile) · findAlertAckDateForProfile(IAlert alert, Profile profile) · findAcknowledgedMessages(Profile profile, String forPosition) · findAlert(long id) · ackAlert(IAlert alert) · getAdminAlerts() · getAlertControls() · newAlertBuilder()
activate(IAlert alert, Profile p)
Returns: AlertAck
Activates the given alert for a profile, recording an activation AlertAck so the profile is considered to have seen it.
| Parameter | Description |
|---|---|
alert | the alert to activate, either an Alert or an AlertBean wrapping one |
p | the profile the alert is activated for |
findAlertsForProfile(Website website, Profile profile)
Returns: List<AlertBean>
Finds the alerts applicable to the given profile in the current admin organisation, excluding ones already acknowledged.
| Parameter | Description |
|---|---|
website | the website the alerts are being shown on, or null |
profile | the profile to find applicable alerts for |
findAllAlertsForProfile(Website website, Profile profile)
Returns: List<AlertBean>
Finds all alerts applicable to the given profile in the current admin organisation, including ones already acknowledged.
| Parameter | Description |
|---|---|
website | the website the alerts are being shown on, or null |
profile | the profile to find applicable alerts for |
findAlertActivationDateForProfile(IAlert alert, Profile profile)
Returns: Date
Finds when the given alert was last activated for the profile. Returns the date of the most recent activation acknowledgement if there is one, otherwise falls back to the alert's configured start date.
| Parameter | Description |
|---|---|
alert | the alert to check |
profile | the profile to check activation for |
findAlertAckDateForProfile(IAlert alert, Profile profile)
Returns: Date
Finds when the given alert was acknowledged (dismissed) by the profile.
| Parameter | Description |
|---|---|
alert | the alert to check |
profile | the profile to check acknowledgement for |
findAcknowledgedMessages(Profile profile, String forPosition)
Returns: List<AlertBean>
Finds alerts applicable to the profile in the current root folder's organisation which have already been acknowledged and are shown at the given screen position.
| Parameter | Description |
|---|---|
profile | the profile to find acknowledged alerts for, or null to return an empty list |
forPosition | the alert position to filter by, eg Alert.POS_TOP or Alert.POS_BOTTOM |
findAlert(long id)
Returns: Alert
Looks up a single alert by its ID in the current admin organisation.
| Parameter | Description |
|---|---|
id | the alert ID |
ackAlert(IAlert alert)
Returns: void
Marks an alert as acknowledged for the current user, recording an AlertAck so it will not be shown again for that user.
| Parameter | Description |
|---|---|
alert | the alert to acknowledge, either an Alert or an AlertBean wrapping one |
getAdminAlerts()
Returns: List<AlertBean>
Alerts applicable to the current user in the current organisation which have not yet been acknowledged, with any merge field placeholders in the body evaluated. Returns null if building the list fails.
getAlertControls()
Returns: Map<String,String>
Returns a map of alert control codes and their descriptions.
newAlertBuilder()
Returns: AlertBuilder
Creates a new AlertBuilder for constructing an Alert. Set properties on the builder using its fluent setter methods, then call build to save it and return the new alert.