Interface NotificationService
- All Superinterfaces:
com.appiancorp.services.ContextSensitiveService,Service
Notifications may be sent to users and groups, and can be configured to be sent to email or to the portal application, or both. The frequency with which notifications are sent to email, or the length of time that notifications persist in the portal application, are also configurable.
Methods of service classes can all throw the unchecked exception
ServiceException if any
system-level error (for example, server failure) occurs, and will in general
throw a checked exception (InvalidXXXException) when an entity
to be retrieved is inaccessible, instead of returning null.
All checked exceptions extend
AppianException.
All API's that use Application ID and Notification Type ID should only use
valid ID's that can be obtained by making a call to getApplications()
It may be necessary to retrieve a subset of results as opposed to an entire
collection, and also to sort the subset by some property of the returned
object. "Paging" methods which return a
ResultPage are provided in certain
instances for this purpose. The ResultPage will contain the
sorted subset of results
(via Result.getResults()), and the
total number of items in the available result set
(via ResultPage.getAvailableItems()).
It may also be necessary to retrieve some results, even if all results
cannot be retrieved (for instance, some of the entities corresponding
to a list of entity IDs may no longer exist). Methods which return a
ResultList are provided for this
purpose. The Result.getResults()
method in this case will return all results which can be retrieved. In
addition, there will be a list of result codes
(ResultList.getResultCodes()) that
represent the successful retrieval of an entity, or, if the entity could
not be retrieved, the reason for the failure. See the CODE_XXX
constants in ResultList for details.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.Fields inherited from interface com.appiancorp.services.ContextSensitiveService
SET_SERVICE_CONTEXT_METHOD_NAME -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Gets the name of the application on which this service is running.Deprecated.getApplicationsPaging(int startPosition_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Deprecated.Returns all registeredApplicationobjectsgetDefaultFormat(String name_) Deprecated.Since i18n, the notifications server no longer formats dates (the raw timestamps are sent to the JSPs), so no formats should be set on the server.Medium[]getMedia()Deprecated.usegetMediaPaging(int, int, Integer, Integer)insteadMedium[]getMediaForType(int typeId_) Deprecated.getMediaForTypePaging(int typeId_, int startPosition_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Deprecated.Gets the media to whichNotifications of the specified type can be sent.getMediaPaging(int startPosition_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Deprecated.Gets the media to whichNotifications can be sent.getNotificationCustomAttributes(int typeId_) Deprecated.getNotificationCustomAttributesPaging(int typeId_, int startPosition_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Deprecated.GetNotificationcustom attribute valuesgetTypePrefsForUser(String user_, int appId_, int typeId_) Deprecated.getTypePrefsForUserPaging(String user_, int appId_, int typeId_, int startPosition_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Deprecated.Gets the user preferences for theNotificationtypeString[]Deprecated.Gets the current memory profile for the workspace.voidvoidsaveNotificationRuleForUser(String user_, int type_, int[] media_, String[] conditions_, String[] settings_) Deprecated.Saves theNotificationrules for the given uservoidsaveNotificationRuleForUser(String user_, int type_, int[] media_, String[] conditions_, String[] settings_, List<Integer> hiddenMedia) Deprecated.voidsetDefaultFormat(String name_, String format_) Deprecated.Since i18n, the notifications server no longer formats dates (the raw timestamps are sent to the JSPs), therefore this method no longer affects the formatting.Methods inherited from interface com.appiancorp.services.ContextSensitiveService
setServiceContext
-
Field Details
-
getApplications$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getNotificationCustomAttributes$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getMedia$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getMediaForType$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getTypePrefsForUser$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
saveNotificationRuleForUser$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
notify$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getApplicationsPaging$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getNotificationCustomAttributesPaging$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getMediaPaging$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getMediaForTypePaging$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getTypePrefsForUserPaging$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getApplicationName$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getWorkspace$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getDefaultFormat$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
setDefaultFormat$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
-
Method Details
-
getApplications
Deprecated.Get all registeredApplicationobjects.- Returns:
- an array of
Applicationwith names, IDs and notification types for the application. The notification types and application names are listed inPortalNotificationService.
-
getNotificationCustomAttributes
Deprecated.Gets customAttributeobjects for specifiedNotificationtype.- Parameters:
typeId_- ID of theNotificationtype.- Returns:
- an array of
Attributeobjects, each of which contains the parameters for the specifiedNotificationtype. SeePortalNotificationService.notify(java.lang.String[], java.lang.Long[], java.lang.String, java.lang.String, java.util.Map)for the list of custom attributes per notification type. Each attribute will have itslabelfield populated with the appropriate value.
-
getMedia
Deprecated.usegetMediaPaging(int, int, Integer, Integer)insteadGets the media to whichNotifications can be sent.- Returns:
- an array of
Medium, which contains the medium name, id and options. Currently the generic options are not used. Timing is currently the only specific option, i.e. the interval of time to wait until theNotificationis sent which can be immediately, hourly, daily, weekly.
-
getMediaForType
Deprecated.Gets the media to whichNotifications of the specified type can be sent.- Parameters:
typeId_- ID of theNotificationtype- Returns:
- an array of
Medium, which contains the medium name, ID and options. Currently the generic options are not used. Timing is currently the only specific option, i.e. the interval of time to wait until the notification is sent, which can be immediately, hourly, daily, weekly.
-
getTypePrefsForUser
@Deprecated @Read(K_NOTIFY) NotificationRule[] getTypePrefsForUser(String user_, int appId_, int typeId_) Deprecated.Gets the user preferences for theNotificationtype- Parameters:
user_- the username of theUserwhose preferences are to be retrievedappId_- the ID of theApplicationof theNotificationtypetypeId_- the ID of theNotificationtype, which will be unique across applications- Returns:
NotificationRulewith theApplicationID and name, theNotificationtype ID and name, theMediumID and name, and the conditions. The "conditions" is a double array of strings, where every row is a String[3] with comparison operator id, attribute ID and value against which theAttributevalue will be compared
-
saveNotificationRuleForUser
@Write(K_NOTIFY) void saveNotificationRuleForUser(String user_, int type_, int[] media_, String[] conditions_, String[] settings_) Deprecated.Saves theNotificationrules for the given user- Parameters:
user_- the username of the usertype_- the ID of theNotificationtype.media_- the IDs of the media types. UsegetMedia()for valid types. If conditions or settings differ in length from media, then media determines the length of conditions and settings used.conditions_- Each element in the string array will be comma- separated triplets of comparison operator IDs, attribute ID, and the values to compare against. If no conditions are being set, an empty array should be passed. To see available attribute IDs and operator IDs usegetNotificationCustomAttributesPaging(int, int, int, Integer, Integer)and browse the returnedAttributeobject.settings_- the time intervals at which allNotificationwill be sent. If no time intervals are being set, an empty array should be passed. The array size depends on the number of rules (seeNotificationRule) for given notification type. Each element of an array is a string of comma separated triplet:",type,parameter". The first value is always empty. The type is one of constant values of OPTION_XXX incom.appiancorp.ap2.ns.Option. If the Notification media type is Portal the parameter specifies the number of days for the message to persist. If the Notification media type is Email the parameter specifies the timing of the email - 1: Immediate, 2: Hourly Bulk Email, 3: Daily Bulk Email, 4: Weekly Bulk Email.
-
saveNotificationRuleForUser
@Write(K_NOTIFY) void saveNotificationRuleForUser(String user_, int type_, int[] media_, String[] conditions_, String[] settings_, List<Integer> hiddenMedia) Deprecated. -
notify
@Deprecated @Write(K_NOTIFY) void notify(String[] users_, Long[] groups_, String appName_, String ntfType_, Map attributes_) throws InvalidNotificationTypeException Deprecated.Send a notification to specific users and groups- Parameters:
users_- the usernames of those to be notified. If no users are to be notified, this value should be an emptyStringarray, notnull.groups_- the groupIds of those to be notified. If no groups are to be notified, this value should be an emptyStringarray, notnull.appName_- theApplicationname of theNotification. See theXXX_NOTIFICATION_APPLICATIONconstants inPortalNotificationServicefor valid valuesntfType_- the name of theNotificationtype. See theXXX_NOTIFICATION_TYPEconstants inPortalNotificationServicefor valid valuesattributes_- the attributes of the notification. The map keys correspond toAttributelabels. For example, for thePortalNotificationService.COLLABORATION_SEND_LINK_NOTIFICATION_TYPE, a key in the attribute map would be "sender" The values of the keys are the values to be displayed in theNotification(eg. the sender's username).- Throws:
InvalidNotificationException- if theNotificationdoes not existInvalidNotificationTypeException- if an invalidNotificationtype is specified- See Also:
-
getApplicationsPaging
@Read(K_NOTIFY) ResultPage getApplicationsPaging(int startPosition_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Deprecated.Returns all registeredApplicationobjects- Parameters:
startPosition_- the index into the collection of total results at which to start. Negative numbers are treated as zeros.batchSize_- the number of results to return. UseConstants.COUNT_ALLto return the entire collection, but this is STRONGLY discouraged.sortProperty_- the property by which the results will be sorted. This is one of theSORT_BY_XXXconstants inApplication.sortOrder_- The order in which to sort the returnedApplicationobjects. This is eitherConstants.SORT_ORDER_ASCENDINGorConstants.SORT_ORDER_DESCENDING- Returns:
- a
ResultPagecontaining an array ofApplicationobjects
-
getNotificationCustomAttributesPaging
@Read(K_NOTIFY) ResultPage getNotificationCustomAttributesPaging(int typeId_, int startPosition_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Deprecated.GetNotificationcustom attribute values- Parameters:
typeId_- ID of theNotificationtype.startPosition_- the index into the collection of total results at which to start. Negative numbers are treated as zeros.batchSize_- the number of results to return. UseConstants.COUNT_ALLto return the entire collection, but this is STRONGLY discouraged.sortProperty_- the property by which the results will be sorted. This is one of theSORT_BY_XXXconstants inAttribute.sortOrder_- The order in which to sort the returnedAttributeobjects. This is eitherConstants.SORT_ORDER_ASCENDINGorConstants.SORT_ORDER_DESCENDING- Returns:
- a
ResultPagewhich contains the array ofAttributeobjects
-
getMediaPaging
@Read(K_NOTIFY) ResultPage getMediaPaging(int startPosition_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Deprecated.Gets the media to whichNotifications can be sent.- Parameters:
startPosition_- the index into the collection of total results at which to start. Negative numbers are treated as zeros.batchSize_- the number of results to return. UseConstants.COUNT_ALLto return the entire collection, but this is STRONGLY discouraged.sortProperty_- the property by which the results will be sorted. This is one of theSORT_BY_XXXconstants inMedium.sortOrder_- The order in which to sort the returnedMediumobjects. This is eitherConstants.SORT_ORDER_ASCENDINGorConstants.SORT_ORDER_DESCENDING- Returns:
- a
ResultPagewhich contains the array ofMediumobjects Currently the generic options are not used, and Timing is the only specific option, i.e. the interval of time to wait until theNotificationis sent which can be immediately, hourly, daily, weekly.
-
getMediaForTypePaging
@Read(K_NOTIFY) ResultPage getMediaForTypePaging(int typeId_, int startPosition_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Deprecated.Gets the media to whichNotifications of the specified type can be sent.- Parameters:
typeId_- ID of theNotificationtypestartPosition_- the index into the collection of total results at which to start. Negative numbers are treated as zeros.batchSize_- the number of results to return. UseConstants.COUNT_ALLto return the entire collection, but this is STRONGLY discouraged.sortProperty_- the property by which the results will be sorted. This is one of theSORT_BY_XXXconstants inMedium.sortOrder_- The order in which to sort the returnedMediumobjects. This is eitherConstants.SORT_ORDER_ASCENDINGorConstants.SORT_ORDER_DESCENDING- Returns:
- a
ResultPagewhich contains the array ofMedium, which contains the medium name, id and options. Currently the generic options are not used, and Timing is the only specific option, i.e. the interval of time to wait until theNotificationis sent which can be immediately, hourly, daily, weekly.
-
getTypePrefsForUserPaging
@Read(K_NOTIFY) ResultPage getTypePrefsForUserPaging(String user_, int appId_, int typeId_, int startPosition_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Deprecated.Gets the user preferences for theNotificationtype- Parameters:
user_- the username of the user whose preferences are to be retrievedappId_- ID of theApplicationfor theNotificationtypetypeId_- ID of theNotificationtype, which will be unique across allApplicationobjectsstartPosition_- the index into the collection of total results at which to start. Negative numbers are treated as zeros.batchSize_- the number of results to return. UseConstants.COUNT_ALLto return the entire collection, but this is STRONGLY discouraged.sortProperty_- the property by which the results will be sorted. This is one of theSORT_BY_XXXconstants inNotificationRule.sortOrder_- The order in which to sort the returnedUserPreferencesobjects. This is eitherConstants.SORT_ORDER_ASCENDINGorConstants.SORT_ORDER_DESCENDING- Returns:
- a
ResultPagecontaining an array ofNotificationRulewith theApplicationID and name, theNotificationtype ID and name, the medium ID and name, and the conditions. The conditions is a double array of strings, where every row is a String[3] with comparison operator id, attribute id and value against which theAttributevalue will be compared
-
getApplicationName
Deprecated.Gets the name of the application on which this service is running.- Returns:
- the name of the
Application
-
getWorkspace
Deprecated.Gets the current memory profile for the workspace.- Returns:
- array of Strings of length 4 describing memory usage:
- [0]Used - Memory Used by the Server so far for storage
- [1]Allocated - Memory allocated for use. Often if a large data item was allocated by a server and subsequently freed, this value will be large compared to "Used". If nearly all memory allocated is in use, this value will be close to (but always higher than) "Used"
- [2]Mapped - is the space used by memory-mapped files
- [3]Available - is the total available memory for the Server process
-
getDefaultFormat
@Deprecated @Read(K_NOTIFY) String getDefaultFormat(String name_) throws InvalidParameterException, NullPointerException Deprecated.Since i18n, the notifications server no longer formats dates (the raw timestamps are sent to the JSPs), so no formats should be set on the server.- Parameters:
name_- A string identifying the type of display format, one of: "date", "time", or "timezone".- Returns:
- Returns the display format for the given format name.
- Throws:
InvalidParameterException- if thename_is not recognizedNullPointerException- if thename_is null
-
setDefaultFormat
@Deprecated @Write(K_NOTIFY) void setDefaultFormat(String name_, String format_) throws InvalidParameterException, NullPointerException Deprecated.Since i18n, the notifications server no longer formats dates (the raw timestamps are sent to the JSPs), therefore this method no longer affects the formatting.- Parameters:
name_- A string identifying the type of display format, one of: "date", "time", or "timezone".format_- The display format to use for the given format name.- Throws:
InvalidParameterException- if thename_is not recognizedNullPointerException- if thename_orformat_is null
-