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
Modifier and TypeFieldDescriptionstatic final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.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 registeredApplication
objectsgetDefaultFormat
(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 whichNotification
s of the specified type can be sent.getMediaPaging
(int startPosition_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Deprecated.Gets the media to whichNotification
s can be sent.getNotificationCustomAttributes
(int typeId_) Deprecated.getNotificationCustomAttributesPaging
(int typeId_, int startPosition_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Deprecated.GetNotification
custom 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 theNotification
typeString[]
Deprecated.Gets the current memory profile for the workspace.void
void
saveNotificationRuleForUser
(String user_, int type_, int[] media_, String[] conditions_, String[] settings_) Deprecated.Saves theNotification
rules for the given uservoid
saveNotificationRuleForUser
(String user_, int type_, int[] media_, String[] conditions_, String[] settings_, List<Integer> hiddenMedia) Deprecated.void
setDefaultFormat
(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
static final boolean getApplications$UPDATESDeprecated.- See Also:
-
getNotificationCustomAttributes$UPDATES
static final boolean getNotificationCustomAttributes$UPDATESDeprecated.- See Also:
-
getMedia$UPDATES
static final boolean getMedia$UPDATESDeprecated.- See Also:
-
getMediaForType$UPDATES
static final boolean getMediaForType$UPDATESDeprecated.- See Also:
-
getTypePrefsForUser$UPDATES
static final boolean getTypePrefsForUser$UPDATESDeprecated.- See Also:
-
saveNotificationRuleForUser$UPDATES
static final boolean saveNotificationRuleForUser$UPDATESDeprecated.- See Also:
-
notify$UPDATES
static final boolean notify$UPDATESDeprecated.- See Also:
-
getApplicationsPaging$UPDATES
static final boolean getApplicationsPaging$UPDATESDeprecated.- See Also:
-
getNotificationCustomAttributesPaging$UPDATES
static final boolean getNotificationCustomAttributesPaging$UPDATESDeprecated.- See Also:
-
getMediaPaging$UPDATES
static final boolean getMediaPaging$UPDATESDeprecated.- See Also:
-
getMediaForTypePaging$UPDATES
static final boolean getMediaForTypePaging$UPDATESDeprecated.- See Also:
-
getTypePrefsForUserPaging$UPDATES
static final boolean getTypePrefsForUserPaging$UPDATESDeprecated.- See Also:
-
getApplicationName$UPDATES
static final boolean getApplicationName$UPDATESDeprecated.- See Also:
-
getWorkspace$UPDATES
static final boolean getWorkspace$UPDATESDeprecated.- See Also:
-
getDefaultFormat$UPDATES
static final boolean getDefaultFormat$UPDATESDeprecated.- See Also:
-
setDefaultFormat$UPDATES
static final boolean setDefaultFormat$UPDATESDeprecated.- See Also:
-
-
Method Details
-
getApplications
Deprecated.Get all registeredApplication
objects.- Returns:
- an array of
Application
with names, IDs and notification types for the application. The notification types and application names are listed inPortalNotificationService
. - Throws:
ServiceException
- if any system-level error occurs
-
getNotificationCustomAttributes
Deprecated.Gets customAttribute
objects for specifiedNotification
type.- Parameters:
typeId_
- ID of theNotification
type.- Returns:
- an array of
Attribute
objects, each of which contains the parameters for the specifiedNotification
type. 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 itslabel
field populated with the appropriate value. - Throws:
ServiceException
- if any system-level error occurs
-
getMedia
Deprecated.usegetMediaPaging(int, int, Integer, Integer)
insteadGets the media to whichNotification
s 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 theNotification
is sent which can be immediately, hourly, daily, weekly. - Throws:
ServiceException
- if any system-level error occurs
-
getMediaForType
Deprecated.Gets the media to whichNotification
s of the specified type can be sent.- Parameters:
typeId_
- ID of theNotification
type- 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. - Throws:
ServiceException
- if any system-level error occurs
-
getTypePrefsForUser
Deprecated.Gets the user preferences for theNotification
type- Parameters:
user_
- the username of theUser
whose preferences are to be retrievedappId_
- the ID of theApplication
of theNotification
typetypeId_
- the ID of theNotification
type, which will be unique across applications- Returns:
NotificationRule
with theApplication
ID and name, theNotification
type ID and name, theMedium
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 theAttribute
value will be compared- Throws:
ServiceException
- if any system-level error occurs
-
saveNotificationRuleForUser
void saveNotificationRuleForUser(String user_, int type_, int[] media_, String[] conditions_, String[] settings_) Deprecated.Saves theNotification
rules for the given user- Parameters:
user_
- the username of the usertype_
- the ID of theNotification
type.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 returnedAttribute
object.settings_
- the time intervals at which allNotification
will 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.- Throws:
ServiceException
- if any system-level error occurs
-
saveNotificationRuleForUser
void saveNotificationRuleForUser(String user_, int type_, int[] media_, String[] conditions_, String[] settings_, List<Integer> hiddenMedia) Deprecated. -
notify
@Deprecated 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 emptyString
array, notnull
.groups_
- the groupIds of those to be notified. If no groups are to be notified, this value should be an emptyString
array, notnull
.appName_
- theApplication
name of theNotification
. See theXXX_NOTIFICATION_APPLICATION
constants inPortalNotificationService
for valid valuesntfType_
- the name of theNotification
type. See theXXX_NOTIFICATION_TYPE
constants inPortalNotificationService
for valid valuesattributes_
- the attributes of the notification. The map keys correspond toAttribute
labels. 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 theNotification
does not existInvalidNotificationTypeException
- if an invalidNotification
type is specifiedServiceException
- if any system-level error occurs- See Also:
-
getApplicationsPaging
ResultPage getApplicationsPaging(int startPosition_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Deprecated.Returns all registeredApplication
objects- 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_ALL
to 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_XXX
constants inApplication
.sortOrder_
- The order in which to sort the returnedApplication
objects. This is eitherConstants.SORT_ORDER_ASCENDING
orConstants.SORT_ORDER_DESCENDING
- Returns:
- a
ResultPage
containing an array ofApplication
objects - Throws:
ServiceException
- if any system-level error occurs
-
getNotificationCustomAttributesPaging
ResultPage getNotificationCustomAttributesPaging(int typeId_, int startPosition_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Deprecated.GetNotification
custom attribute values- Parameters:
typeId_
- ID of theNotification
type.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_ALL
to 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_XXX
constants inAttribute
.sortOrder_
- The order in which to sort the returnedAttribute
objects. This is eitherConstants.SORT_ORDER_ASCENDING
orConstants.SORT_ORDER_DESCENDING
- Returns:
- a
ResultPage
which contains the array ofAttribute
objects - Throws:
ServiceException
- if any system-level error occurs
-
getMediaPaging
ResultPage getMediaPaging(int startPosition_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Deprecated.Gets the media to whichNotification
s 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_ALL
to 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_XXX
constants inMedium
.sortOrder_
- The order in which to sort the returnedMedium
objects. This is eitherConstants.SORT_ORDER_ASCENDING
orConstants.SORT_ORDER_DESCENDING
- Returns:
- a
ResultPage
which contains the array ofMedium
objects Currently the generic options are not used, and Timing is the only specific option, i.e. the interval of time to wait until theNotification
is sent which can be immediately, hourly, daily, weekly. - Throws:
ServiceException
- if any system-level error occurs
-
getMediaForTypePaging
ResultPage getMediaForTypePaging(int typeId_, int startPosition_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Deprecated.Gets the media to whichNotification
s of the specified type can be sent.- Parameters:
typeId_
- ID of theNotification
typestartPosition_
- 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_ALL
to 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_XXX
constants inMedium
.sortOrder_
- The order in which to sort the returnedMedium
objects. This is eitherConstants.SORT_ORDER_ASCENDING
orConstants.SORT_ORDER_DESCENDING
- Returns:
- a
ResultPage
which 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 theNotification
is sent which can be immediately, hourly, daily, weekly. - Throws:
ServiceException
- if any system-level error occurs
-
getTypePrefsForUserPaging
ResultPage getTypePrefsForUserPaging(String user_, int appId_, int typeId_, int startPosition_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Deprecated.Gets the user preferences for theNotification
type- Parameters:
user_
- the username of the user whose preferences are to be retrievedappId_
- ID of theApplication
for theNotification
typetypeId_
- ID of theNotification
type, which will be unique across allApplication
objectsstartPosition_
- 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_ALL
to 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_XXX
constants inNotificationRule
.sortOrder_
- The order in which to sort the returnedUserPreferences
objects. This is eitherConstants.SORT_ORDER_ASCENDING
orConstants.SORT_ORDER_DESCENDING
- Returns:
- a
ResultPage
containing an array ofNotificationRule
with theApplication
ID and name, theNotification
type 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 theAttribute
value will be compared - Throws:
ServiceException
- if any system-level error occurs
-
getApplicationName
String getApplicationName()Deprecated.Gets the name of the application on which this service is running.- Returns:
- the name of the
Application
- Throws:
ServiceException
- if any system-level error occurs
-
getWorkspace
String[] 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
- Throws:
ServiceException
- if any system-level error occurs
-
getDefaultFormat
@Deprecated 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 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
-