Fluent builder for creating a new Alert, obtained from AlertsManager.newAlertBuilder. Set the properties for the alert using the builder methods and call build to save it and return the created Alert.

Group: Builders


Methods

name(String alertName) · title(String alerTitle) · website(Website alertWebsite) · targetOrg(Organisation alertTargetOrg) · targetGroup(Group alertTargetGroup) · targetOrgType(OrgType alertTargetOrgType) · body(String alertBody) · type(String alertType) · position(String alertPosition) · allowDismiss(boolean alertAllowDismiss) · startDate(Date alertStartDate) · control(String controlName) · build()

name(String alertName)

Returns: AlertBuilder

Sets the alert's name.

ParameterDescription
alertNamethe alert's name

title(String alerTitle)

Returns: AlertBuilder

Sets the alert's title, shown above its body.

ParameterDescription
alerTitlethe alert's title

website(Website alertWebsite)

Returns: AlertBuilder

Sets the website the alert is shown on.

ParameterDescription
alertWebsitethe website to associate the alert with

targetOrg(Organisation alertTargetOrg)

Returns: AlertBuilder

Restricts the alert to profiles who belong to this organisation.

ParameterDescription
alertTargetOrgthe organisation to target

targetGroup(Group alertTargetGroup)

Returns: AlertBuilder

Restricts the alert to profiles who belong to this group.

ParameterDescription
alertTargetGroupthe group to target

targetOrgType(OrgType alertTargetOrgType)

Returns: AlertBuilder

Restricts the alert to people who belong to an organisation of this type. ANDs with targetGroup and targetOrg.

ParameterDescription
alertTargetOrgTypethe organisation type to target

body(String alertBody)

Returns: AlertBuilder

Sets the alert's body text, which may contain merge field placeholders evaluated when the alert is displayed.

ParameterDescription
alertBodythe alert's body text

type(String alertType)

Returns: AlertBuilder

Sets the alert's visual style. Ignored if the given value is not one of the recognised types.

ParameterDescription
alertTypethe alert type - one of warning, info, primary, danger, success or modal popup

position(String alertPosition)

Returns: AlertBuilder

Sets where the alert is displayed on the page. Ignored if the given value is not one of the recognised positions.

ParameterDescription
alertPositionthe alert position - top or bottom

allowDismiss(boolean alertAllowDismiss)

Returns: AlertBuilder

If true, users can dismiss the alert; if false, it stays visible while active.

ParameterDescription
alertAllowDismisswhether users may dismiss the alert

startDate(Date alertStartDate)

Returns: AlertBuilder

Sets the date from which the alert becomes active.

ParameterDescription
alertStartDatethe alert's start date

control(String controlName)

Returns: AlertBuilder

Sets the control code for this alert, looked up by name.

ParameterDescription
controlNamethe name of the control to use

build()

Returns: Alert

Saves the alert to the current admin organisation using the properties set on this builder, and returns the persisted alert.

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