NotificationManager Class Methods

In this section, the NotificationManager methods are described in alphabetical order.

Syntax

AddPersonalizationList(&nType, &value)

Description

Use the AddPersonalizationList method to add a permission list or role for a user. It also enables personalizations, if not enabled already.

Parameters

Parameter

Description

&nType

Specifies permission list or role.

Valid values:

  • 1 - Permission List

  • 2 - Role

&value

Specifies the permission list or role name.

Returns

None.

Example

import PTNC_UTILITY:NotificationManager;

Local object &objNotif = create PTNC_UTILITY:NotificationManager("DEMONOTIFICATION");

&objNotif.SetEventName("SENDNOTE");
&objNotif.SetDescription("Demo Notifications");
&objNotif.SetFuncCategory("Demo");
&objNotif.SetOwnerId("PT");
&objNotif.SetMandatory( True);

&objNotif.EnablePush( True);
&objNotif.EnableMail( False);
&objNotif.DisableText();

&objNotif.EnablePersonalization( True);
&objNotif.AddPersonalizationList(2, "PeopleSoft User");
&objNotif.AddPersonalizationList(1, "PTPT1200");

Local boolean &bReturn = &objNotif.Save();

Syntax

AddPersonalizationLists(&nType, &arrValue)

Description

Use the AddPersonalizationLists method to add multiple permission lists or roles for a user. It also enables personalizations, if not enabled already.

Parameters

Parameter

Description

&nType

Specifies permission list or role.

Valid values:

  • 1 - Permission list

  • 2 - Role

&arrValue

Specifies multiple permission lists or role names as an array of string.

Returns

None.

Syntax

ClearPersonalizationList()

Description

Use the ClearPersonalizationList method to clear all the personalization permission lists and roles.

Note: This operation is executed immediately and cannot be rolled back. It does not depend on the Save method.

Parameters

None.

Returns

A Boolean value; True if the personalization is cleared successfully, False otherwise.

Syntax

Delete()

Description

Use this method to delete a personalization.

Note: The delete operation is executed immediately and it cannot be rolled back.

Parameters

None.

Returns

A Boolean value; True if the delete completes successfully, False otherwise.

Syntax

DisableMail()

Description

Use this method to disable email notifications.

Parameters

None.

Returns

None.

Example

&objNotif.DisableMail();

Syntax

DisablePush()

Description

Use this method to disable In-app notifications, that is, to disable notifications that appear on the Notifications panel on PIA. It will reset the default value too.

Parameters

None.

Returns

None.

Example

&objNotif.DisablePush();

Syntax

DisableText()

Description

Use this method to disable text notifications. It will reset the default value too.

Parameters

None.

Returns

None.

Example

&objNotif.DisableText();

Syntax

EnableMail(default)

Description

Use the EnableMail method to enable mail in notifications.

Parameters

Parameter

Description

default

Specifies whether mail in notifications is available to users as default.

Returns

A Boolean value. True for mail as default; False otherwise.

Example

&objNotif.EnableMail(False);

Syntax

EnablePersonalization(&state)

Description

Use the EnablePersonalization method to activate personalizations for a user.

Parameters

Parameter

Description

&state

Specifies whether to enable personalization as a Boolean value.

Returns

A Boolean value. True to enable personalization; False otherwise.

Example

&objNotif.EnablePersonalization( True);

Syntax

EnablePush(default)

Description

Use the EnablePush method to enable In-app notifications. It will reset the default value too.

Parameters

Parameter

Description

default

Specifies whether In-app notifications are available to users as default.

Returns

A Boolean value. True if In-app notifications is the default; False otherwise.

Example

&objNotif.EnablePush(True);

Syntax

EnableText(default)

Description

Use the EnableText method to enable text notifications. It will reset the default value too.

Parameters

Parameter

Description

default

Specifies whether text notifications is available to users as default..

Returns

A Boolean value. True if text notifications is the default; False otherwise.

Example

&objNotif.EnableText(True);

Syntax

GetCategory()

Description

Use this method to retrieve the functional category of a notification.

Parameters

None.

Returns

A string containing the functional category of a notification.

Syntax

GetDescription()

Description

Use this method to retrieve the description of a notification.

Parameters

None.

Returns

A string containing the description of a notification.

Syntax

GetEventName()

Description

Use this method to retrieve the name of a notification.

Parameters

None.

Returns

A string containing the name of an event.

Example

&objNotif.GetEventName();

Syntax

GetOwnerDescr()

Description

Use the GetOwnerDescr method to retrieve the description of an owner, for example, PeopleTools for the PT owner.

Parameters

None.

Returns

A string containing the long description of the owner.

Example

&objNotif.GetOwnerDescr();

Syntax

GetOwnerId()

Description

Use the GetOwnerId method to retrieve the owner of a notification.

Parameters

None.

Returns

A string containing the owner ID.

Example

&objNotif.GetOwnerId();

Syntax

IsMailAvailable()

Description

Use this method to determine whether mail notification is available or not.

Parameters

None.

Returns

A Boolean value; True if mail notification is available, False otherwise.

Syntax

IsMailDefault()

Description

