@ThingworxExtensionApiClass(since={7,4}, canInstantiate=true) public class NotificationUtilities extends java.lang.Object
Constructor and Description |
---|
NotificationUtilities() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
replaceEventTokensInString(java.lang.String content,
InfoTable event,
java.lang.String languages)
Replaces the tokens for event data in a notification content string with the actual values from an event. |
static java.lang.String |
replaceTokensInString(java.lang.String content,
InfoTable event,
InfoTable user,
IServiceProvider serviceProvider,
java.lang.String languages)
Replaces the tokens in a notification content string with the actual values from an event, user or service. |
@ThingworxExtensionApiMethod(since={7,4}) public static java.lang.String replaceEventTokensInString(java.lang.String content, InfoTable event, java.lang.String languages) throws java.lang.Exception
content
- The content where the tokens should be replaced.event
- The InfoTable representing the Event triggering the notification (based on the Event datashape).languages
- The languages to localize to (in order of preference, comma-delimited).java.lang.Exception
- If there are circular dependencies in nested localization tokens.@ThingworxExtensionApiMethod(since={8,0}) public static java.lang.String replaceTokensInString(java.lang.String content, InfoTable event, InfoTable user, IServiceProvider serviceProvider, java.lang.String languages) throws java.lang.Exception
content
- The content where the tokens should be replaced.event
- The InfoTable representing the Event triggering the notification (based on the Event datashape).user
- The InfoTable representing the User recipient of the notification.serviceProvider
- The service provider defining services to resolve service tokens.languages
- The languages to localize to (in order of preference, comma-delimited).java.lang.Exception
- If there are circular dependencies in nested localization tokens.