Constructors
| Name | Type | Description |
|---|---|---|
message |
string |
optional
message |
title |
string |
optional
notification title |
type |
string |
optional
notification type |
action |
otris.ScriptReturn |
optional
Add a click action for the notification |
sticky |
boolean |
optional
Remove notification only if closed or clicked (otris.notifications.NotificationDefaults.sticky) |
- Since:
- Documents 5.0d
Examples
// #import "Notification_API"
var loginName = "schreiber";
var notification = new otris.notifications.Notification("Just a test... " + (new Date()).toISOString(), "My title");
notification.publish(loginName);
// #import "Notification_API"
// Create a progress notification
var loginName = "schreiber";
var notification = new otris.notifications.Notification("My custom message", "My custom title");
// Set the type to "progress"
notification.setType("progress");
// Set the current progress as a value between 0 and 100. see setProgressValue() for details
notification.setProgressValue(10);
// All progress notification concerning the same task must have the same referenceId
notification.setReferenceId("myCustomProgress007");
notification.publish(loginName);
Methods
-
publish(user)
-
Publish the notification to the given user(s)
Name Type Description userstring | SystemUser | Array.<string> | Array.<SystemUser> recipients
-
setAction(action)
-
Set the click action of the notification
Name Type Description actionotris.ScriptReturn notification onclick action
-
setMessage(message)
-
Set the notification message
Name Type Description messagestring message
-
setOnloadAction(onloadAction)
-
Set the onload action of the notification
Name Type Description onloadActionotris.ScriptReturn notification onload action
-
setProducer(user)
-
Set the user who produced the notification (e.g. the author of a file message)
Defaults to the current system userName Type Description userSystemUser optional system user
- Since:
- Documents 5.0d HF2
-
setProgressValue(progressValue)
-
Set the current progress value for a long running task. Set a value between 0 and 100.
A value over 100 means the task is done and was successful.
A negative value indicates that the task failed.
The notification type must be set toprogress.
It is also necessary to set areferenceIdas a identifier for the task.Name Type Description progressValueNumber current progress
- Since:
- Documents 5.0e
-
setReferenceId(referenceId)
-
Set a referenceId for the notification
Name Type Description referenceIdstring reference id
-
setRemoveOnAction(removeOnAction)
-
Remove the notification if action is executed
Name Type Description removeOnActionboolean remove on action flag
-
setSticky(sticky)
-
Remove notification only if closed or clicked (otris.notifications.NotificationDefaults.sticky)
Name Type Description stickyboolean sticky flag
-
setTimeout(timeout)
-
Set the timeout for this notification
Name Type Description timeoutnumber notification timeout
-
setTitle(title)
-
Set the notification title
Name Type Description titlestring notification title
-
setType(type)
-
Set the type of the notification
Name Type Description typestring notification type