Use this method to determine whether mail notification is enabled by default for a notification or not. This method can be true only if the IsMailAvailable method is set to True.

Parameters

None.

Returns

A Boolean value; True if mail notification is enabled by default for a notification, False otherwise.

Syntax

IsMandatory()

Description

Use this method to determine whether a notification is mandatory.

Parameters

None.

Returns

A Boolean value; True if a notification is mandatory, False otherwise.

Syntax

IsNew()

Description

Use this method to determine whether a notification is new.

Parameters

None.

Returns

A Boolean value; True if a notification is new, False if a notification with the same name already exists.

Syntax

IsPersonalizationAllowed()

Description

Use the IsPersonalizationAllowed method to specify whether personalization is allowed for a user or not.

Parameters

None.

Returns

A Boolean value; True if personalization is allowed, False otherwise.

Syntax

IsPersonalized(&user)

Description

Use this method to determine whether a user has set personalizations or not.

Parameters

Parameter

Description

&user

Specifies a user as a String value.

Returns

A Boolean value; True if the user has set personalizations, False otherwise.

Syntax

IsPushAvailable()

Description

Use this method to determine whether in-app notification is available or not.

Parameters

None.

Returns

A Boolean value; True if in-app notification is available, False otherwise.

Syntax

IsPushDefault()

Description

Use this method to determine whether in-app notification is available and is set as default.

Parameters

None.

Returns

A Boolean value; True if in-app notification is available and is set as default, False otherwise.

Syntax

IsTextAvailable()

Description

Use this method to determine whether text notification is available or not.

Parameters

None.

Returns

A Boolean value; True if text notification is available, False otherwise.

Syntax

IsTextDefault()

Description

Use this method to determine whether text notification is available and is set as default. If text notification is not default, it may be available or not.

Parameters

None.

Returns

A Boolean value; True if text notification is available and is set as default, False otherwise.

Syntax

NotificationManager(Notification_name)

Description

NotificationManager is a constructor method for the NotificationManager class. Use the NotificationManager method to instantiate an instance of the class.

Parameters

Parameter

Description

Notification_name

Specifies a notification as a String value.

Syntax

RemoveFromPersonalizationList(&nType, &value)

Description

Use this method to remove permission lists or roles from personalization set for a user. The actual deletion takes place on Save.

Parameters

Parameter

Description

&nType

Specifies permission list or role.

Valid values:

  • 1 - Permission list

  • 2 - Role

&value

Specifies the name of the permission list or role.

Returns

A Boolean value. True if permission list or role is marked for deletion; False otherwise.

Example

&objNotif.RemoveFromPersonalizationList(2, "PeopleSoft User");

Syntax

ResetUserPersonalization(user)

Description

Use this method to reset the personalizations for an individual user.

Note: This operation is executed immediately and cannot be rolled back. It does not depend on the Save method.

Parameters

Parameter

Description

user

Specifies a user as a String value.

Returns

None.

Syntax

ResetUserPersonalizations()

Description

Use this method to reset personalizations for all users.

Note: This operation is executed immediately and cannot be rolled back. It does not depend on the Save method.

Parameters

None.

Returns

None.

Syntax

Save()

Description

Use the Save method to commit changes to the database.

Parameters

None.

Returns

A Boolean value; True if the Save operation is successful, False otherwise.

Example

Local boolean &bReturn = &objNotif.Save();

Syntax

SetDescription(Description)

Description

Use this method to specify the description for a notification.

Parameters

Parameter

Description

Description

Specifies the description for a notification as a string.

Returns

None.

Example

&objNotif.SetDescription("Demo Notifications");

Syntax

SetEventName(Event_Name)

Description

Use this method to set an event.

Parameters

Parameter

Description

Event_name

Specifies the name of an event as a string.

Returns

None.

Example

&objNotif.SetEventName("SENDNOTE");

Syntax

SetFuncCategory(FuncCategory)

Description

Use this method to specify a functional category for notifications.

Parameters

Parameter

Description

FuncCategory

Specifies a functional category as a string.

Returns

None.

Example

&objNotif.SetFuncCategory("Demo");

Syntax

SetMailAvailable()

Description

Use the SetMailAvailable method to set mail notification as available. This setting has no impact if the mail notification is already available.

Parameters

None.

Returns

None.

Syntax

SetMandatory(mandatory)

Description

Use this method to set a notification as mandatory.

Parameters

Parameter

Description

mandatory

Specifies whether a notification is mandatory or not as a Boolean value.

Returns

None.

Syntax

SetOwnerId(Owner_ID)

Description

Use this method to specify the owner of a notification.

Parameters

Parameter

Description

Owner_ID

Specifies the owner of a notification as a string.

Returns

None.

Example

&objNotif.SetOwnerId("PT");

Syntax

SetPushAvailable()

Description

Use the SetPushAvailable method to set in-app notification as available. This setting has no impact if the in-app notification is already available.

Parameters

None.

Returns

None.

Syntax

SetTextAvailable()

Description

Use the SetTextAvailable method to set text notification as available. This setting has no impact if the text notification is already available.

Parameters

None.

Returns

None.