public class JSNotificationManager extends JSBaseScriptableObject
myLogger
Constructor and Description |
---|
JSNotificationManager() |
Modifier and Type | Method and Description |
---|---|
void |
jsFunction_createGlobalStickyNotification(int theEventSourceUser,
java.lang.String theMessage,
boolean theWarning,
java.lang.String theUrlToOpen,
java.lang.String theWindowTarget)
Create a text notification to be displayed in a at the top of all user's notification's bell at the top right of the interface
Example:
notificationManager.createGlobalStickyNotification(1, "Test Global Messages", true, "https://www.google.com/", "_blank");
|
void |
jsFunction_createNotification(java.lang.String theResolverUrl,
int theUserToAlert,
int theEventSourceUser,
java.lang.String theMessage,
java.lang.String theUrlToOpen,
java.lang.String theWindowTarget)
Create a notification to be displayed in a user's notification's bell at the top right of the interface
Example:
notificationManager.createNotification(resolverManager.assetsURLFromAssetIds([201659053, 201659056]), 1, 3, "Test Asset Messages", null, null);
Example 2:
notificationManager.createNotification(null, 1, 3, "Test System Message", "https://www.google.com/", "_blank");
|
void |
jsFunction_createStickyNotification(int theUserToAlert,
int theEventSourceUser,
java.lang.String theMessage,
boolean theWarning,
java.lang.String theUrlToOpen,
java.lang.String theWindowTarget)
Create a text notification to be displayed in a at the top of a user's notification's bell at the top right of the interface
Example:
notificationManager.createStickyNotification(1, 3, "Test Sticky Messages", true, "https://www.google.com/", "_blank");
|
int |
jsFunction_getCurrentPercent(int theUserId,
java.lang.String theProgressBarId)
Get the percent for a known progress ID for a user.
|
java.lang.String[] |
jsFunction_getSubscribedAlerts(int theAssetId,
int theUserId)
Returns the list of subscribed Alerts for the specified user and asset.
|
java.lang.String |
jsFunction_publishSystemAction(int theUserId,
java.lang.Object theActionMap)
Post a system action.
|
java.lang.String |
jsFunction_publishSystemMessage(int theUserId,
java.lang.String theMessage)
Post a system message that will show on a logged-in user's screen.
|
void |
jsFunction_subscribe(java.lang.String theResolverUrl,
int theUserId)
Subscribe a user to a particular set of assets for all subscribable Alerts.
|
void |
jsFunction_subscribeAlerts(java.lang.String theResolverUrl,
int theUserId,
org.mozilla.javascript.NativeArray theAlerts)
Subscribes a user to a particular set of assets, for the specified Alerts.
|
void |
jsFunction_unsubscribe(java.lang.String theResolverUrl,
int theUserId)
Unsubscribe a user to a particular set of assets
|
void |
jsFunction_updateStatus(int theUserId,
java.lang.String theProgressBarId,
java.lang.String theMessage,
int thePercent,
java.lang.String theTitle)
Create or update a progress bar for a user.
|
int |
jsGet_kCompletePercent()
The percent (100%) that signifies the notification/progress is complete.
|
java.lang.String |
jsGet_kSystemMessageTitle()
Title to use when updating status for a system message.
|
int |
jsGet_kSystemMessageUserId()
User id to use when posting a system message for all users.
|
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, get, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassName, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, has, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size
public int jsGet_kCompletePercent()
public int jsGet_kSystemMessageUserId()
public java.lang.String jsGet_kSystemMessageTitle()
public void jsFunction_updateStatus(int theUserId, java.lang.String theProgressBarId, java.lang.String theMessage, int thePercent, java.lang.String theTitle)
theUserId
- User ID this progress bar is for.theProgressBarId
- Unique progress ID for this user.theMessage
- Message for this update, may be null.thePercent
- What percent should the bar show, from 1 to 100?theTitle
- Title of the progress bar, required if creating.public int jsFunction_getCurrentPercent(int theUserId, java.lang.String theProgressBarId)
theUserId
- Whose progress bar?theProgressBarId
- The id of the bar we're looking for.public java.lang.String jsFunction_publishSystemMessage(int theUserId, java.lang.String theMessage)
theUserId
- who's it for? -2 for all users.theMessage
- What's it say?JSNotificationManager.jsGet_kSystemMessageUserId()
,
JSNotificationManager.jsGet_kSystemMessageTitle()
public java.lang.String jsFunction_publishSystemAction(int theUserId, java.lang.Object theActionMap)
theUserId
- who's it for? -2 for all users.theActionMap
- map of keys and values to pass to client-side event, including special "action" keyJSNotificationManager.jsGet_kSystemMessageUserId()
,
JSNotificationManager.jsGet_kSystemMessageTitle()
public void jsFunction_subscribe(java.lang.String theResolverUrl, int theUserId)
theResolverUrl
- see ResolverManagertheUserId
- the user id to subscribe withpublic void jsFunction_subscribeAlerts(java.lang.String theResolverUrl, int theUserId, org.mozilla.javascript.NativeArray theAlerts)
theResolverUrl
- see ResolverManager.theUserId
- the user id to subscribe with.theAlerts
- array of Alerts to subscribe to. Null/empty signifies unsubscribe from all Alerts.public java.lang.String[] jsFunction_getSubscribedAlerts(int theAssetId, int theUserId)
theAssetId
- asset id to checktheUserId
- user to check forpublic void jsFunction_unsubscribe(java.lang.String theResolverUrl, int theUserId)
theResolverUrl
- see ResolverManagertheUserId
- the user id to subscribe withpublic void jsFunction_createNotification(java.lang.String theResolverUrl, int theUserToAlert, int theEventSourceUser, java.lang.String theMessage, java.lang.String theUrlToOpen, java.lang.String theWindowTarget)
theResolverUrl
- resolver url to describe which asset the notification is associated withtheUserToAlert
- the user id of whom should see the notification, -1 for global notificationtheEventSourceUser
- the user id who generated the eventtheMessage
- the message to display to the usertheUrlToOpen
- the url to open when the notification is clicked. Leave empty or null to use the resolver to determine the click actiontheWindowTarget
- Specifies the target attribute or the name of the window. _blank, _parent, _self, or _toppublic void jsFunction_createStickyNotification(int theUserToAlert, int theEventSourceUser, java.lang.String theMessage, boolean theWarning, java.lang.String theUrlToOpen, java.lang.String theWindowTarget)
theEventSourceUser
- the user id who generated the eventtheUserToAlert
- the user id of whom should see the notification, -1 for global notificationtheMessage
- the message to display to the usertheWarning
- true to display message as warningtheUrlToOpen
- the url to open when the notification is clicked. Leave empty do do nothing on clicktheWindowTarget
- Specifies the target attribute or the name of the window. _blank, _parent, _self, or _toppublic void jsFunction_createGlobalStickyNotification(int theEventSourceUser, java.lang.String theMessage, boolean theWarning, java.lang.String theUrlToOpen, java.lang.String theWindowTarget)
theEventSourceUser
- the user id who generated the eventtheMessage
- the message to display to the usertheWarning
- true to display message as warningtheUrlToOpen
- the url to open when the notification is clicked. Leave empty to do nothing on clicktheWindowTarget
- Specifies the target attribute or the name of the window. _blank, _parent, _self, or _topCopyright © 2023 MediaBeacon, Inc. All Rights Reserved.