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

PropertyReturnsDescription
adminAlertsList<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.
alertControlsMap<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.

ParameterDescription
alertthe alert to activate, either an Alert or an AlertBean wrapping one
pthe 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.

ParameterDescription
websitethe website the alerts are being shown on, or null
profilethe 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.

ParameterDescription
websitethe website the alerts are being shown on, or null
profilethe 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.

ParameterDescription
alertthe alert to check
profilethe profile to check activation for

findAlertAckDateForProfile(IAlert alert, Profile profile)

Returns: Date

Finds when the given alert was acknowledged (dismissed) by the profile.

ParameterDescription
alertthe alert to check
profilethe 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.

ParameterDescription
profilethe profile to find acknowledged alerts for, or null to return an empty list
forPositionthe 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.

ParameterDescription
idthe 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.

ParameterDescription
alertthe 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.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.